solid-panes 3.5.21 → 3.5.22-1138b2aa

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 (312) hide show
  1. package/.babelrc +0 -0
  2. package/.eslintignore +0 -0
  3. package/.eslintrc +1 -1
  4. package/.github/workflows/ci.yml +0 -1
  5. package/.nvmrc +1 -1
  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 -0
  10. package/dev/index.html +0 -0
  11. package/dev/loader.ts +1 -1
  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 +4 -4
  16. package/jest.setup.ts +0 -0
  17. package/lib/RDFXMLPane.js +0 -0
  18. package/lib/RDFXMLPane.js.map +0 -0
  19. package/lib/argument/argumentPane.js +0 -0
  20. package/lib/argument/argumentPane.js.map +0 -0
  21. package/lib/attach/attachPane.js +0 -0
  22. package/lib/attach/attachPane.js.map +0 -0
  23. package/lib/audio/audioPane.js +0 -0
  24. package/lib/audio/audioPane.js.map +0 -0
  25. package/lib/classInstancePane.js +0 -0
  26. package/lib/classInstancePane.js.map +0 -0
  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 +0 -0
  30. package/lib/dashboard/basicPreferences.js.map +0 -0
  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 +0 -0
  34. package/lib/dashboard/dashboardPane.js.map +0 -0
  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 +0 -0
  38. package/lib/dashboard/homepage.js.map +0 -0
  39. package/lib/dataContentPane.js +0 -0
  40. package/lib/dataContentPane.js.map +0 -0
  41. package/lib/defaultPane.js +0 -0
  42. package/lib/defaultPane.js.map +0 -0
  43. package/lib/dokieli/dokieliPane.js +0 -0
  44. package/lib/dokieli/dokieliPane.js.map +0 -0
  45. package/lib/dokieli/new.js +0 -0
  46. package/lib/dokieli/new.js.map +0 -0
  47. package/lib/form/pane.js +0 -0
  48. package/lib/form/pane.js.map +0 -0
  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 +0 -0
  54. package/lib/home/homePane.js.map +0 -0
  55. package/lib/humanReadablePane.js +0 -0
  56. package/lib/humanReadablePane.js.map +0 -0
  57. package/lib/imagePane.js +0 -0
  58. package/lib/imagePane.js.map +0 -0
  59. package/lib/index.d.ts +0 -0
  60. package/lib/index.d.ts.map +0 -0
  61. package/lib/index.js +0 -0
  62. package/lib/index.js.map +0 -0
  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 +0 -0
  66. package/lib/internal/internalPane.js.map +0 -0
  67. package/lib/mainPage/footer.d.ts +2 -2
  68. package/lib/mainPage/footer.d.ts.map +1 -1
  69. package/lib/mainPage/footer.js +0 -0
  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 +0 -0
  74. package/lib/mainPage/header.js.map +0 -0
  75. package/lib/mainPage/index.d.ts +2 -2
  76. package/lib/mainPage/index.d.ts.map +1 -1
  77. package/lib/mainPage/index.js +0 -0
  78. package/lib/mainPage/index.js.map +1 -1
  79. package/lib/microblogPane/microblogPane.js +0 -0
  80. package/lib/microblogPane/microblogPane.js.map +0 -0
  81. package/lib/n3Pane.js +0 -0
  82. package/lib/n3Pane.js.map +0 -0
  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 -0
  86. package/lib/outline/context.js.map +0 -0
  87. package/lib/outline/licenseOptions.js +0 -0
  88. package/lib/outline/licenseOptions.js.map +0 -0
  89. package/lib/outline/manager.js +37 -80
  90. package/lib/outline/manager.js.map +1 -1
  91. package/lib/outline/manager.test.js +0 -0
  92. package/lib/outline/manager.test.js.map +0 -0
  93. package/lib/outline/outlineIcons.js +0 -0
  94. package/lib/outline/outlineIcons.js.map +0 -0
  95. package/lib/outline/propertyViews.d.ts +0 -0
  96. package/lib/outline/propertyViews.d.ts.map +0 -0
  97. package/lib/outline/propertyViews.js +0 -0
  98. package/lib/outline/propertyViews.js.map +0 -0
  99. package/lib/outline/propertyViews.test.js +0 -0
  100. package/lib/outline/propertyViews.test.js.map +0 -0
  101. package/lib/outline/queryByExample.js +0 -0
  102. package/lib/outline/queryByExample.js.map +0 -0
  103. package/lib/outline/userInput.js +0 -0
  104. package/lib/outline/userInput.js.map +0 -0
  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 -0
  108. package/lib/outline/viewAsImage.js.map +0 -0
  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 +0 -0
  112. package/lib/outline/viewAsMbox.js.map +0 -0
  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 +0 -0
  116. package/lib/pad/padPane.js.map +0 -0
  117. package/lib/playlist/playlistPane.js +0 -0
  118. package/lib/playlist/playlistPane.js.map +0 -0
  119. package/lib/profile/editProfile.view.d.ts +0 -0
  120. package/lib/profile/editProfile.view.d.ts.map +0 -0
  121. package/lib/profile/editProfile.view.js +0 -0
  122. package/lib/profile/editProfile.view.js.map +0 -0
  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 -0
  126. package/lib/profile/profile.dom.js.map +0 -0
  127. package/lib/registerPanes.js +0 -0
  128. package/lib/registerPanes.js.map +0 -0
  129. package/lib/schedule/formsForSchedule.js +0 -0
  130. package/lib/schedule/formsForSchedule.js.map +0 -0
  131. package/lib/schedule/schedulePane.js +0 -0
  132. package/lib/schedule/schedulePane.js.map +0 -0
  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 +0 -0
  136. package/lib/sharing/sharingPane.js.map +0 -0
  137. package/lib/slideshow/slideshowPane.js +0 -0
  138. package/lib/slideshow/slideshowPane.js.map +0 -0
  139. package/lib/socialPane.js +0 -0
  140. package/lib/socialPane.js.map +0 -0
  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 +0 -0
  144. package/lib/tabbed/tabbedPane.js.map +0 -0
  145. package/lib/tableViewPane.js +0 -0
  146. package/lib/tableViewPane.js.map +0 -0
  147. package/lib/test-import-export/common.js +0 -0
  148. package/lib/test-import-export/common.js.map +0 -0
  149. package/lib/test-import-export/edit-importer.js +0 -0
  150. package/lib/test-import-export/edit-importer.js.map +0 -0
  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 +0 -0
  154. package/lib/transaction/pane.js.map +0 -0
  155. package/lib/transaction/period.js +0 -0
  156. package/lib/transaction/period.js.map +0 -0
  157. package/lib/trip/tripPane.js +0 -0
  158. package/lib/trip/tripPane.js.map +0 -0
  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 +0 -0
  162. package/lib/trustedApplications/trustedApplications.dom.js.map +0 -0
  163. package/lib/trustedApplications/trustedApplications.test.js +0 -0
  164. package/lib/trustedApplications/trustedApplications.test.js.map +0 -0
  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 +0 -0
  168. package/lib/trustedApplications/trustedApplications.utils.js.map +0 -0
  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 +0 -0
  172. package/lib/trustedApplications/trustedApplications.view.js.map +0 -0
  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 +0 -0
  178. package/lib/ui/pane.js.map +0 -0
  179. package/lib/versionInfo.d.ts +0 -0
  180. package/lib/versionInfo.d.ts.map +1 -1
  181. package/lib/versionInfo.js +14 -14
  182. package/lib/versionInfo.js.map +1 -1
  183. package/lib/video/videoPane.js +0 -0
  184. package/lib/video/videoPane.js.map +0 -0
  185. package/package.json +36 -43
  186. package/src/RDFXMLPane.js +0 -0
  187. package/src/argument/argumentPane.js +0 -0
  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 +0 -0
  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 +0 -0
  196. package/src/chatPreferencesForm.ttl +0 -0
  197. package/src/classInstancePane.js +0 -0
  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 +0 -0
  210. package/src/defaultPane.js +0 -0
  211. package/src/dokieli/Makefile +0 -0
  212. package/src/dokieli/dokieliPane.js +0 -0
  213. package/src/dokieli/new.html +0 -0
  214. package/src/dokieli/new.js +0 -0
  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 +0 -0
  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 +0 -0
  225. package/src/index.ts +0 -0
  226. package/src/internal/internalPane.ts +0 -0
  227. package/src/mainPage/footer.ts +2 -2
  228. package/src/mainPage/header.ts +0 -0
  229. package/src/mainPage/index.ts +2 -2
  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 +0 -0
  248. package/src/n3Pane.js +0 -0
  249. package/src/outline/context.ts +0 -0
  250. package/src/outline/licenseOptions.js +0 -0
  251. package/src/outline/manager.js +6 -55
  252. package/src/outline/manager.test.ts +0 -0
  253. package/src/outline/outlineIcons.js +0 -0
  254. package/src/outline/propertyViews.test.ts +0 -0
  255. package/src/outline/propertyViews.ts +0 -0
  256. package/src/outline/queryByExample.js +0 -0
  257. package/src/outline/userInput.js +0 -0
  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 +0 -0
  266. package/src/profile/editProfile.view.ts +0 -0
  267. package/src/profile/profile.dom.ts +0 -0
  268. package/src/profile/profileFormText.ttl +0 -0
  269. package/src/registerPanes.js +0 -0
  270. package/src/schedule/Makefile +0 -0
  271. package/src/schedule/formsForSchedule.js +0 -0
  272. package/src/schedule/formsForSchedule.ttl +0 -0
  273. package/src/schedule/schedulePane.js +0 -0
  274. package/src/sharing/sharingPane.ts +0 -0
  275. package/src/slideshow/slideshowPane.js +0 -0
  276. package/src/socialPane.js +0 -0
  277. package/src/style/tabbedtab.css +0 -0
  278. package/src/tabbed/tabbedPane.ts +0 -0
  279. package/src/tableViewPane.js +0 -0
  280. package/src/test-import-export/common.js +0 -0
  281. package/src/test-import-export/edit-importer.js +0 -0
  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 +0 -0
  287. package/src/transaction/period.js +0 -0
  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 +0 -0
  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 +0 -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 +0 -0
  302. package/src/versionInfo.ts +16 -16
  303. package/src/video/videoPane.js +0 -0
  304. package/timestamp.sh +0 -0
  305. package/travis/bumpversion.js +0 -0
  306. package/tsconfig.json +1 -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 +2 -9
  310. package/lib/outline/dragDrop.js +0 -406
  311. package/lib/outline/dragDrop.js.map +0 -1
  312. package/src/outline/dragDrop.js +0 -444
