solid-panes 3.7.3 → 4.0.0-2fdba5cd

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 (379) hide show
  1. package/dist/RDFXMLPane.js +59 -0
  2. package/dist/RDFXMLPane.js.map +1 -0
  3. package/{lib → dist}/argument/argumentPane.js +14 -15
  4. package/dist/argument/argumentPane.js.map +1 -0
  5. package/{lib → dist}/attach/attachPane.js +83 -93
  6. package/dist/attach/attachPane.js.map +1 -0
  7. package/{lib → dist}/audio/audioPane.js +49 -50
  8. package/dist/audio/audioPane.js.map +1 -0
  9. package/{lib → dist}/classInstancePane.js +23 -24
  10. package/dist/classInstancePane.js.map +1 -0
  11. package/dist/dashboard/basicPreferences.js +147 -0
  12. package/dist/dashboard/basicPreferences.js.map +1 -0
  13. package/{lib → dist}/dashboard/dashboardPane.js +17 -21
  14. package/dist/dashboard/dashboardPane.js.map +1 -0
  15. package/dist/dashboard/homepage.js +54 -0
  16. package/dist/dashboard/homepage.js.map +1 -0
  17. package/{lib → dist}/dataContentPane.js +64 -63
  18. package/dist/dataContentPane.js.map +1 -0
  19. package/{lib → dist}/defaultPane.js +15 -16
  20. package/dist/defaultPane.js.map +1 -0
  21. package/{lib → dist}/dokieli/dokieliPane.js +49 -53
  22. package/dist/dokieli/dokieliPane.js.map +1 -0
  23. package/{src → dist}/dokieli/new.js +9 -3
  24. package/dist/dokieli/new.js.map +1 -0
  25. package/{lib → dist}/form/pane.js +44 -45
  26. package/dist/form/pane.js.map +1 -0
  27. package/dist/home/homePane.js +73 -0
  28. package/dist/home/homePane.js.map +1 -0
  29. package/dist/humanReadablePane.js +135 -0
  30. package/dist/humanReadablePane.js.map +1 -0
  31. package/dist/imagePane.js +70 -0
  32. package/dist/imagePane.js.map +1 -0
  33. package/{lib → dist}/index.js +17 -20
  34. package/dist/index.js.map +1 -0
  35. package/{lib → dist}/internal/internalPane.js +41 -41
  36. package/dist/internal/internalPane.js.map +1 -0
  37. package/{lib → dist}/mainPage/footer.js +2 -2
  38. package/{lib → dist}/mainPage/footer.js.map +1 -1
  39. package/dist/mainPage/header.js +86 -0
  40. package/dist/mainPage/header.js.map +1 -0
  41. package/{lib → dist}/mainPage/index.d.ts.map +1 -1
  42. package/dist/mainPage/index.js +25 -0
  43. package/dist/mainPage/index.js.map +1 -0
  44. package/{lib → dist}/microblogPane/microblogPane.js +270 -270
  45. package/dist/microblogPane/microblogPane.js.map +1 -0
  46. package/dist/n3Pane.js +57 -0
  47. package/dist/n3Pane.js.map +1 -0
  48. package/{lib → dist}/outline/context.js +4 -4
  49. package/{lib → dist}/outline/context.js.map +1 -1
  50. package/dist/outline/manager.js +1997 -0
  51. package/dist/outline/manager.js.map +1 -0
  52. package/{lib → dist}/outline/outlineIcons.js +2 -3
  53. package/dist/outline/outlineIcons.js.map +1 -0
  54. package/{lib → dist}/outline/propertyViews.js +4 -4
  55. package/dist/outline/propertyViews.js.map +1 -0
  56. package/{lib → dist}/outline/queryByExample.js +33 -33
  57. package/dist/outline/queryByExample.js.map +1 -0
  58. package/{lib → dist}/outline/userInput.js +268 -266
  59. package/dist/outline/userInput.js.map +1 -0
  60. package/dist/outline/viewAsImage.js +15 -0
  61. package/dist/outline/viewAsImage.js.map +1 -0
  62. package/dist/outline/viewAsMbox.js +22 -0
  63. package/dist/outline/viewAsMbox.js.map +1 -0
  64. package/{lib → dist}/pad/padPane.js +90 -96
  65. package/dist/pad/padPane.js.map +1 -0
  66. package/{lib → dist}/playlist/playlistPane.js +36 -37
  67. package/dist/playlist/playlistPane.js.map +1 -0
  68. package/{lib → dist}/registerPanes.js +29 -29
  69. package/dist/registerPanes.js.map +1 -0
  70. package/{lib → dist}/schedule/schedulePane.js +171 -178
  71. package/dist/schedule/schedulePane.js.map +1 -0
  72. package/{lib → dist}/sharing/sharingPane.js +12 -12
  73. package/dist/sharing/sharingPane.js.map +1 -0
  74. package/dist/slideshow/slideshowPane.js +80 -0
  75. package/dist/slideshow/slideshowPane.js.map +1 -0
  76. package/{lib → dist}/socialPane.js +142 -142
  77. package/dist/socialPane.js.map +1 -0
  78. package/dist/tabbed/tabbedPane.js +58 -0
  79. package/dist/tabbed/tabbedPane.js.map +1 -0
  80. package/{lib → dist}/tableViewPane.js +8 -9
  81. package/dist/tableViewPane.js.map +1 -0
  82. package/{lib → dist}/transaction/pane.js +117 -118
  83. package/dist/transaction/pane.js.map +1 -0
  84. package/{lib → dist}/transaction/period.js +82 -83
  85. package/dist/transaction/period.js.map +1 -0
  86. package/{lib → dist}/trip/tripPane.js +47 -48
  87. package/dist/trip/tripPane.js.map +1 -0
  88. package/dist/trustedApplications/trustedApplications.dom.js +146 -0
  89. package/dist/trustedApplications/trustedApplications.dom.js.map +1 -0
  90. package/dist/trustedApplications/trustedApplications.utils.js +24 -0
  91. package/dist/trustedApplications/trustedApplications.utils.js.map +1 -0
  92. package/dist/trustedApplications/trustedApplications.view.js +56 -0
  93. package/dist/trustedApplications/trustedApplications.view.js.map +1 -0
  94. package/{lib → dist}/ui/pane.js +30 -31
  95. package/dist/ui/pane.js.map +1 -0
  96. package/dist/versionInfo.js +37 -0
  97. package/dist/versionInfo.js.map +1 -0
  98. package/dist/video/videoPane.js +43 -0
  99. package/dist/video/videoPane.js.map +1 -0
  100. package/package.json +47 -41
  101. package/Documentation/VisualLanguage.html +0 -538
  102. package/Documentation/conventions.md +0 -333
  103. package/coverage/clover.xml +0 -152
  104. package/coverage/coverage-final.json +0 -6
  105. package/coverage/lcov-report/base.css +0 -224
  106. package/coverage/lcov-report/block-navigation.js +0 -87
  107. package/coverage/lcov-report/favicon.png +0 -0
  108. package/coverage/lcov-report/index.html +0 -131
  109. package/coverage/lcov-report/outline/index.html +0 -161
  110. package/coverage/lcov-report/outline/outlineIcons.js.html +0 -565
  111. package/coverage/lcov-report/outline/propertyViews.ts.html +0 -196
  112. package/coverage/lcov-report/outline/viewAsImage.ts.html +0 -121
  113. package/coverage/lcov-report/outline/viewAsMbox.ts.html +0 -127
  114. package/coverage/lcov-report/prettify.css +0 -1
  115. package/coverage/lcov-report/prettify.js +0 -2
  116. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  117. package/coverage/lcov-report/sorter.js +0 -210
  118. package/coverage/lcov-report/trustedApplications/index.html +0 -116
  119. package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +0 -238
  120. package/coverage/lcov.info +0 -204
  121. package/dev/index.html +0 -28
  122. package/dev/loader.ts +0 -91
  123. package/dev/pane/index.ts +0 -10
  124. package/doc/images/panes-for-classes.epgz +0 -0
  125. package/doc/images/panes-for-classes.svg +0 -609
  126. package/eslint.config.mjs +0 -34
  127. package/jest.config.js +0 -27
  128. package/jest.setup.ts +0 -4
  129. package/lib/RDFXMLPane.js +0 -59
  130. package/lib/RDFXMLPane.js.map +0 -1
  131. package/lib/argument/argumentPane.js.map +0 -1
  132. package/lib/attach/attachPane.js.map +0 -1
  133. package/lib/audio/audioPane.js.map +0 -1
  134. package/lib/classInstancePane.js.map +0 -1
  135. package/lib/dashboard/basicPreferences.js +0 -229
  136. package/lib/dashboard/basicPreferences.js.map +0 -1
  137. package/lib/dashboard/dashboardPane.js.map +0 -1
  138. package/lib/dashboard/homepage.js +0 -86
  139. package/lib/dashboard/homepage.js.map +0 -1
  140. package/lib/dataContentPane.js.map +0 -1
  141. package/lib/defaultPane.js.map +0 -1
  142. package/lib/dokieli/dokieliPane.js.map +0 -1
  143. package/lib/dokieli/new.js +0 -9
  144. package/lib/dokieli/new.js.map +0 -1
  145. package/lib/form/pane.js.map +0 -1
  146. package/lib/global.d.js +0 -2
  147. package/lib/global.d.js.map +0 -1
  148. package/lib/home/homePane.js +0 -91
  149. package/lib/home/homePane.js.map +0 -1
  150. package/lib/humanReadablePane.js +0 -138
  151. package/lib/humanReadablePane.js.map +0 -1
  152. package/lib/imagePane.js +0 -71
  153. package/lib/imagePane.js.map +0 -1
  154. package/lib/index.js.map +0 -1
  155. package/lib/internal/internalPane.js.map +0 -1
  156. package/lib/mainPage/header.js +0 -152
  157. package/lib/mainPage/header.js.map +0 -1
  158. package/lib/mainPage/index.js +0 -42
  159. package/lib/mainPage/index.js.map +0 -1
  160. package/lib/microblogPane/microblogPane.js.map +0 -1
  161. package/lib/n3Pane.js +0 -57
  162. package/lib/n3Pane.js.map +0 -1
  163. package/lib/outline/manager.js +0 -2264
  164. package/lib/outline/manager.js.map +0 -1
  165. package/lib/outline/manager.test.d.ts +0 -2
  166. package/lib/outline/manager.test.d.ts.map +0 -1
  167. package/lib/outline/manager.test.js +0 -210
  168. package/lib/outline/manager.test.js.map +0 -1
  169. package/lib/outline/outlineIcons.js.map +0 -1
  170. package/lib/outline/propertyViews.js.map +0 -1
  171. package/lib/outline/propertyViews.test.d.ts +0 -2
  172. package/lib/outline/propertyViews.test.d.ts.map +0 -1
  173. package/lib/outline/propertyViews.test.js +0 -27
  174. package/lib/outline/propertyViews.test.js.map +0 -1
  175. package/lib/outline/queryByExample.js.map +0 -1
  176. package/lib/outline/userInput.js.map +0 -1
  177. package/lib/outline/viewAsImage.js +0 -17
  178. package/lib/outline/viewAsImage.js.map +0 -1
  179. package/lib/outline/viewAsMbox.js +0 -23
  180. package/lib/outline/viewAsMbox.js.map +0 -1
  181. package/lib/pad/padPane.js.map +0 -1
  182. package/lib/playlist/playlistPane.js.map +0 -1
  183. package/lib/registerPanes.js.map +0 -1
  184. package/lib/schedule/formsForSchedule.js +0 -8
  185. package/lib/schedule/formsForSchedule.js.map +0 -1
  186. package/lib/schedule/schedulePane.js.map +0 -1
  187. package/lib/sharing/sharingPane.js.map +0 -1
  188. package/lib/slideshow/slideshowPane.js +0 -84
  189. package/lib/slideshow/slideshowPane.js.map +0 -1
  190. package/lib/socialPane.js.map +0 -1
  191. package/lib/tabbed/tabbedPane.js +0 -72
  192. package/lib/tabbed/tabbedPane.js.map +0 -1
  193. package/lib/tableViewPane.js.map +0 -1
  194. package/lib/test-import-export/common.js +0 -12
  195. package/lib/test-import-export/common.js.map +0 -1
  196. package/lib/test-import-export/edit-importer.js +0 -25
  197. package/lib/test-import-export/edit-importer.js.map +0 -1
  198. package/lib/test-import-export/testImportExport.js +0 -2
  199. package/lib/test-import-export/testImportExport.js.map +0 -1
  200. package/lib/transaction/pane.js.map +0 -1
  201. package/lib/transaction/period.js.map +0 -1
  202. package/lib/trip/tripPane.js.map +0 -1
  203. package/lib/trustedApplications/trustedApplications.dom.js +0 -177
  204. package/lib/trustedApplications/trustedApplications.dom.js.map +0 -1
  205. package/lib/trustedApplications/trustedApplications.test.d.ts +0 -2
  206. package/lib/trustedApplications/trustedApplications.test.d.ts.map +0 -1
  207. package/lib/trustedApplications/trustedApplications.test.js +0 -64
  208. package/lib/trustedApplications/trustedApplications.test.js.map +0 -1
  209. package/lib/trustedApplications/trustedApplications.utils.js +0 -34
  210. package/lib/trustedApplications/trustedApplications.utils.js.map +0 -1
  211. package/lib/trustedApplications/trustedApplications.view.js +0 -87
  212. package/lib/trustedApplications/trustedApplications.view.js.map +0 -1
  213. package/lib/types.d.ts +0 -30
  214. package/lib/types.d.ts.map +0 -1
  215. package/lib/types.js +0 -6
  216. package/lib/types.js.map +0 -1
  217. package/lib/ui/pane.js.map +0 -1
  218. package/lib/versionInfo.d.ts +0 -32
  219. package/lib/versionInfo.d.ts.map +0 -1
  220. package/lib/versionInfo.js +0 -37
  221. package/lib/versionInfo.js.map +0 -1
  222. package/lib/video/videoPane.js +0 -44
  223. package/lib/video/videoPane.js.map +0 -1
  224. package/src/RDFXMLPane.js +0 -60
  225. package/src/argument/argumentPane.js +0 -65
  226. package/src/argument/argument_icon_v04.jpg +0 -0
  227. package/src/argument/icon_argument.png +0 -0
  228. package/src/argument/transparentyingyang.png +0 -0
  229. package/src/attach/attachPane.js +0 -508
  230. package/src/attach/tbl-paperclip-128.png +0 -0
  231. package/src/attach/tbl-paperclip-22.png +0 -0
  232. package/src/attach/tbl-paperclip-22a.png +0 -0
  233. package/src/audio/audioPane.js +0 -197
  234. package/src/chatPreferencesForm.ttl +0 -12
  235. package/src/classInstancePane.js +0 -110
  236. package/src/dashboard/basicPreferences.ts +0 -201
  237. package/src/dashboard/dashboardPane.ts +0 -83
  238. package/src/dashboard/homepage.ts +0 -72
  239. package/src/dashboard/languages/codes.html +0 -8611
  240. package/src/dashboard/languages/codes.xml +0 -3563
  241. package/src/dashboard/languages/codes2.txt +0 -170
  242. package/src/dashboard/languages/foo +0 -70
  243. package/src/dashboard/languages/foo.ttl +0 -0
  244. package/src/dashboard/languages/get-language-names.sh +0 -12
  245. package/src/dashboard/ontologyData.ttl +0 -35
  246. package/src/dashboard/preferencesFormText.ttl +0 -18
  247. package/src/dataContentPane.js +0 -290
  248. package/src/defaultPane.js +0 -102
  249. package/src/dokieli/Makefile +0 -6
  250. package/src/dokieli/dokieliPane.js +0 -190
  251. package/src/dokieli/new.html +0 -30
  252. package/src/form/form-22.png +0 -0
  253. package/src/form/form-b-22.png +0 -0
  254. package/src/form/form.graffle +0 -0
  255. package/src/form/form.png +0 -0
  256. package/src/form/pane.js +0 -217
  257. package/src/form/psuedocode-notes.txt +0 -57
  258. package/src/global.d.ts +0 -4
  259. package/src/home/homePane.ts +0 -72
  260. package/src/humanReadablePane.js +0 -150
  261. package/src/imagePane.js +0 -75
  262. package/src/index.ts +0 -71
  263. package/src/internal/internalPane.ts +0 -263
  264. package/src/mainPage/footer.ts +0 -19
  265. package/src/mainPage/header.ts +0 -79
  266. package/src/mainPage/index.ts +0 -20
  267. package/src/meeting/Makefile +0 -3
  268. package/src/meeting/test/meeting1/Actions/actions.ttl +0 -14
  269. package/src/meeting/test/meeting1/Actions/config.ttl +0 -16
  270. package/src/meeting/test/meeting1/Actions/state.ttl +0 -30
  271. package/src/meeting/test/meeting1/Schedule/details.ttl +0 -34
  272. package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -20
  273. package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -75
  274. package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -20
  275. package/src/meeting/test/meeting1/Schedule/index.html +0 -72
  276. package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -20
  277. package/src/meeting/test/meeting1/Schedule/results.ttl +0 -15
  278. package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -20
  279. package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -23
  280. package/src/meeting/test/meeting1/chat/chat.ttl +0 -1
  281. package/src/meeting/test/meeting1/details.ttl +0 -35
  282. package/src/meeting/test/meeting1/pad/pad.ttl +0 -16
  283. package/src/microblogPane/mbStyle.css +0 -267
  284. package/src/microblogPane/microblogPane.js +0 -1412
  285. package/src/n3Pane.js +0 -56
  286. package/src/outline/context.ts +0 -21
  287. package/src/outline/manager.js +0 -2384
  288. package/src/outline/manager.test.ts +0 -189
  289. package/src/outline/outlineIcons.js +0 -160
  290. package/src/outline/propertyViews.test.ts +0 -36
  291. package/src/outline/propertyViews.ts +0 -37
  292. package/src/outline/queryByExample.js +0 -296
  293. package/src/outline/userInput.js +0 -2373
  294. package/src/outline/viewAsImage.ts +0 -12
  295. package/src/outline/viewAsMbox.ts +0 -14
  296. package/src/pad/images/ColourOff.ai +2 -872
  297. package/src/pad/images/ColourOff.png +0 -0
  298. package/src/pad/images/ColourOn.ai +1 -935
  299. package/src/pad/images/ColourOn.png +0 -0
  300. package/src/pad/padPane.ts +0 -559
  301. package/src/playlist/playlistPane.js +0 -161
  302. package/src/registerPanes.js +0 -147
  303. package/src/schedule/Makefile +0 -6
  304. package/src/schedule/formsForSchedule.js +0 -117
  305. package/src/schedule/formsForSchedule.ttl +0 -115
  306. package/src/schedule/schedulePane.js +0 -1201
  307. package/src/sharing/sharingPane.ts +0 -49
  308. package/src/slideshow/slideshowPane.js +0 -80
  309. package/src/socialPane.js +0 -523
  310. package/src/style/tabbedtab.css +0 -1347
  311. package/src/tabbed/tabbedPane.ts +0 -60
  312. package/src/tableViewPane.js +0 -51
  313. package/src/test-import-export/common.js +0 -6
  314. package/src/test-import-export/edit-importer.js +0 -20
  315. package/src/test-import-export/testImportExport.js +0 -0
  316. package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  317. package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
  318. package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  319. package/src/transaction/pane.js +0 -629
  320. package/src/transaction/period.js +0 -374
  321. package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
  322. package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
  323. package/src/trip/tripPane.js +0 -176
  324. package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -176
  325. package/src/trustedApplications/trustedApplications.dom.ts +0 -276
  326. package/src/trustedApplications/trustedApplications.test.ts +0 -82
  327. package/src/trustedApplications/trustedApplications.utils.ts +0 -51
  328. package/src/trustedApplications/trustedApplications.view.ts +0 -80
  329. package/src/types.ts +0 -34
  330. package/src/ui/22-builder.png +0 -0
  331. package/src/ui/builder.graffle +0 -0
  332. package/src/ui/builder.png +0 -0
  333. package/src/ui/builder2.png +0 -0
  334. package/src/ui/pane.js +0 -226
  335. package/src/versionInfo.ts +0 -30
  336. package/src/video/videoPane.js +0 -44
  337. package/timestamp.sh +0 -13
  338. package/travis/bumpversion.js +0 -29
  339. package/tsconfig.json +0 -78
  340. package/typings/raw-loader.d.ts +0 -4
  341. package/typings/solid-namespace/index.d.ts +0 -9
  342. package/webpack.config.js +0 -41
  343. /package/{lib → dist}/dashboard/basicPreferences.d.ts +0 -0
  344. /package/{lib → dist}/dashboard/basicPreferences.d.ts.map +0 -0
  345. /package/{lib → dist}/dashboard/dashboardPane.d.ts +0 -0
  346. /package/{lib → dist}/dashboard/dashboardPane.d.ts.map +0 -0
  347. /package/{lib → dist}/dashboard/homepage.d.ts +0 -0
  348. /package/{lib → dist}/dashboard/homepage.d.ts.map +0 -0
  349. /package/{lib → dist}/home/homePane.d.ts +0 -0
  350. /package/{lib → dist}/home/homePane.d.ts.map +0 -0
  351. /package/{lib → dist}/index.d.ts +0 -0
  352. /package/{lib → dist}/index.d.ts.map +0 -0
  353. /package/{lib → dist}/internal/internalPane.d.ts +0 -0
  354. /package/{lib → dist}/internal/internalPane.d.ts.map +0 -0
  355. /package/{lib → dist}/mainPage/footer.d.ts +0 -0
  356. /package/{lib → dist}/mainPage/footer.d.ts.map +0 -0
  357. /package/{lib → dist}/mainPage/header.d.ts +0 -0
  358. /package/{lib → dist}/mainPage/header.d.ts.map +0 -0
  359. /package/{lib → dist}/mainPage/index.d.ts +0 -0
  360. /package/{lib → dist}/outline/context.d.ts +0 -0
  361. /package/{lib → dist}/outline/context.d.ts.map +0 -0
  362. /package/{lib → dist}/outline/propertyViews.d.ts +0 -0
  363. /package/{lib → dist}/outline/propertyViews.d.ts.map +0 -0
  364. /package/{lib → dist}/outline/viewAsImage.d.ts +0 -0
  365. /package/{lib → dist}/outline/viewAsImage.d.ts.map +0 -0
  366. /package/{lib → dist}/outline/viewAsMbox.d.ts +0 -0
  367. /package/{lib → dist}/outline/viewAsMbox.d.ts.map +0 -0
  368. /package/{lib → dist}/pad/padPane.d.ts +0 -0
  369. /package/{lib → dist}/pad/padPane.d.ts.map +0 -0
  370. /package/{lib → dist}/sharing/sharingPane.d.ts +0 -0
  371. /package/{lib → dist}/sharing/sharingPane.d.ts.map +0 -0
  372. /package/{lib → dist}/tabbed/tabbedPane.d.ts +0 -0
  373. /package/{lib → dist}/tabbed/tabbedPane.d.ts.map +0 -0
  374. /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts +0 -0
  375. /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
  376. /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts +0 -0
  377. /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
  378. /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts +0 -0
  379. /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
