solid-panes 3.5.28-alpha → 3.5.29-alpha
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/README.md +0 -2
- package/lib/RDFXMLPane.js +6 -8
- package/lib/RDFXMLPane.js.map +1 -1
- package/lib/argument/argumentPane.js +10 -11
- package/lib/argument/argumentPane.js.map +1 -1
- package/lib/attach/attachPane.js +47 -85
- package/lib/attach/attachPane.js.map +1 -1
- package/lib/audio/audioPane.js +11 -36
- package/lib/audio/audioPane.js.map +1 -1
- package/lib/classInstancePane.js +11 -20
- package/lib/classInstancePane.js.map +1 -1
- package/lib/dashboard/basicPreferences.js +3 -53
- package/lib/dashboard/basicPreferences.js.map +1 -1
- package/lib/dashboard/dashboardPane.js +2 -18
- package/lib/dashboard/dashboardPane.js.map +1 -1
- package/lib/dashboard/homepage.js +1 -19
- package/lib/dashboard/homepage.js.map +1 -1
- package/lib/dataContentPane.js +15 -58
- package/lib/dataContentPane.js.map +1 -1
- package/lib/defaultPane.js +13 -21
- package/lib/defaultPane.js.map +1 -1
- package/lib/dokieli/dokieliPane.js +19 -28
- package/lib/dokieli/dokieliPane.js.map +1 -1
- package/lib/dokieli/new.js.map +1 -1
- package/lib/form/pane.js +26 -40
- package/lib/form/pane.js.map +1 -1
- package/lib/home/homePane.js +7 -23
- 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 +9 -13
- package/lib/imagePane.js.map +1 -1
- package/lib/index.js +4 -18
- package/lib/index.js.map +1 -1
- package/lib/internal/internalPane.js +10 -41
- package/lib/internal/internalPane.js.map +1 -1
- package/lib/mainPage/footer.js +0 -4
- package/lib/mainPage/footer.js.map +1 -1
- package/lib/mainPage/header.js +2 -28
- package/lib/mainPage/header.js.map +1 -1
- package/lib/mainPage/index.js +1 -12
- package/lib/mainPage/index.js.map +1 -1
- package/lib/microblogPane/microblogPane.js +100 -237
- package/lib/microblogPane/microblogPane.js.map +1 -1
- package/lib/n3Pane.js +2 -7
- package/lib/n3Pane.js.map +1 -1
- package/lib/outline/context.js +0 -2
- package/lib/outline/context.js.map +1 -1
- package/lib/outline/licenseOptions.js +9 -25
- package/lib/outline/licenseOptions.js.map +1 -1
- package/lib/outline/manager.js +178 -580
- package/lib/outline/manager.js.map +1 -1
- package/lib/outline/manager.test.js +1 -11
- package/lib/outline/manager.test.js.map +1 -1
- package/lib/outline/outlineIcons.js +30 -25
- package/lib/outline/outlineIcons.js.map +1 -1
- package/lib/outline/propertyViews.js +0 -10
- package/lib/outline/propertyViews.js.map +1 -1
- package/lib/outline/propertyViews.test.js +1 -3
- package/lib/outline/propertyViews.test.js.map +1 -1
- package/lib/outline/queryByExample.js +24 -76
- package/lib/outline/queryByExample.js.map +1 -1
- package/lib/outline/userInput.js +214 -454
- package/lib/outline/userInput.js.map +1 -1
- package/lib/outline/viewAsImage.js +0 -6
- package/lib/outline/viewAsImage.js.map +1 -1
- package/lib/outline/viewAsMbox.js +3 -4
- package/lib/outline/viewAsMbox.js.map +1 -1
- package/lib/pad/padPane.js +45 -93
- package/lib/pad/padPane.js.map +1 -1
- package/lib/playlist/playlistPane.js +3 -20
- package/lib/playlist/playlistPane.js.map +1 -1
- package/lib/profile/editProfile.view.js +7 -24
- package/lib/profile/editProfile.view.js.map +1 -1
- package/lib/profile/profile.dom.js +0 -3
- package/lib/profile/profile.dom.js.map +1 -1
- package/lib/registerPanes.js +29 -27
- package/lib/registerPanes.js.map +1 -1
- package/lib/schedule/formsForSchedule.js.map +1 -1
- package/lib/schedule/schedulePane.js +62 -122
- package/lib/schedule/schedulePane.js.map +1 -1
- package/lib/sharing/sharingPane.js +2 -10
- package/lib/sharing/sharingPane.js.map +1 -1
- package/lib/slideshow/slideshowPane.js +9 -14
- package/lib/slideshow/slideshowPane.js.map +1 -1
- package/lib/socialPane.js +43 -124
- package/lib/socialPane.js.map +1 -1
- package/lib/tabbed/tabbedPane.js +1 -15
- package/lib/tabbed/tabbedPane.js.map +1 -1
- package/lib/tableViewPane.js +4 -7
- package/lib/tableViewPane.js.map +1 -1
- package/lib/test-import-export/common.js +2 -1
- package/lib/test-import-export/common.js.map +1 -1
- package/lib/test-import-export/edit-importer.js +7 -9
- package/lib/test-import-export/edit-importer.js.map +1 -1
- package/lib/transaction/pane.js +31 -90
- package/lib/transaction/pane.js.map +1 -1
- package/lib/transaction/period.js +20 -71
- package/lib/transaction/period.js.map +1 -1
- package/lib/trip/tripPane.js +30 -34
- package/lib/trip/tripPane.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.dom.js +8 -34
- package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.test.js +3 -8
- package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -10
- package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
- package/lib/trustedApplications/trustedApplications.view.js +1 -22
- package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
- package/lib/ui/pane.js +22 -28
- package/lib/ui/pane.js.map +1 -1
- package/lib/versionInfo.d.ts +2 -0
- package/lib/versionInfo.d.ts.map +1 -1
- package/lib/versionInfo.js +18 -16
- package/lib/versionInfo.js.map +1 -1
- package/lib/video/videoPane.js +2 -5
- package/lib/video/videoPane.js.map +1 -1
- package/package.json +24 -24
- package/src/versionInfo.ts +18 -16
package/lib/transaction/pane.js
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
** downloaded from a bank statement, annotting it with classes and comments,
|
|
7
7
|
** trips, etc
|
|
8
8
|
*/
|
|
9
|
-
var UI = require('solid-ui');
|
|
10
9
|
|
|
10
|
+
var UI = require('solid-ui');
|
|
11
11
|
var $rdf = require('rdflib');
|
|
12
|
-
|
|
13
12
|
var ns = UI.ns;
|
|
14
13
|
module.exports = {
|
|
15
14
|
// icon: (module.__dirname || __dirname) + '22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png',
|
|
@@ -22,11 +21,13 @@ module.exports = {
|
|
|
22
21
|
var t = kb.findTypeURIs(subject);
|
|
23
22
|
if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction']) return '$$';
|
|
24
23
|
if (kb.any(subject, UI.ns.qu('amount'))) return '$$$'; // In case schema not picked up
|
|
24
|
+
|
|
25
25
|
// if (t['http://www.w3.org/2000/10/swap/pim/qif#Period']) return "period $"
|
|
26
26
|
|
|
27
27
|
if (t['http://www.w3.org/ns/pim/trip#Trip']) return 'Trip $';
|
|
28
28
|
return null; // No under other circumstances (while testing at least!)
|
|
29
29
|
},
|
|
30
|
+
|
|
30
31
|
render: function render(subject, context) {
|
|
31
32
|
var dom = context.dom;
|
|
32
33
|
var kb = context.session.store;
|
|
@@ -35,7 +36,6 @@ module.exports = {
|
|
|
35
36
|
var TRIP = $rdf.Namespace('http://www.w3.org/ns/pim/trip#');
|
|
36
37
|
var div = dom.createElement('div');
|
|
37
38
|
div.setAttribute('class', 'transactionPane');
|
|
38
|
-
|
|
39
39
|
var mention = function mention(message, style) {
|
|
40
40
|
if (style === undefined) style = 'color: grey';
|
|
41
41
|
var pre = dom.createElement('pre');
|
|
@@ -43,10 +43,10 @@ module.exports = {
|
|
|
43
43
|
div.appendChild(pre);
|
|
44
44
|
pre.appendChild(dom.createTextNode(message));
|
|
45
45
|
};
|
|
46
|
-
|
|
47
46
|
var complain = function complain(message) {
|
|
48
47
|
return mention(message, 'color: #100; background-color: #fee');
|
|
49
48
|
};
|
|
49
|
+
|
|
50
50
|
/*
|
|
51
51
|
var thisPane = this
|
|
52
52
|
var rerender = function (div) {
|
|
@@ -57,89 +57,72 @@ module.exports = {
|
|
|
57
57
|
*/
|
|
58
58
|
// //////////////////////////////////////////////////////////////////////////////
|
|
59
59
|
|
|
60
|
-
|
|
61
60
|
var plist = kb.statementsMatching(subject);
|
|
62
61
|
var qlist = kb.statementsMatching(undefined, undefined, subject);
|
|
63
|
-
var t = kb.findTypeURIs(subject);
|
|
62
|
+
var t = kb.findTypeURIs(subject);
|
|
64
63
|
|
|
64
|
+
// var me = authn.currentUser()
|
|
65
65
|
var predicateURIsDone = {};
|
|
66
|
-
|
|
67
66
|
var donePredicate = function donePredicate(pred) {
|
|
68
67
|
predicateURIsDone[pred.uri] = true;
|
|
69
68
|
};
|
|
70
|
-
|
|
71
69
|
var setPaneStyle = function setPaneStyle(account) {
|
|
72
70
|
var mystyle = 'padding: 0.5em 1.5em 1em 1.5em; ';
|
|
73
|
-
|
|
74
71
|
if (account) {
|
|
75
72
|
var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
|
|
76
|
-
|
|
77
73
|
if (backgroundColor) {
|
|
78
74
|
mystyle += 'background-color: ' + backgroundColor.value + '; ';
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
|
-
|
|
82
77
|
div.setAttribute('style', mystyle);
|
|
83
|
-
};
|
|
78
|
+
};
|
|
79
|
+
// setPaneStyle()
|
|
80
|
+
|
|
84
81
|
// Functions for displaying lists of transactions
|
|
85
82
|
// Click on the transaction line to expand it into a pane
|
|
86
83
|
// Shift-click to expand without collapsing others
|
|
87
84
|
|
|
88
|
-
|
|
89
85
|
var d2 = function d2(n) {
|
|
90
86
|
if (n === undefined) return '';
|
|
91
87
|
var s = '' + n;
|
|
92
|
-
|
|
93
88
|
if (s.indexOf('.') >= 0) {
|
|
94
89
|
return s.split('.')[0] + '.' + (s.split('.')[1] + '00').slice(0, 2);
|
|
95
90
|
}
|
|
96
|
-
|
|
97
91
|
return s + '.00';
|
|
98
92
|
};
|
|
99
|
-
|
|
100
93
|
var numericCell = function numericCell(amount, suppressZero) {
|
|
101
94
|
var td = dom.createElement('td');
|
|
102
|
-
|
|
103
95
|
if (!(0.0 + amount === 0.0 && suppressZero)) {
|
|
104
96
|
td.textContent = d2(amount);
|
|
105
97
|
}
|
|
106
|
-
|
|
107
98
|
td.setAttribute('style', 'width: 6em; text-align: right; ');
|
|
108
99
|
return td;
|
|
109
100
|
};
|
|
110
|
-
|
|
111
101
|
var headerCell = function headerCell(str) {
|
|
112
102
|
var td = dom.createElement('th');
|
|
113
103
|
td.textContent = str;
|
|
114
104
|
td.setAttribute('style', 'text-align: right; ');
|
|
115
105
|
return td;
|
|
116
106
|
};
|
|
117
|
-
|
|
118
107
|
var oderByDate = function oderByDate(x, y) {
|
|
119
108
|
var dx = kb.any(x, ns.qu('date'));
|
|
120
109
|
var dy = kb.any(y, ns.qu('date'));
|
|
121
|
-
|
|
122
110
|
if (dx !== undefined && dy !== undefined) {
|
|
123
111
|
if (dx.value < dy.value) return -1;
|
|
124
112
|
if (dx.value > dy.value) return 1;
|
|
125
113
|
}
|
|
126
|
-
|
|
127
114
|
if (x.uri < y.uri) return -1; // Arbitrary but repeatable
|
|
128
|
-
|
|
129
115
|
if (x.uri > y.uri) return 1;
|
|
130
116
|
return 0;
|
|
131
117
|
};
|
|
132
|
-
|
|
133
118
|
var insertedPane = function insertedPane(context, subject, paneName) {
|
|
134
119
|
var p = context.session.paneRegistry.byName(paneName);
|
|
135
120
|
var d = p.render(subject, context);
|
|
136
121
|
d.setAttribute('style', 'border: 0.1em solid green;');
|
|
137
122
|
return d;
|
|
138
123
|
};
|
|
139
|
-
|
|
140
124
|
var expandAfterRow = function expandAfterRow(dom, row, subject, paneName, solo) {
|
|
141
125
|
var siblings = row.parentNode.children;
|
|
142
|
-
|
|
143
126
|
if (solo) {
|
|
144
127
|
for (var j = siblings.length - 1; j >= 0; j--) {
|
|
145
128
|
if (siblings[j].expanded) {
|
|
@@ -148,23 +131,19 @@ module.exports = {
|
|
|
148
131
|
}
|
|
149
132
|
}
|
|
150
133
|
}
|
|
151
|
-
|
|
152
134
|
var tr = dom.createElement('tr');
|
|
153
135
|
var td = tr.appendChild(dom.createElement('td'));
|
|
154
136
|
td.setAttribute('style', 'width: 98%; padding: 1em; border: 0.1em solid grey;');
|
|
155
137
|
var cols = row.children.length;
|
|
156
|
-
|
|
157
138
|
if (row.nextSibling) {
|
|
158
139
|
row.parentNode.insertBefore(tr, row.nextSibling);
|
|
159
140
|
} else {
|
|
160
141
|
row.parentNode.appendChild(tr);
|
|
161
142
|
}
|
|
162
|
-
|
|
163
143
|
row.expanded = tr;
|
|
164
144
|
td.setAttribute('colspan', '' + cols);
|
|
165
145
|
td.appendChild(insertedPane(context, subject, paneName));
|
|
166
146
|
};
|
|
167
|
-
|
|
168
147
|
var expandAfterRowOrCollapse = function expandAfterRowOrCollapse(dom, row, subject, paneName, solo) {
|
|
169
148
|
if (row.expanded) {
|
|
170
149
|
row.parentNode.removeChild(row.expanded);
|
|
@@ -173,29 +152,22 @@ module.exports = {
|
|
|
173
152
|
expandAfterRow(dom, row, subject, paneName, solo);
|
|
174
153
|
}
|
|
175
154
|
};
|
|
176
|
-
|
|
177
155
|
var transactionTable = function transactionTable(dom, list, filter) {
|
|
178
156
|
var table = dom.createElement('table');
|
|
179
157
|
table.setAttribute('style', 'padding-left: 0.5em; padding-right: 0.5em; font-size: 9pt; width: 85%;');
|
|
180
|
-
|
|
181
158
|
var transactionRow = function transactionRow(dom, x) {
|
|
182
159
|
var tr = dom.createElement('tr');
|
|
183
|
-
|
|
184
160
|
var setTRStyle = function setTRStyle(tr, account) {
|
|
185
161
|
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
|
|
186
162
|
var mystyle = "'padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.1em;";
|
|
187
|
-
|
|
188
163
|
if (account) {
|
|
189
164
|
var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
|
|
190
|
-
|
|
191
165
|
if (backgroundColor) {
|
|
192
166
|
mystyle += 'background-color: ' + backgroundColor.value + '; ';
|
|
193
167
|
}
|
|
194
168
|
}
|
|
195
|
-
|
|
196
169
|
tr.setAttribute('style', mystyle);
|
|
197
170
|
};
|
|
198
|
-
|
|
199
171
|
var account = kb.any(x, ns.qu('toAccount'));
|
|
200
172
|
setTRStyle(tr, account);
|
|
201
173
|
var c0 = tr.appendChild(dom.createElement('td'));
|
|
@@ -213,55 +185,45 @@ module.exports = {
|
|
|
213
185
|
var amount = kb.any(x, ns.qu('in_USD'));
|
|
214
186
|
c3.textContent = amount ? d2(amount.value) : '???';
|
|
215
187
|
c3.setAttribute('style', 'width: 6em; text-align: right; '); // @@ decimal alignment?
|
|
216
|
-
|
|
217
188
|
tr.addEventListener('click', function (e) {
|
|
218
189
|
// solo unless shift key
|
|
219
190
|
expandAfterRowOrCollapse(dom, tr, x, 'transaction', !e.shiftKey);
|
|
220
191
|
}, false);
|
|
221
192
|
return tr;
|
|
222
193
|
};
|
|
223
|
-
|
|
224
194
|
var list2 = filter ? list.filter(filter) : list.slice(); // don't sort a paramater passed in place
|
|
225
|
-
|
|
226
195
|
list2.sort(oderByDate);
|
|
227
|
-
|
|
228
196
|
for (var i = 0; i < list2.length; i++) {
|
|
229
197
|
table.appendChild(transactionRow(dom, list2[i]));
|
|
230
198
|
}
|
|
231
|
-
|
|
232
199
|
return table;
|
|
233
|
-
};
|
|
234
|
-
// This works only if enough metadata about the properties can drive the RDFS
|
|
235
|
-
// (or actual type statements whichtypically are NOT there on)
|
|
200
|
+
};
|
|
236
201
|
|
|
202
|
+
// Render a single transaction
|
|
237
203
|
|
|
204
|
+
// This works only if enough metadata about the properties can drive the RDFS
|
|
205
|
+
// (or actual type statements whichtypically are NOT there on)
|
|
238
206
|
if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction'] || kb.any(subject, ns.qu('toAccount'))) {
|
|
239
207
|
// var trip = kb.any(subject, WF('trip'))
|
|
240
208
|
donePredicate(ns.rdf('type'));
|
|
241
209
|
var account = kb.any(subject, UI.ns.qu('toAccount'));
|
|
242
210
|
setPaneStyle(account);
|
|
243
|
-
|
|
244
211
|
if (!account) {
|
|
245
212
|
complain('(Error: There is no bank account known for this transaction <' + subject.uri + '>,\n -- every transaction needs one.)');
|
|
246
213
|
}
|
|
247
|
-
|
|
248
214
|
var store = null;
|
|
249
215
|
var statement = kb.any(subject, UI.ns.qu('accordingTo'));
|
|
250
|
-
|
|
251
216
|
if (statement === undefined) {
|
|
252
217
|
complain('(Error: There is no back link to the original data source foir this transaction <' + subject.uri + ">,\nso I can't tell how to annotate it.)");
|
|
253
218
|
} else {
|
|
254
219
|
store = statement !== undefined ? kb.any(statement, UI.ns.qu('annotationStore')) : null;
|
|
255
|
-
|
|
256
220
|
if (store === undefined) {
|
|
257
221
|
complain('(There is no annotation document for this statement\n<' + statement.uri + '>,\nso you cannot classify this transaction.)');
|
|
258
222
|
}
|
|
259
223
|
}
|
|
260
|
-
|
|
261
224
|
var nav = dom.createElement('div');
|
|
262
225
|
nav.setAttribute('style', 'float:right');
|
|
263
226
|
div.appendChild(nav);
|
|
264
|
-
|
|
265
227
|
var navLink = function navLink(pred, label) {
|
|
266
228
|
donePredicate(pred);
|
|
267
229
|
var obj = kb.any(subject, pred);
|
|
@@ -272,11 +234,11 @@ module.exports = {
|
|
|
272
234
|
nav.appendChild(a).textContent = label || UI.utils.label(obj);
|
|
273
235
|
nav.appendChild(dom.createElement('br'));
|
|
274
236
|
};
|
|
275
|
-
|
|
276
237
|
navLink(UI.ns.qu('toAccount'));
|
|
277
238
|
navLink(UI.ns.qu('accordingTo'), 'Statement');
|
|
278
|
-
navLink(TRIP('trip'));
|
|
239
|
+
navLink(TRIP('trip'));
|
|
279
240
|
|
|
241
|
+
// Basic data:
|
|
280
242
|
var table = dom.createElement('table');
|
|
281
243
|
div.appendChild(table);
|
|
282
244
|
var preds = ['date', 'payee', 'amount', 'in_USD', 'currency'].map(Q);
|
|
@@ -287,24 +249,23 @@ module.exports = {
|
|
|
287
249
|
return '<tr><td style="text-align: right; padding-right: 0.6em">' + UI.utils.labelForXML(p) + '</td><td style="font-weight: bold;">' + s + '</td></tr>';
|
|
288
250
|
}).join('\n');
|
|
289
251
|
table.innerHTML = inner;
|
|
290
|
-
|
|
291
252
|
var complainIfBad = function complainIfBad(ok, body) {
|
|
292
|
-
if (ok) {
|
|
253
|
+
if (ok) {
|
|
254
|
+
// setModifiedDate(store, kb, store)
|
|
293
255
|
// rerender(div) // deletes the new trip form
|
|
294
256
|
} else complain('Sorry, failed to save your change:\n' + body);
|
|
295
|
-
};
|
|
296
|
-
// Classify:
|
|
257
|
+
};
|
|
297
258
|
|
|
259
|
+
// What trips do we know about?
|
|
298
260
|
|
|
261
|
+
// Classify:
|
|
299
262
|
if (store) {
|
|
300
263
|
kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {
|
|
301
264
|
if (!ok) complain('Cannot load store ' + store + ' ' + body);
|
|
302
265
|
var calendarYear = kb.any(store, ns.qu('calendarYear'));
|
|
303
|
-
|
|
304
266
|
var renderCatgorySelectors = function renderCatgorySelectors() {
|
|
305
267
|
div.insertBefore(UI.widgets.makeSelectForNestedCategory(dom, kb, subject, UI.ns.qu('Classified'), store, complainIfBad), table.nextSibling);
|
|
306
268
|
};
|
|
307
|
-
|
|
308
269
|
if (kb.any(undefined, ns.rdfs('subClassOf'), ns.qu.Classified)) {
|
|
309
270
|
renderCatgorySelectors();
|
|
310
271
|
} else if (calendarYear) {
|
|
@@ -320,12 +281,10 @@ module.exports = {
|
|
|
320
281
|
} else {
|
|
321
282
|
console.log("Can't get categories, because no calendarYear");
|
|
322
283
|
}
|
|
323
|
-
|
|
324
284
|
div.appendChild(UI.widgets.makeDescription(dom, kb, subject, UI.ns.rdfs('comment'), store, complainIfBad));
|
|
325
285
|
var trips = kb.statementsMatching(undefined, TRIP('trip'), undefined, store).map(function (st) {
|
|
326
286
|
return st.object;
|
|
327
287
|
}); // @@ Use rdfs
|
|
328
|
-
|
|
329
288
|
var trips2 = kb.each(undefined, UI.ns.rdf('type'), TRIP('Trip'));
|
|
330
289
|
trips = trips.concat(trips2).sort(); // @@ Unique
|
|
331
290
|
|
|
@@ -341,7 +300,6 @@ module.exports = {
|
|
|
341
300
|
return pair[1];
|
|
342
301
|
});
|
|
343
302
|
};
|
|
344
|
-
|
|
345
303
|
trips = sortedBy(kb, trips, UI.ns.cal('dtstart'), true); // Reverse chron
|
|
346
304
|
|
|
347
305
|
if (trips.length > 1) {
|
|
@@ -357,8 +315,9 @@ module.exports = {
|
|
|
357
315
|
}
|
|
358
316
|
}, store, complainIfBad));
|
|
359
317
|
}
|
|
318
|
+
div.appendChild(dom.createElement('br'));
|
|
360
319
|
|
|
361
|
-
|
|
320
|
+
// Add in simple comments about the transaction
|
|
362
321
|
|
|
363
322
|
var outliner = context.getOutliner(dom);
|
|
364
323
|
donePredicate(ns.rdfs('comment')); // Done above
|
|
@@ -366,8 +325,8 @@ module.exports = {
|
|
|
366
325
|
UI.widgets.attachmentList(dom, subject, div);
|
|
367
326
|
donePredicate(ns.wf('attachment'));
|
|
368
327
|
div.appendChild(dom.createElement('tr')).setAttribute('style', 'height: 1em'); // spacer
|
|
369
|
-
// Remaining properties
|
|
370
328
|
|
|
329
|
+
// Remaining properties
|
|
371
330
|
outliner.appendPropertyTRs(div, plist, false, function (pred, _inverse) {
|
|
372
331
|
return !(pred.uri in predicateURIsDone);
|
|
373
332
|
});
|
|
@@ -375,12 +334,13 @@ module.exports = {
|
|
|
375
334
|
return !(pred.uri in predicateURIsDone);
|
|
376
335
|
});
|
|
377
336
|
}); // fetch
|
|
378
|
-
}
|
|
337
|
+
}
|
|
338
|
+
// end of render tranasaction instance
|
|
339
|
+
|
|
379
340
|
// ////////////////////////////////////////////////////////////////////
|
|
380
341
|
//
|
|
381
342
|
// Render the transactions in a Trip
|
|
382
343
|
//
|
|
383
|
-
|
|
384
344
|
} else if (t['http://www.w3.org/ns/pim/trip#Trip']) {
|
|
385
345
|
/*
|
|
386
346
|
var query = new $rdf.Query(UI.utils.label(subject))
|
|
@@ -415,25 +375,19 @@ module.exports = {
|
|
|
415
375
|
var year = date ? ('' + date.value).slice(0, 4) : '????';
|
|
416
376
|
var ty = kb.the(t, ns.rdf('type')); // @@ find most specific type
|
|
417
377
|
// complain(" -- one trans: "+t.uri + ' -> '+kb.any(t, UI.ns.qu('in_USD')))
|
|
418
|
-
|
|
419
378
|
if (!ty) ty = UI.ns.qu('ErrorNoType');
|
|
420
|
-
|
|
421
379
|
if (ty && ty.uri) {
|
|
422
380
|
var tyuri = ty.uri;
|
|
423
381
|
if (!yearTotal[year]) yearTotal[year] = 0.0;
|
|
424
382
|
if (!yearCategoryTotal[year]) yearCategoryTotal[year] = {};
|
|
425
383
|
if (!total[tyuri]) total[tyuri] = 0.0;
|
|
426
|
-
|
|
427
384
|
if (!yearCategoryTotal[year][tyuri]) {
|
|
428
385
|
yearCategoryTotal[year][tyuri] = 0.0;
|
|
429
386
|
}
|
|
430
|
-
|
|
431
387
|
var lit = kb.any(t, UI.ns.qu('in_USD'));
|
|
432
|
-
|
|
433
388
|
if (!lit) {
|
|
434
389
|
complain('@@ No amount in USD: ' + lit + ' for ' + t);
|
|
435
390
|
}
|
|
436
|
-
|
|
437
391
|
if (lit) {
|
|
438
392
|
var amount = parseFloat(lit.value);
|
|
439
393
|
total[tyuri] += amount;
|
|
@@ -446,7 +400,6 @@ module.exports = {
|
|
|
446
400
|
var grandTotal = 0.0;
|
|
447
401
|
var years = [];
|
|
448
402
|
var i;
|
|
449
|
-
|
|
450
403
|
for (var y in yearCategoryTotal) {
|
|
451
404
|
// @@ TODO: Write away the need for exception on next line
|
|
452
405
|
// eslint-disable-next-line no-prototype-builtins
|
|
@@ -454,24 +407,19 @@ module.exports = {
|
|
|
454
407
|
years.push(y);
|
|
455
408
|
}
|
|
456
409
|
}
|
|
457
|
-
|
|
458
410
|
years.sort();
|
|
459
411
|
var ny = years.length;
|
|
460
412
|
var cell;
|
|
461
413
|
var table = div.appendChild(dom.createElement('table'));
|
|
462
414
|
table.setAttribute('style', 'font-size: 120%; margin-left:auto; margin-right:1em; margin-top: 1em; border: 0.05em solid gray; padding: 1em;');
|
|
463
|
-
|
|
464
415
|
if (ny > 1) {
|
|
465
416
|
var header = table.appendChild(dom.createElement('tr'));
|
|
466
417
|
header.appendChild(headerCell(''));
|
|
467
|
-
|
|
468
418
|
for (i = 0; i < ny; i++) {
|
|
469
419
|
header.appendChild(headerCell(years[i]));
|
|
470
420
|
}
|
|
471
|
-
|
|
472
421
|
header.appendChild(headerCell('total'));
|
|
473
422
|
}
|
|
474
|
-
|
|
475
423
|
for (var uri in total) {
|
|
476
424
|
// @@ TODO: Write away the need for exception on next line
|
|
477
425
|
// eslint-disable-next-line no-prototype-builtins
|
|
@@ -480,42 +428,35 @@ module.exports = {
|
|
|
480
428
|
grandTotal += total[uri];
|
|
481
429
|
}
|
|
482
430
|
}
|
|
483
|
-
|
|
484
431
|
types.sort();
|
|
485
432
|
var row, label, z;
|
|
486
|
-
|
|
487
433
|
for (var j = 0; j < types.length; j++) {
|
|
488
434
|
var cat = kb.sym(types[j]);
|
|
489
435
|
row = table.appendChild(dom.createElement('tr'));
|
|
490
436
|
label = row.appendChild(dom.createElement('td'));
|
|
491
437
|
label.textContent = UI.utils.label(cat);
|
|
492
|
-
|
|
493
438
|
if (ny > 1) {
|
|
494
439
|
for (i = 0; i < ny; i++) {
|
|
495
440
|
z = yearCategoryTotal[years[i]][types[j]];
|
|
496
441
|
cell = row.appendChild(numericCell(z, true));
|
|
497
442
|
}
|
|
498
443
|
}
|
|
499
|
-
|
|
500
444
|
row.appendChild(numericCell(total[types[j]], true));
|
|
501
|
-
}
|
|
502
|
-
|
|
445
|
+
}
|
|
503
446
|
|
|
447
|
+
// Trailing totals
|
|
504
448
|
if (types.length > 1) {
|
|
505
449
|
row = table.appendChild(dom.createElement('tr'));
|
|
506
450
|
row.appendChild(headerCell('total'));
|
|
507
|
-
|
|
508
451
|
if (ny > 1) {
|
|
509
452
|
for (i = 0; i < ny; i++) {
|
|
510
453
|
z = yearTotal[years[i]];
|
|
511
454
|
cell = row.appendChild(numericCell(z ? d2(z) : ''));
|
|
512
455
|
}
|
|
513
456
|
}
|
|
514
|
-
|
|
515
457
|
cell = row.appendChild(numericCell(grandTotal));
|
|
516
458
|
cell.setAttribute('style', 'font-weight: bold; text-align: right;');
|
|
517
459
|
}
|
|
518
|
-
|
|
519
460
|
var tab = transactionTable(dom, trans);
|
|
520
461
|
tab.setAttribute('style', 'margin-left:auto; margin-right:1em; margin-top: 1em; border: padding: 1em;');
|
|
521
462
|
div.appendChild(tab);
|
|
@@ -524,12 +465,12 @@ module.exports = {
|
|
|
524
465
|
complain('Error loading transactions: ' + e);
|
|
525
466
|
});
|
|
526
467
|
};
|
|
527
|
-
|
|
528
468
|
calculations();
|
|
529
469
|
} // if
|
|
530
470
|
|
|
531
|
-
|
|
532
471
|
return div;
|
|
533
472
|
}
|
|
534
|
-
};
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// ends
|
|
535
476
|
//# sourceMappingURL=pane.js.map
|