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