solid-panes 3.5.28-alpha → 3.5.29-alpha

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.
Files changed (119) hide show
  1. package/README.md +0 -2
  2. package/lib/RDFXMLPane.js +6 -8
  3. package/lib/RDFXMLPane.js.map +1 -1
  4. package/lib/argument/argumentPane.js +10 -11
  5. package/lib/argument/argumentPane.js.map +1 -1
  6. package/lib/attach/attachPane.js +47 -85
  7. package/lib/attach/attachPane.js.map +1 -1
  8. package/lib/audio/audioPane.js +11 -36
  9. package/lib/audio/audioPane.js.map +1 -1
  10. package/lib/classInstancePane.js +11 -20
  11. package/lib/classInstancePane.js.map +1 -1
  12. package/lib/dashboard/basicPreferences.js +3 -53
  13. package/lib/dashboard/basicPreferences.js.map +1 -1
  14. package/lib/dashboard/dashboardPane.js +2 -18
  15. package/lib/dashboard/dashboardPane.js.map +1 -1
  16. package/lib/dashboard/homepage.js +1 -19
  17. package/lib/dashboard/homepage.js.map +1 -1
  18. package/lib/dataContentPane.js +15 -58
  19. package/lib/dataContentPane.js.map +1 -1
  20. package/lib/defaultPane.js +13 -21
  21. package/lib/defaultPane.js.map +1 -1
  22. package/lib/dokieli/dokieliPane.js +19 -28
  23. package/lib/dokieli/dokieliPane.js.map +1 -1
  24. package/lib/dokieli/new.js.map +1 -1
  25. package/lib/form/pane.js +26 -40
  26. package/lib/form/pane.js.map +1 -1
  27. package/lib/home/homePane.js +7 -23
  28. package/lib/home/homePane.js.map +1 -1
  29. package/lib/humanReadablePane.js +14 -28
  30. package/lib/humanReadablePane.js.map +1 -1
  31. package/lib/imagePane.js +9 -13
  32. package/lib/imagePane.js.map +1 -1
  33. package/lib/index.js +4 -18
  34. package/lib/index.js.map +1 -1
  35. package/lib/internal/internalPane.js +10 -41
  36. package/lib/internal/internalPane.js.map +1 -1
  37. package/lib/mainPage/footer.js +0 -4
  38. package/lib/mainPage/footer.js.map +1 -1
  39. package/lib/mainPage/header.js +2 -28
  40. package/lib/mainPage/header.js.map +1 -1
  41. package/lib/mainPage/index.js +1 -12
  42. package/lib/mainPage/index.js.map +1 -1
  43. package/lib/microblogPane/microblogPane.js +100 -237
  44. package/lib/microblogPane/microblogPane.js.map +1 -1
  45. package/lib/n3Pane.js +2 -7
  46. package/lib/n3Pane.js.map +1 -1
  47. package/lib/outline/context.js +0 -2
  48. package/lib/outline/context.js.map +1 -1
  49. package/lib/outline/licenseOptions.js +9 -25
  50. package/lib/outline/licenseOptions.js.map +1 -1
  51. package/lib/outline/manager.js +178 -580
  52. package/lib/outline/manager.js.map +1 -1
  53. package/lib/outline/manager.test.js +1 -11
  54. package/lib/outline/manager.test.js.map +1 -1
  55. package/lib/outline/outlineIcons.js +30 -25
  56. package/lib/outline/outlineIcons.js.map +1 -1
  57. package/lib/outline/propertyViews.js +0 -10
  58. package/lib/outline/propertyViews.js.map +1 -1
  59. package/lib/outline/propertyViews.test.js +1 -3
  60. package/lib/outline/propertyViews.test.js.map +1 -1
  61. package/lib/outline/queryByExample.js +24 -76
  62. package/lib/outline/queryByExample.js.map +1 -1
  63. package/lib/outline/userInput.js +214 -454
  64. package/lib/outline/userInput.js.map +1 -1
  65. package/lib/outline/viewAsImage.js +0 -6
  66. package/lib/outline/viewAsImage.js.map +1 -1
  67. package/lib/outline/viewAsMbox.js +3 -4
  68. package/lib/outline/viewAsMbox.js.map +1 -1
  69. package/lib/pad/padPane.js +45 -93
  70. package/lib/pad/padPane.js.map +1 -1
  71. package/lib/playlist/playlistPane.js +3 -20
  72. package/lib/playlist/playlistPane.js.map +1 -1
  73. package/lib/profile/editProfile.view.js +7 -24
  74. package/lib/profile/editProfile.view.js.map +1 -1
  75. package/lib/profile/profile.dom.js +0 -3
  76. package/lib/profile/profile.dom.js.map +1 -1
  77. package/lib/registerPanes.js +29 -27
  78. package/lib/registerPanes.js.map +1 -1
  79. package/lib/schedule/formsForSchedule.js.map +1 -1
  80. package/lib/schedule/schedulePane.js +62 -122
  81. package/lib/schedule/schedulePane.js.map +1 -1
  82. package/lib/sharing/sharingPane.js +2 -10
  83. package/lib/sharing/sharingPane.js.map +1 -1
  84. package/lib/slideshow/slideshowPane.js +9 -14
  85. package/lib/slideshow/slideshowPane.js.map +1 -1
  86. package/lib/socialPane.js +43 -124
  87. package/lib/socialPane.js.map +1 -1
  88. package/lib/tabbed/tabbedPane.js +1 -15
  89. package/lib/tabbed/tabbedPane.js.map +1 -1
  90. package/lib/tableViewPane.js +4 -7
  91. package/lib/tableViewPane.js.map +1 -1
  92. package/lib/test-import-export/common.js +2 -1
  93. package/lib/test-import-export/common.js.map +1 -1
  94. package/lib/test-import-export/edit-importer.js +7 -9
  95. package/lib/test-import-export/edit-importer.js.map +1 -1
  96. package/lib/transaction/pane.js +31 -90
  97. package/lib/transaction/pane.js.map +1 -1
  98. package/lib/transaction/period.js +20 -71
  99. package/lib/transaction/period.js.map +1 -1
  100. package/lib/trip/tripPane.js +30 -34
  101. package/lib/trip/tripPane.js.map +1 -1
  102. package/lib/trustedApplications/trustedApplications.dom.js +8 -34
  103. package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
  104. package/lib/trustedApplications/trustedApplications.test.js +3 -8
  105. package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
  106. package/lib/trustedApplications/trustedApplications.utils.js +0 -10
  107. package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
  108. package/lib/trustedApplications/trustedApplications.view.js +1 -22
  109. package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
  110. package/lib/ui/pane.js +22 -28
  111. package/lib/ui/pane.js.map +1 -1
  112. package/lib/versionInfo.d.ts +2 -0
  113. package/lib/versionInfo.d.ts.map +1 -1
  114. package/lib/versionInfo.js +18 -16
  115. package/lib/versionInfo.js.map +1 -1
  116. package/lib/video/videoPane.js +2 -5
  117. package/lib/video/videoPane.js.map +1 -1
  118. package/package.json +24 -24
  119. package/src/versionInfo.ts +18 -16
