solid-panes 3.5.27 → 3.5.28-67b6a3eb
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 +6 -8
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +10 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +47 -85
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +11 -36
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +11 -20
- 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 +3 -53
- 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 +1 -19
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +15 -58
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +13 -21
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +19 -28
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js +0 -0
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +26 -40
- 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 +7 -23
- 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 +9 -13
- 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 +4 -18
- 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 +2 -28
- 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 +1 -12
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +100 -237
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +2 -7
- 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 +9 -25
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +180 -581
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +1 -11
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +30 -25
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.d.ts +0 -0
- package/lib/outline/propertyViews.d.ts.map +0 -0
- package/lib/outline/propertyViews.js +0 -10
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +1 -3
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +24 -76
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +214 -454
- 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 +3 -20
- 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 +0 -0
- package/lib/profile/editProfile.view.js +7 -24
- 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 +29 -27
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js +0 -0
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +62 -122
- 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 +9 -14
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +45 -126
- 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 +1 -15
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +4 -7
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +2 -1
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +7 -9
- 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 +31 -90
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +20 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +30 -34
- 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 +8 -34
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +3 -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 +0 -10
- 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 +1 -22
- 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 +22 -28
- 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 +2 -5
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +25 -25
- package/src/RDFXMLPane.js +0 -0
- package/src/argument/argumentPane.js +0 -0
- 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 +0 -0
- 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 +0 -0
- package/src/chatPreferencesForm.ttl +0 -0
- package/src/classInstancePane.js +0 -0
- 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 +0 -0
- package/src/defaultPane.js +0 -0
- package/src/dokieli/Makefile +0 -0
- package/src/dokieli/dokieliPane.js +0 -0
- package/src/dokieli/new.html +0 -0
- package/src/dokieli/new.js +0 -0
- 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 +0 -0
- 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 +0 -0
- package/src/index.ts +0 -0
- 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 +0 -0
- package/src/n3Pane.js +0 -0
- package/src/outline/context.ts +0 -0
- package/src/outline/licenseOptions.js +0 -0
- package/src/outline/manager.js +2 -1
- package/src/outline/manager.test.ts +0 -0
- package/src/outline/outlineIcons.js +0 -0
- package/src/outline/propertyViews.test.ts +0 -0
- package/src/outline/propertyViews.ts +0 -0
- package/src/outline/queryByExample.js +0 -0
- package/src/outline/userInput.js +0 -0
- 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 +0 -0
- package/src/profile/editProfile.view.ts +0 -0
- package/src/profile/profile.dom.ts +0 -0
- package/src/profile/profileFormText.ttl +0 -0
- package/src/registerPanes.js +0 -0
- package/src/schedule/Makefile +0 -0
- package/src/schedule/formsForSchedule.js +0 -0
- package/src/schedule/formsForSchedule.ttl +0 -0
- package/src/schedule/schedulePane.js +0 -0
- package/src/sharing/sharingPane.ts +0 -0
- package/src/slideshow/slideshowPane.js +0 -0
- package/src/socialPane.js +2 -2
- package/src/style/tabbedtab.css +0 -0
- package/src/tabbed/tabbedPane.ts +0 -0
- package/src/tableViewPane.js +0 -0
- package/src/test-import-export/common.js +0 -0
- package/src/test-import-export/edit-importer.js +0 -0
- 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 +0 -0
- package/src/transaction/period.js +0 -0
- 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 +0 -0
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -0
- package/src/trustedApplications/trustedApplications.dom.ts +0 -0
- package/src/trustedApplications/trustedApplications.test.ts +0 -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 +0 -0
- package/src/versionInfo.ts +14 -14
- package/src/video/videoPane.js +0 -0
- 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
package/lib/outline/manager.js
CHANGED
|
@@ -1,55 +1,36 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = _default;
|
|
9
|
-
|
|
10
8
|
var paneRegistry = _interopRequireWildcard(require("pane-registry"));
|
|
11
|
-
|
|
12
9
|
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
13
|
-
|
|
14
10
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
15
|
-
|
|
16
11
|
var _solidLogic = require("solid-logic");
|
|
17
|
-
|
|
18
12
|
var _propertyViews = _interopRequireDefault(require("./propertyViews"));
|
|
19
|
-
|
|
13
|
+
var licenseOptions = _interopRequireWildcard(require("./licenseOptions"));
|
|
20
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
15
|
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); }
|
|
23
|
-
|
|
24
16
|
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; }
|
|
25
|
-
|
|
26
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
|
-
|
|
28
18
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
-
|
|
30
19
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
31
|
-
|
|
32
20
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
33
|
-
|
|
34
21
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
35
|
-
|
|
36
22
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
37
|
-
|
|
38
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
39
|
-
|
|
23
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
40
24
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
41
|
-
|
|
42
25
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
43
|
-
|
|
44
26
|
var outlineIcons = require('./outlineIcons.js');
|
|
45
|
-
|
|
46
27
|
var UserInput = require('./userInput.js');
|
|
47
|
-
|
|
48
28
|
var queryByExample = require('./queryByExample.js');
|
|
29
|
+
|
|
49
30
|
/* global alert XPathResult sourceWidget */
|
|
50
31
|
// XPathResult?
|
|
51
|
-
// const iconHeight = '24px'
|
|
52
32
|
|
|
33
|
+
// const iconHeight = '24px'
|
|
53
34
|
|
|
54
35
|
function _default(context) {
|
|
55
36
|
var dom = context.dom;
|
|
@@ -57,46 +38,37 @@ function _default(context) {
|
|
|
57
38
|
this.outlineIcons = outlineIcons;
|
|
58
39
|
this.labeller = this.labeller || {};
|
|
59
40
|
this.labeller.LanguagePreference = ''; // for now
|
|
60
|
-
|
|
61
41
|
var outline = this; // Kenny: do we need this?
|
|
62
|
-
|
|
63
42
|
var thisOutline = this;
|
|
64
43
|
var selection = [];
|
|
65
44
|
this.selection = selection;
|
|
66
45
|
this.ancestor = UI.utils.ancestor; // make available as outline.ancestor in callbacks
|
|
67
|
-
|
|
68
46
|
this.sparql = UI.rdf.UpdateManager;
|
|
69
47
|
this.kb = _solidLogic.store;
|
|
70
48
|
var kb = _solidLogic.store;
|
|
71
49
|
var sf = _solidLogic.store.fetcher;
|
|
72
50
|
dom.outline = this;
|
|
73
51
|
this.qs = new queryByExample.QuerySource(); // Track queries in queryByExample
|
|
52
|
+
|
|
74
53
|
// var selection = [] // Array of statements which have been selected
|
|
75
54
|
// this.focusTd // the <td> that is being observed
|
|
76
|
-
|
|
77
55
|
this.UserInput = new UserInput(this);
|
|
78
56
|
this.clipboardAddress = 'tabulator:clipboard'; // Weird
|
|
79
|
-
|
|
80
57
|
this.UserInput.clipboardInit(this.clipboardAddress);
|
|
81
58
|
var outlineElement = this.outlineElement;
|
|
82
|
-
|
|
83
59
|
this.init = function () {
|
|
84
60
|
var table = getOutlineContainer();
|
|
85
61
|
table.outline = this;
|
|
86
62
|
};
|
|
87
|
-
/** benchmark a function **/
|
|
88
|
-
|
|
89
63
|
|
|
64
|
+
/** benchmark a function **/
|
|
90
65
|
benchmark.lastkbsize = 0;
|
|
91
|
-
|
|
92
66
|
function benchmark(f) {
|
|
93
67
|
var args = [];
|
|
94
|
-
|
|
95
68
|
for (var i = arguments.length - 1; i > 0; i--) {
|
|
96
69
|
args[i - 1] = arguments[i];
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
70
|
+
}
|
|
71
|
+
// UI.log.debug('BENCHMARK: args=' + args.join());
|
|
100
72
|
var begin = new Date().getTime();
|
|
101
73
|
var returnValue = f.apply(f, args);
|
|
102
74
|
var end = new Date().getTime();
|
|
@@ -104,91 +76,78 @@ function _default(context) {
|
|
|
104
76
|
benchmark.lastkbsize = kb.statements.length;
|
|
105
77
|
return returnValue;
|
|
106
78
|
} // benchmark
|
|
79
|
+
|
|
107
80
|
// / ////////////////////// Representing data
|
|
108
|
-
// Represent an object in summary form as a table cell
|
|
109
81
|
|
|
82
|
+
// Represent an object in summary form as a table cell
|
|
110
83
|
|
|
111
84
|
function appendRemoveIcon(node, subject, removeNode) {
|
|
112
85
|
var image = UI.utils.AJARImage(outlineIcons.src.icon_remove_node, 'remove', undefined, dom);
|
|
113
|
-
image.addEventListener('click', removeNodeIconMouseDownListener);
|
|
114
|
-
|
|
86
|
+
image.addEventListener('click', removeNodeIconMouseDownListener);
|
|
87
|
+
// image.setAttribute('align', 'right') Causes icon to be moved down
|
|
115
88
|
image.node = removeNode;
|
|
116
89
|
image.setAttribute('about', subject.toNT());
|
|
117
90
|
image.style.marginLeft = '5px';
|
|
118
|
-
image.style.marginRight = '10px';
|
|
119
|
-
|
|
91
|
+
image.style.marginRight = '10px';
|
|
92
|
+
// image.style.border='solid #777 1px';
|
|
120
93
|
node.appendChild(image);
|
|
121
94
|
return image;
|
|
122
95
|
}
|
|
123
|
-
|
|
124
96
|
this.appendAccessIcons = function (kb, node, obj) {
|
|
125
97
|
if (obj.termType !== 'NamedNode') return;
|
|
126
98
|
var uris = kb.uris(obj);
|
|
127
99
|
uris.sort();
|
|
128
100
|
var last = null;
|
|
129
|
-
|
|
130
101
|
for (var i = 0; i < uris.length; i++) {
|
|
131
102
|
if (uris[i] === last) continue;
|
|
132
103
|
last = uris[i];
|
|
133
104
|
thisOutline.appendAccessIcon(node, last);
|
|
134
105
|
}
|
|
135
106
|
};
|
|
136
|
-
|
|
137
107
|
this.appendAccessIcon = function (node, uri) {
|
|
138
108
|
if (!uri) return '';
|
|
139
109
|
var docuri = UI.rdf.uri.docpart(uri);
|
|
140
110
|
if (docuri.slice(0, 5) !== 'http:') return '';
|
|
141
111
|
var state = sf.getState(docuri);
|
|
142
112
|
var icon, alt, listener;
|
|
143
|
-
|
|
144
113
|
switch (state) {
|
|
145
114
|
case 'unrequested':
|
|
146
115
|
icon = outlineIcons.src.icon_unrequested;
|
|
147
116
|
alt = 'fetch';
|
|
148
117
|
listener = unrequestedIconMouseDownListener;
|
|
149
118
|
break;
|
|
150
|
-
|
|
151
119
|
case 'requested':
|
|
152
120
|
icon = outlineIcons.src.icon_requested;
|
|
153
121
|
alt = 'fetching';
|
|
154
122
|
listener = failedIconMouseDownListener; // new: can retry yello blob
|
|
155
|
-
|
|
156
123
|
break;
|
|
157
|
-
|
|
158
124
|
case 'fetched':
|
|
159
125
|
icon = outlineIcons.src.icon_fetched;
|
|
160
126
|
listener = fetchedIconMouseDownListener;
|
|
161
127
|
alt = 'loaded';
|
|
162
128
|
break;
|
|
163
|
-
|
|
164
129
|
case 'failed':
|
|
165
130
|
icon = outlineIcons.src.icon_failed;
|
|
166
131
|
alt = 'failed';
|
|
167
132
|
listener = failedIconMouseDownListener;
|
|
168
133
|
break;
|
|
169
|
-
|
|
170
134
|
case 'unpermitted':
|
|
171
135
|
icon = outlineIcons.src.icon_failed;
|
|
172
136
|
listener = failedIconMouseDownListener;
|
|
173
137
|
alt = 'no perm';
|
|
174
138
|
break;
|
|
175
|
-
|
|
176
139
|
case 'unfetchable':
|
|
177
140
|
icon = outlineIcons.src.icon_failed;
|
|
178
141
|
listener = failedIconMouseDownListener;
|
|
179
142
|
alt = 'cannot fetch';
|
|
180
143
|
break;
|
|
181
|
-
|
|
182
144
|
default:
|
|
183
145
|
UI.log.error('?? state = ' + state);
|
|
184
146
|
break;
|
|
185
147
|
} // switch
|
|
186
|
-
|
|
187
|
-
|
|
188
148
|
var img = UI.utils.AJARImage(icon, alt, outlineIcons.tooltips[icon].replace(/[Tt]his resource/, docuri), dom);
|
|
189
149
|
img.setAttribute('uri', uri);
|
|
190
150
|
img.addEventListener('click', listener); // @@ seemed to be missing 2017-08
|
|
191
|
-
|
|
192
151
|
addButtonCallbacks(img, docuri);
|
|
193
152
|
node.appendChild(img);
|
|
194
153
|
return img;
|
|
@@ -199,80 +158,69 @@ function _default(context) {
|
|
|
199
158
|
* @param view - a VIEW function (rather than a bool asImage)
|
|
200
159
|
**/
|
|
201
160
|
|
|
202
|
-
|
|
203
161
|
this.outlineObjectTD = function outlineObjectTD(obj, view, deleteNode, statement) {
|
|
204
162
|
var td = dom.createElement('td');
|
|
205
163
|
td.setAttribute('style', 'margin: 0.2em; border: none; padding: 0; vertical-align: top;');
|
|
206
164
|
td.setAttribute('notSelectable', 'false');
|
|
207
|
-
var theClass = 'obj';
|
|
165
|
+
var theClass = 'obj';
|
|
208
166
|
|
|
167
|
+
// check the IPR on the data. Ok if there is any checked license which is one the document has.
|
|
209
168
|
if (statement && statement.why) {
|
|
210
|
-
if (
|
|
169
|
+
if (licenseOptions && licenseOptions.checkLicence()) {
|
|
211
170
|
theClass += ' licOkay'; // flag as light green etc .licOkay {background-color: #dfd}
|
|
212
171
|
}
|
|
213
|
-
}
|
|
214
|
-
|
|
172
|
+
}
|
|
215
173
|
|
|
174
|
+
// set about and put 'expand' icon
|
|
216
175
|
if (obj.termType === 'NamedNode' || obj.termType === 'BlankNode' || obj.termType === 'Literal' && obj.value.slice && (obj.value.slice(0, 6) === 'ftp://' || obj.value.slice(0, 8) === 'https://' || obj.value.slice(0, 7) === 'http://')) {
|
|
217
176
|
td.setAttribute('about', obj.toNT());
|
|
218
177
|
td.appendChild(UI.utils.AJARImage(UI.icons.originalIconBase + 'tbl-expand-trans.png', 'expand', undefined, dom)).addEventListener('click', expandMouseDownListener);
|
|
219
178
|
}
|
|
220
|
-
|
|
221
179
|
td.setAttribute('class', theClass); // this is how you find an object
|
|
222
180
|
// @@ TAKE CSS OUT OF STYLE SHEET
|
|
223
|
-
|
|
224
181
|
if (kb.whether(obj, UI.ns.rdf('type'), UI.ns.link('Request'))) {
|
|
225
182
|
td.className = 'undetermined';
|
|
226
183
|
} // @@? why-timbl
|
|
227
184
|
|
|
228
|
-
|
|
229
185
|
if (!view) {
|
|
230
186
|
// view should be a function pointer
|
|
231
187
|
view = viewAsBoringDefault;
|
|
232
188
|
}
|
|
233
|
-
|
|
234
189
|
td.appendChild(view(obj));
|
|
235
|
-
|
|
236
190
|
if (deleteNode) {
|
|
237
191
|
appendRemoveIcon(td, obj, deleteNode);
|
|
238
|
-
}
|
|
239
|
-
|
|
192
|
+
}
|
|
240
193
|
|
|
194
|
+
// set DOM methods
|
|
241
195
|
td.tabulatorSelect = function () {
|
|
242
196
|
setSelected(this, true);
|
|
243
197
|
};
|
|
244
|
-
|
|
245
198
|
td.tabulatorDeselect = function () {
|
|
246
199
|
setSelected(this, false);
|
|
247
200
|
};
|
|
248
|
-
|
|
249
201
|
td.addEventListener('click', selectableTDClickListener);
|
|
250
202
|
return td;
|
|
251
203
|
}; // outlineObjectTD
|
|
252
204
|
|
|
253
|
-
|
|
254
205
|
this.outlinePredicateTD = function outlinePredicateTD(predicate, newTr, inverse, internal) {
|
|
255
206
|
var predicateTD = dom.createElement('TD');
|
|
256
207
|
predicateTD.setAttribute('about', predicate.toNT());
|
|
257
208
|
predicateTD.setAttribute('class', internal ? 'pred internal' : 'pred');
|
|
258
209
|
var lab;
|
|
259
|
-
|
|
260
210
|
switch (predicate.termType) {
|
|
261
211
|
case 'BlankNode':
|
|
262
212
|
// TBD
|
|
263
213
|
predicateTD.className = 'undetermined';
|
|
264
214
|
break;
|
|
265
|
-
|
|
266
215
|
case 'NamedNode':
|
|
267
216
|
lab = UI.utils.predicateLabelForXML(predicate, inverse);
|
|
268
217
|
break;
|
|
269
|
-
|
|
270
218
|
case 'Collection':
|
|
271
219
|
// some choices of predicate
|
|
272
220
|
lab = UI.utils.predicateLabelForXML(predicate.elements[0], inverse);
|
|
273
221
|
}
|
|
274
|
-
|
|
275
|
-
|
|
222
|
+
lab = lab.slice(0, 1).toUpperCase() + lab.slice(1);
|
|
223
|
+
// if (kb.statementsMatching(predicate,rdf('type'), UI.ns.link('Request')).length) predicateTD.className='undetermined';
|
|
276
224
|
|
|
277
225
|
var labelTD = dom.createElement('TD');
|
|
278
226
|
labelTD.setAttribute('style', 'margin: 0.2em; border: none; padding: 0; vertical-align: top;');
|
|
@@ -281,25 +229,21 @@ function _default(context) {
|
|
|
281
229
|
predicateTD.appendChild(labelTD);
|
|
282
230
|
labelTD.style.width = '100%';
|
|
283
231
|
predicateTD.appendChild(termWidget.construct(dom)); // termWidget is global???
|
|
284
|
-
|
|
285
232
|
for (var w in outlineIcons.termWidgets) {
|
|
286
233
|
if (!newTr || !newTr.AJAR_statement) break; // case for TBD as predicate
|
|
287
234
|
// alert(Icon.termWidgets[w]+' '+Icon.termWidgets[w].filter)
|
|
288
|
-
|
|
289
235
|
if (outlineIcons.termWidgets[w].filter && outlineIcons.termWidgets[w].filter(newTr.AJAR_statement, 'pred', inverse)) {
|
|
290
236
|
termWidget.addIcon(predicateTD, outlineIcons.termWidgets[w]);
|
|
291
237
|
}
|
|
292
|
-
}
|
|
293
|
-
|
|
238
|
+
}
|
|
294
239
|
|
|
240
|
+
// set DOM methods
|
|
295
241
|
predicateTD.tabulatorSelect = function () {
|
|
296
242
|
setSelected(this, true);
|
|
297
243
|
};
|
|
298
|
-
|
|
299
244
|
predicateTD.tabulatorDeselect = function () {
|
|
300
245
|
setSelected(this, false);
|
|
301
246
|
};
|
|
302
|
-
|
|
303
247
|
predicateTD.addEventListener('click', selectableTDClickListener);
|
|
304
248
|
return predicateTD;
|
|
305
249
|
}; // outlinePredicateTD
|
|
@@ -312,21 +256,18 @@ function _default(context) {
|
|
|
312
256
|
* @param {Function} [options.onClose] If given, will present an X for the dashboard, and call this method when clicked
|
|
313
257
|
* @returns Promise<{Element}> - the div that holds the dashboard
|
|
314
258
|
*/
|
|
315
|
-
|
|
316
|
-
|
|
317
259
|
function globalAppTabs() {
|
|
318
260
|
return _globalAppTabs.apply(this, arguments);
|
|
319
261
|
}
|
|
320
|
-
|
|
321
262
|
function _globalAppTabs() {
|
|
322
263
|
_globalAppTabs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
323
264
|
var options,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
265
|
+
div,
|
|
266
|
+
me,
|
|
267
|
+
items,
|
|
268
|
+
renderTab,
|
|
269
|
+
renderMain,
|
|
270
|
+
_args = arguments;
|
|
330
271
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
331
272
|
while (1) {
|
|
332
273
|
switch (_context.prev = _context.next) {
|
|
@@ -334,37 +275,28 @@ function _default(context) {
|
|
|
334
275
|
renderMain = function _renderMain(containerDiv, item) {
|
|
335
276
|
// Items are pane names
|
|
336
277
|
var pane = paneRegistry.byName(item.paneName); // 20190701
|
|
337
|
-
|
|
338
278
|
containerDiv.innerHTML = '';
|
|
339
279
|
var table = containerDiv.appendChild(dom.createElement('table'));
|
|
340
|
-
|
|
341
280
|
var me = _solidLogic.authn.currentUser();
|
|
342
|
-
|
|
343
281
|
thisOutline.GotoSubject(item.subject || me, true, pane, false, undefined, table);
|
|
344
282
|
};
|
|
345
|
-
|
|
346
283
|
renderTab = function _renderTab(div, item) {
|
|
347
284
|
div.dataset.globalPaneName = item.tabName || item.paneName;
|
|
348
285
|
div.textContent = item.label;
|
|
349
286
|
};
|
|
350
|
-
|
|
351
287
|
options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
352
288
|
console.log('globalAppTabs @@');
|
|
353
289
|
div = dom.createElement('div');
|
|
354
290
|
me = _solidLogic.authn.currentUser();
|
|
355
|
-
|
|
356
291
|
if (me) {
|
|
357
292
|
_context.next = 9;
|
|
358
293
|
break;
|
|
359
294
|
}
|
|
360
|
-
|
|
361
295
|
alert('Must be logged in for this');
|
|
362
296
|
throw new Error('Not logged in');
|
|
363
|
-
|
|
364
297
|
case 9:
|
|
365
298
|
_context.next = 11;
|
|
366
299
|
return getDashboardItems();
|
|
367
|
-
|
|
368
300
|
case 11:
|
|
369
301
|
items = _context.sent;
|
|
370
302
|
div.appendChild(UI.tabs.tabWidget({
|
|
@@ -381,7 +313,6 @@ function _default(context) {
|
|
|
381
313
|
onClose: options.onClose
|
|
382
314
|
}));
|
|
383
315
|
return _context.abrupt("return", div);
|
|
384
|
-
|
|
385
316
|
case 14:
|
|
386
317
|
case "end":
|
|
387
318
|
return _context.stop();
|
|
@@ -391,17 +322,13 @@ function _default(context) {
|
|
|
391
322
|
}));
|
|
392
323
|
return _globalAppTabs.apply(this, arguments);
|
|
393
324
|
}
|
|
394
|
-
|
|
395
325
|
this.getDashboard = globalAppTabs;
|
|
396
|
-
|
|
397
326
|
function getDashboardItems() {
|
|
398
327
|
return _getDashboardItems.apply(this, arguments);
|
|
399
328
|
}
|
|
400
|
-
|
|
401
329
|
function _getDashboardItems() {
|
|
402
330
|
_getDashboardItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
403
331
|
var me, div, _yield$Promise$all, _yield$Promise$all2, books, pods, getPods, _getPods, getAddressBooks, _getAddressBooks;
|
|
404
|
-
|
|
405
332
|
return _regeneratorRuntime().wrap(function _callee7$(_context8) {
|
|
406
333
|
while (1) {
|
|
407
334
|
switch (_context8.prev = _context8.next) {
|
|
@@ -409,7 +336,6 @@ function _default(context) {
|
|
|
409
336
|
_getAddressBooks = function _getAddressBooks3() {
|
|
410
337
|
_getAddressBooks = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
411
338
|
var _context6;
|
|
412
|
-
|
|
413
339
|
return _regeneratorRuntime().wrap(function _callee6$(_context7) {
|
|
414
340
|
while (1) {
|
|
415
341
|
switch (_context7.prev = _context7.next) {
|
|
@@ -421,7 +347,6 @@ function _default(context) {
|
|
|
421
347
|
div: div,
|
|
422
348
|
dom: dom
|
|
423
349
|
}, ns.vcard('AddressBook'));
|
|
424
|
-
|
|
425
350
|
case 3:
|
|
426
351
|
_context6 = _context7.sent;
|
|
427
352
|
return _context7.abrupt("return", (_context6.instances || []).map(function (book, index) {
|
|
@@ -433,15 +358,12 @@ function _default(context) {
|
|
|
433
358
|
icon: UI.icons.iconBase + 'noun_15695.svg'
|
|
434
359
|
};
|
|
435
360
|
}));
|
|
436
|
-
|
|
437
361
|
case 7:
|
|
438
362
|
_context7.prev = 7;
|
|
439
363
|
_context7.t0 = _context7["catch"](0);
|
|
440
364
|
console.error('oops in globalAppTabs AddressBook');
|
|
441
|
-
|
|
442
365
|
case 10:
|
|
443
366
|
return _context7.abrupt("return", []);
|
|
444
|
-
|
|
445
367
|
case 11:
|
|
446
368
|
case "end":
|
|
447
369
|
return _context7.stop();
|
|
@@ -451,15 +373,12 @@ function _default(context) {
|
|
|
451
373
|
}));
|
|
452
374
|
return _getAddressBooks.apply(this, arguments);
|
|
453
375
|
};
|
|
454
|
-
|
|
455
376
|
getAddressBooks = function _getAddressBooks2() {
|
|
456
377
|
return _getAddressBooks.apply(this, arguments);
|
|
457
378
|
};
|
|
458
|
-
|
|
459
379
|
_getPods = function _getPods3() {
|
|
460
380
|
_getPods = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
461
381
|
var addPodStorage, _addPodStorage, addPodStorageFromUrl, _addPodStorageFromUrl, pods, uri, podUrl, uniques;
|
|
462
|
-
|
|
463
382
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
464
383
|
while (1) {
|
|
465
384
|
switch (_context5.prev = _context5.next) {
|
|
@@ -473,7 +392,6 @@ function _default(context) {
|
|
|
473
392
|
});
|
|
474
393
|
return uniqueNodes;
|
|
475
394
|
};
|
|
476
|
-
|
|
477
395
|
_addPodStorageFromUrl = function _addPodStorageFromUrl3() {
|
|
478
396
|
_addPodStorageFromUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(url) {
|
|
479
397
|
var podStorage, pathStorage;
|
|
@@ -482,31 +400,24 @@ function _default(context) {
|
|
|
482
400
|
switch (_context4.prev = _context4.next) {
|
|
483
401
|
case 0:
|
|
484
402
|
podStorage = new URL(url); // check for predicate pim:Storage in containers up the path tree
|
|
485
|
-
|
|
486
403
|
pathStorage = podStorage.pathname;
|
|
487
|
-
|
|
488
404
|
case 2:
|
|
489
405
|
if (!pathStorage.length) {
|
|
490
406
|
_context4.next = 10;
|
|
491
407
|
break;
|
|
492
408
|
}
|
|
493
|
-
|
|
494
409
|
pathStorage = pathStorage.substring(0, pathStorage.lastIndexOf('/'));
|
|
495
410
|
_context4.next = 6;
|
|
496
411
|
return addPodStorage(kb.sym("".concat(podStorage.origin).concat(pathStorage, "/")));
|
|
497
|
-
|
|
498
412
|
case 6:
|
|
499
413
|
if (!_context4.sent) {
|
|
500
414
|
_context4.next = 8;
|
|
501
415
|
break;
|
|
502
416
|
}
|
|
503
|
-
|
|
504
417
|
return _context4.abrupt("return");
|
|
505
|
-
|
|
506
418
|
case 8:
|
|
507
419
|
_context4.next = 2;
|
|
508
420
|
break;
|
|
509
|
-
|
|
510
421
|
case 10:
|
|
511
422
|
case "end":
|
|
512
423
|
return _context4.stop();
|
|
@@ -516,11 +427,9 @@ function _default(context) {
|
|
|
516
427
|
}));
|
|
517
428
|
return _addPodStorageFromUrl.apply(this, arguments);
|
|
518
429
|
};
|
|
519
|
-
|
|
520
430
|
addPodStorageFromUrl = function _addPodStorageFromUrl2(_x8) {
|
|
521
431
|
return _addPodStorageFromUrl.apply(this, arguments);
|
|
522
432
|
};
|
|
523
|
-
|
|
524
433
|
_addPodStorage = function _addPodStorage3() {
|
|
525
434
|
_addPodStorage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(pod) {
|
|
526
435
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
@@ -529,19 +438,15 @@ function _default(context) {
|
|
|
529
438
|
case 0:
|
|
530
439
|
_context3.next = 2;
|
|
531
440
|
return loadContainerRepresentation(pod);
|
|
532
|
-
|
|
533
441
|
case 2:
|
|
534
442
|
if (!kb.holds(pod, ns.rdf('type'), ns.space('Storage'), pod.doc())) {
|
|
535
443
|
_context3.next = 5;
|
|
536
444
|
break;
|
|
537
445
|
}
|
|
538
|
-
|
|
539
446
|
pods.push(pod);
|
|
540
447
|
return _context3.abrupt("return", true);
|
|
541
|
-
|
|
542
448
|
case 5:
|
|
543
449
|
return _context3.abrupt("return", false);
|
|
544
|
-
|
|
545
450
|
case 6:
|
|
546
451
|
case "end":
|
|
547
452
|
return _context3.stop();
|
|
@@ -551,25 +456,20 @@ function _default(context) {
|
|
|
551
456
|
}));
|
|
552
457
|
return _addPodStorage.apply(this, arguments);
|
|
553
458
|
};
|
|
554
|
-
|
|
555
459
|
addPodStorage = function _addPodStorage2(_x7) {
|
|
556
460
|
return _addPodStorage.apply(this, arguments);
|
|
557
461
|
};
|
|
558
|
-
|
|
559
462
|
_context5.prev = 5;
|
|
560
463
|
_context5.next = 8;
|
|
561
464
|
return kb.fetcher.load(me.doc());
|
|
562
|
-
|
|
563
465
|
case 8:
|
|
564
466
|
_context5.next = 14;
|
|
565
467
|
break;
|
|
566
|
-
|
|
567
468
|
case 10:
|
|
568
469
|
_context5.prev = 10;
|
|
569
470
|
_context5.t0 = _context5["catch"](5);
|
|
570
471
|
console.error('Unable to load profile', _context5.t0);
|
|
571
472
|
return _context5.abrupt("return", []);
|
|
572
|
-
|
|
573
473
|
case 14:
|
|
574
474
|
// load pod's storages from profile
|
|
575
475
|
pods = kb.each(me, ns.space('storage'), null, me.doc());
|
|
@@ -581,7 +481,6 @@ function _default(context) {
|
|
|
581
481
|
case 0:
|
|
582
482
|
_context2.next = 2;
|
|
583
483
|
return loadContainerRepresentation(pod);
|
|
584
|
-
|
|
585
484
|
case 2:
|
|
586
485
|
case "end":
|
|
587
486
|
return _context2.stop();
|
|
@@ -589,7 +488,6 @@ function _default(context) {
|
|
|
589
488
|
}
|
|
590
489
|
}, _callee2);
|
|
591
490
|
}));
|
|
592
|
-
|
|
593
491
|
return function (_x9) {
|
|
594
492
|
return _ref.apply(this, arguments);
|
|
595
493
|
};
|
|
@@ -600,32 +498,25 @@ function _default(context) {
|
|
|
600
498
|
podUrl = uri || window.location.href;
|
|
601
499
|
_context5.next = 21;
|
|
602
500
|
return addPodStorageFromUrl(podUrl);
|
|
603
|
-
|
|
604
501
|
case 21:
|
|
605
502
|
_context5.next = 26;
|
|
606
503
|
break;
|
|
607
|
-
|
|
608
504
|
case 23:
|
|
609
505
|
_context5.prev = 23;
|
|
610
506
|
_context5.t1 = _context5["catch"](16);
|
|
611
507
|
console.error('cannot load container', _context5.t1);
|
|
612
|
-
|
|
613
508
|
case 26:
|
|
614
509
|
pods = uniques(pods);
|
|
615
|
-
|
|
616
510
|
if (pods.length) {
|
|
617
511
|
_context5.next = 29;
|
|
618
512
|
break;
|
|
619
513
|
}
|
|
620
|
-
|
|
621
514
|
return _context5.abrupt("return", []);
|
|
622
|
-
|
|
623
515
|
case 29:
|
|
624
516
|
return _context5.abrupt("return", pods.map(function (pod, index) {
|
|
625
517
|
function split(item) {
|
|
626
518
|
return item.uri.split('//')[1].slice(0, -1);
|
|
627
519
|
}
|
|
628
|
-
|
|
629
520
|
var label = split(me).startsWith(split(pod)) ? 'Your storage' : split(pod);
|
|
630
521
|
return {
|
|
631
522
|
paneName: 'folder',
|
|
@@ -635,7 +526,6 @@ function _default(context) {
|
|
|
635
526
|
icon: UI.icons.iconBase + 'noun_Cabinet_251723.svg'
|
|
636
527
|
};
|
|
637
528
|
}));
|
|
638
|
-
|
|
639
529
|
case 30:
|
|
640
530
|
case "end":
|
|
641
531
|
return _context5.stop();
|
|
@@ -645,25 +535,19 @@ function _default(context) {
|
|
|
645
535
|
}));
|
|
646
536
|
return _getPods.apply(this, arguments);
|
|
647
537
|
};
|
|
648
|
-
|
|
649
538
|
getPods = function _getPods2() {
|
|
650
539
|
return _getPods.apply(this, arguments);
|
|
651
540
|
};
|
|
652
|
-
|
|
653
541
|
me = _solidLogic.authn.currentUser();
|
|
654
|
-
|
|
655
542
|
if (me) {
|
|
656
543
|
_context8.next = 7;
|
|
657
544
|
break;
|
|
658
545
|
}
|
|
659
|
-
|
|
660
546
|
return _context8.abrupt("return", []);
|
|
661
|
-
|
|
662
547
|
case 7:
|
|
663
548
|
div = dom.createElement('div');
|
|
664
549
|
_context8.next = 10;
|
|
665
550
|
return Promise.all([getAddressBooks(), getPods()]);
|
|
666
|
-
|
|
667
551
|
case 10:
|
|
668
552
|
_yield$Promise$all = _context8.sent;
|
|
669
553
|
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
|
|
@@ -682,7 +566,6 @@ function _default(context) {
|
|
|
682
566
|
label: 'Edit your profile',
|
|
683
567
|
icon: UI.icons.iconBase + 'noun_492246.svg'
|
|
684
568
|
}].concat(books).concat(pods));
|
|
685
|
-
|
|
686
569
|
case 15:
|
|
687
570
|
case "end":
|
|
688
571
|
return _context8.stop();
|
|
@@ -692,8 +575,8 @@ function _default(context) {
|
|
|
692
575
|
}));
|
|
693
576
|
return _getDashboardItems.apply(this, arguments);
|
|
694
577
|
}
|
|
695
|
-
|
|
696
578
|
this.getDashboardItems = getDashboardItems;
|
|
579
|
+
|
|
697
580
|
/**
|
|
698
581
|
* Call this method to show the global dashboard.
|
|
699
582
|
*
|
|
@@ -701,22 +584,19 @@ function _default(context) {
|
|
|
701
584
|
* @param {string} [options.pane] To open a specific dashboard pane
|
|
702
585
|
* @returns {Promise<void>}
|
|
703
586
|
*/
|
|
704
|
-
|
|
705
587
|
function showDashboard() {
|
|
706
588
|
return _showDashboard.apply(this, arguments);
|
|
707
589
|
}
|
|
708
|
-
|
|
709
590
|
function _showDashboard() {
|
|
710
591
|
_showDashboard = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
711
592
|
var options,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
593
|
+
dashboardContainer,
|
|
594
|
+
outlineContainer,
|
|
595
|
+
_tab,
|
|
596
|
+
dashboard,
|
|
597
|
+
tab,
|
|
598
|
+
closeDashboard,
|
|
599
|
+
_args8 = arguments;
|
|
720
600
|
return _regeneratorRuntime().wrap(function _callee8$(_context9) {
|
|
721
601
|
while (1) {
|
|
722
602
|
switch (_context9.prev = _context9.next) {
|
|
@@ -725,54 +605,42 @@ function _default(context) {
|
|
|
725
605
|
dashboardContainer.style.display = 'none';
|
|
726
606
|
outlineContainer.style.display = 'inherit';
|
|
727
607
|
};
|
|
728
|
-
|
|
729
608
|
options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
|
|
730
609
|
dashboardContainer = getDashboardContainer();
|
|
731
610
|
outlineContainer = getOutlineContainer(); // reuse dashboard if already children already is inserted
|
|
732
|
-
|
|
733
611
|
if (!(dashboardContainer.childNodes.length > 0 && options.pane)) {
|
|
734
612
|
_context9.next = 12;
|
|
735
613
|
break;
|
|
736
614
|
}
|
|
737
|
-
|
|
738
615
|
outlineContainer.style.display = 'none';
|
|
739
616
|
dashboardContainer.style.display = 'inherit';
|
|
740
617
|
_tab = dashboardContainer.querySelector("[data-global-pane-name=\"".concat(options.pane, "\"]"));
|
|
741
|
-
|
|
742
618
|
if (!_tab) {
|
|
743
619
|
_context9.next = 11;
|
|
744
620
|
break;
|
|
745
621
|
}
|
|
746
|
-
|
|
747
622
|
_tab.click();
|
|
748
|
-
|
|
749
623
|
return _context9.abrupt("return");
|
|
750
|
-
|
|
751
624
|
case 11:
|
|
752
625
|
console.warn('Did not find the referred tab in global dashboard, will open first one');
|
|
753
|
-
|
|
754
626
|
case 12:
|
|
755
627
|
_context9.next = 14;
|
|
756
628
|
return globalAppTabs({
|
|
757
629
|
selectedTab: options.pane,
|
|
758
630
|
onClose: closeDashboard
|
|
759
631
|
});
|
|
760
|
-
|
|
761
632
|
case 14:
|
|
762
633
|
dashboard = _context9.sent;
|
|
763
|
-
|
|
764
634
|
// close the dashboard if user log out
|
|
765
|
-
_solidLogic.authSession.onLogout(closeDashboard);
|
|
766
|
-
|
|
635
|
+
_solidLogic.authSession.onLogout(closeDashboard);
|
|
767
636
|
|
|
637
|
+
// finally - switch to showing dashboard
|
|
768
638
|
outlineContainer.style.display = 'none';
|
|
769
639
|
dashboardContainer.appendChild(dashboard);
|
|
770
640
|
tab = dashboardContainer.querySelector("[data-global-pane-name=\"".concat(options.pane, "\"]"));
|
|
771
|
-
|
|
772
641
|
if (tab) {
|
|
773
642
|
tab.click();
|
|
774
643
|
}
|
|
775
|
-
|
|
776
644
|
case 20:
|
|
777
645
|
case "end":
|
|
778
646
|
return _context9.stop();
|
|
@@ -782,24 +650,20 @@ function _default(context) {
|
|
|
782
650
|
}));
|
|
783
651
|
return _showDashboard.apply(this, arguments);
|
|
784
652
|
}
|
|
785
|
-
|
|
786
653
|
this.showDashboard = showDashboard;
|
|
787
|
-
|
|
788
654
|
function getDashboardContainer() {
|
|
789
655
|
return getOrCreateContainer('GlobalDashboard');
|
|
790
656
|
}
|
|
791
|
-
|
|
792
657
|
function getOutlineContainer() {
|
|
793
658
|
return getOrCreateContainer('outline');
|
|
794
659
|
}
|
|
660
|
+
|
|
795
661
|
/**
|
|
796
662
|
* Get element with id or create a new on the fly with that id
|
|
797
663
|
*
|
|
798
664
|
* @param {string} id The ID of the element you want to get or create
|
|
799
665
|
* @returns {HTMLElement}
|
|
800
666
|
*/
|
|
801
|
-
|
|
802
|
-
|
|
803
667
|
function getOrCreateContainer(id) {
|
|
804
668
|
return document.getElementById(id) || function () {
|
|
805
669
|
var dashboardContainer = document.createElement('div');
|
|
@@ -808,11 +672,9 @@ function _default(context) {
|
|
|
808
672
|
return mainContainer.appendChild(dashboardContainer);
|
|
809
673
|
}();
|
|
810
674
|
}
|
|
811
|
-
|
|
812
675
|
function loadContainerRepresentation(_x) {
|
|
813
676
|
return _loadContainerRepresentation.apply(this, arguments);
|
|
814
677
|
}
|
|
815
|
-
|
|
816
678
|
function _loadContainerRepresentation() {
|
|
817
679
|
_loadContainerRepresentation = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(subject) {
|
|
818
680
|
var response, containerTurtle;
|
|
@@ -824,19 +686,16 @@ function _default(context) {
|
|
|
824
686
|
_context10.next = 6;
|
|
825
687
|
break;
|
|
826
688
|
}
|
|
827
|
-
|
|
828
689
|
_context10.next = 3;
|
|
829
690
|
return kb.fetcher.webOperation('GET', subject.uri, kb.fetcher.initFetchOptions(subject.uri, {
|
|
830
691
|
headers: {
|
|
831
692
|
accept: 'text/turtle'
|
|
832
693
|
}
|
|
833
694
|
}));
|
|
834
|
-
|
|
835
695
|
case 3:
|
|
836
696
|
response = _context10.sent;
|
|
837
697
|
containerTurtle = response.responseText;
|
|
838
698
|
$rdf.parse(containerTurtle, kb, subject.uri, 'text/turtle');
|
|
839
|
-
|
|
840
699
|
case 6:
|
|
841
700
|
case "end":
|
|
842
701
|
return _context10.stop();
|
|
@@ -846,11 +705,9 @@ function _default(context) {
|
|
|
846
705
|
}));
|
|
847
706
|
return _loadContainerRepresentation.apply(this, arguments);
|
|
848
707
|
}
|
|
849
|
-
|
|
850
708
|
function getRelevantPanes(_x2, _x3) {
|
|
851
709
|
return _getRelevantPanes.apply(this, arguments);
|
|
852
710
|
}
|
|
853
|
-
|
|
854
711
|
function _getRelevantPanes() {
|
|
855
712
|
_getRelevantPanes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(subject, context) {
|
|
856
713
|
var panes, relevantPanes, filteredPanes, firstRelevantPaneIndex, firstFilteredPaneIndex;
|
|
@@ -862,43 +719,32 @@ function _default(context) {
|
|
|
862
719
|
_context11.next = 3;
|
|
863
720
|
break;
|
|
864
721
|
}
|
|
865
|
-
|
|
866
722
|
_context11.next = 3;
|
|
867
723
|
return loadContainerRepresentation(subject);
|
|
868
|
-
|
|
869
724
|
case 3:
|
|
870
725
|
panes = context.session.paneRegistry;
|
|
871
726
|
relevantPanes = panes.list.filter(function (pane) {
|
|
872
727
|
return pane.label(subject, context) && !pane.global;
|
|
873
728
|
});
|
|
874
|
-
|
|
875
729
|
if (!(relevantPanes.length === 0)) {
|
|
876
730
|
_context11.next = 7;
|
|
877
731
|
break;
|
|
878
732
|
}
|
|
879
|
-
|
|
880
733
|
return _context11.abrupt("return", [panes.byName('internal')]);
|
|
881
|
-
|
|
882
734
|
case 7:
|
|
883
735
|
_context11.next = 9;
|
|
884
736
|
return UI.login.filterAvailablePanes(relevantPanes);
|
|
885
|
-
|
|
886
737
|
case 9:
|
|
887
738
|
filteredPanes = _context11.sent;
|
|
888
|
-
|
|
889
739
|
if (!(filteredPanes.length === 0)) {
|
|
890
740
|
_context11.next = 12;
|
|
891
741
|
break;
|
|
892
742
|
}
|
|
893
|
-
|
|
894
743
|
return _context11.abrupt("return", [relevantPanes[0]]);
|
|
895
|
-
|
|
896
744
|
case 12:
|
|
897
745
|
firstRelevantPaneIndex = panes.list.indexOf(relevantPanes[0]);
|
|
898
746
|
firstFilteredPaneIndex = panes.list.indexOf(filteredPanes[0]); // if the first relevant pane is loaded before the panes available wrt role, we still want to offer the most relevant pane
|
|
899
|
-
|
|
900
747
|
return _context11.abrupt("return", firstRelevantPaneIndex < firstFilteredPaneIndex ? [relevantPanes[0]].concat(filteredPanes) : filteredPanes);
|
|
901
|
-
|
|
902
748
|
case 15:
|
|
903
749
|
case "end":
|
|
904
750
|
return _context11.stop();
|
|
@@ -908,18 +754,15 @@ function _default(context) {
|
|
|
908
754
|
}));
|
|
909
755
|
return _getRelevantPanes.apply(this, arguments);
|
|
910
756
|
}
|
|
911
|
-
|
|
912
757
|
function getPane(relevantPanes, subject) {
|
|
913
758
|
return relevantPanes.find(function (pane) {
|
|
914
759
|
return pane.shouldGetFocus && pane.shouldGetFocus(subject);
|
|
915
760
|
}) || relevantPanes[0];
|
|
916
761
|
}
|
|
917
|
-
|
|
918
762
|
function expandedHeaderTR(_x4, _x5, _x6) {
|
|
919
763
|
return _expandedHeaderTR.apply(this, arguments);
|
|
920
764
|
} // expandedHeaderTR
|
|
921
765
|
// / //////////////////////////////////////////////////////////////////////////
|
|
922
|
-
|
|
923
766
|
/* PANES
|
|
924
767
|
**
|
|
925
768
|
** Panes are regions of the outline view in which a particular subject is
|
|
@@ -931,7 +774,6 @@ function _default(context) {
|
|
|
931
774
|
// The defaultPane is the first one registered for which the label method exists
|
|
932
775
|
// Those registered first take priority as a default pane.
|
|
933
776
|
// That is, those earlier in this file
|
|
934
|
-
|
|
935
777
|
/**
|
|
936
778
|
* Pane registration
|
|
937
779
|
*/
|
|
@@ -939,12 +781,9 @@ function _default(context) {
|
|
|
939
781
|
// / ///////////////////////////////////////////////////////////////////////////
|
|
940
782
|
// Remove a node from the DOM so that Firefox refreshes the screen OK
|
|
941
783
|
// Just deleting it cause whitespace to accumulate.
|
|
942
|
-
|
|
943
|
-
|
|
944
784
|
function _expandedHeaderTR() {
|
|
945
785
|
_expandedHeaderTR = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(subject, requiredPane, options) {
|
|
946
786
|
var renderPaneIconTray, _renderPaneIconTray, tr, td, header, showHeader, icon, strong;
|
|
947
|
-
|
|
948
787
|
return _regeneratorRuntime().wrap(function _callee12$(_context13) {
|
|
949
788
|
while (1) {
|
|
950
789
|
switch (_context13.prev = _context13.next) {
|
|
@@ -952,12 +791,12 @@ function _default(context) {
|
|
|
952
791
|
_renderPaneIconTray = function _renderPaneIconTray3() {
|
|
953
792
|
_renderPaneIconTray = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(td) {
|
|
954
793
|
var options,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
794
|
+
paneShownStyle,
|
|
795
|
+
paneHiddenStyle,
|
|
796
|
+
paneIconTray,
|
|
797
|
+
relevantPanes,
|
|
798
|
+
paneNumber,
|
|
799
|
+
_args11 = arguments;
|
|
961
800
|
return _regeneratorRuntime().wrap(function _callee11$(_context12) {
|
|
962
801
|
while (1) {
|
|
963
802
|
switch (_context12.prev = _context12.next) {
|
|
@@ -967,28 +806,22 @@ function _default(context) {
|
|
|
967
806
|
paneHiddenStyle = 'width: 24px; border-radius: 0.5em; margin-left: 1em; padding: 3px';
|
|
968
807
|
paneIconTray = td.appendChild(dom.createElement('nav'));
|
|
969
808
|
paneIconTray.style = 'display:flex; justify-content: flex-start; align-items: center;';
|
|
970
|
-
|
|
971
809
|
if (!options.hideList) {
|
|
972
810
|
_context12.next = 9;
|
|
973
811
|
break;
|
|
974
812
|
}
|
|
975
|
-
|
|
976
813
|
_context12.t0 = [];
|
|
977
814
|
_context12.next = 12;
|
|
978
815
|
break;
|
|
979
|
-
|
|
980
816
|
case 9:
|
|
981
817
|
_context12.next = 11;
|
|
982
818
|
return getRelevantPanes(subject, context);
|
|
983
|
-
|
|
984
819
|
case 11:
|
|
985
820
|
_context12.t0 = _context12.sent;
|
|
986
|
-
|
|
987
821
|
case 12:
|
|
988
822
|
relevantPanes = _context12.t0;
|
|
989
823
|
tr.firstPane = requiredPane || getPane(relevantPanes, subject);
|
|
990
824
|
paneNumber = relevantPanes.indexOf(tr.firstPane);
|
|
991
|
-
|
|
992
825
|
if (relevantPanes.length !== 1) {
|
|
993
826
|
// if only one, simplify interface
|
|
994
827
|
relevantPanes.forEach(function (pane, index) {
|
|
@@ -998,20 +831,17 @@ function _default(context) {
|
|
|
998
831
|
// ico.setAttribute('align','right'); @@ Should be better, but ffox bug pushes them down
|
|
999
832
|
// ico.style.width = iconHeight
|
|
1000
833
|
// ico.style.height = iconHeight
|
|
1001
|
-
|
|
1002
834
|
var listen = function listen(ico, pane) {
|
|
1003
835
|
// Freeze scope for event time
|
|
1004
836
|
ico.addEventListener('click', function (event) {
|
|
1005
|
-
var containingTable;
|
|
1006
|
-
|
|
837
|
+
var containingTable;
|
|
838
|
+
// Find the containing table for this subject
|
|
1007
839
|
for (containingTable = td; containingTable.parentNode; containingTable = containingTable.parentNode) {
|
|
1008
840
|
if (containingTable.nodeName === 'TABLE') break;
|
|
1009
841
|
}
|
|
1010
|
-
|
|
1011
842
|
if (containingTable.nodeName !== 'TABLE') {
|
|
1012
843
|
throw new Error('outline: internal error.');
|
|
1013
844
|
}
|
|
1014
|
-
|
|
1015
845
|
var removePanes = function removePanes(specific) {
|
|
1016
846
|
for (var d = containingTable.firstChild; d; d = d.nextSibling) {
|
|
1017
847
|
if (typeof d.pane !== 'undefined') {
|
|
@@ -1020,24 +850,19 @@ function _default(context) {
|
|
|
1020
850
|
d.paneButton.setAttribute('class', 'paneHidden');
|
|
1021
851
|
d.paneButton.style = paneHiddenStyle;
|
|
1022
852
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
853
|
+
removeAndRefresh(d);
|
|
854
|
+
// If we just delete the node d, ffox doesn't refresh the display properly.
|
|
1025
855
|
// state = 'paneHidden';
|
|
1026
|
-
|
|
1027
|
-
if (d.pane.requireQueryButton && containingTable.parentNode.className
|
|
1028
|
-
/* outer table */
|
|
1029
|
-
&& numberOfPanesRequiringQueryButton === 1 && dom.getElementById('queryButton')) {
|
|
856
|
+
if (d.pane.requireQueryButton && containingTable.parentNode.className /* outer table */ && numberOfPanesRequiringQueryButton === 1 && dom.getElementById('queryButton')) {
|
|
1030
857
|
dom.getElementById('queryButton').setAttribute('style', 'display:none;');
|
|
1031
858
|
}
|
|
1032
859
|
}
|
|
1033
860
|
}
|
|
1034
861
|
}
|
|
1035
862
|
};
|
|
1036
|
-
|
|
1037
863
|
var renderPane = function renderPane(pane) {
|
|
1038
864
|
var paneDiv;
|
|
1039
865
|
UI.log.info('outline: Rendering pane (2): ' + pane.name);
|
|
1040
|
-
|
|
1041
866
|
if (UI.no_catch_pane_errors) {
|
|
1042
867
|
// for debugging
|
|
1043
868
|
paneDiv = pane.render(subject, context, options);
|
|
@@ -1053,11 +878,9 @@ function _default(context) {
|
|
|
1053
878
|
pre.appendChild(dom.createTextNode(UI.utils.stackString(e)));
|
|
1054
879
|
}
|
|
1055
880
|
}
|
|
1056
|
-
|
|
1057
881
|
if (pane.requireQueryButton && dom.getElementById('queryButton')) {
|
|
1058
882
|
dom.getElementById('queryButton').removeAttribute('style');
|
|
1059
883
|
}
|
|
1060
|
-
|
|
1061
884
|
var second = containingTable.firstChild.nextSibling;
|
|
1062
885
|
var row = dom.createElement('tr');
|
|
1063
886
|
var cell = row.appendChild(dom.createElement('td'));
|
|
@@ -1066,15 +889,12 @@ function _default(context) {
|
|
|
1066
889
|
row.pane = pane;
|
|
1067
890
|
row.paneButton = ico;
|
|
1068
891
|
};
|
|
1069
|
-
|
|
1070
892
|
var state = ico.getAttribute('class');
|
|
1071
|
-
|
|
1072
893
|
if (state === 'paneHidden') {
|
|
1073
894
|
if (!event.shiftKey) {
|
|
1074
895
|
// shift means multiple select
|
|
1075
896
|
removePanes();
|
|
1076
897
|
}
|
|
1077
|
-
|
|
1078
898
|
renderPane(pane);
|
|
1079
899
|
ico.setAttribute('class', 'paneShown');
|
|
1080
900
|
ico.style = paneShownStyle;
|
|
@@ -1083,9 +903,7 @@ function _default(context) {
|
|
|
1083
903
|
ico.setAttribute('class', 'paneHidden');
|
|
1084
904
|
ico.style = paneHiddenStyle;
|
|
1085
905
|
}
|
|
1086
|
-
|
|
1087
906
|
var numberOfPanesRequiringQueryButton = 0;
|
|
1088
|
-
|
|
1089
907
|
for (var d = containingTable.firstChild; d; d = d.nextSibling) {
|
|
1090
908
|
if (d.pane && d.pane.requireQueryButton) {
|
|
1091
909
|
numberOfPanesRequiringQueryButton++;
|
|
@@ -1094,16 +912,13 @@ function _default(context) {
|
|
|
1094
912
|
}, false);
|
|
1095
913
|
}; // listen
|
|
1096
914
|
|
|
1097
|
-
|
|
1098
915
|
listen(ico, pane);
|
|
1099
916
|
ico.setAttribute('class', index !== paneNumber ? 'paneHidden' : 'paneShown');
|
|
1100
917
|
if (index === paneNumber) tr.paneButton = ico;
|
|
1101
918
|
paneIconTray.appendChild(ico);
|
|
1102
919
|
});
|
|
1103
920
|
}
|
|
1104
|
-
|
|
1105
921
|
return _context12.abrupt("return", paneIconTray);
|
|
1106
|
-
|
|
1107
922
|
case 17:
|
|
1108
923
|
case "end":
|
|
1109
924
|
return _context12.stop();
|
|
@@ -1113,30 +928,26 @@ function _default(context) {
|
|
|
1113
928
|
}));
|
|
1114
929
|
return _renderPaneIconTray.apply(this, arguments);
|
|
1115
930
|
};
|
|
1116
|
-
|
|
1117
931
|
renderPaneIconTray = function _renderPaneIconTray2(_x10) {
|
|
1118
932
|
return _renderPaneIconTray.apply(this, arguments);
|
|
1119
933
|
};
|
|
1120
|
-
|
|
1121
934
|
// renderPaneIconTray
|
|
1122
935
|
// Body of expandedHeaderTR
|
|
1123
936
|
tr = dom.createElement('tr');
|
|
1124
|
-
|
|
1125
937
|
if (options.hover) {
|
|
1126
938
|
// By default no hide till hover as community deems it confusing
|
|
1127
939
|
tr.setAttribute('class', 'hoverControl');
|
|
1128
940
|
}
|
|
1129
|
-
|
|
1130
941
|
td = tr.appendChild(dom.createElement('td'));
|
|
1131
942
|
td.setAttribute('style', 'margin: 0.2em; border: none; padding: 0; vertical-align: top;' + 'display:flex; justify-content: space-between; flex-direction: row;');
|
|
1132
943
|
td.setAttribute('notSelectable', 'true');
|
|
1133
944
|
td.setAttribute('about', subject.toNT());
|
|
1134
|
-
td.setAttribute('colspan', '2');
|
|
945
|
+
td.setAttribute('colspan', '2');
|
|
1135
946
|
|
|
947
|
+
// Stuff at the right about the subject
|
|
1136
948
|
header = td.appendChild(dom.createElement('div'));
|
|
1137
949
|
header.style = 'display:flex; justify-content: flex-start; align-items: center; flex-wrap: wrap;';
|
|
1138
950
|
showHeader = !!requiredPane;
|
|
1139
|
-
|
|
1140
951
|
if (!options.solo && !showHeader) {
|
|
1141
952
|
icon = header.appendChild(UI.utils.AJARImage(UI.icons.originalIconBase + 'tbl-collapse.png', 'collapse', undefined, dom));
|
|
1142
953
|
icon.addEventListener('click', collapseMouseDownListener);
|
|
@@ -1145,29 +956,22 @@ function _default(context) {
|
|
|
1145
956
|
strong.style = 'font-size: 150%; margin: 0 0.6em 0 0; padding: 0.1em 0.4em;';
|
|
1146
957
|
UI.widgets.makeDraggable(strong, subject);
|
|
1147
958
|
}
|
|
1148
|
-
|
|
1149
959
|
_context13.t0 = header;
|
|
1150
960
|
_context13.next = 16;
|
|
1151
961
|
return renderPaneIconTray(td, {
|
|
1152
962
|
hideList: showHeader
|
|
1153
963
|
});
|
|
1154
|
-
|
|
1155
964
|
case 16:
|
|
1156
965
|
_context13.t1 = _context13.sent;
|
|
1157
|
-
|
|
1158
966
|
_context13.t0.appendChild.call(_context13.t0, _context13.t1);
|
|
1159
|
-
|
|
1160
967
|
// set DOM methods
|
|
1161
968
|
tr.firstChild.tabulatorSelect = function () {
|
|
1162
969
|
setSelected(this, true);
|
|
1163
970
|
};
|
|
1164
|
-
|
|
1165
971
|
tr.firstChild.tabulatorDeselect = function () {
|
|
1166
972
|
setSelected(this, false);
|
|
1167
973
|
};
|
|
1168
|
-
|
|
1169
974
|
return _context13.abrupt("return", tr);
|
|
1170
|
-
|
|
1171
975
|
case 21:
|
|
1172
976
|
case "end":
|
|
1173
977
|
return _context13.stop();
|
|
@@ -1177,7 +981,6 @@ function _default(context) {
|
|
|
1177
981
|
}));
|
|
1178
982
|
return _expandedHeaderTR.apply(this, arguments);
|
|
1179
983
|
}
|
|
1180
|
-
|
|
1181
984
|
function removeAndRefresh(d) {
|
|
1182
985
|
var table = d.parentNode;
|
|
1183
986
|
var par = table.parentNode;
|
|
@@ -1190,7 +993,8 @@ function _default(context) {
|
|
|
1190
993
|
|
|
1191
994
|
var propertyTable = this.propertyTable = function propertyTable(subject, table, pane, options) {
|
|
1192
995
|
UI.log.debug('Property table for: ' + subject);
|
|
1193
|
-
subject = kb.canon(subject);
|
|
996
|
+
subject = kb.canon(subject);
|
|
997
|
+
// if (!pane) pane = panes.defaultPane;
|
|
1194
998
|
|
|
1195
999
|
if (!table) {
|
|
1196
1000
|
// Create a new property table
|
|
@@ -1198,10 +1002,8 @@ function _default(context) {
|
|
|
1198
1002
|
table.setAttribute('style', 'width: 100%;');
|
|
1199
1003
|
expandedHeaderTR(subject, pane, options).then(function (tr1) {
|
|
1200
1004
|
table.appendChild(tr1);
|
|
1201
|
-
|
|
1202
1005
|
if (tr1.firstPane) {
|
|
1203
1006
|
var paneDiv;
|
|
1204
|
-
|
|
1205
1007
|
try {
|
|
1206
1008
|
UI.log.info('outline: Rendering pane (1): ' + tr1.firstPane.name);
|
|
1207
1009
|
paneDiv = tr1.firstPane.render(subject, context, options);
|
|
@@ -1213,15 +1015,12 @@ function _default(context) {
|
|
|
1213
1015
|
paneDiv.appendChild(pre);
|
|
1214
1016
|
pre.appendChild(dom.createTextNode(UI.utils.stackString(e)));
|
|
1215
1017
|
}
|
|
1216
|
-
|
|
1217
1018
|
var row = dom.createElement('tr');
|
|
1218
1019
|
var cell = row.appendChild(dom.createElement('td'));
|
|
1219
1020
|
cell.appendChild(paneDiv);
|
|
1220
|
-
|
|
1221
1021
|
if (tr1.firstPane.requireQueryButton && dom.getElementById('queryButton')) {
|
|
1222
1022
|
dom.getElementById('queryButton').removeAttribute('style');
|
|
1223
1023
|
}
|
|
1224
|
-
|
|
1225
1024
|
table.appendChild(row);
|
|
1226
1025
|
row.pane = tr1.firstPane;
|
|
1227
1026
|
row.paneButton = tr1.paneButton;
|
|
@@ -1230,28 +1029,25 @@ function _default(context) {
|
|
|
1230
1029
|
return table;
|
|
1231
1030
|
} else {
|
|
1232
1031
|
// New display of existing table, keeping expanded bits
|
|
1233
|
-
UI.log.info('Re-expand: ' + table);
|
|
1234
|
-
|
|
1032
|
+
UI.log.info('Re-expand: ' + table);
|
|
1033
|
+
// do some other stuff here
|
|
1235
1034
|
return table;
|
|
1236
1035
|
}
|
|
1237
|
-
};
|
|
1238
|
-
/* propertyTable */
|
|
1239
|
-
|
|
1036
|
+
}; /* propertyTable */
|
|
1240
1037
|
|
|
1241
1038
|
function propertyTR(doc, st, inverse) {
|
|
1242
1039
|
var tr = doc.createElement('TR');
|
|
1243
1040
|
tr.AJAR_statement = st;
|
|
1244
|
-
tr.AJAR_inverse = inverse;
|
|
1245
|
-
|
|
1041
|
+
tr.AJAR_inverse = inverse;
|
|
1042
|
+
// tr.AJAR_variable = null; // @@ ?? was just 'tr.AJAR_variable'
|
|
1246
1043
|
tr.setAttribute('predTR', 'true');
|
|
1247
1044
|
var predicateTD = thisOutline.outlinePredicateTD(st.predicate, tr, inverse);
|
|
1248
1045
|
tr.appendChild(predicateTD); // @@ add 'internal' to predicateTD's class for style? mno
|
|
1249
|
-
|
|
1250
1046
|
return tr;
|
|
1251
1047
|
}
|
|
1048
|
+
this.propertyTR = propertyTR;
|
|
1252
1049
|
|
|
1253
|
-
|
|
1254
|
-
|
|
1050
|
+
// / ////////// Property list
|
|
1255
1051
|
function appendPropertyTRs(parent, plist, inverse, predicateFilter) {
|
|
1256
1052
|
// UI.log.info('@appendPropertyTRs, 'this' is %s, dom is %s, '+ // Gives 'can't access dead object'
|
|
1257
1053
|
// 'thisOutline.document is %s', this, dom.location, thisOutline.document.location);
|
|
@@ -1260,57 +1056,51 @@ function _default(context) {
|
|
|
1260
1056
|
UI.log.debug('Property list length = ' + plist.length);
|
|
1261
1057
|
if (plist.length === 0) return '';
|
|
1262
1058
|
var sel, j, k;
|
|
1263
|
-
|
|
1264
1059
|
if (inverse) {
|
|
1265
1060
|
sel = function sel(x) {
|
|
1266
1061
|
return x.subject;
|
|
1267
1062
|
};
|
|
1268
|
-
|
|
1269
1063
|
plist = plist.sort(UI.utils.RDFComparePredicateSubject);
|
|
1270
1064
|
} else {
|
|
1271
1065
|
sel = function sel(x) {
|
|
1272
1066
|
return x.object;
|
|
1273
1067
|
};
|
|
1274
|
-
|
|
1275
1068
|
plist = plist.sort(UI.utils.RDFComparePredicateObject);
|
|
1276
1069
|
}
|
|
1277
|
-
|
|
1278
1070
|
var max = plist.length;
|
|
1279
|
-
|
|
1280
1071
|
var _loop = function _loop() {
|
|
1281
1072
|
// squishing together equivalent properties I think
|
|
1282
|
-
var s = plist[j];
|
|
1283
|
-
//
|
|
1073
|
+
var s = plist[j];
|
|
1074
|
+
// if (s.object == parentSubject) continue; // that we knew
|
|
1284
1075
|
|
|
1076
|
+
// Avoid predicates from other panes
|
|
1285
1077
|
if (predicateFilter && !predicateFilter(s.predicate, inverse)) return "continue";
|
|
1286
1078
|
var tr = propertyTR(dom, s, inverse);
|
|
1287
1079
|
parent.appendChild(tr);
|
|
1288
1080
|
var predicateTD = tr.firstChild; // we need to kludge the rowspan later
|
|
1289
1081
|
|
|
1290
|
-
var defaultpropview = views.defaults[s.predicate.uri];
|
|
1082
|
+
var defaultpropview = views.defaults[s.predicate.uri];
|
|
1291
1083
|
|
|
1292
|
-
|
|
1084
|
+
// LANGUAGE PREFERENCES WAS AVAILABLE WITH FF EXTENSION - get from elsewhere?
|
|
1293
1085
|
|
|
1086
|
+
var dups = 0; // How many rows have the same predicate, -1?
|
|
1294
1087
|
var langTagged = 0; // how many objects have language tags?
|
|
1295
|
-
|
|
1296
1088
|
var myLang = 0; // Is there one I like?
|
|
1297
1089
|
|
|
1298
1090
|
for (k = 0; k + j < max && plist[j + k].predicate.sameTerm(s.predicate); k++) {
|
|
1299
1091
|
if (k > 0 && sel(plist[j + k]).sameTerm(sel(plist[j + k - 1]))) dups++;
|
|
1300
|
-
|
|
1301
1092
|
if (sel(plist[j + k]).lang && outline.labeller.LanguagePreference) {
|
|
1302
1093
|
langTagged += 1;
|
|
1303
|
-
|
|
1304
1094
|
if (sel(plist[j + k]).lang.indexOf(outline.labeller.LanguagePreference) >= 0) {
|
|
1305
1095
|
myLang++;
|
|
1306
1096
|
}
|
|
1307
1097
|
}
|
|
1308
1098
|
}
|
|
1099
|
+
|
|
1309
1100
|
/* Display only the one in the preferred language
|
|
1310
1101
|
ONLY in the case (currently) when all the values are tagged.
|
|
1311
1102
|
Then we treat them as alternatives. */
|
|
1312
1103
|
|
|
1313
|
-
|
|
1314
1104
|
if (myLang > 0 && langTagged === dups + 1) {
|
|
1315
1105
|
for (var _k = j; _k <= j + dups; _k++) {
|
|
1316
1106
|
if (outline.labeller.LanguagePreference && sel(plist[_k]).lang.indexOf(outline.labeller.LanguagePreference) >= 0) {
|
|
@@ -1318,13 +1108,11 @@ function _default(context) {
|
|
|
1318
1108
|
break;
|
|
1319
1109
|
}
|
|
1320
1110
|
}
|
|
1321
|
-
|
|
1322
1111
|
j += dups; // extra push
|
|
1323
|
-
|
|
1324
1112
|
return "continue";
|
|
1325
1113
|
}
|
|
1326
|
-
|
|
1327
1114
|
tr.appendChild(thisOutline.outlineObjectTD(sel(s), defaultpropview, undefined, s));
|
|
1115
|
+
|
|
1328
1116
|
/* Note: showNobj shows between n to 2n objects.
|
|
1329
1117
|
* This is to prevent the case where you have a long list of objects
|
|
1330
1118
|
* shown, and dangling at the end is '1 more' (which is easily ignored)
|
|
@@ -1335,19 +1123,15 @@ function _default(context) {
|
|
|
1335
1123
|
var predDups = k - dups;
|
|
1336
1124
|
var show = 2 * n < predDups ? n : predDups;
|
|
1337
1125
|
var showLaterArray = [];
|
|
1338
|
-
|
|
1339
1126
|
if (predDups !== 1) {
|
|
1340
1127
|
predicateTD.setAttribute('rowspan', show === predDups ? predDups : n + 1);
|
|
1341
1128
|
var l;
|
|
1342
|
-
|
|
1343
1129
|
if (show < predDups && show === 1) {
|
|
1344
1130
|
// what case is this...
|
|
1345
1131
|
predicateTD.setAttribute('rowspan', 2);
|
|
1346
1132
|
}
|
|
1347
|
-
|
|
1348
1133
|
var displayed = 0; // The number of cells generated-1,
|
|
1349
1134
|
// all duplicate thing removed
|
|
1350
|
-
|
|
1351
1135
|
for (l = 1; l < k; l++) {
|
|
1352
1136
|
// This detects the same things
|
|
1353
1137
|
if (!kb.canon(sel(plist[j + l])).sameTerm(kb.canon(sel(plist[j + l - 1])))) {
|
|
@@ -1360,7 +1144,6 @@ function _default(context) {
|
|
|
1360
1144
|
trObj.AJAR_statement = s;
|
|
1361
1145
|
trObj.AJAR_inverse = inverse;
|
|
1362
1146
|
parent.appendChild(trObj);
|
|
1363
|
-
|
|
1364
1147
|
if (displayed >= show) {
|
|
1365
1148
|
trObj.style.display = 'none';
|
|
1366
1149
|
showLaterArray.push(trObj);
|
|
@@ -1369,33 +1152,28 @@ function _default(context) {
|
|
|
1369
1152
|
// ToDo: show all the data sources of this statement
|
|
1370
1153
|
UI.log.info('there are duplicates here: %s', plist[j + l - 1]);
|
|
1371
1154
|
}
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1155
|
+
}
|
|
1156
|
+
// @@a quick fix on the messing problem.
|
|
1375
1157
|
if (show === predDups) {
|
|
1376
1158
|
predicateTD.setAttribute('rowspan', displayed + 1);
|
|
1377
1159
|
}
|
|
1378
1160
|
} // end of if (predDups!==1)
|
|
1379
1161
|
|
|
1380
|
-
|
|
1381
1162
|
if (show < predDups) {
|
|
1382
1163
|
// Add the x more <TR> here
|
|
1383
1164
|
var moreTR = dom.createElement('tr');
|
|
1384
1165
|
var moreTD = moreTR.appendChild(dom.createElement('td'));
|
|
1385
1166
|
moreTD.setAttribute('style', 'margin: 0.2em; border: none; padding: 0; vertical-align: top;');
|
|
1386
1167
|
moreTD.setAttribute('notSelectable', 'false');
|
|
1387
|
-
|
|
1388
1168
|
if (predDups > n) {
|
|
1389
1169
|
// what is this for??
|
|
1390
1170
|
var small = dom.createElement('a');
|
|
1391
1171
|
moreTD.appendChild(small);
|
|
1392
|
-
|
|
1393
1172
|
var predToggle = function (f) {
|
|
1394
1173
|
return f(predicateTD, k, dups, n);
|
|
1395
1174
|
}(function (predicateTD, k, dups, n) {
|
|
1396
1175
|
return function (display) {
|
|
1397
1176
|
small.innerHTML = '';
|
|
1398
|
-
|
|
1399
1177
|
if (display === 'none') {
|
|
1400
1178
|
small.appendChild(UI.utils.AJARImage(UI.icons.originalIconBase + 'tbl-more-trans.png', 'more', 'See all', dom));
|
|
1401
1179
|
small.appendChild(dom.createTextNode(predDups - n + ' more...'));
|
|
@@ -1404,17 +1182,13 @@ function _default(context) {
|
|
|
1404
1182
|
small.appendChild(UI.utils.AJARImage(UI.icons.originalIconBase + 'tbl-shrink.png', '(less)', undefined, dom));
|
|
1405
1183
|
predicateTD.setAttribute('rowspan', predDups + 1);
|
|
1406
1184
|
}
|
|
1407
|
-
|
|
1408
1185
|
for (var i = 0; i < showLaterArray.length; i++) {
|
|
1409
1186
|
var _trObj = showLaterArray[i];
|
|
1410
1187
|
_trObj.style.display = display;
|
|
1411
1188
|
}
|
|
1412
1189
|
};
|
|
1413
1190
|
}); // ???
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
1191
|
var current = 'none';
|
|
1417
|
-
|
|
1418
1192
|
var toggleObj = function toggleObj(event) {
|
|
1419
1193
|
predToggle(current);
|
|
1420
1194
|
current = current === 'none' ? '' : 'none';
|
|
@@ -1425,39 +1199,29 @@ function _default(context) {
|
|
|
1425
1199
|
toggleObj();
|
|
1426
1200
|
small.addEventListener('click', toggleObj, false);
|
|
1427
1201
|
} // if(predDups>n)
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
1202
|
parent.appendChild(moreTR);
|
|
1431
1203
|
} // if
|
|
1432
|
-
|
|
1433
1204
|
}; // tr.showNobj
|
|
1434
1205
|
|
|
1435
|
-
|
|
1436
1206
|
tr.showAllobj = function () {
|
|
1437
1207
|
tr.showNobj(k - dups);
|
|
1438
1208
|
};
|
|
1439
|
-
|
|
1440
1209
|
tr.showNobj(10);
|
|
1441
1210
|
j += k - 1; // extra push
|
|
1442
1211
|
};
|
|
1443
|
-
|
|
1444
1212
|
for (j = 0; j < max; j++) {
|
|
1445
1213
|
var _ret = _loop();
|
|
1446
|
-
|
|
1447
1214
|
if (_ret === "continue") continue;
|
|
1448
1215
|
}
|
|
1449
1216
|
} // appendPropertyTRs
|
|
1450
1217
|
|
|
1451
|
-
|
|
1452
1218
|
this.appendPropertyTRs = appendPropertyTRs;
|
|
1219
|
+
|
|
1453
1220
|
/* termWidget
|
|
1454
1221
|
**
|
|
1455
1222
|
*/
|
|
1456
|
-
|
|
1457
1223
|
var termWidget = {}; // @@@@@@ global
|
|
1458
|
-
|
|
1459
1224
|
global.termWidget = termWidget;
|
|
1460
|
-
|
|
1461
1225
|
termWidget.construct = function (dom) {
|
|
1462
1226
|
dom = dom || document;
|
|
1463
1227
|
var td = dom.createElement('TD');
|
|
@@ -1467,7 +1231,6 @@ function _default(context) {
|
|
|
1467
1231
|
td.style.width = '0px';
|
|
1468
1232
|
return td;
|
|
1469
1233
|
};
|
|
1470
|
-
|
|
1471
1234
|
termWidget.addIcon = function (td, icon, listener) {
|
|
1472
1235
|
var iconTD = td.childNodes[1];
|
|
1473
1236
|
if (!iconTD) return;
|
|
@@ -1477,12 +1240,10 @@ function _default(context) {
|
|
|
1477
1240
|
width = width + icon.width;
|
|
1478
1241
|
iconTD.style.width = width + 'px';
|
|
1479
1242
|
iconTD.appendChild(img);
|
|
1480
|
-
|
|
1481
1243
|
if (listener) {
|
|
1482
1244
|
img.addEventListener('click', listener);
|
|
1483
1245
|
}
|
|
1484
1246
|
};
|
|
1485
|
-
|
|
1486
1247
|
termWidget.removeIcon = function (td, icon) {
|
|
1487
1248
|
var iconTD = td.childNodes[1];
|
|
1488
1249
|
var baseURI;
|
|
@@ -1491,46 +1252,48 @@ function _default(context) {
|
|
|
1491
1252
|
width = parseInt(width);
|
|
1492
1253
|
width = width - icon.width;
|
|
1493
1254
|
iconTD.style.width = width + 'px';
|
|
1494
|
-
|
|
1495
1255
|
for (var x = 0; x < iconTD.childNodes.length; x++) {
|
|
1496
1256
|
var elt = iconTD.childNodes[x];
|
|
1497
|
-
var eltSrc = elt.src;
|
|
1257
|
+
var eltSrc = elt.src;
|
|
1498
1258
|
|
|
1259
|
+
// ignore first '?' and everything after it //Kenny doesn't know what this is for
|
|
1499
1260
|
try {
|
|
1500
1261
|
baseURI = dom.location.href.split('?')[0];
|
|
1501
1262
|
} catch (e) {
|
|
1502
1263
|
console.log(e);
|
|
1503
1264
|
baseURI = '';
|
|
1504
1265
|
}
|
|
1505
|
-
|
|
1506
1266
|
var relativeIconSrc = UI.rdf.uri.join(icon.src, baseURI);
|
|
1507
|
-
|
|
1508
1267
|
if (eltSrc === relativeIconSrc) {
|
|
1509
1268
|
iconTD.removeChild(elt);
|
|
1510
1269
|
}
|
|
1511
1270
|
}
|
|
1512
1271
|
};
|
|
1513
|
-
|
|
1514
1272
|
termWidget.replaceIcon = function (td, oldIcon, newIcon, listener) {
|
|
1515
1273
|
termWidget.removeIcon(td, oldIcon);
|
|
1516
1274
|
termWidget.addIcon(td, newIcon, listener);
|
|
1517
|
-
};
|
|
1275
|
+
};
|
|
1276
|
+
|
|
1277
|
+
// / /////////////////////////////////////////////////// VALUE BROWSER VIEW
|
|
1278
|
+
|
|
1518
1279
|
// / /////////////////////////////////////////////////////// TABLE VIEW
|
|
1280
|
+
|
|
1519
1281
|
// Summarize a thing as a table cell
|
|
1520
1282
|
|
|
1521
1283
|
/**********************
|
|
1522
1284
|
query global vars
|
|
1523
1285
|
***********************/
|
|
1286
|
+
|
|
1524
1287
|
// const doesn't work in Opera
|
|
1525
1288
|
// const BLANK_QUERY = { pat: kb.formula(), vars: [], orderBy: [] };
|
|
1526
1289
|
// @ pat: the query pattern in an RDFIndexedFormula. Statements are in pat.statements
|
|
1527
1290
|
// @ vars: the free variables in the query
|
|
1528
1291
|
// @ orderBy: the variables to order the table
|
|
1529
1292
|
|
|
1530
|
-
|
|
1531
1293
|
function QueryObj() {
|
|
1532
1294
|
this.pat = kb.formula();
|
|
1533
|
-
this.vars = [];
|
|
1295
|
+
this.vars = [];
|
|
1296
|
+
// this.orderBy = []
|
|
1534
1297
|
}
|
|
1535
1298
|
|
|
1536
1299
|
var queries = [];
|
|
@@ -1552,7 +1315,6 @@ function _default(context) {
|
|
|
1552
1315
|
dom.getElementById('queryJump').appendChild(next)
|
|
1553
1316
|
}
|
|
1554
1317
|
*/
|
|
1555
|
-
|
|
1556
1318
|
/*
|
|
1557
1319
|
function resetQuery () {
|
|
1558
1320
|
function resetOutliner (pat) {
|
|
@@ -1574,44 +1336,41 @@ function _default(context) {
|
|
|
1574
1336
|
queries[0] = myQuery = new QueryObj()
|
|
1575
1337
|
}
|
|
1576
1338
|
*/
|
|
1577
|
-
|
|
1578
1339
|
function addButtonCallbacks(target, fireOn) {
|
|
1579
1340
|
UI.log.debug('Button callbacks for ' + fireOn + ' added');
|
|
1580
|
-
|
|
1581
1341
|
var makeIconCallback = function makeIconCallback(icon) {
|
|
1582
1342
|
return function IconCallback(req) {
|
|
1583
1343
|
if (req.indexOf('#') >= 0) {
|
|
1584
|
-
console.log('@@ makeIconCallback: Not expecting # in URI whose state changed: ' + req);
|
|
1344
|
+
console.log('@@ makeIconCallback: Not expecting # in URI whose state changed: ' + req);
|
|
1345
|
+
// alert('Should have no hash in '+req)
|
|
1585
1346
|
}
|
|
1586
1347
|
|
|
1587
1348
|
if (!target) {
|
|
1588
1349
|
return false;
|
|
1589
1350
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1351
|
+
if (!outline.ancestor(target, 'DIV')) return false;
|
|
1352
|
+
// if (term.termType != 'symbol') { return true } // should always ve
|
|
1593
1353
|
if (req === fireOn) {
|
|
1594
1354
|
target.src = icon;
|
|
1595
1355
|
target.title = outlineIcons.tooltips[icon];
|
|
1596
1356
|
}
|
|
1597
|
-
|
|
1598
1357
|
return true;
|
|
1599
1358
|
};
|
|
1600
1359
|
};
|
|
1601
|
-
|
|
1602
1360
|
sf.addCallback('request', makeIconCallback(outlineIcons.src.icon_requested));
|
|
1603
1361
|
sf.addCallback('done', makeIconCallback(outlineIcons.src.icon_fetched));
|
|
1604
1362
|
sf.addCallback('fail', makeIconCallback(outlineIcons.src.icon_failed));
|
|
1605
|
-
}
|
|
1363
|
+
}
|
|
1606
1364
|
|
|
1365
|
+
// Selection support
|
|
1607
1366
|
|
|
1608
1367
|
function selected(node) {
|
|
1609
1368
|
var a = node.getAttribute('class');
|
|
1610
1369
|
if (a && a.indexOf('selected') >= 0) return true;
|
|
1611
1370
|
return false;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1371
|
+
}
|
|
1614
1372
|
|
|
1373
|
+
// These woulkd be simpler using closer variables below
|
|
1615
1374
|
function optOnIconMouseDownListener(e) {
|
|
1616
1375
|
// outlineIcons.src.icon_opton needed?
|
|
1617
1376
|
var target = thisOutline.targetOf(e);
|
|
@@ -1619,7 +1378,6 @@ function _default(context) {
|
|
|
1619
1378
|
termWidget.replaceIcon(p.parentNode, outlineIcons.termWidgets.optOn, outlineIcons.termWidgets.optOff, optOffIconMouseDownListener);
|
|
1620
1379
|
p.parentNode.parentNode.removeAttribute('optional');
|
|
1621
1380
|
}
|
|
1622
|
-
|
|
1623
1381
|
function optOffIconMouseDownListener(e) {
|
|
1624
1382
|
// outlineIcons.src.icon_optoff needed?
|
|
1625
1383
|
var target = thisOutline.targetOf(e);
|
|
@@ -1627,29 +1385,23 @@ function _default(context) {
|
|
|
1627
1385
|
termWidget.replaceIcon(p.parentNode, outlineIcons.termWidgets.optOff, outlineIcons.termWidgets.optOn, optOnIconMouseDownListener);
|
|
1628
1386
|
p.parentNode.parentNode.setAttribute('optional', 'true');
|
|
1629
1387
|
}
|
|
1630
|
-
|
|
1631
1388
|
function setSelectedParent(node, inc) {
|
|
1632
1389
|
var onIcon = outlineIcons.termWidgets.optOn;
|
|
1633
1390
|
var offIcon = outlineIcons.termWidgets.optOff;
|
|
1634
|
-
|
|
1635
1391
|
for (var n = node; n.parentNode; n = n.parentNode) {
|
|
1636
1392
|
while (true) {
|
|
1637
1393
|
if (n.getAttribute('predTR')) {
|
|
1638
1394
|
var num = n.getAttribute('parentOfSelected');
|
|
1639
1395
|
if (!num) num = 0;else num = parseInt(num);
|
|
1640
|
-
|
|
1641
1396
|
if (num === 0 && inc > 0) {
|
|
1642
1397
|
termWidget.addIcon(n.childNodes[0], n.getAttribute('optional') ? onIcon : offIcon, n.getAttribute('optional') ? optOnIconMouseDownListener : optOffIconMouseDownListener);
|
|
1643
1398
|
}
|
|
1644
|
-
|
|
1645
1399
|
num = num + inc;
|
|
1646
1400
|
n.setAttribute('parentOfSelected', num);
|
|
1647
|
-
|
|
1648
1401
|
if (num === 0) {
|
|
1649
1402
|
n.removeAttribute('parentOfSelected');
|
|
1650
1403
|
termWidget.removeIcon(n.childNodes[0], n.getAttribute('optional') ? onIcon : offIcon);
|
|
1651
1404
|
}
|
|
1652
|
-
|
|
1653
1405
|
break;
|
|
1654
1406
|
} else if (n.previousSibling && n.previousSibling.nodeName === 'TR') {
|
|
1655
1407
|
n = n.previousSibling;
|
|
@@ -1657,12 +1409,11 @@ function _default(context) {
|
|
|
1657
1409
|
}
|
|
1658
1410
|
}
|
|
1659
1411
|
}
|
|
1660
|
-
|
|
1661
1412
|
this.statusBarClick = function (event) {
|
|
1662
1413
|
var target = UI.utils.getTarget(event);
|
|
1663
|
-
|
|
1664
1414
|
if (target.label) {
|
|
1665
|
-
window.content.location = target.label;
|
|
1415
|
+
window.content.location = target.label;
|
|
1416
|
+
// The following alternative does not work in the extension.
|
|
1666
1417
|
// var s = store.sym(target.label);
|
|
1667
1418
|
// outline.GotoSubject(s, true);
|
|
1668
1419
|
}
|
|
@@ -1675,35 +1426,28 @@ function _default(context) {
|
|
|
1675
1426
|
};
|
|
1676
1427
|
|
|
1677
1428
|
this.showSource = function showSource() {
|
|
1678
|
-
if (typeof sourceWidget === 'undefined') return;
|
|
1429
|
+
if (typeof sourceWidget === 'undefined') return;
|
|
1430
|
+
// deselect all before going on, this is necessary because you would switch tab,
|
|
1679
1431
|
// close tab or so on...
|
|
1680
|
-
|
|
1681
1432
|
for (var uri in sourceWidget.sources) {
|
|
1682
1433
|
sourceWidget.sources[uri].setAttribute('class', '');
|
|
1683
1434
|
} // .class doesn't work. Be careful!
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
1435
|
for (var i = 0; i < selection.length; i++) {
|
|
1687
1436
|
if (!selection[i].parentNode) {
|
|
1688
1437
|
console.log('showSource: EH? no parentNode? ' + selection[i] + '\n');
|
|
1689
1438
|
continue;
|
|
1690
1439
|
}
|
|
1691
|
-
|
|
1692
1440
|
var st = selection[i].parentNode.AJAR_statement;
|
|
1693
1441
|
if (!st) continue; // for root TD
|
|
1694
|
-
|
|
1695
1442
|
var source = st.why;
|
|
1696
|
-
|
|
1697
1443
|
if (source && source.uri) {
|
|
1698
1444
|
sourceWidget.highlight(source, true);
|
|
1699
1445
|
}
|
|
1700
1446
|
}
|
|
1701
1447
|
};
|
|
1702
|
-
|
|
1703
1448
|
this.getSelection = function getSelection() {
|
|
1704
1449
|
return selection;
|
|
1705
1450
|
};
|
|
1706
|
-
|
|
1707
1451
|
function setSelected(node, newValue) {
|
|
1708
1452
|
// UI.log.info('selection has ' +selection.map(function(item){return item.textContent;}).join(', '));
|
|
1709
1453
|
// UI.log.debug('@outline setSelected, intended to '+(newValue?'select ':'deselect ')+node+node.textContent);
|
|
@@ -1712,87 +1456,68 @@ function _default(context) {
|
|
|
1712
1456
|
UI.log.debug('down' + node.nodeName);
|
|
1713
1457
|
throw new Error('Expected TD in setSelected: ' + node.nodeName + ' : ' + node.textContent);
|
|
1714
1458
|
}
|
|
1715
|
-
|
|
1716
1459
|
UI.log.debug('pass');
|
|
1717
1460
|
var cla = node.getAttribute('class');
|
|
1718
1461
|
if (!cla) cla = '';
|
|
1719
|
-
|
|
1720
1462
|
if (newValue) {
|
|
1721
1463
|
cla += ' selected';
|
|
1722
|
-
|
|
1723
1464
|
if (cla.indexOf('pred') >= 0 || cla.indexOf('obj') >= 0) {
|
|
1724
1465
|
setSelectedParent(node, 1);
|
|
1725
1466
|
}
|
|
1726
|
-
|
|
1727
|
-
|
|
1467
|
+
selection.push(node);
|
|
1468
|
+
// UI.log.info('Selecting '+node.textContent)
|
|
1728
1469
|
|
|
1729
1470
|
var about = UI.utils.getTerm(node); // show uri for a newly selectedTd
|
|
1730
|
-
|
|
1731
1471
|
thisOutline.showURI(about);
|
|
1732
1472
|
var st = node.AJAR_statement; // show blue cross when the why of that triple is editable
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1473
|
+
if (typeof st === 'undefined' && node.parentNode) st = node.parentNode.AJAR_statement;
|
|
1474
|
+
// if (typeof st === 'undefined') return; // @@ Kludge? Click in the middle of nowhere
|
|
1736
1475
|
if (st) {
|
|
1737
1476
|
// don't do these for headers or base nodes
|
|
1738
|
-
var source = st.why;
|
|
1739
|
-
|
|
1477
|
+
var source = st.why;
|
|
1478
|
+
// var target = st.why
|
|
1740
1479
|
var editable = _solidLogic.store.updater.editable(source.uri, kb);
|
|
1741
|
-
|
|
1742
|
-
|
|
1480
|
+
if (!editable) {
|
|
1481
|
+
// let target = node.parentNode.AJAR_inverse ? st.object : st.subject
|
|
1743
1482
|
} // left hand side
|
|
1744
1483
|
// think about this later. Because we update to the why for now.
|
|
1745
1484
|
// alert('Target='+target+', editable='+editable+'\nselected statement:' + st)
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
1485
|
if (editable && cla.indexOf('pred') >= 0) {
|
|
1749
1486
|
termWidget.addIcon(node, outlineIcons.termWidgets.addTri);
|
|
1750
1487
|
} // Add blue plus
|
|
1751
|
-
|
|
1752
1488
|
}
|
|
1753
1489
|
} else {
|
|
1754
1490
|
UI.log.debug('cla=$' + cla + '$');
|
|
1755
1491
|
if (cla === 'selected') cla = ''; // for header <TD>
|
|
1756
|
-
|
|
1757
1492
|
cla = cla.replace(' selected', '');
|
|
1758
|
-
|
|
1759
1493
|
if (cla.indexOf('pred') >= 0 || cla.indexOf('obj') >= 0) {
|
|
1760
1494
|
setSelectedParent(node, -1);
|
|
1761
1495
|
}
|
|
1762
|
-
|
|
1763
1496
|
if (cla.indexOf('pred') >= 0) {
|
|
1764
1497
|
termWidget.removeIcon(node, outlineIcons.termWidgets.addTri);
|
|
1765
1498
|
}
|
|
1766
|
-
|
|
1767
1499
|
selection = selection.filter(function (x) {
|
|
1768
1500
|
return x === node;
|
|
1769
1501
|
});
|
|
1770
1502
|
UI.log.info('Deselecting ' + node.textContent);
|
|
1771
1503
|
}
|
|
1772
|
-
|
|
1773
1504
|
if (typeof sourceWidget !== 'undefined') thisOutline.showSource(); // Update the data sources display
|
|
1774
1505
|
// UI.log.info('selection becomes [' +selection.map(function(item){return item.textContent;}).join(', ')+']');
|
|
1775
1506
|
// UI.log.info('Setting className ' + cla);
|
|
1776
|
-
|
|
1777
1507
|
node.setAttribute('class', cla);
|
|
1778
1508
|
}
|
|
1779
|
-
|
|
1780
1509
|
function deselectAll() {
|
|
1781
1510
|
var n = selection.length;
|
|
1782
|
-
|
|
1783
1511
|
for (var i = n - 1; i >= 0; i--) {
|
|
1784
1512
|
setSelected(selection[i], false);
|
|
1785
1513
|
}
|
|
1786
|
-
|
|
1787
1514
|
selection = [];
|
|
1788
1515
|
}
|
|
1789
|
-
/** Get the target of an event **/
|
|
1790
|
-
|
|
1791
1516
|
|
|
1517
|
+
/** Get the target of an event **/
|
|
1792
1518
|
this.targetOf = function (e) {
|
|
1793
1519
|
var target;
|
|
1794
1520
|
if (!e) e = window.event;
|
|
1795
|
-
|
|
1796
1521
|
if (e.target) {
|
|
1797
1522
|
target = e.target;
|
|
1798
1523
|
} else if (e.srcElement) {
|
|
@@ -1801,21 +1526,16 @@ function _default(context) {
|
|
|
1801
1526
|
UI.log.error("can't get target for event " + e);
|
|
1802
1527
|
return false;
|
|
1803
1528
|
} // fail
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
1529
|
if (target.nodeType === 3) {
|
|
1807
1530
|
// defeat Safari bug [sic]
|
|
1808
1531
|
target = target.parentNode;
|
|
1809
1532
|
}
|
|
1810
|
-
|
|
1811
1533
|
return target;
|
|
1812
1534
|
}; // targetOf
|
|
1813
1535
|
|
|
1814
|
-
|
|
1815
1536
|
this.walk = function walk(directionCode, inputTd) {
|
|
1816
1537
|
var selectedTd = inputTd || selection[0];
|
|
1817
1538
|
var newSelTd;
|
|
1818
|
-
|
|
1819
1539
|
switch (directionCode) {
|
|
1820
1540
|
case 'down':
|
|
1821
1541
|
try {
|
|
@@ -1824,68 +1544,53 @@ function _default(context) {
|
|
|
1824
1544
|
this.walk('up');
|
|
1825
1545
|
return;
|
|
1826
1546
|
} // end
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
1547
|
deselectAll();
|
|
1830
1548
|
setSelected(newSelTd, true);
|
|
1831
1549
|
break;
|
|
1832
|
-
|
|
1833
1550
|
case 'up':
|
|
1834
1551
|
try {
|
|
1835
1552
|
newSelTd = selectedTd.parentNode.previousSibling.lastChild;
|
|
1836
1553
|
} catch (e) {
|
|
1837
1554
|
return;
|
|
1838
1555
|
} // top
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
1556
|
deselectAll();
|
|
1842
1557
|
setSelected(newSelTd, true);
|
|
1843
1558
|
break;
|
|
1844
|
-
|
|
1845
1559
|
case 'right':
|
|
1846
1560
|
deselectAll();
|
|
1847
|
-
|
|
1848
1561
|
if (selectedTd.nextSibling || selectedTd.lastChild.tagName === 'strong') {
|
|
1849
1562
|
setSelected(selectedTd.nextSibling, true);
|
|
1850
1563
|
} else {
|
|
1851
1564
|
var newSelected = dom.evaluate('table/div/tr/td[2]', selectedTd, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
|
|
1852
1565
|
setSelected(newSelected, true);
|
|
1853
1566
|
}
|
|
1854
|
-
|
|
1855
1567
|
break;
|
|
1856
|
-
|
|
1857
1568
|
case 'left':
|
|
1858
1569
|
deselectAll();
|
|
1859
|
-
|
|
1860
1570
|
if (selectedTd.previousSibling && selectedTd.previousSibling.className === 'undetermined') {
|
|
1861
1571
|
setSelected(selectedTd.previousSibling, true);
|
|
1862
1572
|
return true; // do not shrink signal
|
|
1863
1573
|
} else {
|
|
1864
1574
|
setSelected(UI.utils.ancestor(selectedTd.parentNode, 'TD'), true);
|
|
1865
1575
|
} // supplied by thieOutline.focusTd
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
1576
|
break;
|
|
1869
|
-
|
|
1870
1577
|
case 'moveTo':
|
|
1871
1578
|
// UI.log.info(selection[0].textContent+'->'+inputTd.textContent);
|
|
1872
1579
|
deselectAll();
|
|
1873
1580
|
setSelected(inputTd, true);
|
|
1874
1581
|
break;
|
|
1875
1582
|
}
|
|
1876
|
-
|
|
1877
1583
|
if (directionCode === 'down' || directionCode === 'up') {
|
|
1878
1584
|
if (!newSelTd.tabulatorSelect) this.walk(directionCode);
|
|
1879
|
-
}
|
|
1585
|
+
}
|
|
1586
|
+
// return newSelTd;
|
|
1587
|
+
};
|
|
1880
1588
|
|
|
1881
|
-
|
|
1589
|
+
// Keyboard Input: we can consider this as...
|
|
1882
1590
|
// 1. a fast way to modify data - enter will go to next predicate
|
|
1883
1591
|
// 2. an alternative way to input - enter at the end of a predicate will create a new statement
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
1592
|
this.OutlinerKeypressPanel = function OutlinerKeypressPanel(e) {
|
|
1887
1593
|
UI.log.info('Key ' + e.keyCode + ' pressed');
|
|
1888
|
-
|
|
1889
1594
|
function showURI(about) {
|
|
1890
1595
|
if (about && dom.getElementById('UserURI')) {
|
|
1891
1596
|
dom.getElementById('UserURI').value = about.termType === 'NamedNode' ? about.uri : ''; // blank if no URI
|
|
@@ -1898,26 +1603,21 @@ function _default(context) {
|
|
|
1898
1603
|
showURI(UI.utils.getAbout(kb, selection[0]));
|
|
1899
1604
|
return true;
|
|
1900
1605
|
}
|
|
1901
|
-
|
|
1902
1606
|
var target, editable;
|
|
1903
1607
|
if (UI.utils.getTarget(e).tagName === 'TEXTAREA') return;
|
|
1904
1608
|
if (UI.utils.getTarget(e).id === 'UserURI') return;
|
|
1905
1609
|
if (selection.length > 1) return;
|
|
1906
|
-
|
|
1907
1610
|
if (selection.length === 0) {
|
|
1908
1611
|
if (e.keyCode === 13 || e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 37 || e.keyCode === 39) {
|
|
1909
1612
|
this.walk('right', thisOutline.focusTd);
|
|
1910
1613
|
showURI(UI.utils.getAbout(kb, selection[0]));
|
|
1911
1614
|
}
|
|
1912
|
-
|
|
1913
1615
|
return;
|
|
1914
1616
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1617
|
+
var selectedTd = selection[0];
|
|
1618
|
+
// if not done, Have to deal with redraw...
|
|
1918
1619
|
sf.removeCallback('done', 'setSelectedAfterward');
|
|
1919
1620
|
sf.removeCallback('fail', 'setSelectedAfterward');
|
|
1920
|
-
|
|
1921
1621
|
switch (e.keyCode) {
|
|
1922
1622
|
case 13:
|
|
1923
1623
|
// enter
|
|
@@ -1926,7 +1626,6 @@ function _default(context) {
|
|
|
1926
1626
|
var object = UI.utils.getAbout(kb, selectedTd);
|
|
1927
1627
|
target = selectedTd.parentNode.AJAR_statement.why;
|
|
1928
1628
|
editable = _solidLogic.store.updater.editable(target.uri, kb);
|
|
1929
|
-
|
|
1930
1629
|
if (object) {
|
|
1931
1630
|
// <Feature about='enterToExpand'>
|
|
1932
1631
|
outline.GotoSubject(object, true);
|
|
@@ -1953,12 +1652,9 @@ function _default(context) {
|
|
|
1953
1652
|
this.UserInput.Keypress(e);
|
|
1954
1653
|
this.walk('down'); // bug with input at the end
|
|
1955
1654
|
// dom.getElementById('docHTML').focus(); //have to set this or focus blurs
|
|
1956
|
-
|
|
1957
1655
|
e.stopPropagation();
|
|
1958
1656
|
}
|
|
1959
|
-
|
|
1960
1657
|
return;
|
|
1961
|
-
|
|
1962
1658
|
case 38:
|
|
1963
1659
|
// up
|
|
1964
1660
|
// thisOutline.UserInput.clearInputAndSave();
|
|
@@ -1967,7 +1663,6 @@ function _default(context) {
|
|
|
1967
1663
|
e.stopPropagation();
|
|
1968
1664
|
e.preventDefault();
|
|
1969
1665
|
break;
|
|
1970
|
-
|
|
1971
1666
|
case 40:
|
|
1972
1667
|
// down
|
|
1973
1668
|
// thisOutline.UserInput.clearInputAndSave();
|
|
@@ -1976,26 +1671,19 @@ function _default(context) {
|
|
|
1976
1671
|
e.preventDefault();
|
|
1977
1672
|
} // switch
|
|
1978
1673
|
|
|
1979
|
-
|
|
1980
1674
|
if (UI.utils.getTarget(e).tagName === 'INPUT') return;
|
|
1981
1675
|
var walk;
|
|
1982
|
-
|
|
1983
1676
|
switch (e.keyCode) {
|
|
1984
1677
|
case 46: // delete
|
|
1985
|
-
|
|
1986
1678
|
case 8:
|
|
1987
1679
|
// backspace
|
|
1988
1680
|
target = selectedTd.parentNode.AJAR_statement.why;
|
|
1989
1681
|
editable = _solidLogic.store.updater.editable(target.uri, kb);
|
|
1990
|
-
|
|
1991
1682
|
if (editable) {
|
|
1992
1683
|
e.preventDefault(); // prevent from going back
|
|
1993
|
-
|
|
1994
1684
|
this.UserInput.Delete(selectedTd);
|
|
1995
1685
|
}
|
|
1996
|
-
|
|
1997
1686
|
break;
|
|
1998
|
-
|
|
1999
1687
|
case 37:
|
|
2000
1688
|
{
|
|
2001
1689
|
// left
|
|
@@ -2004,22 +1692,18 @@ function _default(context) {
|
|
|
2004
1692
|
outlineCollapse(selectedTd, UI.utils.getAbout(kb, titleTd));
|
|
2005
1693
|
break;
|
|
2006
1694
|
}
|
|
2007
|
-
|
|
2008
1695
|
case 39:
|
|
2009
1696
|
// right
|
|
2010
1697
|
// @@ TODO: Write away the need for exception on next line
|
|
2011
1698
|
// eslint-disable-next-line no-case-declarations
|
|
2012
1699
|
var obj = UI.utils.getAbout(kb, selectedTd);
|
|
2013
|
-
|
|
2014
1700
|
if (obj) {
|
|
2015
1701
|
walk = this.walk;
|
|
2016
|
-
|
|
2017
1702
|
if (selectedTd.nextSibling) {
|
|
2018
1703
|
// when selectedTd is a predicate
|
|
2019
1704
|
this.walk('right');
|
|
2020
1705
|
return;
|
|
2021
1706
|
}
|
|
2022
|
-
|
|
2023
1707
|
if (selectedTd.firstChild.tagName !== 'TABLE') {
|
|
2024
1708
|
// not expanded
|
|
2025
1709
|
sf.addCallback('done', setSelectedAfterward);
|
|
@@ -2028,18 +1712,13 @@ function _default(context) {
|
|
|
2028
1712
|
pane: paneRegistry.byName('defaultPane')
|
|
2029
1713
|
});
|
|
2030
1714
|
}
|
|
2031
|
-
|
|
2032
1715
|
setSelectedAfterward();
|
|
2033
1716
|
}
|
|
2034
|
-
|
|
2035
1717
|
break;
|
|
2036
|
-
|
|
2037
1718
|
case 38: // up
|
|
2038
|
-
|
|
2039
1719
|
case 40:
|
|
2040
1720
|
// down
|
|
2041
1721
|
break;
|
|
2042
|
-
|
|
2043
1722
|
default:
|
|
2044
1723
|
switch (e.charCode) {
|
|
2045
1724
|
case 99:
|
|
@@ -2048,23 +1727,18 @@ function _default(context) {
|
|
|
2048
1727
|
thisOutline.UserInput.copyToClipboard(thisOutline.clipboardAddress, selectedTd);
|
|
2049
1728
|
break;
|
|
2050
1729
|
}
|
|
2051
|
-
|
|
2052
1730
|
break;
|
|
2053
|
-
|
|
2054
1731
|
case 118: // v
|
|
2055
|
-
|
|
2056
1732
|
case 112:
|
|
2057
1733
|
// p for Paste
|
|
2058
1734
|
if (e.ctrlKey) {
|
|
2059
|
-
thisOutline.UserInput.pasteFromClipboard(thisOutline.clipboardAddress, selectedTd);
|
|
1735
|
+
thisOutline.UserInput.pasteFromClipboard(thisOutline.clipboardAddress, selectedTd);
|
|
1736
|
+
// dom.getElementById('docHTML').focus(); //have to set this or focus blurs
|
|
2060
1737
|
// window.focus();
|
|
2061
1738
|
// e.stopPropagation();
|
|
2062
|
-
|
|
2063
1739
|
break;
|
|
2064
1740
|
}
|
|
2065
|
-
|
|
2066
1741
|
break;
|
|
2067
|
-
|
|
2068
1742
|
default:
|
|
2069
1743
|
if (UI.utils.getTarget(e).tagName === 'HTML') {
|
|
2070
1744
|
/*
|
|
@@ -2079,14 +1753,11 @@ function _default(context) {
|
|
|
2079
1753
|
// e2.initKeyEvent('keypress',true,true,null,false,false,false,false,e.keyCode,0);
|
|
2080
1754
|
// UserInput.lastModified.dispatchEvent(e2);
|
|
2081
1755
|
}
|
|
2082
|
-
|
|
2083
1756
|
}
|
|
2084
|
-
|
|
2085
1757
|
} // end of switch
|
|
2086
1758
|
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
1759
|
+
showURI(UI.utils.getAbout(kb, selection[0]));
|
|
1760
|
+
// alert(window);alert(doc);
|
|
2090
1761
|
/*
|
|
2091
1762
|
var wm = Components.classes['@mozilla.org/appshell/window-mediator;1']
|
|
2092
1763
|
.getService(Components.interfaces.nsIWindowMediator);
|
|
@@ -2094,36 +1765,31 @@ function _default(context) {
|
|
|
2094
1765
|
// gBrowser.addTab('http://www.w3.org/');
|
|
2095
1766
|
// alert(gBrowser.addTab);alert(gBrowser.scroll);alert(gBrowser.scrollBy)
|
|
2096
1767
|
// gBrowser.scrollBy(0,100);
|
|
2097
|
-
// var thisHtml=selection[0].owner
|
|
2098
1768
|
|
|
1769
|
+
// var thisHtml=selection[0].owner
|
|
2099
1770
|
if (selection[0]) {
|
|
2100
1771
|
var PosY = UI.utils.findPos(selection[0])[1];
|
|
2101
|
-
|
|
2102
1772
|
if (PosY + selection[0].clientHeight > window.scrollY + window.innerHeight) {
|
|
2103
1773
|
UI.utils.getEyeFocus(selection[0], true, true, window);
|
|
2104
1774
|
}
|
|
2105
|
-
|
|
2106
1775
|
if (PosY < window.scrollY + 54) {
|
|
2107
1776
|
UI.utils.getEyeFocus(selection[0], true, undefined, window);
|
|
2108
1777
|
}
|
|
2109
1778
|
}
|
|
2110
1779
|
};
|
|
2111
|
-
|
|
2112
1780
|
this.OutlinerMouseclickPanel = function (e) {
|
|
2113
1781
|
switch (thisOutline.UserInput._tabulatorMode) {
|
|
2114
1782
|
case 0:
|
|
2115
1783
|
TabulatorMousedown(e);
|
|
2116
1784
|
break;
|
|
2117
|
-
|
|
2118
1785
|
case 1:
|
|
2119
1786
|
thisOutline.UserInput.Click(e);
|
|
2120
1787
|
break;
|
|
2121
|
-
|
|
2122
1788
|
default:
|
|
2123
1789
|
}
|
|
2124
1790
|
};
|
|
2125
|
-
/** things to do onmousedown in outline view **/
|
|
2126
1791
|
|
|
1792
|
+
/** things to do onmousedown in outline view **/
|
|
2127
1793
|
/*
|
|
2128
1794
|
** To Do: This big event handler needs to be replaced by lots
|
|
2129
1795
|
** of little ones individually connected to each icon. This horrible
|
|
@@ -2135,7 +1801,6 @@ function _default(context) {
|
|
|
2135
1801
|
// select
|
|
2136
1802
|
// visit/open a page
|
|
2137
1803
|
|
|
2138
|
-
|
|
2139
1804
|
function expandMouseDownListener(e) {
|
|
2140
1805
|
// For icon (UI.icons.originalIconBase + 'tbl-expand-trans.png')
|
|
2141
1806
|
var target = thisOutline.targetOf(e);
|
|
@@ -2158,7 +1823,6 @@ function _default(context) {
|
|
|
2158
1823
|
}
|
|
2159
1824
|
}
|
|
2160
1825
|
}
|
|
2161
|
-
|
|
2162
1826
|
function collapseMouseDownListener(e) {
|
|
2163
1827
|
// for icon UI.icons.originalIconBase + 'tbl-collapse.png'
|
|
2164
1828
|
var target = thisOutline.targetOf(e);
|
|
@@ -2167,12 +1831,10 @@ function _default(context) {
|
|
|
2167
1831
|
var p = target.parentNode.parentNode;
|
|
2168
1832
|
outlineCollapse(p, subject, pane);
|
|
2169
1833
|
}
|
|
2170
|
-
|
|
2171
1834
|
function failedIconMouseDownListener(e) {
|
|
2172
1835
|
// outlineIcons.src.icon_failed
|
|
2173
1836
|
var target = thisOutline.targetOf(e);
|
|
2174
1837
|
var uri = target.getAttribute('uri'); // Put on access buttons
|
|
2175
|
-
|
|
2176
1838
|
if (e.altKey) {
|
|
2177
1839
|
sf.fetch(UI.rdf.uri.docpart(uri), {
|
|
2178
1840
|
force: true
|
|
@@ -2186,7 +1848,6 @@ function _default(context) {
|
|
|
2186
1848
|
// outlineIcons.src.icon_fetched
|
|
2187
1849
|
var target = thisOutline.targetOf(e);
|
|
2188
1850
|
var uri = target.getAttribute('uri'); // Put on access buttons
|
|
2189
|
-
|
|
2190
1851
|
if (e.altKey) {
|
|
2191
1852
|
sf.fetch(UI.rdf.uri.docpart(uri), {
|
|
2192
1853
|
force: true
|
|
@@ -2199,16 +1860,13 @@ function _default(context) {
|
|
|
2199
1860
|
function unrequestedIconMouseDownListener(e) {
|
|
2200
1861
|
var target = thisOutline.targetOf(e);
|
|
2201
1862
|
var uri = target.getAttribute('uri'); // Put on access buttons
|
|
2202
|
-
|
|
2203
1863
|
sf.fetch(UI.rdf.uri.docpart(uri));
|
|
2204
1864
|
}
|
|
2205
|
-
|
|
2206
1865
|
function removeNodeIconMouseDownListener(e) {
|
|
2207
1866
|
// icon_remove_node
|
|
2208
1867
|
var target = thisOutline.targetOf(e);
|
|
2209
1868
|
var node = target.node;
|
|
2210
1869
|
if (node.childNodes.length > 1) node = target.parentNode; // parallel outline view @@ Hack
|
|
2211
|
-
|
|
2212
1870
|
removeAndRefresh(node); // @@ update icons for pane?
|
|
2213
1871
|
}
|
|
2214
1872
|
|
|
@@ -2217,22 +1875,22 @@ function _default(context) {
|
|
|
2217
1875
|
if (thisOutline.UserInput._tabulatorMode) {
|
|
2218
1876
|
return thisOutline.UserInput.Click(e);
|
|
2219
1877
|
}
|
|
2220
|
-
|
|
2221
|
-
|
|
1878
|
+
var target = thisOutline.targetOf(e);
|
|
1879
|
+
// Originally this was set on the whole tree and could happen anywhere
|
|
2222
1880
|
// var p = target.parentNode
|
|
2223
|
-
|
|
2224
1881
|
var node;
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
node = UI.utils.ancestor(node.parentNode, 'TD')) {
|
|
1882
|
+
for (node = UI.utils.ancestor(target, 'TD'); node && !(node.getAttribute('notSelectable') === 'false');
|
|
1883
|
+
// Default now is not selectable
|
|
1884
|
+
node = UI.utils.ancestor(node.parentNode, 'TD')) {
|
|
1885
|
+
// ...
|
|
2228
1886
|
}
|
|
1887
|
+
if (!node) return;
|
|
2229
1888
|
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
var sel = selected(node); // var cla = node.getAttribute('class')
|
|
1889
|
+
// var node = target;
|
|
2233
1890
|
|
|
1891
|
+
var sel = selected(node);
|
|
1892
|
+
// var cla = node.getAttribute('class')
|
|
2234
1893
|
UI.log.debug('Was node selected before: ' + sel);
|
|
2235
|
-
|
|
2236
1894
|
if (e.altKey) {
|
|
2237
1895
|
setSelected(node, !selected(node));
|
|
2238
1896
|
} else if (e.shiftKey) {
|
|
@@ -2242,177 +1900,153 @@ function _default(context) {
|
|
|
2242
1900
|
deselectAll();
|
|
2243
1901
|
thisOutline.UserInput.clearInputAndSave(e);
|
|
2244
1902
|
setSelected(node, true);
|
|
2245
|
-
|
|
2246
1903
|
if (e.detail === 2) {
|
|
2247
1904
|
// double click -> quit TabulatorMousedown()
|
|
2248
1905
|
e.stopPropagation();
|
|
2249
1906
|
return;
|
|
2250
|
-
}
|
|
1907
|
+
}
|
|
1908
|
+
// if the node is already selected and the corresponding statement is editable,
|
|
2251
1909
|
// go to UserInput
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
1910
|
var st;
|
|
2255
1911
|
if (node.parentNode) st = node.parentNode.AJAR_statement;
|
|
2256
1912
|
if (!st) return; // For example in the title TD of an expanded pane
|
|
2257
|
-
|
|
2258
1913
|
var _target = st.why;
|
|
2259
|
-
|
|
2260
1914
|
var editable = _solidLogic.store.updater.editable(_target.uri, kb);
|
|
2261
|
-
|
|
2262
1915
|
if (sel && editable) thisOutline.UserInput.Click(e, selection[0]); // was next 2 lines
|
|
2263
1916
|
// var text='TabulatorMouseDown@Outline()';
|
|
2264
1917
|
// HCIoptions['able to edit in Discovery Mode by mouse'].setupHere([sel,e,thisOutline,selection[0]],text);
|
|
2265
1918
|
}
|
|
2266
1919
|
|
|
2267
|
-
UI.log.debug('Was node selected after: ' + selected(node) + ', count=' + selection.length);
|
|
2268
|
-
|
|
1920
|
+
UI.log.debug('Was node selected after: ' + selected(node) + ', count=' + selection.length);
|
|
1921
|
+
// var tr = node.parentNode
|
|
2269
1922
|
/*
|
|
2270
1923
|
if (tr.AJAR_statement) {
|
|
2271
1924
|
// var why = tr.AJAR_statement.why
|
|
2272
1925
|
// UI.log.info('Information from '+why);
|
|
2273
1926
|
}
|
|
2274
1927
|
*/
|
|
2275
|
-
|
|
2276
|
-
|
|
1928
|
+
e.stopPropagation();
|
|
1929
|
+
// this is important or conflict between deselect and user input happens
|
|
2277
1930
|
}
|
|
2278
1931
|
|
|
2279
1932
|
function TabulatorMousedown(e) {
|
|
2280
1933
|
UI.log.info('@TabulatorMousedown, dom.location is now ' + dom.location);
|
|
2281
1934
|
var target = thisOutline.targetOf(e);
|
|
2282
1935
|
if (!target) return;
|
|
2283
|
-
var tname = target.tagName;
|
|
1936
|
+
var tname = target.tagName;
|
|
1937
|
+
// UI.log.debug('TabulatorMousedown: ' + tname + ' shift='+e.shiftKey+' alt='+e.altKey+' ctrl='+e.ctrlKey);
|
|
2284
1938
|
// var p = target.parentNode
|
|
2285
1939
|
// var about = UI.utils.getAbout(kb, target)
|
|
2286
1940
|
// var source = null
|
|
2287
|
-
|
|
2288
1941
|
if (tname === 'INPUT' || tname === 'TEXTAREA') {
|
|
2289
1942
|
return;
|
|
2290
|
-
}
|
|
2291
|
-
|
|
1943
|
+
}
|
|
2292
1944
|
|
|
2293
|
-
|
|
1945
|
+
// not input then clear
|
|
1946
|
+
thisOutline.UserInput.clearMenu();
|
|
2294
1947
|
|
|
1948
|
+
// ToDo:remove this and recover X
|
|
2295
1949
|
if (thisOutline.UserInput.lastModified && thisOutline.UserInput.lastModified.parentNode.nextSibling) {
|
|
2296
1950
|
thisOutline.UserInput.backOut();
|
|
2297
|
-
}
|
|
2298
|
-
// have to put this here or this conflicts with deselectAll()
|
|
1951
|
+
}
|
|
2299
1952
|
|
|
1953
|
+
// if (typeof rav=='undefined') //uncomment this for javascript2rdf
|
|
1954
|
+
// have to put this here or this conflicts with deselectAll()
|
|
2300
1955
|
|
|
2301
1956
|
if (!target.src || target.src.slice(target.src.indexOf('/icons/') + 1) !== outlineIcons.src.icon_show_choices && target.src.slice(target.src.indexOf('/icons/') + 1) !== outlineIcons.src.icon_add_triple) {
|
|
2302
1957
|
thisOutline.UserInput.clearInputAndSave(e);
|
|
2303
1958
|
}
|
|
2304
|
-
|
|
2305
1959
|
if (!target.src || target.src.slice(target.src.indexOf('/icons/') + 1) !== outlineIcons.src.icon_show_choices) {
|
|
2306
1960
|
thisOutline.UserInput.clearMenu();
|
|
2307
1961
|
}
|
|
2308
|
-
|
|
2309
1962
|
if (e) e.stopPropagation();
|
|
2310
1963
|
} // function TabulatorMousedown
|
|
2311
1964
|
|
|
2312
|
-
|
|
2313
1965
|
function setUrlBarAndTitle(subject) {
|
|
2314
1966
|
dom.title = UI.utils.label(subject);
|
|
2315
|
-
|
|
2316
|
-
|
|
1967
|
+
if (dom.location.href.startsWith(subject.site().uri)) {
|
|
1968
|
+
// dom.location = subject.uri // No causes reload
|
|
2317
1969
|
}
|
|
2318
1970
|
}
|
|
1971
|
+
|
|
2319
1972
|
/** Expand an outline view
|
|
2320
1973
|
* @param p {Element} - container
|
|
2321
1974
|
*/
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
1975
|
function outlineExpand(p, subject1, options) {
|
|
2325
1976
|
options = options || {};
|
|
2326
1977
|
var pane = options.pane;
|
|
2327
1978
|
var already = !!options.already;
|
|
2328
1979
|
var immediate = options.immediate;
|
|
2329
|
-
UI.log.info('@outlineExpand, dom is now ' + dom.location);
|
|
2330
|
-
|
|
1980
|
+
UI.log.info('@outlineExpand, dom is now ' + dom.location);
|
|
1981
|
+
// remove callback to prevent unexpected repaint
|
|
2331
1982
|
sf.removeCallback('done', 'expand');
|
|
2332
1983
|
sf.removeCallback('fail', 'expand');
|
|
2333
|
-
var subject = kb.canon(subject1);
|
|
1984
|
+
var subject = kb.canon(subject1);
|
|
1985
|
+
// var requTerm = subject.uri ? kb.sym(UI.rdf.uri.docpart(subject.uri)) : subject
|
|
2334
1986
|
|
|
2335
1987
|
function render() {
|
|
2336
1988
|
subject = kb.canon(subject);
|
|
2337
1989
|
if (!p || !p.parentNode || !p.parentNode.parentNode) return false;
|
|
2338
1990
|
var newTable;
|
|
2339
1991
|
UI.log.info('@@ REPAINTING ');
|
|
2340
|
-
|
|
2341
1992
|
if (!already) {
|
|
2342
1993
|
// first expand
|
|
2343
1994
|
newTable = propertyTable(subject, undefined, pane, options);
|
|
2344
1995
|
} else {
|
|
2345
1996
|
UI.log.info(' ... p is ' + p);
|
|
2346
|
-
|
|
2347
1997
|
for (newTable = p.firstChild; newTable.nextSibling; newTable = newTable.nextSibling) {
|
|
2348
1998
|
UI.log.info(' ... checking node ' + newTable);
|
|
2349
1999
|
if (newTable.nodeName === 'table') break;
|
|
2350
2000
|
}
|
|
2351
|
-
|
|
2352
2001
|
newTable = propertyTable(subject, newTable, pane, options);
|
|
2353
2002
|
}
|
|
2354
|
-
|
|
2355
2003
|
already = true;
|
|
2356
|
-
|
|
2357
2004
|
if (UI.utils.ancestor(p, 'TABLE') && UI.utils.ancestor(p, 'TABLE').style.backgroundColor === 'white') {
|
|
2358
2005
|
newTable.style.backgroundColor = '#eee';
|
|
2359
2006
|
} else {
|
|
2360
2007
|
newTable.style.backgroundColor = 'white';
|
|
2361
2008
|
}
|
|
2362
|
-
|
|
2363
2009
|
UI.utils.emptyNode(p).appendChild(newTable);
|
|
2364
2010
|
thisOutline.focusTd = p; // I don't know why I couldn't use 'this'...because not defined in callbacks
|
|
2365
|
-
|
|
2366
|
-
|
|
2011
|
+
UI.log.debug('expand: Node for ' + subject + ' expanded');
|
|
2012
|
+
// fetch seeAlso when render()
|
|
2367
2013
|
// var seeAlsoStats = sf.store.statementsMatching(subject, UI.ns.rdfs('seeAlso'))
|
|
2368
2014
|
// seeAlsoStats.map(function (x) {sf.lookUpThing(x.object, subject,false);})
|
|
2369
|
-
|
|
2370
2015
|
var seeAlsoWhat = kb.each(subject, UI.ns.rdfs('seeAlso'));
|
|
2371
|
-
|
|
2372
2016
|
for (var i = 0; i < seeAlsoWhat.length; i++) {
|
|
2373
2017
|
if (i === 25) {
|
|
2374
|
-
UI.log.warn('expand: Warning: many (' + seeAlsoWhat.length + ') seeAlso links for ' + subject);
|
|
2018
|
+
UI.log.warn('expand: Warning: many (' + seeAlsoWhat.length + ') seeAlso links for ' + subject);
|
|
2019
|
+
// break; Not sure what limits the AJAX system has here
|
|
2375
2020
|
}
|
|
2376
2021
|
|
|
2377
2022
|
sf.lookUpThing(seeAlsoWhat[i], subject);
|
|
2378
2023
|
}
|
|
2379
2024
|
}
|
|
2380
|
-
|
|
2381
2025
|
function expand(uri) {
|
|
2382
2026
|
if (arguments[3]) return true; // already fetched indicator
|
|
2383
|
-
|
|
2384
2027
|
var cursubj = kb.canon(subject); // canonical identifier may have changed
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2028
|
+
UI.log.info('@@ expand: relevant subject=' + cursubj + ', uri=' + uri + ', already=' + already);
|
|
2029
|
+
// var term = kb.sym(uri)
|
|
2388
2030
|
var docTerm = kb.sym(UI.rdf.uri.docpart(uri));
|
|
2389
|
-
|
|
2390
2031
|
if (uri.indexOf('#') >= 0) {
|
|
2391
2032
|
throw new Error('Internal error: hash in ' + uri);
|
|
2392
2033
|
}
|
|
2393
|
-
|
|
2394
2034
|
var relevant = function relevant() {
|
|
2395
2035
|
// Is the loading of this URI relevam to the display of subject?
|
|
2396
2036
|
if (!cursubj.uri) return true; // bnode should expand()
|
|
2397
|
-
|
|
2398
2037
|
var as = kb.uris(cursubj);
|
|
2399
2038
|
if (!as) return false;
|
|
2400
|
-
|
|
2401
2039
|
for (var i = 0; i < as.length; i++) {
|
|
2402
2040
|
// canon'l uri or any alias
|
|
2403
2041
|
for (var rd = UI.rdf.uri.docpart(as[i]); rd; rd = kb.HTTPRedirects[rd]) {
|
|
2404
2042
|
if (uri === rd) return true;
|
|
2405
2043
|
}
|
|
2406
2044
|
}
|
|
2407
|
-
|
|
2408
2045
|
if (kb.anyStatementMatching(cursubj, undefined, undefined, docTerm)) {
|
|
2409
2046
|
return true;
|
|
2410
2047
|
} // Kenny: inverse?
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
2048
|
return false;
|
|
2414
2049
|
};
|
|
2415
|
-
|
|
2416
2050
|
if (relevant()) {
|
|
2417
2051
|
UI.log.success('@@ expand OK: relevant subject=' + cursubj + ', uri=' + uri + ', source=' + already);
|
|
2418
2052
|
render();
|
|
@@ -2420,32 +2054,27 @@ function _default(context) {
|
|
|
2420
2054
|
}
|
|
2421
2055
|
|
|
2422
2056
|
return true;
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2057
|
+
}
|
|
2058
|
+
// Body of outlineExpand
|
|
2425
2059
|
|
|
2426
2060
|
if (options.solo) {
|
|
2427
2061
|
setUrlBarAndTitle(subject);
|
|
2428
2062
|
}
|
|
2429
|
-
|
|
2430
2063
|
UI.log.debug('outlineExpand: dereferencing ' + subject);
|
|
2431
2064
|
var status = dom.createElement('span');
|
|
2432
2065
|
p.appendChild(status);
|
|
2433
2066
|
sf.addCallback('done', expand); // @@@@@@@ This can really mess up existing work
|
|
2434
|
-
|
|
2435
2067
|
sf.addCallback('fail', expand); // Need to do if there s one a gentle resync of page with store
|
|
2436
2068
|
|
|
2437
2069
|
var returnConditions = []; // this is quite a general way to do cut and paste programming
|
|
2438
2070
|
// I might make a class for this
|
|
2439
|
-
|
|
2440
2071
|
if (subject.uri && subject.uri.split(':')[0] === 'rdf') {
|
|
2441
2072
|
// what is this? -tim
|
|
2442
2073
|
render();
|
|
2443
2074
|
return;
|
|
2444
2075
|
}
|
|
2445
|
-
|
|
2446
2076
|
for (var i = 0; i < returnConditions.length; i++) {
|
|
2447
2077
|
var returnCode = void 0;
|
|
2448
|
-
|
|
2449
2078
|
if (returnCode === returnConditions[i](subject)) {
|
|
2450
2079
|
render();
|
|
2451
2080
|
UI.log.debug('outline 1815');
|
|
@@ -2453,14 +2082,12 @@ function _default(context) {
|
|
|
2453
2082
|
return;
|
|
2454
2083
|
}
|
|
2455
2084
|
}
|
|
2456
|
-
|
|
2457
2085
|
if (subject.uri && !immediate && !UI.widgets.isAudio(subject) && !UI.widgets.isVideo(subject)) {
|
|
2458
2086
|
// Wait till at least the main URI is loaded before expanding:
|
|
2459
2087
|
sf.nowOrWhenFetched(subject.doc(), undefined, function (ok, body) {
|
|
2460
2088
|
if (ok) {
|
|
2461
2089
|
sf.lookUpThing(subject);
|
|
2462
2090
|
render(); // inital open, or else full if re-open
|
|
2463
|
-
|
|
2464
2091
|
if (options.solo) {
|
|
2465
2092
|
// Update window title with new information
|
|
2466
2093
|
// dom.title = UI.utils.label(subject)
|
|
@@ -2479,46 +2106,38 @@ function _default(context) {
|
|
|
2479
2106
|
}
|
|
2480
2107
|
} // outlineExpand
|
|
2481
2108
|
|
|
2482
|
-
|
|
2483
2109
|
function outlineCollapse(p, subject) {
|
|
2484
2110
|
var row = UI.utils.ancestor(p, 'TR');
|
|
2485
2111
|
row = UI.utils.ancestor(row.parentNode, 'TR'); // two levels up
|
|
2486
|
-
|
|
2487
2112
|
var statement;
|
|
2488
2113
|
if (row) statement = row.AJAR_statement;
|
|
2489
2114
|
var level; // find level (the enclosing TD)
|
|
2490
|
-
|
|
2491
2115
|
for (level = p.parentNode; level.tagName !== 'TD'; level = level.parentNode) {
|
|
2492
2116
|
if (typeof level === 'undefined') {
|
|
2493
2117
|
alert('Not enclosed in TD!');
|
|
2494
2118
|
return;
|
|
2495
2119
|
}
|
|
2496
2120
|
}
|
|
2497
|
-
|
|
2498
2121
|
UI.log.debug('Collapsing subject ' + subject);
|
|
2499
2122
|
var myview;
|
|
2500
|
-
|
|
2501
2123
|
if (statement) {
|
|
2502
2124
|
UI.log.debug('looking up pred ' + statement.predicate.uri + 'in defaults');
|
|
2503
2125
|
myview = views.defaults[statement.predicate.uri];
|
|
2504
2126
|
}
|
|
2505
|
-
|
|
2506
2127
|
UI.log.debug('view= ' + myview);
|
|
2507
2128
|
var deleteNode;
|
|
2508
|
-
|
|
2509
2129
|
if (level.parentNode.parentNode.id === 'outline') {
|
|
2510
2130
|
deleteNode = level.parentNode;
|
|
2511
2131
|
}
|
|
2512
|
-
|
|
2513
2132
|
thisOutline.replaceTD(thisOutline.outlineObjectTD(subject, myview, deleteNode, statement), level);
|
|
2514
2133
|
} // outlineCollapse
|
|
2515
2134
|
|
|
2516
|
-
|
|
2517
2135
|
this.replaceTD = function replaceTD(newTd, replacedTd) {
|
|
2518
2136
|
var reselect;
|
|
2519
|
-
if (selected(replacedTd)) reselect = true;
|
|
2520
|
-
// deselecting an element decreases selection.length
|
|
2137
|
+
if (selected(replacedTd)) reselect = true;
|
|
2521
2138
|
|
|
2139
|
+
// deselects everything being collapsed. This goes backwards because
|
|
2140
|
+
// deselecting an element decreases selection.length
|
|
2522
2141
|
for (var x = selection.length - 1; x > -1; x--) {
|
|
2523
2142
|
for (var elt = selection[x]; elt.parentNode; elt = elt.parentNode) {
|
|
2524
2143
|
if (elt === replacedTd) {
|
|
@@ -2526,31 +2145,26 @@ function _default(context) {
|
|
|
2526
2145
|
}
|
|
2527
2146
|
}
|
|
2528
2147
|
}
|
|
2529
|
-
|
|
2530
2148
|
replacedTd.parentNode.replaceChild(newTd, replacedTd);
|
|
2531
2149
|
if (reselect) setSelected(newTd, true);
|
|
2532
2150
|
};
|
|
2533
|
-
|
|
2534
2151
|
function outlineRefocus(p, subject) {
|
|
2535
2152
|
// Shift-expand or shift-collapse: Maximize
|
|
2536
2153
|
var outer = null;
|
|
2537
|
-
|
|
2538
2154
|
for (var level = p.parentNode; level; level = level.parentNode) {
|
|
2539
2155
|
UI.log.debug('level ' + level.tagName);
|
|
2540
2156
|
if (level.tagName === 'TD') outer = level;
|
|
2541
2157
|
} // find outermost td
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
2158
|
UI.utils.emptyNode(outer).appendChild(propertyTable(subject));
|
|
2545
|
-
setUrlBarAndTitle(subject);
|
|
2546
|
-
|
|
2159
|
+
setUrlBarAndTitle(subject);
|
|
2160
|
+
// dom.title = UI.utils.label(subject)
|
|
2547
2161
|
outer.setAttribute('about', subject.toNT());
|
|
2548
2162
|
} // outlineRefocus
|
|
2549
2163
|
|
|
2164
|
+
outline.outlineRefocus = outlineRefocus;
|
|
2550
2165
|
|
|
2551
|
-
|
|
2166
|
+
// Inversion is turning the outline view inside-out
|
|
2552
2167
|
// It may be called eversion
|
|
2553
|
-
|
|
2554
2168
|
/*
|
|
2555
2169
|
function outlineInversion (p, subject) { // re-root at subject
|
|
2556
2170
|
function move_root (rootTR, childTR) { // swap root with child
|
|
@@ -2558,24 +2172,21 @@ function _default(context) {
|
|
|
2558
2172
|
}
|
|
2559
2173
|
}
|
|
2560
2174
|
*/
|
|
2561
|
-
|
|
2562
2175
|
this.GotoFormURI_enterKey = function (e) {
|
|
2563
2176
|
if (e.keyCode === 13) outline.GotoFormURI(e);
|
|
2564
2177
|
};
|
|
2565
|
-
|
|
2566
2178
|
this.GotoFormURI = function (_e) {
|
|
2567
2179
|
GotoURI(dom.getElementById('UserURI').value);
|
|
2568
2180
|
};
|
|
2569
|
-
|
|
2570
2181
|
function GotoURI(uri) {
|
|
2571
2182
|
var subject = kb.sym(uri);
|
|
2572
2183
|
this.GotoSubject(subject, true);
|
|
2573
2184
|
}
|
|
2574
|
-
|
|
2575
2185
|
this.GotoURIinit = function (uri) {
|
|
2576
2186
|
var subject = kb.sym(uri);
|
|
2577
2187
|
this.GotoSubject(subject);
|
|
2578
2188
|
};
|
|
2189
|
+
|
|
2579
2190
|
/** Display the subject in an outline view
|
|
2580
2191
|
@param subject -- RDF term for teh thing to be presented
|
|
2581
2192
|
@param expand -- flag -- open the subject rather than keep folded closed
|
|
@@ -2584,16 +2195,12 @@ function _default(context) {
|
|
|
2584
2195
|
@param referer -- optional -- where did we hear about this from anyway?
|
|
2585
2196
|
@param table -- option -- a table element in which to put the outline.
|
|
2586
2197
|
*/
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
2198
|
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
|
|
2590
2199
|
table = table || dom.getElementById('outline'); // if does not exist just add one? nowhere to out it
|
|
2591
|
-
|
|
2592
2200
|
if (solo) {
|
|
2593
2201
|
UI.utils.emptyNode(table);
|
|
2594
2202
|
table.style.width = '100%';
|
|
2595
2203
|
}
|
|
2596
|
-
|
|
2597
2204
|
function GotoSubjectDefault() {
|
|
2598
2205
|
var tr = dom.createElement('TR');
|
|
2599
2206
|
tr.style.verticalAlign = 'top';
|
|
@@ -2602,7 +2209,6 @@ function _default(context) {
|
|
|
2602
2209
|
tr.appendChild(td);
|
|
2603
2210
|
return td;
|
|
2604
2211
|
}
|
|
2605
|
-
|
|
2606
2212
|
var td = GotoSubjectDefault();
|
|
2607
2213
|
if (solo) setUrlBarAndTitle(subject); // dom.title = UI.utils.label(subject) // 'Tabulator: '+ No need to advertize
|
|
2608
2214
|
|
|
@@ -2615,13 +2221,13 @@ function _default(context) {
|
|
|
2615
2221
|
UI.utils.getEyeFocus(tr, false, undefined, window); // instantly: false
|
|
2616
2222
|
}
|
|
2617
2223
|
|
|
2618
|
-
if (solo && dom && dom.defaultView && dom.defaultView.history &&
|
|
2224
|
+
if (solo && dom && dom.defaultView && dom.defaultView.history &&
|
|
2225
|
+
// Don't add the new location to the history if we arrived here through a direct link
|
|
2619
2226
|
// (i.e. when static/databrowser.html in node-solid-server called this method):
|
|
2620
2227
|
document.location.href !== subject.uri) {
|
|
2621
2228
|
var stateObj = pane ? {
|
|
2622
2229
|
paneName: pane.name
|
|
2623
2230
|
} : {};
|
|
2624
|
-
|
|
2625
2231
|
try {
|
|
2626
2232
|
// can fail if different origin
|
|
2627
2233
|
dom.defaultView.history.pushState(stateObj, subject.uri, subject.uri);
|
|
@@ -2629,9 +2235,10 @@ function _default(context) {
|
|
|
2629
2235
|
console.log(e);
|
|
2630
2236
|
}
|
|
2631
2237
|
}
|
|
2632
|
-
|
|
2633
2238
|
return subject;
|
|
2634
|
-
};
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
// / /////////////////////////////////////////////////////
|
|
2635
2242
|
//
|
|
2636
2243
|
//
|
|
2637
2244
|
// VIEWS
|
|
@@ -2639,10 +2246,10 @@ function _default(context) {
|
|
|
2639
2246
|
//
|
|
2640
2247
|
// / /////////////////////////////////////////////////////
|
|
2641
2248
|
|
|
2642
|
-
|
|
2643
2249
|
var ns = UI.ns;
|
|
2644
|
-
var views = (0, _propertyViews["default"])(dom);
|
|
2250
|
+
var views = (0, _propertyViews["default"])(dom);
|
|
2645
2251
|
|
|
2252
|
+
// var thisOutline = this dup
|
|
2646
2253
|
/** some builtin simple views **/
|
|
2647
2254
|
|
|
2648
2255
|
function viewAsBoringDefault(obj) {
|
|
@@ -2656,24 +2263,20 @@ function _default(context) {
|
|
|
2656
2263
|
"double": "text-align: '.';"
|
|
2657
2264
|
};
|
|
2658
2265
|
rep = dom.createElement('span');
|
|
2659
|
-
rep.textContent = obj.value;
|
|
2660
|
-
|
|
2266
|
+
rep.textContent = obj.value;
|
|
2267
|
+
// Newlines have effect and overlong lines wrapped automatically
|
|
2661
2268
|
var style = '';
|
|
2662
|
-
|
|
2663
2269
|
if (obj.datatype && obj.datatype.uri) {
|
|
2664
2270
|
var xsd = UI.ns.xsd('').uri;
|
|
2665
|
-
|
|
2666
2271
|
if (obj.datatype.uri.slice(0, xsd.length) === xsd) {
|
|
2667
2272
|
style = styles[obj.datatype.uri.slice(xsd.length)];
|
|
2668
2273
|
}
|
|
2669
2274
|
}
|
|
2670
|
-
|
|
2671
2275
|
rep.setAttribute('style', style || 'white-space: pre-wrap;');
|
|
2672
2276
|
} else if (obj.termType === 'NamedNode' || obj.termType === 'BlankNode') {
|
|
2673
2277
|
rep = dom.createElement('span');
|
|
2674
2278
|
rep.setAttribute('about', obj.toNT());
|
|
2675
2279
|
thisOutline.appendAccessIcons(kb, rep, obj);
|
|
2676
|
-
|
|
2677
2280
|
if (obj.termType === 'NamedNode') {
|
|
2678
2281
|
if (obj.uri.slice(0, 4) === 'tel:') {
|
|
2679
2282
|
var num = obj.uri.slice(4);
|
|
@@ -2686,9 +2289,7 @@ function _default(context) {
|
|
|
2686
2289
|
} else {
|
|
2687
2290
|
// not tel:
|
|
2688
2291
|
rep.appendChild(dom.createTextNode(UI.utils.label(obj)));
|
|
2689
|
-
|
|
2690
2292
|
var _anchor = UI.widgets.linkIcon(dom, obj);
|
|
2691
|
-
|
|
2692
2293
|
rep.appendChild(_anchor);
|
|
2693
2294
|
UI.widgets.makeDraggable(rep, obj); // 2017
|
|
2694
2295
|
}
|
|
@@ -2706,7 +2307,6 @@ function _default(context) {
|
|
|
2706
2307
|
tr.appendChild(document.createTextNode(
|
|
2707
2308
|
obj.elements.length ? '(' + obj.elements.length+')' : '(none)'));
|
|
2708
2309
|
*/
|
|
2709
|
-
|
|
2710
2310
|
for (var i = 0; i < obj.elements.length; i++) {
|
|
2711
2311
|
var elt = obj.elements[i];
|
|
2712
2312
|
var row = rep.appendChild(dom.createElement('tr'));
|
|
@@ -2724,22 +2324,21 @@ function _default(context) {
|
|
|
2724
2324
|
UI.log.error('Object ' + obj + ' has unknown term type: ' + obj.termType);
|
|
2725
2325
|
rep = dom.createTextNode('[unknownTermType:' + obj.termType + ']');
|
|
2726
2326
|
} // boring defaults.
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
2327
|
UI.log.debug('contents: ' + rep.innerHTML);
|
|
2730
2328
|
return rep;
|
|
2731
2329
|
} // boring_default
|
|
2732
2330
|
|
|
2733
|
-
|
|
2734
2331
|
this.createTabURI = function () {
|
|
2735
2332
|
dom.getElementById('UserURI').value = dom.URL + '?uri=' + dom.getElementById('UserURI').value;
|
|
2736
|
-
};
|
|
2737
|
-
|
|
2333
|
+
};
|
|
2738
2334
|
|
|
2335
|
+
// a way to expose variables to UserInput without making them propeties/methods
|
|
2739
2336
|
this.UserInput.setSelected = setSelected;
|
|
2740
2337
|
this.UserInput.deselectAll = deselectAll;
|
|
2741
2338
|
this.UserInput.views = views;
|
|
2742
|
-
this.outlineExpand = outlineExpand;
|
|
2339
|
+
this.outlineExpand = outlineExpand;
|
|
2340
|
+
|
|
2341
|
+
// this.panes = panes; // Allow external panes to register
|
|
2743
2342
|
|
|
2744
2343
|
return this;
|
|
2745
2344
|
} // END OF OUTLINE
|