solid-panes 3.7.3-cc40de56 → 3.7.3-f251a0e3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RDFXMLPane.js +58 -0
- package/dist/RDFXMLPane.js.map +1 -0
- package/{lib → dist}/argument/argumentPane.js +14 -15
- package/dist/argument/argumentPane.js.map +1 -0
- package/{lib → dist}/attach/attachPane.js +83 -93
- package/dist/attach/attachPane.js.map +1 -0
- package/{lib → dist}/audio/audioPane.js +49 -50
- package/dist/audio/audioPane.js.map +1 -0
- package/{lib → dist}/classInstancePane.js +23 -24
- package/dist/classInstancePane.js.map +1 -0
- package/dist/dashboard/basicPreferences.js +155 -0
- package/dist/dashboard/basicPreferences.js.map +1 -0
- package/dist/dashboard/dashboardPane.js +63 -0
- package/dist/dashboard/dashboardPane.js.map +1 -0
- package/dist/dashboard/homepage.js +63 -0
- package/dist/dashboard/homepage.js.map +1 -0
- package/{lib → dist}/dataContentPane.js +63 -63
- package/dist/dataContentPane.js.map +1 -0
- package/{lib → dist}/defaultPane.js +14 -15
- package/dist/defaultPane.js.map +1 -0
- package/{lib → dist}/dokieli/dokieliPane.js +49 -53
- package/dist/dokieli/dokieliPane.js.map +1 -0
- package/{src → dist}/dokieli/new.js +9 -3
- package/dist/dokieli/new.js.map +1 -0
- package/{lib → dist}/form/pane.js +44 -45
- package/dist/form/pane.js.map +1 -0
- package/dist/home/homePane.js +68 -0
- package/dist/home/homePane.js.map +1 -0
- package/dist/humanReadablePane.js +135 -0
- package/dist/humanReadablePane.js.map +1 -0
- package/dist/imagePane.js +70 -0
- package/dist/imagePane.js.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/internalPane.js +195 -0
- package/dist/internal/internalPane.js.map +1 -0
- package/dist/mainPage/footer.js +16 -0
- package/dist/mainPage/footer.js.map +1 -0
- package/dist/mainPage/header.js +84 -0
- package/dist/mainPage/header.js.map +1 -0
- package/{lib → dist}/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.js +30 -0
- package/dist/mainPage/index.js.map +1 -0
- package/{lib → dist}/microblogPane/microblogPane.js +261 -262
- package/dist/microblogPane/microblogPane.js.map +1 -0
- package/dist/n3Pane.js +56 -0
- package/dist/n3Pane.js.map +1 -0
- package/dist/outline/context.js +13 -0
- package/dist/outline/context.js.map +1 -0
- package/dist/outline/manager.js +1997 -0
- package/dist/outline/manager.js.map +1 -0
- package/{lib → dist}/outline/outlineIcons.js +2 -3
- package/dist/outline/outlineIcons.js.map +1 -0
- package/dist/outline/propertyViews.js +33 -0
- package/dist/outline/propertyViews.js.map +1 -0
- package/{lib → dist}/outline/queryByExample.js +30 -31
- package/dist/outline/queryByExample.js.map +1 -0
- package/{lib → dist}/outline/userInput.js +262 -260
- package/dist/outline/userInput.js.map +1 -0
- package/dist/outline/viewAsImage.js +7 -0
- package/dist/outline/viewAsImage.js.map +1 -0
- package/{lib → dist}/outline/viewAsMbox.js +4 -14
- package/dist/outline/viewAsMbox.js.map +1 -0
- package/dist/pad/padPane.js +420 -0
- package/dist/pad/padPane.js.map +1 -0
- package/{lib → dist}/playlist/playlistPane.js +36 -37
- package/dist/playlist/playlistPane.js.map +1 -0
- package/{lib → dist}/registerPanes.js +29 -29
- package/dist/registerPanes.js.map +1 -0
- package/{src → dist}/schedule/formsForSchedule.js +9 -2
- package/dist/schedule/formsForSchedule.js.map +1 -0
- package/{lib → dist}/schedule/schedulePane.js +171 -177
- package/dist/schedule/schedulePane.js.map +1 -0
- package/dist/sharing/sharingPane.js +45 -0
- package/dist/sharing/sharingPane.js.map +1 -0
- package/dist/slideshow/slideshowPane.js +80 -0
- package/dist/slideshow/slideshowPane.js.map +1 -0
- package/{lib → dist}/socialPane.js +141 -142
- package/dist/socialPane.js.map +1 -0
- package/dist/tabbed/tabbedPane.js +55 -0
- package/dist/tabbed/tabbedPane.js.map +1 -0
- package/{lib → dist}/tableViewPane.js +8 -9
- package/dist/tableViewPane.js.map +1 -0
- package/{lib → dist}/transaction/pane.js +117 -118
- package/dist/transaction/pane.js.map +1 -0
- package/{lib → dist}/transaction/period.js +82 -83
- package/dist/transaction/period.js.map +1 -0
- package/{lib → dist}/trip/tripPane.js +47 -48
- package/dist/trip/tripPane.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.dom.js +158 -0
- package/dist/trustedApplications/trustedApplications.dom.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.utils.js +24 -0
- package/dist/trustedApplications/trustedApplications.utils.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.view.js +62 -0
- package/dist/trustedApplications/trustedApplications.view.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/{lib → dist}/ui/pane.js +30 -31
- package/dist/ui/pane.js.map +1 -0
- package/dist/versionInfo.js +31 -0
- package/dist/versionInfo.js.map +1 -0
- package/dist/video/videoPane.js +43 -0
- package/dist/video/videoPane.js.map +1 -0
- package/package.json +26 -13
- package/Documentation/VisualLanguage.html +0 -538
- package/Documentation/conventions.md +0 -333
- package/coverage/clover.xml +0 -152
- package/coverage/coverage-final.json +0 -6
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/outline/index.html +0 -161
- package/coverage/lcov-report/outline/outlineIcons.js.html +0 -565
- package/coverage/lcov-report/outline/propertyViews.ts.html +0 -196
- package/coverage/lcov-report/outline/viewAsImage.ts.html +0 -121
- package/coverage/lcov-report/outline/viewAsMbox.ts.html +0 -127
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/trustedApplications/index.html +0 -116
- package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +0 -238
- package/coverage/lcov.info +0 -204
- package/dev/index.html +0 -28
- package/dev/loader.ts +0 -91
- package/dev/pane/index.ts +0 -10
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +0 -609
- package/eslint.config.mjs +0 -34
- package/jest.config.js +0 -27
- package/jest.setup.ts +0 -4
- package/lib/RDFXMLPane.js +0 -59
- package/lib/RDFXMLPane.js.map +0 -1
- package/lib/argument/argumentPane.js.map +0 -1
- package/lib/attach/attachPane.js.map +0 -1
- package/lib/audio/audioPane.js.map +0 -1
- package/lib/classInstancePane.js.map +0 -1
- package/lib/dashboard/basicPreferences.js +0 -229
- package/lib/dashboard/basicPreferences.js.map +0 -1
- package/lib/dashboard/dashboardPane.js +0 -73
- package/lib/dashboard/dashboardPane.js.map +0 -1
- package/lib/dashboard/homepage.js +0 -86
- package/lib/dashboard/homepage.js.map +0 -1
- package/lib/dataContentPane.js.map +0 -1
- package/lib/defaultPane.js.map +0 -1
- package/lib/dokieli/dokieliPane.js.map +0 -1
- package/lib/dokieli/new.js +0 -9
- package/lib/dokieli/new.js.map +0 -1
- package/lib/form/pane.js.map +0 -1
- package/lib/global.d.js +0 -2
- package/lib/global.d.js.map +0 -1
- package/lib/home/homePane.js +0 -91
- package/lib/home/homePane.js.map +0 -1
- package/lib/humanReadablePane.js +0 -138
- package/lib/humanReadablePane.js.map +0 -1
- package/lib/imagePane.js +0 -71
- package/lib/imagePane.js.map +0 -1
- package/lib/index.js +0 -112
- package/lib/index.js.map +0 -1
- package/lib/internal/internalPane.js +0 -184
- package/lib/internal/internalPane.js.map +0 -1
- package/lib/mainPage/footer.js +0 -22
- package/lib/mainPage/footer.js.map +0 -1
- package/lib/mainPage/header.js +0 -152
- package/lib/mainPage/header.js.map +0 -1
- package/lib/mainPage/index.js +0 -42
- package/lib/mainPage/index.js.map +0 -1
- package/lib/microblogPane/microblogPane.js.map +0 -1
- package/lib/n3Pane.js +0 -57
- package/lib/n3Pane.js.map +0 -1
- package/lib/outline/context.js +0 -19
- package/lib/outline/context.js.map +0 -1
- package/lib/outline/manager.js +0 -2264
- package/lib/outline/manager.js.map +0 -1
- package/lib/outline/manager.test.d.ts +0 -2
- package/lib/outline/manager.test.d.ts.map +0 -1
- package/lib/outline/manager.test.js +0 -210
- package/lib/outline/manager.test.js.map +0 -1
- package/lib/outline/outlineIcons.js.map +0 -1
- package/lib/outline/propertyViews.js +0 -44
- package/lib/outline/propertyViews.js.map +0 -1
- package/lib/outline/propertyViews.test.d.ts +0 -2
- package/lib/outline/propertyViews.test.d.ts.map +0 -1
- package/lib/outline/propertyViews.test.js +0 -27
- package/lib/outline/propertyViews.test.js.map +0 -1
- package/lib/outline/queryByExample.js.map +0 -1
- package/lib/outline/userInput.js.map +0 -1
- package/lib/outline/viewAsImage.js +0 -17
- package/lib/outline/viewAsImage.js.map +0 -1
- package/lib/outline/viewAsMbox.js.map +0 -1
- package/lib/pad/padPane.js +0 -417
- package/lib/pad/padPane.js.map +0 -1
- package/lib/playlist/playlistPane.js.map +0 -1
- package/lib/registerPanes.js.map +0 -1
- package/lib/schedule/formsForSchedule.js +0 -4
- package/lib/schedule/formsForSchedule.js.map +0 -1
- package/lib/schedule/schedulePane.js.map +0 -1
- package/lib/sharing/sharingPane.js +0 -49
- package/lib/sharing/sharingPane.js.map +0 -1
- package/lib/slideshow/slideshowPane.js +0 -84
- package/lib/slideshow/slideshowPane.js.map +0 -1
- package/lib/socialPane.js.map +0 -1
- package/lib/tabbed/tabbedPane.js +0 -72
- package/lib/tabbed/tabbedPane.js.map +0 -1
- package/lib/tableViewPane.js.map +0 -1
- package/lib/test-import-export/common.js +0 -12
- package/lib/test-import-export/common.js.map +0 -1
- package/lib/test-import-export/edit-importer.js +0 -25
- package/lib/test-import-export/edit-importer.js.map +0 -1
- package/lib/test-import-export/testImportExport.js +0 -2
- package/lib/test-import-export/testImportExport.js.map +0 -1
- package/lib/transaction/pane.js.map +0 -1
- package/lib/transaction/period.js.map +0 -1
- package/lib/trip/tripPane.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.dom.js +0 -177
- package/lib/trustedApplications/trustedApplications.dom.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.d.ts +0 -2
- package/lib/trustedApplications/trustedApplications.test.d.ts.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.js +0 -64
- package/lib/trustedApplications/trustedApplications.test.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -34
- package/lib/trustedApplications/trustedApplications.utils.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.view.js +0 -87
- package/lib/trustedApplications/trustedApplications.view.js.map +0 -1
- package/lib/types.js +0 -6
- package/lib/types.js.map +0 -1
- package/lib/ui/pane.js.map +0 -1
- package/lib/versionInfo.d.ts +0 -32
- package/lib/versionInfo.d.ts.map +0 -1
- package/lib/versionInfo.js +0 -37
- package/lib/versionInfo.js.map +0 -1
- package/lib/video/videoPane.js +0 -44
- package/lib/video/videoPane.js.map +0 -1
- package/src/RDFXMLPane.js +0 -60
- package/src/argument/argumentPane.js +0 -65
- package/src/argument/argument_icon_v04.jpg +0 -0
- package/src/argument/icon_argument.png +0 -0
- package/src/argument/transparentyingyang.png +0 -0
- package/src/attach/attachPane.js +0 -508
- package/src/attach/tbl-paperclip-128.png +0 -0
- package/src/attach/tbl-paperclip-22.png +0 -0
- package/src/attach/tbl-paperclip-22a.png +0 -0
- package/src/audio/audioPane.js +0 -197
- package/src/chatPreferencesForm.ttl +0 -12
- package/src/classInstancePane.js +0 -110
- package/src/dashboard/basicPreferences.ts +0 -201
- package/src/dashboard/dashboardPane.ts +0 -83
- package/src/dashboard/homepage.ts +0 -72
- package/src/dashboard/languages/codes.html +0 -8611
- package/src/dashboard/languages/codes.xml +0 -3563
- package/src/dashboard/languages/codes2.txt +0 -170
- package/src/dashboard/languages/foo +0 -70
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +0 -12
- package/src/dashboard/ontologyData.ttl +0 -35
- package/src/dashboard/preferencesFormText.ttl +0 -18
- package/src/dataContentPane.js +0 -290
- package/src/defaultPane.js +0 -102
- package/src/dokieli/Makefile +0 -6
- package/src/dokieli/dokieliPane.js +0 -190
- package/src/dokieli/new.html +0 -30
- package/src/form/form-22.png +0 -0
- package/src/form/form-b-22.png +0 -0
- package/src/form/form.graffle +0 -0
- package/src/form/form.png +0 -0
- package/src/form/pane.js +0 -217
- package/src/form/psuedocode-notes.txt +0 -57
- package/src/global.d.ts +0 -4
- package/src/home/homePane.ts +0 -72
- package/src/humanReadablePane.js +0 -150
- package/src/imagePane.js +0 -75
- package/src/index.ts +0 -71
- package/src/internal/internalPane.ts +0 -263
- package/src/mainPage/footer.ts +0 -19
- package/src/mainPage/header.ts +0 -79
- package/src/mainPage/index.ts +0 -20
- package/src/meeting/Makefile +0 -3
- package/src/meeting/test/meeting1/Actions/actions.ttl +0 -14
- package/src/meeting/test/meeting1/Actions/config.ttl +0 -16
- package/src/meeting/test/meeting1/Actions/state.ttl +0 -30
- package/src/meeting/test/meeting1/Schedule/details.ttl +0 -34
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -75
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/index.html +0 -72
- package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/results.ttl +0 -15
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -20
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -23
- package/src/meeting/test/meeting1/chat/chat.ttl +0 -1
- package/src/meeting/test/meeting1/details.ttl +0 -35
- package/src/meeting/test/meeting1/pad/pad.ttl +0 -16
- package/src/microblogPane/mbStyle.css +0 -267
- package/src/microblogPane/microblogPane.js +0 -1412
- package/src/n3Pane.js +0 -56
- package/src/outline/context.ts +0 -21
- package/src/outline/manager.js +0 -2384
- package/src/outline/manager.test.ts +0 -189
- package/src/outline/outlineIcons.js +0 -160
- package/src/outline/propertyViews.test.ts +0 -36
- package/src/outline/propertyViews.ts +0 -37
- package/src/outline/queryByExample.js +0 -296
- package/src/outline/userInput.js +0 -2373
- package/src/outline/viewAsImage.ts +0 -12
- package/src/outline/viewAsMbox.ts +0 -14
- package/src/pad/images/ColourOff.ai +2 -872
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +1 -935
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +0 -559
- package/src/playlist/playlistPane.js +0 -161
- package/src/registerPanes.js +0 -147
- package/src/schedule/Makefile +0 -6
- package/src/schedule/formsForSchedule.ttl +0 -115
- package/src/schedule/schedulePane.js +0 -1201
- package/src/sharing/sharingPane.ts +0 -49
- package/src/slideshow/slideshowPane.js +0 -80
- package/src/socialPane.js +0 -523
- package/src/style/tabbedtab.css +0 -1347
- package/src/tabbed/tabbedPane.ts +0 -60
- package/src/tableViewPane.js +0 -51
- package/src/test-import-export/common.js +0 -6
- package/src/test-import-export/edit-importer.js +0 -20
- package/src/test-import-export/testImportExport.js +0 -0
- package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
- package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/pane.js +0 -629
- package/src/transaction/period.js +0 -374
- package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
- package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
- package/src/trip/tripPane.js +0 -176
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -176
- package/src/trustedApplications/trustedApplications.dom.ts +0 -276
- package/src/trustedApplications/trustedApplications.test.ts +0 -82
- package/src/trustedApplications/trustedApplications.utils.ts +0 -51
- package/src/trustedApplications/trustedApplications.view.ts +0 -80
- package/src/types.ts +0 -34
- package/src/ui/22-builder.png +0 -0
- package/src/ui/builder.graffle +0 -0
- package/src/ui/builder.png +0 -0
- package/src/ui/builder2.png +0 -0
- package/src/ui/pane.js +0 -226
- package/src/versionInfo.ts +0 -30
- package/src/video/videoPane.js +0 -44
- package/timestamp.sh +0 -13
- package/travis/bumpversion.js +0 -29
- package/tsconfig.json +0 -78
- package/typings/raw-loader.d.ts +0 -4
- package/typings/solid-namespace/index.d.ts +0 -9
- package/webpack.config.js +0 -41
- /package/{lib → dist}/dashboard/basicPreferences.d.ts +0 -0
- /package/{lib → dist}/dashboard/basicPreferences.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts.map +0 -0
- /package/{lib → dist}/home/homePane.d.ts +0 -0
- /package/{lib → dist}/home/homePane.d.ts.map +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.d.ts.map +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/header.d.ts +0 -0
- /package/{lib → dist}/mainPage/header.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/index.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts.map +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts.map +0 -0
- /package/{lib → dist}/pad/padPane.d.ts +0 -0
- /package/{lib → dist}/pad/padPane.d.ts.map +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts.map +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
- /package/{lib → dist}/types.d.ts +0 -0
- /package/{lib → dist}/types.d.ts.map +0 -0
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _solidLogic = require("solid-logic");
|
|
9
8
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
10
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function
|
|
9
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
10
|
/*
|
|
12
11
|
Microblog pane
|
|
13
12
|
Charles McKenzie <charles2@mit.edu>
|
|
14
13
|
*/
|
|
15
14
|
/* global alert */
|
|
16
|
-
var _default = exports
|
|
15
|
+
var _default = exports.default = {
|
|
17
16
|
icon: UI.icons.originalIconBase + 'microblog/microblog.png',
|
|
18
17
|
name: 'microblogPane',
|
|
19
|
-
label: function
|
|
18
|
+
label: function (subject) {
|
|
20
19
|
if (_solidLogic.store.whether(subject, UI.ns.rdf('type'), UI.ns.foaf('Person'))) {
|
|
21
20
|
return 'Microblog';
|
|
22
21
|
} else {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
25
24
|
},
|
|
26
|
-
render: function
|
|
25
|
+
render: function (s, doc) {
|
|
27
26
|
//* **********************************************
|
|
28
27
|
// NAMESPACES SECTION
|
|
29
28
|
//* **********************************************
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
const SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#');
|
|
30
|
+
const SIOCt = UI.rdf.Namespace('http://rdfs.org/sioc/types#');
|
|
31
|
+
const FOAF = UI.rdf.Namespace('http://xmlns.com/foaf/0.1/');
|
|
32
|
+
const terms = UI.rdf.Namespace('http://purl.org/dc/terms/');
|
|
33
|
+
const RDF = UI.ns.rdf;
|
|
34
|
+
const kb = _solidLogic.store;
|
|
35
|
+
const charCount = 140;
|
|
36
|
+
const sf = _solidLogic.store.fetcher;
|
|
38
37
|
//* **********************************************
|
|
39
38
|
// BACK END
|
|
40
39
|
//* **********************************************
|
|
41
|
-
|
|
40
|
+
const sparqlUpdater = kb.updater;
|
|
42
41
|
// ----------------------------------------------
|
|
43
42
|
// FOLLOW LIST
|
|
44
43
|
// store the URIs of followed users for
|
|
45
44
|
// dereferencing the @replies
|
|
46
45
|
// ----------------------------------------------
|
|
47
|
-
|
|
46
|
+
const FollowList = function (user) {
|
|
48
47
|
this.userlist = {};
|
|
49
48
|
this.uris = {};
|
|
50
|
-
|
|
51
|
-
for (
|
|
49
|
+
const myFollows = kb.each(kb.sym(user), SIOC('follows'));
|
|
50
|
+
for (const mf in myFollows) {
|
|
52
51
|
this.add(kb.any(myFollows[mf], SIOC('id')), myFollows[mf].uri);
|
|
53
52
|
}
|
|
54
53
|
};
|
|
@@ -77,7 +76,7 @@ var _default = exports["default"] = {
|
|
|
77
76
|
// controls the list of favorites.
|
|
78
77
|
// constructor expects a user as uri.
|
|
79
78
|
// ----------------------------------------------
|
|
80
|
-
|
|
79
|
+
const Favorites = function (user) {
|
|
81
80
|
this.favorites = {};
|
|
82
81
|
this.favoritesURI = '';
|
|
83
82
|
if (!user) {
|
|
@@ -85,12 +84,12 @@ var _default = exports["default"] = {
|
|
|
85
84
|
return;
|
|
86
85
|
}
|
|
87
86
|
this.user = user.split('#')[0];
|
|
88
|
-
|
|
89
|
-
for (
|
|
87
|
+
const created = kb.each(kb.sym(user), SIOC('creator_of'));
|
|
88
|
+
for (const c in created) {
|
|
90
89
|
if (kb.whether(created[c], RDF('type'), SIOCt('FavouriteThings'))) {
|
|
91
90
|
this.favoritesURI = created[c];
|
|
92
|
-
|
|
93
|
-
for (
|
|
91
|
+
const favs = kb.each(created[c], SIOC('container_of'));
|
|
92
|
+
for (const f in favs) {
|
|
94
93
|
this.favorites[favs[f]] = '';
|
|
95
94
|
}
|
|
96
95
|
break;
|
|
@@ -103,7 +102,7 @@ var _default = exports["default"] = {
|
|
|
103
102
|
return kb.sym(post) in this.favorites;
|
|
104
103
|
};
|
|
105
104
|
Favorites.prototype.add = function (post, callback) {
|
|
106
|
-
|
|
105
|
+
const batch = new UI.rdf.Statement(this.favoritesURI, SIOC('container_of'), kb.sym(post), kb.sym(this.user));
|
|
107
106
|
sparqlUpdater.insert_statement(batch, function (a, success, c) {
|
|
108
107
|
if (success) {
|
|
109
108
|
kb.add(batch.subject, batch.predicate, batch.object, batch.why);
|
|
@@ -112,7 +111,7 @@ var _default = exports["default"] = {
|
|
|
112
111
|
});
|
|
113
112
|
};
|
|
114
113
|
Favorites.prototype.remove = function (post, callback) {
|
|
115
|
-
|
|
114
|
+
const batch = new UI.rdf.Statement(this.favoritesURI, SIOC('container_of'), kb.sym(post), kb.sym(this.user));
|
|
116
115
|
sparqlUpdater.delete_statement(batch, function (a, success, c) {
|
|
117
116
|
if (success) {
|
|
118
117
|
kb.add(batch.subject, batch.predicate, batch.object, batch.why);
|
|
@@ -125,15 +124,15 @@ var _default = exports["default"] = {
|
|
|
125
124
|
// store the uri's of followed users for
|
|
126
125
|
// dereferencing the @replies.
|
|
127
126
|
// ----------------------------------------------
|
|
128
|
-
|
|
127
|
+
const Microblog = function (kb) {
|
|
129
128
|
this.kb = kb;
|
|
130
129
|
|
|
131
130
|
// attempt to fetch user account from local preferences if just
|
|
132
131
|
// in case the user's foaf was not writable. add it to the store
|
|
133
132
|
// this will probably need to change.
|
|
134
|
-
|
|
133
|
+
const theUser = _solidLogic.authn.currentUser();
|
|
135
134
|
if (theUser) {
|
|
136
|
-
|
|
135
|
+
let theAccount = UI.preferences.get('acct');
|
|
137
136
|
if (theAccount) {
|
|
138
137
|
theAccount = kb.sym(theAccount);
|
|
139
138
|
}
|
|
@@ -143,7 +142,7 @@ var _default = exports["default"] = {
|
|
|
143
142
|
}
|
|
144
143
|
};
|
|
145
144
|
Microblog.prototype.getUser = function (uri) {
|
|
146
|
-
|
|
145
|
+
const User = {};
|
|
147
146
|
User.name = kb.any(uri, SIOC('name')) ? kb.any(uri, SIOC('name')) : '';
|
|
148
147
|
User.avatar = kb.any(uri, SIOC('avatar')) ? kb.any(uri, SIOC('avatar')) : '';
|
|
149
148
|
User.id = kb.any(uri, SIOC('id'));
|
|
@@ -151,17 +150,17 @@ var _default = exports["default"] = {
|
|
|
151
150
|
return User;
|
|
152
151
|
};
|
|
153
152
|
Microblog.prototype.getPost = function (uri) {
|
|
154
|
-
|
|
153
|
+
const Post = {};
|
|
155
154
|
// date ----------
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
let postLink = new Date(kb.anyValue(uri, terms('created')));
|
|
156
|
+
let h = postLink.getHours();
|
|
157
|
+
const a = h > 12 ? ' PM' : ' AM';
|
|
159
158
|
h = h > 12 ? h - 12 : h;
|
|
160
|
-
|
|
159
|
+
let m = postLink.getMinutes();
|
|
161
160
|
m = m < 10 ? '0' + m : m;
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
const mo = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
162
|
+
const da = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
163
|
+
const ds = da[postLink.getDay()] + ' ' + postLink.getDate() + ' ' + mo[postLink.getMonth()] + ' ' + postLink.getFullYear();
|
|
165
164
|
postLink = h + ':' + m + a + ' on ' + ds;
|
|
166
165
|
Post.date = postLink;
|
|
167
166
|
// ---------
|
|
@@ -173,16 +172,16 @@ var _default = exports["default"] = {
|
|
|
173
172
|
};
|
|
174
173
|
Microblog.prototype.gen_random_uri = function (base) {
|
|
175
174
|
// generate random uri
|
|
176
|
-
|
|
175
|
+
const uriNonce = base + '#n' + Math.floor(Math.random() * 10e9);
|
|
177
176
|
return kb.sym(uriNonce);
|
|
178
177
|
};
|
|
179
178
|
Microblog.prototype.statusUpdate = function (statusMsg, callback, replyTo, meta) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
for (
|
|
179
|
+
const myUserURI = this.getMyURI();
|
|
180
|
+
const myUser = kb.sym(myUserURI.split('#')[0]);
|
|
181
|
+
const newPost = this.gen_random_uri(myUser.uri);
|
|
182
|
+
const microlist = kb.each(kb.sym(myUserURI), SIOC('creator_of'));
|
|
183
|
+
let micro;
|
|
184
|
+
for (const microlistelement in microlist) {
|
|
186
185
|
if (kb.whether(microlist[microlistelement], RDF('type'), SIOCt('Microblog')) && !kb.whether(microlist[microlistelement], SIOC('topic'), kb.sym(this.getMyURI()))) {
|
|
187
186
|
micro = microlist[microlistelement];
|
|
188
187
|
break;
|
|
@@ -190,7 +189,7 @@ var _default = exports["default"] = {
|
|
|
190
189
|
}
|
|
191
190
|
|
|
192
191
|
// generate new post
|
|
193
|
-
|
|
192
|
+
const batch = [new UI.rdf.Statement(newPost, RDF('type'), SIOCt('MicroblogPost'), myUser), new UI.rdf.Statement(newPost, SIOC('has_creator'), kb.sym(myUserURI), myUser), new UI.rdf.Statement(newPost, SIOC('content'), statusMsg, myUser), new UI.rdf.Statement(newPost, terms('created'), new Date(), myUser), new UI.rdf.Statement(micro, SIOC('container_of'), newPost, myUser)];
|
|
194
193
|
|
|
195
194
|
// message replies
|
|
196
195
|
if (replyTo) {
|
|
@@ -198,13 +197,13 @@ var _default = exports["default"] = {
|
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
// @replies, #hashtags, !groupReplies
|
|
201
|
-
for (
|
|
200
|
+
for (const r in meta.recipients) {
|
|
202
201
|
batch.push(new UI.rdf.Statement(newPost, SIOC('topic'), kb.sym(meta.recipients[r]), myUser));
|
|
203
202
|
batch.push(new UI.rdf.Statement(kb.any(), SIOC('container_of'), newPost, myUser));
|
|
204
|
-
|
|
205
|
-
for (
|
|
203
|
+
const mblogs = kb.each(kb.sym(meta.recipients[r]), SIOC('creator_of'));
|
|
204
|
+
for (const mbl in mblogs) {
|
|
206
205
|
if (kb.whether(mblogs[mbl], SIOC('topic'), kb.sym(meta.recipients[r]))) {
|
|
207
|
-
|
|
206
|
+
const replyBatch = new UI.rdf.Statement(mblogs[mbl], SIOC('container_of'), newPost, kb.sym(meta.recipients[r].split('#')[0]));
|
|
208
207
|
sparqlUpdater.insert_statement(replyBatch);
|
|
209
208
|
}
|
|
210
209
|
}
|
|
@@ -214,18 +213,18 @@ var _default = exports["default"] = {
|
|
|
214
213
|
});
|
|
215
214
|
};
|
|
216
215
|
Microblog.prototype.getMyURI = function () {
|
|
217
|
-
|
|
216
|
+
const me = _solidLogic.authn.currentUser();
|
|
218
217
|
console.log(me);
|
|
219
|
-
|
|
218
|
+
const myMicroblog = kb.any(kb.sym(me), FOAF('holdsAccount'));
|
|
220
219
|
console.log('\n\n' + myMicroblog);
|
|
221
220
|
return myMicroblog ? myMicroblog.uri : false;
|
|
222
221
|
};
|
|
223
222
|
Microblog.prototype.generateNewMB = function (id, name, avatar, loc) {
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
const host = loc + '/' + id;
|
|
224
|
+
const rememberMicroblog = function () {
|
|
226
225
|
UI.preferences.set('acct', host + '#' + id);
|
|
227
226
|
};
|
|
228
|
-
|
|
227
|
+
const cbgenUserMB = function (a, success, c, d) {
|
|
229
228
|
if (success) {
|
|
230
229
|
alert('Microblog generated at ' + host + '#' + id + 'please add <b>' + host + '</b> to your foaf.');
|
|
231
230
|
// mbCancelNewMB() @@TBD
|
|
@@ -233,12 +232,12 @@ var _default = exports["default"] = {
|
|
|
233
232
|
// preferences for later retrieval.
|
|
234
233
|
// this will probably need to change.
|
|
235
234
|
rememberMicroblog();
|
|
236
|
-
for (
|
|
235
|
+
for (const triple in d) {
|
|
237
236
|
kb.add(d[triple].subject, d[triple].predicate, d[triple].object, d[triple].why);
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
};
|
|
241
|
-
|
|
240
|
+
const genUserMB = [
|
|
242
241
|
// user
|
|
243
242
|
new UI.rdf.Statement(kb.sym(host + '#' + id), RDF('type'), SIOC('User'), kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), SIOC('creator_of'), kb.sym(host + '#mb'), kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), SIOC('creator_of'), kb.sym(host + '#mbn'), kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), SIOC('creator_of'), kb.sym(host + '#fav'), kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), SIOC('name'), name, kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), SIOC('id'), id, kb.sym(host)), new UI.rdf.Statement(kb.sym(host + '#' + id), RDF('label'), id, kb.sym(host)), new UI.rdf.Statement(s, FOAF('holdsAccount'), kb.sym(host + '#' + id), kb.sym(host)),
|
|
244
243
|
// microblog
|
|
@@ -253,9 +252,9 @@ var _default = exports["default"] = {
|
|
|
253
252
|
}
|
|
254
253
|
sparqlUpdater.insert_statement(genUserMB, cbgenUserMB);
|
|
255
254
|
};
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
const mb = new Microblog(kb);
|
|
256
|
+
const myFavorites = new Favorites(mb.getMyURI());
|
|
257
|
+
const myFollowList = new FollowList(mb.getMyURI());
|
|
259
258
|
|
|
260
259
|
//* **********************************************
|
|
261
260
|
// FRONT END FUNCTIONALITY
|
|
@@ -264,28 +263,28 @@ var _default = exports["default"] = {
|
|
|
264
263
|
// PANE
|
|
265
264
|
// User Interface for the Microblog Pane
|
|
266
265
|
// ----------------------------------------------
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
const Pane = function (s, doc, microblogPane) {
|
|
267
|
+
const TabManager = function (doc) {
|
|
269
268
|
this.tablist = {};
|
|
270
269
|
this.doc = doc;
|
|
271
270
|
this.tabView = doc.createElement('ul');
|
|
272
271
|
this.tabView.className = 'tabslist';
|
|
273
272
|
};
|
|
274
273
|
TabManager.prototype.create = function (id, caption, view, isDefault) {
|
|
275
|
-
|
|
274
|
+
const tab = this.doc.createElement('li');
|
|
276
275
|
tab.innerHTML = caption;
|
|
277
276
|
if (isDefault) {
|
|
278
277
|
tab.className = 'active';
|
|
279
278
|
}
|
|
280
279
|
tab.id = id;
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
const change = this.change;
|
|
281
|
+
const tablist = this.tablist;
|
|
283
282
|
tab.addEventListener('click', function (evt) {
|
|
284
283
|
change(evt.target.id, tablist, doc);
|
|
285
284
|
}, false);
|
|
286
285
|
this.tablist[id] = {
|
|
287
286
|
view: view.id,
|
|
288
|
-
tab
|
|
287
|
+
tab
|
|
289
288
|
};
|
|
290
289
|
this.tabView.appendChild(tab);
|
|
291
290
|
};
|
|
@@ -293,35 +292,35 @@ var _default = exports["default"] = {
|
|
|
293
292
|
return this.tabView;
|
|
294
293
|
};
|
|
295
294
|
TabManager.prototype.change = function (id, tablist, doc) {
|
|
296
|
-
for (
|
|
295
|
+
for (const tab in tablist) {
|
|
297
296
|
if (tab === id) {
|
|
298
297
|
tablist[id].tab.className = 'active';
|
|
299
298
|
doc.getElementById(tablist[id].view).className += ' active';
|
|
300
299
|
} else {
|
|
301
|
-
|
|
300
|
+
const view = doc.getElementById(tablist[tab].view);
|
|
302
301
|
view.className = view.className.replace(/\w*active\w*/, '');
|
|
303
302
|
tablist[tab].tab.className = tablist[id].tab.className.replace(/\w*active\w*/, '');
|
|
304
303
|
}
|
|
305
304
|
}
|
|
306
305
|
};
|
|
307
306
|
this.microblogPane = microblogPane;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
for (
|
|
307
|
+
const accounts = kb.each(s, FOAF('holdsAccount'));
|
|
308
|
+
let account;
|
|
309
|
+
for (const a in accounts) {
|
|
311
310
|
if (kb.whether(accounts[a], RDF('type'), SIOC('User')) && kb.whether(kb.any(accounts[a], SIOC('creator_of')), RDF('type'), SIOCt('Microblog'))) {
|
|
312
311
|
account = accounts[a];
|
|
313
312
|
break;
|
|
314
313
|
}
|
|
315
314
|
}
|
|
316
315
|
this.Ifollow = kb.whether(kb.sym(mb.getMyURI()), SIOC('follows'), account);
|
|
317
|
-
|
|
316
|
+
const resourceType = kb.any(s, RDF('type'));
|
|
318
317
|
if (resourceType.uri === SIOCt('Microblog').uri || resourceType.uri === SIOCt('MicroblogPost').uri) {
|
|
319
318
|
this.thisIsMe = kb.any(s, SIOC('has_creator')).uri === mb.getMyURI();
|
|
320
319
|
} else if (resourceType.uri === SIOC('User').uri) {
|
|
321
320
|
this.thisIsMe = s.uri === mb.getMyURI();
|
|
322
321
|
} else if (resourceType.uri === FOAF('Person').uri) {
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
const me = _solidLogic.authn.currentUser();
|
|
323
|
+
const meUri = me && me.uri;
|
|
325
324
|
this.thisIsMe = s.uri === meUri;
|
|
326
325
|
} else {
|
|
327
326
|
this.thisIsMe = false;
|
|
@@ -329,7 +328,7 @@ var _default = exports["default"] = {
|
|
|
329
328
|
this.Tab = new TabManager(doc);
|
|
330
329
|
};
|
|
331
330
|
Pane.prototype.notify = function (messageString) {
|
|
332
|
-
|
|
331
|
+
const xmsg = doc.createElement('li');
|
|
333
332
|
xmsg.className = 'notify';
|
|
334
333
|
xmsg.innerHTML = messageString;
|
|
335
334
|
doc.getElementById('notify-container').appendChild(xmsg);
|
|
@@ -339,12 +338,12 @@ var _default = exports["default"] = {
|
|
|
339
338
|
}, 4000);
|
|
340
339
|
};
|
|
341
340
|
Pane.prototype.header = function (s, doc) {
|
|
342
|
-
|
|
341
|
+
const that = this;
|
|
343
342
|
function lsFollowUser() {
|
|
344
|
-
|
|
343
|
+
const myUser = kb.sym(mb.getMyURI());
|
|
345
344
|
// var Ifollow = that.Ifollow
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
const username = that.creator.name;
|
|
346
|
+
const mbconfirmFollow = function (uri, success, _msg) {
|
|
348
347
|
if (success === true) {
|
|
349
348
|
if (!that.Ifollow) {
|
|
350
349
|
// prevent duplicate entries from being added to kb (because that was happening)
|
|
@@ -358,13 +357,13 @@ var _default = exports["default"] = {
|
|
|
358
357
|
that.Ifollow = !that.Ifollow;
|
|
359
358
|
xfollowButton.disabled = false;
|
|
360
359
|
console.log(that.Ifollow);
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
const followButtonLabel = that.Ifollow ? 'Unfollow ' : 'Follow ';
|
|
361
|
+
const doFollow = that.Ifollow ? 'now follow ' : 'no longer follow ';
|
|
363
362
|
xfollowButton.value = followButtonLabel + username;
|
|
364
363
|
that.notify('You ' + doFollow + username + '.');
|
|
365
364
|
}
|
|
366
365
|
};
|
|
367
|
-
|
|
366
|
+
const followMe = new UI.rdf.Statement(myUser, SIOC('follows'), that.creator.sym, myUser);
|
|
368
367
|
xfollowButton.disabled = true;
|
|
369
368
|
xfollowButton.value = 'Updating...';
|
|
370
369
|
if (!that.Ifollow) {
|
|
@@ -373,8 +372,8 @@ var _default = exports["default"] = {
|
|
|
373
372
|
sparqlUpdater.delete_statement(followMe, mbconfirmFollow);
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
const notify = function (messageString) {
|
|
376
|
+
const xmsg = doc.createElement('li');
|
|
378
377
|
xmsg.className = 'notify';
|
|
379
378
|
xmsg.innerHTML = messageString;
|
|
380
379
|
doc.getElementById('notify-container').appendChild(xmsg);
|
|
@@ -383,16 +382,16 @@ var _default = exports["default"] = {
|
|
|
383
382
|
// delete xmsg;
|
|
384
383
|
}, 4000);
|
|
385
384
|
};
|
|
386
|
-
|
|
385
|
+
const mbCancelNewMB = function (_evt) {
|
|
387
386
|
xupdateContainer.removeChild(xupdateContainer.childNodes[xupdateContainer.childNodes.length - 1]);
|
|
388
387
|
xcreateNewMB.disabled = false;
|
|
389
388
|
};
|
|
390
|
-
|
|
389
|
+
const lsCreateNewMB = function (_evt) {
|
|
391
390
|
// disable the create new microblog button.
|
|
392
391
|
// then prefills the information.
|
|
393
392
|
xcreateNewMB.disabled = true;
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
const xcmb = doc.createElement('div');
|
|
394
|
+
const xcmbName = doc.createElement('input');
|
|
396
395
|
if (kb.whether(s, FOAF('name'))) {
|
|
397
396
|
// handle use of FOAF:NAME
|
|
398
397
|
xcmbName.value = kb.any(s, FOAF('name'));
|
|
@@ -402,9 +401,9 @@ var _default = exports["default"] = {
|
|
|
402
401
|
xcmbName.value += kb.any(s, FOAF('family_name')) ? kb.any(s, FOAF('givenname')) : '';
|
|
403
402
|
xcmbName.value = kb.any(s, FOAF('givenname')) + ' ' + kb.any(s, FOAF('family_name'));
|
|
404
403
|
}
|
|
405
|
-
|
|
404
|
+
const xcmbId = doc.createElement('input');
|
|
406
405
|
xcmbId.value = kb.any(s, FOAF('nick')) ? kb.any(s, FOAF('nick')) : '';
|
|
407
|
-
|
|
406
|
+
const xcmbAvatar = doc.createElement('input');
|
|
408
407
|
if (kb.whether(s, FOAF('img'))) {
|
|
409
408
|
// handle use of img
|
|
410
409
|
xcmbAvatar.value = kb.any(s, FOAF('img')).uri;
|
|
@@ -412,11 +411,20 @@ var _default = exports["default"] = {
|
|
|
412
411
|
// otherwise try depiction
|
|
413
412
|
xcmbAvatar.value = kb.any(s, FOAF('depiction')) ? kb.any(s, FOAF('depiction')).uri : '';
|
|
414
413
|
}
|
|
415
|
-
|
|
414
|
+
let workspace;
|
|
416
415
|
// = kb.any(s,WORKSPACE) //TODO - ADD URI FOR WORKSPACE DEFINITION
|
|
417
|
-
|
|
416
|
+
const xcmbWritable = doc.createElement('input');
|
|
418
417
|
xcmbWritable.value = workspace || 'http://dig.csail.mit.edu/2007/wiki/sandbox'; // @@@
|
|
419
|
-
xcmb.innerHTML =
|
|
418
|
+
xcmb.innerHTML = `
|
|
419
|
+
<form class ="createNewMB" id="createNewMB">
|
|
420
|
+
<p id="xcmbname"><span class="">Name: </span></p>
|
|
421
|
+
<p id="xcmbid">Id: </p>
|
|
422
|
+
<p id="xcmbavatar">Avatar: </p>
|
|
423
|
+
<p id="xcmbwritable">Host my microblog at: </p>
|
|
424
|
+
<input type="button" id="mbCancel" value="Cancel" />
|
|
425
|
+
<input type="submit" id="mbCreate" value="Create!" />
|
|
426
|
+
</form>
|
|
427
|
+
`;
|
|
420
428
|
xupdateContainer.appendChild(xcmb);
|
|
421
429
|
doc.getElementById('xcmbname').appendChild(xcmbName);
|
|
422
430
|
doc.getElementById('xcmbid').appendChild(xcmbId);
|
|
@@ -428,17 +436,17 @@ var _default = exports["default"] = {
|
|
|
428
436
|
}, false);
|
|
429
437
|
xcmbName.focus();
|
|
430
438
|
};
|
|
431
|
-
|
|
432
|
-
|
|
439
|
+
const mbSubmitPost = function () {
|
|
440
|
+
const meta = {
|
|
433
441
|
recipients: []
|
|
434
442
|
};
|
|
435
443
|
// user has selected a microblog to post to
|
|
436
444
|
if (mb.getMyURI()) {
|
|
437
445
|
// let myUser = kb.sym(mb.getMyURI())
|
|
438
446
|
// submission callback
|
|
439
|
-
|
|
447
|
+
const cbconfirmSubmit = function (uri, success, responseText, d) {
|
|
440
448
|
if (success === true) {
|
|
441
|
-
for (
|
|
449
|
+
for (const triple in d) {
|
|
442
450
|
kb.add(d[triple].subject, d[triple].predicate, d[triple].object, d[triple].why);
|
|
443
451
|
}
|
|
444
452
|
xupdateSubmit.disabled = false;
|
|
@@ -452,74 +460,65 @@ var _default = exports["default"] = {
|
|
|
452
460
|
notify('There was a problem submitting your post.');
|
|
453
461
|
}
|
|
454
462
|
};
|
|
455
|
-
|
|
456
|
-
|
|
463
|
+
const words = xupdateStatus.value.split(' ');
|
|
464
|
+
const mbUpdateWithReplies = function () {
|
|
457
465
|
xupdateSubmit.disabled = true;
|
|
458
466
|
xupdateSubmit.value = 'Updating...';
|
|
459
467
|
mb.statusUpdate(xupdateStatus.value, cbconfirmSubmit, xinReplyToContainer.value, meta);
|
|
460
468
|
};
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
469
|
+
for (const word in words) {
|
|
470
|
+
if (words[word].match(/@\w+/)) {
|
|
471
|
+
const atUser = words[word].replace(/\W/g, '');
|
|
472
|
+
const recipient = myFollowList.selectUser(atUser);
|
|
473
|
+
if (recipient[0] === true) {
|
|
474
|
+
meta.recipients.push(recipient[1][0]);
|
|
475
|
+
} else if (recipient[1].length > 1) {
|
|
476
|
+
// if multiple users allow the user to choose
|
|
477
|
+
const xrecipients = doc.createElement('select');
|
|
478
|
+
const xrecipientsSubmit = doc.createElement('input');
|
|
479
|
+
xrecipientsSubmit.type = 'button';
|
|
480
|
+
xrecipientsSubmit.value = 'Continue';
|
|
481
|
+
xrecipientsSubmit.addEventListener('click', function () {
|
|
482
|
+
meta.recipients.push(recipient[1][xrecipients.value]);
|
|
483
|
+
mbUpdateWithReplies();
|
|
484
|
+
xrecipients.parentNode.removeChild(xrecipientsSubmit);
|
|
485
|
+
xrecipients.parentNode.removeChild(xrecipients);
|
|
486
|
+
}, false);
|
|
487
|
+
const recipChoice = function (recip, c) {
|
|
488
|
+
const name = kb.any(kb.sym(recip), SIOC('name'));
|
|
489
|
+
const choice = doc.createElement('option');
|
|
490
|
+
choice.value = c;
|
|
491
|
+
choice.innerHTML = name;
|
|
492
|
+
return choice;
|
|
493
|
+
};
|
|
494
|
+
for (const r in recipient[1]) {
|
|
495
|
+
xrecipients.appendChild(recipChoice(recipient[1][r], r));
|
|
496
|
+
}
|
|
497
|
+
xupdateContainer.appendChild(xrecipients);
|
|
498
|
+
xupdateContainer.appendChild(xrecipientsSubmit);
|
|
499
|
+
return;
|
|
500
|
+
} else {
|
|
501
|
+
// no users known or self reference.
|
|
502
|
+
if (String(kb.any(kb.sym(mb.getMyURI()), SIOC('id'))).toLowerCase() === atUser.toLowerCase()) {
|
|
503
|
+
meta.recipients.push(mb.getMyURI());
|
|
494
504
|
} else {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
meta.recipients.push(mb.getMyURI());
|
|
498
|
-
} else {
|
|
499
|
-
notify('You do not follow ' + atUser + '. Try following ' + atUser + ' before mentioning them.');
|
|
500
|
-
return {
|
|
501
|
-
v: void 0
|
|
502
|
-
};
|
|
503
|
-
}
|
|
505
|
+
notify('You do not follow ' + atUser + '. Try following ' + atUser + ' before mentioning them.');
|
|
506
|
+
return;
|
|
504
507
|
}
|
|
505
508
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
}
|
|
512
|
-
_ret;
|
|
513
|
-
for (var word in words) {
|
|
514
|
-
_ret = _loop();
|
|
515
|
-
if (_ret) return _ret.v;
|
|
509
|
+
}
|
|
510
|
+
/* else if(words[word].match(/\#\w+/)){
|
|
511
|
+
//hashtag
|
|
512
|
+
} else if(words[word].match(/\!\w+/)){
|
|
513
|
+
//usergroup
|
|
514
|
+
} */
|
|
516
515
|
}
|
|
517
516
|
mbUpdateWithReplies();
|
|
518
517
|
} else {
|
|
519
518
|
notify('Please set your microblog first.');
|
|
520
519
|
}
|
|
521
520
|
};
|
|
522
|
-
|
|
521
|
+
const mbLetterCount = function () {
|
|
523
522
|
xupdateStatusCounter.innerHTML = charCount - xupdateStatus.value.length;
|
|
524
523
|
xupdateStatusCounter.style.color = charCount - xupdateStatus.value.length < 0 ? '#c33' : '';
|
|
525
524
|
if (xupdateStatus.value.length === 0) {
|
|
@@ -528,28 +527,28 @@ var _default = exports["default"] = {
|
|
|
528
527
|
}
|
|
529
528
|
};
|
|
530
529
|
// reply viewer
|
|
531
|
-
|
|
530
|
+
const xviewReply = doc.createElement('ul');
|
|
532
531
|
xviewReply.className = 'replyView';
|
|
533
532
|
xviewReply.addEventListener('click', function () {
|
|
534
533
|
xviewReply.className = 'replyView';
|
|
535
534
|
}, false);
|
|
536
535
|
this.xviewReply = xviewReply;
|
|
537
|
-
|
|
536
|
+
const headerContainer = doc.createElement('div');
|
|
538
537
|
headerContainer.className = 'header-container';
|
|
539
538
|
|
|
540
539
|
// ---create status update box---
|
|
541
|
-
|
|
540
|
+
const xnotify = doc.createElement('ul');
|
|
542
541
|
xnotify.id = 'notify-container';
|
|
543
542
|
xnotify.className = 'notify-container';
|
|
544
543
|
this.xnotify = xnotify;
|
|
545
|
-
|
|
544
|
+
const xupdateContainer = doc.createElement('form');
|
|
546
545
|
xupdateContainer.className = 'update-container';
|
|
547
546
|
xupdateContainer.innerHTML = '<h3>What are you up to?</h3>';
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
547
|
+
let xinReplyToContainer;
|
|
548
|
+
let xupdateStatus;
|
|
549
|
+
let xupdateStatusCounter;
|
|
550
|
+
let xupdateSubmit;
|
|
551
|
+
let xcreateNewMB;
|
|
553
552
|
if (mb.getMyURI()) {
|
|
554
553
|
xinReplyToContainer = doc.createElement('input');
|
|
555
554
|
xinReplyToContainer.id = 'xinReplyToContainer';
|
|
@@ -571,7 +570,7 @@ var _default = exports["default"] = {
|
|
|
571
570
|
xupdateContainer.appendChild(xupdateSubmit);
|
|
572
571
|
xupdateContainer.addEventListener('submit', mbSubmitPost, false);
|
|
573
572
|
} else {
|
|
574
|
-
|
|
573
|
+
const xnewUser = doc.createTextNode('Hi, it looks like you don\'t have a microblog, ' + ' would you like to create one? ');
|
|
575
574
|
xcreateNewMB = doc.createElement('input');
|
|
576
575
|
xcreateNewMB.type = 'button';
|
|
577
576
|
xcreateNewMB.value = 'Create a new Microblog';
|
|
@@ -580,14 +579,14 @@ var _default = exports["default"] = {
|
|
|
580
579
|
xupdateContainer.appendChild(xcreateNewMB);
|
|
581
580
|
}
|
|
582
581
|
headerContainer.appendChild(xupdateContainer);
|
|
583
|
-
|
|
582
|
+
const subheaderContainer = doc.createElement('div');
|
|
584
583
|
subheaderContainer.className = 'subheader-container';
|
|
585
584
|
|
|
586
585
|
// user header
|
|
587
586
|
// this.creator
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
for (
|
|
587
|
+
const creators = kb.each(s, FOAF('holdsAccount'));
|
|
588
|
+
let creator;
|
|
589
|
+
for (const c in creators) {
|
|
591
590
|
if (kb.whether(creators[c], RDF('type'), SIOC('User')) && kb.whether(kb.any(creators[c], SIOC('creator_of')), RDF('type'), SIOCt('Microblog'))) {
|
|
592
591
|
creator = creators[c];
|
|
593
592
|
// var mb = kb.sym(creator.uri.split("#")[0]);
|
|
@@ -596,17 +595,17 @@ var _default = exports["default"] = {
|
|
|
596
595
|
// TODO add support for more than one microblog in same foaf
|
|
597
596
|
}
|
|
598
597
|
}
|
|
599
|
-
|
|
598
|
+
let xfollowButton;
|
|
600
599
|
if (creator) {
|
|
601
600
|
this.creator = mb.getUser(creator);
|
|
602
601
|
// ---display avatar, if available ---
|
|
603
602
|
if (this.creator.avatar !== '') {
|
|
604
|
-
|
|
603
|
+
const avatar = doc.createElement('img');
|
|
605
604
|
avatar.src = this.creator.avatar.uri;
|
|
606
605
|
subheaderContainer.appendChild(avatar);
|
|
607
606
|
}
|
|
608
607
|
// ---generate name ---
|
|
609
|
-
|
|
608
|
+
const userName = doc.createElement('h1');
|
|
610
609
|
userName.className = 'fn';
|
|
611
610
|
userName.appendChild(doc.createTextNode(this.creator.name + ' (' + this.creator.id + ')'));
|
|
612
611
|
subheaderContainer.appendChild(userName);
|
|
@@ -614,14 +613,14 @@ var _default = exports["default"] = {
|
|
|
614
613
|
if (!this.thisIsMe && mb.getMyURI()) {
|
|
615
614
|
xfollowButton = doc.createElement('input');
|
|
616
615
|
xfollowButton.setAttribute('type', 'button');
|
|
617
|
-
|
|
616
|
+
const followButtonLabel = this.Ifollow ? 'Unfollow ' : 'Follow ';
|
|
618
617
|
xfollowButton.value = followButtonLabel + this.creator.name;
|
|
619
618
|
xfollowButton.addEventListener('click', lsFollowUser, false);
|
|
620
619
|
subheaderContainer.appendChild(xfollowButton);
|
|
621
620
|
}
|
|
622
621
|
// user header end
|
|
623
622
|
// header tabs
|
|
624
|
-
|
|
623
|
+
const xtabsList = this.Tab.getTabView();
|
|
625
624
|
headerContainer.appendChild(subheaderContainer);
|
|
626
625
|
headerContainer.appendChild(xtabsList);
|
|
627
626
|
}
|
|
@@ -632,47 +631,47 @@ var _default = exports["default"] = {
|
|
|
632
631
|
generatePost - Creates and formats microblog posts
|
|
633
632
|
post - symbol of the uri the post in question
|
|
634
633
|
*/
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
for (
|
|
634
|
+
const that = this;
|
|
635
|
+
const viewPost = function (uris) {
|
|
636
|
+
const xviewReply = that.xviewReply;
|
|
637
|
+
for (let i = 0; i < xviewReply.childNodes.length; i++) {
|
|
639
638
|
xviewReply.removeChild(xviewReply.childNodes[0]);
|
|
640
639
|
}
|
|
641
|
-
|
|
640
|
+
const xcloseContainer = doc.createElement('li');
|
|
642
641
|
xcloseContainer.className = 'closeContainer';
|
|
643
|
-
|
|
642
|
+
const xcloseButton = doc.createElement('span');
|
|
644
643
|
xcloseButton.innerHTML = '×';
|
|
645
644
|
xcloseButton.className = 'closeButton';
|
|
646
645
|
xcloseContainer.appendChild(xcloseButton);
|
|
647
646
|
xviewReply.appendChild(xcloseContainer);
|
|
648
|
-
for (
|
|
647
|
+
for (const uri in uris) {
|
|
649
648
|
xviewReply.appendChild(that.generatePost(kb.sym(uris[uri]), this.thisIsMe, 'view'));
|
|
650
649
|
}
|
|
651
650
|
xviewReply.className = 'replyView-active';
|
|
652
651
|
that.microblogPane.appendChild(xviewReply);
|
|
653
652
|
};
|
|
654
653
|
// container for post
|
|
655
|
-
|
|
654
|
+
const xpost = doc.createElement('li');
|
|
656
655
|
xpost.className = 'post';
|
|
657
656
|
xpost.setAttribute('id', String(post.uri).split('#')[1]);
|
|
658
|
-
|
|
657
|
+
const Post = mb.getPost(post);
|
|
659
658
|
// username text
|
|
660
659
|
// var uname = kb.any(kb.any(post, SIOC('has_creator')), SIOC('id'))
|
|
661
|
-
|
|
662
|
-
|
|
660
|
+
const uholdsaccount = kb.any(undefined, FOAF('holdsAccount'), kb.any(post, SIOC('has_creator')));
|
|
661
|
+
const xuname = doc.createElement('a');
|
|
663
662
|
xuname.href = uholdsaccount.uri;
|
|
664
663
|
xuname.className = 'userLink';
|
|
665
|
-
|
|
664
|
+
const xunameText = doc.createTextNode(mb.getUser(Post.creator).id);
|
|
666
665
|
xuname.appendChild(xunameText);
|
|
667
666
|
// user image
|
|
668
|
-
|
|
667
|
+
const xuavatar = doc.createElement('img');
|
|
669
668
|
xuavatar.src = mb.getUser(Post.creator).avatar.uri;
|
|
670
669
|
xuavatar.className = 'postAvatar';
|
|
671
670
|
// post content
|
|
672
|
-
|
|
673
|
-
|
|
671
|
+
const xpostContent = doc.createElement('blockquote');
|
|
672
|
+
let postText = Post.message;
|
|
674
673
|
// post date
|
|
675
|
-
|
|
674
|
+
const xpostLink = doc.createElement('a');
|
|
676
675
|
xpostLink.className = 'postLink';
|
|
677
676
|
xpostLink.addEventListener('click', function () {
|
|
678
677
|
viewPost([post.uri]);
|
|
@@ -680,38 +679,38 @@ var _default = exports["default"] = {
|
|
|
680
679
|
xpostLink.id = 'post_' + String(post.uri).split('#')[1];
|
|
681
680
|
xpostLink.setAttribute('content', post.uri);
|
|
682
681
|
xpostLink.setAttribute('property', 'permalink');
|
|
683
|
-
|
|
682
|
+
const postLink = doc.createTextNode(Post.date ? Post.date : 'post date unknown');
|
|
684
683
|
xpostLink.appendChild(postLink);
|
|
685
684
|
|
|
686
685
|
// LINK META DATA (MENTIONS, HASHTAGS, GROUPS)
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
for (
|
|
686
|
+
const mentions = kb.each(post, SIOC('topic'));
|
|
687
|
+
const tags = {};
|
|
688
|
+
for (const mention in mentions) {
|
|
690
689
|
sf.lookUpThing(mentions[mention]);
|
|
691
|
-
|
|
690
|
+
const id = kb.any(mentions[mention], SIOC('id'));
|
|
692
691
|
tags['@' + id] = mentions[mention];
|
|
693
692
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
693
|
+
const postTags = postText.match(/(@|#|!)\w+/g);
|
|
694
|
+
const postFunction = function () {
|
|
695
|
+
const p = postTags.pop();
|
|
697
696
|
return tags[p] ? kb.any(undefined, FOAF('holdsAccount'), tags[p]).uri : p;
|
|
698
697
|
};
|
|
699
|
-
for (
|
|
700
|
-
|
|
701
|
-
|
|
698
|
+
for (const t in tags) {
|
|
699
|
+
const person = t.replace(/@/, '');
|
|
700
|
+
const replacePerson = RegExp('(@|!|#)(' + person + ')');
|
|
702
701
|
postText = postText.replace(replacePerson, '$1<a href="' + postFunction() + '">$2</a>');
|
|
703
702
|
}
|
|
704
703
|
xpostContent.innerHTML = postText;
|
|
705
704
|
|
|
706
705
|
// in reply to logic
|
|
707
706
|
// This has the potential to support a post that replies to many messages.
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
for (
|
|
707
|
+
const inReplyTo = kb.each(post, SIOC('reply_of'));
|
|
708
|
+
const xreplyTo = doc.createElement('span');
|
|
709
|
+
let theReply;
|
|
710
|
+
for (const reply in inReplyTo) {
|
|
712
711
|
theReply = String(inReplyTo[reply]).replace(/<|>/g, '');
|
|
713
|
-
|
|
714
|
-
|
|
712
|
+
const genReplyTo = function () {
|
|
713
|
+
const reply = doc.createElement('a');
|
|
715
714
|
reply.innerHTML = ', <b>in reply to</b>';
|
|
716
715
|
reply.addEventListener('click', function () {
|
|
717
716
|
viewPost([post.uri, theReply]);
|
|
@@ -724,23 +723,23 @@ var _default = exports["default"] = {
|
|
|
724
723
|
|
|
725
724
|
// END LINK META DATA
|
|
726
725
|
// add the reply to and delete buttons to the interface
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
726
|
+
const mbReplyTo = function () {
|
|
727
|
+
const id = mb.getUser(Post.creator).id;
|
|
728
|
+
const xupdateStatus = doc.getElementById('xupdateStatus');
|
|
729
|
+
const xinReplyToContainer = doc.getElementById('xinReplyToContainer');
|
|
730
|
+
const xupdateSubmit = doc.getElementById('xupdateSubmit');
|
|
732
731
|
xupdateStatus.value = '@' + id + ' ';
|
|
733
732
|
xupdateStatus.focus();
|
|
734
733
|
xinReplyToContainer.value = post.uri;
|
|
735
734
|
xupdateSubmit.value = 'Reply';
|
|
736
735
|
};
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
736
|
+
let xconfirmDeletionDialog;
|
|
737
|
+
const mbDeletePost = function (evt) {
|
|
738
|
+
const lsconfirmNo = function () {
|
|
740
739
|
doc.getElementById('notify-container').removeChild(xconfirmDeletionDialog);
|
|
741
740
|
evt.target.disabled = false;
|
|
742
741
|
};
|
|
743
|
-
|
|
742
|
+
const lsconfirmYes = function () {
|
|
744
743
|
reallyDelete();
|
|
745
744
|
doc.getElementById('notify-container').removeChild(xconfirmDeletionDialog);
|
|
746
745
|
};
|
|
@@ -753,12 +752,12 @@ var _default = exports["default"] = {
|
|
|
753
752
|
lsconfirmNo();
|
|
754
753
|
}
|
|
755
754
|
}, false);
|
|
756
|
-
|
|
755
|
+
const confirmyes = doc.createElement('input');
|
|
757
756
|
confirmyes.type = 'button';
|
|
758
757
|
confirmyes.className = 'confirm';
|
|
759
758
|
confirmyes.value = 'Delete';
|
|
760
759
|
confirmyes.addEventListener('click', lsconfirmYes, false);
|
|
761
|
-
|
|
760
|
+
const confirmno = doc.createElement('input');
|
|
762
761
|
confirmno.type = 'button';
|
|
763
762
|
confirmno.className = 'confirm';
|
|
764
763
|
confirmno.value = 'Cancel';
|
|
@@ -767,13 +766,13 @@ var _default = exports["default"] = {
|
|
|
767
766
|
xconfirmDeletionDialog.appendChild(confirmyes);
|
|
768
767
|
doc.getElementById('notify-container').appendChild(xconfirmDeletionDialog);
|
|
769
768
|
confirmno.focus();
|
|
770
|
-
|
|
769
|
+
const reallyDelete = function () {
|
|
771
770
|
// callback after deletion
|
|
772
|
-
|
|
771
|
+
const mbconfirmDeletePost = function (a, success) {
|
|
773
772
|
if (success) {
|
|
774
773
|
that.notify('Post deleted.');
|
|
775
774
|
// update the ui to reflect model changes.
|
|
776
|
-
|
|
775
|
+
const deleteThisNode = evt.target.parentNode;
|
|
777
776
|
deleteThisNode.parentNode.removeChild(deleteThisNode);
|
|
778
777
|
kb.removeMany(deleteMe);
|
|
779
778
|
} else {
|
|
@@ -782,9 +781,9 @@ var _default = exports["default"] = {
|
|
|
782
781
|
}
|
|
783
782
|
};
|
|
784
783
|
// delete references to post
|
|
785
|
-
|
|
784
|
+
const deleteContainerOf = function (a, success) {
|
|
786
785
|
if (success) {
|
|
787
|
-
|
|
786
|
+
const deleteContainer = kb.statementsMatching(undefined, SIOC('container_of'), kb.sym(doc.getElementById('post_' + evt.target.parentNode.id).getAttribute('content')));
|
|
788
787
|
sparqlUpdater.batch_delete_statement(deleteContainer, mbconfirmDeletePost);
|
|
789
788
|
} else {
|
|
790
789
|
that.notify('Oops, there was a problem, please try again');
|
|
@@ -793,13 +792,13 @@ var _default = exports["default"] = {
|
|
|
793
792
|
};
|
|
794
793
|
// delete attributes of post
|
|
795
794
|
evt.target.disabled = true;
|
|
796
|
-
|
|
795
|
+
const deleteMe = kb.statementsMatching(kb.sym(doc.getElementById('post_' + evt.target.parentNode.id).getAttribute('content')));
|
|
797
796
|
sparqlUpdater.batch_delete_statement(deleteMe, deleteContainerOf);
|
|
798
797
|
};
|
|
799
798
|
};
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
799
|
+
let themaker;
|
|
800
|
+
let xreplyButton;
|
|
801
|
+
let xdeleteButton;
|
|
803
802
|
if (mb.getMyURI()) {
|
|
804
803
|
// If the microblog in question does not belong to the user,
|
|
805
804
|
// display the delete post and reply to post buttons.
|
|
@@ -818,11 +817,11 @@ var _default = exports["default"] = {
|
|
|
818
817
|
xdeleteButton.addEventListener('click', mbDeletePost, false);
|
|
819
818
|
}
|
|
820
819
|
}
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
820
|
+
const mbFavorite = function (evt) {
|
|
821
|
+
const nid = evt.target.parentNode.id;
|
|
822
|
+
const favpost = doc.getElementById('post_' + nid).getAttribute('content');
|
|
824
823
|
xfavorite.className += ' ing';
|
|
825
|
-
|
|
824
|
+
const cbFavorite = function (a, success, _c, _d) {
|
|
826
825
|
if (success) {
|
|
827
826
|
xfavorite.className = xfavorite.className.split(' ')[1] === 'ed' ? 'favorit' : 'favorit ed';
|
|
828
827
|
}
|
|
@@ -833,7 +832,7 @@ var _default = exports["default"] = {
|
|
|
833
832
|
myFavorites.remove(favpost, cbFavorite);
|
|
834
833
|
}
|
|
835
834
|
};
|
|
836
|
-
|
|
835
|
+
const xfavorite = doc.createElement('a');
|
|
837
836
|
xfavorite.innerHTML = '★';
|
|
838
837
|
xfavorite.addEventListener('click', mbFavorite, false);
|
|
839
838
|
if (myFavorites.favorited(post.uri)) {
|
|
@@ -864,40 +863,40 @@ var _default = exports["default"] = {
|
|
|
864
863
|
generatePostList - Generate the posts and
|
|
865
864
|
display their results on the interface.
|
|
866
865
|
*/
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
for (
|
|
871
|
-
|
|
866
|
+
const postList = doc.createElement('ul');
|
|
867
|
+
const postlist = {};
|
|
868
|
+
const datelist = [];
|
|
869
|
+
for (const post in gmbPosts) {
|
|
870
|
+
const postDate = kb.any(gmbPosts[post], terms('created'));
|
|
872
871
|
if (postDate) {
|
|
873
872
|
datelist.push(postDate);
|
|
874
873
|
postlist[postDate] = this.generatePost(gmbPosts[post], this.thisIsMe);
|
|
875
874
|
}
|
|
876
875
|
}
|
|
877
876
|
datelist.sort().reverse();
|
|
878
|
-
for (
|
|
877
|
+
for (const d in datelist) {
|
|
879
878
|
postList.appendChild(postlist[datelist[d]]);
|
|
880
879
|
}
|
|
881
880
|
return postList;
|
|
882
881
|
};
|
|
883
882
|
Pane.prototype.followsView = function () {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
883
|
+
const getFollowed = function (user) {
|
|
884
|
+
let userid = kb.any(user, SIOC('id'));
|
|
885
|
+
const follow = doc.createElement('li');
|
|
887
886
|
follow.className = 'follow';
|
|
888
887
|
userid = userid || user.uri;
|
|
889
|
-
|
|
888
|
+
let fol = kb.any(undefined, FOAF('holdsAccount'), user);
|
|
890
889
|
fol = fol ? fol.uri : user.uri;
|
|
891
890
|
follow.innerHTML = '<a href="' + fol + '">' + userid + '</a>';
|
|
892
891
|
return follow;
|
|
893
892
|
};
|
|
894
|
-
|
|
893
|
+
const xfollows = doc.createElement('div');
|
|
895
894
|
xfollows.id = 'xfollows';
|
|
896
895
|
xfollows.className = 'followlist-container view-container';
|
|
897
896
|
if (this.creator && kb.whether(this.creator.sym, SIOC('follows'))) {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
for (
|
|
897
|
+
const creatorFollows = kb.each(this.creator.sym, SIOC('follows'));
|
|
898
|
+
const xfollowsList = doc.createElement('ul');
|
|
899
|
+
for (const thisPerson in creatorFollows) {
|
|
901
900
|
xfollowsList.appendChild(getFollowed(creatorFollows[thisPerson]));
|
|
902
901
|
}
|
|
903
902
|
xfollows.appendChild(xfollowsList);
|
|
@@ -906,19 +905,19 @@ var _default = exports["default"] = {
|
|
|
906
905
|
return xfollows;
|
|
907
906
|
};
|
|
908
907
|
Pane.prototype.streamView = function (s, doc) {
|
|
909
|
-
|
|
908
|
+
const postContainer = doc.createElement('div');
|
|
910
909
|
postContainer.id = 'postContainer';
|
|
911
910
|
postContainer.className = 'post-container view-container active';
|
|
912
|
-
|
|
911
|
+
let mbPosts = [];
|
|
913
912
|
if (kb.whether(s, FOAF('name')) && kb.whether(s, FOAF('holdsAccount'))) {
|
|
914
913
|
sf.lookUpThing(kb.any(s, FOAF('holdsAccount')));
|
|
915
|
-
|
|
916
|
-
for (
|
|
914
|
+
const follows = kb.each(kb.any(s, FOAF('holdsAccount')), SIOC('follows'));
|
|
915
|
+
for (const f in follows) {
|
|
917
916
|
sf.lookUpThing(follows[f]);
|
|
918
917
|
// look up people user follows
|
|
919
|
-
|
|
918
|
+
const smicroblogs = kb.each(follows[f], SIOC('creator_of'));
|
|
920
919
|
// get the follows microblogs
|
|
921
|
-
for (
|
|
920
|
+
for (const smb in smicroblogs) {
|
|
922
921
|
sf.lookUpThing(smicroblogs[smb]);
|
|
923
922
|
if (kb.whether(smicroblogs[smb], SIOC('topic'), follows[f])) {
|
|
924
923
|
continue;
|
|
@@ -929,7 +928,7 @@ var _default = exports["default"] = {
|
|
|
929
928
|
}
|
|
930
929
|
}
|
|
931
930
|
if (mbPosts.length > 0) {
|
|
932
|
-
|
|
931
|
+
const postList = this.generatePostList(mbPosts);
|
|
933
932
|
// generate stream
|
|
934
933
|
postList.id = 'postList';
|
|
935
934
|
postList.className = 'postList';
|
|
@@ -939,19 +938,19 @@ var _default = exports["default"] = {
|
|
|
939
938
|
return postContainer;
|
|
940
939
|
};
|
|
941
940
|
Pane.prototype.notificationsView = function (s, doc) {
|
|
942
|
-
|
|
941
|
+
const postNotificationContainer = doc.createElement('div');
|
|
943
942
|
postNotificationContainer.id = 'postNotificationContainer';
|
|
944
943
|
postNotificationContainer.className = 'notification-container view-container';
|
|
945
|
-
|
|
944
|
+
const postMentionContainer = doc.createElement('div');
|
|
946
945
|
postMentionContainer.id = 'postMentionContainer';
|
|
947
946
|
postMentionContainer.className = 'mention-container view-container';
|
|
948
|
-
|
|
949
|
-
|
|
947
|
+
let mbnPosts = [];
|
|
948
|
+
let mbmPosts = [];
|
|
950
949
|
// get mbs that I am the creator of.
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
for (
|
|
950
|
+
const theUser = kb.any(s, FOAF('holdsAccount'));
|
|
951
|
+
const user = kb.any(theUser, SIOC('id'));
|
|
952
|
+
const microblogs = kb.each(theUser, SIOC('creator_of'));
|
|
953
|
+
for (const mbm in microblogs) {
|
|
955
954
|
sf.lookUpThing(microblogs[mbm]);
|
|
956
955
|
if (kb.whether(microblogs[mbm], SIOC('topic'), theUser)) {
|
|
957
956
|
mbmPosts = mbmPosts.concat(kb.each(microblogs[mbm], SIOC('container_of')));
|
|
@@ -961,11 +960,11 @@ var _default = exports["default"] = {
|
|
|
961
960
|
}
|
|
962
961
|
}
|
|
963
962
|
}
|
|
964
|
-
|
|
963
|
+
const postNotificationList = this.generatePostList(mbnPosts);
|
|
965
964
|
postNotificationList.id = 'postNotificationList';
|
|
966
965
|
postNotificationList.className = 'postList';
|
|
967
966
|
postNotificationContainer.appendChild(postNotificationList);
|
|
968
|
-
|
|
967
|
+
const postMentionList = this.generatePostList(mbmPosts);
|
|
969
968
|
postMentionList.id = 'postMentionList';
|
|
970
969
|
postMentionList.className = 'postList';
|
|
971
970
|
postMentionContainer.appendChild(postMentionList);
|
|
@@ -975,7 +974,7 @@ var _default = exports["default"] = {
|
|
|
975
974
|
this.Tab.create('tab-at-user', '@' + user, postMentionContainer, false);
|
|
976
975
|
};
|
|
977
976
|
Pane.prototype.build = function () {
|
|
978
|
-
|
|
977
|
+
const microblogPane = this.microblogPane;
|
|
979
978
|
this.headerContainer = this.header(s, doc);
|
|
980
979
|
this.postContainer = this.streamView(s, doc);
|
|
981
980
|
this.notificationsView(s, doc);
|
|
@@ -991,7 +990,7 @@ var _default = exports["default"] = {
|
|
|
991
990
|
microblogPane.appendChild(this.postNotificationContainer);
|
|
992
991
|
microblogPane.appendChild(this.postMentionContainer);
|
|
993
992
|
};
|
|
994
|
-
|
|
993
|
+
const microblogpane = doc.createElement('div');
|
|
995
994
|
// var getusersfollows = function(uri){
|
|
996
995
|
// var follows = new Object();
|
|
997
996
|
// var followsa = {follows:0, matches:0};
|
|
@@ -1011,7 +1010,7 @@ var _default = exports["default"] = {
|
|
|
1011
1010
|
// followsa.matches = (follows[uri]) ? followsa.matches+1: followsa.matches;
|
|
1012
1011
|
// console.log(follows.toSource());
|
|
1013
1012
|
// if(followsa.follows == followsa.matches ){
|
|
1014
|
-
|
|
1013
|
+
const ppane = new Pane(s, doc, microblogpane);
|
|
1015
1014
|
ppane.build();
|
|
1016
1015
|
// return false;
|
|
1017
1016
|
// }
|