meeting-pane 2.3.13-3c0b6068 → 2.3.14-2f08cf43

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.
@@ -4,19 +4,14 @@
4
4
  **
5
5
  ** Putting together some of the tools we have to manage a Meeting
6
6
  */
7
+
7
8
  // const VideoRoomPrefix = 'https://appear.in/'
8
9
  var logic = require('solid-logic');
9
-
10
10
  var VideoRoomPrefix = 'https://meet.jit.si/';
11
-
12
11
  var UI = require('solid-ui');
13
-
14
12
  var ns = UI.ns;
15
-
16
13
  var $rdf = require('rdflib');
17
-
18
14
  var meetingDetailsFormText = require('./meetingDetailsForm.js');
19
-
20
15
  module.exports = {
21
16
  icon: UI.icons.iconBase + 'noun_66617.svg',
22
17
  name: 'meeting',
@@ -24,17 +19,17 @@ module.exports = {
24
19
  label: function label(subject, context) {
25
20
  var kb = context.session.store;
26
21
  var ns = UI.ns;
27
-
28
22
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('Meeting'))) {
29
23
  return 'Meeting';
30
24
  }
31
-
32
25
  return null; // Suppress pane otherwise
33
26
  },
27
+
34
28
  // Create a new Meeting thing
35
29
  //
36
30
  // returns: A promise of a meeting object
37
31
  //
32
+
38
33
  mintClass: UI.ns.meeting('Meeting'),
