Browse Source

Update documentation

Timothy J. Warren 10 months ago
parent
commit
960d7f5051
70 changed files with 25898 additions and 1043 deletions
  1. 202
    157
      API.md
  2. 0
    1
      README.md
  3. 303
    150
      docs/assets/anchor.js
  4. 1
    0
      docs/assets/bass.css
  5. 0
    93
      docs/assets/fonts/source-code-pro/LICENSE.txt
  6. 0
    20
      docs/assets/fonts/source-code-pro/README.md
  7. BIN
      docs/assets/fonts/source-code-pro/WOFF/OTF/SourceCodePro-Regular.otf.woff
  8. 0
    15
      docs/assets/fonts/source-code-pro/source-code-pro.css
  9. 0
    93
      docs/assets/fonts/source-sans-pro/LICENSE.txt
  10. 0
    20
      docs/assets/fonts/source-sans-pro/README.md
  11. BIN
      docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Bold.otf.woff
  12. BIN
      docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Light.otf.woff
  13. BIN
      docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Regular.otf.woff
  14. BIN
      docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Semibold.otf.woff
  15. 0
    17
      docs/assets/fonts/source-sans-pro/bower.json
  16. 0
    31
      docs/assets/fonts/source-sans-pro/source-sans-pro.css
  17. 118
    58
      docs/assets/site.js
  18. 15
    0
      docs/assets/split.css
  19. 586
    0
      docs/assets/split.js
  20. 4
    0
      docs/assets/style.css
  21. 594
    388
      docs/index.html
  22. 99
    0
      documentation/Adapter.js.html
  23. 220
    0
      documentation/Helpers.js.html
  24. 333
    0
      documentation/NodeQuery.html
  25. 131
    0
      documentation/NodeQuery.js.html
  26. 8096
    0
      documentation/QueryBuilder.html
  27. 708
    0
      documentation/QueryBuilder.js.html
  28. 298
    0
      documentation/QueryParser.js.html
  29. 464
    0
      documentation/Result.html
  30. 144
    0
      documentation/Result.js.html
  31. 100
    0
      documentation/adapters_Mysql_mysql2.js.html
  32. 154
    0
      documentation/adapters_Pg_Pg.js.html
  33. 116
    0
      documentation/adapters_Sqlite_dblite.js.html
  34. 112
    0
      documentation/adapters_Sqlite_sqlite3.js.html
  35. 65
    0
      documentation/drivers_MSSQLDriver.js.html
  36. 57
    0
      documentation/drivers_MariaDB.js.html
  37. 82
    0
      documentation/drivers_Mysql.js.html
  38. 60
    0
      documentation/drivers_Pg.js.html
  39. 111
    0
      documentation/drivers_Sqlite.js.html
  40. BIN
      documentation/fonts/OpenSans-Bold-webfont.eot
  41. 1830
    0
      documentation/fonts/OpenSans-Bold-webfont.svg
  42. BIN
      documentation/fonts/OpenSans-Bold-webfont.woff
  43. BIN
      documentation/fonts/OpenSans-BoldItalic-webfont.eot
  44. 1830
    0
      documentation/fonts/OpenSans-BoldItalic-webfont.svg
  45. BIN
      documentation/fonts/OpenSans-BoldItalic-webfont.woff
  46. BIN
      documentation/fonts/OpenSans-Italic-webfont.eot
  47. 1830
    0
      documentation/fonts/OpenSans-Italic-webfont.svg
  48. BIN
      documentation/fonts/OpenSans-Italic-webfont.woff
  49. BIN
      documentation/fonts/OpenSans-Light-webfont.eot
  50. 1831
    0
      documentation/fonts/OpenSans-Light-webfont.svg
  51. BIN
      documentation/fonts/OpenSans-Light-webfont.woff
  52. BIN
      documentation/fonts/OpenSans-LightItalic-webfont.eot
  53. 1835
    0
      documentation/fonts/OpenSans-LightItalic-webfont.svg
  54. BIN
      documentation/fonts/OpenSans-LightItalic-webfont.woff
  55. BIN
      documentation/fonts/OpenSans-Regular-webfont.eot
  56. 1831
    0
      documentation/fonts/OpenSans-Regular-webfont.svg
  57. BIN
      documentation/fonts/OpenSans-Regular-webfont.woff
  58. 65
    0
      documentation/index.html
  59. 163
    0
      documentation/module-drivers_MSSQLDriver.html
  60. 163
    0
      documentation/module-drivers_MariaDB.html
  61. 163
    0
      documentation/module-drivers_Mysql.html
  62. 163
    0
      documentation/module-drivers_Pg.html
  63. 163
    0
      documentation/module-drivers_Sqlite.html
  64. 25
    0
      documentation/scripts/linenumber.js
  65. 202
    0
      documentation/scripts/prettify/Apache-License-2.0.txt
  66. 2
    0
      documentation/scripts/prettify/lang-css.js
  67. 28
    0
      documentation/scripts/prettify/prettify.js
  68. 358
    0
      documentation/styles/jsdoc-default.css
  69. 111
    0
      documentation/styles/prettify-jsdoc.css
  70. 132
    0
      documentation/styles/prettify-tomorrow.css

+ 202
- 157
API.md View File

@@ -1,49 +1,71 @@
1 1
 <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
2 2
 
