@iebh/tera-fy 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/api.md +214 -199
- package/dist/plugin.vue2.es2019.js +1 -1
- package/dist/terafy.es2019.js +2 -2
- package/dist/terafy.js +2 -2
- package/lib/terafy.client.js +17 -0
- package/lib/terafy.server.js +14 -0
- package/package.json +1 -1
- package/plugins/vue2.js +10 -3
package/api.md
CHANGED
|
@@ -119,12 +119,14 @@
|
|
|
119
119
|
* [Parameters][115]
|
|
120
120
|
* [projectLog][116]
|
|
121
121
|
* [Parameters][117]
|
|
122
|
-
* [
|
|
122
|
+
* [setPageUrl][118]
|
|
123
123
|
* [Parameters][119]
|
|
124
|
-
* [
|
|
124
|
+
* [uiAlert][120]
|
|
125
125
|
* [Parameters][121]
|
|
126
|
-
* [
|
|
126
|
+
* [uiSplat][122]
|
|
127
127
|
* [Parameters][123]
|
|
128
|
+
* [uiWindow][124]
|
|
129
|
+
* [Parameters][125]
|
|
128
130
|
|
|
129
131
|
## ProjectFile
|
|
130
132
|
|
|
@@ -134,99 +136,99 @@ A project file fetched from TERA
|
|
|
134
136
|
|
|
135
137
|
A UUID string representing the unique ID of the file
|
|
136
138
|
|
|
137
|
-
Type: [String][
|
|
139
|
+
Type: [String][126]
|
|
138
140
|
|
|
139
141
|
### name
|
|
140
142
|
|
|
141
143
|
Relative name path (can contain prefix directories) for the human readable file name
|
|
142
144
|
|
|
143
|
-
Type: [String][
|
|
145
|
+
Type: [String][126]
|
|
144
146
|
|
|
145
147
|
### icon
|
|
146
148
|
|
|
147
149
|
CSS class to use as the file icon
|
|
148
150
|
|
|
149
|
-
Type: [String][
|
|
151
|
+
Type: [String][126]
|
|
150
152
|
|
|
151
153
|
### path
|
|
152
154
|
|
|
153
155
|
Full path to the file
|
|
154
156
|
This is also used as the unique identifier within the project
|
|
155
157
|
|
|
156
|
-
Type: [String][
|
|
158
|
+
Type: [String][126]
|
|
157
159
|
|
|
158
160
|
### parsedName
|
|
159
161
|
|
|
160
162
|
An object representing meta file parts of a file name
|
|
161
163
|
|
|
162
|
-
Type: [Object][
|
|
164
|
+
Type: [Object][127]
|
|
163
165
|
|
|
164
166
|
#### Properties
|
|
165
167
|
|
|
166
|
-
* `basename` **[String][
|
|
167
|
-
* `filename` **[String][
|
|
168
|
-
* `ext` **[String][
|
|
169
|
-
* `dirName` **[String][
|
|
168
|
+
* `basename` **[String][126]** The filename + extention (i.e. everything without directory name)
|
|
169
|
+
* `filename` **[String][126]** The file portion of the name (basename without the extension)
|
|
170
|
+
* `ext` **[String][126]** The extension portion of the name (always lower case)
|
|
171
|
+
* `dirName` **[String][126]** The directory path portion of the name
|
|
170
172
|
|
|
171
173
|
### created
|
|
172
174
|
|
|
173
175
|
A date representing when the file was created
|
|
174
176
|
|
|
175
|
-
Type: [Date][
|
|
177
|
+
Type: [Date][128]
|
|
176
178
|
|
|
177
179
|
### createdFormatted
|
|
178
180
|
|
|
179
181
|
A human readable, formatted version of "created"
|
|
180
182
|
|
|
181
|
-
Type: [String][
|
|
183
|
+
Type: [String][126]
|
|
182
184
|
|
|
183
185
|
### modified
|
|
184
186
|
|
|
185
187
|
A date representing when the file was created
|
|
186
188
|
|
|
187
|
-
Type: [Date][
|
|
189
|
+
Type: [Date][128]
|
|
188
190
|
|
|
189
191
|
### modifiedFormatted
|
|
190
192
|
|
|
191
193
|
A human readable, formatted version of "modified"
|
|
192
194
|
|
|
193
|
-
Type: [String][
|
|
195
|
+
Type: [String][126]
|
|
194
196
|
|
|
195
197
|
### accessed
|
|
196
198
|
|
|
197
199
|
A date representing when the file was last accessed
|
|
198
200
|
|
|
199
|
-
Type: [Date][
|
|
201
|
+
Type: [Date][128]
|
|
200
202
|
|
|
201
203
|
### accessedFormatted
|
|
202
204
|
|
|
203
205
|
A human readable, formatted version of "accessed"
|
|
204
206
|
|
|
205
|
-
Type: [String][
|
|
207
|
+
Type: [String][126]
|
|
206
208
|
|
|
207
209
|
### size
|
|
208
210
|
|
|
209
211
|
Size, in bytes, of the file
|
|
210
212
|
|
|
211
|
-
Type: [Number][
|
|
213
|
+
Type: [Number][129]
|
|
212
214
|
|
|
213
215
|
### sizeFormatted
|
|
214
216
|
|
|
215
217
|
A human readable, formatted version of the file size
|
|
216
218
|
|
|
217
|
-
Type: [String][
|
|
219
|
+
Type: [String][126]
|
|
218
220
|
|
|
219
221
|
### mime
|
|
220
222
|
|
|
221
223
|
The associated mime type for the file
|
|
222
224
|
|
|
223
|
-
Type: [String][
|
|
225
|
+
Type: [String][126]
|
|
224
226
|
|
|
225
227
|
### meta
|
|
226
228
|
|
|
227
229
|
Additional meta information for the file
|
|
228
230
|
|
|
229
|
-
Type: [Object][
|
|
231
|
+
Type: [Object][127]
|
|
230
232
|
|
|
231
233
|
### getContents
|
|
232
234
|
|
|
@@ -244,9 +246,9 @@ Overwrite the contents of a file with new content
|
|
|
244
246
|
|
|
245
247
|
#### Parameters
|
|
246
248
|
|
|
247
|
-
* `contents` **(File | [Blob][
|
|
249
|
+
* `contents` **(File | [Blob][130] | [FormData][131] | [Object][127] | [Array][132])** The new file contents
|
|
248
250
|
|
|
249
|
-
Returns **[Promise][
|
|
251
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
250
252
|
|
|
251
253
|
### getRefs
|
|
252
254
|
|
|
@@ -254,7 +256,7 @@ Returns **[Promise][131]** A promise which resolves when the operation has compl
|
|
|
254
256
|
|
|
255
257
|
Fetch the file contents as an array of Reflib refs
|
|
256
258
|
|
|
257
|
-
Returns **[Promise][
|
|
259
|
+
Returns **[Promise][133]<[Array][132]\<Ref>>** An eventual array of RefLib references
|
|
258
260
|
|
|
259
261
|
### setRefs
|
|
260
262
|
|
|
@@ -265,18 +267,18 @@ Overwrite the contents of a file with a new collection of Reflib refs
|
|
|
265
267
|
#### Parameters
|
|
266
268
|
|
|
267
269
|
* `refs`  
|
|
268
|
-
* `Collection` **[Array][
|
|
270
|
+
* `Collection` **[Array][132]\<RefLibRef>** of references for the selected library
|
|
269
271
|
|
|
270
|
-
Returns **[Promise][
|
|
272
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
271
273
|
|
|
272
274
|
### serialize
|
|
273
275
|
|
|
274
|
-
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][
|
|
276
|
+
* **See**: [https://developer.mozilla.org/en-US/docs/Web/API/Web\_Workers\_API/Structured\_clone\_algorithm][134]
|
|
275
277
|
|
|
276
278
|
Compress a file state down into a serializable entity
|
|
277
279
|
By default this computes a Structured Clone which can be stringified
|
|
278
280
|
|
|
279
|
-
Returns **[Object][
|
|
281
|
+
Returns **[Object][127]** A Structured Clone compatible representation of this ProjectFile instance
|
|
280
282
|
|
|
281
283
|
### deserialize
|
|
282
284
|
|
|
@@ -284,7 +286,7 @@ Restore an entity created with serialize
|
|
|
284
286
|
|
|
285
287
|
#### Parameters
|
|
286
288
|
|
|
287
|
-
* `data` **[Object][
|
|
289
|
+
* `data` **[Object][127]** An input object created via `ProjectFiles.serialize()`
|
|
288
290
|
|
|
289
291
|
Returns **[ProjectFile][1]** A ProjectFile instance setup against the deserializzed data
|
|
290
292
|
|
|
@@ -304,19 +306,19 @@ Main Tera-Fy Client (class singleton) to be used in a frontend browser
|
|
|
304
306
|
|
|
305
307
|
Various settings to configure behaviour
|
|
306
308
|
|
|
307
|
-
Type: [Object][
|
|
309
|
+
Type: [Object][127]
|
|
308
310
|
|
|
309
311
|
#### Properties
|
|
310
312
|
|
|
311
|
-
* `devMode` **[Boolean][
|
|
312
|
-
* `verbosity` **[Number][
|
|
313
|
+
* `devMode` **[Boolean][135]** Operate in devMode - i.e. force outer refresh when encountering an existing TeraFy instance
|
|
314
|
+
* `verbosity` **[Number][129]** Verbosity level, the higher the more chatty TeraFY will be. Set to zero to disable all `debug()` call output
|
|
313
315
|
* `mode` **(`"detect"` | `"parent"` | `"child"` | `"popup"`)** How to communicate with TERA. 'parent' assumes that the parent of the current document is TERA, 'child' spawns an iFrame and uses TERA there, 'detect' tries parent and switches to `modeFallback` if communication fails
|
|
314
|
-
* `modeFallback` **[String][
|
|
315
|
-
* `modeTimeout` **[Number][
|
|
316
|
-
* `siteUrl` **[String][
|
|
317
|
-
* `restrictOrigin` **[String][
|
|
318
|
-
* `List` **[Array][
|
|
319
|
-
* `handshakeInterval` **[Number][
|
|
316
|
+
* `modeFallback` **[String][126]** Method to use when all method detection fails
|
|
317
|
+
* `modeTimeout` **[Number][129]** How long entities have in 'detect' mode to identify themselves
|
|
318
|
+
* `siteUrl` **[String][126]** The TERA URL to connect to
|
|
319
|
+
* `restrictOrigin` **[String][126]** URL to restrict communications to
|
|
320
|
+
* `List` **[Array][132]<[String][126]>** of sandbox allowables for the embedded if in embed mode
|
|
321
|
+
* `handshakeInterval` **[Number][129]** Interval in milliseconds when sanning for a handshake
|
|
320
322
|
|
|
321
323
|
### events
|
|
322
324
|
|
|
@@ -328,13 +330,13 @@ Type: Mitt
|
|
|
328
330
|
|
|
329
331
|
DOMElements for this TeraFy instance
|
|
330
332
|
|
|
331
|
-
Type: [Object][
|
|
333
|
+
Type: [Object][127]
|
|
332
334
|
|
|
333
335
|
#### Properties
|
|
334
336
|
|
|
335
337
|
* `el` **DOMElement** The main tera-fy div wrapper
|
|
336
338
|
* `iframe` **DOMElement** The internal iFrame element (if `settings.mode == 'child'`)
|
|
337
|
-
* `popup` **[Window][
|
|
339
|
+
* `popup` **[Window][136]** The popup window context (if `settings.mode == 'popup'`)
|
|
338
340
|
* `stylesheet` **DOMElement** The corresponding stylesheet
|
|
339
341
|
|
|
340
342
|
### methods
|
|
@@ -342,13 +344,13 @@ Type: [Object][125]
|
|
|
342
344
|
List of function stubs mapped from the server to here
|
|
343
345
|
This array is forms the reference of `TeraFy.METHOD()` objects to provide locally which will be mapped via `TeraFy.rpc(METHOD, ...args)`
|
|
344
346
|
|
|
345
|
-
Type: [Array][
|
|
347
|
+
Type: [Array][132]<[String][126]>
|
|
346
348
|
|
|
347
349
|
### plugins
|
|
348
350
|
|
|
349
351
|
Loaded plugins via Use()
|
|
350
352
|
|
|
351
|
-
Type: [Array][
|
|
353
|
+
Type: [Array][132]\<TeraFyPlugin>
|
|
352
354
|
|
|
353
355
|
### send
|
|
354
356
|
|
|
@@ -356,9 +358,9 @@ Send a message + wait for a response object
|
|
|
356
358
|
|
|
357
359
|
#### Parameters
|
|
358
360
|
|
|
359
|
-
* `message` **[Object][
|
|
361
|
+
* `message` **[Object][127]** Message object to send
|
|
360
362
|
|
|
361
|
-
Returns **[Promise][
|
|
363
|
+
Returns **[Promise][133]\<any>** A promise which resolves when the operation has completed with the remote reply
|
|
362
364
|
|
|
363
365
|
### sendRaw
|
|
364
366
|
|
|
@@ -367,7 +369,7 @@ This function does not return or wait for a reply - use `send()` for that
|
|
|
367
369
|
|
|
368
370
|
#### Parameters
|
|
369
371
|
|
|
370
|
-
* `message` **[Object][
|
|
372
|
+
* `message` **[Object][127]** Message object to send
|
|
371
373
|
|
|
372
374
|
### rpc
|
|
373
375
|
|
|
@@ -375,10 +377,10 @@ Call an RPC function in the server instance
|
|
|
375
377
|
|
|
376
378
|
#### Parameters
|
|
377
379
|
|
|
378
|
-
* `method` **[String][
|
|
380
|
+
* `method` **[String][126]** The method name to call
|
|
379
381
|
* `args` **...any** 
|
|
380
382
|
|
|
381
|
-
Returns **[Promise][
|
|
383
|
+
Returns **[Promise][133]\<any>** The resolved output of the server function
|
|
382
384
|
|
|
383
385
|
### acceptMessage
|
|
384
386
|
|
|
@@ -387,7 +389,7 @@ Accept an incoming message
|
|
|
387
389
|
#### Parameters
|
|
388
390
|
|
|
389
391
|
* `rawMessage`  
|
|
390
|
-
* `Raw` **[MessageEvent][
|
|
392
|
+
* `Raw` **[MessageEvent][137]** message event to process
|
|
391
393
|
|
|
392
394
|
### acceptPostboxes
|
|
393
395
|
|
|
@@ -396,27 +398,27 @@ Listening postboxes, these correspond to outgoing message IDs that expect a resp
|
|
|
396
398
|
### createProjectStatePatch
|
|
397
399
|
|
|
398
400
|
Create + transmit a new project state patch base on the current and previous states
|
|
399
|
-
The transmitted patch follows the [JSPatch][
|
|
401
|
+
The transmitted patch follows the [JSPatch][138] standard
|
|
400
402
|
This function accepts an entire projectState instance, computes the delta and transmits that to the server for merging
|
|
401
403
|
|
|
402
404
|
#### Parameters
|
|
403
405
|
|
|
404
|
-
* `newState` **[Object][
|
|
405
|
-
* `oldState` **[Object][
|
|
406
|
+
* `newState` **[Object][127]** The local projectState to accept
|
|
407
|
+
* `oldState` **[Object][127]** The previous projectState to examine against
|
|
406
408
|
|
|
407
|
-
Returns **[Promise][
|
|
409
|
+
Returns **[Promise][133]** A promise which will resolve when the operation has completed
|
|
408
410
|
|
|
409
411
|
### applyProjectStatePatchLocal
|
|
410
412
|
|
|
411
413
|
Client function which accepts a patch from the server and applies it to local project state
|
|
412
|
-
The patch should follow the [JSPatch][
|
|
414
|
+
The patch should follow the [JSPatch][138] standard
|
|
413
415
|
This function is expected to be sub-classed by a plugin
|
|
414
416
|
|
|
415
417
|
#### Parameters
|
|
416
418
|
|
|
417
|
-
* `patch` **[Array][
|
|
419
|
+
* `patch` **[Array][132]** A JSPatch patch to apply
|
|
418
420
|
|
|
419
|
-
Returns **[Promise][
|
|
421
|
+
Returns **[Promise][133]** A promise which will resolve when the operation has completed
|
|
420
422
|
|
|
421
423
|
### init
|
|
422
424
|
|
|
@@ -425,28 +427,28 @@ This function can only be called once and will return the existing init() worker
|
|
|
425
427
|
|
|
426
428
|
#### Parameters
|
|
427
429
|
|
|
428
|
-
* `options` **[Object][
|
|
430
|
+
* `options` **[Object][127]?** Additional options to merge into `settings` via `set`
|
|
429
431
|
|
|
430
|
-
Returns **[Promise][
|
|
432
|
+
Returns **[Promise][133]<[TeraFy][29]>** An eventual promise which will resovle with this terafy instance
|
|
431
433
|
|
|
432
434
|
### detectMode
|
|
433
435
|
|
|
434
436
|
Populate `settings.mode`
|
|
435
437
|
Try to communicate with a parent frame, if none assume we need to fallback to child mode
|
|
436
438
|
|
|
437
|
-
Returns **[Promise][
|
|
439
|
+
Returns **[Promise][133]<[String][126]>** A promise which will resolve with the detected mode to use
|
|
438
440
|
|
|
439
441
|
### injectComms
|
|
440
442
|
|
|
441
443
|
Find an existing active TERA server OR initalize one
|
|
442
444
|
|
|
443
|
-
Returns **[Promise][
|
|
445
|
+
Returns **[Promise][133]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
444
446
|
|
|
445
447
|
### injectStylesheet
|
|
446
448
|
|
|
447
449
|
Inject a local stylesheet to handle TERA server functionality
|
|
448
450
|
|
|
449
|
-
Returns **[Promise][
|
|
451
|
+
Returns **[Promise][133]** A promise which will resolve when the loading has completed and we have found a parent TERA instance or initiallized a child
|
|
450
452
|
|
|
451
453
|
### injectMethods
|
|
452
454
|
|
|
@@ -461,7 +463,7 @@ This function will only act if `settings.devMode` is truthy
|
|
|
461
463
|
|
|
462
464
|
* `msg` **...any** 
|
|
463
465
|
* `method` **(`"INFO"` | `"LOG"` | `"WARN"` | `"ERROR"`)** Logging method to use (optional, default `'LOG'`)
|
|
464
|
-
* `verboseLevel` **[Number][
|
|
466
|
+
* `verboseLevel` **[Number][129]** The verbosity level to trigger at. If `settings.verbosity` is lower than this, the message is ignored (optional, default `1`)
|
|
465
467
|
|
|
466
468
|
### set
|
|
467
469
|
|
|
@@ -470,7 +472,7 @@ This function also routes 'special' keys like `devMode` to their internal handle
|
|
|
470
472
|
|
|
471
473
|
#### Parameters
|
|
472
474
|
|
|
473
|
-
* `key` **([String][
|
|
475
|
+
* `key` **([String][126] | [Object][127])** Either a single setting key to set or an object to merge
|
|
474
476
|
* `value` **any** The value to set if `key` is a string
|
|
475
477
|
|
|
476
478
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -483,7 +485,7 @@ Set or merge settings - but only in dev mode and only if the value is not undefi
|
|
|
483
485
|
|
|
484
486
|
#### Parameters
|
|
485
487
|
|
|
486
|
-
* `key` **([String][
|
|
488
|
+
* `key` **([String][126] | [Object][127])** Either a single setting key to set or an object to merge
|
|
487
489
|
* `value` **any** The value to set if `key` is a string
|
|
488
490
|
|
|
489
491
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
@@ -495,8 +497,8 @@ Include a TeraFy client plugin
|
|
|
495
497
|
#### Parameters
|
|
496
498
|
|
|
497
499
|
* `mod`  
|
|
498
|
-
* `options` **[Object][
|
|
499
|
-
* `The` **[Object][
|
|
500
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour during construction (pass options to init() to intialize later options)
|
|
501
|
+
* `The` **[Object][127]** module function to include. Invoked as `(teraClient:TeraFy, options:Object)`
|
|
500
502
|
|
|
501
503
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
502
504
|
|
|
@@ -506,8 +508,8 @@ Internal function used by use() to merge an external declared singleton against
|
|
|
506
508
|
|
|
507
509
|
#### Parameters
|
|
508
510
|
|
|
509
|
-
* `target` **[Object][
|
|
510
|
-
* `source` **[Object][
|
|
511
|
+
* `target` **[Object][127]** Initalied class instance to extend
|
|
512
|
+
* `source` **[Object][127]** Initalized source object to extend from
|
|
511
513
|
|
|
512
514
|
### toggleDevMode
|
|
513
515
|
|
|
@@ -515,7 +517,7 @@ Set or toggle devMode
|
|
|
515
517
|
|
|
516
518
|
#### Parameters
|
|
517
519
|
|
|
518
|
-
* `devModeEnabled` **([String][
|
|
520
|
+
* `devModeEnabled` **([String][126] | [Boolean][135])** Optional boolean to force dev mode (optional, default `'toggle'`)
|
|
519
521
|
|
|
520
522
|
Returns **[TeraFy][29]** This chainable terafy instance
|
|
521
523
|
|
|
@@ -526,7 +528,7 @@ This is usually because the server component wants to perform some user activity
|
|
|
526
528
|
|
|
527
529
|
#### Parameters
|
|
528
530
|
|
|
529
|
-
* `isFocused` **([String][
|
|
531
|
+
* `isFocused` **([String][126] | [Boolean][135])** Whether to fullscreen the embedded component (optional, default `'toggle'`)
|
|
530
532
|
|
|
531
533
|
### selectProjectFile
|
|
532
534
|
|
|
@@ -538,7 +540,7 @@ This is an pre-requisite step for requireProject()
|
|
|
538
540
|
|
|
539
541
|
* `options`  
|
|
540
542
|
|
|
541
|
-
Returns **[Promise][
|
|
543
|
+
Returns **[Promise][133]** A promise which will resolve if the there is a user and they are logged in
|
|
542
544
|
|
|
543
545
|
### getProjectFiles
|
|
544
546
|
|
|
@@ -546,12 +548,12 @@ Fetch the files associated with a given project
|
|
|
546
548
|
|
|
547
549
|
#### Parameters
|
|
548
550
|
|
|
549
|
-
* `options` **[Object][
|
|
551
|
+
* `options` **[Object][127]** Options which mutate behaviour
|
|
550
552
|
|
|
551
|
-
* `options.autoRequire` **[Boolean][
|
|
552
|
-
* `options.meta` **[Boolean][
|
|
553
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
554
|
+
* `options.meta` **[Boolean][135]** Pull meta information for each file entity (optional, default `true`)
|
|
553
555
|
|
|
554
|
-
Returns **[Promise][
|
|
556
|
+
Returns **[Promise][133]<[Array][132]<[ProjectFile][1]>>** A collection of project files for the given project
|
|
555
557
|
|
|
556
558
|
### getProjectFile
|
|
557
559
|
|
|
@@ -559,9 +561,9 @@ Fetch a project file
|
|
|
559
561
|
|
|
560
562
|
#### Parameters
|
|
561
563
|
|
|
562
|
-
* `path` **[String][
|
|
564
|
+
* `path` **[String][126]** File path to read
|
|
563
565
|
|
|
564
|
-
Returns **[Promise][
|
|
566
|
+
Returns **[Promise][133]<[Blob][130]>** The eventual fetched file as a blob
|
|
565
567
|
|
|
566
568
|
## handshake
|
|
567
569
|
|
|
@@ -569,9 +571,9 @@ Return basic server information as a form of validation
|
|
|
569
571
|
|
|
570
572
|
### Properties
|
|
571
573
|
|
|
572
|
-
* `date` **[Date][
|
|
574
|
+
* `date` **[Date][128]** Server date
|
|
573
575
|
|
|
574
|
-
Returns **[Promise][
|
|
576
|
+
Returns **[Promise][133]<[Object][127]>** Basic promise result
|
|
575
577
|
|
|
576
578
|
## User
|
|
577
579
|
|
|
@@ -579,16 +581,16 @@ User / active session within TERA
|
|
|
579
581
|
|
|
580
582
|
### Properties
|
|
581
583
|
|
|
582
|
-
* `id` **[String][
|
|
583
|
-
* `email` **[String][
|
|
584
|
-
* `name` **[String][
|
|
585
|
-
* `isSubscribed` **[Boolean][
|
|
584
|
+
* `id` **[String][126]** Unique identifier of the user
|
|
585
|
+
* `email` **[String][126]** The email address of the current user
|
|
586
|
+
* `name` **[String][126]** The provided full name of the user
|
|
587
|
+
* `isSubscribed` **[Boolean][135]** Whether the active user has a TERA subscription
|
|
586
588
|
|
|
587
589
|
## getUser
|
|
588
590
|
|
|
589
591
|
Fetch the current session user
|
|
590
592
|
|
|
591
|
-
Returns **[Promise][
|
|
593
|
+
Returns **[Promise][133]<[User][78]>** The current logged in user or null if none
|
|
592
594
|
|
|
593
595
|
## requireUser
|
|
594
596
|
|
|
@@ -598,11 +600,11 @@ This is an pre-requisite step for requireProject()
|
|
|
598
600
|
|
|
599
601
|
### Parameters
|
|
600
602
|
|
|
601
|
-
* `options` **[Object][
|
|
603
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
602
604
|
|
|
603
|
-
* `options.forceRetry` **[Boolean][
|
|
605
|
+
* `options.forceRetry` **[Boolean][135]** Forcabily try to refresh the user state (optional, default `false`)
|
|
604
606
|
|
|
605
|
-
Returns **[Promise][
|
|
607
|
+
Returns **[Promise][133]<[User][78]>** The current logged in user or null if none
|
|
606
608
|
|
|
607
609
|
## Project
|
|
608
610
|
|
|
@@ -612,13 +614,13 @@ Project entry within TERA
|
|
|
612
614
|
|
|
613
615
|
Get the currently active project, if any
|
|
614
616
|
|
|
615
|
-
Returns **[Promise][
|
|
617
|
+
Returns **[Promise][133]<([Project][83] | null)>** The currently active project, if any
|
|
616
618
|
|
|
617
619
|
## getProjects
|
|
618
620
|
|
|
619
621
|
Get a list of projects the current session user has access to
|
|
620
622
|
|
|
621
|
-
Returns **[Promise][
|
|
623
|
+
Returns **[Promise][133]<[Array][132]<[Project][83]>>** Collection of projects the user has access to
|
|
622
624
|
|
|
623
625
|
## setActiveProject
|
|
624
626
|
|
|
@@ -626,7 +628,7 @@ Set the currently active project within TERA
|
|
|
626
628
|
|
|
627
629
|
### Parameters
|
|
628
630
|
|
|
629
|
-
* `project` **([Object][
|
|
631
|
+
* `project` **([Object][127] | [String][126])** The project to set as active - either the full Project object or its ID
|
|
630
632
|
|
|
631
633
|
## requireProject
|
|
632
634
|
|
|
@@ -635,14 +637,14 @@ Note that this function will percist in asking the uesr even if they try to canc
|
|
|
635
637
|
|
|
636
638
|
### Parameters
|
|
637
639
|
|
|
638
|
-
* `options` **[Object][
|
|
640
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
639
641
|
|
|
640
|
-
* `options.autoSetActiveProject` **[Boolean][
|
|
641
|
-
* `options.title` **[String][
|
|
642
|
-
* `options.noSelectTitle` **[String][
|
|
643
|
-
* `options.noSelectBody` **[String][
|
|
642
|
+
* `options.autoSetActiveProject` **[Boolean][135]** After selecting a project set that project as active in TERA (optional, default `true`)
|
|
643
|
+
* `options.title` **[String][126]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
644
|
+
* `options.noSelectTitle` **[String][126]** Dialog title when warning the user they need to select something (optional, default `'Select project'`)
|
|
645
|
+
* `options.noSelectBody` **[String][126]** Dialog body when warning the user they need to select something (optional, default `'A project needs to be selected to continue'`)
|
|
644
646
|
|
|
645
|
-
Returns **[Promise][
|
|
647
|
+
Returns **[Promise][133]<[Project][83]>** The active project
|
|
646
648
|
|
|
647
649
|
## selectProject
|
|
648
650
|
|
|
@@ -650,13 +652,13 @@ Prompt the user to select a project from those available
|
|
|
650
652
|
|
|
651
653
|
### Parameters
|
|
652
654
|
|
|
653
|
-
* `options` **[Object][
|
|
655
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
654
656
|
|
|
655
|
-
* `options.title` **[String][
|
|
656
|
-
* `options.allowCancel` **[Boolean][
|
|
657
|
-
* `options.setActive` **[Boolean][
|
|
657
|
+
* `options.title` **[String][126]** The title of the dialog to display (optional, default `"Select a project to work with"`)
|
|
658
|
+
* `options.allowCancel` **[Boolean][135]** Advertise cancelling the operation, the dialog can still be cancelled by closing it (optional, default `true`)
|
|
659
|
+
* `options.setActive` **[Boolean][135]** Also set the project as active when selected (optional, default `false`)
|
|
658
660
|
|
|
659
|
-
Returns **[Promise][
|
|
661
|
+
Returns **[Promise][133]<[Project][83]>** The active project
|
|
660
662
|
|
|
661
663
|
## getProjectState
|
|
662
664
|
|
|
@@ -664,12 +666,12 @@ Return the current, full snapshot state of the active project
|
|
|
664
666
|
|
|
665
667
|
### Parameters
|
|
666
668
|
|
|
667
|
-
* `options` **[Object][
|
|
669
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
668
670
|
|
|
669
|
-
* `options.autoRequire` **[Boolean][
|
|
670
|
-
* `Paths` **[Array][
|
|
671
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
672
|
+
* `Paths` **[Array][132]<[String][126]>** to subscribe to e.g. \['/users/'],
|
|
671
673
|
|
|
672
|
-
Returns **[Promise][
|
|
674
|
+
Returns **[Promise][133]<[Object][127]>** The current project state snapshot
|
|
673
675
|
|
|
674
676
|
## setProjectState
|
|
675
677
|
|
|
@@ -681,13 +683,13 @@ Paths can be any valid Lodash.set() value such as:
|
|
|
681
683
|
|
|
682
684
|
### Parameters
|
|
683
685
|
|
|
684
|
-
* `path` **([String][
|
|
686
|
+
* `path` **([String][126] | [Array][132]<[String][126]>)** The sub-path within the project state to set
|
|
685
687
|
* `value` **any** The value to set
|
|
686
|
-
* `options` **[Object][
|
|
688
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
687
689
|
|
|
688
|
-
* `options.save` **[Boolean][
|
|
690
|
+
* `options.save` **[Boolean][135]** Save the changes to the server immediately, disable to queue up multiple writes (optional, default `true`)
|
|
689
691
|
|
|
690
|
-
Returns **[Promise][
|
|
692
|
+
Returns **[Promise][133]** A promise which resolves when the operation has been dispatched to the server
|
|
691
693
|
|
|
692
694
|
## setProjectStateDefaults
|
|
693
695
|
|
|
@@ -697,17 +699,17 @@ Set a nested value within the project state - just like `setProjectState()` - bu
|
|
|
697
699
|
|
|
698
700
|
### Parameters
|
|
699
701
|
|
|
700
|
-
* `path` **([String][
|
|
702
|
+
* `path` **([String][126] | [Array][132]<[String][126]>)** The sub-path within the project state to set
|
|
701
703
|
* `value` **any** The value to set
|
|
702
|
-
* `options` **[Object][
|
|
704
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour, see setProjectState() for the full list of supported options
|
|
703
705
|
|
|
704
|
-
Returns **[Promise][
|
|
706
|
+
Returns **[Promise][133]<[Boolean][135]>** A promise which resolves to whether any changes were made - True if defaults were applied, false otherwise
|
|
705
707
|
|
|
706
708
|
## saveProjectState
|
|
707
709
|
|
|
708
710
|
Force-Save the currently active project state
|
|
709
711
|
|
|
710
|
-
Returns **[Promise][
|
|
712
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
711
713
|
|
|
712
714
|
## replaceProjectState
|
|
713
715
|
|
|
@@ -718,9 +720,9 @@ You almost never want to use this function directly, see `setProjectState(path,
|
|
|
718
720
|
|
|
719
721
|
### Parameters
|
|
720
722
|
|
|
721
|
-
* `newState` **[Object][
|
|
723
|
+
* `newState` **[Object][127]** The new state to replace the current state with
|
|
722
724
|
|
|
723
|
-
Returns **[Promise][
|
|
725
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
724
726
|
|
|
725
727
|
## applyProjectStatePatch
|
|
726
728
|
|
|
@@ -728,9 +730,9 @@ Apply a computed `just-diff` patch to the current project state
|
|
|
728
730
|
|
|
729
731
|
### Parameters
|
|
730
732
|
|
|
731
|
-
* `Patch` **[Object][
|
|
733
|
+
* `Patch` **[Object][127]** to apply
|
|
732
734
|
|
|
733
|
-
Returns **[Promise][
|
|
735
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
734
736
|
|
|
735
737
|
## subscribeProjectState
|
|
736
738
|
|
|
@@ -738,7 +740,7 @@ Subscribe to project state changes
|
|
|
738
740
|
This will dispatch an RPC call to the source object `applyProjectStatePatchLocal()` function with the patch
|
|
739
741
|
If the above call fails the subscriber is assumed as dead and unsubscribed from the polling list
|
|
740
742
|
|
|
741
|
-
Returns **[Promise][
|
|
743
|
+
Returns **[Promise][133]<[Function][139]>** A promise which resolves when a subscription has been created, call the resulting function to unsubscribe
|
|
742
744
|
|
|
743
745
|
## FileFilters
|
|
744
746
|
|
|
@@ -746,10 +748,10 @@ Data structure for a file filter
|
|
|
746
748
|
|
|
747
749
|
### Properties
|
|
748
750
|
|
|
749
|
-
* `library` **[Boolean][
|
|
750
|
-
* `filename` **[String][
|
|
751
|
-
* `basename` **[String][
|
|
752
|
-
* `ext` **[String][
|
|
751
|
+
* `library` **[Boolean][135]?** Restrict to library files only
|
|
752
|
+
* `filename` **[String][126]?** CSV of @momsfriendlydevco/match expressions to filter the filename by (filenames are the basename sans extension)
|
|
753
|
+
* `basename` **[String][126]?** CSV of @momsfriendlydevco/match expressions to filter the basename by
|
|
754
|
+
* `ext` **[String][126]?** CSV of @momsfriendlydevco/match expressions to filter the file extension by
|
|
753
755
|
|
|
754
756
|
## selectProjectFile
|
|
755
757
|
|
|
@@ -757,20 +759,20 @@ Prompt the user to select a library to operate on
|
|
|
757
759
|
|
|
758
760
|
### Parameters
|
|
759
761
|
|
|
760
|
-
* `options` **[Object][
|
|
762
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
761
763
|
|
|
762
|
-
* `options.title` **[String][
|
|
763
|
-
* `options.hint` **([String][
|
|
764
|
-
* `options.save` **[Boolean][
|
|
764
|
+
* `options.title` **[String][126]** The title of the dialog to display (optional, default `"Select a file"`)
|
|
765
|
+
* `options.hint` **([String][126] | [Array][132]<[String][126]>)?** Hints to identify the file to select in array order of preference
|
|
766
|
+
* `options.save` **[Boolean][135]** Set to truthy if saving a new file, UI will adjust to allowing overwrite OR new file name input (optional, default `false`)
|
|
765
767
|
* `options.filters` **[FileFilters][104]?** Optional file filters
|
|
766
|
-
* `options.allowUpload` **[Boolean][
|
|
767
|
-
* `options.allowRefresh` **[Boolean][
|
|
768
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
769
|
-
* `options.allowCancel` **[Boolean][
|
|
770
|
-
* `options.autoRequire` **[Boolean][
|
|
768
|
+
* `options.allowUpload` **[Boolean][135]** Allow uploading new files (optional, default `true`)
|
|
769
|
+
* `options.allowRefresh` **[Boolean][135]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
770
|
+
* `options.allowDownloadZip` **[Boolean][135]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
771
|
+
* `options.allowCancel` **[Boolean][135]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
772
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
771
773
|
* `options.filter` **[FileFilters][104]?** Optional file filters
|
|
772
774
|
|
|
773
|
-
Returns **[Promise][
|
|
775
|
+
Returns **[Promise][133]<[ProjectFile][1]>** The eventually selected file
|
|
774
776
|
|
|
775
777
|
## setProjectFile
|
|
776
778
|
|
|
@@ -778,10 +780,10 @@ Replace a project files contents
|
|
|
778
780
|
|
|
779
781
|
### Parameters
|
|
780
782
|
|
|
781
|
-
* `path` **[String][
|
|
782
|
-
* `contents` **(File | [Blob][
|
|
783
|
+
* `path` **[String][126]** File path to write
|
|
784
|
+
* `contents` **(File | [Blob][130] | [FormData][131] | [Object][127] | [Array][132])** The new file contents
|
|
783
785
|
|
|
784
|
-
Returns **[Promise][
|
|
786
|
+
Returns **[Promise][133]** A promise which will resolve when the write operation has completed
|
|
785
787
|
|
|
786
788
|
## selectProjectLibrary
|
|
787
789
|
|
|
@@ -789,18 +791,18 @@ Prompt the user to select a library to operate on and return a array of referenc
|
|
|
789
791
|
|
|
790
792
|
### Parameters
|
|
791
793
|
|
|
792
|
-
* `options` **[Object][
|
|
794
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
793
795
|
|
|
794
|
-
* `options.title` **[String][
|
|
795
|
-
* `options.hint` **([String][
|
|
796
|
-
* `options.allowUpload` **[Boolean][
|
|
797
|
-
* `options.allowRefresh` **[Boolean][
|
|
798
|
-
* `options.allowDownloadZip` **[Boolean][
|
|
799
|
-
* `options.allowCancel` **[Boolean][
|
|
800
|
-
* `options.autoRequire` **[Boolean][
|
|
796
|
+
* `options.title` **[String][126]** The title of the dialog to display (optional, default `"Select a citation library"`)
|
|
797
|
+
* `options.hint` **([String][126] | [Array][132]<[String][126]>)?** Hints to identify the library to select in array order of preference. Generally corresponds to the previous stage - e.g. 'deduped', 'review1', 'review2', 'dedisputed'
|
|
798
|
+
* `options.allowUpload` **[Boolean][135]** Allow uploading new files (optional, default `true`)
|
|
799
|
+
* `options.allowRefresh` **[Boolean][135]** Allow the user to manually refresh the file list (optional, default `true`)
|
|
800
|
+
* `options.allowDownloadZip` **[Boolean][135]** Allow the user to download a Zip of all files (optional, default `true`)
|
|
801
|
+
* `options.allowCancel` **[Boolean][135]** Allow cancelling the operation. Will throw `'CANCEL'` as the promise rejection if acationed (optional, default `true`)
|
|
802
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
801
803
|
* `options.filters` **[FileFilters][104]?** Optional file filters, defaults to citation library selection only
|
|
802
804
|
|
|
803
|
-
Returns **[Promise][
|
|
805
|
+
Returns **[Promise][133]<[Array][132]\<Ref>>** A collection of references from the selected file
|
|
804
806
|
|
|
805
807
|
## getProjectLibrary
|
|
806
808
|
|
|
@@ -808,15 +810,15 @@ Fetch + convert a project file into a library of citations
|
|
|
808
810
|
|
|
809
811
|
### Parameters
|
|
810
812
|
|
|
811
|
-
* `path` **[String][
|
|
812
|
-
* `options` **[Object][
|
|
813
|
+
* `path` **[String][126]** File path to read, if omitted the contents of `options` are used to guess at a suitable file
|
|
814
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
813
815
|
|
|
814
|
-
* `options.format` **[String][
|
|
815
|
-
* `options.autoRequire` **[Boolean][
|
|
816
|
-
* `options.filter` **[Function][
|
|
817
|
-
* `options.find` **[Function][
|
|
816
|
+
* `options.format` **[String][126]** Format for the file. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
817
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
818
|
+
* `options.filter` **[Function][139]?** Optional async file filter, called each time as `(File:ProjectFile)`
|
|
819
|
+
* `options.find` **[Function][139]?** Optional async final stage file filter to reduce all candidates down to one subject file
|
|
818
820
|
|
|
819
|
-
Returns **([Promise][
|
|
821
|
+
Returns **([Promise][133]<[Array][132]\<Ref>> | [Promise][133]\<any>)** A collection of references (default bevahiour) or a whatever format was requested
|
|
820
822
|
|
|
821
823
|
## setProjectLibrary
|
|
822
824
|
|
|
@@ -824,33 +826,42 @@ Save back a citation library from some input
|
|
|
824
826
|
|
|
825
827
|
### Parameters
|
|
826
828
|
|
|
827
|
-
* `path` **[String][
|
|
828
|
-
* `refs` **([Array][
|
|
829
|
-
* `options` **[Object][
|
|
829
|
+
* `path` **[String][126]?** File path to save back to, if omitted one will be prompted for
|
|
830
|
+
* `refs` **([Array][132]\<RefLibRef> | [Blob][130] | File)?** Collection of references for the selected library or the raw Blob/File
|
|
831
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
830
832
|
|
|
831
|
-
* `options.path` **[String][
|
|
832
|
-
* `options.refs` **([Array][
|
|
833
|
-
* `options.format` **[String][
|
|
834
|
-
* `options.autoRequire` **[Boolean][
|
|
835
|
-
* `options.hint` **[String][
|
|
836
|
-
* `options.filename` **[String][
|
|
837
|
-
* `options.title` **[String][
|
|
838
|
-
* `options.overwrite` **[Boolean][
|
|
839
|
-
* `options.meta` **[Object][
|
|
833
|
+
* `options.path` **[String][126]?** Alternate method to specify the path to save as, if omitted one will be prompted for
|
|
834
|
+
* `options.refs` **([Array][132]\<RefLibRef> | [Blob][130] | File)?** Alternate method to specify the refs to save as an array or raw Blob/File
|
|
835
|
+
* `options.format` **[String][126]** Input format used. ENUM: 'pojo' (return a parsed JS collection), 'blob' (raw JS Blob object), 'file' (named JS File object) (optional, default `'json'`)
|
|
836
|
+
* `options.autoRequire` **[Boolean][135]** Run `requireProject()` automatically before continuing (optional, default `true`)
|
|
837
|
+
* `options.hint` **[String][126]?** Hint to store against the library. Generally corresponds to the current operation being performed - e.g. 'deduped'
|
|
838
|
+
* `options.filename` **[String][126]?** Suggested filename if path is unspecified
|
|
839
|
+
* `options.title` **[String][126]** Dialog title if path is unspecified and we need to prompt (optional, default `'Save citation library'`)
|
|
840
|
+
* `options.overwrite` **[Boolean][135]** Allow existing file upsert (optional, default `true`)
|
|
841
|
+
* `options.meta` **[Object][127]?** Optional meta data to merge into the file data
|
|
840
842
|
|
|
841
|
-
Returns **[Promise][
|
|
843
|
+
Returns **[Promise][133]** A promise which resolves when the save operation has completed
|
|
842
844
|
|
|
843
845
|
## projectLog
|
|
844
846
|
|
|
845
847
|
Create a log entry for the currently active project
|
|
846
848
|
|
|
847
|
-
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][
|
|
849
|
+
The required log object can be of various forms. See [https://tera-tools.com/api/logs.json][140] for the full list
|
|
848
850
|
|
|
849
851
|
### Parameters
|
|
850
852
|
|
|
851
|
-
* `log` **[Object][
|
|
853
|
+
* `log` **[Object][127]** The log entry to create
|
|
852
854
|
|
|
853
|
-
Returns **[Promise][
|
|
855
|
+
Returns **[Promise][133]** A promise which resolves when the operation has completed
|
|
856
|
+
|
|
857
|
+
## setPageUrl
|
|
858
|
+
|
|
859
|
+
Set an active tools URL so that it survives a refresh
|
|
860
|
+
This only really makes a difference to tools within the tera-tools.com site where the tool is working as an embed
|
|
861
|
+
|
|
862
|
+
### Parameters
|
|
863
|
+
|
|
864
|
+
* `url` **[String][126]** The URL to restore on next refresh
|
|
854
865
|
|
|
855
866
|
## uiAlert
|
|
856
867
|
|
|
@@ -858,13 +869,13 @@ Display simple text within TERA
|
|
|
858
869
|
|
|
859
870
|
### Parameters
|
|
860
871
|
|
|
861
|
-
* `text` **[String][
|
|
862
|
-
* `options` **[Object][
|
|
872
|
+
* `text` **[String][126]** The text to display
|
|
873
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
863
874
|
|
|
864
|
-
* `options.title` **[String][
|
|
865
|
-
* `options.isHtml` **[Boolean][
|
|
875
|
+
* `options.title` **[String][126]** The title of the alert box (optional, default `'TERA'`)
|
|
876
|
+
* `options.isHtml` **[Boolean][135]** If falsy the text is rendered as plain-text otherwise it will be assumed as HTML content (optional, default `false`)
|
|
866
877
|
|
|
867
|
-
Returns **[Promise][
|
|
878
|
+
Returns **[Promise][133]** A promise which resolves when the alert has been dismissed
|
|
868
879
|
|
|
869
880
|
## uiSplat
|
|
870
881
|
|
|
@@ -873,10 +884,10 @@ This function is ideally called within a requestFocus() wrapper
|
|
|
873
884
|
|
|
874
885
|
### Parameters
|
|
875
886
|
|
|
876
|
-
* `content` **(DOMElement | [String][
|
|
877
|
-
* `options` **[Object][
|
|
887
|
+
* `content` **(DOMElement | [String][126] | `false`)** Either a prepared DOM element or string to compile, set to falsy to remove existing content
|
|
888
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
878
889
|
|
|
879
|
-
* `options.logo` **([Boolean][
|
|
890
|
+
* `options.logo` **([Boolean][135] | [String][126])** Add a logo to the output, if boolean true the Tera-tools logo is used otherwise specify a path or URL (optional, default `false`)
|
|
880
891
|
|
|
881
892
|
## uiWindow
|
|
882
893
|
|
|
@@ -884,13 +895,13 @@ Open a popup window containing a new site
|
|
|
884
895
|
|
|
885
896
|
### Parameters
|
|
886
897
|
|
|
887
|
-
* `url` **[String][
|
|
888
|
-
* `options` **[Object][
|
|
898
|
+
* `url` **[String][126]** The URL to open
|
|
899
|
+
* `options` **[Object][127]?** Additional options to mutate behaviour
|
|
889
900
|
|
|
890
|
-
* `options.width` **[Number][
|
|
891
|
-
* `options.height` **[Number][
|
|
892
|
-
* `options.center` **[Boolean][
|
|
893
|
-
* `options.permissions` **[Object][
|
|
901
|
+
* `options.width` **[Number][129]** The desired width of the window (optional, default `500`)
|
|
902
|
+
* `options.height` **[Number][129]** The desired height of the window (optional, default `600`)
|
|
903
|
+
* `options.center` **[Boolean][135]** Attempt to center the window on the screen (optional, default `true`)
|
|
904
|
+
* `options.permissions` **[Object][127]?** Additional permissions to set on opening, defaults to a suitable set of permission for popups (see code)
|
|
894
905
|
|
|
895
906
|
Returns **WindowProxy** The opened window object (if `noopener` is not set in permissions)
|
|
896
907
|
|
|
@@ -1128,44 +1139,48 @@ Returns **WindowProxy** The opened window object (if `noopener` is not set in pe
|
|
|
1128
1139
|
|
|
1129
1140
|
[117]: #parameters-35
|
|
1130
1141
|
|
|
1131
|
-
[118]: #
|
|
1142
|
+
[118]: #setpageurl
|
|
1132
1143
|
|
|
1133
1144
|
[119]: #parameters-36
|
|
1134
1145
|
|
|
1135
|
-
[120]: #
|
|
1146
|
+
[120]: #uialert
|
|
1136
1147
|
|
|
1137
1148
|
[121]: #parameters-37
|
|
1138
1149
|
|
|
1139
|
-
[122]: #
|
|
1150
|
+
[122]: #uisplat
|
|
1140
1151
|
|
|
1141
1152
|
[123]: #parameters-38
|
|
1142
1153
|
|
|
1143
|
-
[124]:
|
|
1154
|
+
[124]: #uiwindow
|
|
1155
|
+
|
|
1156
|
+
[125]: #parameters-39
|
|
1157
|
+
|
|
1158
|
+
[126]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
1144
1159
|
|
|
1145
|
-
[
|
|
1160
|
+
[127]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
1146
1161
|
|
|
1147
|
-
[
|
|
1162
|
+
[128]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date
|
|
1148
1163
|
|
|
1149
|
-
[
|
|
1164
|
+
[129]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
1150
1165
|
|
|
1151
|
-
[
|
|
1166
|
+
[130]: https://developer.mozilla.org/docs/Web/API/Blob
|
|
1152
1167
|
|
|
1153
|
-
[
|
|
1168
|
+
[131]: https://developer.mozilla.org/docs/Web/API/FormData
|
|
1154
1169
|
|
|
1155
|
-
[
|
|
1170
|
+
[132]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1156
1171
|
|
|
1157
|
-
[
|
|
1172
|
+
[133]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise
|
|
1158
1173
|
|
|
1159
|
-
[
|
|
1174
|
+
[134]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
|
1160
1175
|
|
|
1161
|
-
[
|
|
1176
|
+
[135]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
1162
1177
|
|
|
1163
|
-
[
|
|
1178
|
+
[136]: https://developer.mozilla.org/docs/Web/API/Window
|
|
1164
1179
|
|
|
1165
|
-
[
|
|
1180
|
+
[137]: https://developer.mozilla.org/docs/Web/API/MessageEvent
|
|
1166
1181
|
|
|
1167
|
-
[
|
|
1182
|
+
[138]: http://jsonpatch.com
|
|
1168
1183
|
|
|
1169
|
-
[
|
|
1184
|
+
[139]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function
|
|
1170
1185
|
|
|
1171
|
-
[
|
|
1186
|
+
[140]: https://tera-tools.com/api/logs.json
|