solid-panes 3.5.28-alpha → 3.5.28-c481e73e
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/.babelrc +0 -0
- package/.eslintignore +0 -0
- package/.eslintrc +0 -0
- package/.github/workflows/ci.yml +0 -0
- package/.nvmrc +0 -0
- package/Documentation/VisualLanguage.html +0 -0
- package/Documentation/conventions.md +0 -0
- package/LICENSE.md +0 -0
- package/README.md +0 -2
- package/dev/index.html +0 -0
- package/dev/loader.ts +0 -0
- package/dev/pane/index.ts +0 -0
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +0 -0
- package/jest.config.js +0 -0
- package/jest.setup.ts +0 -0
- package/lib/RDFXMLPane.js +15 -9
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +12 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +58 -90
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +19 -37
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +21 -22
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.d.ts +0 -0
- package/lib/dashboard/basicPreferences.d.ts.map +0 -0
- package/lib/dashboard/basicPreferences.js +96 -154
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.d.ts +0 -0
- package/lib/dashboard/dashboardPane.d.ts.map +0 -0
- package/lib/dashboard/dashboardPane.js +2 -18
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.d.ts +0 -0
- package/lib/dashboard/homepage.d.ts.map +0 -0
- package/lib/dashboard/homepage.js +27 -49
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +26 -61
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +23 -23
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +29 -34
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js +6 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +34 -45
- package/lib/form/pane.js.map +1 -1
- package/lib/global.d.js +0 -0
- package/lib/global.d.js.map +0 -0
- package/lib/home/homePane.d.ts +0 -0
- package/lib/home/homePane.d.ts.map +1 -1
- package/lib/home/homePane.js +38 -68
- package/lib/home/homePane.js.map +1 -1
- package/lib/humanReadablePane.js +14 -28
- package/lib/humanReadablePane.js.map +1 -1
- package/lib/imagePane.js +19 -14
- package/lib/imagePane.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +6 -20
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.d.ts +0 -0
- package/lib/internal/internalPane.d.ts.map +0 -0
- package/lib/internal/internalPane.js +10 -41
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.d.ts +0 -0
- package/lib/mainPage/footer.d.ts.map +0 -0
- package/lib/mainPage/footer.js +0 -4
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.d.ts +0 -0
- package/lib/mainPage/header.d.ts.map +0 -0
- package/lib/mainPage/header.js +66 -100
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.d.ts +0 -0
- package/lib/mainPage/index.d.ts.map +0 -0
- package/lib/mainPage/index.js +17 -30
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +182 -321
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +12 -8
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.d.ts +0 -0
- package/lib/outline/context.d.ts.map +0 -0
- package/lib/outline/context.js +0 -2
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js +21 -35
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +740 -1176
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +16 -25
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +39 -26
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.d.ts +3 -2
- package/lib/outline/propertyViews.d.ts.map +1 -1
- package/lib/outline/propertyViews.js +7 -15
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +7 -7
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +28 -80
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +221 -459
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.d.ts +0 -0
- package/lib/outline/viewAsImage.d.ts.map +0 -0
- package/lib/outline/viewAsImage.js +0 -6
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.d.ts +0 -0
- package/lib/outline/viewAsMbox.d.ts.map +0 -0
- package/lib/outline/viewAsMbox.js +3 -4
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.d.ts +0 -0
- package/lib/pad/padPane.d.ts.map +0 -0
- package/lib/pad/padPane.js +45 -93
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js +11 -21
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.d.ts +0 -0
- package/lib/profile/editProfile.view.d.ts.map +1 -1
- package/lib/profile/editProfile.view.js +22 -23
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.d.ts +0 -0
- package/lib/profile/profile.dom.d.ts.map +0 -0
- package/lib/profile/profile.dom.js +0 -3
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +99 -54
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js +6 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +71 -126
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.d.ts +0 -0
- package/lib/sharing/sharingPane.d.ts.map +0 -0
- package/lib/sharing/sharingPane.js +2 -10
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js +21 -21
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +58 -135
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.d.ts +0 -0
- package/lib/tabbed/tabbedPane.d.ts.map +0 -0
- package/lib/tabbed/tabbedPane.js +32 -48
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +15 -9
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +8 -3
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +10 -14
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/test-import-export/testImportExport.js +0 -0
- package/lib/test-import-export/testImportExport.js.map +0 -0
- package/lib/transaction/pane.js +38 -91
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +27 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +38 -35
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.dom.js +12 -35
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +6 -8
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.utils.js +1 -11
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.d.ts +0 -0
- package/lib/trustedApplications/trustedApplications.view.d.ts.map +0 -0
- package/lib/trustedApplications/trustedApplications.view.js +38 -61
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/types.d.ts +0 -0
- package/lib/types.d.ts.map +0 -0
- package/lib/types.js +0 -0
- package/lib/types.js.map +0 -0
- package/lib/ui/pane.js +30 -29
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -0
- package/lib/versionInfo.d.ts.map +0 -0
- package/lib/versionInfo.js +14 -14
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js +11 -7
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +26 -26
- package/src/RDFXMLPane.js +2 -2
- package/src/argument/argumentPane.js +1 -1
- 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 +3 -3
- 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 +3 -3
- package/src/chatPreferencesForm.ttl +0 -0
- package/src/classInstancePane.js +3 -3
- package/src/dashboard/basicPreferences.ts +0 -0
- package/src/dashboard/dashboardPane.ts +0 -0
- package/src/dashboard/homepage.ts +0 -0
- package/src/dashboard/languages/codes.html +0 -0
- package/src/dashboard/languages/codes.xml +0 -0
- package/src/dashboard/languages/codes2.txt +0 -0
- package/src/dashboard/languages/foo +0 -0
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +0 -0
- package/src/dashboard/ontologyData.ttl +0 -0
- package/src/dashboard/preferencesFormText.ttl +0 -0
- package/src/dataContentPane.js +3 -4
- package/src/defaultPane.js +3 -3
- package/src/dokieli/Makefile +0 -0
- package/src/dokieli/dokieliPane.js +5 -5
- package/src/dokieli/new.html +0 -0
- package/src/dokieli/new.js +1 -1
- 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 +2 -2
- package/src/form/psuedocode-notes.txt +0 -0
- package/src/global.d.ts +0 -0
- package/src/home/homePane.ts +1 -14
- package/src/humanReadablePane.js +0 -0
- package/src/imagePane.js +2 -2
- package/src/index.ts +1 -1
- package/src/internal/internalPane.ts +0 -0
- package/src/mainPage/footer.ts +0 -0
- package/src/mainPage/header.ts +0 -0
- package/src/mainPage/index.ts +0 -0
- package/src/meeting/Makefile +0 -0
- package/src/meeting/test/meeting1/Actions/actions.ttl +0 -0
- package/src/meeting/test/meeting1/Actions/config.ttl +0 -0
- package/src/meeting/test/meeting1/Actions/state.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/index.html +0 -0
- package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl +0 -0
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -0
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -0
- package/src/meeting/test/meeting1/chat/chat.ttl +0 -0
- package/src/meeting/test/meeting1/details.ttl +0 -0
- package/src/meeting/test/meeting1/pad/pad.ttl +0 -0
- package/src/microblogPane/mbStyle.css +0 -0
- package/src/microblogPane/microblogPane.js +1 -1
- package/src/n3Pane.js +2 -2
- package/src/outline/context.ts +0 -0
- package/src/outline/licenseOptions.js +9 -8
- package/src/outline/manager.js +18 -20
- package/src/outline/manager.test.ts +6 -0
- package/src/outline/outlineIcons.js +4 -2
- package/src/outline/propertyViews.test.ts +7 -1
- package/src/outline/propertyViews.ts +3 -3
- package/src/outline/queryByExample.js +3 -9
- package/src/outline/userInput.js +1 -1
- package/src/outline/viewAsImage.ts +0 -0
- package/src/outline/viewAsMbox.ts +0 -0
- package/src/pad/images/ColourOff.ai +0 -0
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +0 -0
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +0 -0
- package/src/playlist/playlistPane.js +3 -3
- package/src/profile/editProfile.view.ts +20 -0
- package/src/profile/profile.dom.ts +0 -0
- package/src/profile/profileFormText.ttl +0 -0
- package/src/registerPanes.js +92 -52
- package/src/schedule/Makefile +0 -0
- package/src/schedule/formsForSchedule.js +1 -1
- package/src/schedule/formsForSchedule.ttl +0 -0
- package/src/schedule/schedulePane.js +6 -2
- package/src/sharing/sharingPane.ts +0 -0
- package/src/slideshow/slideshowPane.js +3 -6
- package/src/socialPane.js +4 -5
- package/src/style/tabbedtab.css +0 -0
- package/src/tabbed/tabbedPane.ts +0 -0
- package/src/tableViewPane.js +3 -3
- package/src/test-import-export/common.js +1 -1
- package/src/test-import-export/edit-importer.js +5 -10
- 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 +3 -3
- package/src/transaction/period.js +2 -2
- 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 +3 -3
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -0
- package/src/trustedApplications/trustedApplications.dom.ts +0 -0
- package/src/trustedApplications/trustedApplications.test.ts +4 -0
- package/src/trustedApplications/trustedApplications.utils.ts +0 -0
- package/src/trustedApplications/trustedApplications.view.ts +0 -0
- package/src/types.ts +0 -0
- 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 +3 -3
- package/src/versionInfo.ts +14 -14
- package/src/video/videoPane.js +3 -3
- package/timestamp.sh +0 -0
- package/travis/bumpversion.js +0 -0
- package/tsconfig.json +0 -0
- package/typings/raw-loader.d.ts +0 -0
- package/typings/solid-namespace/index.d.ts +0 -0
- package/webpack.config.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slideshowPane.js","names":["
|
|
1
|
+
{"version":3,"file":"slideshowPane.js","names":["ns","UI","slideshowPane","icon","icons","iconBase","name","audience","solid","label","subject","context","store","session","t","findTypeURIs","ldp","uri","contents","each","count","forEach","file","widgets","isImage","render","dom","styleSheet","addStyleSheet","div","createElement","setAttribute","predicate","images","sort","i","figure","appendChild","img","fetcher","_fetch","then","response","blob","myBlob","objectURL","URL","createObjectURL","length","options","setTimeout","makeBSS"],"sources":["../../src/slideshow/slideshowPane.js"],"sourcesContent":["/* slideshow Pane\n **\n */\nimport * as UI from 'solid-ui'\nconst ns = UI.ns\n\nimport makeBSS from '@solid/better-simple-slideshow'\n\nexport const slideshowPane = {\n icon: UI.icons.iconBase + 'noun_138712.svg',\n\n name: 'slideshow',\n\n audience: [ns.solid('PowerUser')],\n\n // Does the subject deserve an slideshow pane?\n label: function (subject, context) {\n const store = context.session.store\n const ns = UI.ns\n const t = store.findTypeURIs(subject)\n if (t[ns.ldp('Container').uri] || t[ns.ldp('BasicContainer').uri]) {\n const contents = store.each(subject, ns.ldp('contains'))\n let count = 0\n contents.forEach(function (file) {\n if (UI.widgets.isImage(file)) count++\n })\n return count > 0 ? 'Slideshow' : null\n }\n return null\n },\n\n // See https://github.com/leemark/better-simple-slideshow\n // and follow instructions there\n render: function (subject, context) {\n const dom = context.dom\n const styleSheet =\n 'https://leemark.github.io/better-simple-slideshow/css/simple-slideshow-styles.css'\n UI.widgets.addStyleSheet(dom, styleSheet)\n\n const store = context.session.store\n const ns = UI.ns\n const div = dom.createElement('div')\n div.setAttribute('class', 'bss-slides')\n\n const t = store.findTypeURIs(subject)\n let predicate\n if (t[ns.ldp('BasicContainer').uri] || t[ns.ldp('Container').uri]) {\n predicate = ns.ldp('contains')\n }\n const images = store.each(subject, predicate) // @@ random order?\n // @@ Ideally: sort by embedded time of image\n images.sort() // Sort for now by URI\n for (let i = 0; i < images.length; i++) {\n if (!UI.widgets.isImage(images[i])) continue\n const figure = div.appendChild(dom.createElement('figure'))\n const img = figure.appendChild(dom.createElement('img'))\n\n // get image with authenticated fetch\n store.fetcher._fetch(images[i].uri)\n .then(function(response) {\n return response.blob()\n })\n .then(function(myBlob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n img.setAttribute('width', '100%')\n figure.appendChild(dom.createElement('figcaption'))\n }\n const options = { dom: dom }\n\n setTimeout(function () {\n makeBSS('.bss-slides', options)\n }, 1000) // Must run after the code which called this\n\n return div\n }\n}\n\n// ends\n"],"mappings":";;;;;;;AAGA;AAGA;AAAoD;AAAA;AAAA;AANpD;AACA;AACA;;AAEA,IAAMA,EAAE,GAAGC,EAAE,CAACD,EAAE;AAIT,IAAME,aAAa,GAAG;EAC3BC,IAAI,EAAEF,EAAE,CAACG,KAAK,CAACC,QAAQ,GAAG,iBAAiB;EAE3CC,IAAI,EAAE,WAAW;EAEjBC,QAAQ,EAAE,CAACP,EAAE,CAACQ,KAAK,CAAC,WAAW,CAAC,CAAC;EAEjC;EACAC,KAAK,EAAE,eAAUC,OAAO,EAAEC,OAAO,EAAE;IACjC,IAAMC,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACD,KAAK;IACnC,IAAMZ,EAAE,GAAGC,EAAE,CAACD,EAAE;IAChB,IAAMc,CAAC,GAAGF,KAAK,CAACG,YAAY,CAACL,OAAO,CAAC;IACrC,IAAII,CAAC,CAACd,EAAE,CAACgB,GAAG,CAAC,WAAW,CAAC,CAACC,GAAG,CAAC,IAAIH,CAAC,CAACd,EAAE,CAACgB,GAAG,CAAC,gBAAgB,CAAC,CAACC,GAAG,CAAC,EAAE;MACjE,IAAMC,QAAQ,GAAGN,KAAK,CAACO,IAAI,CAACT,OAAO,EAAEV,EAAE,CAACgB,GAAG,CAAC,UAAU,CAAC,CAAC;MACxD,IAAII,KAAK,GAAG,CAAC;MACbF,QAAQ,CAACG,OAAO,CAAC,UAAUC,IAAI,EAAE;QAC/B,IAAIrB,EAAE,CAACsB,OAAO,CAACC,OAAO,CAACF,IAAI,CAAC,EAAEF,KAAK,EAAE;MACvC,CAAC,CAAC;MACF,OAAOA,KAAK,GAAG,CAAC,GAAG,WAAW,GAAG,IAAI;IACvC;IACA,OAAO,IAAI;EACb,CAAC;EAED;EACA;EACAK,MAAM,EAAE,gBAAUf,OAAO,EAAEC,OAAO,EAAE;IAClC,IAAMe,GAAG,GAAGf,OAAO,CAACe,GAAG;IACvB,IAAMC,UAAU,GACd,mFAAmF;IACrF1B,EAAE,CAACsB,OAAO,CAACK,aAAa,CAACF,GAAG,EAAEC,UAAU,CAAC;IAEzC,IAAMf,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACD,KAAK;IACnC,IAAMZ,EAAE,GAAGC,EAAE,CAACD,EAAE;IAChB,IAAM6B,GAAG,GAAGH,GAAG,CAACI,aAAa,CAAC,KAAK,CAAC;IACpCD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC;IAEvC,IAAMjB,CAAC,GAAGF,KAAK,CAACG,YAAY,CAACL,OAAO,CAAC;IACrC,IAAIsB,SAAS;IACb,IAAIlB,CAAC,CAACd,EAAE,CAACgB,GAAG,CAAC,gBAAgB,CAAC,CAACC,GAAG,CAAC,IAAIH,CAAC,CAACd,EAAE,CAACgB,GAAG,CAAC,WAAW,CAAC,CAACC,GAAG,CAAC,EAAE;MACjEe,SAAS,GAAGhC,EAAE,CAACgB,GAAG,CAAC,UAAU,CAAC;IAChC;IACA,IAAMiB,MAAM,GAAGrB,KAAK,CAACO,IAAI,CAACT,OAAO,EAAEsB,SAAS,CAAC,EAAC;IAC9C;IACAC,MAAM,CAACC,IAAI,EAAE,EAAC;IAAA,6BAC0B;MACtC,IAAI,CAACjC,EAAE,CAACsB,OAAO,CAACC,OAAO,CAACS,MAAM,CAACE,CAAC,CAAC,CAAC;MAClC,IAAMC,MAAM,GAAGP,GAAG,CAACQ,WAAW,CAACX,GAAG,CAACI,aAAa,CAAC,QAAQ,CAAC,CAAC;MAC3D,IAAMQ,GAAG,GAAGF,MAAM,CAACC,WAAW,CAACX,GAAG,CAACI,aAAa,CAAC,KAAK,CAAC,CAAC;;MAExD;MACAlB,KAAK,CAAC2B,OAAO,CAACC,MAAM,CAACP,MAAM,CAACE,CAAC,CAAC,CAAClB,GAAG,CAAC,CAChCwB,IAAI,CAAC,UAASC,QAAQ,EAAE;QACvB,OAAOA,QAAQ,CAACC,IAAI,EAAE;MACxB,CAAC,CAAC,CACDF,IAAI,CAAC,UAASG,MAAM,EAAE;QACrB,IAAMC,SAAS,GAAGC,GAAG,CAACC,eAAe,CAACH,MAAM,CAAC;QAC7CN,GAAG,CAACP,YAAY,CAAC,KAAK,EAAEc,SAAS,CAAC,EAAC;MACrC,CAAC,CAAC;;MACJP,GAAG,CAACP,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC;MACjCK,MAAM,CAACC,WAAW,CAACX,GAAG,CAACI,aAAa,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;IAhBD,KAAK,IAAIK,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACe,MAAM,EAAEb,CAAC,EAAE;MAAA;MAAA,yBACA;IAAQ;IAgB9C,IAAMc,OAAO,GAAG;MAAEvB,GAAG,EAAEA;IAAI,CAAC;IAE5BwB,UAAU,CAAC,YAAY;MACrB,IAAAC,iCAAO,EAAC,aAAa,EAAEF,OAAO,CAAC;IACjC,CAAC,EAAE,IAAI,CAAC,EAAC;;IAET,OAAOpB,GAAG;EACZ;AACF,CAAC;;AAED;AAAA"}
|
package/lib/socialPane.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.socialPane = void 0;
|
|
5
8
|
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
6
|
-
|
|
7
9
|
var _solidLogic = require("solid-logic");
|
|
8
|
-
|
|
9
|
-
var $rdf = _interopRequireWildcard(require("rdflib"));
|
|
10
|
-
|
|
11
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
|
|
13
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
|
|
15
12
|
/* Social Pane
|
|
16
13
|
**
|
|
17
14
|
** This outline pane provides social network functions
|
|
@@ -21,26 +18,23 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
18
|
** - Read and write both user-private (address book) and public data clearly
|
|
22
19
|
** -- todo: use common code to get username and load profile and set 'me'
|
|
23
20
|
*/
|
|
24
|
-
|
|
21
|
+
|
|
22
|
+
var socialPane = {
|
|
25
23
|
icon: UI.icons.originalIconBase + 'foaf/foafTiny.gif',
|
|
26
24
|
name: 'social',
|
|
27
25
|
label: function label(subject, context) {
|
|
28
26
|
var kb = context.session.store;
|
|
29
27
|
var types = kb.findTypeURIs(subject);
|
|
30
|
-
|
|
31
28
|
if (types[UI.ns.foaf('Person').uri] || types[UI.ns.vcard('Individual').uri]) {
|
|
32
29
|
return 'Friends';
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return null;
|
|
36
32
|
},
|
|
37
33
|
render: function render(s, context) {
|
|
38
34
|
var dom = context.dom;
|
|
39
|
-
|
|
40
35
|
var common = function common(x, y) {
|
|
41
36
|
// Find common members of two lists
|
|
42
37
|
var both = [];
|
|
43
|
-
|
|
44
38
|
for (var i = 0; i < x.length; i++) {
|
|
45
39
|
for (var j = 0; j < y.length; j++) {
|
|
46
40
|
if (y[j].sameTerm(x[i])) {
|
|
@@ -49,24 +43,20 @@ module.exports = {
|
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
|
-
|
|
53
46
|
return both;
|
|
54
47
|
};
|
|
55
|
-
|
|
56
48
|
var people = function people(n) {
|
|
57
49
|
var res = ' ';
|
|
58
50
|
res += n || 'no';
|
|
59
51
|
if (n === 1) return res + ' person';
|
|
60
52
|
return res + ' people';
|
|
61
53
|
};
|
|
62
|
-
|
|
63
54
|
var say = function say(str) {
|
|
64
55
|
console.log(str);
|
|
65
56
|
var p = dom.createElement('p');
|
|
66
57
|
p.textContent = str;
|
|
67
58
|
tips.appendChild(p);
|
|
68
59
|
};
|
|
69
|
-
|
|
70
60
|
var link = function link(contents, uri) {
|
|
71
61
|
if (!uri) return contents;
|
|
72
62
|
var a = dom.createElement('a');
|
|
@@ -74,11 +64,9 @@ module.exports = {
|
|
|
74
64
|
a.appendChild(contents);
|
|
75
65
|
return a;
|
|
76
66
|
};
|
|
77
|
-
|
|
78
67
|
var text = function text(str) {
|
|
79
68
|
return dom.createTextNode(str);
|
|
80
69
|
};
|
|
81
|
-
|
|
82
70
|
var buildCheckboxForm = function buildCheckboxForm(lab, statement, state) {
|
|
83
71
|
var f = dom.createElement('form');
|
|
84
72
|
var input = dom.createElement('input');
|
|
@@ -87,30 +75,25 @@ module.exports = {
|
|
|
87
75
|
tx.className = 'question';
|
|
88
76
|
f.appendChild(tx);
|
|
89
77
|
input.setAttribute('type', 'checkbox');
|
|
90
|
-
|
|
91
78
|
var boxHandler = function boxHandler(_e) {
|
|
92
|
-
tx.className = 'pendingedit';
|
|
93
|
-
|
|
79
|
+
tx.className = 'pendingedit';
|
|
80
|
+
// alert('Should be greyed out')
|
|
94
81
|
if (this.checked) {
|
|
95
82
|
// Add link
|
|
96
83
|
try {
|
|
97
84
|
outliner.UserInput.sparqler.insert_statement(statement, function (uri, success, errorBody) {
|
|
98
85
|
tx.className = 'question';
|
|
99
|
-
|
|
100
86
|
if (!success) {
|
|
101
87
|
UI.log.alert(null, 'Message', 'Error occurs while inserting ' + statement + '\n\n' + errorBody);
|
|
102
88
|
input.checked = false; // rollback UI
|
|
103
|
-
|
|
104
89
|
return;
|
|
105
90
|
}
|
|
106
|
-
|
|
107
91
|
kb.add(statement.subject, statement.predicate, statement.object, statement.why);
|
|
108
92
|
});
|
|
109
93
|
} catch (e) {
|
|
110
94
|
UI.log.error('Data write fails:' + e);
|
|
111
95
|
UI.log.alert('Data write fails:' + e);
|
|
112
96
|
input.checked = false; // rollback UI
|
|
113
|
-
|
|
114
97
|
tx.className = 'question';
|
|
115
98
|
}
|
|
116
99
|
} else {
|
|
@@ -118,7 +101,6 @@ module.exports = {
|
|
|
118
101
|
try {
|
|
119
102
|
outliner.UserInput.sparqler.delete_statement(statement, function (uri, success, errorBody) {
|
|
120
103
|
tx.className = 'question';
|
|
121
|
-
|
|
122
104
|
if (!success) {
|
|
123
105
|
UI.log.alert('Error occurs while deleting ' + statement + '\n\n' + errorBody);
|
|
124
106
|
this.checked = true; // Rollback UI
|
|
@@ -138,19 +120,20 @@ module.exports = {
|
|
|
138
120
|
input.addEventListener('click', boxHandler, false);
|
|
139
121
|
return f;
|
|
140
122
|
};
|
|
141
|
-
|
|
142
123
|
var oneFriend = function oneFriend(friend, _confirmed) {
|
|
143
124
|
return UI.widgets.personTR(dom, UI.ns.foaf('knows'), friend, {});
|
|
144
|
-
};
|
|
125
|
+
};
|
|
145
126
|
|
|
127
|
+
// ////////// Body of render():
|
|
146
128
|
|
|
147
129
|
var outliner = context.getOutliner(dom);
|
|
148
130
|
var kb = context.session.store;
|
|
149
131
|
var div = dom.createElement('div');
|
|
150
132
|
div.setAttribute('class', 'socialPane');
|
|
151
133
|
var foaf = UI.ns.foaf;
|
|
152
|
-
var vcard = UI.ns.vcard;
|
|
134
|
+
var vcard = UI.ns.vcard;
|
|
153
135
|
|
|
136
|
+
// extracted from tabbedtab.css 2017-03-21
|
|
154
137
|
var navBlockStyle = 'background-color: #eee; width: 25%; border: 0; padding: 0.5em; margin: 0;';
|
|
155
138
|
var mainBlockStyle = '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;';
|
|
156
139
|
var foafPicStyle = ' width: 100% ; border: none; margin: 0; padding: 0;';
|
|
@@ -164,56 +147,50 @@ module.exports = {
|
|
|
164
147
|
var mainTable = middle.appendChild(dom.createElement('table'));
|
|
165
148
|
mainTable.style.cssText = mainBlockStyle;
|
|
166
149
|
var tips = right;
|
|
167
|
-
tips.style.cssText = navBlockStyle;
|
|
150
|
+
tips.style.cssText = navBlockStyle;
|
|
168
151
|
|
|
152
|
+
// Image top left
|
|
169
153
|
var src = kb.any(s, foaf('img')) || kb.any(s, foaf('depiction'));
|
|
170
|
-
|
|
171
154
|
if (src) {
|
|
172
155
|
var img = dom.createElement('IMG');
|
|
173
156
|
img.setAttribute('src', src.uri); // w640 h480
|
|
174
157
|
// img.className = 'foafPic'
|
|
175
|
-
|
|
176
158
|
img.style.cssText = foafPicStyle;
|
|
177
159
|
tools.appendChild(img);
|
|
178
160
|
}
|
|
179
|
-
|
|
180
161
|
var name = kb.anyValue(s, foaf('name')) || '???';
|
|
181
162
|
var h3 = dom.createElement('H3');
|
|
182
163
|
h3.appendChild(dom.createTextNode(name));
|
|
183
|
-
|
|
184
164
|
var me = _solidLogic.authn.currentUser();
|
|
165
|
+
var meUri = me ? me.uri : null;
|
|
185
166
|
|
|
186
|
-
|
|
187
|
-
|
|
167
|
+
// @@ Add: event handler to redraw the stuff below when me changes.
|
|
188
168
|
var loginOutButton = UI.login.loginStatusBox(dom, function (webIdUri) {
|
|
189
|
-
me = kb.sym(webIdUri);
|
|
169
|
+
me = kb.sym(webIdUri);
|
|
170
|
+
// @@ To be written: redraw as a function the new me
|
|
190
171
|
// @@ refresh the sidebars
|
|
191
|
-
|
|
192
172
|
UI.widgets.refreshTree(div); // this refreshes the middle at least
|
|
193
173
|
});
|
|
174
|
+
|
|
194
175
|
tips.appendChild(loginOutButton);
|
|
195
176
|
var thisIsYou = me && kb.sameThings(me, s);
|
|
196
|
-
var knows = foaf('knows');
|
|
197
|
-
|
|
177
|
+
var knows = foaf('knows');
|
|
178
|
+
// var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')
|
|
198
179
|
var familiar = kb.anyValue(s, foaf('givenname')) || kb.anyValue(s, foaf('firstName')) || kb.anyValue(s, foaf('nick')) || kb.anyValue(s, foaf('name')) || kb.anyValue(s, vcard('fn'));
|
|
199
|
-
var friends = kb.each(s, knows);
|
|
180
|
+
var friends = kb.each(s, knows);
|
|
200
181
|
|
|
182
|
+
// Do I have a public profile document?
|
|
201
183
|
var profile = null; // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }
|
|
202
|
-
|
|
203
184
|
var editable = false;
|
|
204
185
|
var incoming;
|
|
205
186
|
var outgoing;
|
|
206
|
-
|
|
207
187
|
if (me) {
|
|
208
188
|
// The definition of FAF personal profile document is ..
|
|
209
189
|
var works = kb.each(undefined, foaf('primaryTopic'), me); // having me as primary topic
|
|
210
|
-
|
|
211
190
|
var message = '';
|
|
212
|
-
|
|
213
191
|
for (var i = 0; i < works.length; i++) {
|
|
214
192
|
if (kb.whether(works[i], UI.ns.rdf('type'), foaf('PersonalProfileDocument'))) {
|
|
215
193
|
editable = outliner.UserInput.sparqler.editable(works[i].uri, kb);
|
|
216
|
-
|
|
217
194
|
if (!editable) {
|
|
218
195
|
message += 'Your profile <' + UI.utils.escapeForXML(works[i].uri) + '> is not remotely editable.';
|
|
219
196
|
} else {
|
|
@@ -222,20 +199,20 @@ module.exports = {
|
|
|
222
199
|
}
|
|
223
200
|
}
|
|
224
201
|
}
|
|
225
|
-
|
|
226
202
|
if (!profile) {
|
|
227
203
|
say(message + "\nI couldn't find your editable personal profile document.");
|
|
228
204
|
} else {
|
|
229
|
-
say('Editing your profile ' + profile + '.');
|
|
230
|
-
|
|
205
|
+
say('Editing your profile ' + profile + '.');
|
|
206
|
+
// Do I have an EDITABLE profile?
|
|
231
207
|
editable = outliner.UserInput.sparqler.editable(profile.uri, kb);
|
|
232
208
|
}
|
|
233
|
-
|
|
234
|
-
|
|
209
|
+
if (thisIsYou) {
|
|
210
|
+
// This is about me
|
|
235
211
|
// pass... @@
|
|
236
212
|
} else {
|
|
237
213
|
// This is about someone else
|
|
238
214
|
// My relationship with this person
|
|
215
|
+
|
|
239
216
|
h3 = dom.createElement('h3');
|
|
240
217
|
h3.appendChild(dom.createTextNode('You and ' + familiar));
|
|
241
218
|
tools.appendChild(h3);
|
|
@@ -243,181 +220,138 @@ module.exports = {
|
|
|
243
220
|
incoming = kb.whether(s, knows, cme);
|
|
244
221
|
outgoing = false;
|
|
245
222
|
var outgoingSt = kb.statementsMatching(cme, knows, s);
|
|
246
|
-
|
|
247
223
|
if (outgoingSt.length) {
|
|
248
224
|
outgoing = true;
|
|
249
225
|
if (!profile) profile = outgoingSt[0].why;
|
|
250
226
|
}
|
|
251
|
-
|
|
252
227
|
var _tr = dom.createElement('tr');
|
|
253
|
-
|
|
254
228
|
tools.appendChild(_tr);
|
|
255
|
-
|
|
256
229
|
var youAndThem = function youAndThem() {
|
|
257
230
|
_tr.appendChild(link(text('You'), meUri));
|
|
258
|
-
|
|
259
231
|
_tr.appendChild(text(' and '));
|
|
260
|
-
|
|
261
232
|
_tr.appendChild(link(text(familiar), s.uri));
|
|
262
233
|
};
|
|
263
|
-
|
|
264
234
|
if (!incoming) {
|
|
265
235
|
if (!outgoing) {
|
|
266
236
|
youAndThem();
|
|
267
|
-
|
|
268
237
|
_tr.appendChild(text(' have not said you know each other.'));
|
|
269
238
|
} else {
|
|
270
239
|
_tr.appendChild(link(text('You'), meUri));
|
|
271
|
-
|
|
272
240
|
_tr.appendChild(text(' know '));
|
|
273
|
-
|
|
274
241
|
_tr.appendChild(link(text(familiar), s.uri));
|
|
275
|
-
|
|
276
242
|
_tr.appendChild(text(' (unconfirmed)'));
|
|
277
243
|
}
|
|
278
244
|
} else {
|
|
279
245
|
if (!outgoing) {
|
|
280
246
|
_tr.appendChild(link(text(familiar), s.uri));
|
|
281
|
-
|
|
282
247
|
_tr.appendChild(text(' knows '));
|
|
283
|
-
|
|
284
248
|
_tr.appendChild(link(text('you'), meUri));
|
|
285
|
-
|
|
286
249
|
_tr.appendChild(text(' (unconfirmed).')); // @@
|
|
287
|
-
|
|
288
|
-
|
|
289
250
|
_tr.appendChild(text(' confirm you know '));
|
|
290
|
-
|
|
291
251
|
_tr.appendChild(link(text(familiar), s.uri));
|
|
292
|
-
|
|
293
252
|
_tr.appendChild(text('.'));
|
|
294
253
|
} else {
|
|
295
254
|
youAndThem();
|
|
296
|
-
|
|
297
255
|
_tr.appendChild(text(' say you know each other.'));
|
|
298
256
|
}
|
|
299
257
|
}
|
|
300
|
-
|
|
301
258
|
if (editable) {
|
|
302
259
|
var f = buildCheckboxForm('You know ' + familiar, new UI.rdf.Statement(me, knows, s, profile), outgoing);
|
|
303
260
|
tools.appendChild(f);
|
|
304
261
|
} // editable
|
|
305
|
-
// //////////////// Mutual friends
|
|
306
|
-
|
|
307
262
|
|
|
263
|
+
// //////////////// Mutual friends
|
|
308
264
|
if (friends) {
|
|
309
265
|
var myFriends = kb.each(me, foaf('knows'));
|
|
310
|
-
|
|
311
266
|
if (myFriends.length) {
|
|
312
267
|
var mutualFriends = common(friends, myFriends);
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
tools.appendChild(_tr3);
|
|
317
|
-
|
|
318
|
-
_tr3.appendChild(dom.createTextNode('You' + (familiar ? ' and ' + familiar : '') + ' know' + people(mutualFriends.length) + ' found in common'));
|
|
319
|
-
|
|
268
|
+
var _tr2 = dom.createElement('tr');
|
|
269
|
+
tools.appendChild(_tr2);
|
|
270
|
+
_tr2.appendChild(dom.createTextNode('You' + (familiar ? ' and ' + familiar : '') + ' know' + people(mutualFriends.length) + ' found in common'));
|
|
320
271
|
if (mutualFriends) {
|
|
321
272
|
for (var _i = 0; _i < mutualFriends.length; _i++) {
|
|
322
|
-
|
|
273
|
+
_tr2.appendChild(dom.createTextNode(', ' + UI.utils.label(mutualFriends[_i])));
|
|
323
274
|
}
|
|
324
275
|
}
|
|
325
276
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
tools.appendChild(_tr2);
|
|
277
|
+
var _tr3 = dom.createElement('tr');
|
|
278
|
+
tools.appendChild(_tr3);
|
|
330
279
|
} // friends
|
|
331
|
-
|
|
332
280
|
} // About someone else
|
|
333
|
-
|
|
334
281
|
} // me is defined
|
|
335
282
|
// End of you and s
|
|
283
|
+
|
|
336
284
|
// div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))
|
|
285
|
+
|
|
337
286
|
// ///////////////////////////////////////////// Main block
|
|
338
287
|
//
|
|
339
288
|
// Should: Find the intersection and difference sets
|
|
340
|
-
// List all x such that s knows x.
|
|
341
|
-
|
|
342
289
|
|
|
290
|
+
// List all x such that s knows x.
|
|
343
291
|
UI.widgets.attachmentList(dom, s, mainTable, {
|
|
344
292
|
doc: profile,
|
|
345
293
|
modify: !!editable,
|
|
346
294
|
predicate: foaf('knows'),
|
|
347
295
|
noun: 'friend'
|
|
348
|
-
});
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// Figure out which are reciprocated:
|
|
349
299
|
// @@ Does not look up profiles
|
|
350
300
|
// Does distinguish reciprocated from unreciprocated friendships
|
|
351
301
|
//
|
|
352
|
-
|
|
353
|
-
function triageFriends(s) {
|
|
302
|
+
function _triageFriends(s) {
|
|
354
303
|
outgoing = kb.each(s, foaf('knows'));
|
|
355
304
|
incoming = kb.each(undefined, foaf('knows'), s); // @@ have to load the friends
|
|
356
|
-
|
|
357
305
|
var confirmed = [];
|
|
358
306
|
var unconfirmed = [];
|
|
359
307
|
var requests = [];
|
|
360
|
-
|
|
361
308
|
for (var _i2 = 0; _i2 < outgoing.length; _i2++) {
|
|
362
309
|
var friend = outgoing[_i2];
|
|
363
310
|
var found = false;
|
|
364
|
-
|
|
365
311
|
for (var j = 0; j < incoming.length; j++) {
|
|
366
312
|
if (incoming[j].sameTerm(friend)) {
|
|
367
313
|
found = true;
|
|
368
314
|
break;
|
|
369
315
|
}
|
|
370
316
|
}
|
|
371
|
-
|
|
372
317
|
if (found) confirmed.push(friend);else unconfirmed.push(friend);
|
|
373
318
|
} // outgoing
|
|
374
319
|
|
|
375
|
-
|
|
376
320
|
for (var _i3 = 0; _i3 < incoming.length; _i3++) {
|
|
377
|
-
var _friend = incoming[_i3];
|
|
378
|
-
|
|
321
|
+
var _friend = incoming[_i3];
|
|
322
|
+
// var lab = UI.utils.label(friend)
|
|
379
323
|
var _found = false;
|
|
380
|
-
|
|
381
324
|
for (var _j = 0; _j < outgoing.length; _j++) {
|
|
382
325
|
if (outgoing[_j].sameTerm(_friend)) {
|
|
383
326
|
_found = true;
|
|
384
327
|
break;
|
|
385
328
|
}
|
|
386
329
|
}
|
|
387
|
-
|
|
388
330
|
if (!_found) requests.push(_friend);
|
|
389
331
|
} // incoming
|
|
390
332
|
|
|
391
|
-
|
|
392
333
|
var cases = [['Acquaintances', outgoing], ['Mentioned as acquaintances by: ', requests]];
|
|
393
|
-
|
|
394
334
|
for (var _i4 = 0; _i4 < cases.length; _i4++) {
|
|
395
335
|
var thisCase = cases[_i4];
|
|
396
336
|
var _friends = thisCase[1];
|
|
397
337
|
if (_friends.length === 0) continue; // Skip empty sections (sure?)
|
|
398
338
|
|
|
399
339
|
var _h = dom.createElement('h3');
|
|
400
|
-
|
|
401
340
|
_h.textContent = thisCase[0];
|
|
402
341
|
var htr = dom.createElement('tr');
|
|
403
342
|
htr.appendChild(_h);
|
|
404
343
|
mainTable.appendChild(htr);
|
|
405
344
|
var items = [];
|
|
406
|
-
|
|
407
345
|
for (var j9 = 0; j9 < _friends.length; j9++) {
|
|
408
346
|
items.push([UI.utils.label(_friends[j9]), _friends[j9]]);
|
|
409
347
|
}
|
|
410
|
-
|
|
411
348
|
items.sort();
|
|
412
349
|
var last = null;
|
|
413
350
|
var fr = void 0;
|
|
414
|
-
|
|
415
351
|
for (var j7 = 0; j7 < items.length; j7++) {
|
|
416
352
|
fr = items[j7][1];
|
|
417
353
|
if (fr.sameTerm(last)) continue; // unique
|
|
418
|
-
|
|
419
354
|
last = fr;
|
|
420
|
-
|
|
421
355
|
if (UI.utils.label(fr) !== '...') {
|
|
422
356
|
// This check is to avoid bnodes with no labels attached
|
|
423
357
|
// appearing in the friends list with "..." - Oshani
|
|
@@ -426,28 +360,26 @@ module.exports = {
|
|
|
426
360
|
}
|
|
427
361
|
}
|
|
428
362
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
363
|
+
/* if ($rdf.keepThisCodeForLaterButDisableFerossConstantConditionPolice) {
|
|
364
|
+
triageFriends(s)
|
|
365
|
+
} */
|
|
366
|
+
// //////////////////////////////////// Basic info on left
|
|
434
367
|
|
|
435
368
|
h3 = dom.createElement('h3');
|
|
436
369
|
h3.appendChild(dom.createTextNode('Basic Information'));
|
|
437
|
-
tools.appendChild(h3);
|
|
370
|
+
tools.appendChild(h3);
|
|
371
|
+
|
|
372
|
+
// For each home page like thing make a label which will
|
|
438
373
|
// make sense and add the domain (like "w3.org blog") if there are more than one of the same type
|
|
439
374
|
//
|
|
440
|
-
|
|
441
375
|
var preds = [UI.ns.foaf('homepage'), UI.ns.foaf('weblog'), UI.ns.foaf('workplaceHomepage'), UI.ns.foaf('schoolHomepage')];
|
|
442
|
-
|
|
443
376
|
for (var i6 = 0; i6 < preds.length; i6++) {
|
|
444
377
|
var pred = preds[i6];
|
|
445
378
|
var sts = kb.statementsMatching(s, pred);
|
|
446
|
-
|
|
447
|
-
|
|
379
|
+
if (sts.length === 0) {
|
|
380
|
+
// if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
|
|
448
381
|
} else {
|
|
449
382
|
var uris = [];
|
|
450
|
-
|
|
451
383
|
for (var j5 = 0; j5 < sts.length; j5++) {
|
|
452
384
|
var st = sts[j5];
|
|
453
385
|
if (st.object.uri) uris.push(st.object.uri); // Ignore if not symbol
|
|
@@ -456,18 +388,14 @@ module.exports = {
|
|
|
456
388
|
uris.sort();
|
|
457
389
|
var last2 = '';
|
|
458
390
|
var lab2 = void 0;
|
|
459
|
-
|
|
460
391
|
for (var k = 0; k < uris.length; k++) {
|
|
461
392
|
var uri = uris[k];
|
|
462
393
|
if (uri === last2) continue; // uniques only
|
|
463
|
-
|
|
464
394
|
last2 = uri;
|
|
465
395
|
var hostlabel = '';
|
|
466
396
|
lab2 = UI.utils.label(pred);
|
|
467
|
-
|
|
468
397
|
if (uris.length > 1) {
|
|
469
398
|
var l = uri.indexOf('//');
|
|
470
|
-
|
|
471
399
|
if (l > 0) {
|
|
472
400
|
var r = uri.indexOf('/', l + 2);
|
|
473
401
|
var r2 = uri.lastIndexOf('.', r);
|
|
@@ -475,39 +403,34 @@ module.exports = {
|
|
|
475
403
|
hostlabel = uri.slice(l + 2, r);
|
|
476
404
|
}
|
|
477
405
|
}
|
|
478
|
-
|
|
479
406
|
if (hostlabel) lab2 = hostlabel + ' ' + lab2; // disambiguate
|
|
480
|
-
|
|
481
407
|
var t = dom.createTextNode(lab2);
|
|
482
408
|
var a = dom.createElement('a');
|
|
483
409
|
a.appendChild(t);
|
|
484
410
|
a.setAttribute('href', uri);
|
|
485
|
-
var d = dom.createElement('div');
|
|
486
|
-
|
|
411
|
+
var d = dom.createElement('div');
|
|
412
|
+
// d.className = 'social_linkButton'
|
|
487
413
|
d.style.cssText = 'width: 80%; background-color: #fff; border: solid 0.05em #ccc; margin-top: 0.1em; margin-bottom: 0.1em; padding: 0.1em; text-align: center;';
|
|
488
414
|
d.appendChild(a);
|
|
489
415
|
tools.appendChild(d);
|
|
490
416
|
}
|
|
491
417
|
}
|
|
492
418
|
}
|
|
493
|
-
|
|
494
419
|
var preds2 = [UI.ns.foaf('openid'), UI.ns.foaf('nick')];
|
|
495
|
-
|
|
496
420
|
for (var i2 = 0; i2 < preds2.length; i2++) {
|
|
497
421
|
var _pred2 = preds2[i2];
|
|
498
422
|
var sts2 = kb.statementsMatching(s, _pred2);
|
|
499
|
-
|
|
500
|
-
|
|
423
|
+
if (sts2.length === 0) {
|
|
424
|
+
// if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
|
|
501
425
|
} else {
|
|
502
426
|
outliner.appendPropertyTRs(tools, sts2, false, function (_pred) {
|
|
503
427
|
return true;
|
|
504
428
|
});
|
|
505
429
|
}
|
|
506
430
|
}
|
|
507
|
-
|
|
508
431
|
return div;
|
|
509
432
|
} // render()
|
|
510
|
-
|
|
511
433
|
}; //
|
|
512
434
|
// ends
|
|
435
|
+
exports.socialPane = socialPane;
|
|
513
436
|
//# sourceMappingURL=socialPane.js.map
|