solid-panes 3.7.3-671186bc → 3.7.3-8aeefd81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RDFXMLPane.js +58 -0
- package/dist/RDFXMLPane.js.map +1 -0
- package/{lib → dist}/argument/argumentPane.js +14 -15
- package/dist/argument/argumentPane.js.map +1 -0
- package/{lib → dist}/attach/attachPane.js +83 -93
- package/dist/attach/attachPane.js.map +1 -0
- package/{lib → dist}/audio/audioPane.js +49 -50
- package/dist/audio/audioPane.js.map +1 -0
- package/{lib → dist}/classInstancePane.js +23 -24
- package/dist/classInstancePane.js.map +1 -0
- package/dist/dashboard/basicPreferences.js +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 +63 -63
- package/dist/dataContentPane.js.map +1 -0
- package/{lib → dist}/defaultPane.js +14 -15
- package/dist/defaultPane.js.map +1 -0
- package/{lib → dist}/dokieli/dokieliPane.js +49 -53
- package/dist/dokieli/dokieliPane.js.map +1 -0
- package/{src → dist}/dokieli/new.js +9 -3
- package/dist/dokieli/new.js.map +1 -0
- package/{lib → dist}/form/pane.js +44 -45
- package/dist/form/pane.js.map +1 -0
- package/{lib → dist}/home/homePane.d.ts.map +1 -1
- 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 +85 -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 +261 -262
- package/dist/microblogPane/microblogPane.js.map +1 -0
- package/dist/n3Pane.js +56 -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 +30 -31
- package/dist/outline/queryByExample.js.map +1 -0
- package/{lib → dist}/outline/userInput.js +262 -260
- package/dist/outline/userInput.js.map +1 -0
- package/dist/outline/viewAsImage.js +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 +141 -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 +45 -38
- 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}/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,374 +0,0 @@
|
|
|
1
|
-
/* Financial Period Pane
|
|
2
|
-
**
|
|
3
|
-
** This outline pane allows a user to interact with a period
|
|
4
|
-
** downloaded from a bank statement, annotting it with classes and comments,
|
|
5
|
-
** trips, etc
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import * as UI from 'solid-ui'
|
|
9
|
-
const ns = UI.ns
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
icon: UI.icons.iconBase + 'noun_142708.svg',
|
|
13
|
-
|
|
14
|
-
name: 'period',
|
|
15
|
-
|
|
16
|
-
audience: [ns.solid('PowerUser')],
|
|
17
|
-
|
|
18
|
-
// Does the subject deserve this pane?
|
|
19
|
-
label: function (subject, context) {
|
|
20
|
-
const kb = context.session.store
|
|
21
|
-
const t = kb.findTypeURIs(subject)
|
|
22
|
-
if (t['http://www.w3.org/2000/10/swap/pim/qif#Period']) return 'period'
|
|
23
|
-
return null // No under other circumstances (while testing at least!)
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
render: function (subject, context) {
|
|
27
|
-
const dom = context.dom
|
|
28
|
-
const kb = context.session.store
|
|
29
|
-
const ns = UI.ns
|
|
30
|
-
|
|
31
|
-
const div = dom.createElement('div')
|
|
32
|
-
div.setAttribute('class', 'periodPane')
|
|
33
|
-
|
|
34
|
-
const mention = function mention (message, style) {
|
|
35
|
-
if (!style) style = 'color: grey;'
|
|
36
|
-
const pre = dom.createElement('pre')
|
|
37
|
-
pre.setAttribute('style', style)
|
|
38
|
-
div.appendChild(pre)
|
|
39
|
-
pre.appendChild(dom.createTextNode(message))
|
|
40
|
-
}
|
|
41
|
-
const happy = function happy (message) {
|
|
42
|
-
return mention('✓ ' + message, 'color: #010; background-color: #efe')
|
|
43
|
-
}
|
|
44
|
-
const complain = function complain (message) {
|
|
45
|
-
return mention(message, 'color: #100; background-color: #fee')
|
|
46
|
-
}
|
|
47
|
-
/*
|
|
48
|
-
var rerender = function (div) {
|
|
49
|
-
var parent = div.parentNode
|
|
50
|
-
var div2 = thisPane.render(subject, dom)
|
|
51
|
-
parent.replaceChild(div2, div)
|
|
52
|
-
}
|
|
53
|
-
*/
|
|
54
|
-
const renderPeriod = function () {
|
|
55
|
-
const dtstart = kb.any(subject, ns.cal('dtstart'))
|
|
56
|
-
if (dtstart === undefined) {
|
|
57
|
-
complain(
|
|
58
|
-
'(Error: There is no start date known for this period <' +
|
|
59
|
-
subject.uri +
|
|
60
|
-
'>,\n -- every period needs one.)'
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const dtend = kb.any(subject, ns.cal('dtend'))
|
|
65
|
-
if (dtend === undefined) {
|
|
66
|
-
complain(
|
|
67
|
-
'(Error: There is no end date known for this period <' +
|
|
68
|
-
subject.uri +
|
|
69
|
-
'>,\n -- every period needs one.)'
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// var store = kb.any(subject, UI.ns.qu('annotationStore')) || null
|
|
74
|
-
|
|
75
|
-
const predicateURIsDone = {}
|
|
76
|
-
const donePredicate = function (pred) {
|
|
77
|
-
predicateURIsDone[pred.uri] = true
|
|
78
|
-
}
|
|
79
|
-
donePredicate(ns.rdf('type'))
|
|
80
|
-
|
|
81
|
-
const inPeriod = function (date) {
|
|
82
|
-
return !!(date && date >= dtstart && date < dtend)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const d2 = function (n) {
|
|
86
|
-
const s = '' + n
|
|
87
|
-
if (s.indexOf('.') >= 0) {
|
|
88
|
-
return s.split('.')[0] + '.' + (s.split('.')[1] + '00').slice(0, 2)
|
|
89
|
-
}
|
|
90
|
-
return s + '.00'
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const transactionInPeriod = function (x) {
|
|
94
|
-
return inPeriod(kb.any(x, ns.qu('date')))
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const oderByDate = function (x, y) {
|
|
98
|
-
const dx = kb.any(x, ns.qu('date'))
|
|
99
|
-
const dy = kb.any(y, ns.qu('date'))
|
|
100
|
-
if (dx !== undefined && dy !== undefined) {
|
|
101
|
-
if (dx.value < dy.value) return -1
|
|
102
|
-
if (dx.value > dy.value) return 1
|
|
103
|
-
}
|
|
104
|
-
if (x.uri < y.uri) return -1 // Arbitrary but repeatable
|
|
105
|
-
if (x.uri > y.uri) return 1
|
|
106
|
-
return 0
|
|
107
|
-
}
|
|
108
|
-
/*
|
|
109
|
-
var setPaneStyle = function (account) {
|
|
110
|
-
var mystyle = 'padding: 0.5em 1.5em 1em 1.5em; '
|
|
111
|
-
if (account) {
|
|
112
|
-
var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'))
|
|
113
|
-
if (backgroundColor) {
|
|
114
|
-
mystyle += 'background-color: ' + backgroundColor.value + '; '
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
div.setAttribute('style', mystyle)
|
|
118
|
-
}
|
|
119
|
-
// setPaneStyle();
|
|
120
|
-
*/
|
|
121
|
-
const h2 = div.appendChild(dom.createElement('h2'))
|
|
122
|
-
h2.textContent =
|
|
123
|
-
'Period ' +
|
|
124
|
-
dtstart.value.slice(0, 10) +
|
|
125
|
-
' - ' +
|
|
126
|
-
dtend.value.slice(0, 10)
|
|
127
|
-
|
|
128
|
-
const insertedPane = function (context, subject, paneName) {
|
|
129
|
-
const p = context.session.paneRegistry.byName(paneName)
|
|
130
|
-
const d = p.render(subject, context)
|
|
131
|
-
d.setAttribute('style', 'border: 0.1em solid green;')
|
|
132
|
-
return d
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const expandAfterRow = function (dom, row, subject, paneName, solo) {
|
|
136
|
-
const siblings = row.parentNode.children
|
|
137
|
-
if (solo) {
|
|
138
|
-
for (let j = siblings.length - 1; j >= 0; j--) {
|
|
139
|
-
if (siblings[j].expanded) {
|
|
140
|
-
siblings[j].parentNode.removeChild(siblings[j].expanded)
|
|
141
|
-
siblings[j].expanded = false
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
const tr = dom.createElement('tr')
|
|
146
|
-
const td = tr.appendChild(dom.createElement('td'))
|
|
147
|
-
td.setAttribute(
|
|
148
|
-
'style',
|
|
149
|
-
'width: 98%; padding: 1em; border: 0.1em solid grey;'
|
|
150
|
-
)
|
|
151
|
-
const cols = row.children.length
|
|
152
|
-
if (row.nextSibling) {
|
|
153
|
-
row.parentNode.insertBefore(tr, row.nextSibling)
|
|
154
|
-
} else {
|
|
155
|
-
row.parentNode.appendChild(tr)
|
|
156
|
-
}
|
|
157
|
-
row.expanded = tr
|
|
158
|
-
td.setAttribute('colspan', '' + cols)
|
|
159
|
-
td.appendChild(insertedPane(context, subject, paneName))
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const expandAfterRowOrCollapse = function (
|
|
163
|
-
dom,
|
|
164
|
-
row,
|
|
165
|
-
subject,
|
|
166
|
-
paneName,
|
|
167
|
-
solo
|
|
168
|
-
) {
|
|
169
|
-
if (row.expanded) {
|
|
170
|
-
row.parentNode.removeChild(row.expanded)
|
|
171
|
-
row.expanded = false
|
|
172
|
-
} else {
|
|
173
|
-
expandAfterRow(dom, row, subject, paneName, solo)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const transactionTable = function (dom, list) {
|
|
178
|
-
const table = dom.createElement('table')
|
|
179
|
-
table.setAttribute(
|
|
180
|
-
'style',
|
|
181
|
-
'margin-left: 100; font-size: 9pt; width: 85%;'
|
|
182
|
-
)
|
|
183
|
-
const transactionRow = function (dom, x) {
|
|
184
|
-
const tr = dom.createElement('tr')
|
|
185
|
-
|
|
186
|
-
const setTRStyle = function (tr, account) {
|
|
187
|
-
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; ";
|
|
188
|
-
let mystyle = 'margin-left: 8em; padding-left: 5em;'
|
|
189
|
-
if (account) {
|
|
190
|
-
const backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'))
|
|
191
|
-
if (backgroundColor) {
|
|
192
|
-
mystyle += 'background-color: ' + backgroundColor.value + '; '
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
tr.setAttribute('style', mystyle)
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const account = kb.any(x, ns.qu('toAccount'))
|
|
199
|
-
setTRStyle(tr, account)
|
|
200
|
-
|
|
201
|
-
const c0 = tr.appendChild(dom.createElement('td'))
|
|
202
|
-
const date = kb.any(x, ns.qu('date'))
|
|
203
|
-
c0.textContent = date ? date.value.slice(0, 10) : '???'
|
|
204
|
-
c0.setAttribute('style', 'width: 7em;')
|
|
205
|
-
|
|
206
|
-
const c1 = tr.appendChild(dom.createElement('td'))
|
|
207
|
-
c1.setAttribute('style', 'width: 36em;')
|
|
208
|
-
const payee = kb.any(x, ns.qu('payee'))
|
|
209
|
-
c1.textContent = payee ? payee.value : '???'
|
|
210
|
-
const a1 = c1.appendChild(dom.createElement('a'))
|
|
211
|
-
a1.textContent = ' ➜'
|
|
212
|
-
a1.setAttribute('href', x.uri)
|
|
213
|
-
|
|
214
|
-
const c3 = tr.appendChild(dom.createElement('td'))
|
|
215
|
-
const amount = kb.any(x, ns.qu('in_USD'))
|
|
216
|
-
c3.textContent = amount ? d2(amount.value) : '???'
|
|
217
|
-
c3.setAttribute('style', 'width: 6em; text-align: right; ') // @@ decimal alignment?
|
|
218
|
-
tr.addEventListener(
|
|
219
|
-
'click',
|
|
220
|
-
function (e) {
|
|
221
|
-
// solo unless shift key
|
|
222
|
-
expandAfterRowOrCollapse(dom, tr, x, 'transaction', !e.shiftKey)
|
|
223
|
-
},
|
|
224
|
-
false
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
return tr
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const list2 = list.filter(transactionInPeriod)
|
|
231
|
-
list2.sort(oderByDate)
|
|
232
|
-
|
|
233
|
-
for (let i = 0; i < list2.length; i++) {
|
|
234
|
-
table.appendChild(transactionRow(dom, list2[i]))
|
|
235
|
-
}
|
|
236
|
-
return table
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// List unclassified transactions
|
|
240
|
-
|
|
241
|
-
const dummies = {
|
|
242
|
-
'http://www.w3.org/2000/10/swap/pim/qif#Transaction': true, // (we knew)
|
|
243
|
-
'http://www.w3.org/2000/10/swap/pim/qif#Unclassified': true, // pseudo classifications we may phase out
|
|
244
|
-
'http://www.w3.org/2000/10/swap/pim/qif#UnclassifiedOutgoing': true,
|
|
245
|
-
'http://www.w3.org/2000/10/swap/pim/qif#UnclassifiedIncome': true
|
|
246
|
-
}
|
|
247
|
-
const xURIs = kb.findMemberURIs(ns.qu('Transaction'))
|
|
248
|
-
const unclassifiedIn = []
|
|
249
|
-
const unclassifiedOut = []
|
|
250
|
-
let usd, z
|
|
251
|
-
for (const y in xURIs) {
|
|
252
|
-
// For each thing which can be inferred to be a transaction
|
|
253
|
-
// @@ TODO: Write away the need for exception on next line
|
|
254
|
-
|
|
255
|
-
if (xURIs.hasOwnProperty(y)) {
|
|
256
|
-
z = kb.sym(y)
|
|
257
|
-
const tt = kb.each(z, ns.rdf('type')) // What EXPLICIT definitions
|
|
258
|
-
let classified = false
|
|
259
|
-
for (let j = 0; j < tt.length; j++) {
|
|
260
|
-
const t = tt[j]
|
|
261
|
-
if (dummies[t.uri] === undefined) {
|
|
262
|
-
classified = true
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
if (!classified) {
|
|
266
|
-
usd = kb.any(z, ns.qu('in_USD'))
|
|
267
|
-
if (usd === undefined) {
|
|
268
|
-
usd = kb.any(z, ns.qu('amount'))
|
|
269
|
-
}
|
|
270
|
-
if (usd && ('' + usd.value).indexOf('-') >= 0) {
|
|
271
|
-
unclassifiedOut.push(kb.sym(y))
|
|
272
|
-
} else {
|
|
273
|
-
unclassifiedIn.push(kb.sym(y))
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
let tab, count
|
|
279
|
-
if (unclassifiedIn.length) {
|
|
280
|
-
tab = transactionTable(dom, unclassifiedIn)
|
|
281
|
-
count = tab.children.length
|
|
282
|
-
div.appendChild(dom.createElement('h3')).textContent =
|
|
283
|
-
'Unclassified Income' + (count < 4 ? '' : ' (' + count + ')')
|
|
284
|
-
div.appendChild(tab)
|
|
285
|
-
} else {
|
|
286
|
-
happy('No unclassified income')
|
|
287
|
-
}
|
|
288
|
-
if (unclassifiedOut.length) {
|
|
289
|
-
tab = transactionTable(dom, unclassifiedOut)
|
|
290
|
-
count = tab.children.length
|
|
291
|
-
div.appendChild(dom.createElement('h3')).textContent =
|
|
292
|
-
'Unclassified Outgoings' + (count < 4 ? '' : ' (' + count + ')')
|
|
293
|
-
div.appendChild(tab)
|
|
294
|
-
} else {
|
|
295
|
-
happy('No unclassified outgoings ')
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// /////////////// Check some categories of transaction for having given fields
|
|
299
|
-
|
|
300
|
-
const catSymbol = function (catTail) {
|
|
301
|
-
const cats = kb.findSubClassesNT(ns.qu('Transaction'))
|
|
302
|
-
for (const cat in cats) {
|
|
303
|
-
// @@ TODO: Write away the need for exception on next line
|
|
304
|
-
|
|
305
|
-
if (cats.hasOwnProperty(cat)) {
|
|
306
|
-
if (cat.slice(1, -1).split('#')[1] === catTail) {
|
|
307
|
-
return kb.sym(cat.slice(1, -1))
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
return null
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
const checkCatHasField = function (catTail, pred) {
|
|
315
|
-
const cat = catSymbol(catTail)
|
|
316
|
-
let tab
|
|
317
|
-
const guilty = []
|
|
318
|
-
let count = 0
|
|
319
|
-
if (!cat) {
|
|
320
|
-
complain('Error: No category correspnding to ' + catTail)
|
|
321
|
-
return null
|
|
322
|
-
}
|
|
323
|
-
const list = kb.each(undefined, ns.rdf('type'), cat)
|
|
324
|
-
for (let i = 0; i < list.length; i++) {
|
|
325
|
-
if (!kb.any(list[i], pred)) {
|
|
326
|
-
guilty.push(list[i])
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (guilty.length) {
|
|
330
|
-
tab = transactionTable(dom, guilty)
|
|
331
|
-
count = tab.children.length
|
|
332
|
-
div.appendChild(dom.createElement('h3')).textContent =
|
|
333
|
-
UI.utils.label(cat) +
|
|
334
|
-
' with no ' +
|
|
335
|
-
UI.utils.label(pred) +
|
|
336
|
-
(count < 4 ? '' : ' (' + count + ')')
|
|
337
|
-
div.appendChild(tab)
|
|
338
|
-
}
|
|
339
|
-
return count
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
// Load dynamically as properties of period
|
|
343
|
-
if (checkCatHasField('Reimbursables', ns.trip('trip')) === 0) {
|
|
344
|
-
happy('Reimbursables all have trips')
|
|
345
|
-
}
|
|
346
|
-
if (checkCatHasField('Other_Inc_Speaking', ns.trip('trip')) === 0) {
|
|
347
|
-
happy('Speaking income all has trips')
|
|
348
|
-
}
|
|
349
|
-
// end of render period instance
|
|
350
|
-
} // renderPeriod
|
|
351
|
-
|
|
352
|
-
// //////////////////////////////////////////////////////////////////////////////
|
|
353
|
-
|
|
354
|
-
// var me = authn.currentUser()
|
|
355
|
-
|
|
356
|
-
// Render a single Period
|
|
357
|
-
|
|
358
|
-
// This works only if enough metadata about the properties can drive the RDFS
|
|
359
|
-
// (or actual type statements whichtypically are NOT there on)
|
|
360
|
-
const t = kb.findTypeURIs(subject)
|
|
361
|
-
if (t['http://www.w3.org/2000/10/swap/pim/qif#Period']) {
|
|
362
|
-
const needed = kb.each(subject, ns.rdfs('seeAlso'))
|
|
363
|
-
console.log('Loading before render: ' + needed.length)
|
|
364
|
-
kb.fetcher.load(needed).then(function () {
|
|
365
|
-
renderPeriod()
|
|
366
|
-
})
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
// if (!me) complain("You do not have your Web Id set. Set your Web ID to make changes.");
|
|
370
|
-
|
|
371
|
-
return div
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
// ends
|
|
Binary file
|
package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png
DELETED
|
Binary file
|
package/src/trip/tripPane.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/* Trip Pane
|
|
2
|
-
**
|
|
3
|
-
** This pane deals with trips themselves and also
|
|
4
|
-
** will look at transactions organized by trip.
|
|
5
|
-
**
|
|
6
|
-
** This outline pane allows a user to interact with a transaction
|
|
7
|
-
** downloaded from a bank statement, annotting it with classes and comments,
|
|
8
|
-
** trips, etc
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as UI from 'solid-ui'
|
|
12
|
-
import * as $rdf from 'rdflib'
|
|
13
|
-
const ns = UI.ns
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
icon: UI.icons.iconBase + 'noun_62007.svg',
|
|
17
|
-
|
|
18
|
-
name: 'travel expenses',
|
|
19
|
-
|
|
20
|
-
audience: [ns.solid('PowerUser')],
|
|
21
|
-
|
|
22
|
-
// Does the subject deserve this pane?
|
|
23
|
-
label: function (subject, context) {
|
|
24
|
-
const kb = context.session.store
|
|
25
|
-
const t = kb.findTypeURIs(subject)
|
|
26
|
-
|
|
27
|
-
// if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction']) return "$$";
|
|
28
|
-
// if(kb.any(subject, UI.ns.qu('amount'))) return "$$$"; // In case schema not picked up
|
|
29
|
-
|
|
30
|
-
if (UI.ns.qu('Transaction') in kb.findSuperClassesNT(subject)) {
|
|
31
|
-
return 'by Trip'
|
|
32
|
-
}
|
|
33
|
-
if (t['http://www.w3.org/ns/pim/trip#Trip']) return 'Trip $'
|
|
34
|
-
|
|
35
|
-
return null // No under other circumstances (while testing at least!)
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
render: function (subject, context) {
|
|
39
|
-
const myDocument = context.dom
|
|
40
|
-
const kb = context.store
|
|
41
|
-
const ns = UI.ns
|
|
42
|
-
const CAL = $rdf.Namespace('http://www.w3.org/2002/12/cal/ical#')
|
|
43
|
-
const TRIP = $rdf.Namespace('http://www.w3.org/ns/pim/trip#')
|
|
44
|
-
|
|
45
|
-
const div = myDocument.createElement('div')
|
|
46
|
-
div.setAttribute('class', 'transactionPane')
|
|
47
|
-
div.innerHTML = '<h2>Trip transactions</h2>'
|
|
48
|
-
|
|
49
|
-
const complain = function complain (message, style) {
|
|
50
|
-
if (style === undefined) style = 'color: grey'
|
|
51
|
-
const pre = myDocument.createElement('pre')
|
|
52
|
-
pre.setAttribute('style', style)
|
|
53
|
-
div.appendChild(pre)
|
|
54
|
-
pre.appendChild(myDocument.createTextNode(message))
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// //////////////////////////////////////////////////////////////////////////////
|
|
58
|
-
//
|
|
59
|
-
// Body of trip pane
|
|
60
|
-
|
|
61
|
-
const t = kb.findTypeURIs(subject)
|
|
62
|
-
|
|
63
|
-
// var me = authn.currentUser()
|
|
64
|
-
|
|
65
|
-
// Function: Render a single trip
|
|
66
|
-
|
|
67
|
-
const renderTrip = function renderTrip (subject, thisDiv) {
|
|
68
|
-
const query = new $rdf.Query(UI.utils.label(subject))
|
|
69
|
-
const vars = ['date', 'transaction', 'comment', 'type', 'in_USD']
|
|
70
|
-
const v = {}
|
|
71
|
-
vars.forEach(function (x) {
|
|
72
|
-
query.vars.push((v[x] = $rdf.variable(x)))
|
|
73
|
-
}) // Only used by UI
|
|
74
|
-
query.pat.add(v.transaction, TRIP('trip'), subject)
|
|
75
|
-
|
|
76
|
-
const opt = kb.formula()
|
|
77
|
-
opt.add(v.transaction, ns.rdf('type'), v.type) // Issue: this will get stored supertypes too
|
|
78
|
-
query.pat.optional.push(opt)
|
|
79
|
-
|
|
80
|
-
query.pat.add(v.transaction, UI.ns.qu('date'), v.date)
|
|
81
|
-
|
|
82
|
-
opt.add(v.transaction, ns.rdfs('comment'), v.comment)
|
|
83
|
-
query.pat.optional.push(opt)
|
|
84
|
-
|
|
85
|
-
// opt = kb.formula();
|
|
86
|
-
query.pat.add(v.transaction, UI.ns.qu('in_USD'), v.in_USD)
|
|
87
|
-
// query.pat.optional.push(opt);
|
|
88
|
-
|
|
89
|
-
const calculations = function () {
|
|
90
|
-
const total = {}
|
|
91
|
-
const trans = kb.each(undefined, TRIP('trip'), subject)
|
|
92
|
-
// complain("@@ Number of transactions in this trip: " + trans.length);
|
|
93
|
-
trans.forEach(function (t) {
|
|
94
|
-
let ty = kb.the(t, ns.rdf('type'))
|
|
95
|
-
// complain(" -- one trans: "+t.uri + ' -> '+kb.any(t, UI.ns.qu('in_USD')));
|
|
96
|
-
if (!ty) ty = UI.ns.qu('ErrorNoType')
|
|
97
|
-
if (ty && ty.uri) {
|
|
98
|
-
const tyuri = ty.uri
|
|
99
|
-
if (!total[tyuri]) total[tyuri] = 0.0
|
|
100
|
-
const lit = kb.any(t, UI.ns.qu('in_USD'))
|
|
101
|
-
if (!lit) {
|
|
102
|
-
complain(' @@ No amount in USD: ' + lit + ' for ' + t)
|
|
103
|
-
}
|
|
104
|
-
if (lit) {
|
|
105
|
-
total[tyuri] = total[tyuri] + parseFloat(lit.value)
|
|
106
|
-
// complain(' Trans type ='+ty+'; in_USD "' + lit
|
|
107
|
-
// +'; total[tyuri] = '+total[tyuri]+';')
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
let str = ''
|
|
112
|
-
let types = 0
|
|
113
|
-
let grandTotal = 0.0
|
|
114
|
-
for (const uri in total) {
|
|
115
|
-
str += UI.utils.label(kb.sym(uri)) + ': ' + total[uri] + '; '
|
|
116
|
-
types++
|
|
117
|
-
grandTotal += total[uri]
|
|
118
|
-
}
|
|
119
|
-
complain('Totals of ' + trans.length + ' transactions: ' + str, '') // @@@@@ yucky -- need 2 col table
|
|
120
|
-
if (types > 1) {
|
|
121
|
-
complain('Overall net: ' + grandTotal, 'text-treatment: bold;')
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
const tableDiv = UI.table(myDocument, {
|
|
125
|
-
query: query,
|
|
126
|
-
onDone: calculations
|
|
127
|
-
})
|
|
128
|
-
thisDiv.appendChild(tableDiv)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Render the set of trips which have transactions in this class
|
|
132
|
-
|
|
133
|
-
if (UI.ns.qu('Transaction') in kb.findSuperClassesNT(subject)) {
|
|
134
|
-
const ts = kb.each(undefined, ns.rdf('type'), subject)
|
|
135
|
-
const triples = []
|
|
136
|
-
const index = []
|
|
137
|
-
for (let i = 0; i < ts.length; i++) {
|
|
138
|
-
const trans = ts[i]
|
|
139
|
-
const trip = kb.any(trans, TRIP('trip'))
|
|
140
|
-
if (!trip) {
|
|
141
|
-
triples.push(trans)
|
|
142
|
-
} else {
|
|
143
|
-
if (!(trans in index)) index[trip] = { total: 0, transactions: [] }
|
|
144
|
-
const usd = kb.any(trans, UI.ns.qu('in_USD'))
|
|
145
|
-
if (usd) index[trip].total += usd
|
|
146
|
-
const date = kb.any(trans, UI.ns.qu('date'))
|
|
147
|
-
index[trip.toNT()].transactions.push([date, trans])
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
/* var byDate = function(a,b) {
|
|
151
|
-
return new Date(kb.any(a, CAL('dtstart'))) -
|
|
152
|
-
new Date(kb.any(b, CAL('dtstart')));
|
|
153
|
-
}
|
|
154
|
-
*/
|
|
155
|
-
const list = []
|
|
156
|
-
for (const h1 in index) {
|
|
157
|
-
const t1 = kb.fromNT(h1)
|
|
158
|
-
list.push([kb.any(t1, CAL('dtstart')), t1])
|
|
159
|
-
}
|
|
160
|
-
list.sort()
|
|
161
|
-
for (let j = 0; j < list.length; j++) {
|
|
162
|
-
const t2 = list[j][1]
|
|
163
|
-
renderTrip(t2, div)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Render a single trip
|
|
167
|
-
} else if (t['http://www.w3.org/ns/pim/trip#Trip']) {
|
|
168
|
-
renderTrip(subject, div)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// if (!me) complain("You do not have your Web Id set. Set your Web ID to make changes.");
|
|
172
|
-
|
|
173
|
-
return div
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
// ends
|