39
34
  mintNew: function mintNew(context, options) {
40
35
  return new Promise(function (resolve, reject) {
@@ -44,11 +39,9 @@ module.exports = {
44
39
  var meeting = options.newInstance;
45
40
  var meetingDoc = meeting.doc();
46
41
  var me = logic.authn.currentUser();
47
-
48
42
  if (me) {
49
43
  kb.add(meeting, ns.dc('author'), me, meetingDoc);
50
44
  }
51
-
52
45
  kb.add(meeting, ns.rdf('type'), ns.meeting('Meeting'), meetingDoc);
53
46
  kb.add(meeting, ns.dc('created'), new Date(), meetingDoc);
54
47
  kb.add(meeting, ns.ui('backgroundColor'), new $rdf.Literal('#ddddcc', undefined, ns.xsd('color')), meetingDoc);
@@ -66,13 +59,13 @@ module.exports = {
66
59
  });
67
60
  },
68
61
  // Returns a div
62
+
69
63
  render: function render(subject, dataBrowserContext) {
70
64
  var dom = dataBrowserContext.dom;
71
65
  var kb = dataBrowserContext.session.store;
72
66
  var ns = UI.ns;
73
67
  var updater = kb.updater;
74
68
  var thisPane = this;
75
-
76
69
  var complain = function complain(message, color) {
77
70
  console.log(message);
78
71
  var pre = dom.createElement('pre');
@@ -80,11 +73,9 @@ module.exports = {
80
73
  div.appendChild(pre);
81
74
  pre.appendChild(dom.createTextNode(message));
82
75
  };
83
-
84
76
  var complainIfBad = function complainIfBad(ok, message) {
85
77
  if (!ok) complain(message);
86
78
  };
87
-
88
79
  var meeting = subject;
89
80
  var meetingDoc = subject.doc();
90
81
  var meetingBase = subject.dir().uri;
@@ -93,7 +84,6 @@ module.exports = {
93
84
  table.style = 'width: 100%; height: 100%; margin:0;';
94
85
  var topTR = table.appendChild(dom.createElement('tr'));
95
86
  topTR.appendChild(dom.createElement('div')); // topDiv
96
-
97
87
  var mainTR = table.appendChild(dom.createElement('tr'));
98
88
  var toolBar0 = table.appendChild(dom.createElement('td'));
99
89
  var toolBar1 = toolBar0.appendChild(dom.createElement('table'));
@@ -113,16 +103,13 @@ module.exports = {
113
103
  }
114
104
  });
115
105
  };
116
-
117
106
  var saveAppDocumentLinkAndAddNewThing = function saveAppDocumentLinkAndAddNewThing(tool, thing, pred) {
118
107
  var appDoc = thing.doc();
119
-
120
108
  if (pred) {
121
109
  kb.add(meeting, pred, thing, appDoc); // Specific Link back to meeting
122
110
  }
123
111
 
124
112
  kb.add(thing, ns.meeting('parentMeeting'), meeting, appDoc); // Generic link back to meeting
125
-
126
113
  updater.put(appDoc, kb.statementsMatching(undefined, undefined, undefined, appDoc), 'text/turtle', function (uri2, ok, message) {
127
114
  if (ok) {
128
115
  saveBackMeetingDoc();
@@ -131,12 +118,10 @@ module.exports = {
131
118
  }
132
119
  });
133
120
  };
134
-
135
121
  var makeToolNode = function makeToolNode(target, pred, label, iconURI) {
136
122
  if (pred) {
137
123
  kb.add(meeting, pred, target, meetingDoc);
138
124
  }
139
-
140
125
  var x = UI.widgets.newThing(meetingDoc);
141
126
  if (label) kb.add(x, ns.rdfs('label'), label, meetingDoc);
142
127
  if (iconURI) kb.add(x, ns.meeting('icon'), kb.sym(iconURI), meetingDoc);
@@ -145,26 +130,25 @@ module.exports = {
145
130
  var toolList = kb.the(meeting, ns.meeting('toolList'));
146
131
  toolList.elements.push(x);
147
132
  return x;
148
- }; // Map from end-user non-iframeable Google maps URI to G Maps API
133
+ };
134
+
135
+ // Map from end-user non-iframeable Google maps URI to G Maps API
149
136
  // Input: like https://www.google.co.uk/maps/place/Mastercard/@53.2717971,-6.2042699,17z/...
150
137
  // Output:
151
-
152
-
153
138
  function googleMapsSpecial(page) {
154
139
  var initialPrefix = /https:\/\/www\.google\..*\/maps\//;
155
140
  var finalPrefix = 'https://www.google.com/maps/embed/v1/';
156
141
  var myPersonalApiKEY = 'AIzaSyB8aaT6bY9tcLCmc2oPCkdUYLmTOWM8R54'; // Get your own key!
157
142
  // GET YOUR KEY AT https://developers.google.com/maps/documentation/javascript/
158
-
159
143
  var uri = page.uri;
160
144
  if (!uri.match(initialPrefix)) return page;
161
145
  if (uri.startsWith(finalPrefix)) return page; // Already done
162
-
163
146
  var map = uri.replace(initialPrefix, finalPrefix) + '&key=' + myPersonalApiKEY;
164
147
  console.log('Converted Google Map URI! ' + map);
165
148
  return $rdf.sym(map);
166
- } // //////////////////// DRAG and Drop
149
+ }
167
150
 
151
+ // //////////////////// DRAG and Drop
168
152
 
169
153
  var handleDroppedThing = function handleDroppedThing(target) {
170
154
  // @@ idea: look
@@ -175,7 +159,6 @@ module.exports = {
175
159
  var tool = makeToolNode(target, UI.ns.wf('attachment'), UI.utils.label(target), null);
176
160
  kb.add(tool, UI.ns.meeting('view'), 'iframe', meetingDoc);
177
161
  };
178
-
179
162
  var addLink = function addLink(target) {
180
163
  var pred = ns.wf('attachment');
181
164
  kb.add(subject, pred, target, subject.doc());
@@ -184,8 +167,8 @@ module.exports = {
184
167
  // right arrow "link"
185
168
  limit: 1,
186
169
  shareTab: true // but many things behind it
187
-
188
170
  };
171
+
189
172
  var newPaneOptions = {
190
173
  newInstance: subject,
191
174
  // kb.sym(subject.doc().uri + '#LinkListTool'),
@@ -198,45 +181,37 @@ module.exports = {
198
181
  noIndexHTML: true
199
182
  };
200
183
  return makeNewPaneTool(toolObject, newPaneOptions);
201
- }; // When paerson added to he meeting, make an ad hoc group
202
- // of meeting participants is one does not already exist, and add them
203
-
184
+ };
204
185
 
186
+ // When paerson added to he meeting, make an ad hoc group
187
+ // of meeting participants is one does not already exist, and add them
205
188
  var addParticipant = function addParticipant(target) {
206
189
  var pref = kb.any(target, ns.foaf('preferredURI'));
207
190
  var obj = pref ? kb.sym(pref) : target;
208
191
  var group = kb.any(meeting, ns.meeting('attendeeGroup'));
209
-
210
192
  var addPersonToGroup = function addPersonToGroup(obj, group) {
211
193
  var ins = [$rdf.st(group, UI.ns.vcard('hasMember'), obj, group.doc())]; // @@@ Complex rules about webid?
212
-
213
194
  var name = kb.any(obj, ns.vcard('fn')) || kb.any(obj, ns.foaf('name'));
214
-
215
195
  if (name) {
216
196
  ins.push($rdf.st(obj, UI.ns.vcard('fn'), name, group.doc()));
217
197
  }
218
-
219
198
  kb.fetcher.nowOrWhenFetched(group.doc(), undefined, function (ok, _body) {
220
199
  if (!ok) {
221
200
  complain("Can't read group to add person" + group);
222
201
  return;
223
202
  }
224
-
225
203
  kb.updater.update([], ins, function (uri, ok, body) {
226
204
  complainIfBad(ok, body);
227
-
228
205
  if (ok) {
229
206
  console.log('Addded to particpants OK: ' + obj);
230
207
  }
231
208
  });
232
209
  });
233
210
  };
234
-
235
211
  if (group) {
236
212
  addPersonToGroup(obj, group);
237
213
  return;
238
214
  }
239
-
240
215
  makeParticipantsGroup().then(function (options) {
241
216
  var group = options.newInstance;
242
217
  addPersonToGroup(obj, group);
@@ -249,93 +224,73 @@ module.exports = {
249
224
  complain(err);
250
225
  });
251
226
  };
252
-
253
227
  console.log('Dropped on thing ' + target); // icon was: UI.icons.iconBase + 'noun_25830.svg'
254
-
255
228
  var u = target.uri;
256
-
257
229
  if (u.startsWith('http:') && u.indexOf('#') < 0) {
258
230
  // insecure Plain document
259
231
  addLink(target);
260
232
  return resolve(target);
261
233
  }
262
-
263
234
  kb.fetcher.nowOrWhenFetched(target, function (ok, mess) {
264
235
  function addAttachmentTab(target) {
265
236
  target = googleMapsSpecial(target);
266
237
  console.log('make web page attachement tab ' + target); // icon was: UI.icons.iconBase + 'noun_25830.svg'
267
-
268
238
  var tool = makeToolNode(target, UI.ns.wf('attachment'), UI.utils.label(target), null);
269
239
  kb.add(tool, UI.ns.meeting('view'), 'iframe', meetingDoc);
270
240
  return resolve(target);
271
241
  }
272
-
273
242
  if (!ok) {
274
243
  console.log('Error looking up dropped thing, will just add it anyway. ' + target + ': ' + mess);
275
244
  return addAttachmentTab(target); // You can still try iframing it. (Could also add to list of links in PersonTR widgets)
276
245
  } else {
277
246
  var obj = target;
278
247
  var types = kb.findTypeURIs(obj);
279
-
280
248
  for (var ty in types) {
281
249
  console.log(' drop object type includes: ' + ty);
282
250
  }
283
-
284
251
  if (ns.vcard('Individual').uri in types || ns.foaf('Person').uri in types || ns.foaf('Agent').uri in types) {
285
252
  addParticipant(target);
286
253
  return resolve(target);
287
254
  }
288
-
289
255
  if (u.startsWith('https:') && u.indexOf('#') < 0) {
290
256
  // Plain secure document
291
257
  // can we iframe it?
292
258
  var hh = kb.fetcher.getHeader(target, 'x-frame-options');
293
259
  var ok2 = true;
294
-
295
260
  if (hh) {
296
261
  for (var j = 0; j < hh.length; j++) {
297
262
  console.log('x-frame-options: ' + hh[j]);
298
-
299
263
  if (hh[j].indexOf('sameorigin') < 0) {
300
264
  // (and diff origin @@)
301
265
  ok2 = false;
302
266
  }
303
-
304
267
  if (hh[j].indexOf('deny') < 0) {
305
268
  ok2 = false;
306
269
  }
307
270
  }
308
271
  }
309
-
310
272
  if (ok2) {
311
273
  target = googleMapsSpecial(target); // tweak Google maps to embed OK
312
-
313
274
  addIframeTool(target); // Something we can maybe iframe
314
-
315
275
  return resolve(target);
316
276
  }
317
277
  } // Something we cannot iframe, and must link to:
318
-
319
-
320
278
  console.log('Default: assume web page attachement ' + target); // icon was: UI.icons.iconBase + 'noun_25830.svg'
321
-
322
279
  return addAttachmentTab(target);
323
280
  }
324
281
  });
325
282
  }); // promise
326
- }; // When a set of URIs are dropped on the tabs
327
-
283
+ };
328
284
 
