solid-panes 3.5.27 → 3.5.28-59efa615

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