@@ -1,444 +0,0 @@
1
- /* istanbul ignore file */
2
- /**
3
- This is for outliner features that only work in the extension version, say drag and drop.
4
- I am always happy creating new files.
5
- 2007.07.11 kennyluck
6
- 2017: Todo: Repace the old Firefox specific code with HTML5 standard code - timbl
7
- **/
8
- // Firefox internals:
9
- /* global Components TransferData TransferDataSet FlavourSet nsTransferable transferUtils */
10
-
11
- // #includedIn chrome://tabulator/tabulator.xul
12
- // #require_once chrome://global/nsDragAndDrop.js
13
-
14
- /* alert(gBrowser);alert(gBrowser.tagName)
15
- if (!tabulator_gBrowser) {
16
- var tabulator_wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
17
- .getService(Components.interfaces.nsIWindowMediator)
18
- var tabulator_gBrowser = tabulator_wm.getMostRecentWindow("navigator:browser")
19
- }
20
- */
21
-
22
- /* 2007: adapted from dragAndDrop UI Library */
23
- import { store } from 'solid-logic'
24
- import * as UI from 'solid-ui'
25
- import * as $rdf from 'rdflib'
26
-
27
- const dragAndDrop = (module.exports = {})
28
-
29
- dragAndDrop.util = {}
30
- dragAndDrop.util.Event = (function () {
31
- const listeners = []
32
- return {
33
- on: function (el, sType, fn, obj, fnId /* ,override */) {
34
- const wrappedFn = function (e) {
35
- return fn.call(obj, e, obj)
36
- }
37
- el.addEventListener(sType, wrappedFn, false)
38
- const li = [el, sType, fnId, wrappedFn]
39
- listeners.push(li)
40
- },
41
- off: function (el, sType, fnId) {
42
- // removeListener, fnId to identify a function
43
- const index = this._getCacheIndex(el, sType, fnId)
44
- if (index === -1) return false
45
- const cacheItem = listeners[index]
46
- el.removeEventListener(sType, cacheItem[this.WFN], false)
47
-
48
- delete listeners[index][this.WFN]
49
- delete listeners[index][this.FN]
50
- listeners.splice(index, 1)
51
- return true
52
- },
53
- EL: 0,
54
- TYPE: 1,
55
- FNID: 2,
56
- WFN: 3,
57
- _getCacheIndex: function (el, sType, fnId) {
58
- for (let i = 0, len = listeners.length; i < len; ++i) {
59
- const li = listeners[i]
60
- if (
61
- li &&
62
- li[this.FNID] === fnId &&
63
- li[this.EL] === el &&
64
- li[this.TYPE] === sType
65
- ) {
66
- return i
67
- }
68
- }
69
-
70
- return -1
71
- }
72
- }
73
- })()
74
- dragAndDrop.util.DDExternalProxy = function DDExternalProxy (el) {
75
- this.initTarget(el)
76
- // dragAndDrop.util.Event.on(this.el, "mousedown", this.handleMouseDown, this, 'dragMouseDown'/*, true*/)
77
- }
78
- // dragAndDrop.util.DDExternalProxy extends dragAndDrop.utilDDProxy
79
- dragAndDrop.util.DDExternalProxy.prototype = {
80
- initTarget: function (el) {
81
- // create a local reference to the drag and drop manager
82
- this.DDM = dragAndDrop.util.DDM
83
-
84
- // set the el
85
- this.el = el
86
-
87
- /*
88
- // We don't want to register this as the handle with the manager
89
- // so we just set the id rather than calling the setter.
90
- this.handleElId = id
91
-
92
- Event.onAvailable(id, this.handleOnAvailable, this, true)
93
- */
94
-
95
- // the linked element is the element that gets dragged by default
96
- // this.setDragElId(id)
97
-
98
- // by default, clicked anchors will not start drag operations.
99
- // @TODO what else should be here? Probably form fields.
100
- // this.invalidHandleTypes = { A: "A" }
101
- // this.invalidHandleIds = {}
102
- // this.invalidHandleClasses = []
103
-
104
- // this.applyConfig()
105
- },
106
- b4StartDrag: function (x, y) {
107
- // show the drag frame
108
- // this.logger.log("start drag show frame, x: " + x + ", y: " + y)
109
- // alert("test startDrag")
110
- TabulatorOutlinerObserver.onDragStart(x, y, this.el)
111
- // this.showFrame(x, y)
112
- },
113
- b4Drag: function (_e) {
114
- // this.setDragElPos(dragAndDrop.util.Event.getPageX(e),
115
- // dragAndDrop.util.Event.getPageY(e))
116
- },
117
- handleMouseDown: function (e, _oDD) {
118
- const button = e.which || e.button
119
- if (button > 1) return
120
-
121
- // firing the mousedown events prior to calculating positions
122
- // this.b4MouseDown(e)
123
- // this.onMouseDown(e)
124
-
125
- // this.DDM.refreshCache(this.groups)
126
- // var self = this
127
- // setTimeout( function() { self.DDM.refreshCache(self.groups); }, 0)
128
-
129
- // Only process the event if we really clicked within the linked
130
- // element. The reason we make this check is that in the case that
131
- // another element was moved between the clicked element and the
132
- // cursor in the time between the mousedown and mouseup events. When
133
- // this happens, the element gets the next mousedown event
134
- // regardless of where on the screen it happened.
135
- // var pt = new dragAndDrop.util.Point(Event.getPageX(e), Event.getPageY(e))
136
- // if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) ) {
137
- // this.logger.log("Click was not over the element: " + this.id)
138
- // } else {
139
- // if (this.clickValidator(e)) {
140
-
141
- // set the initial element position
142
- // this.setStartPosition()
143
-
144
- // start tracking mousemove distance and mousedown time to
145
- // determine when to start the actual drag
146
- this.DDM.handleMouseDown(e, this)
147
-
148
- // this mousedown is mine
149
- // this.DDM.stopEvent(e)
150
- // } else {
151
-
152
- // this.logger.log("clickValidator returned false, drag not initiated")
153
-
154
- // }
155
- // }
156
- }
157
- }
158
-
159
- dragAndDrop.util.DDM = (function DDM () {
160
- return {
161
- handleMouseDown: function (e, oDD) {
162
- // this.currentTarget = dragAndDrop.util.Event.getTarget(e)
163
-
164
- this.dragCurrent = oDD
165
-
166
- const el = oDD.el
167
-
168
- // track start position
169
- this.startX = e.pageX
170
- this.startY = e.pageY
171
-
172
- this.deltaX = this.startX - el.offsetLeft
173
- this.deltaY = this.startY - el.offsetTop
174
-
175
- this.dragThreshMet = false
176
-
177
- // this.clickTimeout = setTimeout(
178
- // function() {
179
- // var DDM = dragAndDrop.util.DDM
180
- // DDM.startDrag(DDM.startX, DDM.startY)
181
- // },
182
- // this.clickTimeThresh )
183
- // dragAndDrop.util.Event.on(el,'mousemove',this.handleMouseMove,this,'dragMouseMove')
184
- // dragAndDrop.util.Event.on(el,'mouseup' ,this.handleMouseUp ,this,'dragMouseUp')
185
- },
186
-
187
- handleMouseMove: function (e) {
188
- // dragAndDrop.log("handlemousemove")
189
- if (!this.dragCurrent) {
190
- // dragAndDrop.log("no current drag obj")
191
- return true
192
- }
193
- // var button = e.which || e.button
194
- // dragAndDrop.log("which: " + e.which + ", button: "+ e.button)
195
-
196
- // check for IE mouseup outside of page boundary
197
- if (dragAndDrop.util.Event.isIE && !e.button) {
198
- dragAndDrop.log('button failure', 'info', 'DragDropMgr')
199
- this.stopEvent(e)
200
- return this.handleMouseUp(e)
201
- }
202
-
203
- if (!this.dragThreshMet) {
204
- const diffX = Math.abs(this.startX - e.pageX)
205
- const diffY = Math.abs(this.startY - e.pageY)
206
- // dragAndDrop.log("diffX: " + diffX + "diffY: " + diffY)
207
- if (diffX > this.clickPixelThresh || diffY > this.clickPixelThresh) {
208
- // dragAndDrop.log("pixel threshold met", "info", "DragDropMgr")
209
- this.startDrag(this.startX, this.startY)
210
- }
211
- }
212
-
213
- if (this.dragThreshMet) {
214
- // this.dragCurrent.b4Drag(e)
215
- // this.dragCurrent.onDrag(e)
216
- // this.fireEvents(e, false)
217
- }
218
-
219
- e.preventDefault()
220
- // this.stopEvent(e)
221
-
222
- return true
223
- },
224
- handleMouseUp: function (e) {
225
- if (!this.dragCurrent) return // Error...
226
- dragAndDrop.util.Event.off(
227
- this.dragCurrent.el,
228
- 'mousemove',
229
- 'dragMouseMove'
230
- )
231
- // there are two mouseup for unknown reason...
232
- dragAndDrop.util.Event.off(this.dragCurrent.el, 'mouseup', 'dragMouseUp')
233
- dragAndDrop.util.Event.off(this.dragCurrent.el, 'mouseup', 'dragMouseUp')
234
- // have to do this as attribute ondragdrop does not recognize any dragdrop event
235
- // initialized inside <tabbrowser> (strange, I think)
236
- if (this.dragThreshMet) {
237
- TabulatorOutlinerObserver.onDropInside(e.target)
238
- this.dragThreshMet = false
239
- }
240
- this.dragCurrent = null
241
- },
242
- startDrag: function (x, y) {
243
- // dragAndDrop.log("firing drag start events", "info", "DragDropMgr")
244
- // clearTimeout(this.clickTimeout)
245
- if (this.dragCurrent) {
246
- this.dragCurrent.b4StartDrag(x, y)
247
- // this.dragCurrent.startDrag(x, y)
248
- }
249
- this.dragThreshMet = true
250
- },
251
- clickPixelThresh: 3
252
- }
253
- })()
254
-
255
- // ToDos
256
- // 1.Recover normal funtionality
257
- // 2.Investigate into Gecko drag and drop
258
- // 3.Cross Tag Drag And Drop
259
- // 4.Firefox native rdf store
260
- const TabulatorOutlinerObserver = {
261
- onDrop: function (e, aXferData, _dragSession) {
262
- const selection = UI.utils.ancestor(
263
- UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
264
- 'TABLE'
265
- ).outline.selection
266
- const contentType = aXferData.flavour.contentType
267
- const url = transferUtils.retrieveURLFromData(aXferData.data, contentType)
268
- if (!url) return
269
- if (contentType === 'application/x-moz-file') {
270
- if (aXferData.data.fileSize === 0) {
271
- const templateDoc = $rdf.sym(
272
- 'chrome://tabulator/content/internalKnowledge.n3#defaultNew'
273
- )
274
- store.copyTo(templateDoc, $rdf.sym(url))
275
- /*
276
- function WriteToFileRepresentedBy (subject){
277
- var outputFormulaTerm=kb.any(subject,OWL('unionOf'))
278
- var theClass = kb.constructor.SuperClass
279
- var outputFormula= theClass.instances[kb.the(outputFormulaTerm,tabont('accesskey')).value]
280
- }
281
- */
282
- }
283
- }
284
- const targetTd = selection[0]
285
- const table = UI.utils.ancestor(
286
- UI.utils.ancestor(targetTd, 'TABLE').parentNode,
287
- 'TABLE'
288
- )
289
- const thisOutline = table.outline
290
- thisOutline.UserInput.insertTermTo(targetTd, $rdf.sym(url))
291
- },
292
-
293
- onDragEnter: function (e, _dragSession) {
294
- // enter or exit something
295
- let selection
296
- try {
297
- selection = UI.utils.ancestor(
298
- UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
299
- 'TABLE'
300
- ).outline.selection
301
- } catch (e) {
302
- /* because e.orginalTarget is not defined */ return
303
- }
304
- for (
305
- let targetTd = e.originalTarget;
306
- targetTd;
307
- targetTd = targetTd.parentNode
308
- ) {
309
- if (targetTd.tabulatorSelect) {
310
- if (selection[0]) {
311
- try {
312
- selection[0].tabulatorDeselect()
313
- } catch (e) {
314
- throw new Error(selection[0] + ' causes ' + e)
315
- }
316
- dragAndDrop.util.Event.off(targetTd, 'mouseup', 'dragMouseUp')
317
- }
318
- targetTd.tabulatorSelect()
319
- // dragAndDrop.util.Event.on(targetTd,'mouseup',this.DDM.handleMouseUp,this.DDM,'dragMouseUp')
320
- break
321
- }
322
- }
323
- },
324
-
325
- onDragExit: function (_e, _dragSession) {
326
- // if (e.originalTarget.tabulatorDeselect) e.originalTarget.tabulatorDeselect()
327
- },
328
- onDropInside: function (targetTd) {
329
- // a special case that you draganddrop totally inside a <tabbrowser>
330
- // var selection = ancestor(ancestor(targetTd,'TABLE').parentNode,'TABLE').outline.selection
331
- // var targetTd=selection[0]
332
- const table = targetTd.ownerDocument.getElementById('outline')
333
- // var table=ancestor(ancestor(targetTd,'TABLE').parentNode,'TABLE')
334
- const thisOutline = table.outline
335
- thisOutline.UserInput.insertTermTo(
336
- targetTd,
337
- UI.utils.getAbout(store, this.dragTarget)
338
- )
339
- },
340
- onDragStart: function (x, y, td) {
341
- /* seeAlso nsDragAndDrop.js::nsDragAndDrop.startDrag */
342
- // ToDo for myself: understand the connections in firefox, x, screenX
343
-
344
- this.dragTarget = td
345
- const kDSIID = Components.interfaces.nsIDragService
346
- const dragAction = {
347
- action:
348
- kDSIID.DRAGDROP_ACTION_COPY +
349
- kDSIID.DRAGDROP_ACTION_MOVE +
350
- kDSIID.DRAGDROP_ACTION_LINK
351
- }
352
-
353
- // alert(td.ownerDocument.getBoxObjectFor(td))
354
- // alert(td.ownerDocument.getBoxObjectFor(td).screenX)
355
- const tdBox = td.ownerDocument.getBoxObjectFor(td) // nsIBoxObject
356
- const region = Components.classes['@mozilla.org/gfx/region;1'].createInstance(
357
- Components.interfaces.nsIScriptableRegion
358
- )
359
- region.init() // this is important
360
- region.unionRect(tdBox.screenX, tdBox.screenY, tdBox.width, tdBox.height)
361
- let transferDataSet = { data: null }
362
- const term = UI.Util.getTerm(td)
363
- switch (term.termType) {
364
- case 'NamedNode':
365
- transferDataSet.data = this.URItoTransferDataSet(term.uri)
366
- break
367
- case 'BlankNode':
368
- transferDataSet.data = this.URItoTransferDataSet(term.toNT())
369
- break
370
- case 'Literal':
371
- transferDataSet.data = this.URItoTransferDataSet(term.value)
372
- break
373
- }
374
-
375
- transferDataSet = transferDataSet.data // quite confusing, anyway...
376
- const transArray = Components.classes[
377
- '@mozilla.org/supports-array;1'
378
- ].createInstance(Components.interfaces.nsISupportsArray)
379
- const trans = nsTransferable.set(transferDataSet.dataList[0])
380
- transArray.AppendElement(
381
- trans.QueryInterface(Components.interfaces.nsISupports)
382
- )
383
- this.mDragService.invokeDragSession(
384
- td,
385
- transArray,
386
- region,
387
- dragAction.action
388
- )
389
- },
390
- /*
391
- onDragStart: function(aEvent,aXferData,aDragAction){
392
- var dragTarget=ancestor(aEvent.target,'TD')
393
- //var nt=dragTarget.getAttribute('about')
394
- //ToDo:text terms
395
- var term=getAbout(kb,dragTarget)
396
- aXferData.data = this.URItoTransferDataSet(term.uri)
397
- alert("start")
398
- },
399
- */
400
-
401
- getSupportedFlavours: function () {
402
- const flavourSet = new FlavourSet()
403
- // flavourSet.appendFlavour("text/rdfitem")
404
- // flavourSet.appendFlavour("moz/rdfitem")
405
- flavourSet.appendFlavour('text/x-moz-url')
406
- flavourSet.appendFlavour('text/unicode')
407
- flavourSet.appendFlavour('application/x-moz-file', 'nsIFile')
408
- return flavourSet
409
- },
410
-
411
- URItoTransferDataSet: function (uri) {
412
- const dataSet = new TransferDataSet()
413
- const data = new TransferData()
414
- data.addDataForFlavour('text/x-moz-url', uri)
415
- data.addDataForFlavour('text/unicode', uri)
416
- dataSet.push(data)
417
- return dataSet
418
- },
419
- _mDS: null,
420
- get_mDragService: function () {
421
- // some syntax I don't understand -- was get mDragService()
422
- if (!this._mDS) {
423
- const kDSContractID = '@mozilla.org/widget/dragservice;1'
424
- const kDSIID = Components.interfaces.nsIDragService
425
- this._mDS = Components.classes[kDSContractID].getService(kDSIID)
426
- }
427
- return this._mDS
428
- },
429
- DDM: dragAndDrop.util.DDM
430
- }
431
- /*
432
- var ondraging=false; //global variable indicating whether ondraging (better choice?)
433
- var testGlobal = function test(e){alert(e.originalTarget);e.originalTarget.className='selected';e.preventDefault();}
434
- var activateDrag = function (e){
435
- if (!ondraging){
436
- alert('activate test')
437
- ondraging=true
438
- }
439
- }
440
- */
441
- // tabulator_gBrowser.setAttribute('ondragdrop','testGlobal(event)')
442
- // tabulator_gBrowser.setAttribute('ondragenter','activateDrag(event)')
443
-
444
- // gBrowser.addEventListener('dragdrop',test,true)