3
-# NodeQuery
3
+### Table of Contents
4
+
5
+-   [NodeQuery](#nodequery)
6
+    -   [getQuery](#getquery)
7
+-   [QueryBuilder](#querybuilder)
8
+    -   [queryFile](#queryfile)
9
+    -   [query](#query)
10
+    -   [resetQuery](#resetquery)
11
+    -   [truncate](#truncate)
12
+    -   [end](#end)
13
+    -   [select](#select)
14
+    -   [from](#from)
15
+    -   [like](#like)
16
+    -   [notLike](#notlike)
17
+    -   [orLike](#orlike)
18
+    -   [orNotLike](#ornotlike)
19
+    -   [having](#having)
20
+    -   [orHaving](#orhaving)
21
+    -   [where](#where)
22
+    -   [orWhere](#orwhere)
23
+    -   [whereIsNull](#whereisnull)
24
+    -   [whereIsNotNull](#whereisnotnull)
25
+    -   [orWhereIsNull](#orwhereisnull)
26
+    -   [orWhereIsNotNull](#orwhereisnotnull)
27
+    -   [whereIn](#wherein)
28
+    -   [orWhereIn](#orwherein)
29
+    -   [whereNotIn](#wherenotin)
30
+    -   [orWhereNotIn](#orwherenotin)
31
+    -   [set](#set)
32
+    -   [join](#join)
33
+    -   [groupBy](#groupby)
34
+    -   [orderBy](#orderby)
35
+    -   [limit](#limit)
36
+    -   [groupStart](#groupstart)
37
+    -   [orGroupStart](#orgroupstart)
38
+    -   [orNotGroupStart](#ornotgroupstart)
39
+    -   [groupEnd](#groupend)
40
+    -   [get](#get)
41
+    -   [insert](#insert)
42
+    -   [insertBatch](#insertbatch)
43
+    -   [update](#update)
44
+    -   [updateBatch](#updatebatch)
45
+    -   [delete](#delete)
46
+    -   [getCompiledSelect](#getcompiledselect)
47
+    -   [getCompiledInsert](#getcompiledinsert)
48
+    -   [getCompiledUpdate](#getcompiledupdate)
49
+    -   [getCompiledDelete](#getcompileddelete)
50
+-   [Result](#result)
51
+    -   [rowCount](#rowcount)
52
+    -   [columnCount](#columncount)
53
+
54
+## NodeQuery
4 55
 
5 56
 Class for connection management
6 57
 
7 58
 **Parameters**
8 59
 
9
--   `config` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** connection parameters
60
+-   `config` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** connection parameters
10 61
 
11
-## constructor
12
-
13
-Constructor
14
-
15
-**Parameters**
16
-
17
--   `config` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** connection parameters
18
-
19
-**Examples**
20
-
21
-```javascript
22
-let nodeQuery = require('ci-node-query')({
23
-	driver: 'mysql',
24
-	connection: {
25
-		host: 'localhost',
26
-		user: 'root',
27
-		password: '',
28
-		database: 'mysql'
29
-	}
30
-});
31
-```
32
-
33
-```javascript
34
-let nodeQuery = require('ci-node-query')({
35
-	driver: 'sqlite',
36
-	connection: ':memory:'
37
-});
38
-```
39
-
40
-## getQuery
62
+### getQuery
41 63
 
42 64
 Return an existing query builder instance
43 65
 
44 66
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object
45 67
 
46
-# QueryBuilder
68
+## QueryBuilder
47 69
 
48 70
 **Extends QueryBuilderBase**
49 71
 
@@ -54,46 +76,57 @@ Main object that builds SQL queries.
54 76
 -   `Driver` **Driver** The syntax driver for the database
55 77
 -   `Adapter` **Adapter** The database module adapter for running queries
56 78
 
57
-## query
79
+### queryFile
80
+
81
+Run a set of queries from a file
82
+
83
+**Parameters**
84
+
85
+-   `file` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The path to the sql file
86
+-   `separator` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The character separating each query (optional, default `';'`)
87
+
88
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** The result of all the queries
89
+
90
+### query
58 91
 
59 92
 Run an arbitrary sql query. Run as a prepared statement.
60 93
 
61 94
 **Parameters**
62 95
 
63
--   `sql` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The sql to execute
64
--   `params` **\[[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)]** The query parameters
96
+-   `sql` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The sql to execute
97
+-   `params` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)?** The query parameters
65 98
 
66
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** Promise with result of query
99
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** Promise with result of query
67 100
 
68
-## resetQuery
101
+### resetQuery
69 102
 
70 103
 Reset the object state for a new query
71 104
 
72 105
 Returns **void** 
73 106
 
74
-## truncate
107
+### truncate
75 108
 
76 109
 Empties the selected database table
77 110
 
78 111
 **Parameters**
79 112
 
80
--   `table` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to truncate
113
+-   `table` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to truncate
81 114
 
82
-Returns **(void | [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise))** Returns a promise if no callback is supplied
115
+Returns **(void | [Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise))** Returns a promise if no callback is supplied
83 116
 
84
-## end
117
+### end
85 118
 
86 119
 Closes the database connection for the current adapter
87 120
 
88 121
 Returns **void** 
89 122
 
90
-## select
123
+### select
91 124
 
92 125
 Specify rows to select in the query
93 126
 
94 127
 **Parameters**
95 128
 
96
--   `fields` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array))** The fields to select from the current table
129
+-   `fields` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** The fields to select from the current table
97 130
 
98 131
 **Examples**
99 132
 
@@ -107,13 +140,13 @@ query.select(['foo', 'bar']); // Select multiple fileds with an array
107 140
 
108 141
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
109 142
 
110
-## from
143
+### from
111 144
 
112 145
 Specify the database table to select from
113 146
 
114 147
 **Parameters**
115 148
 
116
--   `tableName` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to use for the current query
149
+-   `tableName` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to use for the current query
117 150
 
118 151
 **Examples**
119 152
 
@@ -127,190 +160,190 @@ query.from('tableName t'); // Select the table with an alias
127 160
 
128 161
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
129 162
 
130
-## like
163
+### like
131 164
 
132 165
 Add a 'like/ and like' clause to the query
133 166
 
134 167
 **Parameters**
135 168
 
136
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
137
--   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
138
--   `pos` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
169
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
170
+-   `val` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
171
+-   `pos` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
139 172
 
140 173
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
141 174
 
142
-## notLike
175
+### notLike
143 176
 
144 177
 Add a 'not like/ and not like' clause to the query
145 178
 
146 179
 **Parameters**
147 180
 
148
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
149
--   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
150
--   `pos` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
181
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
182
+-   `val` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
183
+-   `pos` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
151 184
 
152 185
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
153 186
 
154
-## orLike
187
+### orLike
155 188
 
156 189
 Add an 'or like' clause to the query
157 190
 
158 191
 **Parameters**
159 192
 
160
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
161
--   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
162
--   `pos` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
193
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
194
+-   `val` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
195
+-   `pos` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
163 196
 
164 197
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
165 198
 
166
-## orNotLike
199
+### orNotLike
167 200
 
168 201
 Add an 'or not like' clause to the query
169 202
 
170 203
 **Parameters**
171 204
 
172
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
173
--   `val` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
174
--   `pos` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
205
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field  to compare to
206
+-   `val` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The value to compare to
207
+-   `pos` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The placement of the wildcard character(s): before, after, or both (optional, default `both`)
175 208
 
176 209
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
177 210
 
178
-## having
211
+### having
179 212
 
180 213
 Add a 'having' clause
181 214
 
182 215
 **Parameters**
183 216
 
184
--   `key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
185
--   `val` **\[([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))]** The value to compare if the value of key is a string
217
+-   `key` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
218
+-   `val` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))?** The value to compare if the value of key is a string (optional, default `null`)
186 219
 
187 220
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
188 221
 
189
-## orHaving
222
+### orHaving
190 223
 
191 224
 Add an 'or having' clause
192 225
 
193 226
 **Parameters**
194 227
 
195
--   `key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
196
--   `val` **\[([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))]** The value to compare if the value of key is a string
228
+-   `key` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
229
+-   `val` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))?** The value to compare if the value of key is a string (optional, default `null`)
197 230
 
198 231
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
199 232
 
200
-## where
233
+### where
201 234
 
202 235
 Set a 'where' clause
203 236
 
204 237
 **Parameters**
205 238
 
206
--   `key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
207
--   `val` **\[([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))]** The value to compare if the value of key is a string
239
+-   `key` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
240
+-   `val` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))?** The value to compare if the value of key is a string
208 241
 
209 242
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
210 243
 
211
-## orWhere
244
+### orWhere
212 245
 
213 246
 Set a 'or where' clause
214 247
 
215 248
 **Parameters**
216 249
 
217
--   `key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
218
--   `val` **\[([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number))]** The value to compare if the value of key is a string
250
+-   `key` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The name of the field and the comparision operator, or an object
251
+-   `val` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number))?** The value to compare if the value of key is a string
219 252
 
220 253
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
221 254
 
222
-## whereIsNull
255
+### whereIsNull
223 256
 
224 257
 Select a field that is Null
225 258
 
226 259
 **Parameters**
227 260
 
228
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field that has a NULL value
261
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field that has a NULL value
229 262
 
230 263
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
231 264
 
232
-## whereIsNotNull
265
+### whereIsNotNull
233 266
 
234 267
 Specify that a field IS NOT NULL
235 268
 
236 269
 **Parameters**
237 270
 
238
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name so the field that is not to be null
271
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name so the field that is not to be null
239 272
 
240 273
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
241 274
 
242
-## orWhereIsNull
275
+### orWhereIsNull
243 276
 
244 277
 Field is null prefixed with 'OR'
245 278
 
246 279
 **Parameters**
247 280
 
248
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field
281
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field
249 282
 
250 283
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
251 284
 
252
-## orWhereIsNotNull
285
+### orWhereIsNotNull
253 286
 
254 287
 Field is not null prefixed with 'OR'
255 288
 
256 289
 **Parameters**
257 290
 
258
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field
291
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of the field
259 292
 
260 293
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
261 294
 
262
-## whereIn
295
+### whereIn
263 296
 
264 297
 Set a 'where in' clause
265 298
 
266 299
 **Parameters**
267 300
 
268
--   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
269
--   `values` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
301
+-   `key` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
302
+-   `values` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
270 303
 
271 304
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
272 305
 
273
-## orWhereIn
306
+### orWhereIn
274 307
 
275 308
 Set a 'or where in' clause
276 309
 
277 310
 **Parameters**
278 311
 
279
--   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
280
--   `values` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
312
+-   `key` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
313
+-   `values` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
281 314
 
282 315
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
283 316
 
284
-## whereNotIn
317
+### whereNotIn
285 318
 
286 319
 Set a 'where not in' clause
287 320
 
288 321
 **Parameters**
289 322
 
290
--   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
291
--   `values` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
323
+-   `key` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
324
+-   `values` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
292 325
 
293 326
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
294 327
 
295
-## orWhereNotIn
328
+### orWhereNotIn
296 329
 
297 330
 Set a 'or where not in' clause
298 331
 
299 332
 **Parameters**
300 333
 
301
--   `key` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
302
--   `values` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
334
+-   `key` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the field to search
335
+-   `values` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the array of items to search in
303 336
 
304 337
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
305 338
 
306
-## set
339
+### set
307 340
 
308 341
 Set values for insertion or updating
309 342
 
310 343
 **Parameters**
311 344
 
312
--   `key` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** The key or object to use
313
--   `val` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The value if using a scalar key
345
+-   `key` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** The key or object to use
346
+-   `val` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The value if using a scalar key
314 347
 
315 348
 **Examples**
316 349
 
@@ -324,85 +357,85 @@ query.set({foo:'bar'}); // Set with an object
324 357
 
325 358
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
326 359
 
327
-## join
360
+### join
328 361
 
329 362
 Add a join clause to the query
330 363
 
331 364
 **Parameters**
332 365
 
333
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table you are joining
334
--   `cond` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The join condition.
335
--   `type` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The type of join, which defaults to inner (optional, default `'inner'`)
366
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table you are joining
367
+-   `cond` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The join condition.
368
+-   `type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The type of join, which defaults to inner (optional, default `'inner'`)
336 369
 
337 370
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
338 371
 
339
-## groupBy
372
+### groupBy
340 373
 
341 374
 Group the results by the selected field(s)
342 375
 
343 376
 **Parameters**
344 377
 
345
--   `field` **([String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array))** The name of the field to group by
378
+-   `field` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array))** The name of the field to group by
346 379
 
347 380
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
348 381
 
349
-## orderBy
382
+### orderBy
350 383
 
351 384
 Order the results by the selected field(s)
352 385
 
353 386
 **Parameters**
354 387
 
355
--   `field` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The field(s) to order by
356
--   `type` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The order direction, ASC or DESC (optional, default `'ASC'`)
388
+-   `field` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The field(s) to order by
389
+-   `type` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The order direction, ASC or DESC (optional, default `'ASC'`)
357 390
 
358 391
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
359 392
 
360
-## limit
393
+### limit
361 394
 
362 395
 Put a limit on the query
363 396
 
364 397
 **Parameters**
365 398
 
366
--   `limit` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum number of rows to fetch
367
--   `offset` **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** The row number to start from
399
+-   `limit` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum number of rows to fetch
400
+-   `offset` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** The row number to start from
368 401
 
369 402
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
370 403
 
371
-## groupStart
404
+### groupStart
372 405
 
373 406
 Adds an open paren to the current query for logical grouping
374 407
 
375 408
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
376 409
 
377
-## orGroupStart
410
+### orGroupStart
378 411
 
379 412
 Adds an open paren to the current query for logical grouping,
380 413
 prefixed with 'OR'
381 414
 
382 415
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
383 416
 
384
-## orNotGroupStart
417
+### orNotGroupStart
385 418
 
386 419
 Adds an open paren to the current query for logical grouping,
387 420
 prefixed with 'OR NOT'
388 421
 
389 422
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
390 423
 
391
-## groupEnd
424
+### groupEnd
392 425
 
393 426
 Ends a logical grouping started with one of the groupStart methods
394 427
 
395 428
 Returns **[QueryBuilder](#querybuilder)** The Query Builder object, for chaining
396 429
 
397
-## get
430
+### get
398 431
 
399 432
 Get the results of the compiled query
400 433
 
401 434
 **Parameters**
402 435
 
403
--   `table` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** The table to select from
404
--   `limit` **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** A limit for the query
405
--   `offset` **\[[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)]** An offset for the query
436
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** The table to select from
437
+-   `limit` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** A limit for the query
438
+-   `offset` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)?** An offset for the query
406 439
 
407 440
 **Examples**
408 441
 
@@ -418,27 +451,27 @@ query.get('table_name', 5); // Get 5 rows from the table
418 451
 query.get(); // Get the results of a query generated with other methods
419 452
 ```
420 453
 
421
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
454
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
422 455
 
423
-## insert
456
+### insert
424 457
 
425 458
 Run the generated insert query
426 459
 
427 460
 **Parameters**
428 461
 
429
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
430
--   `data` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Data to insert, if not already added with the 'set' method
462
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
463
+-   `data` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Data to insert, if not already added with the 'set' method
431 464
 
432
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
465
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
433 466
 
434
-## insertBatch
467
+### insertBatch
435 468
 
436 469
 Insert multiple sets of rows at a time
437 470
 
438 471
 **Parameters**
439 472
 
440
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
441
--   `data` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** The array of objects containing data rows to insert
473
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
474
+-   `data` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** The array of objects containing data rows to insert
442 475
 
443 476
 **Examples**
444 477
 
@@ -447,91 +480,103 @@ query.insertBatch('foo',[{id:1,val:'bar'},{id:2,val:'baz'}])
447 480
 .then(promiseCallback);
448 481
 ```
449 482
 
450
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
483
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
451 484
 
452
-## update
485
+### update
453 486
 
454 487
 Run the generated update query
455 488
 
456 489
 **Parameters**
457 490
 
458
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
459
--   `data` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Data to insert, if not already added with the 'set' method
491
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
492
+-   `data` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Data to insert, if not already added with the 'set' method
493
+
494
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
495
+
496
+### updateBatch
497
+
498
+Creates a batch update sql statement
499
+
500
+**Parameters**
501
+
502
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to update
503
+-   `data` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Batch insert data
504
+-   `updateKey` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The field in the table to compare against for updating
460 505
 
461
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
506
+Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Number of rows updated
462 507
 
463
-## delete
508
+### delete
464 509
 
465 510
 Run the generated delete query
466 511
 
467 512
 **Parameters**
468 513
 
469
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
470
--   `where` **\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)]** Where clause for delete statement
514
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The table to insert into
515
+-   `where` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Where clause for delete statement
471 516
 
472
-Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
517
+Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Result](#result)>** Promise containing the result of the query
473 518
 
474
-## getCompiledSelect
519
+### getCompiledSelect
475 520
 
476 521
 Return generated select query SQL
477 522
 
478 523
 **Parameters**
479 524
 
480
--   `table` **\[[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** the name of the table to retrieve from
481
--   `reset` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Whether to reset the query builder so another query can be built (optional, default `true`)
525
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** the name of the table to retrieve from
526
+-   `reset` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether to reset the query builder so another query can be built (optional, default `true`)
482 527
 
483
-Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
528
+Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
484 529
 
485
-## getCompiledInsert
530
+### getCompiledInsert
486 531
 
487 532
 Return generated insert query SQL
488 533
 
489 534
 **Parameters**
490 535
 
491
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to insert into
492
--   `reset` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Whether to reset the query builder so another query can be built (optional, default `true`)
536
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to insert into
537
+-   `reset` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether to reset the query builder so another query can be built (optional, default `true`)
493 538
 
494
-Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
539
+Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
495 540
 
496
-## getCompiledUpdate
541
+### getCompiledUpdate
497 542
 
498 543
 Return generated update query SQL
499 544
 
500 545
 **Parameters**
501 546
 
502
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to update
503
--   `reset` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Whether to reset the query builder so another query can be built (optional, default `true`)
547
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to update
548
+-   `reset` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether to reset the query builder so another query can be built (optional, default `true`)
504 549
 
505
-Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
550
+Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
506 551
 
507
-## getCompiledDelete
552
+### getCompiledDelete
508 553
 
509 554
 Return generated delete query SQL
510 555
 
511 556
 **Parameters**
512 557
 
513
--   `table` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to delete from
514
--   `reset` **\[[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)]** Whether to reset the query builder so another query can be built (optional, default `true`)
558
+-   `table` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** the name of the table to delete from
559
+-   `reset` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Whether to reset the query builder so another query can be built (optional, default `true`)
515 560
 
516
-Returns **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
561
+Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The compiled sql statement
517 562
 
518
-# Result
563
+## Result
519 564
 
520 565
 Query result object
521 566
 
522 567
 **Parameters**
523 568
 
524
--   `rows` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the data rows of the result
525
--   `columns` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** the column names in the result
569
+-   `rows` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the data rows of the result (optional, default `[]`)
570
+-   `columns` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** the column names in the result (optional, default `[]`)
526 571
 
527
-## rowCount
572
+### rowCount
528 573
 
529 574
 Get the number of rows returned by the query
530 575
 
531
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of rows in the result
576
+Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of rows in the result
532 577
 
533
-## columnCount
578
+### columnCount
534 579
 
535 580
 Get the number of columns returned by the query
536 581
 
537
-Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of columns in the result
582
+Returns **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of columns in the result

+ 0
- 1
README.md View File

@@ -9,7 +9,6 @@ A node query builder for various SQL databases, based on [CodeIgniter](http://ww
9 9
 
10 10
 ### Supported databases
11 11
 
12
-* Firebird (via `node-firebird`)
13 12
 * Mysql (via `mysql2`)
14 13
 * PostgreSQL (via `pg`)
15 14
 * Sqlite (via `dblite`)

+ 303
- 150
docs/assets/anchor.js View File

@@ -1,197 +1,350 @@
1 1
 /*!
2
- * AnchorJS - v1.2.1 - 2015-07-02
2
+ * AnchorJS - v4.0.0 - 2017-06-02
3 3
  * https://github.com/bryanbraun/anchorjs
4
- * Copyright (c) 2015 Bryan Braun; Licensed MIT
4
+ * Copyright (c) 2017 Bryan Braun; Licensed MIT
5 5
  */
6
+/* eslint-env amd, node */
6 7
 
7
-function AnchorJS(options) {
8
+// https://github.com/umdjs/umd/blob/master/templates/returnExports.js
9
+(function(root, factory) {
8 10
   'use strict';
11
+  if (typeof define === 'function' && define.amd) {
12
+    // AMD. Register as an anonymous module.
13
+    define([], factory);
14
+  } else if (typeof module === 'object' && module.exports) {
15
+    // Node. Does not work with strict CommonJS, but
16
+    // only CommonJS-like environments that support module.exports,
17
+    // like Node.
18
+    module.exports = factory();
19
+  } else {
20
+    // Browser globals (root is window)
21
+    root.AnchorJS = factory();
22
+    root.anchors = new root.AnchorJS();
23
+  }
24
+})(this, function() {
25
+  'use strict';
26
+  function AnchorJS(options) {
27
+    this.options = options || {};
28
+    this.elements = [];
9 29
 
10
-  this.options = options || {};
30
+    /**
31
+     * Assigns options to the internal options object, and provides defaults.
32
+     * @param {Object} opts - Options object
33
+     */
34
+    function _applyRemainingDefaultOptions(opts) {
35
+      opts.icon = opts.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like  '#', '¶', '❡', or '§'.
36
+      opts.visible = opts.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' & 'touch'
37
+      opts.placement = opts.hasOwnProperty('placement')
38
+        ? opts.placement
39
+        : 'right'; // Also accepts 'left'
40
+      opts.class = opts.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name.
41
+      // Using Math.floor here will ensure the value is Number-cast and an integer.
42
+      opts.truncate = opts.hasOwnProperty('truncate')
43
+        ? Math.floor(opts.truncate)
44
+        : 64; // Accepts any value that can be typecast to a number.
45
+    }
11 46
 
12
-  this._applyRemainingDefaultOptions = function(opts) {
13
-    this.options.icon = this.options.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like  '#', '¶', '❡', or '§'.
14
-    this.options.visible = this.options.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always'
15
-    this.options.placement = this.options.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left'
16
-    this.options.class = this.options.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name.
17
-  };
47
+    _applyRemainingDefaultOptions(this.options);
18 48
 
19
-  this._applyRemainingDefaultOptions(options);
49
+    /**
50
+     * Checks to see if this device supports touch. Uses criteria pulled from Modernizr:
51
+     * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40
52
+     * @returns {Boolean} - true if the current device supports touch.
53
+     */
54
+    this.isTouchDevice = function() {
55
+      return !!(
56
+        'ontouchstart' in window ||
57
+        (window.DocumentTouch && document instanceof DocumentTouch)
58
+      );
59
+    };
20 60
 
21
-  this.add = function(selector) {
22
-    var elements,
61
+    /**
62
+     * Add anchor links to page elements.
63
+     * @param  {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links
64
+     *                                            to. Also accepts an array or nodeList containing the relavant elements.
65
+     * @returns {this}                           - The AnchorJS object
66
+     */
67
+    this.add = function(selector) {
68
+      var elements,
23 69
         elsWithIds,
24 70
         idList,
25 71
         elementID,
26 72
         i,
27
-        roughText,
28
-        tidyText,
29 73
         index,
30 74
         count,
75
+        tidyText,
31 76
         newTidyText,
32 77
         readableID,
33
-        anchor;
78
+        anchor,
79
+        visibleOptionToUse,
80
+        indexesToDrop = [];
34 81
 
35
-    this._applyRemainingDefaultOptions(this.options);
82
+      // We reapply options here because somebody may have overwritten the default options object when setting options.
83
+      // For example, this overwrites all options but visible:
84
+      //
85
+      // anchors.options = { visible: 'always'; }
86
+      _applyRemainingDefaultOptions(this.options);
36 87
 
37
-    // Provide a sensible default selector, if none is given.
38
-    if (!selector) {
39
-      selector = 'h1, h2, h3, h4, h5, h6';
40
-    } else if (typeof selector !== 'string') {
41
-      throw new Error('The selector provided to AnchorJS was invalid.');
42
-    }
88
+      visibleOptionToUse = this.options.visible;
89
+      if (visibleOptionToUse === 'touch') {
90
+        visibleOptionToUse = this.isTouchDevice() ? 'always' : 'hover';
91
+      }
43 92
 
44
-    elements = document.querySelectorAll(selector);
45
-    if (elements.length === 0) {
46
-      return false;
47
-    }
93
+      // Provide a sensible default selector, if none is given.
94
+      if (!selector) {
95
+        selector = 'h2, h3, h4, h5, h6';
96
+      }
48 97
 
49
-    this._addBaselineStyles();
98
+      elements = _getElements(selector);
50 99
 
51
-    // We produce a list of existing IDs so we don't generate a duplicate.
52
-    elsWithIds = document.querySelectorAll('[id]');
53
-    idList = [].map.call(elsWithIds, function assign(el) {
54
-      return el.id;
55
-    });
100
+      if (elements.length === 0) {
101
+        return this;
102
+      }
56 103
 
57
-    for (i = 0; i < elements.length; i++) {
104
+      _addBaselineStyles();
58 105
 
59
-      if (elements[i].hasAttribute('id')) {
60
-        elementID = elements[i].getAttribute('id');
61
-      } else {
62
-        roughText = elements[i].textContent;
63
-
64
-        // Refine it so it makes a good ID. Strip out non-safe characters, replace
65
-        // spaces with hyphens, truncate to 32 characters, and make toLowerCase.
66
-        //
67
-        // Example string:                                // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.'
68
-        tidyText = roughText.replace(/[^\w\s-]/gi, '')    // ' Unicode icons are cool--but they definitely dont belong in a URL fragment'
69
-                                .replace(/\s+/g, '-')     // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment'
70
-                                .replace(/-{2,}/g, '-')   // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment'
71
-                                .substring(0, 64)         // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
72
-                                .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL'
73
-                                .toLowerCase();           // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url'
74
-
75
-        // Compare our generated ID to existing IDs (and increment it if needed)
76
-        // before we add it to the page.
77
-        newTidyText = tidyText;
78
-        count = 0;
79
-        do {
80
-          if (index !== undefined) {
81
-            newTidyText = tidyText + '-' + count;
106
+      // We produce a list of existing IDs so we don't generate a duplicate.
107
+      elsWithIds = document.querySelectorAll('[id]');
108
+      idList = [].map.call(elsWithIds, function assign(el) {
109
+        return el.id;
110
+      });
111
+
112
+      for (i = 0; i < elements.length; i++) {
113
+        if (this.hasAnchorJSLink(elements[i])) {
114
+          indexesToDrop.push(i);
115
+          continue;
116
+        }
117
+
118
+        if (elements[i].hasAttribute('id')) {
119
+          elementID = elements[i].getAttribute('id');
120
+        } else if (elements[i].hasAttribute('data-anchor-id')) {
121
+          elementID = elements[i].getAttribute('data-anchor-id');
122
+        } else {
123
+          tidyText = this.urlify(elements[i].textContent);
124
+
125
+          // Compare our generated ID to existing IDs (and increment it if needed)
126
+          // before we add it to the page.
127
+          newTidyText = tidyText;
128
+          count = 0;
129
+          do {
130
+            if (index !== undefined) {
131
+              newTidyText = tidyText + '-' + count;
132
+            }
133
+
134
+            index = idList.indexOf(newTidyText);
135
+            count += 1;
136
+          } while (index !== -1);
137
+          index = undefined;
138
+          idList.push(newTidyText);
139
+
140
+          elements[i].setAttribute('id', newTidyText);
141
+          elementID = newTidyText;
142
+        }
143
+
144
+        readableID = elementID.replace(/-/g, ' ');
145
+
146
+        // The following code builds the following DOM structure in a more effiecient (albeit opaque) way.
147
+        // '<a class="anchorjs-link ' + this.options.class + '" href="#' + elementID + '" aria-label="Anchor link for: ' + readableID + '" data-anchorjs-icon="' + this.options.icon + '"></a>';
148
+        anchor = document.createElement('a');
149
+        anchor.className = 'anchorjs-link ' + this.options.class;
150
+        anchor.href = '#' + elementID;
151
+        anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID);
152
+        anchor.setAttribute('data-anchorjs-icon', this.options.icon);
153
+
154
+        if (visibleOptionToUse === 'always') {
155
+          anchor.style.opacity = '1';
156
+        }
157
+
158
+        if (this.options.icon === '\ue9cb') {
159
+          anchor.style.font = '1em/1 anchorjs-icons';
160
+
161
+          // We set lineHeight = 1 here because the `anchorjs-icons` font family could otherwise affect the
162
+          // height of the heading. This isn't the case for icons with `placement: left`, so we restore
163
+          // line-height: inherit in that case, ensuring they remain positioned correctly. For more info,
164
+          // see https://github.com/bryanbraun/anchorjs/issues/39.
165
+          if (this.options.placement === 'left') {
166
+            anchor.style.lineHeight = 'inherit';
82 167
           }
83
-          // .indexOf is supported in IE9+.
84
-          index = idList.indexOf(newTidyText);
85
-          count += 1;
86
-        } while (index !== -1);
87
-        index = undefined;
88
-        idList.push(newTidyText);
89
-
90
-        // Assign it to our element.
91
-        // Currently the setAttribute element is only supported in IE9 and above.
92
-        elements[i].setAttribute('id', newTidyText);
93
-
94
-        elementID = newTidyText;
168
+        }
169
+
170
+        if (this.options.placement === 'left') {
171
+          anchor.style.position = 'absolute';
172
+          anchor.style.marginLeft = '-1em';
173
+          anchor.style.paddingRight = '0.5em';
174
+          elements[i].insertBefore(anchor, elements[i].firstChild);
175
+        } else {
176
+          // if the option provided is `right` (or anything else).
177
+          anchor.style.paddingLeft = '0.375em';
178
+          elements[i].appendChild(anchor);
179
+        }
95 180
       }
96 181
 
97
-      readableID = elementID.replace(/-/g, ' ');
182
+      for (i = 0; i < indexesToDrop.length; i++) {
183
+        elements.splice(indexesToDrop[i] - i, 1);
184
+      }
185
+      this.elements = this.elements.concat(elements);
98 186
 
99
-      // The following code builds the following DOM structure in a more effiecient (albeit opaque) way.
100
-      // '<a class="anchorjs-link ' + this.options.class + '" href="#' + elementID + '" aria-label="Anchor link for: ' + readableID + '" data-anchorjs-icon="' + this.options.icon + '"></a>';
101
-      anchor = document.createElement('a');
102
-      anchor.className = 'anchorjs-link ' + this.options.class;
103
-      anchor.href = '#' + elementID;
104
-      anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID);
105
-      anchor.setAttribute('data-anchorjs-icon', this.options.icon);
187
+      return this;
188
+    };
106 189
 
107
-      if (this.options.visible === 'always') {
108
-        anchor.style.opacity = '1';
109
-      }
190
+    /**
191
+     * Removes all anchorjs-links from elements targed by the selector.
192
+     * @param  {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links,
193
+     *                                            OR a nodeList / array containing the DOM elements.
194
+     * @returns {this}                           - The AnchorJS object
195
+     */
196
+    this.remove = function(selector) {
197
+      var index,
198
+        domAnchor,
199
+        elements = _getElements(selector);
110 200
 
111
-      if (this.options.icon === '\ue9cb') {
112
-        anchor.style.fontFamily = 'anchorjs-icons';
113
-        anchor.style.fontStyle = 'normal';
114
-        anchor.style.fontVariant = 'normal';
115
-        anchor.style.fontWeight = 'normal';
116
-        anchor.style.lineHeight = 1;
201
+      for (var i = 0; i < elements.length; i++) {
202
+        domAnchor = elements[i].querySelector('.anchorjs-link');
203
+        if (domAnchor) {
204
+          // Drop the element from our main list, if it's in there.
205
+          index = this.elements.indexOf(elements[i]);
206
+          if (index !== -1) {
207
+            this.elements.splice(index, 1);
208
+          }
209
+          // Remove the anchor from the DOM.
210
+          elements[i].removeChild(domAnchor);
211
+        }
117 212
       }
213
+      return this;
214
+    };
118 215
 
119
-      if (this.options.placement === 'left') {
120
-        anchor.style.position = 'absolute';
121
-        anchor.style.marginLeft = '-1em';
122
-        anchor.style.paddingRight = '0.5em';
123
-        elements[i].insertBefore(anchor, elements[i].firstChild);
124
-      } else { // if the option provided is `right` (or anything else).
125
-        anchor.style.paddingLeft = '0.375em';
126
-        elements[i].appendChild(anchor);
216
+    /**
217
+     * Removes all anchorjs links. Mostly used for tests.
218
+     */
219
+    this.removeAll = function() {
220
+      this.remove(this.elements);
221
+    };
222
+
223
+    /**
224
+     * Urlify - Refine text so it makes a good ID.
225
+     *
226
+     * To do this, we remove apostrophes, replace nonsafe characters with hyphens,
227
+     * remove extra hyphens, truncate, trim hyphens, and make lowercase.
228
+     *
229
+     * @param  {String} text - Any text. Usually pulled from the webpage element we are linking to.
230
+     * @returns {String}      - hyphen-delimited text for use in IDs and URLs.
231
+     */
232
+    this.urlify = function(text) {
233
+      // Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\
234
+      var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g,
235
+        urlText;
236
+
237
+      // The reason we include this _applyRemainingDefaultOptions is so urlify can be called independently,
238
+      // even after setting options. This can be useful for tests or other applications.
239
+      if (!this.options.truncate) {
240
+        _applyRemainingDefaultOptions(this.options);
127 241
       }
128
-    }
129 242
 
130
-    return this;
131
-  };
243
+      // Note: we trim hyphens after truncating because truncating can cause dangling hyphens.
244
+      // Example string:                                  // " ⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
245
+      urlText = text
246
+        .trim() // "⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
247
+        .replace(/\'/gi, '') // "⚡⚡ Dont forget: URL fragments should be i18n-friendly, hyphenated, short, and clean."
248
+        .replace(nonsafeChars, '-') // "⚡⚡-Dont-forget--URL-fragments-should-be-i18n-friendly--hyphenated--short--and-clean-"
249
+        .replace(/-{2,}/g, '-') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-short-and-clean-"
250
+        .substring(0, this.options.truncate) // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-"
251
+        .replace(/^-+|-+$/gm, '') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated"
252
+        .toLowerCase(); // "⚡⚡-dont-forget-url-fragments-should-be-i18n-friendly-hyphenated"
253
+
254
+      return urlText;
255
+    };
256
+
257
+    /**
258
+     * Determines if this element already has an AnchorJS link on it.
259
+     * Uses this technique: http://stackoverflow.com/a/5898748/1154642
260
+     * @param    {HTMLElemnt}  el - a DOM node
261
+     * @returns   {Boolean}     true/false
262
+     */
263
+    this.hasAnchorJSLink = function(el) {
264
+      var hasLeftAnchor =
265
+        el.firstChild &&
266
+        (' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1,
267
+        hasRightAnchor =
268
+          el.lastChild &&
269
+          (' ' + el.lastChild.className + ' ').indexOf(' anchorjs-link ') > -1;
132 270
 
133
-  this.remove = function(selector) {
134
-    var domAnchor,
135
-        elements = document.querySelectorAll(selector);
136
-    for (var i = 0; i < elements.length; i++) {
137
-      domAnchor = elements[i].querySelector('.anchorjs-link');
138
-      if (domAnchor) {
139
-        elements[i].removeChild(domAnchor);
271
+      return hasLeftAnchor || hasRightAnchor || false;
272
+    };
273
+
274
+    /**
275
+     * Turns a selector, nodeList, or array of elements into an array of elements (so we can use array methods).
276
+     * It also throws errors on any other inputs. Used to handle inputs to .add and .remove.
277
+     * @param  {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links,
278
+     *                                         OR a nodeList / array containing the DOM elements.
279
+     * @returns {Array} - An array containing the elements we want.
280
+     */
281
+    function _getElements(input) {
282
+      var elements;
283
+      if (typeof input === 'string' || input instanceof String) {
284
+        // See https://davidwalsh.name/nodelist-array for the technique transforming nodeList -> Array.
285
+        elements = [].slice.call(document.querySelectorAll(input));
286
+        // I checked the 'input instanceof NodeList' test in IE9 and modern browsers and it worked for me.
287
+      } else if (Array.isArray(input) || input instanceof NodeList) {
288
+        elements = [].slice.call(input);
289
+      } else {
290
+        throw new Error('The selector provided to AnchorJS was invalid.');
140 291
       }
292
+      return elements;
141 293
     }
142
-    return this;
143
-  };
144 294
 
145
-  this._addBaselineStyles = function() {
146
-    // We don't want to add global baseline styles if they've been added before.
147
-    if (document.head.querySelector('style.anchorjs') !== null) {
148
-      return;
149
-    }
295
+    /**
296
+     * _addBaselineStyles
297
+     * Adds baseline styles to the page, used by all AnchorJS links irregardless of configuration.
298
+     */
299
+    function _addBaselineStyles() {
300
+      // We don't want to add global baseline styles if they've been added before.
301
+      if (document.head.querySelector('style.anchorjs') !== null) {
302
+        return;
303
+      }
150 304
 
151
-    var style = document.createElement('style'),
305
+      var style = document.createElement('style'),
152 306
         linkRule =
153
-        ' .anchorjs-link {'                       +
154
-        '   opacity: 0;'                          +
155
-        '   text-decoration: none;'               +
156
-        '   -webkit-font-smoothing: antialiased;' +
157
-        '   -moz-osx-font-smoothing: grayscale;'  +
158
-        ' }',
307
+          ' .anchorjs-link {' +
308
+          '   opacity: 0;' +
309
+          '   text-decoration: none;' +
310
+          '   -webkit-font-smoothing: antialiased;' +
311
+          '   -moz-osx-font-smoothing: grayscale;' +
312
+          ' }',
159 313
         hoverRule =
160
-        ' *:hover > .anchorjs-link,'              +
161
-        ' .anchorjs-link:focus  {'                +
162
-        '   opacity: 1;'                          +
163
-        ' }',
314
+          ' *:hover > .anchorjs-link,' +
315
+          ' .anchorjs-link:focus  {' +
316
+          '   opacity: 1;' +
317
+          ' }',
164 318
         anchorjsLinkFontFace =
165
-        ' @font-face {'                           +
166
-        '   font-family: "anchorjs-icons";'       +
167
-        '   font-style: normal;'                  +
168
-        '   font-weight: normal;'                 + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
169
-        '   src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' +
170
-        ' }',
319
+          ' @font-face {' +
320
+          '   font-family: "anchorjs-icons";' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above
321
+          '   src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype");' +
322
+          ' }',
171 323
         pseudoElContent =
172
-        ' [data-anchorjs-icon]::after {'          +
173
-        '   content: attr(data-anchorjs-icon);'   +
174
-        ' }',
324
+          ' [data-anchorjs-icon]::after {' +
325
+          '   content: attr(data-anchorjs-icon);' +
326
+          ' }',
175 327
         firstStyleEl;
176 328
 
177
-    style.className = 'anchorjs';
178
-    style.appendChild(document.createTextNode('')); // Necessary for Webkit.
179
-
180
-    // We place it in the head with the other style tags, if possible, so as to
181
-    // not look out of place. We insert before the others so these styles can be
182
-    // overridden if necessary.
183
-    firstStyleEl = document.head.querySelector('[rel="stylesheet"], style');
184
-    if (firstStyleEl === undefined) {
185
-      document.head.appendChild(style);
186
-    } else {
187
-      document.head.insertBefore(style, firstStyleEl);
188
-    }
329
+      style.className = 'anchorjs';
330
+      style.appendChild(document.createTextNode('')); // Necessary for Webkit.
189 331
 
190
-    style.sheet.insertRule(linkRule, style.sheet.cssRules.length);
191
-    style.sheet.insertRule(hoverRule, style.sheet.cssRules.length);
192
-    style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length);
193
-    style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length);
194
-  };
195
-}
332
+      // We place it in the head with the other style tags, if possible, so as to
333
+      // not look out of place. We insert before the others so these styles can be
334
+      // overridden if necessary.
335
+      firstStyleEl = document.head.querySelector('[rel="stylesheet"], style');
336
+      if (firstStyleEl === undefined) {
337
+        document.head.appendChild(style);
338
+      } else {
339
+        document.head.insertBefore(style, firstStyleEl);
340
+      }
341
+
342
+      style.sheet.insertRule(linkRule, style.sheet.cssRules.length);
343
+      style.sheet.insertRule(hoverRule, style.sheet.cssRules.length);
344
+      style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length);
345
+      style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length);
346
+    }
347
+  }
196 348
 
197
-var anchors = new AnchorJS();
349
+  return AnchorJS;
350
+});

+ 1
- 0
docs/assets/bass.css View File

@@ -457,6 +457,7 @@
457 457
   min-height:0;
458 458
 }
459 459
 .flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none }
460
+.fs0{ flex-shrink: 0 }
460 461
 
461 462
 .order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 }
462 463
 .order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 }

+ 0
- 93
docs/assets/fonts/source-code-pro/LICENSE.txt View File

@@ -1,93 +0,0 @@
1
-Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
2
-
3
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
-
5
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
6
-
7
-
8
------------------------------------------------------------
9
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
------------------------------------------------------------
11
-
12
-PREAMBLE
13
-The goals of the Open Font License (OFL) are to stimulate worldwide
14
-development of collaborative font projects, to support the font creation
15
-efforts of academic and linguistic communities, and to provide a free and
16
-open framework in which fonts may be shared and improved in partnership
17
-with others.
18
-
19
-The OFL allows the licensed fonts to be used, studied, modified and
20
-redistributed freely as long as they are not sold by themselves. The
21
-fonts, including any derivative works, can be bundled, embedded, 
22
-redistributed and/or sold with any software provided that any reserved
23
-names are not used by derivative works. The fonts and derivatives,
24
-however, cannot be released under any other type of license. The
25
-requirement for fonts to remain under this license does not apply
26
-to any document created using the fonts or their derivatives.
27
-
28
-DEFINITIONS
29
-"Font Software" refers to the set of files released by the Copyright
30
-Holder(s) under this license and clearly marked as such. This may
31
-include source files, build scripts and documentation.
32
-
33
-"Reserved Font Name" refers to any names specified as such after the
34
-copyright statement(s).
35
-
36
-"Original Version" refers to the collection of Font Software components as
37
-distributed by the Copyright Holder(s).
38
-
39
-"Modified Version" refers to any derivative made by adding to, deleting,
40
-or substituting -- in part or in whole -- any of the components of the
41
-Original Version, by changing formats or by porting the Font Software to a
42
-new environment.
43
-
44
-"Author" refers to any designer, engineer, programmer, technical
45
-writer or other person who contributed to the Font Software.
46
-
47
-PERMISSION & CONDITIONS
48
-Permission is hereby granted, free of charge, to any person obtaining
49
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
-redistribute, and sell modified and unmodified copies of the Font
51
-Software, subject to the following conditions:
52
-
53
-1) Neither the Font Software nor any of its individual components,
54
-in Original or Modified Versions, may be sold by itself.
55
-
56
-2) Original or Modified Versions of the Font Software may be bundled,
57
-redistributed and/or sold with any software, provided that each copy
58
-contains the above copyright notice and this license. These can be
59
-included either as stand-alone text files, human-readable headers or
60
-in the appropriate machine-readable metadata fields within text or
61
-binary files as long as those fields can be easily viewed by the user.
62
-
63
-3) No Modified Version of the Font Software may use the Reserved Font
64
-Name(s) unless explicit written permission is granted by the corresponding
65
-Copyright Holder. This restriction only applies to the primary font name as
66
-presented to the users.
67
-
68
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
-Software shall not be used to promote, endorse or advertise any
70
-Modified Version, except to acknowledge the contribution(s) of the
71
-Copyright Holder(s) and the Author(s) or with their explicit written
72
-permission.
73
-
74
-5) The Font Software, modified or unmodified, in part or in whole,
75
-must be distributed entirely under this license, and must not be
76
-distributed under any other license. The requirement for fonts to
77
-remain under this license does not apply to any document created
78
-using the Font Software.
79
-
80
-TERMINATION
81
-This license becomes null and void if any of the above conditions are
82
-not met.
83
-
84
-DISCLAIMER
85
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
-OTHER DEALINGS IN THE FONT SOFTWARE.

+ 0
- 20
docs/assets/fonts/source-code-pro/README.md View File

@@ -1,20 +0,0 @@
1
-# Source Code Pro
2
-
3
-Source Code Pro is a set of OpenType fonts that have been designed to work well
4
-in user interface (UI) environments. In addition to a functional OpenType font, this open
5
-source project provides all of the source files that were used to build this OpenType font
6
-by using the AFDKO makeotf tool.
7
-
8
-## Font installation instructions
9
-
10
-* [Mac OS X](http://support.apple.com/kb/HT2509)
11
-* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
12
-* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)
13
-
14
-## Getting Involved
15
-
16
-Send suggestions for changes to the Source Code OpenType font project maintainer, [Paul D. Hunt](mailto:opensourcefonts@adobe.com?subject=[GitHub] Source Code Pro), for consideration.
17
-
18
-## Further information
19
-
20
-For information about the design and background of Source Code, please refer to the [official font readme file](http://www.adobe.com/products/type/font-information/source-code-pro-readme.html).

BIN
docs/assets/fonts/source-code-pro/WOFF/OTF/SourceCodePro-Regular.otf.woff View File


+ 0
- 15
docs/assets/fonts/source-code-pro/source-code-pro.css View File

@@ -1,15 +0,0 @@
1
-@font-face{
2
-    font-family: 'Source Code Pro';
3
-    font-weight: 400;
4
-    font-style: normal;
5
-    font-stretch: normal;
6
-    src: url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff');
7
-}
8
-
9
-@font-face{
10
-    font-family: 'Source Code Pro';
11
-    font-weight: 500;
12
-    font-style: normal;
13
-    font-stretch: normal;
14
-    src: url('WOFF/OTF/SourceCodePro-Medium.otf.woff') format('woff');
15
-}

+ 0
- 93
docs/assets/fonts/source-sans-pro/LICENSE.txt View File

@@ -1,93 +0,0 @@
1
-Copyright 2010, 2012, 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
2
-
3
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
-
5
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
6
-
7
-
8
------------------------------------------------------------
9
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
------------------------------------------------------------
11
-
12
-PREAMBLE
13
-The goals of the Open Font License (OFL) are to stimulate worldwide
14
-development of collaborative font projects, to support the font creation
15
-efforts of academic and linguistic communities, and to provide a free and
16
-open framework in which fonts may be shared and improved in partnership
17
-with others.
18
-
19
-The OFL allows the licensed fonts to be used, studied, modified and
20
-redistributed freely as long as they are not sold by themselves. The
21
-fonts, including any derivative works, can be bundled, embedded, 
22
-redistributed and/or sold with any software provided that any reserved
23
-names are not used by derivative works. The fonts and derivatives,
24
-however, cannot be released under any other type of license. The
25
-requirement for fonts to remain under this license does not apply
26
-to any document created using the fonts or their derivatives.
27
-
28
-DEFINITIONS
29
-"Font Software" refers to the set of files released by the Copyright
30
-Holder(s) under this license and clearly marked as such. This may
31
-include source files, build scripts and documentation.
32
-
33
-"Reserved Font Name" refers to any names specified as such after the
34
-copyright statement(s).
35
-
36
-"Original Version" refers to the collection of Font Software components as
37
-distributed by the Copyright Holder(s).
38
-
39
-"Modified Version" refers to any derivative made by adding to, deleting,
40
-or substituting -- in part or in whole -- any of the components of the
41
-Original Version, by changing formats or by porting the Font Software to a
42
-new environment.
43
-
44
-"Author" refers to any designer, engineer, programmer, technical
45
-writer or other person who contributed to the Font Software.
46
-
47
-PERMISSION & CONDITIONS
48
-Permission is hereby granted, free of charge, to any person obtaining
49
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
-redistribute, and sell modified and unmodified copies of the Font
51
-Software, subject to the following conditions:
52
-
53
-1) Neither the Font Software nor any of its individual components,
54
-in Original or Modified Versions, may be sold by itself.
55
-
56
-2) Original or Modified Versions of the Font Software may be bundled,
57
-redistributed and/or sold with any software, provided that each copy
58
-contains the above copyright notice and this license. These can be
59
-included either as stand-alone text files, human-readable headers or
60
-in the appropriate machine-readable metadata fields within text or
61
-binary files as long as those fields can be easily viewed by the user.
62
-
63
-3) No Modified Version of the Font Software may use the Reserved Font
64
-Name(s) unless explicit written permission is granted by the corresponding
65
-Copyright Holder. This restriction only applies to the primary font name as
66
-presented to the users.
67
-
68
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
-Software shall not be used to promote, endorse or advertise any
70
-Modified Version, except to acknowledge the contribution(s) of the
71
-Copyright Holder(s) and the Author(s) or with their explicit written
72
-permission.
73
-
74
-5) The Font Software, modified or unmodified, in part or in whole,
75
-must be distributed entirely under this license, and must not be
76
-distributed under any other license. The requirement for fonts to
77
-remain under this license does not apply to any document created
78
-using the Font Software.
79
-
80
-TERMINATION
81
-This license becomes null and void if any of the above conditions are
82
-not met.
83
-
84
-DISCLAIMER
85
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
-OTHER DEALINGS IN THE FONT SOFTWARE.

+ 0
- 20
docs/assets/fonts/source-sans-pro/README.md View File

@@ -1,20 +0,0 @@
1
-# Source Sans Pro
2
-
3
-Source Sans Pro is a set of OpenType fonts that have been designed to work well
4
-in user interface (UI) environments. In addition to a functional OpenType font, this open
5
-source project provides all of the source files that were used to build this OpenType font
6
-by using the AFDKO makeotf tool.
7
-
8
-## Font installation instructions
9
-
10
-* [Mac OS X](http://support.apple.com/kb/HT2509)
11
-* [Windows](http://windows.microsoft.com/en-us/windows-vista/install-or-uninstall-fonts)
12
-* [Linux/Unix-based systems](https://github.com/adobe-fonts/source-code-pro/issues/17#issuecomment-8967116)
13
-
14
-## Getting Involved
15
-
16
-Send suggestions for changes to the Source Sans OpenType font project maintainer, [Paul D. Hunt](mailto:opensourcefonts@adobe.com?subject=[GitHub] Source Sans Pro), for consideration.
17
-
18
-## Further information
19
-
20
-For information about the design and background of Source Sans, please refer to the [official font readme file](http://www.adobe.com/products/type/font-information/source-sans-pro-readme.html).

BIN
docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Bold.otf.woff View File


BIN
docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Light.otf.woff View File


BIN
docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Regular.otf.woff View File


BIN
docs/assets/fonts/source-sans-pro/WOFF/OTF/SourceSansPro-Semibold.otf.woff View File


+ 0
- 17
docs/assets/fonts/source-sans-pro/bower.json View File

@@ -1,17 +0,0 @@
1
-{
2
-  "name": "source-sans-pro",
3
-  "version": "2.020R-ro/1.075R-it",
4
-  "main": "source-sans-pro.css",
5
-  "homepage": "https://github.com/adobe-fonts/source-sans-pro",
6
-  "repository": {
7
-    "type": "git",
8
-    "url": "https://github.com/adobe-fonts/source-sans-pro.git"
9
-  },
10
-  "authors": [
11
-    { "name": "Paul D. Hunt" }
12
-  ],
13
-  "description": "Source Sans Pro font family by Adobe",
14
-  "license": "SIL OFL 1.1",
15
-  "keywords": ["font", "sourcesans", "sourcesanspro", "source sans", "source sans pro"],
16
-  "ignore": ["**/.*"]
17
-}

+ 0
- 31
docs/assets/fonts/source-sans-pro/source-sans-pro.css View File

@@ -1,31 +0,0 @@
1
-@font-face{
2
-    font-family: 'Source Sans Pro';
3
-    font-weight: 300;
4
-    font-style: normal;
5
-    font-stretch: normal;
6
-    src: url('WOFF/OTF/SourceSansPro-Light.otf.woff') format('woff');
7
-}
8
-
9
-@font-face{
10
-    font-family: 'Source Sans Pro';
11
-    font-weight: 400;
12
-    font-style: normal;
13
-    font-stretch: normal;
14
-    src: url('WOFF/OTF/SourceSansPro-Regular.otf.woff') format('woff');
15
-}
16
-
17
-@font-face{
18
-    font-family: 'Source Sans Pro';
19
-    font-weight: 600;
20
-    font-style: normal;
21
-    font-stretch: normal;
22
-    src: url('WOFF/OTF/SourceSansPro-Semibold.otf.woff') format('woff');
23
-}
24
-
25
-@font-face{
26
-    font-family: 'Source Sans Pro';
27
-    font-weight: 700;
28
-    font-style: normal;
29
-    font-stretch: normal;
30
-    src: url('WOFF/OTF/SourceSansPro-Bold.otf.woff') format('woff');
31
-}

+ 118
- 58
docs/assets/site.js View File

@@ -5,65 +5,46 @@ anchors.options.placement = 'left';
5 5
 anchors.add('h3');
6 6
 
7 7
 // Filter UI
8
-var tocElements = document.getElementById('toc')
9
-  .getElementsByTagName('li');
10
-
11
-document.getElementById('filter-input')
12
-  .addEventListener('keyup', function (e) {
13
-
14
-    var i, element, children;
15
-
16
-    // enter key
17
-    if (e.keyCode === 13) {
18
-      // go to the first displayed item in the toc
19
-      for (i = 0; i < tocElements.length; i++) {
20
-        element = tocElements[i];
21
-        if (!element.classList.contains('display-none')) {
22
-          location.replace(element.firstChild.href);
23
-          return e.preventDefault();
24
-        }
25
-      }
26
-    }
27
-
28
-    var match = function () {
29
-      return true;
30
-    };
31
-
32
-    var value = this.value.toLowerCase();
8
+var tocElements = document.getElementById('toc').getElementsByTagName('li');
33 9
 
34
-    if (!value.match(/^\s*$/)) {
35
-      match = function (element) {
36
-        return element.firstChild.innerHTML.toLowerCase().indexOf(value) !== -1;
37
-      };
38
-    }
10
+document.getElementById('filter-input').addEventListener('keyup', function(e) {
11
+  var i, element, children;
39 12
 
13
+  // enter key
14
+  if (e.keyCode === 13) {
15
+    // go to the first displayed item in the toc
40 16
     for (i = 0; i < tocElements.length; i++) {
41 17
       element = tocElements[i];
42
-      children = Array.from(element.getElementsByTagName('li'));
43
-      if (match(element) || children.some(match)) {
44
-        element.classList.remove('display-none');
45
-      } else {
46
-        element.classList.add('display-none');
18
+      if (!element.classList.contains('display-none')) {
19
+        location.replace(element.firstChild.href);
20
+        return e.preventDefault();
47 21
       }
48 22
     }
49
-  });
23
+  }
50 24
 
51
-var toggles = document.getElementsByClassName('toggle-step-sibling');
52
-for (var i = 0; i < toggles.length; i++) {
53
-  toggles[i].addEventListener('click', toggleStepSibling);
54
-}
25
+  var match = function() {
26
+    return true;
27
+  };
55 28
 
56
-function toggleStepSibling() {
57
-  var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName('toggle-target')[0];
58
-  var klass = 'display-none';
59
-  if (stepSibling.classList.contains(klass)) {
60
-    stepSibling.classList.remove(klass);
61
-    stepSibling.innerHTML = '▾';
62
-  } else {
63
-    stepSibling.classList.add(klass);
64
-    stepSibling.innerHTML = '▸';
29
+  var value = this.value.toLowerCase();
30
+
31
+  if (!value.match(/^\s*$/)) {
32
+    match = function(element) {
33
+      var html = element.firstChild.innerHTML;
34
+      return html && html.toLowerCase().indexOf(value) !== -1;
35
+    };
65 36
   }
66
-}
37
+
38
+  for (i = 0; i < tocElements.length; i++) {
39
+    element = tocElements[i];
40
+    children = Array.from(element.getElementsByTagName('li'));
41
+    if (match(element) || children.some(match)) {
42
+      element.classList.remove('display-none');
43
+    } else {
44
+      element.classList.add('display-none');
45
+    }
46
+  }
47
+});
67 48
 
68 49
 var items = document.getElementsByClassName('toggle-sibling');
69 50
 for (var j = 0; j < items.length; j++) {
@@ -84,19 +65,36 @@ function toggleSibling() {
84 65
 }
85 66
 
86 67
 function showHashTarget(targetId) {
87
-  var hashTarget = document.getElementById(targetId);
88
-  // new target is hidden
89
-  if (hashTarget && hashTarget.offsetHeight === 0 &&
90
-    hashTarget.parentNode.parentNode.classList.contains('display-none')) {
91
-    hashTarget.parentNode.parentNode.classList.remove('display-none');
68
+  if (targetId) {
69
+    var hashTarget = document.getElementById(targetId);
70
+    // new target is hidden
71
+    if (
72
+      hashTarget &&
73
+      hashTarget.offsetHeight === 0 &&
74
+      hashTarget.parentNode.parentNode.classList.contains('display-none')
75
+    ) {
76
+      hashTarget.parentNode.parentNode.classList.remove('display-none');
77
+    }
78
+  }
79
+}
80
+
81
+function scrollIntoView(targetId) {
82
+  // Only scroll to element if we don't have a stored scroll position.
83
+  if (targetId && !history.state) {
84
+    var hashTarget = document.getElementById(targetId);
85
+    if (hashTarget) {
86
+      hashTarget.scrollIntoView();
87
+    }
92 88
   }
93 89
 }
94 90
 
95
-window.addEventListener('hashchange', function() {
91
+function gotoCurrentTarget() {
96 92
   showHashTarget(location.hash.substring(1));
97
-});
93
+  scrollIntoView(location.hash.substring(1));
94
+}
98 95
 
99
-showHashTarget(location.hash.substring(1));
96
+window.addEventListener('hashchange', gotoCurrentTarget);
97
+gotoCurrentTarget();
100 98
 
101 99
 var toclinks = document.getElementsByClassName('pre-open');
102 100
 for (var k = 0; k < toclinks.length; k++) {
@@ -106,3 +104,65 @@ for (var k = 0; k < toclinks.length; k++) {
106 104
 function preOpen() {
107 105
   showHashTarget(this.hash.substring(1));
108 106
 }
107
+
108
+var split_left = document.querySelector('#split-left');
109
+var split_right = document.querySelector('#split-right');
110
+var split_parent = split_left.parentNode;
111
+var cw_with_sb = split_left.clientWidth;
112
+split_left.style.overflow = 'hidden';
113
+var cw_without_sb = split_left.clientWidth;
114
+split_left.style.overflow = '';
115
+
116
+Split(['#split-left', '#split-right'], {
117
+  elementStyle: function(dimension, size, gutterSize) {
118
+    return {
119
+      'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'
120
+    };
121
+  },
122
+  gutterStyle: function(dimension, gutterSize) {
123
+    return {
124
+      'flex-basis': gutterSize + 'px'
125
+    };
126
+  },
127
+  gutterSize: 20,
128
+  sizes: [33, 67]
129
+});
130
+
131
+// Chrome doesn't remember scroll position properly so do it ourselves.
132
+// Also works on Firefox and Edge.
133
+
134
+function updateState() {
135
+  history.replaceState(
136
+    {
137
+      left_top: split_left.scrollTop,
138
+      right_top: split_right.scrollTop
139
+    },
140
+    document.title
141
+  );
142
+}
143
+
144
+function loadState(ev) {
145
+  if (ev) {
146
+    // Edge doesn't replace change history.state on popstate.
147
+    history.replaceState(ev.state, document.title);
148
+  }
149
+  if (history.state) {
150
+    split_left.scrollTop = history.state.left_top;
151
+    split_right.scrollTop = history.state.right_top;
152
+  }
153
+}
154
+
155
+window.addEventListener('load', function() {
156
+  // Restore after Firefox scrolls to hash.
157
+  setTimeout(function() {
158
+    loadState();
159
+    // Update with initial scroll position.
160
+    updateState();
161
+    // Update scroll positions only after we've loaded because Firefox
162
+    // emits an initial scroll event with 0.
163
+    split_left.addEventListener('scroll', updateState);
164
+    split_right.addEventListener('scroll', updateState);
165
+  }, 1);
166
+});
167
+
168
+window.addEventListener('popstate', loadState);

+ 15
- 0
docs/assets/split.css View File

@@ -0,0 +1,15 @@
1
+.gutter {
2
+    background-color: #f5f5f5;
3
+    background-repeat: no-repeat;
4
+    background-position: 50%;
5
+}
6
+
7
+.gutter.gutter-vertical {
8
+    background-image:  url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
9
+    cursor: ns-resize;
10
+}
11
+
12
+.gutter.gutter-horizontal {
13
+    background-image:  url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
14
+    cursor: ew-resize;
15
+}

+ 586
- 0
docs/assets/split.js View File

@@ -0,0 +1,586 @@
1
+/*! Split.js - v1.3.5 */
2
+// https://github.com/nathancahill/Split.js
3
+// Copyright (c) 2017 Nathan Cahill; Licensed MIT
4
+
5
+(function(global, factory) {
6
+  typeof exports === 'object' && typeof module !== 'undefined'
7
+    ? (module.exports = factory())
8
+    : typeof define === 'function' && define.amd
9
+      ? define(factory)
10
+      : (global.Split = factory());
11
+})(this, function() {
12
+  'use strict';
13
+  // The programming goals of Split.js are to deliver readable, understandable and
14
+  // maintainable code, while at the same time manually optimizing for tiny minified file size,
15
+  // browser compatibility without additional requirements, graceful fallback (IE8 is supported)
16
+  // and very few assumptions about the user's page layout.
17
+  var global = window;
18
+  var document = global.document;
19
+
20
+  // Save a couple long function names that are used frequently.
21
+  // This optimization saves around 400 bytes.
22
+  var addEventListener = 'addEventListener';
23
+  var removeEventListener = 'removeEventListener';
24
+  var getBoundingClientRect = 'getBoundingClientRect';
25
+  var NOOP = function() {
26
+    return false;
27
+  };
28
+
29
+  // Figure out if we're in IE8 or not. IE8 will still render correctly,
30
+  // but will be static instead of draggable.
31
+  var isIE8 = global.attachEvent && !global[addEventListener];
32
+
33
+  // This library only needs two helper functions:
34
+  //
35
+  // The first determines which prefixes of CSS calc we need.
36
+  // We only need to do this once on startup, when this anonymous function is called.
37
+  //
38
+  // Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
39
+  // http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
40
+  var calc =
41
+    ['', '-webkit-', '-moz-', '-o-']
42
+      .filter(function(prefix) {
43
+        var el = document.createElement('div');
44
+        el.style.cssText = 'width:' + prefix + 'calc(9px)';
45
+
46
+        return !!el.style.length;
47
+      })
48
+      .shift() + 'calc';
49
+
50
+  // The second helper function allows elements and string selectors to be used
51
+  // interchangeably. In either case an element is returned. This allows us to
52
+  // do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`.
53
+  var elementOrSelector = function(el) {
54
+    if (typeof el === 'string' || el instanceof String) {
55
+      return document.querySelector(el);
56
+    }
57
+
58
+    return el;
59
+  };
60
+
61
+  // The main function to initialize a split. Split.js thinks about each pair
62
+  // of elements as an independant pair. Dragging the gutter between two elements
63
+  // only changes the dimensions of elements in that pair. This is key to understanding
64
+  // how the following functions operate, since each function is bound to a pair.
65
+  //
66
+  // A pair object is shaped like this:
67
+  //
68
+  // {
69
+  //     a: DOM element,
70
+  //     b: DOM element,
71
+  //     aMin: Number,
72
+  //     bMin: Number,
73
+  //     dragging: Boolean,
74
+  //     parent: DOM element,
75
+  //     isFirst: Boolean,
76
+  //     isLast: Boolean,
77
+  //     direction: 'horizontal' | 'vertical'
78
+  // }
79
+  //
80
+  // The basic sequence:
81
+  //
82
+  // 1. Set defaults to something sane. `options` doesn't have to be passed at all.
83
+  // 2. Initialize a bunch of strings based on the direction we're splitting.
84
+  //    A lot of the behavior in the rest of the library is paramatized down to
85
+  //    rely on CSS strings and classes.
86
+  // 3. Define the dragging helper functions, and a few helpers to go with them.
87
+  // 4. Loop through the elements while pairing them off. Every pair gets an
88
+  //    `pair` object, a gutter, and special isFirst/isLast properties.
89
+  // 5. Actually size the pair elements, insert gutters and attach event listeners.
90
+  var Split = function(ids, options) {
91
+    if (options === void 0) options = {};
92
+
93
+    var dimension;
94
+    var clientDimension;
95
+    var clientAxis;
96
+    var position;
97
+    var paddingA;
98
+    var paddingB;
99
+    var elements;
100
+
101
+    // All DOM elements in the split should have a common parent. We can grab
102
+    // the first elements parent and hope users read the docs because the
103
+    // behavior will be whacky otherwise.
104
+    var parent = elementOrSelector(ids[0]).parentNode;
105
+    var parentFlexDirection = global.getComputedStyle(parent).flexDirection;
106
+
107
+    // Set default options.sizes to equal percentages of the parent element.
108
+    var sizes =
109
+      options.sizes ||
110
+      ids.map(function() {
111
+        return 100 / ids.length;
112
+      });
113
+
114
+    // Standardize minSize to an array if it isn't already. This allows minSize
115
+    // to be passed as a number.
116
+    var minSize = options.minSize !== undefined ? options.minSize : 100;
117
+    var minSizes = Array.isArray(minSize)
118
+      ? minSize
119
+      : ids.map(function() {
120
+          return minSize;
121
+        });
122
+    var gutterSize = options.gutterSize !== undefined ? options.gutterSize : 10;
123
+    var snapOffset = options.snapOffset !== undefined ? options.snapOffset : 30;
124
+    var direction = options.direction || 'horizontal';
125
+    var cursor =
126
+      options.cursor ||
127
+      (direction === 'horizontal' ? 'ew-resize' : 'ns-resize');
128
+    var gutter =
129
+      options.gutter ||
130
+      function(i, gutterDirection) {
131
+        var gut = document.createElement('div');
132
+        gut.className = 'gutter gutter-' + gutterDirection;
133
+        return gut;
134
+      };
135
+    var elementStyle =
136
+      options.elementStyle ||
137
+      function(dim, size, gutSize) {
138
+        var style = {};
139
+
140
+        if (typeof size !== 'string' && !(size instanceof String)) {
141
+          if (!isIE8) {
142
+            style[dim] = calc + '(' + size + '% - ' + gutSize + 'px)';
143
+          } else {
144
+            style[dim] = size + '%';
145
+          }
146
+        } else {
147
+          style[dim] = size;
148
+        }
149
+
150
+        return style;
151
+      };
152
+    var gutterStyle =
153
+      options.gutterStyle ||
154
+      function(dim, gutSize) {
155
+        return (obj = {}), (obj[dim] = gutSize + 'px'), obj;
156
+        var obj;
157
+      };
158
+
159
+    // 2. Initialize a bunch of strings based on the direction we're splitting.
160
+    // A lot of the behavior in the rest of the library is paramatized down to
161
+    // rely on CSS strings and classes.
162
+    if (direction === 'horizontal') {
163
+      dimension = 'width';
164
+      clientDimension = 'clientWidth';
165
+      clientAxis = 'clientX';
166
+      position = 'left';
167
+      paddingA = 'paddingLeft';
168
+      paddingB = 'paddingRight';
169
+    } else if (direction === 'vertical') {
170
+      dimension = 'height';
171
+      clientDimension = 'clientHeight';
172
+      clientAxis = 'clientY';
173
+      position = 'top';
174
+      paddingA = 'paddingTop';
175
+      paddingB = 'paddingBottom';
176
+    }
177
+
178
+    // 3. Define the dragging helper functions, and a few helpers to go with them.
179
+    // Each helper is bound to a pair object that contains it's metadata. This
180
+    // also makes it easy to store references to listeners that that will be
181
+    // added and removed.
182
+    //
183
+    // Even though there are no other functions contained in them, aliasing
184
+    // this to self saves 50 bytes or so since it's used so frequently.
185
+    //
186
+    // The pair object saves metadata like dragging state, position and
187
+    // event listener references.
188
+
189
+    function setElementSize(el, size, gutSize) {
190
+      // Split.js allows setting sizes via numbers (ideally), or if you must,
191
+      // by string, like '300px'. This is less than ideal, because it breaks
192
+      // the fluid layout that `calc(% - px)` provides. You're on your own if you do that,
193
+      // make sure you calculate the gutter size by hand.
194
+      var style = elementStyle(dimension, size, gutSize);
195
+
196
+      // eslint-disable-next-line no-param-reassign
197
+      Object.keys(style).forEach(function(prop) {
198
+        return (el.style[prop] = style[prop]);
199
+      });
200
+    }
201
+
202
+    function setGutterSize(gutterElement, gutSize) {
203
+      var style = gutterStyle(dimension, gutSize);
204
+
205
+      // eslint-disable-next-line no-param-reassign
206
+      Object.keys(style).forEach(function(prop) {
207
+        return (gutterElement.style[prop] = style[prop]);
208
+      });
209
+    }
210
+
211
+    // Actually adjust the size of elements `a` and `b` to `offset` while dragging.
212
+    // calc is used to allow calc(percentage + gutterpx) on the whole split instance,
213
+    // which allows the viewport to be resized without additional logic.
214
+    // Element a's size is the same as offset. b's size is total size - a size.
215
+    // Both sizes are calculated from the initial parent percentage,
216
+    // then the gutter size is subtracted.
217
+    function adjust(offset) {
218
+      var a = elements[this.a];
219
+      var b = elements[this.b];
220
+      var percentage = a.size + b.size;
221
+
222
+      a.size = offset / this.size * percentage;
223
+      b.size = percentage - offset / this.size * percentage;
224
+
225
+      setElementSize(a.element, a.size, this.aGutterSize);
226
+      setElementSize(b.element, b.size, this.bGutterSize);
227
+    }
228
+
229
+    // drag, where all the magic happens. The logic is really quite simple:
230
+    //
231
+    // 1. Ignore if the pair is not dragging.
232
+    // 2. Get the offset of the event.
233
+    // 3. Snap offset to min if within snappable range (within min + snapOffset).
234
+    // 4. Actually adjust each element in the pair to offset.
235
+    //
236
+    // ---------------------------------------------------------------------
237
+    // |    | <- a.minSize               ||              b.minSize -> |    |
238
+    // |    |  | <- this.snapOffset      ||     this.snapOffset -> |  |    |
239
+    // |    |  |                         ||                        |  |    |
240
+    // |    |  |                         ||                        |  |    |
241
+    // ---------------------------------------------------------------------
242
+    // | <- this.start                                        this.size -> |
243
+    function drag(e) {
244
+      var offset;
245
+
246
+      if (!this.dragging) {
247
+        return;
248
+      }
249
+
250
+      // Get the offset of the event from the first side of the
251
+      // pair `this.start`. Supports touch events, but not multitouch, so only the first
252
+      // finger `touches[0]` is counted.
253
+      if ('touches' in e) {
254
+        offset = e.touches[0][clientAxis] - this.start;
255
+      } else {
256
+        offset = e[clientAxis] - this.start;
257
+      }
258
+
259
+      // If within snapOffset of min or max, set offset to min or max.
260
+      // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
261
+      // Include the appropriate gutter sizes to prevent overflows.
262
+      if (offset <= elements[this.a].minSize + snapOffset + this.aGutterSize) {
263
+        offset = elements[this.a].minSize + this.aGutterSize;
264
+      } else if (
265
+        offset >=
266
+        this.size - (elements[this.b].minSize + snapOffset + this.bGutterSize)
267
+      ) {
268
+        offset = this.size - (elements[this.b].minSize + this.bGutterSize);
269
+      }
270
+
271
+      // Actually adjust the size.
272
+      adjust.call(this, offset);
273
+
274
+      // Call the drag callback continously. Don't do anything too intensive
275
+      // in this callback.
276
+      if (options.onDrag) {
277
+        options.onDrag();
278
+      }
279
+    }
280
+
281
+    // Cache some important sizes when drag starts, so we don't have to do that
282
+    // continously:
283
+    //
284
+    // `size`: The total size of the pair. First + second + first gutter + second gutter.
285
+    // `start`: The leading side of the first element.
286
+    //
287
+    // ------------------------------------------------
288
+    // |      aGutterSize -> |||                      |
289
+    // |                     |||                      |
290
+    // |                     |||                      |
291
+    // |                     ||| <- bGutterSize       |
292
+    // ------------------------------------------------
293
+    // | <- start                             size -> |
294
+    function calculateSizes() {
295
+      // Figure out the parent size minus padding.
296
+      var a = elements[this.a].element;
297
+      var b = elements[this.b].element;
298
+
299
+      this.size =
300
+        a[getBoundingClientRect]()[dimension] +
301
+        b[getBoundingClientRect]()[dimension] +
302
+        this.aGutterSize +
303
+        this.bGutterSize;
304
+      this.start = a[getBoundingClientRect]()[position];
305
+    }
306
+
307
+    // stopDragging is very similar to startDragging in reverse.
308
+    function stopDragging() {
309
+      var self = this;
310
+      var a = elements[self.a].element;
311
+      var b = elements[self.b].element;
312
+
313
+      if (self.dragging && options.onDragEnd) {
314
+        options.onDragEnd();
315
+      }
316
+
317
+      self.dragging = false;
318
+
319
+      // Remove the stored event listeners. This is why we store them.
320
+      global[removeEventListener]('mouseup', self.stop);
321
+      global[removeEventListener]('touchend', self.stop);
322
+      global[removeEventListener]('touchcancel', self.stop);
323
+
324
+      self.parent[removeEventListener]('mousemove', self.move);
325
+      self.parent[removeEventListener]('touchmove', self.move);
326
+
327
+      // Delete them once they are removed. I think this makes a difference
328
+      // in memory usage with a lot of splits on one page. But I don't know for sure.
329
+      delete self.stop;
330
+      delete self.move;
331
+
332
+      a[removeEventListener]('selectstart', NOOP);
333
+      a[removeEventListener]('dragstart', NOOP);
334
+      b[removeEventListener]('selectstart', NOOP);
335
+      b[removeEventListener]('dragstart', NOOP);
336
+
337
+      a.style.userSelect = '';
338
+      a.style.webkitUserSelect = '';
339
+      a.style.MozUserSelect = '';
340
+      a.style.pointerEvents = '';
341
+
342
+      b.style.userSelect = '';
343
+      b.style.webkitUserSelect = '';
344
+      b.style.MozUserSelect = '';
345
+      b.style.pointerEvents = '';
346
+
347
+      self.gutter.style.cursor = '';
348
+      self.parent.style.cursor = '';
349
+    }
350
+
351
+    // startDragging calls `calculateSizes` to store the inital size in the pair object.
352
+    // It also adds event listeners for mouse/touch events,
353
+    // and prevents selection while dragging so avoid the selecting text.
354
+    function startDragging(e) {
355
+      // Alias frequently used variables to save space. 200 bytes.
356
+      var self = this;
357
+      var a = elements[self.a].element;
358
+      var b = elements[self.b].element;
359
+
360
+      // Call the onDragStart callback.
361
+      if (!self.dragging && options.onDragStart) {
362
+        options.onDragStart();
363
+      }
364
+
365
+      // Don't actually drag the element. We emulate that in the drag function.
366
+      e.preventDefault();
367
+
368
+      // Set the dragging property of the pair object.
369
+      self.dragging = true;
370
+
371
+      // Create two event listeners bound to the same pair object and store
372
+      // them in the pair object.
373
+      self.move = drag.bind(self);
374
+      self.stop = stopDragging.bind(self);
375
+
376
+      // All the binding. `window` gets the stop events in case we drag out of the elements.
377
+      global[addEventListener]('mouseup', self.stop);
378
+      global[addEventListener]('touchend', self.stop);
379
+      global[addEventListener]('touchcancel', self.stop);
380
+
381
+      self.parent[addEventListener]('mousemove', self.move);
382
+      self.parent[addEventListener]('touchmove', self.move);
383
+
384
+      // Disable selection. Disable!
385
+      a[addEventListener]('selectstart', NOOP);
386
+      a[addEventListener]('dragstart', NOOP);
387
+      b[addEventListener]('selectstart', NOOP);
388
+      b[addEventListener]('dragstart', NOOP);
389
+
390
+      a.style.userSelect = 'none';
391
+      a.style.webkitUserSelect = 'none';
392
+      a.style.MozUserSelect = 'none';
393
+      a.style.pointerEvents = 'none';
394
+
395
+      b.style.userSelect = 'none';
396
+      b.style.webkitUserSelect = 'none';
397
+      b.style.MozUserSelect = 'none';
398
+      b.style.pointerEvents = 'none';
399
+
400
+      // Set the cursor, both on the gutter and the parent element.
401
+      // Doing only a, b and gutter causes flickering.
402
+      self.gutter.style.cursor = cursor;
403
+      self.parent.style.cursor = cursor;
404
+
405
+      // Cache the initial sizes of the pair.
406
+      calculateSizes.call(self);
407
+    }
408
+
409
+    // 5. Create pair and element objects. Each pair has an index reference to
410
+    // elements `a` and `b` of the pair (first and second elements).
411
+    // Loop through the elements while pairing them off. Every pair gets a
412
+    // `pair` object, a gutter, and isFirst/isLast properties.
413
+    //
414
+    // Basic logic:
415
+    //
416
+    // - Starting with the second element `i > 0`, create `pair` objects with
417
+    //   `a = i - 1` and `b = i`
418
+    // - Set gutter sizes based on the _pair_ being first/last. The first and last
419
+    //   pair have gutterSize / 2, since they only have one half gutter, and not two.
420
+    // - Create gutter elements and add event listeners.
421
+    // - Set the size of the elements, minus the gutter sizes.
422
+    //
423
+    // -----------------------------------------------------------------------
424
+    // |     i=0     |         i=1         |        i=2       |      i=3     |
425
+    // |             |       isFirst       |                  |     isLast   |
426
+    // |           pair 0                pair 1             pair 2           |
427
+    // |             |                     |                  |              |
428
+    // -----------------------------------------------------------------------
429
+    var pairs = [];
430
+    elements = ids.map(function(id, i) {
431
+      // Create the element object.
432
+      var element = {
433
+        element: elementOrSelector(id),
434
+        size: sizes[i],
435
+        minSize: minSizes[i]
436
+      };
437
+
438
+      var pair;
439
+
440
+      if (i > 0) {
441
+        // Create the pair object with it's metadata.
442
+        pair = {
443
+          a: i - 1,
444
+          b: i,
445
+          dragging: false,
446
+          isFirst: i === 1,
447
+          isLast: i === ids.length - 1,
448
+          direction: direction,
449
+          parent: parent
450
+        };
451
+
452
+        // For first and last pairs, first and last gutter width is half.
453
+        pair.aGutterSize = gutterSize;
454
+        pair.bGutterSize = gutterSize;
455
+
456
+        if (pair.isFirst) {
457
+          pair.aGutterSize = gutterSize / 2;
458
+        }
459
+
460
+        if (pair.isLast) {
461
+          pair.bGutterSize = gutterSize / 2;
462
+        }
463
+
464
+        // if the parent has a reverse flex-direction, switch the pair elements.
465
+        if (
466
+          parentFlexDirection === 'row-reverse' ||
467
+          parentFlexDirection === 'column-reverse'
468
+        ) {
469
+          var temp = pair.a;
470
+          pair.a = pair.b;
471
+          pair.b = temp;
472
+        }
473
+      }
474
+
475
+      // Determine the size of the current element. IE8 is supported by
476
+      // staticly assigning sizes without draggable gutters. Assigns a string
477
+      // to `size`.
478
+      //
479
+      // IE9 and above
480
+      if (!isIE8) {
481
+        // Create gutter elements for each pair.
482
+        if (i > 0) {
483
+          var gutterElement = gutter(i, direction);
484
+          setGutterSize(gutterElement, gutterSize);
485
+
486
+          gutterElement[addEventListener](
487
+            'mousedown',
488
+            startDragging.bind(pair)
489
+          );
490
+          gutterElement[addEventListener](
491
+            'touchstart',
492
+            startDragging.bind(pair)
493
+          );
494
+
495
+          parent.insertBefore(gutterElement, element.element);
496
+
497
+          pair.gutter = gutterElement;
498
+        }
499
+      }
500
+
501
+      // Set the element size to our determined size.
502
+      // Half-size gutters for first and last elements.
503
+      if (i === 0 || i === ids.length - 1) {
504
+        setElementSize(element.element, element.size, gutterSize / 2);
505
+      } else {
506
+        setElementSize(element.element, element.size, gutterSize);
507
+      }
508
+
509
+      var computedSize = element.element[getBoundingClientRect]()[dimension];
510
+
511
+      if (computedSize < element.minSize) {
512
+        element.minSize = computedSize;
513
+      }
514
+
515
+      // After the first iteration, and we have a pair object, append it to the
516
+      // list of pairs.
517
+      if (i > 0) {
518
+        pairs.push(pair);
519
+      }
520
+
521
+      return element;
522
+    });
523
+
524
+    function setSizes(newSizes) {
525
+      newSizes.forEach(function(newSize, i) {
526
+        if (i > 0) {
527
+          var pair = pairs[i - 1];
528
+          var a = elements[pair.a];
529
+          var b = elements[pair.b];
530
+
531
+          a.size = newSizes[i - 1];
532
+          b.size = newSize;
533
+
534
+          setElementSize(a.element, a.size, pair.aGutterSize);
535
+          setElementSize(b.element, b.size, pair.bGutterSize);
536
+        }
537
+      });
538
+    }
539
+
540
+    function destroy() {
541
+      pairs.forEach(function(pair) {
542
+        pair.parent.removeChild(pair.gutter);
543
+        elements[pair.a].element.style[dimension] = '';
544
+        elements[pair.b].element.style[dimension] = '';
545
+      });
546
+    }
547
+
548
+    if (isIE8) {
549
+      return {
550
+        setSizes: setSizes,
551
+        destroy: destroy
552
+      };
553
+    }
554
+
555
+    return {
556
+      setSizes: setSizes,
557
+      getSizes: function getSizes() {
558
+        return elements.map(function(element) {
559
+          return element.size;
560
+        });
561
+      },
562
+      collapse: function collapse(i) {
563
+        if (i === pairs.length) {
564
+          var pair = pairs[i - 1];
565
+
566
+          calculateSizes.call(pair);
567
+
568
+          if (!isIE8) {
569
+            adjust.call(pair, pair.size - pair.bGutterSize);
570
+          }
571
+        } else {
572
+          var pair$1 = pairs[i];
573
+
574
+          calculateSizes.call(pair$1);
575
+
576
+          if (!isIE8) {
577
+            adjust.call(pair$1, pair$1.aGutterSize);
578
+          }
579
+        }
580
+      },
581
+      destroy: destroy
582
+    };
583
+  };
584
+
585
+  return Split;
586
+});

+ 4
- 0
docs/assets/style.css View File

@@ -46,6 +46,10 @@ a:hover {
46 46
   max-height: 100%;
47 47
 }
48 48
 
49
+.height-viewport-100 {
50
+  height: 100vh;
51
+}
52
+
49 53
 section:target h3 {
50 54
   font-weight:700;
51 55
 }

+ 594
- 388
docs/index.html
File diff suppressed because it is too large
View File


+ 99
- 0
documentation/Adapter.js.html View File

@@ -0,0 +1,99 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="utf-8">
5
+    <title>JSDoc: Source: Adapter.js</title>
6
+
7
+    <script src="scripts/prettify/prettify.js"> </script>
8
+    <script src="scripts/prettify/lang-css.js"> </script>
9
+    <!--[if lt IE 9]>
10
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
+    <![endif]-->
12
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
+</head>
15
+
16
+<body>
17
+
18
+<div id="main">
19
+
20
+    <h1 class="page-title">Source: Adapter.js</h1>
21
+
22
+    
23
+
24
+
25
+
26
+    
27
+    <section>
28
+        <article>
29
+            <pre class="prettyprint source linenums"><code>/**
30
+ * Class that wraps database connection libraries
31
+ *
32
+ * @private
33
+ * @param  {Promise} instance - The connection object
34
+ */
35
+class Adapter {
36
+	/**
37
+	 * Invoke an adapter
38
+	 *
39
+	 * @constructor
40
+	 * @param  {Promise} instance - Promise holding connection object
41
+	 */
42
+	constructor (instance) {
43
+		this.instance = instance;
44
+	}
45
+
46
+	/**
47
+	 * Run the sql query as a prepared statement
48
+	 *
49
+	 * @param {String} sql - The sql with placeholders
50
+	 * @param {Array} params - The values to insert into the query
51
+	 * @return {Promise} - returns a promise resolving to the result of the database query
52
+	 */
53
+	execute (sql, params) {
54
+		throw new Error('Correct adapter not defined for query execution');
55
+	}
56
+
57
+	/**
58
+	 * Transform the adapter's result into a standard format
59
+	 *
60
+	 * @param {*} originalResult - the original result object from the driver
61
+	 * @return {Result} - the new result object
62
+	 */
63
+	transformResult (originalResult) {
64
+		throw new Error('Result transformer method not defined for current adapter');
65
+	}
66
+
67
+	/**
68
+	 * Close the current database connection
69
+	 * @return {void}
70
+	 */
71
+	close () {
72
+		this.instance.then(conn => conn.end());
73
+	}
74
+}
75
+
76
+module.exports = Adapter;
77
+</code></pre>
78
+        </article>
79
+    </section>
80
+
81
+
82
+
83
+
84
+</div>
85
+
86
+<nav>
87
+    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-drivers_MariaDB.html">drivers/MariaDB</a></li><li><a href="module-drivers_MSSQLDriver.html">drivers/MSSQLDriver</a></li><li><a href="module-drivers_Mysql.html">drivers/Mysql</a></li><li><a href="module-drivers_Pg.html">drivers/Pg</a></li><li><a href="module-drivers_Sqlite.html">drivers/Sqlite</a></li></ul><h3>Classes</h3><ul><li><a href="NodeQuery.html">NodeQuery</a></li><li><a href="QueryBuilder.html">QueryBuilder</a></li><li><a href="Result.html">Result</a></li></ul>
88
+</nav>
89
+
90
+<br class="clear">
91
+
92
+<footer>
93
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Feb 12 2018 14:58:25 GMT-0500 (EST)
94
+</footer>
95
+
96
+<script> prettyPrint(); </script>
97
+<script src="scripts/linenumber.js"> </script>
98
+</body>
99
+</html>

+ 220
- 0
documentation/Helpers.js.html View File

@@ -0,0 +1,220 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="utf-8">