@@ -1,1412 +0,0 @@
1
- /*
2
- Microblog pane
3
- Charles McKenzie <charles2@mit.edu>
4
- */
5
- /* global alert */
6
- import { authn, store } from 'solid-logic'
7
- import * as UI from 'solid-ui'
8
-
9
- export default {
10
- icon: UI.icons.originalIconBase + 'microblog/microblog.png',
11
- name: 'microblogPane',
12
- label: function (subject) {
13
- if (store.whether(subject, UI.ns.rdf('type'), UI.ns.foaf('Person'))) {
14
- return 'Microblog'
15
- } else {
16
- return null
17
- }
18
- },
19
- render: function (s, doc) {
20
- //* **********************************************
21
- // NAMESPACES SECTION
22
- //* **********************************************
23
- const SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#')
24
- const SIOCt = UI.rdf.Namespace('http://rdfs.org/sioc/types#')
25
- const FOAF = UI.rdf.Namespace('http://xmlns.com/foaf/0.1/')
26
- const terms = UI.rdf.Namespace('http://purl.org/dc/terms/')
27
- const RDF = UI.ns.rdf
28
-
29
- const kb = store
30
- const charCount = 140
31
- const sf = store.fetcher
32
- //* **********************************************
33
- // BACK END
34
- //* **********************************************
35
- const sparqlUpdater = kb.updater
36
- // ----------------------------------------------
37
- // FOLLOW LIST
38
- // store the URIs of followed users for
39
- // dereferencing the @replies
40
- // ----------------------------------------------
41
- const FollowList = function (user) {
42
- this.userlist = {}
43
- this.uris = {}
44
- const myFollows = kb.each(kb.sym(user), SIOC('follows'))
45
- for (const mf in myFollows) {
46
- this.add(kb.any(myFollows[mf], SIOC('id')), myFollows[mf].uri)
47
- }
48
- }
49
- FollowList.prototype.add = function (user, uri) {
50
- // add a user to the follows store
51
- if (this.userlist[user]) {
52
- if (!(uri in this.uris)) {
53
- this.userlist[user].push(uri)
54
- this.uris[uri] = ''
55
- }
56
- } else {
57
- this.userlist[user] = [uri]
58
- }
59
- }
60
- FollowList.prototype.selectUser = function (user) {
61
- // check if a user is in the follows list.
62
- if (this.userlist[user]) {
63
- return [this.userlist[user].length === 1, this.userlist[user]]
64
- } else {
65
- // user does not follow any users with this nick
66
- return [false, []]
67
- }
68
- }
69
- // ----------------------------------------------
70
- // FAVORITES
71
- // controls the list of favorites.
72
- // constructor expects a user as uri.
73
- // ----------------------------------------------
74
- const Favorites = function (user) {
75
- this.favorites = {}
76
- this.favoritesURI = ''
77
- if (!user) {
78
- // TODO is this even useful?
79
- return
80
- }
81
- this.user = user.split('#')[0]
82
- const created = kb.each(kb.sym(user), SIOC('creator_of'))
83
- for (const c in created) {
84
- if (kb.whether(created[c], RDF('type'), SIOCt('FavouriteThings'))) {
85
- this.favoritesURI = created[c]
86
- const favs = kb.each(created[c], SIOC('container_of'))
87
- for (const f in favs) {
88
- this.favorites[favs[f]] = ''
89
- }
90
- break
91
- }
92
- }
93
- }
94
- Favorites.prototype.favorited = function (post) {
95
- /* Favorited- returns true if the post is a favorite
96
- false otherwise */
97
- return kb.sym(post) in this.favorites
98
- }
99
- Favorites.prototype.add = function (post, callback) {
100
- const batch = new UI.rdf.Statement(
101
- this.favoritesURI,
102
- SIOC('container_of'),
103
- kb.sym(post),
104
- kb.sym(this.user)
105
- )
106
- sparqlUpdater.insert_statement(batch, function (a, success, c) {
107
- if (success) {
108
- kb.add(batch.subject, batch.predicate, batch.object, batch.why)
109
- }
110
- callback(a, success, c)
111
- })
112
- }
113
- Favorites.prototype.remove = function (post, callback) {
114
- const batch = new UI.rdf.Statement(
115
- this.favoritesURI,
116
- SIOC('container_of'),
117
- kb.sym(post),
118
- kb.sym(this.user)
119
- )
120
- sparqlUpdater.delete_statement(batch, function (a, success, c) {
121
- if (success) {
122
- kb.add(batch.subject, batch.predicate, batch.object, batch.why)
123
- }
124
- callback(a, success, c)
125
- })
126
- }
127
- // ----------------------------------------------
128
- // MICROBLOG
129
- // store the uri's of followed users for
130
- // dereferencing the @replies.
131
- // ----------------------------------------------
132
- const Microblog = function (kb) {
133
- this.kb = kb
134
-
135
- // attempt to fetch user account from local preferences if just
136
- // in case the user's foaf was not writable. add it to the store
137
- // this will probably need to change.
138
- const theUser = authn.currentUser()
139
-
140
- if (theUser) {
141
- let theAccount = UI.preferences.get('acct')
142
-
143
- if (theAccount) {
144
- theAccount = kb.sym(theAccount)
145
- }
146
-
147
- if (theUser && theAccount) {
148
- kb.add(
149
- theUser,
150
- FOAF('holdsAccount'),
151
- theAccount,
152
- theUser.uri.split('#')[0]
153
- )
154
- }
155
- }
156
- }
157
- Microblog.prototype.getUser = function (uri) {
158
- const User = {}
159
- User.name = kb.any(uri, SIOC('name')) ? kb.any(uri, SIOC('name')) : ''
160
- User.avatar = kb.any(uri, SIOC('avatar'))
161
- ? kb.any(uri, SIOC('avatar'))
162
- : ''
163
- User.id = kb.any(uri, SIOC('id'))
164
- User.sym = uri
165
- return User
166
- }
167
-
168
- Microblog.prototype.getPost = function (uri) {
169
- const Post = {}
170
- // date ----------
171
- let postLink = new Date(kb.anyValue(uri, terms('created')))
172
- let h = postLink.getHours()
173
- const a = h > 12 ? ' PM' : ' AM'
174
- h = h > 12 ? h - 12 : h
175
- let m = postLink.getMinutes()
176
- m = m < 10 ? '0' + m : m
177
- const mo = [
178
- 'Jan',
179
- 'Feb',
180
- 'Mar',
181
- 'Apr',
182
- 'May',
183
- 'Jun',
184
- 'Jul',
185
- 'Aug',
186
- 'Sep',
187
- 'Oct',
188
- 'Nov',
189
- 'Dec'
190
- ]
191
- const da = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
192
- const ds =
193
- da[postLink.getDay()] +
194
- ' ' +
195
- postLink.getDate() +
196
- ' ' +
197
- mo[postLink.getMonth()] +
198
- ' ' +
199
- postLink.getFullYear()
200
- postLink = h + ':' + m + a + ' on ' + ds
201
- Post.date = postLink
202
- // ---------
203
- Post.mentions = ''
204
- Post.message = String(kb.any(uri, SIOC('content')))
205
- Post.creator = kb.any(uri, SIOC('has_creator'))
206
- Post.uri = ''
207
- return Post
208
- }
209
- Microblog.prototype.gen_random_uri = function (base) {
210
- // generate random uri
211
- const uriNonce = base + '#n' + Math.floor(Math.random() * 10e9)
212
- return kb.sym(uriNonce)
213
- }
214
- Microblog.prototype.statusUpdate = function (
215
- statusMsg,
216
- callback,
217
- replyTo,
218
- meta
219
- ) {
220
- const myUserURI = this.getMyURI()
221
- const myUser = kb.sym(myUserURI.split('#')[0])
222
- const newPost = this.gen_random_uri(myUser.uri)
223
- const microlist = kb.each(kb.sym(myUserURI), SIOC('creator_of'))
224
- let micro
225
- for (const microlistelement in microlist) {
226
- if (
227
- kb.whether(
228
- microlist[microlistelement],
229
- RDF('type'),
230
- SIOCt('Microblog')
231
- ) &&
232
- !kb.whether(
233
- microlist[microlistelement],
234
- SIOC('topic'),
235
- kb.sym(this.getMyURI())
236
- )
237
- ) {
238
- micro = microlist[microlistelement]
239
- break
240
- }
241
- }
242
-
243
- // generate new post
244
- const batch = [
245
- new UI.rdf.Statement(
246
- newPost,
247
- RDF('type'),
248
- SIOCt('MicroblogPost'),
249
- myUser
250
- ),
251
- new UI.rdf.Statement(
252
- newPost,
253
- SIOC('has_creator'),
254
- kb.sym(myUserURI),
255
- myUser
256
- ),
257
- new UI.rdf.Statement(newPost, SIOC('content'), statusMsg, myUser),
258
- new UI.rdf.Statement(newPost, terms('created'), new Date(), myUser),
259
- new UI.rdf.Statement(micro, SIOC('container_of'), newPost, myUser)
260
- ]
261
-
262
- // message replies
263
- if (replyTo) {
264
- batch.push(
265
- new UI.rdf.Statement(
266
- newPost,
267
- SIOC('reply_of'),
268
- kb.sym(replyTo),
269
- myUser
270
- )
271
- )
272
- }
273
-
274
- // @replies, #hashtags, !groupReplies
275
- for (const r in meta.recipients) {
276
- batch.push(
277
- new UI.rdf.Statement(
278
- newPost,
279
- SIOC('topic'),
280
- kb.sym(meta.recipients[r]),
281
- myUser
282
- )
283
- )
284
- batch.push(
285
- new UI.rdf.Statement(kb.any(), SIOC('container_of'), newPost, myUser)
286
- )
287
- const mblogs = kb.each(kb.sym(meta.recipients[r]), SIOC('creator_of'))
288
- for (const mbl in mblogs) {
289
- if (
290
- kb.whether(mblogs[mbl], SIOC('topic'), kb.sym(meta.recipients[r]))
291
- ) {
292
- const replyBatch = new UI.rdf.Statement(
293
- mblogs[mbl],
294
- SIOC('container_of'),
295
- newPost,
296
- kb.sym(meta.recipients[r].split('#')[0])
297
- )
298
- sparqlUpdater.insert_statement(replyBatch)
299
- }
300
- }
301
- }
302
-
303
- sparqlUpdater.insert_statement(batch, function (a, b, c) {
304
- callback(a, b, c, batch)
305
- })
306
- }
307
- Microblog.prototype.getMyURI = function () {
308
- const me = authn.currentUser()
309
- console.log(me)
310
- const myMicroblog = kb.any(kb.sym(me), FOAF('holdsAccount'))
311
- console.log('\n\n' + myMicroblog)
312
- return myMicroblog ? myMicroblog.uri : false
313
- }
314
- Microblog.prototype.generateNewMB = function (id, name, avatar, loc) {
315
- const host = loc + '/' + id
316
- const rememberMicroblog = function () {
317
- UI.preferences.set('acct', host + '#' + id)
318
- }
319
- const cbgenUserMB = function (a, success, c, d) {
320
- if (success) {
321
- alert(
322
- 'Microblog generated at ' +
323
- host +
324
- '#' +
325
- id +
326
- 'please add <b>' +
327
- host +
328
- '</b> to your foaf.'
329
- )
330
- // mbCancelNewMB() @@TBD
331
- // assume the foaf is not writable and store the microblog to the
332
- // preferences for later retrieval.
333
- // this will probably need to change.
334
- rememberMicroblog()
335
- for (const triple in d) {
336
- kb.add(
337
- d[triple].subject,
338
- d[triple].predicate,
339
- d[triple].object,
340
- d[triple].why
341
- )
342
- }
343
- }
344
- }
345
-
346
- const genUserMB = [
347
- // user
348
- new UI.rdf.Statement(
349
- kb.sym(host + '#' + id),
350
- RDF('type'),
351
- SIOC('User'),
352
- kb.sym(host)
353
- ),
354
- new UI.rdf.Statement(
355
- kb.sym(host + '#' + id),
356
- SIOC('creator_of'),
357
- kb.sym(host + '#mb'),
358
- kb.sym(host)
359
- ),
360
- new UI.rdf.Statement(
361
- kb.sym(host + '#' + id),
362
- SIOC('creator_of'),
363
- kb.sym(host + '#mbn'),
364
- kb.sym(host)
365
- ),
366
- new UI.rdf.Statement(
367
- kb.sym(host + '#' + id),
368
- SIOC('creator_of'),
369
- kb.sym(host + '#fav'),
370
- kb.sym(host)
371
- ),
372
- new UI.rdf.Statement(
373
- kb.sym(host + '#' + id),
374
- SIOC('name'),
375
- name,
376
- kb.sym(host)
377
- ),
378
- new UI.rdf.Statement(
379
- kb.sym(host + '#' + id),
380
- SIOC('id'),
381
- id,
382
- kb.sym(host)
383
- ),
384
- new UI.rdf.Statement(
385
- kb.sym(host + '#' + id),
386
- RDF('label'),
387
- id,
388
- kb.sym(host)
389
- ),
390
- new UI.rdf.Statement(
391
- s,
392
- FOAF('holdsAccount'),
393
- kb.sym(host + '#' + id),
394
- kb.sym(host)
395
- ),
396
- // microblog
397
- new UI.rdf.Statement(
398
- kb.sym(host + '#mb'),
399
- RDF('type'),
400
- SIOCt('Microblog'),
401
- kb.sym(host)
402
- ),
403
- new UI.rdf.Statement(
404
- kb.sym(host + '#mb'),
405
- SIOC('has_creator'),
406
- kb.sym(host + '#' + id),
407
- kb.sym(host)
408
- ),
409
- // notification microblog
410
- new UI.rdf.Statement(
411
- kb.sym(host + '#mbn'),
412
- RDF('type'),
413
- SIOCt('Microblog'),
414
- kb.sym(host)
415
- ),
416
- new UI.rdf.Statement(
417
- kb.sym(host + '#mbn'),
418
- SIOC('topic'),
419
- kb.sym(host + '#' + id),
420
- kb.sym(host)
421
- ),
422
- new UI.rdf.Statement(
423
- kb.sym(host + '#mbn'),
424
- SIOC('has_creator'),
425
- kb.sym(host + '#' + id),
426
- kb.sym(host)
427
- ),
428
- // favorites container
429
- new UI.rdf.Statement(
430
- kb.sym(host + '#fav'),
431
- RDF('type'),
432
- SIOCt('FavouriteThings'),
433
- kb.sym(host)
434
- ),
435
- new UI.rdf.Statement(
436
- kb.sym(host + '#fav'),
437
- SIOC('has_creator'),
438
- kb.sym(host + '#' + id),
439
- kb.sym(host)
440
- )
441
- ]
442
- if (avatar) {
443
- // avatar optional
444
- genUserMB.push(
445
- new UI.rdf.Statement(
446
- kb.sym(host + '#' + id),
447
- SIOC('avatar'),
448
- kb.sym(avatar),
449
- kb.sym(host)
450
- )
451
- )
452
- }
453
- sparqlUpdater.insert_statement(genUserMB, cbgenUserMB)
454
- }
455
- const mb = new Microblog(kb)
456
- const myFavorites = new Favorites(mb.getMyURI())
457
- const myFollowList = new FollowList(mb.getMyURI())
458
-
459
- //* **********************************************
460
- // FRONT END FUNCTIONALITY
461
- //* **********************************************
462
- // ----------------------------------------------
463
- // PANE
464
- // User Interface for the Microblog Pane
465
- // ----------------------------------------------
466
- const Pane = function (s, doc, microblogPane) {
467
- const TabManager = function (doc) {
468
- this.tablist = {}
469
- this.doc = doc
470
- this.tabView = doc.createElement('ul')
471
- this.tabView.className = 'tabslist'
472
- }
473
- TabManager.prototype.create = function (id, caption, view, isDefault) {
474
- const tab = this.doc.createElement('li')
475
- tab.innerHTML = caption
476
- if (isDefault) {
477
- tab.className = 'active'
478
- }
479
- tab.id = id
480
- const change = this.change
481
- const tablist = this.tablist
482
- tab.addEventListener(
483
- 'click',
484
- function (evt) {
485
- change(evt.target.id, tablist, doc)
486
- },
487
- false
488
- )
489
-
490
- this.tablist[id] = { view: view.id, tab: tab }
491
- this.tabView.appendChild(tab)
492
- }
493
- TabManager.prototype.getTabView = function () {
494
- return this.tabView
495
- }
496
- TabManager.prototype.change = function (id, tablist, doc) {
497
- for (const tab in tablist) {
498
- if (tab === id) {
499
- tablist[id].tab.className = 'active'
500
- doc.getElementById(tablist[id].view).className += ' active'
501
- } else {
502
- const view = doc.getElementById(tablist[tab].view)
503
- view.className = view.className.replace(/\w*active\w*/, '')
504
- tablist[tab].tab.className = tablist[id].tab.className.replace(
505
- /\w*active\w*/,
506
- ''
507
- )
508
- }
509
- }
510
- }
511
- this.microblogPane = microblogPane
512
- const accounts = kb.each(s, FOAF('holdsAccount'))
513
- let account
514
- for (const a in accounts) {
515
- if (
516
- kb.whether(accounts[a], RDF('type'), SIOC('User')) &&
517
- kb.whether(
518
- kb.any(accounts[a], SIOC('creator_of')),
519
- RDF('type'),
520
- SIOCt('Microblog')
521
- )
522
- ) {
523
- account = accounts[a]
524
- break
525
- }
526
- }
527
- this.Ifollow = kb.whether(kb.sym(mb.getMyURI()), SIOC('follows'), account)
528
- const resourceType = kb.any(s, RDF('type'))
529
- if (
530
- resourceType.uri === SIOCt('Microblog').uri ||
531
- resourceType.uri === SIOCt('MicroblogPost').uri
532
- ) {
533
- this.thisIsMe = kb.any(s, SIOC('has_creator')).uri === mb.getMyURI()
534
- } else if (resourceType.uri === SIOC('User').uri) {
535
- this.thisIsMe = s.uri === mb.getMyURI()
536
- } else if (resourceType.uri === FOAF('Person').uri) {
537
- const me = authn.currentUser()
538
- const meUri = me && me.uri
539
- this.thisIsMe = s.uri === meUri
540
- } else {
541
- this.thisIsMe = false
542
- }
543
-
544
- this.Tab = new TabManager(doc)
545
- }
546
-
547
- Pane.prototype.notify = function (messageString) {
548
- const xmsg = doc.createElement('li')
549
- xmsg.className = 'notify'
550
- xmsg.innerHTML = messageString
551
- doc.getElementById('notify-container').appendChild(xmsg)
552
- setTimeout(function () {
553
- doc.getElementById('notify-container').removeChild(xmsg)
554
- // delete xmsg;
555
- }, 4000)
556
- }
557
-
558
- Pane.prototype.header = function (s, doc) {
559
- const that = this
560
- function lsFollowUser () {
561
- const myUser = kb.sym(mb.getMyURI())
562
- // var Ifollow = that.Ifollow
563
- const username = that.creator.name
564
- const mbconfirmFollow = function (uri, success, _msg) {
565
- if (success === true) {
566
- if (!that.Ifollow) {
567
- // prevent duplicate entries from being added to kb (because that was happening)
568
- if (
569
- !kb.whether(
570
- followMe.subject,
571
- followMe.predicate,
572
- followMe.object,
573
- followMe.why
574
- )
575
- ) {
576
- kb.add(
577
- followMe.subject,
578
- followMe.predicate,
579
- followMe.object,
580
- followMe.why
581
- )
582
- }
583
- } else {
584
- kb.removeMany(
585
- followMe.subject,
586
- followMe.predicate,
587
- followMe.object,
588
- followMe.why
589
- )
590
- }
591
- console.log(that.Ifollow)
592
- that.Ifollow = !that.Ifollow
593
- xfollowButton.disabled = false
594
- console.log(that.Ifollow)
595
- const followButtonLabel = that.Ifollow ? 'Unfollow ' : 'Follow '
596
- const doFollow = that.Ifollow ? 'now follow ' : 'no longer follow '
597
- xfollowButton.value = followButtonLabel + username
598
- that.notify('You ' + doFollow + username + '.')
599
- }
600
- }
601
- const followMe = new UI.rdf.Statement(
602
- myUser,
603
- SIOC('follows'),
604
- that.creator.sym,
605
- myUser
606
- )
607
- xfollowButton.disabled = true
608
- xfollowButton.value = 'Updating...'
609
- if (!that.Ifollow) {
610
- sparqlUpdater.insert_statement(followMe, mbconfirmFollow)
611
- } else {
612
- sparqlUpdater.delete_statement(followMe, mbconfirmFollow)
613
- }
614
- }
615
- const notify = function (messageString) {
616
- const xmsg = doc.createElement('li')
617
- xmsg.className = 'notify'
618
- xmsg.innerHTML = messageString
619
- doc.getElementById('notify-container').appendChild(xmsg)
620
- setTimeout(function () {
621
- doc.getElementById('notify-container').removeChild(xmsg)
622
- // delete xmsg;
623
- }, 4000)
624
- }
625
- const mbCancelNewMB = function (_evt) {
626
- xupdateContainer.removeChild(
627
- xupdateContainer.childNodes[xupdateContainer.childNodes.length - 1]
628
- )
629
- xcreateNewMB.disabled = false
630
- }
631
- const lsCreateNewMB = function (_evt) {
632
- // disable the create new microblog button.
633
- // then prefills the information.
634
- xcreateNewMB.disabled = true
635
- const xcmb = doc.createElement('div')
636
- const xcmbName = doc.createElement('input')
637
- if (kb.whether(s, FOAF('name'))) {
638
- // handle use of FOAF:NAME
639
- xcmbName.value = kb.any(s, FOAF('name'))
640
- } else {
641
- // handle use of family and given name
642
- xcmbName.value = kb.any(s, FOAF('givenname'))
643
- ? kb.any(s, FOAF('givenname')) + ' '
644
- : ''
645
- xcmbName.value += kb.any(s, FOAF('family_name'))
646
- ? kb.any(s, FOAF('givenname'))
647
- : ''
648
- xcmbName.value =
649
- kb.any(s, FOAF('givenname')) + ' ' + kb.any(s, FOAF('family_name'))
650
- }
651
- const xcmbId = doc.createElement('input')
652
- xcmbId.value = kb.any(s, FOAF('nick')) ? kb.any(s, FOAF('nick')) : ''
653
- const xcmbAvatar = doc.createElement('input')
654
- if (kb.whether(s, FOAF('img'))) {
655
- // handle use of img
656
- xcmbAvatar.value = kb.any(s, FOAF('img')).uri
657
- } else {
658
- // otherwise try depiction
659
- xcmbAvatar.value = kb.any(s, FOAF('depiction'))
660
- ? kb.any(s, FOAF('depiction')).uri
661
- : ''
662
- }
663
- let workspace
664
- // = kb.any(s,WORKSPACE) //TODO - ADD URI FOR WORKSPACE DEFINITION
665
- const xcmbWritable = doc.createElement('input')
666
- xcmbWritable.value =
667
- workspace || 'http://dig.csail.mit.edu/2007/wiki/sandbox' // @@@
668
- xcmb.innerHTML = `
669
- <form class ="createNewMB" id="createNewMB">
670
- <p id="xcmbname"><span class="">Name: </span></p>
671
- <p id="xcmbid">Id: </p>
672
- <p id="xcmbavatar">Avatar: </p>
673
- <p id="xcmbwritable">Host my microblog at: </p>
674
- <input type="button" id="mbCancel" value="Cancel" />
675
- <input type="submit" id="mbCreate" value="Create!" />
676
- </form>
677
- `
678
- xupdateContainer.appendChild(xcmb)
679
- doc.getElementById('xcmbname').appendChild(xcmbName)
680
- doc.getElementById('xcmbid').appendChild(xcmbId)
681
- doc.getElementById('xcmbavatar').appendChild(xcmbAvatar)
682
- doc.getElementById('xcmbwritable').appendChild(xcmbWritable)
683
- doc
684
- .getElementById('mbCancel')
685
- .addEventListener('click', mbCancelNewMB, false)
686
- doc.getElementById('createNewMB').addEventListener(
687
- 'submit',
688
- function () {
689
- mb.generateNewMB(
690
- xcmbId.value,
691
- xcmbName.value,
692
- xcmbAvatar.value,
693
- xcmbWritable.value
694
- )
695
- },
696
- false
697
- )
698
- xcmbName.focus()
699
- }
700
- const mbSubmitPost = function () {
701
- const meta = {
702
- recipients: []
703
- }
704
- // user has selected a microblog to post to
705
- if (mb.getMyURI()) {
706
- // let myUser = kb.sym(mb.getMyURI())
707
- // submission callback
708
- const cbconfirmSubmit = function (uri, success, responseText, d) {
709
- if (success === true) {
710
- for (const triple in d) {
711
- kb.add(
712
- d[triple].subject,
713
- d[triple].predicate,
714
- d[triple].object,
715
- d[triple].why
716
- )
717
- }
718
- xupdateSubmit.disabled = false
719
- xupdateStatus.value = ''
720
- mbLetterCount()
721
- notify('Microblog Updated.')
722
- if (that.thisIsMe) {
723
- doc
724
- .getElementById('postNotificationList')
725
- .insertBefore(
726
- that.generatePost(d[0].subject),
727
- doc.getElementById('postNotificationList').childNodes[0]
728
- )
729
- }
730
- } else {
731
- notify('There was a problem submitting your post.')
732
- }
733
- }
734
- const words = xupdateStatus.value.split(' ')
735
- const mbUpdateWithReplies = function () {
736
- xupdateSubmit.disabled = true
737
- xupdateSubmit.value = 'Updating...'
738
- mb.statusUpdate(
739
- xupdateStatus.value,
740
- cbconfirmSubmit,
741
- xinReplyToContainer.value,
742
- meta
743
- )
744
- }
745
- for (const word in words) {
746
- if (words[word].match(/@\w+/)) {
747
- const atUser = words[word].replace(/\W/g, '')
748
- const recipient = myFollowList.selectUser(atUser)
749
- if (recipient[0] === true) {
750
- meta.recipients.push(recipient[1][0])
751
- } else if (recipient[1].length > 1) {
752
- // if multiple users allow the user to choose
753
- const xrecipients = doc.createElement('select')
754
- const xrecipientsSubmit = doc.createElement('input')
755
- xrecipientsSubmit.type = 'button'
756
- xrecipientsSubmit.value = 'Continue'
757
- xrecipientsSubmit.addEventListener(
758
- 'click',
759
- function () {
760
- meta.recipients.push(recipient[1][xrecipients.value])
761
- mbUpdateWithReplies()
762
- xrecipients.parentNode.removeChild(xrecipientsSubmit)
763
- xrecipients.parentNode.removeChild(xrecipients)
764
- },
765
- false
766
- )
767
- const recipChoice = function (recip, c) {
768
- const name = kb.any(kb.sym(recip), SIOC('name'))
769
- const choice = doc.createElement('option')
770
- choice.value = c
771
- choice.innerHTML = name
772
- return choice
773
- }
774
- for (const r in recipient[1]) {
775
- xrecipients.appendChild(recipChoice(recipient[1][r], r))
776
- }
777
- xupdateContainer.appendChild(xrecipients)
778
- xupdateContainer.appendChild(xrecipientsSubmit)
779
- return
780
- } else {
781
- // no users known or self reference.
782
- if (
783
- String(
784
- kb.any(kb.sym(mb.getMyURI()), SIOC('id'))
785
- ).toLowerCase() === atUser.toLowerCase()
786
- ) {
787
- meta.recipients.push(mb.getMyURI())
788
- } else {
789
- notify(
790
- 'You do not follow ' +
791
- atUser +
792
- '. Try following ' +
793
- atUser +
794
- ' before mentioning them.'
795
- )
796
- return
797
- }
798
- }
799
- }
800
- /* else if(words[word].match(/\#\w+/)){
801
- //hashtag
802
- } else if(words[word].match(/\!\w+/)){
803
- //usergroup
804
- } */
805
- }
806
- mbUpdateWithReplies()
807
- } else {
808
- notify('Please set your microblog first.')
809
- }
810
- }
811
- const mbLetterCount = function () {
812
- xupdateStatusCounter.innerHTML = charCount - xupdateStatus.value.length
813
- xupdateStatusCounter.style.color =
814
- charCount - xupdateStatus.value.length < 0 ? '#c33' : ''
815
- if (xupdateStatus.value.length === 0) {
816
- xinReplyToContainer.value = ''
817
- xupdateSubmit.value = 'Send'
818
- }
819
- }
820
- // reply viewer
821
- const xviewReply = doc.createElement('ul')
822
- xviewReply.className = 'replyView'
823
- xviewReply.addEventListener(
824
- 'click',
825
- function () {
826
- xviewReply.className = 'replyView'
827
- },
828
- false
829
- )
830
- this.xviewReply = xviewReply
831
- const headerContainer = doc.createElement('div')
832
- headerContainer.className = 'header-container'
833
-
834
- // ---create status update box---
835
- const xnotify = doc.createElement('ul')
836
- xnotify.id = 'notify-container'
837
- xnotify.className = 'notify-container'
838
- this.xnotify = xnotify
839
- const xupdateContainer = doc.createElement('form')
840
- xupdateContainer.className = 'update-container'
841
- xupdateContainer.innerHTML = '<h3>What are you up to?</h3>'
842
- let xinReplyToContainer
843
- let xupdateStatus
844
- let xupdateStatusCounter
845
- let xupdateSubmit
846
- let xcreateNewMB
847
- if (mb.getMyURI()) {
848
- xinReplyToContainer = doc.createElement('input')
849
- xinReplyToContainer.id = 'xinReplyToContainer'
850
- xinReplyToContainer.type = 'hidden'
851
-
852
- xupdateStatus = doc.createElement('textarea')
853
- xupdateStatus.id = 'xupdateStatus'
854
-
855
- xupdateStatusCounter = doc.createElement('span')
856
- xupdateStatusCounter.appendChild(doc.createTextNode(charCount))
857
- xupdateStatus.cols = 30
858
- xupdateStatus.addEventListener('keyup', mbLetterCount, false)
859
- xupdateStatus.addEventListener('focus', mbLetterCount, false)
860
-
861
- xupdateSubmit = doc.createElement('input')
862
- xupdateSubmit.id = 'xupdateSubmit'
863
- xupdateSubmit.type = 'submit'
864
- xupdateSubmit.value = 'Send'
865
-
866
- xupdateContainer.appendChild(xinReplyToContainer)
867
- xupdateContainer.appendChild(xupdateStatusCounter)
868
- xupdateContainer.appendChild(xupdateStatus)
869
- xupdateContainer.appendChild(xupdateSubmit)
870
- xupdateContainer.addEventListener('submit', mbSubmitPost, false)
871
- } else {
872
- const xnewUser = doc.createTextNode(
873
- "Hi, it looks like you don't have a microblog, " +
874
- ' would you like to create one? '
875
- )
876
- xcreateNewMB = doc.createElement('input')
877
- xcreateNewMB.type = 'button'
878
- xcreateNewMB.value = 'Create a new Microblog'
879
- xcreateNewMB.addEventListener('click', lsCreateNewMB, false)
880
- xupdateContainer.appendChild(xnewUser)
881
- xupdateContainer.appendChild(xcreateNewMB)
882
- }
883
-
884
- headerContainer.appendChild(xupdateContainer)
885
-
886
- const subheaderContainer = doc.createElement('div')
887
- subheaderContainer.className = 'subheader-container'
888
-
889
- // user header
890
- // this.creator
891
- const creators = kb.each(s, FOAF('holdsAccount'))
892
- let creator
893
- for (const c in creators) {
894
- if (
895
- kb.whether(creators[c], RDF('type'), SIOC('User')) &&
896
- kb.whether(
897
- kb.any(creators[c], SIOC('creator_of')),
898
- RDF('type'),
899
- SIOCt('Microblog')
900
- )
901
- ) {
902
- creator = creators[c]
903
- // var mb = kb.sym(creator.uri.split("#")[0]);
904
- // store.fetcher.refresh(mb);
905
- break
906
- // TODO add support for more than one microblog in same foaf
907
- }
908
- }
909
- let xfollowButton
910
- if (creator) {
911
- this.creator = mb.getUser(creator)
912
- // ---display avatar, if available ---
913
- if (this.creator.avatar !== '') {
914
- const avatar = doc.createElement('img')
915
- avatar.src = this.creator.avatar.uri
916
- subheaderContainer.appendChild(avatar)
917
- }
918
- // ---generate name ---
919
- const userName = doc.createElement('h1')
920
- userName.className = 'fn'
921
- userName.appendChild(
922
- doc.createTextNode(this.creator.name + ' (' + this.creator.id + ')')
923
- )
924
- subheaderContainer.appendChild(userName)
925
- // ---display follow button---
926
- if (!this.thisIsMe && mb.getMyURI()) {
927
- xfollowButton = doc.createElement('input')
928
- xfollowButton.setAttribute('type', 'button')
929
- const followButtonLabel = this.Ifollow ? 'Unfollow ' : 'Follow '
930
- xfollowButton.value = followButtonLabel + this.creator.name
931
- xfollowButton.addEventListener('click', lsFollowUser, false)
932
- subheaderContainer.appendChild(xfollowButton)
933
- }
934
- // user header end
935
- // header tabs
936
- const xtabsList = this.Tab.getTabView()
937
- headerContainer.appendChild(subheaderContainer)
938
- headerContainer.appendChild(xtabsList)
939
- }
940
- return headerContainer
941
- }
942
- Pane.prototype.generatePost = function (post, _me) {
943
- /*
944
- generatePost - Creates and formats microblog posts
945
- post - symbol of the uri the post in question
946
- */
947
- const that = this
948
- const viewPost = function (uris) {
949
- const xviewReply = that.xviewReply
950
- for (let i = 0; i < xviewReply.childNodes.length; i++) {
951
- xviewReply.removeChild(xviewReply.childNodes[0])
952
- }
953
- const xcloseContainer = doc.createElement('li')
954
- xcloseContainer.className = 'closeContainer'
955
- const xcloseButton = doc.createElement('span')
956
- xcloseButton.innerHTML = '&#215;'
957
- xcloseButton.className = 'closeButton'
958
- xcloseContainer.appendChild(xcloseButton)
959
- xviewReply.appendChild(xcloseContainer)
960
- for (const uri in uris) {
961
- xviewReply.appendChild(
962
- that.generatePost(kb.sym(uris[uri]), this.thisIsMe, 'view')
963
- )
964
- }
965
- xviewReply.className = 'replyView-active'
966
- that.microblogPane.appendChild(xviewReply)
967
- }
968
- // container for post
969
- const xpost = doc.createElement('li')
970
- xpost.className = 'post'
971
- xpost.setAttribute('id', String(post.uri).split('#')[1])
972
- const Post = mb.getPost(post)
973
- // username text
974
- // var uname = kb.any(kb.any(post, SIOC('has_creator')), SIOC('id'))
975
- const uholdsaccount = kb.any(
976
- undefined,
977
- FOAF('holdsAccount'),
978
- kb.any(post, SIOC('has_creator'))
979
- )
980
- const xuname = doc.createElement('a')
981
- xuname.href = uholdsaccount.uri
982
- xuname.className = 'userLink'
983
- const xunameText = doc.createTextNode(mb.getUser(Post.creator).id)
984
- xuname.appendChild(xunameText)
985
- // user image
986
- const xuavatar = doc.createElement('img')
987
- xuavatar.src = mb.getUser(Post.creator).avatar.uri
988
- xuavatar.className = 'postAvatar'
989
- // post content
990
- const xpostContent = doc.createElement('blockquote')
991
- let postText = Post.message
992
- // post date
993
- const xpostLink = doc.createElement('a')
994
- xpostLink.className = 'postLink'
995
- xpostLink.addEventListener(
996
- 'click',
997
- function () {
998
- viewPost([post.uri])
999
- },
1000
- false
1001
- )
1002
- xpostLink.id = 'post_' + String(post.uri).split('#')[1]
1003
- xpostLink.setAttribute('content', post.uri)
1004
- xpostLink.setAttribute('property', 'permalink')
1005
- const postLink = doc.createTextNode(
1006
- Post.date ? Post.date : 'post date unknown'
1007
- )
1008
- xpostLink.appendChild(postLink)
1009
-
1010
- // LINK META DATA (MENTIONS, HASHTAGS, GROUPS)
1011
- const mentions = kb.each(post, SIOC('topic'))
1012
- const tags = {}
1013
-
1014
- for (const mention in mentions) {
1015
- sf.lookUpThing(mentions[mention])
1016
- const id = kb.any(mentions[mention], SIOC('id'))
1017
- tags['@' + id] = mentions[mention]
1018
- }
1019
- const postTags = postText.match(/(@|#|!)\w+/g)
1020
- const postFunction = function () {
1021
- const p = postTags.pop()
1022
- return tags[p]
1023
- ? kb.any(undefined, FOAF('holdsAccount'), tags[p]).uri
1024
- : p
1025
- }
1026
- for (const t in tags) {
1027
- const person = t.replace(/@/, '')
1028
- const replacePerson = RegExp('(@|!|#)(' + person + ')')
1029
- postText = postText.replace(
1030
- replacePerson,
1031
- '$1<a href="' + postFunction() + '">$2</a>'
1032
- )
1033
- }
1034
- xpostContent.innerHTML = postText
1035
-
1036
- // in reply to logic
1037
- // This has the potential to support a post that replies to many messages.
1038
- const inReplyTo = kb.each(post, SIOC('reply_of'))
1039
- const xreplyTo = doc.createElement('span')
1040
- let theReply
1041
- for (const reply in inReplyTo) {
1042
- theReply = String(inReplyTo[reply]).replace(/<|>/g, '')
1043
- const genReplyTo = function () {
1044
- const reply = doc.createElement('a')
1045
- reply.innerHTML = ', <b>in reply to</b>'
1046
- reply.addEventListener(
1047
- 'click',
1048
- function () {
1049
- viewPost([post.uri, theReply])
1050
- return false
1051
- },
1052
- false
1053
- )
1054
- return reply
1055
- }
1056
- xreplyTo.appendChild(genReplyTo())
1057
- }
1058
-
1059
- // END LINK META DATA
1060
- // add the reply to and delete buttons to the interface
1061
- const mbReplyTo = function () {
1062
- const id = mb.getUser(Post.creator).id
1063
- const xupdateStatus = doc.getElementById('xupdateStatus')
1064
- const xinReplyToContainer = doc.getElementById('xinReplyToContainer')
1065
- const xupdateSubmit = doc.getElementById('xupdateSubmit')
1066
- xupdateStatus.value = '@' + id + ' '
1067
- xupdateStatus.focus()
1068
- xinReplyToContainer.value = post.uri
1069
- xupdateSubmit.value = 'Reply'
1070
- }
1071
- let xconfirmDeletionDialog
1072
- const mbDeletePost = function (evt) {
1073
- const lsconfirmNo = function () {
1074
- doc
1075
- .getElementById('notify-container')
1076
- .removeChild(xconfirmDeletionDialog)
1077
- evt.target.disabled = false
1078
- }
1079
- const lsconfirmYes = function () {
1080
- reallyDelete()
1081
- doc
1082
- .getElementById('notify-container')
1083
- .removeChild(xconfirmDeletionDialog)
1084
- }
1085
- evt.target.disabled = true
1086
- xconfirmDeletionDialog = doc.createElement('li')
1087
- xconfirmDeletionDialog.className = 'notify conf'
1088
- xconfirmDeletionDialog.innerHTML +=
1089
- '<p>Are you sure you want to delete this post?</p>'
1090
- xconfirmDeletionDialog.addEventListener(
1091
- 'keyup',
1092
- function (evt) {
1093
- if (evt.keyCode === 27) {
1094
- lsconfirmNo()
1095
- }
1096
- },
1097
- false
1098
- )
1099
- const confirmyes = doc.createElement('input')
1100
- confirmyes.type = 'button'
1101
- confirmyes.className = 'confirm'
1102
- confirmyes.value = 'Delete'
1103
- confirmyes.addEventListener('click', lsconfirmYes, false)
1104
- const confirmno = doc.createElement('input')
1105
- confirmno.type = 'button'
1106
- confirmno.className = 'confirm'
1107
- confirmno.value = 'Cancel'
1108
- confirmno.addEventListener('click', lsconfirmNo, false)
1109
- xconfirmDeletionDialog.appendChild(confirmno)
1110
- xconfirmDeletionDialog.appendChild(confirmyes)
1111
- doc
1112
- .getElementById('notify-container')
1113
- .appendChild(xconfirmDeletionDialog)
1114
- confirmno.focus()
1115
-
1116
- const reallyDelete = function () {
1117
- // callback after deletion
1118
- const mbconfirmDeletePost = function (a, success) {
1119
- if (success) {
1120
- that.notify('Post deleted.')
1121
- // update the ui to reflect model changes.
1122
- const deleteThisNode = evt.target.parentNode
1123
- deleteThisNode.parentNode.removeChild(deleteThisNode)
1124
- kb.removeMany(deleteMe)
1125
- } else {
1126
- that.notify('Oops, there was a problem, please try again')
1127
- evt.target.disabled = true
1128
- }
1129
- }
1130
- // delete references to post
1131
- const deleteContainerOf = function (a, success) {
1132
- if (success) {
1133
- const deleteContainer = kb.statementsMatching(
1134
- undefined,
1135
- SIOC('container_of'),
1136
- kb.sym(
1137
- doc
1138
- .getElementById('post_' + evt.target.parentNode.id)
1139
- .getAttribute('content')
1140
- )
1141
- )
1142
- sparqlUpdater.batch_delete_statement(
1143
- deleteContainer,
1144
- mbconfirmDeletePost
1145
- )
1146
- } else {
1147
- that.notify('Oops, there was a problem, please try again')
1148
- evt.target.disabled = false
1149
- }
1150
- }
1151
- // delete attributes of post
1152
- evt.target.disabled = true
1153
- const deleteMe = kb.statementsMatching(
1154
- kb.sym(
1155
- doc
1156
- .getElementById('post_' + evt.target.parentNode.id)
1157
- .getAttribute('content')
1158
- )
1159
- )
1160
- sparqlUpdater.batch_delete_statement(deleteMe, deleteContainerOf)
1161
- }
1162
- }
1163
- let themaker
1164
- let xreplyButton
1165
- let xdeleteButton
1166
- if (mb.getMyURI()) {
1167
- // If the microblog in question does not belong to the user,
1168
- // display the delete post and reply to post buttons.
1169
- themaker = kb.any(post, SIOC('has_creator'))
1170
- if (mb.getMyURI() !== themaker.uri) {
1171
- xreplyButton = doc.createElement('input')
1172
- xreplyButton.type = 'button'
1173
- xreplyButton.value = 'reply'
1174
- xreplyButton.className = 'reply'
1175
- xreplyButton.addEventListener('click', mbReplyTo, false)
1176
- } else {
1177
- xdeleteButton = doc.createElement('input')
1178
- xdeleteButton.type = 'button'
1179
- xdeleteButton.value = 'Delete'
1180
- xdeleteButton.className = 'reply'
1181
- xdeleteButton.addEventListener('click', mbDeletePost, false)
1182
- }
1183
- }
1184
-
1185
- const mbFavorite = function (evt) {
1186
- const nid = evt.target.parentNode.id
1187
- const favpost = doc.getElementById('post_' + nid).getAttribute('content')
1188
- xfavorite.className += ' ing'
1189
- const cbFavorite = function (a, success, _c, _d) {
1190
- if (success) {
1191
- xfavorite.className =
1192
- xfavorite.className.split(' ')[1] === 'ed'
1193
- ? 'favorit'
1194
- : 'favorit ed'
1195
- }
1196
- }
1197
- if (!myFavorites.favorited(favpost)) {
1198
- myFavorites.add(favpost, cbFavorite)
1199
- } else {
1200
- myFavorites.remove(favpost, cbFavorite)
1201
- }
1202
- }
1203
- const xfavorite = doc.createElement('a')
1204
- xfavorite.innerHTML = '&#9733;'
1205
- xfavorite.addEventListener('click', mbFavorite, false)
1206
- if (myFavorites.favorited(post.uri)) {
1207
- xfavorite.className = 'favorit ed'
1208
- } else {
1209
- xfavorite.className = 'favorit'
1210
- }
1211
- // build
1212
- xpost.appendChild(xuavatar)
1213
- xpost.appendChild(xpostContent)
1214
- if (mb.getMyURI()) {
1215
- xpost.appendChild(xfavorite)
1216
- if (mb.getMyURI() !== themaker.uri) {
1217
- xpost.appendChild(xreplyButton)
1218
- } else {
1219
- xpost.appendChild(xdeleteButton)
1220
- }
1221
- }
1222
- xpost.appendChild(xuname)
1223
- xpost.appendChild(xpostLink)
1224
- if (inReplyTo !== '') {
1225
- xpost.appendChild(xreplyTo)
1226
- }
1227
- return xpost
1228
- }
1229
- Pane.prototype.generatePostList = function (gmbPosts) {
1230
- /*
1231
- generatePostList - Generate the posts and
1232
- display their results on the interface.
1233
- */
1234
- const postList = doc.createElement('ul')
1235
- const postlist = {}
1236
- const datelist = []
1237
- for (const post in gmbPosts) {
1238
- const postDate = kb.any(gmbPosts[post], terms('created'))
1239
- if (postDate) {
1240
- datelist.push(postDate)
1241
- postlist[postDate] = this.generatePost(gmbPosts[post], this.thisIsMe)
1242
- }
1243
- }
1244
- datelist.sort().reverse()
1245
- for (const d in datelist) {
1246
- postList.appendChild(postlist[datelist[d]])
1247
- }
1248
- return postList
1249
- }
1250
- Pane.prototype.followsView = function () {
1251
- const getFollowed = function (user) {
1252
- let userid = kb.any(user, SIOC('id'))
1253
- const follow = doc.createElement('li')
1254
- follow.className = 'follow'
1255
- userid = userid || user.uri
1256
- let fol = kb.any(undefined, FOAF('holdsAccount'), user)
1257
- fol = fol ? fol.uri : user.uri
1258
- follow.innerHTML = '<a href="' + fol + '">' + userid + '</a>'
1259
- return follow
1260
- }
1261
- const xfollows = doc.createElement('div')
1262
- xfollows.id = 'xfollows'
1263
- xfollows.className = 'followlist-container view-container'
1264
- if (this.creator && kb.whether(this.creator.sym, SIOC('follows'))) {
1265
- const creatorFollows = kb.each(this.creator.sym, SIOC('follows'))
1266
- const xfollowsList = doc.createElement('ul')
1267
- for (const thisPerson in creatorFollows) {
1268
- xfollowsList.appendChild(getFollowed(creatorFollows[thisPerson]))
1269
- }
1270
- xfollows.appendChild(xfollowsList)
1271
- }
1272
- this.Tab.create('tab-follows', 'Follows', xfollows, false)
1273
- return xfollows
1274
- }
1275
- Pane.prototype.streamView = function (s, doc) {
1276
- const postContainer = doc.createElement('div')
1277
- postContainer.id = 'postContainer'
1278
- postContainer.className = 'post-container view-container active'
1279
- let mbPosts = []
1280
- if (kb.whether(s, FOAF('name')) && kb.whether(s, FOAF('holdsAccount'))) {
1281
- sf.lookUpThing(kb.any(s, FOAF('holdsAccount')))
1282
- const follows = kb.each(kb.any(s, FOAF('holdsAccount')), SIOC('follows'))
1283
- for (const f in follows) {
1284
- sf.lookUpThing(follows[f])
1285
- // look up people user follows
1286
- const smicroblogs = kb.each(follows[f], SIOC('creator_of'))
1287
- // get the follows microblogs
1288
- for (const smb in smicroblogs) {
1289
- sf.lookUpThing(smicroblogs[smb])
1290
- if (kb.whether(smicroblogs[smb], SIOC('topic'), follows[f])) {
1291
- continue
1292
- } else {
1293
- mbPosts = mbPosts.concat(
1294
- kb.each(smicroblogs[smb], SIOC('container_of'))
1295
- )
1296
- }
1297
- }
1298
- }
1299
- }
1300
- if (mbPosts.length > 0) {
1301
- const postList = this.generatePostList(mbPosts)
1302
- // generate stream
1303
- postList.id = 'postList'
1304
- postList.className = 'postList'
1305
- postContainer.appendChild(postList)
1306
- }
1307
- this.Tab.create('tab-stream', 'By Follows', postContainer, true)
1308
- return postContainer
1309
- }
1310
- Pane.prototype.notificationsView = function (s, doc) {
1311
- const postNotificationContainer = doc.createElement('div')
1312
- postNotificationContainer.id = 'postNotificationContainer'
1313
- postNotificationContainer.className =
1314
- 'notification-container view-container'
1315
- const postMentionContainer = doc.createElement('div')
1316
- postMentionContainer.id = 'postMentionContainer'
1317
- postMentionContainer.className = 'mention-container view-container'
1318
- let mbnPosts = []
1319
- let mbmPosts = []
1320
- // get mbs that I am the creator of.
1321
- const theUser = kb.any(s, FOAF('holdsAccount'))
1322
- const user = kb.any(theUser, SIOC('id'))
1323
- const microblogs = kb.each(theUser, SIOC('creator_of'))
1324
- for (const mbm in microblogs) {
1325
- sf.lookUpThing(microblogs[mbm])
1326
- if (kb.whether(microblogs[mbm], SIOC('topic'), theUser)) {
1327
- mbmPosts = mbmPosts.concat(
1328
- kb.each(microblogs[mbm], SIOC('container_of'))
1329
- )
1330
- } else {
1331
- if (kb.whether(microblogs[mbm], RDF('type'), SIOCt('Microblog'))) {
1332
- mbnPosts = mbnPosts.concat(
1333
- kb.each(microblogs[mbm], SIOC('container_of'))
1334
- )
1335
- }
1336
- }
1337
- }
1338
- const postNotificationList = this.generatePostList(mbnPosts)
1339
- postNotificationList.id = 'postNotificationList'
1340
- postNotificationList.className = 'postList'
1341
- postNotificationContainer.appendChild(postNotificationList)
1342
-
1343
- const postMentionList = this.generatePostList(mbmPosts)
1344
- postMentionList.id = 'postMentionList'
1345
- postMentionList.className = 'postList'
1346
- postMentionContainer.appendChild(postMentionList)
1347
- this.postMentionContainer = postMentionContainer
1348
- this.postNotificationContainer = postNotificationContainer
1349
- this.Tab.create(
1350
- 'tab-by-user',
1351
- 'By ' + user,
1352
- postNotificationContainer,
1353
- false
1354
- )
1355
- this.Tab.create('tab-at-user', '@' + user, postMentionContainer, false)
1356
- }
1357
- Pane.prototype.build = function () {
1358
- const microblogPane = this.microblogPane
1359
- this.headerContainer = this.header(s, doc)
1360
- this.postContainer = this.streamView(s, doc)
1361
- this.notificationsView(s, doc)
1362
- this.xfollows = this.followsView()
1363
- microblogPane.className = 'ppane'
1364
- microblogPane.appendChild(this.xviewReply)
1365
- microblogPane.appendChild(this.xnotify)
1366
- microblogPane.appendChild(this.headerContainer)
1367
- if (this.xfollows !== undefined) {
1368
- microblogPane.appendChild(this.xfollows)
1369
- }
1370
- microblogPane.appendChild(this.postContainer)
1371
- microblogPane.appendChild(this.postNotificationContainer)
1372
- microblogPane.appendChild(this.postMentionContainer)
1373
- }
1374
-
1375
- const microblogpane = doc.createElement('div')
1376
- // var getusersfollows = function(uri){
1377
- // var follows = new Object();
1378
- // var followsa = {follows:0, matches:0};
1379
- // var accounts = kb.each(s, FOAF("holdsAccount"));
1380
- // //get all of the accounts that a person holds
1381
- // for (var acct in accounts){
1382
- // var account = accounts[acct].uri;
1383
- // var act = kb.each(kb.sym(account),SIOC("follows"));
1384
- // for (var a in act){
1385
- // var thisuri = act[a].uri.split("#")[0];
1386
- // if (!follows[thisuri]){followsa.follows+=1;}
1387
- // follows[thisuri] =true;
1388
- // }
1389
- // }
1390
- //
1391
- // var buildPaneUI = function(uri){
1392
- // followsa.matches = (follows[uri]) ? followsa.matches+1: followsa.matches;
1393
- // console.log(follows.toSource());
1394
- // if(followsa.follows == followsa.matches ){
1395
- const ppane = new Pane(s, doc, microblogpane)
1396
- ppane.build()
1397
- // return false;
1398
- // }
1399
- // else{
1400
- // return true;
1401
- // }
1402
- // }
1403
- // sf.addCallback('done',buildPaneUI);
1404
- // sf.addCallback('fail',buildPaneUI);
1405
- // //fetch each of the followers
1406
- // for (var f in follows){
1407
- // sf.refresh(kb.sym(f));
1408
- // }
1409
- // }(s);
1410
- return microblogpane
1411
- }
1412
- }