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