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