285
+ // When a set of URIs are dropped on the tabs
329
286
  var droppedURIHandler = function droppedURIHandler(uris) {
330
287
  Promise.all(uris.map(function (u) {
331
288
  var target = $rdf.sym(u); // Attachment needs text label to disinguish I think not icon.
332
-
333
289
  return handleDroppedThing(target); // can add to meetingDoc but must be sync
334
290
  })).then(function (_a) {
335
291
  saveBackMeetingDoc();
336
292
  });
337
293
  };
338
-
339
294
  var droppedFileHandler = function droppedFileHandler(files) {
340
295
  UI.widgets.uploadFiles(kb.fetcher, files, meeting.dir().uri + 'Files', meeting.dir().uri + 'Pictures', function (theFile, _destURI) {
341
296
  if (theFile.type.startsWith('image/')) {
@@ -344,21 +299,19 @@ module.exports = {
344
299
  makeMaterialsFolder('Pictures');
345
300
  }
346
301
  });
347
- }; // ////////////////////////////////////////////////////// end of drag drop
302
+ };
348
303
 
304
+ // ////////////////////////////////////////////////////// end of drag drop
349
305
 
350
306
  var makeGroup = function makeGroup(_toolObject) {
351
307
  var newBase = meetingBase + 'Group/';
352
308
  var kb = dataBrowserContext.session.store;
353
309
  var group = kb.any(meeting, ns.meeting('particpants'));
354
-
355
310
  if (!group) {
356
311
  group = $rdf.sym(newBase + 'index.ttl#this');
357
312
  }
358
-
359
313
  console.log('Participant group: ' + group);
360
314
  var tool = makeToolNode(group, ns.meeting('particpants'), 'Particpants', UI.icons.iconBase + 'noun_339237.svg'); // group: noun_339237.svg 'noun_15695.svg'
361
-
362
315
  kb.add(tool, UI.ns.meeting('view'), 'peoplePicker', meetingDoc);
363
316
  saveBackMeetingDoc();
364
317
  };
@@ -391,8 +344,6 @@ module.exports = {
391
344
  )
392
345
  }
393
346
  */
