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