solid-panes 3.7.3 → 4.0.0-cc645f25
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 +46 -40
- 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,49 +0,0 @@
|
|
|
1
|
-
/* Sharing Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane allows a user to view and adjust the sharing -- access control lists
|
|
4
|
-
** for anything which has that capability.
|
|
5
|
-
**
|
|
6
|
-
** I am using in places single quotes strings like 'this'
|
|
7
|
-
** where internationalization ("i18n") is not a problem, and double quoted
|
|
8
|
-
** like "this" where the string is seen by the user and so I18n is an issue.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { aclControl, icons, ns } from 'solid-ui'
|
|
12
|
-
|
|
13
|
-
const sharingPane = {
|
|
14
|
-
icon: icons.iconBase + 'padlock-timbl.svg',
|
|
15
|
-
|
|
16
|
-
name: 'sharing',
|
|
17
|
-
|
|
18
|
-
label: (subject, context) => {
|
|
19
|
-
const store = context.session.store
|
|
20
|
-
const t = store.findTypeURIs(subject)
|
|
21
|
-
if (t[ns.ldp('Resource').uri]) return 'Sharing' // @@ be more sophisticated?
|
|
22
|
-
if (t[ns.ldp('Container').uri]) return 'Sharing' // @@ be more sophisticated?
|
|
23
|
-
if (t[ns.ldp('BasicContainer').uri]) return 'Sharing' // @@ be more sophisticated?
|
|
24
|
-
// check being allowed to see/change sharing?
|
|
25
|
-
return null // No under other circumstances
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
render: (subject, context) => {
|
|
29
|
-
const dom = context.dom
|
|
30
|
-
const store = context.session.store
|
|
31
|
-
const noun = getNoun()
|
|
32
|
-
|
|
33
|
-
const div = dom.createElement('div')
|
|
34
|
-
div.classList.add('sharingPane')
|
|
35
|
-
aclControl.preventBrowserDropEvents(dom)
|
|
36
|
-
div.appendChild(aclControl.ACLControlBox5(subject, context, noun, store))
|
|
37
|
-
return div
|
|
38
|
-
|
|
39
|
-
function getNoun () {
|
|
40
|
-
const t = store.findTypeURIs(subject)
|
|
41
|
-
if (t[ns.ldp('BasicContainer').uri] || t[ns.ldp('Container').uri]) {
|
|
42
|
-
return 'folder'
|
|
43
|
-
}
|
|
44
|
-
return 'file'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default sharingPane
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/* slideshow Pane
|
|
2
|
-
**
|
|
3
|
-
*/
|
|
4
|
-
import * as UI from 'solid-ui'
|
|
5
|
-
const ns = UI.ns
|
|
6
|
-
|
|
7
|
-
import makeBSS from '@solid/better-simple-slideshow'
|
|
8
|
-
|
|
9
|
-
export const slideshowPane = {
|
|
10
|
-
icon: UI.icons.iconBase + 'noun_138712.svg',
|
|
11
|
-
|
|
12
|
-
name: 'slideshow',
|
|
13
|
-
|
|
14
|
-
audience: [ns.solid('PowerUser')],
|
|
15
|
-
|
|
16
|
-
// Does the subject deserve an slideshow pane?
|
|
17
|
-
label: function (subject, context) {
|
|
18
|
-
const store = context.session.store
|
|
19
|
-
const ns = UI.ns
|
|
20
|
-
const t = store.findTypeURIs(subject)
|
|
21
|
-
if (t[ns.ldp('Container').uri] || t[ns.ldp('BasicContainer').uri]) {
|
|
22
|
-
const contents = store.each(subject, ns.ldp('contains'))
|
|
23
|
-
let count = 0
|
|
24
|
-
contents.forEach(function (file) {
|
|
25
|
-
if (UI.widgets.isImage(file)) count++
|
|
26
|
-
})
|
|
27
|
-
return count > 0 ? 'Slideshow' : null
|
|
28
|
-
}
|
|
29
|
-
return null
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
// See https://github.com/leemark/better-simple-slideshow
|
|
33
|
-
// and follow instructions there
|
|
34
|
-
render: function (subject, context) {
|
|
35
|
-
const dom = context.dom
|
|
36
|
-
const styleSheet =
|
|
37
|
-
'https://leemark.github.io/better-simple-slideshow/css/simple-slideshow-styles.css'
|
|
38
|
-
UI.widgets.addStyleSheet(dom, styleSheet)
|
|
39
|
-
|
|
40
|
-
const store = context.session.store
|
|
41
|
-
const ns = UI.ns
|
|
42
|
-
const div = dom.createElement('div')
|
|
43
|
-
div.setAttribute('class', 'bss-slides')
|
|
44
|
-
|
|
45
|
-
const t = store.findTypeURIs(subject)
|
|
46
|
-
let predicate
|
|
47
|
-
if (t[ns.ldp('BasicContainer').uri] || t[ns.ldp('Container').uri]) {
|
|
48
|
-
predicate = ns.ldp('contains')
|
|
49
|
-
}
|
|
50
|
-
const images = store.each(subject, predicate) // @@ random order?
|
|
51
|
-
// @@ Ideally: sort by embedded time of image
|
|
52
|
-
images.sort() // Sort for now by URI
|
|
53
|
-
for (let i = 0; i < images.length; i++) {
|
|
54
|
-
if (!UI.widgets.isImage(images[i])) continue
|
|
55
|
-
const figure = div.appendChild(dom.createElement('figure'))
|
|
56
|
-
const img = figure.appendChild(dom.createElement('img'))
|
|
57
|
-
|
|
58
|
-
// get image with authenticated fetch
|
|
59
|
-
store.fetcher._fetch(images[i].uri)
|
|
60
|
-
.then(function(response) {
|
|
61
|
-
return response.blob()
|
|
62
|
-
})
|
|
63
|
-
.then(function(myBlob) {
|
|
64
|
-
const objectURL = URL.createObjectURL(myBlob)
|
|
65
|
-
img.setAttribute('src', objectURL) // w640 h480 //
|
|
66
|
-
})
|
|
67
|
-
img.setAttribute('width', '100%')
|
|
68
|
-
figure.appendChild(dom.createElement('figcaption'))
|
|
69
|
-
}
|
|
70
|
-
const options = { dom: dom }
|
|
71
|
-
|
|
72
|
-
setTimeout(function () {
|
|
73
|
-
makeBSS('.bss-slides', options)
|
|
74
|
-
}, 1000) // Must run after the code which called this
|
|
75
|
-
|
|
76
|
-
return div
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ends
|
package/src/socialPane.js
DELETED
|
@@ -1,523 +0,0 @@
|
|
|
1
|
-
/* Social Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane provides social network functions
|
|
4
|
-
** Using for example the FOAF ontology.
|
|
5
|
-
** Goal: A *distributed* version of facebook, advogato, etc etc
|
|
6
|
-
** - Similarly easy user interface, but data storage distributed
|
|
7
|
-
** - Read and write both user-private (address book) and public data clearly
|
|
8
|
-
** -- todo: use common code to get username and load profile and set 'me'
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as UI from 'solid-ui'
|
|
12
|
-
import { authn } from 'solid-logic'
|
|
13
|
-
|
|
14
|
-
export const socialPane = {
|
|
15
|
-
icon: UI.icons.originalIconBase + 'foaf/foafTiny.gif',
|
|
16
|
-
|
|
17
|
-
name: 'social',
|
|
18
|
-
|
|
19
|
-
label: function (subject, context) {
|
|
20
|
-
const kb = context.session.store
|
|
21
|
-
const types = kb.findTypeURIs(subject)
|
|
22
|
-
if (
|
|
23
|
-
types[UI.ns.foaf('Person').uri] ||
|
|
24
|
-
types[UI.ns.vcard('Individual').uri]
|
|
25
|
-
) {
|
|
26
|
-
return 'Friends'
|
|
27
|
-
}
|
|
28
|
-
return null
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
render: function (s, context) {
|
|
32
|
-
const dom = context.dom
|
|
33
|
-
const common = function (x, y) {
|
|
34
|
-
// Find common members of two lists
|
|
35
|
-
const both = []
|
|
36
|
-
for (let i = 0; i < x.length; i++) {
|
|
37
|
-
for (let j = 0; j < y.length; j++) {
|
|
38
|
-
if (y[j].sameTerm(x[i])) {
|
|
39
|
-
both.push(y[j])
|
|
40
|
-
break
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return both
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const people = function (n) {
|
|
48
|
-
let res = ' '
|
|
49
|
-
res += n || 'no'
|
|
50
|
-
if (n === 1) return res + ' person'
|
|
51
|
-
return res + ' people'
|
|
52
|
-
}
|
|
53
|
-
const say = function (str) {
|
|
54
|
-
console.log(str)
|
|
55
|
-
const p = dom.createElement('p')
|
|
56
|
-
p.textContent = str
|
|
57
|
-
tips.appendChild(p)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const link = function (contents, uri) {
|
|
61
|
-
if (!uri) return contents
|
|
62
|
-
const a = dom.createElement('a')
|
|
63
|
-
a.setAttribute('href', uri)
|
|
64
|
-
a.appendChild(contents)
|
|
65
|
-
return a
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const text = function (str) {
|
|
69
|
-
return dom.createTextNode(str)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const buildCheckboxForm = function (lab, statement, state) {
|
|
73
|
-
const f = dom.createElement('form')
|
|
74
|
-
const input = dom.createElement('input')
|
|
75
|
-
f.appendChild(input)
|
|
76
|
-
const tx = dom.createTextNode(lab)
|
|
77
|
-
tx.className = 'question'
|
|
78
|
-
f.appendChild(tx)
|
|
79
|
-
input.setAttribute('type', 'checkbox')
|
|
80
|
-
const boxHandler = function (_e) {
|
|
81
|
-
tx.className = 'pendingedit'
|
|
82
|
-
// alert('Should be greyed out')
|
|
83
|
-
if (this.checked) {
|
|
84
|
-
// Add link
|
|
85
|
-
try {
|
|
86
|
-
outliner.UserInput.sparqler.insert_statement(statement, function (
|
|
87
|
-
uri,
|
|
88
|
-
success,
|
|
89
|
-
errorBody
|
|
90
|
-
) {
|
|
91
|
-
tx.className = 'question'
|
|
92
|
-
if (!success) {
|
|
93
|
-
UI.log.alert(
|
|
94
|
-
null,
|
|
95
|
-
'Message',
|
|
96
|
-
'Error occurs while inserting ' +
|
|
97
|
-
statement +
|
|
98
|
-
'\n\n' +
|
|
99
|
-
errorBody
|
|
100
|
-
)
|
|
101
|
-
input.checked = false // rollback UI
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
kb.add(
|
|
105
|
-
statement.subject,
|
|
106
|
-
statement.predicate,
|
|
107
|
-
statement.object,
|
|
108
|
-
statement.why
|
|
109
|
-
)
|
|
110
|
-
})
|
|
111
|
-
} catch (e) {
|
|
112
|
-
UI.log.error('Data write fails:' + e)
|
|
113
|
-
UI.log.alert('Data write fails:' + e)
|
|
114
|
-
input.checked = false // rollback UI
|
|
115
|
-
tx.className = 'question'
|
|
116
|
-
}
|
|
117
|
-
} else {
|
|
118
|
-
// Remove link
|
|
119
|
-
try {
|
|
120
|
-
outliner.UserInput.sparqler.delete_statement(statement, function (
|
|
121
|
-
uri,
|
|
122
|
-
success,
|
|
123
|
-
errorBody
|
|
124
|
-
) {
|
|
125
|
-
tx.className = 'question'
|
|
126
|
-
if (!success) {
|
|
127
|
-
UI.log.alert(
|
|
128
|
-
'Error occurs while deleting ' +
|
|
129
|
-
statement +
|
|
130
|
-
'\n\n' +
|
|
131
|
-
errorBody
|
|
132
|
-
)
|
|
133
|
-
this.checked = true // Rollback UI
|
|
134
|
-
} else {
|
|
135
|
-
kb.removeMany(
|
|
136
|
-
statement.subject,
|
|
137
|
-
statement.predicate,
|
|
138
|
-
statement.object,
|
|
139
|
-
statement.why
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
} catch (e) {
|
|
144
|
-
UI.log.alert('Delete fails:' + e)
|
|
145
|
-
this.checked = true // Rollback UI
|
|
146
|
-
// return
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
input.checked = state
|
|
151
|
-
input.addEventListener('click', boxHandler, false)
|
|
152
|
-
return f
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const oneFriend = function (friend, _confirmed) {
|
|
156
|
-
return UI.widgets.personTR(dom, UI.ns.foaf('knows'), friend, {})
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// ////////// Body of render():
|
|
160
|
-
|
|
161
|
-
const outliner = context.getOutliner(dom)
|
|
162
|
-
const kb = context.session.store
|
|
163
|
-
const div = dom.createElement('div')
|
|
164
|
-
div.setAttribute('class', 'socialPane')
|
|
165
|
-
const foaf = UI.ns.foaf
|
|
166
|
-
const vcard = UI.ns.vcard
|
|
167
|
-
|
|
168
|
-
// extracted from tabbedtab.css 2017-03-21
|
|
169
|
-
const navBlockStyle =
|
|
170
|
-
'background-color: #eee; width: 25%; border: 0; padding: 0.5em; margin: 0;'
|
|
171
|
-
const mainBlockStyle =
|
|
172
|
-
'background-color: #fff; color: #000; width: 46%; margin: 0; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 0;'
|
|
173
|
-
const foafPicStyle = ' width: 100% ; border: none; margin: 0; padding: 0;'
|
|
174
|
-
|
|
175
|
-
const structure = div.appendChild(dom.createElement('table'))
|
|
176
|
-
const tr = structure.appendChild(dom.createElement('tr'))
|
|
177
|
-
const left = tr.appendChild(dom.createElement('td'))
|
|
178
|
-
const middle = tr.appendChild(dom.createElement('td'))
|
|
179
|
-
const right = tr.appendChild(dom.createElement('td'))
|
|
180
|
-
|
|
181
|
-
const tools = left
|
|
182
|
-
tools.style.cssText = navBlockStyle
|
|
183
|
-
const mainTable = middle.appendChild(dom.createElement('table'))
|
|
184
|
-
mainTable.style.cssText = mainBlockStyle
|
|
185
|
-
const tips = right
|
|
186
|
-
tips.style.cssText = navBlockStyle
|
|
187
|
-
|
|
188
|
-
// Image top left
|
|
189
|
-
const src = kb.any(s, foaf('img')) || kb.any(s, foaf('depiction'))
|
|
190
|
-
if (src) {
|
|
191
|
-
const img = dom.createElement('IMG')
|
|
192
|
-
img.setAttribute('src', src.uri) // w640 h480
|
|
193
|
-
// img.className = 'foafPic'
|
|
194
|
-
img.style.cssText = foafPicStyle
|
|
195
|
-
tools.appendChild(img)
|
|
196
|
-
}
|
|
197
|
-
const name = kb.anyValue(s, foaf('name')) || '???'
|
|
198
|
-
let h3 = dom.createElement('H3')
|
|
199
|
-
h3.appendChild(dom.createTextNode(name))
|
|
200
|
-
|
|
201
|
-
let me = authn.currentUser()
|
|
202
|
-
const meUri = me ? me.uri : null
|
|
203
|
-
|
|
204
|
-
// @@ Add: event handler to redraw the stuff below when me changes.
|
|
205
|
-
const loginOutButton = UI.login.loginStatusBox(dom, webIdUri => {
|
|
206
|
-
me = kb.sym(webIdUri)
|
|
207
|
-
// @@ To be written: redraw as a function the new me
|
|
208
|
-
// @@ refresh the sidebars
|
|
209
|
-
UI.widgets.refreshTree(div) // this refreshes the middle at least
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
tips.appendChild(loginOutButton)
|
|
213
|
-
|
|
214
|
-
const thisIsYou = me && kb.sameThings(me, s)
|
|
215
|
-
|
|
216
|
-
const knows = foaf('knows')
|
|
217
|
-
// var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')
|
|
218
|
-
const familiar =
|
|
219
|
-
kb.anyValue(s, foaf('givenname')) ||
|
|
220
|
-
kb.anyValue(s, foaf('firstName')) ||
|
|
221
|
-
kb.anyValue(s, foaf('nick')) ||
|
|
222
|
-
kb.anyValue(s, foaf('name')) ||
|
|
223
|
-
kb.anyValue(s, vcard('fn'))
|
|
224
|
-
const friends = kb.each(s, knows)
|
|
225
|
-
|
|
226
|
-
// Do I have a public profile document?
|
|
227
|
-
let profile = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }
|
|
228
|
-
let editable = false
|
|
229
|
-
let incoming
|
|
230
|
-
let outgoing
|
|
231
|
-
if (me) {
|
|
232
|
-
// The definition of FAF personal profile document is ..
|
|
233
|
-
const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic
|
|
234
|
-
let message = ''
|
|
235
|
-
for (let i = 0; i < works.length; i++) {
|
|
236
|
-
if (
|
|
237
|
-
kb.whether(
|
|
238
|
-
works[i],
|
|
239
|
-
UI.ns.rdf('type'),
|
|
240
|
-
foaf('PersonalProfileDocument')
|
|
241
|
-
)
|
|
242
|
-
) {
|
|
243
|
-
editable = outliner.UserInput.sparqler.editable(works[i].uri, kb)
|
|
244
|
-
if (!editable) {
|
|
245
|
-
message +=
|
|
246
|
-
'Your profile <' +
|
|
247
|
-
UI.utils.escapeForXML(works[i].uri) +
|
|
248
|
-
'> is not remotely editable.'
|
|
249
|
-
} else {
|
|
250
|
-
profile = works[i]
|
|
251
|
-
break
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (!profile) {
|
|
257
|
-
say(
|
|
258
|
-
message + "\nI couldn't find your editable personal profile document."
|
|
259
|
-
)
|
|
260
|
-
} else {
|
|
261
|
-
say('Editing your profile ' + profile + '.')
|
|
262
|
-
// Do I have an EDITABLE profile?
|
|
263
|
-
editable = outliner.UserInput.sparqler.editable(profile.uri, kb)
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
if (thisIsYou) {
|
|
267
|
-
// This is about me
|
|
268
|
-
// pass... @@
|
|
269
|
-
} else {
|
|
270
|
-
// This is about someone else
|
|
271
|
-
// My relationship with this person
|
|
272
|
-
|
|
273
|
-
h3 = dom.createElement('h3')
|
|
274
|
-
h3.appendChild(dom.createTextNode('You and ' + familiar))
|
|
275
|
-
tools.appendChild(h3)
|
|
276
|
-
|
|
277
|
-
const cme = kb.canon(me)
|
|
278
|
-
incoming = kb.whether(s, knows, cme)
|
|
279
|
-
outgoing = false
|
|
280
|
-
const outgoingSt = kb.statementsMatching(cme, knows, s)
|
|
281
|
-
if (outgoingSt.length) {
|
|
282
|
-
outgoing = true
|
|
283
|
-
if (!profile) profile = outgoingSt[0].why
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const tr = dom.createElement('tr')
|
|
287
|
-
tools.appendChild(tr)
|
|
288
|
-
|
|
289
|
-
const youAndThem = function () {
|
|
290
|
-
tr.appendChild(link(text('You'), meUri))
|
|
291
|
-
tr.appendChild(text(' and '))
|
|
292
|
-
tr.appendChild(link(text(familiar), s.uri))
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
if (!incoming) {
|
|
296
|
-
if (!outgoing) {
|
|
297
|
-
youAndThem()
|
|
298
|
-
tr.appendChild(text(' have not said you know each other.'))
|
|
299
|
-
} else {
|
|
300
|
-
tr.appendChild(link(text('You'), meUri))
|
|
301
|
-
tr.appendChild(text(' know '))
|
|
302
|
-
tr.appendChild(link(text(familiar), s.uri))
|
|
303
|
-
tr.appendChild(text(' (unconfirmed)'))
|
|
304
|
-
}
|
|
305
|
-
} else {
|
|
306
|
-
if (!outgoing) {
|
|
307
|
-
tr.appendChild(link(text(familiar), s.uri))
|
|
308
|
-
tr.appendChild(text(' knows '))
|
|
309
|
-
tr.appendChild(link(text('you'), meUri))
|
|
310
|
-
tr.appendChild(text(' (unconfirmed).')) // @@
|
|
311
|
-
tr.appendChild(text(' confirm you know '))
|
|
312
|
-
tr.appendChild(link(text(familiar), s.uri))
|
|
313
|
-
tr.appendChild(text('.'))
|
|
314
|
-
} else {
|
|
315
|
-
youAndThem()
|
|
316
|
-
tr.appendChild(text(' say you know each other.'))
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (editable) {
|
|
321
|
-
const f = buildCheckboxForm(
|
|
322
|
-
'You know ' + familiar,
|
|
323
|
-
new UI.rdf.Statement(me, knows, s, profile),
|
|
324
|
-
outgoing
|
|
325
|
-
)
|
|
326
|
-
tools.appendChild(f)
|
|
327
|
-
} // editable
|
|
328
|
-
|
|
329
|
-
// //////////////// Mutual friends
|
|
330
|
-
if (friends) {
|
|
331
|
-
const myFriends = kb.each(me, foaf('knows'))
|
|
332
|
-
if (myFriends.length) {
|
|
333
|
-
const mutualFriends = common(friends, myFriends)
|
|
334
|
-
const tr = dom.createElement('tr')
|
|
335
|
-
tools.appendChild(tr)
|
|
336
|
-
tr.appendChild(
|
|
337
|
-
dom.createTextNode(
|
|
338
|
-
'You' +
|
|
339
|
-
(familiar ? ' and ' + familiar : '') +
|
|
340
|
-
' know' +
|
|
341
|
-
people(mutualFriends.length) +
|
|
342
|
-
' found in common'
|
|
343
|
-
)
|
|
344
|
-
)
|
|
345
|
-
if (mutualFriends) {
|
|
346
|
-
for (let i = 0; i < mutualFriends.length; i++) {
|
|
347
|
-
tr.appendChild(
|
|
348
|
-
dom.createTextNode(', ' + UI.utils.label(mutualFriends[i]))
|
|
349
|
-
)
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
const tr = dom.createElement('tr')
|
|
354
|
-
tools.appendChild(tr)
|
|
355
|
-
} // friends
|
|
356
|
-
} // About someone else
|
|
357
|
-
} // me is defined
|
|
358
|
-
// End of you and s
|
|
359
|
-
|
|
360
|
-
// div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))
|
|
361
|
-
|
|
362
|
-
// ///////////////////////////////////////////// Main block
|
|
363
|
-
//
|
|
364
|
-
// Should: Find the intersection and difference sets
|
|
365
|
-
|
|
366
|
-
// List all x such that s knows x.
|
|
367
|
-
UI.widgets.attachmentList(dom, s, mainTable, {
|
|
368
|
-
doc: profile,
|
|
369
|
-
modify: !!editable,
|
|
370
|
-
predicate: foaf('knows'),
|
|
371
|
-
noun: 'friend'
|
|
372
|
-
})
|
|
373
|
-
|
|
374
|
-
// Figure out which are reciprocated:
|
|
375
|
-
// @@ Does not look up profiles
|
|
376
|
-
// Does distinguish reciprocated from unreciprocated friendships
|
|
377
|
-
//
|
|
378
|
-
function _triageFriends (s) {
|
|
379
|
-
outgoing = kb.each(s, foaf('knows'))
|
|
380
|
-
incoming = kb.each(undefined, foaf('knows'), s) // @@ have to load the friends
|
|
381
|
-
const confirmed = []
|
|
382
|
-
const unconfirmed = []
|
|
383
|
-
const requests = []
|
|
384
|
-
|
|
385
|
-
for (let i = 0; i < outgoing.length; i++) {
|
|
386
|
-
const friend = outgoing[i]
|
|
387
|
-
let found = false
|
|
388
|
-
for (let j = 0; j < incoming.length; j++) {
|
|
389
|
-
if (incoming[j].sameTerm(friend)) {
|
|
390
|
-
found = true
|
|
391
|
-
break
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (found) confirmed.push(friend)
|
|
395
|
-
else unconfirmed.push(friend)
|
|
396
|
-
} // outgoing
|
|
397
|
-
|
|
398
|
-
for (let i = 0; i < incoming.length; i++) {
|
|
399
|
-
const friend = incoming[i]
|
|
400
|
-
// var lab = UI.utils.label(friend)
|
|
401
|
-
let found = false
|
|
402
|
-
for (let j = 0; j < outgoing.length; j++) {
|
|
403
|
-
if (outgoing[j].sameTerm(friend)) {
|
|
404
|
-
found = true
|
|
405
|
-
break
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
if (!found) requests.push(friend)
|
|
409
|
-
} // incoming
|
|
410
|
-
|
|
411
|
-
const cases = [
|
|
412
|
-
['Acquaintances', outgoing],
|
|
413
|
-
['Mentioned as acquaintances by: ', requests]
|
|
414
|
-
]
|
|
415
|
-
for (let i = 0; i < cases.length; i++) {
|
|
416
|
-
const thisCase = cases[i]
|
|
417
|
-
const friends = thisCase[1]
|
|
418
|
-
if (friends.length === 0) continue // Skip empty sections (sure?)
|
|
419
|
-
|
|
420
|
-
const h3 = dom.createElement('h3')
|
|
421
|
-
h3.textContent = thisCase[0]
|
|
422
|
-
const htr = dom.createElement('tr')
|
|
423
|
-
htr.appendChild(h3)
|
|
424
|
-
mainTable.appendChild(htr)
|
|
425
|
-
|
|
426
|
-
const items = []
|
|
427
|
-
for (let j9 = 0; j9 < friends.length; j9++) {
|
|
428
|
-
items.push([UI.utils.label(friends[j9]), friends[j9]])
|
|
429
|
-
}
|
|
430
|
-
items.sort()
|
|
431
|
-
let last = null
|
|
432
|
-
let fr
|
|
433
|
-
for (let j7 = 0; j7 < items.length; j7++) {
|
|
434
|
-
fr = items[j7][1]
|
|
435
|
-
if (fr.sameTerm(last)) continue // unique
|
|
436
|
-
last = fr
|
|
437
|
-
if (UI.utils.label(fr) !== '...') {
|
|
438
|
-
// This check is to avoid bnodes with no labels attached
|
|
439
|
-
// appearing in the friends list with "..." - Oshani
|
|
440
|
-
mainTable.appendChild(oneFriend(fr))
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
/* if ($rdf.keepThisCodeForLaterButDisableFerossConstantConditionPolice) {
|
|
446
|
-
triageFriends(s)
|
|
447
|
-
} */
|
|
448
|
-
// //////////////////////////////////// Basic info on left
|
|
449
|
-
|
|
450
|
-
h3 = dom.createElement('h3')
|
|
451
|
-
h3.appendChild(dom.createTextNode('Basic Information'))
|
|
452
|
-
tools.appendChild(h3)
|
|
453
|
-
|
|
454
|
-
// For each home page like thing make a label which will
|
|
455
|
-
// make sense and add the domain (like "w3.org blog") if there are more than one of the same type
|
|
456
|
-
//
|
|
457
|
-
const preds = [
|
|
458
|
-
UI.ns.foaf('homepage'),
|
|
459
|
-
UI.ns.foaf('weblog'),
|
|
460
|
-
UI.ns.foaf('workplaceHomepage'),
|
|
461
|
-
UI.ns.foaf('schoolHomepage')
|
|
462
|
-
]
|
|
463
|
-
for (let i6 = 0; i6 < preds.length; i6++) {
|
|
464
|
-
const pred = preds[i6]
|
|
465
|
-
const sts = kb.statementsMatching(s, pred)
|
|
466
|
-
if (sts.length === 0) {
|
|
467
|
-
// if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
|
|
468
|
-
} else {
|
|
469
|
-
const uris = []
|
|
470
|
-
for (let j5 = 0; j5 < sts.length; j5++) {
|
|
471
|
-
const st = sts[j5]
|
|
472
|
-
if (st.object.uri) uris.push(st.object.uri) // Ignore if not symbol
|
|
473
|
-
}
|
|
474
|
-
uris.sort()
|
|
475
|
-
let last2 = ''
|
|
476
|
-
let lab2
|
|
477
|
-
for (let k = 0; k < uris.length; k++) {
|
|
478
|
-
const uri = uris[k]
|
|
479
|
-
if (uri === last2) continue // uniques only
|
|
480
|
-
last2 = uri
|
|
481
|
-
let hostlabel = ''
|
|
482
|
-
lab2 = UI.utils.label(pred)
|
|
483
|
-
if (uris.length > 1) {
|
|
484
|
-
const l = uri.indexOf('//')
|
|
485
|
-
if (l > 0) {
|
|
486
|
-
let r = uri.indexOf('/', l + 2)
|
|
487
|
-
const r2 = uri.lastIndexOf('.', r)
|
|
488
|
-
if (r2 > 0) r = r2
|
|
489
|
-
hostlabel = uri.slice(l + 2, r)
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
if (hostlabel) lab2 = hostlabel + ' ' + lab2 // disambiguate
|
|
493
|
-
const t = dom.createTextNode(lab2)
|
|
494
|
-
const a = dom.createElement('a')
|
|
495
|
-
a.appendChild(t)
|
|
496
|
-
a.setAttribute('href', uri)
|
|
497
|
-
const d = dom.createElement('div')
|
|
498
|
-
// d.className = 'social_linkButton'
|
|
499
|
-
d.style.cssText =
|
|
500
|
-
'width: 80%; background-color: #fff; border: solid 0.05em #ccc; margin-top: 0.1em; margin-bottom: 0.1em; padding: 0.1em; text-align: center;'
|
|
501
|
-
d.appendChild(a)
|
|
502
|
-
tools.appendChild(d)
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
const preds2 = [UI.ns.foaf('openid'), UI.ns.foaf('nick')]
|
|
508
|
-
for (let i2 = 0; i2 < preds2.length; i2++) {
|
|
509
|
-
const pred = preds2[i2]
|
|
510
|
-
const sts2 = kb.statementsMatching(s, pred)
|
|
511
|
-
if (sts2.length === 0) {
|
|
512
|
-
// if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
|
|
513
|
-
} else {
|
|
514
|
-
outliner.appendPropertyTRs(tools, sts2, false, function (_pred) {
|
|
515
|
-
return true
|
|
516
|
-
})
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
return div
|
|
521
|
-
} // render()
|
|
522
|
-
} //
|
|
523
|
-
// ends
|