394
-
395
-
396
347
  var makePoll = function makePoll(toolObject) {
397
348
  var newPaneOptions = {
398
349
  useExisting: meeting,
@@ -407,15 +358,14 @@ module.exports = {
407
358
  };
408
359
  return makeNewPaneTool(toolObject, newPaneOptions);
409
360
  };
410
-
411
361
  var makePicturesFolder = function makePicturesFolder(folderName) {
412
362
  var toolObject = {
413
363
  icon: 'noun_598334.svg',
414
364
  // Slideshow @@ find a "picture" icon?
415
365
  limit: 1,
416
366
  shareTab: true // but many things behind it
417
-
418
367
  };
368
+
419
369
  var newPaneOptions = {
420
370
  newInstance: kb.sym(meeting.dir().uri + folderName + '/'),
421
371
  pane: dataBrowserContext.session.paneRegistry.byName('folder'),
@@ -428,15 +378,14 @@ module.exports = {
428
378
  };
429
379
  return makeNewPaneTool(toolObject, newPaneOptions);
430
380
  };
431
-
432
381
  var makeMaterialsFolder = function makeMaterialsFolder(_folderName) {
433
382
  var toolObject = {
434
383
  icon: 'noun_681601.svg',
435
384
  // Document
436
385
  limit: 1,
437
386
  shareTab: true // but many things behind it
438
-
439
387
  };
388
+
440
389
  var options = {
441
390
  newInstance: kb.sym(meeting.dir().uri + 'Files/'),
442
391
  pane: dataBrowserContext.session.paneRegistry.byName('folder'),
@@ -446,7 +395,6 @@ module.exports = {
446
395
  };
447
396
  return makeNewPaneTool(toolObject, options);
448
397
  };
449
-
450
398
  var makeParticipantsGroup = function makeParticipantsGroup() {
451
399
  var toolObject = {
452
400
  icon: 'noun_339237.svg',
@@ -454,8 +402,8 @@ module.exports = {
454
402
  limit: 1,
455
403
  // Only one tab
456
404
  shareTab: true // but many things behind it
457
-
458
405
  };
406
+
459
407
  var options = {
460
408
  newInstance: kb.sym(meeting.dir().uri + 'Attendees/index.ttl#this'),
461
409
  pane: dataBrowserContext.session.paneRegistry.byName('contact'),
@@ -466,8 +414,9 @@ module.exports = {
466
414
  noIndexHTML: true
467
415
  };
468
416
  return makeNewPaneTool(toolObject, options);
469
- }; // Make Pad for notes of meeting
417
+ };
470
418
 
419
+ // Make Pad for notes of meeting
471
420
 
472
421
  var makePad = function makePad(toolObject) {
473
422
  var newPaneOptions = {
@@ -477,15 +426,15 @@ module.exports = {
477
426
  pane: dataBrowserContext.session.paneRegistry.byName('pad')
478
427
  };
479
428
  return makeNewPaneTool(toolObject, newPaneOptions);
480
- }; // Make Sub-meeting of meeting
429
+ };
481
430
 
431
+ // Make Sub-meeting of meeting
482
432
 
483
433
  var makeMeeting = function makeMeeting(toolObject) {
484
434
  UI.widgets.askName(dom, kb, parameterCell, ns.foaf('name'), UI.ns.meeting('Meeting')).then(function (name) {
485
435
  if (!name) {
486
436
  return resetTools();
487
437
  }
488
-
489
438
  var URIsegment = encodeURIComponent(name);
490
439
  var options = {
491
440
  newBase: meetingBase + URIsegment + '/',
@@ -498,28 +447,26 @@ module.exports = {
498
447
  })["catch"](function (e) {
499
448
  complain('Error making new sub-meeting: ' + e);
500
449
  });
501
- }; // Returns promise of newPaneOptions
450
+ };
451
+
452
+ // Returns promise of newPaneOptions
502
453
  // In: options.
503
454
  // me?, predicate, newInstance ?, newBase, instanceClass
504
455
  // out: options. the above plus
505
456
  // me, newInstance
506
457
 
507
-
508
458
  function makeNewPaneTool(toolObject, options) {
509
459
  return new Promise(function (resolve, reject) {
510
460
  var kb = dataBrowserContext.session.store;
511
-
512
461
  if (!options.useExisting) {
513
462
  // useExisting means use existing object in new role
514
463
  var existing = kb.any(meeting, options.predicate);
515
-
516
464
  if (existing) {
517
465
  if (toolObject.limit && toolObject.limit === 1 && !toolObject.shareTab) {
518
466
  complain('Already have ' + existing + ' as ' + UI.utils.label(options.predicate));
519
467
  complain('Cant have two');
520
468
  return resolve(null);
521
469
  }
522
-
523
470
  if (toolObject.shareTab) {
524
471
  // return existing one
525
472
  console.log('Using existing ' + existing + ' as ' + UI.utils.label(options.predicate));
@@ -531,20 +478,16 @@ module.exports = {
531
478
  }
532
479
  }
533
480
  }
534
-
535
481
  if (!me && !options.me) {
536
482
  reject(new Error('Username not defined for new tool'));
537
483
  }
538
-
539
484
  options.me = options.me || me;
540
485
  options.newInstance = options.useExisting || options.newInstance || kb.sym(options.newBase + 'index.ttl#this');
541
486
  options.pane.mintNew(dataBrowserContext, options).then(function (options) {
542
487
  var tool = makeToolNode(options.newInstance, options.predicate, options.tabTitle, options.pane.icon);
543
-
544
488
  if (options.view) {
545
489
  kb.add(tool, UI.ns.meeting('view'), options.view, meetingDoc);
546
490
  }
547
-
548
491
  saveBackMeetingDoc();
549
492
  kb.fetcher.putBack(meetingDoc, {
550
493
  contentType: 'text/turtle'
@@ -559,14 +502,12 @@ module.exports = {
559
502
  });
560
503
  });
561
504
  }
562
-
563
- var makeAgenda = function makeAgenda(_toolObject) {// selectTool(icon)
505
+ var makeAgenda = function makeAgenda(_toolObject) {
506
+ // selectTool(icon)
564
507
  };
565
-
566
508
  var makeActions = function makeActions(_toolObject) {
567
509
  var newBase = meetingBase + 'Actions/';
568
510
  var kb = dataBrowserContext.session.store;
569
-
570
511
  if (kb.holds(meeting, ns.meeting('actions'))) {
571
512
  console.log('Ignored - already have actions');
572
513
  return; // already got one
@@ -581,17 +522,16 @@ module.exports = {
581
522
  kb.add(newInstance, ns.wf('stateStore'), stateStore, appDoc);
582
523
  kb.add(newInstance, ns.wf('assigneeClass'), ns.foaf('Person'), appDoc); // @@ set to people in the meeting?
583
524
 
584
- kb.add(newInstance, ns.rdf('type'), ns.wf('Tracker'), appDoc); // Flag its type in the chat itself as well as in the master meeting config file
525
+ kb.add(newInstance, ns.rdf('type'), ns.wf('Tracker'), appDoc);
585
526
 
527
+ // Flag its type in the chat itself as well as in the master meeting config file
586
528
  kb.add(newInstance, ns.rdf('type'), ns.wf('Tracker'), appDoc);
587
529
  var tool = makeToolNode(newInstance, ns.meeting('actions'), 'Actions', UI.icons.iconBase + 'noun_17020.svg');
588
530
  saveAppDocumentLinkAndAddNewThing(tool, newInstance, ns.meeting('actions'));
589
531
  };
590
-
591
532
  var makeChat = function makeChat(_toolObject) {
592
533
  var newBase = meetingBase + 'Chat/';
593
534
  var kb = dataBrowserContext.session.store;
594
-
595
535
  if (kb.holds(meeting, ns.meeting('chat'))) {
596
536
  console.log('Ignored - already have chat');
597
537
  return; // already got one
@@ -602,11 +542,9 @@ module.exports = {
602
542
  var tool = makeToolNode(messageStore, ns.meeting('chat'), 'Chat', UI.icons.iconBase + 'noun_346319.svg');
603
543
  saveAppDocumentLinkAndAddNewThing(tool, messageStore, ns.meeting('chat'));
604
544
  };
605
-
606
545
  var makeVideoCall = function makeVideoCall(_toolObject) {
607
546
  var kb = dataBrowserContext.session.store;
608
547
  var newInstance = $rdf.sym(VideoRoomPrefix + UI.utils.genUuid());
609
-
610
548
  if (kb.holds(meeting, ns.meeting('videoCallPage'))) {
611
549
  console.log('Ignored - already have a videoCallPage');
612
550
  return; // already got one
@@ -617,13 +555,11 @@ module.exports = {
617
555
  kb.add(tool, ns.meeting('view'), 'iframe', meetingDoc);
618
556
  saveBackMeetingDoc();
619
557
  };
620
-
621
558
  var makeAttachment = function makeAttachment(_toolObject) {
622
559
  UI.widgets.askName(dom, kb, parameterCell, ns.log('uri'), UI.ns.rdf('Resource')).then(function (uri) {
623
560
  if (!uri) {
624
561
  return resetTools();
625
562
  }
626
-
627
563
  var kb = dataBrowserContext.session.store;
628
564
  var ns = UI.ns;
629
565
  var target = kb.sym(uri);
@@ -634,28 +570,23 @@ module.exports = {
634
570
  complain('Error making new sub-meeting: ' + e);
635
571
  });
636
572
  };
637
-
638
573
  var makeSharing = function makeSharing(toolObject) {
639
574
  var kb = dataBrowserContext.session.store;
640
575
  var ns = UI.ns;
641
576
  var target = meeting.dir();
642
-
643
577
  if (toolObject.limit && toolObject.limit === 1 && kb.holds(meeting, ns.wf('sharingControl'))) {
644
578
  complain('Ignored - already have ' + UI.utils.label(options.predicate));
645
579
  return;
646
580
  }
647
-
648
581
  var tool = makeToolNode(target, ns.wf('sharingControl'), 'Sharing', UI.icons.iconBase + 'noun_123691.svg');
649
582
  kb.add(tool, ns.meeting('view'), 'sharing', meetingDoc);
650
583
  saveBackMeetingDoc();
651
584
  };
652
-
653
585
  var makeNewMeeting = function makeNewMeeting() {
654
586
  // @@@ make option of continuing series
655
587
  var appDetails = {
656
588
  noun: 'meeting'
657
589
  };
658
-
659
590
  var gotWS = function gotWS(ws, base) {
660
591
  thisPane.mintNew(dataBrowserContext, {
661
592
  newBase: base
@@ -670,11 +601,11 @@ module.exports = {
670
601
  parameterCell.appendChild(UI.widgets.errorMessageBlock(dom, err));
671
602
  });
672
603
  };
673
-
674
604
  var mintUI = UI.login.selectWorkspace(dom, appDetails, gotWS);
675
605
  parameterCell.appendChild(mintUI);
676
- }; // //////////////////////////////////////////////////////////// end of new tab creation functions
606
+ };
677
607
 
608
+ // //////////////////////////////////////////////////////////// end of new tab creation functions
678
609
 
679
610
  var toolIcons = [{
680
611
  icon: 'noun_339237.svg',
@@ -685,14 +616,16 @@ module.exports = {
685
616
  icon: 'noun_346777.svg',
686
617
  maker: makePoll,
687
618
  hint: 'Make a poll to schedule the meeting'
688
- }, // When meet THIS or NEXT time
619
+ },
620
+ // When meet THIS or NEXT time
689
621
  {
690
622
  icon: 'noun_48218.svg',
691
623
  maker: makeAgenda,
692
624
  limit: 1,
693
625
  hint: 'Add an agenda list',
694
626
  disabled: true
695
- }, // When meet THIS or NEXT time
627
+ },
628
+ // When meet THIS or NEXT time
696
629
  {
697
630
  icon: 'noun_79217.svg',
698
631
  maker: makePad,
@@ -707,7 +640,8 @@ module.exports = {
707
640
  maker: makeActions,
708
641
  limit: 1,
709
642
  hint: 'Add a list of action items'
710
- }, // When meet THIS or NEXT time
643
+ },
644
+ // When meet THIS or NEXT time
711
645
  {
712
646
  icon: 'noun_260227.svg',
713
647
  maker: makeVideoCall,
@@ -741,16 +675,13 @@ module.exports = {
741
675
  var visible = false; // the inividual tools tools
742
676
 
743
677
  star.setAttribute('src', UI.icons.iconBase + 'noun_19460_green.svg'); // noun_272948.svg
744
-
745
678
  star.setAttribute('style', iconStyle + 'opacity: 50%;');
746
679
  star.setAttribute('title', 'Add another tool to the meeting');
747
-
748
680
  var selectNewTool = function selectNewTool(_event) {
749
681
  visible = !visible;
750
682
  star.setAttribute('style', iconStyle + (visible ? 'background-color: yellow;' : ''));
751
683
  styleTheIcons(visible ? '' : 'display: none;');
752
684
  };
753
-
754
685
  var loginOutButton;
755
686
  logic.authn.checkUser().then(function (webId) {
756
687
  if (webId) {
@@ -759,12 +690,11 @@ module.exports = {
759
690
  star.setAttribute('style', iconStyle);
760
691
  return;
761
692
  }
762
-
763
693
  loginOutButton = UI.login.loginStatusBox(dom, function (webIdUri) {
764
694
  if (webIdUri) {
765
695
  me = kb.sym(webIdUri);
766
- parameterCell.removeChild(loginOutButton); // loginOutButton.setAttribute('',iconStyle) // make it match the icons
767
-
696
+ parameterCell.removeChild(loginOutButton);
697
+ // loginOutButton.setAttribute('',iconStyle) // make it match the icons
768
698
  star.addEventListener('click', selectNewTool);
769
699
  star.setAttribute('style', iconStyle);
770
700
  } else {
@@ -776,7 +706,6 @@ module.exports = {
776
706
  parameterCell.appendChild(loginOutButton);
777
707
  });
778
708
  var iconArray = [];
779
-
780
709
  for (var i = 0; i < toolIcons.length; i++) {
781
710
  var foo = function foo() {
782
711
  var toolObject = toolIcons[i];
@@ -786,7 +715,6 @@ module.exports = {
786
715
  iconArray.push(icon);
787
716
  icon.tool = toolObject;
788
717
  var maker = toolObject.maker;
789
-
790
718
  if (!toolObject.disabled) {
791
719
  icon.addEventListener('click', function (_event) {
792
720
  selectTool(icon);
@@ -794,18 +722,14 @@ module.exports = {
794
722
  });
795
723
  }
796
724
  };
797
-
798
725
  foo();
799
726
  }
800
-
801
727
  var styleTheIcons = function styleTheIcons(style) {
802
728
  for (var i = 0; i < iconArray.length; i++) {
803
729
  var st = iconStyle + style;
804
-
805
730
  if (toolIcons[i].disabled) {
806
731
  st += 'opacity: 0.3;';
807
732
  }
808
-
809
733
  iconArray[i].setAttribute('style', st); // eg 'background-color: #ccc;'
810
734
  }
811
735
  };
@@ -814,13 +738,12 @@ module.exports = {
814
738
  styleTheIcons('display: none;');
815
739
  star.setAttribute('style', iconStyle);
816
740
  };
817
-
818
741
  var selectTool = function selectTool(icon) {
819
742
  styleTheIcons('display: none;'); // 'background-color: #ccc;'
820
-
821
743
  icon.setAttribute('style', iconStyle + 'background-color: yellow;');
822
- }; // //////////////////////////////
744
+ };
823
745
 
746
+ // //////////////////////////////
824
747
 
825
748
  var renderTab = function renderTab(div, item) {
826
749
  if (kb.holds(item, ns.rdf('type'), ns.meeting('Tool'))) {
@@ -831,19 +754,17 @@ module.exports = {
831
754
  s.textContent = label;
832
755
  s.setAttribute('style', 'margin-left: 0.7em');
833
756
  var icon = kb.any(item, ns.meeting('icon'));
834
-
835
757
  if (icon) {
836
758
  // Make sure the icon is cleanly on the left of the label
837
759
  var table = div.appendChild(dom.createElement('table'));
838
760
  var tr = table.appendChild(dom.createElement('tr'));
839
761
  var left = tr.appendChild(dom.createElement('td'));
840
- var right = tr.appendChild(dom.createElement('td')); // var img = div.appendChild(dom.createElement('img'))
841
-
762
+ var right = tr.appendChild(dom.createElement('td'));
763
+ // var img = div.appendChild(dom.createElement('img'))
842
764
  var img = left.appendChild(dom.createElement('img'));
843
- img.setAttribute('src', icon.uri); // img.setAttribute('style', 'max-width: 1.5em; max-height: 1.5em;') // @@ SVG shrinks to 0
844
-
765
+ img.setAttribute('src', icon.uri);
766
+ // img.setAttribute('style', 'max-width: 1.5em; max-height: 1.5em;') // @@ SVG shrinks to 0
845
767
  img.setAttribute('style', 'width: 1.5em; height: 1.5em;'); // @
846
-
847
768
  img.setAttribute('title', label);
848
769
  right.appendChild(s);
849
770
  } else {
@@ -853,7 +774,6 @@ module.exports = {
853
774
  div.textContent = UI.utils.label(item);
854
775
  }
855
776
  };
856
-
857
777
  var tipDiv = function tipDiv(text) {
858
778
  var d = dom.createElement('div');
859
779
  var p = d.appendChild(dom.createElement('p'));
@@ -861,57 +781,50 @@ module.exports = {
861
781
  p.textContent = 'Tip: ' + text;
862
782
  return d;
863
783
  };
864
-
865
784
  var renderTabSettings = function renderTabSettings(containerDiv, subject) {
866
785
  containerDiv.innerHTML = '';
867
786
  containerDiv.style += 'border-color: #eed;';
868
787
  containerDiv.appendChild(dom.createElement('h3')).textContent = 'Adjust this tab';
869
-
870
788
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('Tool'))) {
871
789
  var form = $rdf.sym('https://solid.github.io/solid-panes/meeting/meetingDetailsForm.ttl#settings');
872
790
  UI.widgets.appendForm(document, containerDiv, {}, subject, form, meeting.doc(), complainIfBad);
873
791
  var delButton = UI.widgets.deleteButtonWithCheck(dom, containerDiv, 'tab', function () {
874
792
  var toolList = kb.the(meeting, ns.meeting('toolList'));
875
-
876
793
  for (var i = 0; i < toolList.elements.length; i++) {
877
794
  if (toolList.elements[i].sameTerm(subject)) {
878
795
  toolList.elements.splice(i, 1);
879
796
  break;
880
797
  }
881
798
  }
882
-
883
799
  var target = kb.any(subject, ns.meeting('target'));
884
800
  var ds = kb.statementsMatching(subject).concat(kb.statementsMatching(undefined, undefined, subject)).concat(kb.statementsMatching(meeting, undefined, target));
885
801
  kb.remove(ds); // Remove all links to and from the tab node
886
-
887
802
  saveBackMeetingDoc();
888
803
  });
889
- delButton.setAttribute('style', 'width: 1.5em; height: 1.5em;'); // delButton.setAttribute('class', '')
804
+ delButton.setAttribute('style', 'width: 1.5em; height: 1.5em;');
805
+ // delButton.setAttribute('class', '')
890
806
  // delButton.setAttribute('style', 'height: 2em; width: 2em; margin: 1em; border-radius: 0.5em; padding: 1em; font-size: 120%; background-color: red; color: white;')
891
807
  // delButton.textContent = 'Delete this tab'
892
808
  } else {
893
809
  containerDiv.appendChild(dom.createElement('h4')).textContent = '(No adjustments available)';
894
810
  }
895
811
  };
896
-
897
812
  var renderMain = function renderMain(containerDiv, subject) {
898
813
  var pane = null;
899
814
  var table;
900
815
  var selectedGroup = null;
901
816
  containerDiv.innerHTML = '';
902
-
903
817
  var complainIfBad = function complainIfBad(ok, message) {
904
818
  if (!ok) {
905
819
  containerDiv.textContent = '' + message;
906
820
  }
907
821
  };
908
-
909
822
  var showIframe = function showIframe(target) {
910
- var iframe = containerDiv.appendChild(dom.createElement('iframe')); // iframe.setAttribute('sandbox', '') // All restrictions
911
-
912
- iframe.setAttribute('src', target.uri); // See https://stackoverflow.com/questions/325273/make-iframe-to-fit-100-of-containers-remaining-height
823
+ var iframe = containerDiv.appendChild(dom.createElement('iframe'));
824
+ // iframe.setAttribute('sandbox', '') // All restrictions
825
+ iframe.setAttribute('src', target.uri);
826
+ // See https://stackoverflow.com/questions/325273/make-iframe-to-fit-100-of-containers-remaining-height
913
827
  // Set the container position (sic) so it becaomes a 100% reference for the size of the iframe height 100%
914
-
915
828
  /* For now at least , leave the container style as set by the tab system. 20200115b
916
829
  containerDiv.setAttribute(
917
830
  'style',
@@ -920,24 +833,19 @@ module.exports = {
920
833
  */
921
834
  // iframe.setAttribute('style', 'height: 350px; border: 0; margin: 0; padding: 0; resize:both; overflow:scroll; width: 100%;')
922
835
  // iframe.setAttribute('style', 'border: none; margin: 0; padding: 0; height: 100%; width: 100%; resize: both; overflow:scroll;')
923
-
924
- iframe.setAttribute('style', 'border: none; margin: 0; padding: 0; height: 100%; width: 100%;'); // Following https://dev.chromium.org/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes :
925
-
836
+ iframe.setAttribute('style', 'border: none; margin: 0; padding: 0; height: 100%; width: 100%;');
837
+ // Following https://dev.chromium.org/Home/chromium-security/deprecating-permissions-in-cross-origin-iframes :
926
838
  iframe.setAttribute('allow', 'microphone camera'); // Allow iframe to request camera and mic
927
839
  // containerDiv.style.resize = 'none' // Remove scroll bars on outer div - don't seem to work so well
928
-
929
840
  iframe.setAttribute('name', 'disable-x-frame-options'); // For electron: see https://github.com/electron/electron/pull/573
930
-
931
841
  containerDiv.style.padding = 0;
932
842
  };
933
-
934
843
  var renderPeoplePicker = function renderPeoplePicker() {
935
844
  var context = {
936
845
  div: containerDiv,
937
846
  dom: dom
938
847
  };
939
848
  containerDiv.appendChild(dom.createElement('h4')).textContent = 'Meeting Participants';
940
-
941
849
  var groupPickedCb = function groupPickedCb(group) {
942
850
  var toIns = [$rdf.st(meeting, ns.meeting('particpantGroup'), group, meeting.doc())];
943
851
  kb.updater.update([], toIns, function (uri, ok, message) {
@@ -948,7 +856,6 @@ module.exports = {
948
856
  }
949
857
  });
950
858
  };
951
-
952
859
  selectedGroup = kb.any(meeting, ns.meeting('particpantGroup'));
953
860
  logic.loadTypeIndexes(context).then(function () {
954
861
  // Assumes that the type index has an entry for addressbook
@@ -960,14 +867,12 @@ module.exports = {
960
867
  picker.render();
961
868
  });
962
869
  };
963
-
964
870
  var renderDetails = function renderDetails() {
965
871
  containerDiv.appendChild(dom.createElement('h3')).textContent = 'Details of meeting';
966
872
  var form = $rdf.sym('https://solid.github.io/solid-panes/meeting/meetingDetailsForm.ttl#main');
967
873
  UI.widgets.appendForm(document, containerDiv, {}, meeting, form, meeting.doc(), complainIfBad);
968
874
  containerDiv.appendChild(tipDiv('Drag URL-bar icons of web pages into the tab bar on the left to add new meeting materials.'));
969
875
  me = logic.authn.currentUser();
970
-
971
876
  if (me) {
972
877
  kb.add(meeting, ns.dc('author'), me, meetingDoc); // @@ should nly be on initial creation?
973
878
  }
@@ -983,36 +888,34 @@ module.exports = {
983
888
  console.log('Registration control finsished.');
984
889
  });
985
890
  var options = {};
986
- UI.pad.manageParticipation(dom, containerDiv, meetingDoc, meeting, me, options); // "Make a new meeting" button
891
+ UI.pad.manageParticipation(dom, containerDiv, meetingDoc, meeting, me, options);
987
892
 
893
+ // "Make a new meeting" button
988
894
  var imageStyle = 'height: 2em; width: 2em; margin:0.5em;';
989
895
  var detailsBottom = containerDiv.appendChild(dom.createElement('div'));
990
896
  var spawn = detailsBottom.appendChild(dom.createElement('img'));
991
897
  spawn.setAttribute('src', UI.icons.iconBase + 'noun_145978.svg');
992
898
  spawn.setAttribute('title', 'Make a fresh new meeting');
993
899
  spawn.addEventListener('click', makeNewMeeting);
994
- spawn.setAttribute('style', imageStyle); // "Fork me on Github" button
900
+ spawn.setAttribute('style', imageStyle);
995
901
 
902
+ // "Fork me on Github" button
996
903
  var forka = detailsBottom.appendChild(dom.createElement('a'));
997
904
  forka.setAttribute('href', 'https://github.com/solid/solid-panes'); // @@ Move when code moves
998
-
999
905
  forka.setAttribute('target', '_blank');
1000
906
  var fork = forka.appendChild(dom.createElement('img'));
1001
907
  fork.setAttribute('src', UI.icons.iconBase + 'noun_368567.svg');
1002
908
  fork.setAttribute('title', 'Fork me on github');
1003
909
  fork.setAttribute('style', imageStyle + 'opacity: 50%;');
1004
910
  };
1005
-
1006
911
  if (kb.holds(subject, ns.rdf('type'), ns.meeting('Tool'))) {
1007
912
  var target = kb.any(subject, ns.meeting('target'));
1008
-
1009
913
  if (target.sameTerm(meeting) && !kb.any(subject, ns.meeting('view'))) {
1010
914
  // self reference? force details form
1011
915
  renderDetails(); // Legacy meeting instances
1012
916
  } else {
1013
917
  var view = kb.any(subject, ns.meeting('view'));
1014
918
  view = view ? view.value : null;
1015
-
1016
919
  if (view === 'details') {
1017
920
  renderDetails();
1018
921
  } else if (view === 'peoplePicker') {
@@ -1029,13 +932,13 @@ module.exports = {
1029
932
  } else if (subject.sameTerm(meeting)) {
1030
933
  // self reference? force details form
1031
934
  renderDetails();
1032
- } else if (subject.sameTerm(subject.doc()) && !kb.holds(subject, UI.ns.rdf('type'), UI.ns.meeting('Chat')) && !kb.holds(subject, UI.ns.rdf('type'), UI.ns.meeting('PaneView')) // eslint-disable-next-line no-empty
935
+ } else if (subject.sameTerm(subject.doc()) && !kb.holds(subject, UI.ns.rdf('type'), UI.ns.meeting('Chat')) && !kb.holds(subject, UI.ns.rdf('type'), UI.ns.meeting('PaneView'))
936
+ // eslint-disable-next-line no-empty
1033
937
  ) {} else {
1034
938
  table = containerDiv.appendChild(dom.createElement('table'));
1035
939
  dataBrowserContext.getOutliner(dom).GotoSubject(subject, true, undefined, false, undefined, table);
1036
940
  }
1037
941
  };
1038
-
1039
942
  var options = {
1040
943
  dom: dom
1041
944
  };
@@ -1043,7 +946,6 @@ module.exports = {
1043
946
  options.subject = subject;
1044
947
  options.ordered = true;
1045
948
  options.orientation = 1; // tabs on LHS
1046
-
1047
949
  options.renderMain = renderMain;
1048
950
  options.renderTab = renderTab;
1049
951
  options.renderTabSettings = renderTabSettings;
@@ -1054,5 +956,6 @@ module.exports = {
1054
956
  UI.widgets.makeDropTarget(iconCell, droppedURIHandler, droppedFileHandler);
1055
957
  return div;
1056
958
  }
1057
- }; // ends
959
+ };
960
+ // ends
1058
961
  //# sourceMappingURL=meetingPane.js.map