@@ -1,41 +1,37 @@
1
1
  "use strict";
2
2
 
3
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
4
  var UI = _interopRequireWildcard(require("solid-ui"));
6
-
7
5
  var _solidLogic = require("solid-logic");
8
-
9
6
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
-
11
7
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
-
13
8
  /* Scheduler Pane
14
9
  **
15
10
  **
16
11
  */
17
-
18
12
  /* global alert */
13
+
19
14
  var $rdf = UI.rdf;
20
- var ns = UI.ns; // @@ Give other combos too-- see schedule ontology
15
+ var ns = UI.ns;
21
16
 
17
+ // @@ Give other combos too-- see schedule ontology
22
18
  var possibleAvailabilities = [ns.sched('No'), ns.sched('Maybe'), ns.sched('Yes')];
23
19
  module.exports = {
24
20
  icon: UI.icons.iconBase + 'noun_346777.svg',
25
21
  // @@ better?
22
+
26
23
  name: 'schedule',
27
24
  audience: [ns.solid('PowerUser')],
28
25
  // Does the subject deserve an Scheduler pane?
29
26
  label: function label(subject, context) {
30
27
  var kb = context.session.store;
31
28
  var t = kb.findTypeURIs(subject);
32
-
33
29
  if (t['http://www.w3.org/ns/pim/schedule#SchedulableEvent']) {
34
30
  return 'Scheduling poll';
35
31
  }
36
-
37
32
  return null; // No under other circumstances
38
33
  },
34
+
39
35
  // Mint a new Schedule poll
40
36
  mintClass: ns.sched('SchedulableEvent'),
41
37
  mintNew: function mintNew(context, options) {
@@ -44,16 +40,17 @@ module.exports = {
44
40
  var kb = context.session.store;
45
41
  var newBase = options.newBase;
46
42
  var thisInstance = options.useExisting || $rdf.sym(options.newBase + 'index.ttl#this');
47
-
48
43
  var complainIfBad = function complainIfBad(ok, body) {
49
44
  if (ok) return;
50
45
  console.log('Error in Schedule Pane: Error constructing new scheduler: ' + body);
51
46
  reject(new Error(body));
52
- }; // ////////////////////// Accesss control
47
+ };
48
+
49
+ // ////////////////////// Accesss control
50
+
53
51
  // Two constiations of ACL for this app, public read and public read/write
54
52
  // In all cases owner has read write control
55
53
 
56
-
57
54
  var genACLtext = function genACLtext(docURI, aclURI, allWrite) {
58
55
  var g = $rdf.graph();
59
56
  var auth = $rdf.Namespace('http://www.w3.org/ns/auth/acl#');
@@ -71,13 +68,12 @@ module.exports = {
71
68
  g.add(a, auth('accessTo'), doc, acl);
72
69
  g.add(a, auth('agentClass'), ns.foaf('Agent'), acl);
73
70
  g.add(a, auth('mode'), auth('Read'), acl);
74
-
75
71
  if (allWrite) {
76
72
  g.add(a, auth('mode'), auth('Write'), acl);
77
73
  }
78
-
79
74
  return $rdf.serialize(acl, g, aclURI, 'text/turtle');
80
75
  };
76
+
81
77
  /*
82
78
  const setACL3 = function (docURI, allWrite, callbackFunction) {
83
79
  const aclText = genACLtext(docURI, aclDoc.uri, allWrite)
@@ -85,7 +81,6 @@ module.exports = {
85
81
  }
86
82
  */
87
83
 
88
-
89
84
  var setACL2 = function setACL2(docURI, allWrite, callbackFunction) {
90
85
  var aclDoc = kb.any(kb.sym(docURI), kb.sym('http://www.iana.org/assignments/link-relations/acl')); // @@ check that this get set by web.js
91
86
 
@@ -105,12 +100,10 @@ module.exports = {
105
100
  callbackFunction(false, 'Getting headers for ACL: ' + err);
106
101
  }).then(function () {
107
102
  var aclDoc = kb.any(kb.sym(docURI), kb.sym('http://www.iana.org/assignments/link-relations/acl'));
108
-
109
103
  if (!aclDoc) {
110
104
  // complainIfBad(false, "No Link rel=ACL header for " + docURI)
111
105
  throw new Error('No Link rel=ACL header for ' + docURI);
112
106
  }
113
-
114
107
  var aclText = genACLtext(docURI, aclDoc.uri, allWrite);
115
108
  return fetcher.webOperation('PUT', aclDoc.uri, {
116
109
  data: aclText,
@@ -122,52 +115,47 @@ module.exports = {
122
115
  callbackFunction(false, err.message);
123
116
  });
124
117
  }
125
- }; // Body of mintNew
126
-
118
+ };
127
119
 
120
+ // Body of mintNew
128
121
  var fetcher = kb.fetcher;
129
122
  var updater = kb.updater;
130
-
131
123
  var me = options.me || _solidLogic.authn.currentUser();
132
-
133
124
  if (!me) {
134
125
  console.log('MUST BE LOGGED IN');
135
126
  alert('NOT LOGGED IN');
136
127
  return;
137
128
  }
138
-
139
129
  var base = thisInstance.dir().uri;
140
130
  var newDetailsDoc, newInstance; // , newIndexDoc
141
131
 
142
132
  if (options.useExisting) {
143
133
  newInstance = options.useExisting;
144
134
  newBase = thisInstance.dir().uri;
145
- newDetailsDoc = newInstance.doc(); // newIndexDoc = null
146
-
135
+ newDetailsDoc = newInstance.doc();
136
+ // newIndexDoc = null
147
137
  if (options.newBase) {
148
138
  throw new Error('mint new scheduler: Illegal - have both new base and existing event');
149
139
  }
150
140
  } else {
151
- newDetailsDoc = kb.sym(newBase + 'details.ttl'); // newIndexDoc = kb.sym(newBase + 'index.html')
152
-
141
+ newDetailsDoc = kb.sym(newBase + 'details.ttl');
142
+ // newIndexDoc = kb.sym(newBase + 'index.html')
153
143
  newInstance = kb.sym(newDetailsDoc.uri + '#event');
154
144
  }
155
-
156
145
  var newResultsDoc = kb.sym(newBase + 'results.ttl');
157
146
  var toBeCopied = options.noIndexHTML ? {} : [{
158
147
  local: 'index.html',
159
148
  contentType: 'text/html'
160
149
  }];
161
- var agenda = []; // @@ This needs some form of visible progress bar
150
+ var agenda = [];
162
151
 
152
+ // @@ This needs some form of visible progress bar
163
153
  for (var f = 0; f < toBeCopied.length; f++) {
164
154
  var item = toBeCopied[f];
165
-
166
155
  var fun = function copyItem(item) {
167
156
  agenda.push(function () {
168
157
  var newURI = newBase + item.local;
169
158
  console.log('Copying ' + base + item.local + ' to ' + newURI);
170
-
171
159
  var setThatACL = function setThatACL() {
172
160
  setACL2(newURI, false, function (ok, message) {
173
161
  if (!ok) {
@@ -190,16 +178,12 @@ module.exports = {
190
178
  });
191
179
  });
192
180
  };
193
-
194
181
  fun(item);
195
182
  }
196
-
197
183
  agenda.push(function createDetailsFile() {
198
184
  kb.add(newInstance, ns.rdf('type'), ns.sched('SchedulableEvent'), newDetailsDoc);
199
-
200
185
  if (me) {
201
186
  kb.add(newInstance, ns.dc('author'), me, newDetailsDoc); // Who is sending the invitation?
202
-
203
187
  kb.add(newInstance, ns.foaf('maker'), me, newDetailsDoc); // Uneditable - wh is allowed to edit this?
204
188
  }
205
189
 
@@ -242,10 +226,13 @@ module.exports = {
242
226
  options.newInstance = newInstance;
243
227
  resolve(options);
244
228
  });
245
- agenda.shift()(); // Created new data files.
229
+ agenda.shift()();
230
+ // Created new data files.
246
231
  }); // promise
247
232
  },
233
+
248
234
  // mintNew
235
+
249
236
  // Render one meeting schedule poll
250
237
  render: function render(subject, context) {
251
238
  var dom = context.dom;
@@ -253,6 +240,7 @@ module.exports = {
253
240
  var ns = UI.ns;
254
241
  var invitation = subject;
255
242
  var appPathSegment = 'app-when-can-we.w3.org'; // how to allocate this string and connect to
243
+
256
244
  // ////////////////////////////////////////////
257
245
 
258
246
  var fetcher = kb.fetcher;
@@ -262,60 +250,51 @@ module.exports = {
262
250
  var detailsDoc = subject.doc();
263
251
  var baseDir = detailsDoc.dir();
264
252
  var base = baseDir.uri;
265
- var resultsDoc = $rdf.sym(base + 'results.ttl'); // const formsURI = base + 'forms.ttl'
253
+ var resultsDoc = $rdf.sym(base + 'results.ttl');
254
+ // const formsURI = base + 'forms.ttl'
266
255
  // We can't in fact host stuff from there because of CORS
267
-
268
256
  var formsURI = 'https://solidos.github.io/solid-panes/schedule/formsForSchedule.ttl';
269
257
  var form1 = kb.sym(formsURI + '#form1');
270
258
  var form2 = kb.sym(formsURI + '#form2');
271
259
  var form3 = kb.sym(formsURI + '#form3');
272
-
273
260
  var formText = require('./formsForSchedule.js');
274
-
275
261
  $rdf.parse(formText, kb, formsURI, 'text/turtle'); // Load forms directly
276
262
 
277
263
  var inputStyle = 'background-color: #eef; padding: 0.5em; border: .5em solid white; font-size: 100%'; // font-size: 120%
264
+ var buttonIconStyle = 'width: 1.8em; height: 1.8em;';
278
265
 
279
- var buttonIconStyle = 'width: 1.8em; height: 1.8em;'; // Utility functions
266
+ // Utility functions
280
267
 
281
268
  var complainIfBad = function complainIfBad(ok, message) {
282
269
  if (!ok) {
283
270
  div.appendChild(UI.widgets.errorMessageBlock(dom, message, 'pink'));
284
271
  }
285
272
  };
286
-
287
273
  var clearElement = function clearElement(ele) {
288
274
  while (ele.firstChild) {
289
275
  ele.removeChild(ele.firstChild);
290
276
  }
291
-
292
277
  return ele;
293
278
  };
294
-
295
279
  var refreshCellColor = function refreshCellColor(cell, value) {
296
280
  var bg = kb.any(value, UI.ns.ui('backgroundColor'));
297
-
298
281
  if (bg) {
299
282
  cell.setAttribute('style', 'padding: 0.3em; text-align: center; background-color: ' + bg + ';');
300
283
  }
301
284
  };
302
-
303
285
  var me;
304
-
305
286
  _solidLogic.authn.checkUser().then(function (webId) {
306
287
  me = webId;
307
-
308
288
  if (logInOutButton) {
309
289
  logInOutButton.refresh();
310
290
  }
311
-
312
291
  if (webId && waitingForLogin) {
313
292
  waitingForLogin = false;
314
293
  showAppropriateDisplay();
315
294
  }
316
295
  });
317
-
318
296
  console.log('me: ' + me); // @@ curently not actually used elsewhere
297
+
319
298
  // ////////////////////////////// Reproduction: spawn a new instance
320
299
  //
321
300
  // Viral growth path: user of app decides to make another instance
@@ -328,30 +307,25 @@ module.exports = {
328
307
  b.firstChild.setAttribute('style', inputStyle);
329
308
  return b;
330
309
  }; // newInstanceButton
331
- // /////////////////////// Create new document files for new instance of app
332
310
 
311
+ // /////////////////////// Create new document files for new instance of app
333
312
 
334
313
  var initializeNewInstanceInWorkspace = function initializeNewInstanceInWorkspace(ws) {
335
314
  var newBase = kb.any(ws, ns.space('uriPrefix'));
336
-
337
315
  if (!newBase) {
338
316
  newBase = ws.uri.split('#')[0];
339
317
  } else {
340
318
  newBase = newBase.value;
341
319
  }
342
-
343
320
  if (newBase.slice(-1) !== '/') {
344
321
  $rdf.log.error(appPathSegment + ': No / at end of uriPrefix ' + newBase); // @@ paramater?
345
-
346
322
  newBase = newBase + '/';
347
323
  }
348
-
349
324
  var now = new Date();
350
325
  newBase += appPathSegment + '/id' + now.getTime() + '/'; // unique id
351
326
 
352
327
  initializeNewInstanceAtBase(thisInstance, newBase);
353
328
  };
354
-
355
329
  var initializeNewInstanceAtBase = function initializeNewInstanceAtBase(thisInstance, newBase) {
356
330
  var options = {
357
331
  thisInstance: thisInstance,
@@ -364,8 +338,9 @@ module.exports = {
364
338
  })["catch"](function (error) {
365
339
  complainIfBad(false, 'Error createing new scheduler at ' + options.newInstance + ': ' + error);
366
340
  });
367
- }; // ///////////////////////
341
+ };
368
342
 
343
+ // ///////////////////////
369
344
 
370
345
  var getForms = function getForms() {
371
346
  console.log('getforms()');
@@ -381,32 +356,28 @@ module.exports = {
381
356
 
382
357
  var getDetails = function getDetails() {
383
358
  console.log('getDetails()'); // Looking for blank screen hang-up
384
-
385
359
  fetcher.nowOrWhenFetched(detailsDoc.uri, undefined, function (ok, body) {
386
360
  console.log('getDetails() ok? ' + ok);
387
361
  if (!ok) return complainIfBad(ok, body);
388
362
  showAppropriateDisplay();
389
363
  });
390
364
  };
391
-
392
365
  var showAppropriateDisplay = function showAppropriateDisplay() {
393
366
  console.log('showAppropriateDisplay()');
394
-
395
367
  _solidLogic.authn.checkUser().then(function (webId) {
396
368
  if (!webId) {
397
369
  return showSignon();
398
- } // On gh-pages, the turtle will not load properly (bad mime type)
399
- // but we can trap it as being a non-editable server.
370
+ }
400
371
 
372
+ // On gh-pages, the turtle will not load properly (bad mime type)
373
+ // but we can trap it as being a non-editable server.
401
374
 
402
375
  if (!kb.updater.editable(detailsDoc.uri, kb) || kb.holds(subject, ns.rdf('type'), ns.wf('TemplateInstance'))) {
403
376
  // This is read-only example e.g. on github pages, etc
404
377
  showBootstrap(div);
405
378
  return;
406
379
  }
407
-
408
380
  var ready = kb.any(subject, ns.sched('ready'));
409
-
410
381
  if (!ready) {
411
382
  showForms();
412
383
  } else {
@@ -415,7 +386,6 @@ module.exports = {
415
386
  }
416
387
  });
417
388
  };
418
-
419
389
  var showSignon = function showSignon() {
420
390
  clearElement(naviMain);
421
391
  var signonContext = {
@@ -425,11 +395,9 @@ module.exports = {
425
395
  UI.login.ensureLoggedIn(signonContext).then(function (context) {
426
396
  me = context.me;
427
397
  waitingForLogin = false; // untested
428
-
429
398
  showAppropriateDisplay();
430
399
  });
431
400
  };
432
-
433
401
  var showBootstrap = function showBootstrap() {
434
402
  var div = clearElement(naviMain);
435
403
  div.appendChild(UI.login.newAppInstance(dom, {
@@ -442,7 +410,6 @@ module.exports = {
442
410
  var baseField = div.appendChild(dom.createElement('input'));
443
411
  baseField.setAttribute('type', 'text');
444
412
  baseField.size = 80; // really a string
445
-
446
413
  baseField.label = 'base URL';
447
414
  baseField.autocomplete = 'on';
448
415
  div.appendChild(dom.createElement('br')); // @@
@@ -452,62 +419,50 @@ module.exports = {
452
419
  button.textContent = 'Start new poll at this URI';
453
420
  button.addEventListener('click', function (_e) {
454
421
  var newBase = baseField.value;
455
-
456
422
  if (newBase.slice(-1) !== '/') {
457
423
  newBase += '/';
458
424
  }
459
-
460
425
  initializeNewInstanceAtBase(thisInstance, newBase);
461
426
  });
462
- }; // ///////////// The forms to configure the poll
427
+ };
463
428
 
429
+ // ///////////// The forms to configure the poll
464
430
 
465
431
  var doneButton = dom.createElement('button');
466
-
467
432
  var showForms = function showForms() {
468
433
  clearElement(naviCenter); // Remove refresh button if nec
469
-
470
434
  var div = naviMain;
471
435
  var wizard = true;
472
436
  var currentSlide = 0;
473
437
  var gotDoneButton = false;
474
-
475
438
  if (wizard) {
476
439
  var forms = [form1, form2, form3];
477
440
  var slides = [];
478
441
  currentSlide = 0;
479
-
480
442
  for (var f = 0; f < forms.length; f++) {
481
443
  var slide = dom.createElement('div');
482
444
  UI.widgets.appendForm(document, slide, {}, subject, forms[f], detailsDoc, complainIfBad);
483
445
  slides.push(slide);
484
446
  }
485
-
486
447
  var refresh = function refresh() {
487
448
  clearElement(naviMain).appendChild(slides[currentSlide]);
488
-
489
449
  if (currentSlide === 0) {
490
450
  b1.setAttribute('disabled', '');
491
451
  } else {
492
452
  b1.removeAttribute('disabled');
493
453
  }
494
-
495
454
  if (currentSlide === slides.length - 1) {
496
455
  b2.setAttribute('disabled', '');
497
-
498
456
  if (!gotDoneButton) {
499
457
  // Only expose at last slide seen
500
458
  naviCenter.appendChild(emailButton); // could also check data shape
501
-
502
459
  naviCenter.appendChild(doneButton); // could also check data shape
503
-
504
460
  gotDoneButton = true;
505
461
  }
506
462
  } else {
507
463
  b2.removeAttribute('disabled');
508
464
  }
509
465
  };
510
-
511
466
  var b1 = clearElement(naviLeft).appendChild(dom.createElement('button'));
512
467
  b1.setAttribute('style', inputStyle);
513
468
  b1.textContent = '<- go back';
@@ -535,8 +490,8 @@ module.exports = {
535
490
  UI.widgets.appendForm(document, table, {}, subject, form2, detailsDoc, complainIfBad);
536
491
  UI.widgets.appendForm(document, table, {}, subject, form3, detailsDoc, complainIfBad);
537
492
  naviCenter.appendChild(doneButton); // could also check data shape
538
- } // @@@ link config to results
539
-
493
+ }
494
+ // @@@ link config to results
540
495
 
541
496
  var insertables = [];
542
497
  insertables.push($rdf.st(subject, ns.sched('availabilityOptions'), ns.sched('YesNoMaybe'), detailsDoc));
@@ -566,22 +521,22 @@ module.exports = {
566
521
  emailButton.setAttribute('style', inputStyle);
567
522
  var emailIcon = emailButton.appendChild(dom.createElement('img'));
568
523
  emailIcon.setAttribute('src', UI.icons.iconBase + 'noun_480183.svg'); // noun_480183.svg
569
-
570
- emailIcon.setAttribute('style', buttonIconStyle); // emailButton.textContent = 'email invitations'
571
-
524
+ emailIcon.setAttribute('style', buttonIconStyle);
525
+ // emailButton.textContent = 'email invitations'
572
526
  emailButton.addEventListener('click', function (_e) {
573
527
  var title = kb.anyValue(subject, ns.cal('summary')) || kb.anyValue(subject, ns.dc('title')) || '';
574
528
  var mailto = 'mailto:' + kb.each(subject, ns.sched('invitee')).map(function (who) {
575
529
  var mbox = kb.any(who, ns.foaf('mbox'));
576
530
  return mbox ? mbox.uri.replace('mailto:', '') : '';
577
- }).join(',') + '?subject=' + encodeURIComponent(title + '-- When can we meet?') + '&body=' + encodeURIComponent(title + '\n\nWhen can you?\n\nSee ' + subject + '\n'); // @@ assumed there is a data browser
531
+ }).join(',') + '?subject=' + encodeURIComponent(title + '-- When can we meet?') + '&body=' + encodeURIComponent(title + '\n\nWhen can you?\n\nSee ' + subject + '\n');
532
+ // @@ assumed there is a data browser
578
533
 
579
534
  console.log('Mail: ' + mailto);
580
535
  window.location.href = mailto;
581
536
  }, false);
582
537
  }; // showForms
583
- // Ask for each day, what times .. @@ to be added some time
584
538
 
539
+ // Ask for each day, what times .. @@ to be added some time
585
540
  /*
586
541
  const setTimesOfDay = function () {
587
542
  const i, j, x, y, slot, cell, day
@@ -700,9 +655,8 @@ module.exports = {
700
655
  }
701
656
  */
702
657
  // end setTimesOfDay
703
- // Read or create empty results file
704
-
705
658
 
659
+ // Read or create empty results file
706
660
  function getResults() {
707
661
  fetcher.nowOrWhenFetched(resultsDoc.uri, function (ok, body, response) {
708
662
  if (!ok) {
@@ -729,36 +683,31 @@ module.exports = {
729
683
  }
730
684
  });
731
685
  }
732
-
733
686
  function showResults() {
734
687
  // Now the form for responsing to the poll
735
688
  //
689
+
736
690
  // div.appendChild(dom.createElement('hr'))
691
+
737
692
  // const invitation = subject
738
693
  var title = kb.any(invitation, ns.cal('summary'));
739
694
  var comment = kb.any(invitation, ns.cal('comment'));
740
695
  var location = kb.any(invitation, ns.cal('location'));
741
696
  var div = naviMain;
742
697
  if (title) div.appendChild(dom.createElement('h3')).textContent = title;
743
-
744
698
  if (location) {
745
699
  div.appendChild(dom.createElement('address')).textContent = location.value;
746
700
  }
747
-
748
701
  if (comment) {
749
702
  div.appendChild(dom.createElement('p')).textContent = comment.value;
750
703
  }
751
-
752
704
  var author = kb.any(invitation, ns.dc('author'));
753
-
754
705
  if (author) {
755
706
  var authorName = kb.any(author, ns.foaf('name'));
756
-
757
707
  if (authorName) {
758
708
  div.appendChild(dom.createElement('p')).textContent = authorName;
759
709
  }
760
710
  }
761
-
762
711
  var query = new $rdf.Query('Responses');
763
712
  var v = {};
764
713
  var vs = ['time', 'author', 'value', 'resp', 'cell'];
@@ -769,11 +718,12 @@ module.exports = {
769
718
  query.pat.add(v.resp, ns.dc('author'), v.author);
770
719
  query.pat.add(v.resp, ns.sched('cell'), v.cell);
771
720
  query.pat.add(v.cell, ns.sched('availabilty'), v.value);
772
- query.pat.add(v.cell, ns.cal('dtstart'), v.time); // Sort by by person @@@
721
+ query.pat.add(v.cell, ns.cal('dtstart'), v.time);
722
+
723
+ // Sort by by person @@@
773
724
 
774
725
  var options = {};
775
726
  options.set_x = kb.each(subject, ns.sched('option')); // @@@@@ option -> dtstart in future
776
-
777
727
  options.set_x = options.set_x.map(function (opt) {
778
728
  return kb.any(opt, ns.cal('dtstart'));
779
729
  });
@@ -784,13 +734,12 @@ module.exports = {
784
734
  var possibleTimes = kb.each(invitation, ns.sched('option')).map(function (opt) {
785
735
  return kb.any(opt, ns.cal('dtstart'));
786
736
  });
787
-
788
737
  var displayTheMatrix = function displayTheMatrix() {
789
738
  var matrix = div.appendChild(UI.matrix.matrixForQuery(dom, query, v.time, v.author, v.value, options, function () {}));
790
739
  matrix.setAttribute('class', 'matrix');
791
740
  var refreshButton = dom.createElement('button');
792
- refreshButton.setAttribute('style', inputStyle); // refreshButton.textContent = 'refresh' // noun_479395.svg
793
-
741
+ refreshButton.setAttribute('style', inputStyle);
742
+ // refreshButton.textContent = 'refresh' // noun_479395.svg
794
743
  var refreshIcon = dom.createElement('img');
795
744
  refreshIcon.setAttribute('src', UI.icons.iconBase + 'noun_479395.svg');
796
745
  refreshIcon.setAttribute('style', buttonIconStyle);
@@ -808,10 +757,12 @@ module.exports = {
808
757
  }, false);
809
758
  clearElement(naviCenter);
810
759
  naviCenter.appendChild(refreshButton);
811
- }; // @@ Give other combos too-- see schedule ontology
760
+ };
761
+
762
+ // @@ Give other combos too-- see schedule ontology
812
763
  // const possibleAvailabilities = [ SCHED('No'), SCHED('Maybe'), SCHED('Yes') ]
813
- // const me = authn.currentUser()
814
764
 
765
+ // const me = authn.currentUser()
815
766
 
816
767
  var dataPointForNT = [];
817
768
  var loginContext = {
@@ -832,13 +783,10 @@ module.exports = {
832
783
  if (ok) refreshCellColor(cell, value);
833
784
  });
834
785
  }
835
-
836
786
  if (y.sameTerm(me)) {
837
787
  var callbackFunction = function callbackFunction() {
838
788
  refreshCellColor(cell, value);
839
789
  }; // @@ may need that
840
-
841
-
842
790
  var selectOptions = {};
843
791
  var predicate = ns.sched('availabilty');
844
792
  var cellSubject = dataPointForNT[x.toNT()];
@@ -848,7 +796,6 @@ module.exports = {
848
796
  cell.textContent = UI.utils.label(value);
849
797
  }
850
798
  };
851
-
852
799
  var responses = kb.each(invitation, ns.sched('response'));
853
800
  var myResponse = null;
854
801
  responses.forEach(function (r) {
@@ -859,7 +806,6 @@ module.exports = {
859
806
  var insertables = []; // list of statements to be stored
860
807
 
861
808
  var id = UI.widgets.newThing(doc).uri;
862
-
863
809
  if (myResponse === null) {
864
810
  myResponse = $rdf.sym(id + '_response');
865
811
  insertables.push($rdf.st(invitation, ns.sched('response'), myResponse, doc));
@@ -871,16 +817,13 @@ module.exports = {
871
817
  dataPointForNT[time.toNT()] = dataPoint;
872
818
  });
873
819
  }
874
-
875
820
  for (var j = 0; j < possibleTimes.length; j++) {
876
821
  if (dataPointForNT[possibleTimes[j].toNT()]) continue;
877
822
  var dataPoint = $rdf.sym(id + '_' + j);
878
823
  insertables.push($rdf.st(myResponse, ns.sched('cell'), dataPoint, doc));
879
824
  insertables.push($rdf.st(dataPoint, ns.cal('dtstart'), possibleTimes[j], doc)); // @@
880
-
881
825
  dataPointForNT[possibleTimes[j].toNT()] = dataPoint;
882
826
  }
883
-
884
827
  if (insertables.length) {
885
828
  kb.updater.update([], insertables, function (uri, success, errorBody) {
886
829
  if (!success) {
@@ -894,15 +837,14 @@ module.exports = {
894
837
  displayTheMatrix();
895
838
  }
896
839
  }); // @@@@ end of .then
840
+
897
841
  // If I made this in the first place, allow me to edit it.
898
842
  // @@ optionally -- allows others to if according to original
899
-
900
843
  var instanceCreator = kb.any(subject, ns.foaf('maker')); // owner?
901
-
902
844
  if (!instanceCreator || instanceCreator.sameTerm(me)) {
903
845
  var editButton = dom.createElement('button');
904
- editButton.setAttribute('style', inputStyle); // editButton.textContent = '(Modify the poll)' // noun_344563.svg
905
-
846
+ editButton.setAttribute('style', inputStyle);
847
+ // editButton.textContent = '(Modify the poll)' // noun_344563.svg
906
848
  var editIcon = dom.createElement('img');
907
849
  editIcon.setAttribute('src', UI.icons.iconBase + 'noun_344563.svg');
908
850
  editIcon.setAttribute('style', buttonIconStyle);
@@ -913,17 +855,16 @@ module.exports = {
913
855
  }, false);
914
856
  clearElement(naviLeft);
915
857
  naviLeft.appendChild(editButton);
916
- } // div.appendChild(editButton)
858
+ }
917
859
 
860
+ // div.appendChild(editButton)
918
861
 
919
862
  clearElement(naviRight);
920
863
  naviRight.appendChild(newInstanceButton());
921
864
  } // showResults
922
865
 
923
-
924
866
  var div = dom.createElement('div');
925
867
  var structure = div.appendChild(dom.createElement('table')); // @@ make responsive style
926
-
927
868
  structure.setAttribute('style', 'background-color: white; min-width: 40em; min-height: 13em;');
928
869
  var naviLoginoutTR = structure.appendChild(dom.createElement('tr'));
929
870
  naviLoginoutTR.appendChild(dom.createElement('td'));
@@ -943,15 +884,14 @@ module.exports = {
943
884
  naviMain.setAttribute('colspan', '3');
944
885
  var naviMenu = structure.appendChild(dom.createElement('tr'));
945
886
  naviMenu.setAttribute('class', 'naviMenu');
946
- naviMenu.setAttribute('style', ' text-align: middle; vertical-align: middle; padding-top: 4em; '); // naviMenu.setAttribute('style', 'margin-top: 3em;')
947
-
887
+ naviMenu.setAttribute('style', ' text-align: middle; vertical-align: middle; padding-top: 4em; ');
888
+ // naviMenu.setAttribute('style', 'margin-top: 3em;')
948
889
  var naviLeft = naviMenu.appendChild(dom.createElement('td'));
949
890
  var naviCenter = naviMenu.appendChild(dom.createElement('td'));
950
891
  var naviRight = naviMenu.appendChild(dom.createElement('td'));
951
892
  getForms();
952
893
  return div;
953
894
  } // render
954
-
955
895
  }; // property list
956
896
  // ends
957
897
  //# sourceMappingURL=schedulePane.js.map