solid-ui 2.4.27-c6bf02ea → 2.4.27-cb30461a
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 +6 -1
- package/dist/805.solid-ui.min.js +1 -1
- package/dist/805.solid-ui.min.js.map +1 -1
- package/dist/solid-ui.js +5877 -2920
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.LICENSE.txt +4 -0
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1955 -1955
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
- package/lib/chat/bookmarks.js +7 -6
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +103 -248
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +126 -129
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +423 -633
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.d.ts +13 -0
- package/lib/chat/keys.d.ts.map +1 -0
- package/lib/chat/keys.js +233 -0
- package/lib/chat/keys.js.map +1 -0
- package/lib/chat/message.js +193 -289
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +277 -463
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/signature.d.ts +25 -0
- package/lib/chat/signature.d.ts.map +1 -0
- package/lib/chat/signature.js +113 -0
- package/lib/chat/signature.js.map +1 -0
- package/lib/chat/thread.js +144 -166
- package/lib/chat/thread.js.map +1 -1
- package/lib/header/index.js +0 -5
- package/lib/header/index.js.map +1 -1
- package/lib/log.js +5 -5
- package/lib/log.js.map +1 -1
- package/lib/login/login.js +1 -24
- package/lib/login/login.js.map +1 -1
- package/lib/pad.js +1 -4
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +1 -2
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +0 -4
- package/lib/preferences.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +0 -2
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts +10 -0
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -0
- package/lib/utils/keyHelpers/accessData.js +235 -0
- package/lib/utils/keyHelpers/accessData.js.map +1 -0
- package/lib/utils/keyHelpers/acl.d.ts +20 -0
- package/lib/utils/keyHelpers/acl.d.ts.map +1 -0
- package/lib/utils/keyHelpers/acl.js +93 -0
- package/lib/utils/keyHelpers/acl.js.map +1 -0
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons.js +2 -0
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +1 -8
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +3 -8
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +0 -5
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms.js +1 -4
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/peoplePicker.js +0 -11
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/package.json +5 -3
package/lib/chat/infinite.js
CHANGED
|
@@ -20,17 +20,19 @@ var _chatLogic = require("./chatLogic");
|
|
|
20
20
|
var _message = require("./message");
|
|
21
21
|
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); }
|
|
22
22
|
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; }
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*/ // import { findBookmarkDocument } from './bookmarks'
|
|
23
|
+
/**
|
|
24
|
+
* Contains the [[infiniteMessageArea]] class
|
|
25
|
+
* @packageDocumentation
|
|
26
|
+
*/
|
|
27
|
+
// import { findBookmarkDocument } from './bookmarks'
|
|
29
28
|
// pull in first avoid cross-refs
|
|
29
|
+
|
|
30
30
|
// import * as style from '../style'
|
|
31
31
|
// import * as utils from '../utils'
|
|
32
|
+
|
|
32
33
|
// import * as pad from '../pad'
|
|
33
34
|
// import { DateFolder } from './dateFolder'
|
|
35
|
+
|
|
34
36
|
// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }
|
|
35
37
|
|
|
36
38
|
function desktopNotification(str) {
|
|
@@ -58,9 +60,34 @@ function desktopNotification(str) {
|
|
|
58
60
|
/**
|
|
59
61
|
* Renders a chat message inside a `messageTable`
|
|
60
62
|
*/
|
|
61
|
-
function insertMessageIntoTable(
|
|
62
|
-
|
|
63
|
+
function insertMessageIntoTable(channelObject, messageTable, message, fresh, options, userContext) {
|
|
64
|
+
var messageRow = (0, _message.renderMessageRow)(channelObject, message, fresh, options, userContext);
|
|
65
|
+
|
|
66
|
+
// const message = messageRow.AJAR_subject
|
|
67
|
+
if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {
|
|
68
|
+
messageRow.style.backgroundColor = 'yellow';
|
|
69
|
+
options.selectedElement = messageRow;
|
|
70
|
+
messageTable.selectedElement = messageRow;
|
|
71
|
+
}
|
|
72
|
+
var done = false;
|
|
73
|
+
for (var ele = messageTable.firstChild;; ele = ele.nextSibling) {
|
|
74
|
+
if (!ele) {
|
|
75
|
+
// empty
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
var newestFirst = options.newestfirst === true;
|
|
79
|
+
var dateString = messageRow.AJAR_date;
|
|
80
|
+
if (dateString > ele.AJAR_date && newestFirst || dateString < ele.AJAR_date && !newestFirst) {
|
|
81
|
+
messageTable.insertBefore(messageRow, ele);
|
|
82
|
+
done = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!done) {
|
|
87
|
+
messageTable.appendChild(messageRow);
|
|
88
|
+
}
|
|
63
89
|
}
|
|
90
|
+
|
|
64
91
|
/**
|
|
65
92
|
* Common code for a chat (discussion area of messages about something)
|
|
66
93
|
* This version runs over a series of files for different time periods
|
|
@@ -83,70 +110,20 @@ function insertMessageIntoTable(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
|
83
110
|
- inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.
|
|
84
111
|
|
|
85
112
|
*/
|
|
86
|
-
function
|
|
87
|
-
_insertMessageIntoTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(channelObject, messageTable, message, fresh, options, userContext) {
|
|
88
|
-
var messageRow, done, ele, newestFirst, dateString;
|
|
89
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
90
|
-
while (1) switch (_context.prev = _context.next) {
|
|
91
|
-
case 0:
|
|
92
|
-
_context.next = 2;
|
|
93
|
-
return (0, _message.renderMessageRow)(channelObject, message, fresh, options, userContext);
|
|
94
|
-
case 2:
|
|
95
|
-
messageRow = _context.sent;
|
|
96
|
-
// const message = messageRow.AJAR_subject
|
|
97
|
-
if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {
|
|
98
|
-
messageRow.style.backgroundColor = 'yellow';
|
|
99
|
-
options.selectedElement = messageRow;
|
|
100
|
-
messageTable.selectedElement = messageRow;
|
|
101
|
-
}
|
|
102
|
-
done = false;
|
|
103
|
-
ele = messageTable.firstChild;
|
|
104
|
-
case 6:
|
|
105
|
-
if (ele) {
|
|
106
|
-
_context.next = 8;
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
return _context.abrupt("break", 17);
|
|
110
|
-
case 8:
|
|
111
|
-
newestFirst = options.newestfirst === true;
|
|
112
|
-
dateString = messageRow.AJAR_date;
|
|
113
|
-
if (!(dateString > ele.AJAR_date && newestFirst || dateString < ele.AJAR_date && !newestFirst)) {
|
|
114
|
-
_context.next = 14;
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
messageTable.insertBefore(messageRow, ele);
|
|
118
|
-
done = true;
|
|
119
|
-
return _context.abrupt("break", 17);
|
|
120
|
-
case 14:
|
|
121
|
-
ele = ele.nextSibling;
|
|
122
|
-
_context.next = 6;
|
|
123
|
-
break;
|
|
124
|
-
case 17:
|
|
125
|
-
if (!done) {
|
|
126
|
-
messageTable.appendChild(messageRow);
|
|
127
|
-
}
|
|
128
|
-
case 18:
|
|
129
|
-
case "end":
|
|
130
|
-
return _context.stop();
|
|
131
|
-
}
|
|
132
|
-
}, _callee);
|
|
133
|
-
}));
|
|
134
|
-
return _insertMessageIntoTable.apply(this, arguments);
|
|
135
|
-
}
|
|
136
|
-
function infiniteMessageArea(_x7, _x8, _x9, _x10) {
|
|
113
|
+
function infiniteMessageArea(_x, _x2, _x3, _x4) {
|
|
137
114
|
return _infiniteMessageArea.apply(this, arguments);
|
|
138
115
|
}
|
|
139
116
|
function _infiniteMessageArea() {
|
|
140
|
-
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
141
|
-
var syncMessages,
|
|
142
|
-
return _regenerator["default"].wrap(function
|
|
143
|
-
while (1) switch (
|
|
117
|
+
_infiniteMessageArea = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(dom, wasStore, chatChannel, options) {
|
|
118
|
+
var syncMessages, addMessage, insertPreviousMessages, _insertPreviousMessages, removePreviousMessages, createMessageTable, _createMessageTable, renderMessageTable, addNewChatDocumentIfNewDay, _addNewChatDocumentIfNewDay, appendCurrentMessages, _appendCurrentMessages, loadMoreWhereNeeded, _loadMoreWhereNeeded, loadInitialContent, _loadInitialContent, newestFirst, channelObject, dateFolder, div, statusArea, userContext, liveMessageTable, earliest, latest, lock;
|
|
119
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
120
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
144
121
|
case 0:
|
|
145
122
|
_loadInitialContent = function _loadInitialContent3() {
|
|
146
|
-
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
147
|
-
var yank, fixScroll, live, selectedDocument,
|
|
148
|
-
return _regenerator["default"].wrap(function
|
|
149
|
-
while (1) switch (
|
|
123
|
+
_loadInitialContent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
124
|
+
var yank, fixScroll, live, selectedDocument, now, todayDocument, selectedMessageTable, selectedDate;
|
|
125
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
126
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
150
127
|
case 0:
|
|
151
128
|
fixScroll = function _fixScroll() {
|
|
152
129
|
if (options.selectedElement) {
|
|
@@ -160,59 +137,51 @@ function _infiniteMessageArea() {
|
|
|
160
137
|
}
|
|
161
138
|
};
|
|
162
139
|
yank = function _yank() {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
}; // During initial load ONLY keep scroll to selected thing or bottom
|
|
140
|
+
selectedMessageTable.selectedElement.scrollIntoView({
|
|
141
|
+
block: 'center'
|
|
142
|
+
});
|
|
143
|
+
};
|
|
169
144
|
if (options.selectedMessage) {
|
|
170
145
|
selectedDocument = options.selectedMessage.doc();
|
|
171
|
-
}
|
|
172
|
-
if (threadRootMessage) {
|
|
173
|
-
threadRootDocument = threadRootMessage.doc();
|
|
174
|
-
}
|
|
175
|
-
initialDocment = selectedDocument || threadRootDocument;
|
|
176
|
-
if (initialDocment) {
|
|
177
146
|
now = new Date();
|
|
178
147
|
todayDocument = dateFolder.leafDocumentFromDate(now);
|
|
179
|
-
live = todayDocument.sameTerm(
|
|
148
|
+
live = todayDocument.sameTerm(selectedDocument);
|
|
180
149
|
}
|
|
181
|
-
if (!(
|
|
182
|
-
|
|
150
|
+
if (!(options.selectedMessage && !live)) {
|
|
151
|
+
_context11.next = 15;
|
|
183
152
|
break;
|
|
184
153
|
}
|
|
185
|
-
selectedDate = dateFolder.dateFromLeafDocument(
|
|
186
|
-
|
|
154
|
+
selectedDate = dateFolder.dateFromLeafDocument(selectedDocument);
|
|
155
|
+
_context11.next = 7;
|
|
187
156
|
return createMessageTable(selectedDate, live);
|
|
188
|
-
case
|
|
189
|
-
selectedMessageTable =
|
|
157
|
+
case 7:
|
|
158
|
+
selectedMessageTable = _context11.sent;
|
|
190
159
|
div.appendChild(selectedMessageTable);
|
|
191
160
|
earliest.messageTable = selectedMessageTable;
|
|
192
161
|
latest.messageTable = selectedMessageTable;
|
|
193
162
|
yank();
|
|
194
163
|
setTimeout(yank, 1000); // @@ kludge - restore position distubed by other cHANGES
|
|
195
|
-
|
|
164
|
+
_context11.next = 19;
|
|
196
165
|
break;
|
|
197
|
-
case
|
|
198
|
-
|
|
166
|
+
case 15:
|
|
167
|
+
_context11.next = 17;
|
|
199
168
|
return appendCurrentMessages();
|
|
200
|
-
case
|
|
169
|
+
case 17:
|
|
201
170
|
earliest.messageTable = liveMessageTable;
|
|
202
171
|
latest.messageTable = liveMessageTable;
|
|
203
|
-
case
|
|
204
|
-
|
|
172
|
+
case 19:
|
|
173
|
+
_context11.next = 21;
|
|
205
174
|
return loadMoreWhereNeeded(null, fixScroll);
|
|
206
|
-
case
|
|
175
|
+
case 21:
|
|
207
176
|
div.addEventListener('scroll', loadMoreWhereNeeded);
|
|
208
177
|
if (options.solo) {
|
|
209
178
|
document.body.addEventListener('scroll', loadMoreWhereNeeded);
|
|
210
179
|
}
|
|
211
|
-
case
|
|
180
|
+
case 23:
|
|
212
181
|
case "end":
|
|
213
|
-
return
|
|
182
|
+
return _context11.stop();
|
|
214
183
|
}
|
|
215
|
-
},
|
|
184
|
+
}, _callee11);
|
|
216
185
|
}));
|
|
217
186
|
return _loadInitialContent.apply(this, arguments);
|
|
218
187
|
};
|
|
@@ -220,16 +189,16 @@ function _infiniteMessageArea() {
|
|
|
220
189
|
return _loadInitialContent.apply(this, arguments);
|
|
221
190
|
};
|
|
222
191
|
_loadMoreWhereNeeded = function _loadMoreWhereNeeded3() {
|
|
223
|
-
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
192
|
+
_loadMoreWhereNeeded = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(event, fixScroll) {
|
|
224
193
|
var freeze, magicZone, done, scrollBottom, scrollTop;
|
|
225
|
-
return _regenerator["default"].wrap(function
|
|
226
|
-
while (1) switch (
|
|
194
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
195
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
227
196
|
case 0:
|
|
228
197
|
if (!lock) {
|
|
229
|
-
|
|
198
|
+
_context10.next = 2;
|
|
230
199
|
break;
|
|
231
200
|
}
|
|
232
|
-
return
|
|
201
|
+
return _context10.abrupt("return");
|
|
233
202
|
case 2:
|
|
234
203
|
lock = true;
|
|
235
204
|
freeze = !fixScroll;
|
|
@@ -237,36 +206,36 @@ function _infiniteMessageArea() {
|
|
|
237
206
|
// const bottom = div.scrollHeight - top - div.clientHeight
|
|
238
207
|
case 5:
|
|
239
208
|
if (!(div.scrollTop < magicZone && earliest.messageTable && !earliest.messageTable.initial && earliest.messageTable.extendBackwards)) {
|
|
240
|
-
|
|
209
|
+
_context10.next = 21;
|
|
241
210
|
break;
|
|
242
211
|
}
|
|
243
212
|
if (!(div.scrollHeight === 0)) {
|
|
244
|
-
|
|
213
|
+
_context10.next = 10;
|
|
245
214
|
break;
|
|
246
215
|
}
|
|
247
|
-
//
|
|
216
|
+
// console.log(' chat/loadMoreWhereNeeded: trying later...')
|
|
248
217
|
setTimeout(loadMoreWhereNeeded, 2000); // couple be less
|
|
249
218
|
lock = false;
|
|
250
|
-
return
|
|
219
|
+
return _context10.abrupt("return");
|
|
251
220
|
case 10:
|
|
252
|
-
//
|
|
221
|
+
// console.log(' chat/loadMoreWhereNeeded: Going now')
|
|
253
222
|
scrollBottom = div.scrollHeight - div.scrollTop;
|
|
254
223
|
debug.log('infinite scroll: adding above: top ' + div.scrollTop);
|
|
255
|
-
|
|
224
|
+
_context10.next = 14;
|
|
256
225
|
return earliest.messageTable.extendBackwards();
|
|
257
226
|
case 14:
|
|
258
|
-
done =
|
|
227
|
+
done = _context10.sent;
|
|
259
228
|
if (freeze) {
|
|
260
229
|
div.scrollTop = div.scrollHeight - scrollBottom;
|
|
261
230
|
}
|
|
262
231
|
if (fixScroll) fixScroll();
|
|
263
232
|
if (!done) {
|
|
264
|
-
|
|
233
|
+
_context10.next = 19;
|
|
265
234
|
break;
|
|
266
235
|
}
|
|
267
|
-
return
|
|
236
|
+
return _context10.abrupt("break", 21);
|
|
268
237
|
case 19:
|
|
269
|
-
|
|
238
|
+
_context10.next = 5;
|
|
270
239
|
break;
|
|
271
240
|
case 21:
|
|
272
241
|
if (!(options.selectedMessage &&
|
|
@@ -276,15 +245,15 @@ function _infiniteMessageArea() {
|
|
|
276
245
|
latest.messageTable && !latest.messageTable["final"] &&
|
|
277
246
|
// there is more data to come
|
|
278
247
|
latest.messageTable.extendForwards)) {
|
|
279
|
-
|
|
248
|
+
_context10.next = 33;
|
|
280
249
|
break;
|
|
281
250
|
}
|
|
282
251
|
scrollTop = div.scrollTop;
|
|
283
252
|
debug.log('infinite scroll: adding below: bottom: ' + (div.scrollHeight - div.scrollTop - div.clientHeight));
|
|
284
|
-
|
|
253
|
+
_context10.next = 26;
|
|
285
254
|
return latest.messageTable.extendForwards();
|
|
286
255
|
case 26:
|
|
287
|
-
done =
|
|
256
|
+
done = _context10.sent;
|
|
288
257
|
// then add more data on the bottom
|
|
289
258
|
if (freeze) {
|
|
290
259
|
div.scrollTop = scrollTop; // while adding below keep same things in view
|
|
@@ -292,66 +261,63 @@ function _infiniteMessageArea() {
|
|
|
292
261
|
|
|
293
262
|
if (fixScroll) fixScroll();
|
|
294
263
|
if (!done) {
|
|
295
|
-
|
|
264
|
+
_context10.next = 31;
|
|
296
265
|
break;
|
|
297
266
|
}
|
|
298
|
-
return
|
|
267
|
+
return _context10.abrupt("break", 33);
|
|
299
268
|
case 31:
|
|
300
|
-
|
|
269
|
+
_context10.next = 21;
|
|
301
270
|
break;
|
|
302
271
|
case 33:
|
|
303
272
|
lock = false;
|
|
304
273
|
case 34:
|
|
305
274
|
case "end":
|
|
306
|
-
return
|
|
275
|
+
return _context10.stop();
|
|
307
276
|
}
|
|
308
|
-
},
|
|
277
|
+
}, _callee10);
|
|
309
278
|
}));
|
|
310
279
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
311
280
|
};
|
|
312
|
-
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(
|
|
281
|
+
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(_x10, _x11) {
|
|
313
282
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
314
283
|
};
|
|
315
284
|
_appendCurrentMessages = function _appendCurrentMessage2() {
|
|
316
|
-
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
285
|
+
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
317
286
|
var now, chatDocument, messageTable;
|
|
318
|
-
return _regenerator["default"].wrap(function
|
|
319
|
-
while (1) switch (
|
|
287
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
288
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
320
289
|
case 0:
|
|
321
290
|
now = new Date();
|
|
322
291
|
chatDocument = dateFolder.leafDocumentFromDate(now); /// ///////////////////////////////////////////////////////////
|
|
323
|
-
|
|
292
|
+
_context9.next = 4;
|
|
324
293
|
return createMessageTable(now, true);
|
|
325
294
|
case 4:
|
|
326
|
-
messageTable =
|
|
295
|
+
messageTable = _context9.sent;
|
|
327
296
|
div.appendChild(messageTable);
|
|
328
|
-
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
329
|
-
return _regenerator["default"].wrap(function
|
|
330
|
-
while (1) switch (
|
|
297
|
+
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
298
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
299
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
331
300
|
case 0:
|
|
332
|
-
|
|
301
|
+
_context8.next = 2;
|
|
333
302
|
return addNewChatDocumentIfNewDay(new Date());
|
|
334
303
|
case 2:
|
|
335
|
-
|
|
336
|
-
return syncMessages(chatChannel, messageTable);
|
|
337
|
-
case 4:
|
|
338
|
-
// @@ livemessagetable??
|
|
304
|
+
syncMessages(chatChannel, messageTable); // @@ livemessagetable??
|
|
339
305
|
desktopNotification(chatChannel);
|
|
340
|
-
case
|
|
306
|
+
case 4:
|
|
341
307
|
case "end":
|
|
342
|
-
return
|
|
308
|
+
return _context8.stop();
|
|
343
309
|
}
|
|
344
|
-
},
|
|
310
|
+
}, _callee8);
|
|
345
311
|
})); // The short chat version the live update listening is done in the pane but we do it in the widget @@
|
|
346
312
|
_solidLogic.store.updater.addDownstreamChangeListener(chatDocument, div.refresh); // Live update
|
|
347
313
|
liveMessageTable = messageTable;
|
|
348
314
|
latest.messageTable = liveMessageTable;
|
|
349
|
-
return
|
|
315
|
+
return _context9.abrupt("return", messageTable);
|
|
350
316
|
case 11:
|
|
351
317
|
case "end":
|
|
352
|
-
return
|
|
318
|
+
return _context9.stop();
|
|
353
319
|
}
|
|
354
|
-
},
|
|
320
|
+
}, _callee9);
|
|
355
321
|
}));
|
|
356
322
|
return _appendCurrentMessages.apply(this, arguments);
|
|
357
323
|
};
|
|
@@ -359,15 +325,15 @@ function _infiniteMessageArea() {
|
|
|
359
325
|
return _appendCurrentMessages.apply(this, arguments);
|
|
360
326
|
};
|
|
361
327
|
_addNewChatDocumentIfNewDay = function _addNewChatDocumentIf2() {
|
|
362
|
-
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
328
|
+
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
363
329
|
var newChatDocument, oldChatDocument, sts;
|
|
364
|
-
return _regenerator["default"].wrap(function
|
|
365
|
-
while (1) switch (
|
|
330
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
331
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
366
332
|
case 0:
|
|
367
333
|
// @@ Remove listener from previous table as it is now static
|
|
368
334
|
newChatDocument = dateFolder.leafDocumentFromDate(new Date());
|
|
369
335
|
if (newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
|
|
370
|
-
|
|
336
|
+
_context7.next = 7;
|
|
371
337
|
break;
|
|
372
338
|
}
|
|
373
339
|
// It is a new day
|
|
@@ -376,7 +342,7 @@ function _infiniteMessageArea() {
|
|
|
376
342
|
delete liveMessageTable.inputRow;
|
|
377
343
|
}
|
|
378
344
|
oldChatDocument = latest.messageTable.chatDocument;
|
|
379
|
-
|
|
345
|
+
_context7.next = 6;
|
|
380
346
|
return appendCurrentMessages();
|
|
381
347
|
case 6:
|
|
382
348
|
// Adding a link in the document will ping listeners to add the new block too
|
|
@@ -390,323 +356,286 @@ function _infiniteMessageArea() {
|
|
|
390
356
|
}
|
|
391
357
|
case 7:
|
|
392
358
|
case "end":
|
|
393
|
-
return
|
|
359
|
+
return _context7.stop();
|
|
394
360
|
}
|
|
395
|
-
},
|
|
361
|
+
}, _callee7);
|
|
396
362
|
}));
|
|
397
363
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
398
364
|
};
|
|
399
365
|
addNewChatDocumentIfNewDay = function _addNewChatDocumentIf() {
|
|
400
366
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
401
367
|
};
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
406
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
407
|
-
case 0:
|
|
408
|
-
_scrollForwardButtonHandler = function _scrollForwardButtonH2() {
|
|
409
|
-
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(_event) {
|
|
410
|
-
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
411
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
412
|
-
case 0:
|
|
413
|
-
if (!messageTable.extendedForwards) {
|
|
414
|
-
_context8.next = 6;
|
|
415
|
-
break;
|
|
416
|
-
}
|
|
417
|
-
removePreviousMessages(false, messageTable);
|
|
418
|
-
messageTable.extendedForwards = false;
|
|
419
|
-
setScrollForwardButtonIcon();
|
|
420
|
-
_context8.next = 9;
|
|
421
|
-
break;
|
|
422
|
-
case 6:
|
|
423
|
-
_context8.next = 8;
|
|
424
|
-
return extendForwards();
|
|
425
|
-
case 8:
|
|
426
|
-
// async
|
|
427
|
-
latest.messageTable.scrollIntoView(newestFirst);
|
|
428
|
-
case 9:
|
|
429
|
-
case "end":
|
|
430
|
-
return _context8.stop();
|
|
431
|
-
}
|
|
432
|
-
}, _callee8);
|
|
433
|
-
}));
|
|
434
|
-
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
435
|
-
};
|
|
436
|
-
scrollForwardButtonHandler = function _scrollForwardButtonH(_x22) {
|
|
437
|
-
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
438
|
-
};
|
|
439
|
-
setScrollForwardButtonIcon = function _setScrollForwardButt() {
|
|
440
|
-
if (!scrollForwardButton) return;
|
|
441
|
-
var sense = messageTable.extendedForwards ? !newestFirst : newestFirst; // noun_T-Block_1114657_000000.svg
|
|
442
|
-
var scrollForwardIcon = messageTable["final"] ? 'noun_T-Block_1114657_000000.svg' : getScrollForwardButtonIcon(sense);
|
|
443
|
-
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollForwardIcon);
|
|
444
|
-
function getScrollForwardButtonIcon(sense) {
|
|
445
|
-
return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
_extendForwards = function _extendForwards3() {
|
|
449
|
-
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
450
|
-
var done;
|
|
451
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
452
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
453
|
-
case 0:
|
|
454
|
-
_context7.next = 2;
|
|
455
|
-
return insertPreviousMessages(false);
|
|
456
|
-
case 2:
|
|
457
|
-
done = _context7.sent;
|
|
458
|
-
return _context7.abrupt("return", done);
|
|
459
|
-
case 4:
|
|
460
|
-
case "end":
|
|
461
|
-
return _context7.stop();
|
|
462
|
-
}
|
|
463
|
-
}, _callee7);
|
|
464
|
-
}));
|
|
465
|
-
return _extendForwards.apply(this, arguments);
|
|
466
|
-
};
|
|
467
|
-
extendForwards = function _extendForwards2() {
|
|
468
|
-
return _extendForwards.apply(this, arguments);
|
|
469
|
-
};
|
|
470
|
-
setScrollBackbuttonIcon = function _setScrollBackbuttonI() {
|
|
471
|
-
if (!scrollBackbutton) {
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
var sense = messageTable.extendedBack ? !newestFirst : newestFirst;
|
|
475
|
-
var scrollBackIcon = messageTable.initial ? 'noun_T-Block_1114655_000000.svg' : getScrollbackIcon(sense);
|
|
476
|
-
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollBackIcon);
|
|
477
|
-
function getScrollbackIcon(sense) {
|
|
478
|
-
return sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
479
|
-
}
|
|
480
|
-
};
|
|
481
|
-
_extendBackwards = function _extendBackwards3() {
|
|
482
|
-
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
483
|
-
var done;
|
|
484
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
485
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
486
|
-
case 0:
|
|
487
|
-
_context6.next = 2;
|
|
488
|
-
return insertPreviousMessages(true);
|
|
489
|
-
case 2:
|
|
490
|
-
done = _context6.sent;
|
|
491
|
-
if (done) {
|
|
492
|
-
if (scrollBackbutton) {
|
|
493
|
-
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg'); // T
|
|
494
|
-
scrollBackbutton.disabled = true;
|
|
495
|
-
}
|
|
496
|
-
messageTable.initial = true;
|
|
497
|
-
} else {
|
|
498
|
-
messageTable.extendedBack = true;
|
|
499
|
-
}
|
|
500
|
-
setScrollBackbuttonIcon();
|
|
501
|
-
return _context6.abrupt("return", done);
|
|
502
|
-
case 6:
|
|
503
|
-
case "end":
|
|
504
|
-
return _context6.stop();
|
|
505
|
-
}
|
|
506
|
-
}, _callee6);
|
|
507
|
-
}));
|
|
508
|
-
return _extendBackwards.apply(this, arguments);
|
|
509
|
-
};
|
|
510
|
-
extendBackwards = function _extendBackwards2() {
|
|
511
|
-
return _extendBackwards.apply(this, arguments);
|
|
512
|
-
};
|
|
513
|
-
scrollBackbutton = null; // was let
|
|
514
|
-
scrollForwardButton = null; // was let
|
|
515
|
-
/// ///////////////// Scroll down adding more above
|
|
516
|
-
/// ////////////// Scroll up adding more below
|
|
517
|
-
/// ///////////////////////
|
|
518
|
-
/*
|
|
519
|
-
options = options || {}
|
|
520
|
-
options.authorDateOnLeft = true
|
|
521
|
-
const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now
|
|
522
|
-
const channelObject = new ChatChannel(chatChannel, options)
|
|
523
|
-
const dateFolder = channelObject.dateFolder
|
|
524
|
-
const div = dom.createElement('div')
|
|
525
|
-
const statusArea = div.appendChild(dom.createElement('div'))
|
|
526
|
-
const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff
|
|
527
|
-
*/
|
|
528
|
-
debug.log('Options for called message Area', options);
|
|
529
|
-
messageTable = dom.createElement('table');
|
|
530
|
-
messageTable.style.width = '100%'; // fill the pane div
|
|
531
|
-
messageTable.extendBackwards = extendBackwards; // Make function available to scroll stuff
|
|
532
|
-
messageTable.extendForwards = extendForwards; // Make function available to scroll stuff
|
|
368
|
+
renderMessageTable = function _renderMessageTable(date, live) {
|
|
369
|
+
var scrollBackbutton;
|
|
370
|
+
var scrollForwardButton;
|
|
533
371
|
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
372
|
+
/// ///////////////// Scroll down adding more above
|
|
373
|
+
function extendBackwards() {
|
|
374
|
+
return _extendBackwards.apply(this, arguments);
|
|
375
|
+
}
|
|
376
|
+
function _extendBackwards() {
|
|
377
|
+
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
378
|
+
var done;
|
|
379
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
380
|
+
while (1) switch (_context.prev = _context.next) {
|
|
381
|
+
case 0:
|
|
382
|
+
_context.next = 2;
|
|
383
|
+
return insertPreviousMessages(true);
|
|
384
|
+
case 2:
|
|
385
|
+
done = _context.sent;
|
|
386
|
+
if (done) {
|
|
387
|
+
if (scrollBackbutton) {
|
|
388
|
+
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg'); // T
|
|
389
|
+
scrollBackbutton.disabled = true;
|
|
390
|
+
}
|
|
391
|
+
messageTable.initial = true;
|
|
546
392
|
} else {
|
|
547
|
-
messageTable.
|
|
393
|
+
messageTable.extendedBack = true;
|
|
548
394
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
// @@@@@@@@@@@ todo move this button to other end of message cell, o
|
|
582
|
-
scrollForwardButtonCell = titleTR.appendChild(dom.createElement('td'));
|
|
583
|
-
if (options.includeRemoveButton) {
|
|
584
|
-
scrollForwardButtonCell.appendChild(widgets.cancelButton(dom, function (_e) {
|
|
585
|
-
div.parentNode.removeChild(div);
|
|
586
|
-
}));
|
|
395
|
+
setScrollBackbuttonIcon();
|
|
396
|
+
return _context.abrupt("return", done);
|
|
397
|
+
case 6:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context.stop();
|
|
400
|
+
}
|
|
401
|
+
}, _callee);
|
|
402
|
+
}));
|
|
403
|
+
return _extendBackwards.apply(this, arguments);
|
|
404
|
+
}
|
|
405
|
+
function setScrollBackbuttonIcon() {
|
|
406
|
+
if (!scrollBackbutton) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
var sense = messageTable.extendedBack ? !newestFirst : newestFirst;
|
|
410
|
+
var scrollBackIcon = messageTable.initial ? 'noun_T-Block_1114655_000000.svg' : getScrollbackIcon(sense);
|
|
411
|
+
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollBackIcon);
|
|
412
|
+
function getScrollbackIcon(sense) {
|
|
413
|
+
return sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function scrollBackbuttonHandler(_x8) {
|
|
417
|
+
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
418
|
+
} /// ////////////// Scroll up adding more below
|
|
419
|
+
function _scrollBackbuttonHandler() {
|
|
420
|
+
_scrollBackbuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
421
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
422
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
423
|
+
case 0:
|
|
424
|
+
if (!messageTable.extendedBack) {
|
|
425
|
+
_context2.next = 6;
|
|
426
|
+
break;
|
|
587
427
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
428
|
+
removePreviousMessages(true, messageTable);
|
|
429
|
+
messageTable.extendedBack = false;
|
|
430
|
+
setScrollBackbuttonIcon();
|
|
431
|
+
_context2.next = 8;
|
|
432
|
+
break;
|
|
433
|
+
case 6:
|
|
434
|
+
_context2.next = 8;
|
|
435
|
+
return extendBackwards();
|
|
436
|
+
case 8:
|
|
437
|
+
case "end":
|
|
438
|
+
return _context2.stop();
|
|
439
|
+
}
|
|
440
|
+
}, _callee2);
|
|
441
|
+
}));
|
|
442
|
+
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
443
|
+
}
|
|
444
|
+
function extendForwards() {
|
|
445
|
+
return _extendForwards.apply(this, arguments);
|
|
446
|
+
}
|
|
447
|
+
function _extendForwards() {
|
|
448
|
+
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
449
|
+
var done;
|
|
450
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
451
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
452
|
+
case 0:
|
|
453
|
+
_context3.next = 2;
|
|
454
|
+
return insertPreviousMessages(false);
|
|
455
|
+
case 2:
|
|
456
|
+
done = _context3.sent;
|
|
457
|
+
if (done) {
|
|
458
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg');
|
|
459
|
+
scrollForwardButton.disabled = true;
|
|
460
|
+
messageTable["final"] = true;
|
|
611
461
|
} else {
|
|
612
|
-
messageTable.
|
|
462
|
+
messageTable.extendedForwards = true;
|
|
613
463
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
464
|
+
setScrollForwardButtonIcon();
|
|
465
|
+
return _context3.abrupt("return", done);
|
|
466
|
+
case 6:
|
|
467
|
+
case "end":
|
|
468
|
+
return _context3.stop();
|
|
469
|
+
}
|
|
470
|
+
}, _callee3);
|
|
471
|
+
}));
|
|
472
|
+
return _extendForwards.apply(this, arguments);
|
|
473
|
+
}
|
|
474
|
+
function setScrollForwardButtonIcon() {
|
|
475
|
+
var sense = messageTable.extendedForwards ? !newestFirst : newestFirst; // noun_T-Block_1114657_000000.svg
|
|
476
|
+
var scrollForwardIcon = messageTable["final"] ? 'noun_T-Block_1114657_000000.svg' : getScrollForwardButtonIcon(sense);
|
|
477
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollForwardIcon);
|
|
478
|
+
function getScrollForwardButtonIcon(sense) {
|
|
479
|
+
return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
function scrollForwardButtonHandler(_x9) {
|
|
483
|
+
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
484
|
+
} /// ///////////////////////
|
|
485
|
+
/*
|
|
486
|
+
options = options || {}
|
|
487
|
+
options.authorDateOnLeft = true
|
|
488
|
+
const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now
|
|
489
|
+
const channelObject = new ChatChannel(chatChannel, options)
|
|
490
|
+
const dateFolder = channelObject.dateFolder
|
|
491
|
+
const div = dom.createElement('div')
|
|
492
|
+
const statusArea = div.appendChild(dom.createElement('div'))
|
|
493
|
+
const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff
|
|
494
|
+
*/
|
|
495
|
+
function _scrollForwardButtonHandler() {
|
|
496
|
+
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
497
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
498
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
499
|
+
case 0:
|
|
500
|
+
if (!messageTable.extendedForwards) {
|
|
501
|
+
_context4.next = 6;
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
removePreviousMessages(false, messageTable);
|
|
505
|
+
messageTable.extendedForwards = false;
|
|
506
|
+
setScrollForwardButtonIcon();
|
|
507
|
+
_context4.next = 9;
|
|
627
508
|
break;
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
return _context9.finish(39);
|
|
646
|
-
case 42:
|
|
647
|
-
messageTable.fresh = true;
|
|
509
|
+
case 6:
|
|
510
|
+
_context4.next = 8;
|
|
511
|
+
return extendForwards();
|
|
512
|
+
case 8:
|
|
513
|
+
// async
|
|
514
|
+
latest.messageTable.scrollIntoView(newestFirst);
|
|
515
|
+
case 9:
|
|
516
|
+
case "end":
|
|
517
|
+
return _context4.stop();
|
|
518
|
+
}
|
|
519
|
+
}, _callee4);
|
|
520
|
+
}));
|
|
521
|
+
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
522
|
+
}
|
|
523
|
+
var messageTable = dom.createElement('table');
|
|
524
|
+
messageTable.extendBackwards = extendBackwards; // Make function available to scroll stuff
|
|
525
|
+
messageTable.extendForwards = extendForwards; // Make function available to scroll stuff
|
|
648
526
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
527
|
+
messageTable.date = date;
|
|
528
|
+
var chatDocument = dateFolder.leafDocumentFromDate(date);
|
|
529
|
+
messageTable.chatDocument = chatDocument;
|
|
530
|
+
messageTable.fresh = false;
|
|
531
|
+
messageTable.setAttribute('style', 'width: 100%;'); // fill that div!
|
|
532
|
+
if (live) {
|
|
533
|
+
messageTable["final"] = true;
|
|
534
|
+
liveMessageTable = messageTable;
|
|
535
|
+
latest.messageTable = messageTable;
|
|
536
|
+
var tr = (0, _message.renderMessageEditor)(channelObject, messageTable, userContext, options);
|
|
537
|
+
if (newestFirst) {
|
|
538
|
+
messageTable.insertBefore(tr, messageTable.firstChild); // If newestFirst
|
|
539
|
+
} else {
|
|
540
|
+
messageTable.appendChild(tr); // not newestFirst
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
messageTable.inputRow = tr;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/// ///// Infinite scroll
|
|
547
|
+
//
|
|
548
|
+
// @@ listen for swipe past end event not just button
|
|
549
|
+
if (options.infinite) {
|
|
550
|
+
var scrollBackbuttonTR = dom.createElement('tr');
|
|
551
|
+
var scrollBackbuttonCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
552
|
+
// up traingles: noun_1369237.svg
|
|
553
|
+
// down triangles: noun_1369241.svg
|
|
554
|
+
var scrollBackIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
555
|
+
scrollBackbutton = widgets.button(dom, _iconBase.icons.iconBase + scrollBackIcon, 'Previous messages ...');
|
|
556
|
+
scrollBackbuttonCell.style = 'width:3em; height:3em;';
|
|
557
|
+
scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false);
|
|
558
|
+
messageTable.extendedBack = false;
|
|
559
|
+
scrollBackbuttonCell.appendChild(scrollBackbutton);
|
|
560
|
+
setScrollBackbuttonIcon();
|
|
561
|
+
var dateCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
562
|
+
dateCell.style = 'text-align: center; vertical-align: middle; color: #888; font-style: italic;';
|
|
563
|
+
dateCell.textContent = widgets.shortDate(date.toISOString(), true); // no time, only date
|
|
564
|
+
|
|
565
|
+
// @@@@@@@@@@@ todo move this button to other end of message cell, o
|
|
566
|
+
var scrollForwardButtonCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
567
|
+
var scrollForwardIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
568
|
+
scrollForwardButton = widgets.button(dom, _iconBase.icons.iconBase + scrollForwardIcon, 'Later messages ...');
|
|
569
|
+
scrollForwardButtonCell.appendChild(scrollForwardButton);
|
|
570
|
+
scrollForwardButtonCell.style = 'width:3em; height:3em;';
|
|
571
|
+
scrollForwardButton.addEventListener('click', scrollForwardButtonHandler, false);
|
|
572
|
+
messageTable.extendedForward = false;
|
|
573
|
+
setScrollForwardButtonIcon();
|
|
574
|
+
messageTable.extendedForwards = false;
|
|
575
|
+
if (!newestFirst) {
|
|
576
|
+
// opposite end from the entry field
|
|
577
|
+
messageTable.insertBefore(scrollBackbuttonTR, messageTable.firstChild); // If not newestFirst
|
|
578
|
+
} else {
|
|
579
|
+
messageTable.appendChild(scrollBackbuttonTR); // newestFirst
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
var sts = _solidLogic.store.statementsMatching(null, ns.wf('message'), null, chatDocument);
|
|
584
|
+
if (!live && sts.length === 0) {
|
|
585
|
+
// not todays
|
|
586
|
+
// no need buttomns at the moment
|
|
587
|
+
// messageTable.style.visibility = 'collapse' // Hide files with no messages
|
|
588
|
+
}
|
|
589
|
+
sts.forEach(function (st) {
|
|
590
|
+
addMessage(st.object, messageTable);
|
|
591
|
+
});
|
|
592
|
+
messageTable.fresh = true;
|
|
593
|
+
|
|
594
|
+
// loadMessageTable(messageTable, chatDocument)
|
|
595
|
+
messageTable.fresh = false;
|
|
596
|
+
return messageTable;
|
|
662
597
|
};
|
|
663
598
|
_createMessageTable = function _createMessageTable3() {
|
|
664
|
-
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
599
|
+
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(date, live) {
|
|
665
600
|
var chatDocument, messageTable, statusTR;
|
|
666
|
-
return _regenerator["default"].wrap(function
|
|
667
|
-
while (1) switch (
|
|
601
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
602
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
668
603
|
case 0:
|
|
669
604
|
debug.log(' createMessageTable for ' + date);
|
|
670
605
|
chatDocument = dateFolder.leafDocumentFromDate(date);
|
|
671
|
-
|
|
672
|
-
|
|
606
|
+
_context6.prev = 2;
|
|
607
|
+
_context6.next = 5;
|
|
673
608
|
return _solidLogic.store.fetcher.load(chatDocument);
|
|
674
609
|
case 5:
|
|
675
|
-
|
|
610
|
+
_context6.next = 19;
|
|
676
611
|
break;
|
|
677
612
|
case 7:
|
|
678
|
-
|
|
679
|
-
|
|
613
|
+
_context6.prev = 7;
|
|
614
|
+
_context6.t0 = _context6["catch"](2);
|
|
680
615
|
messageTable = dom.createElement('table');
|
|
681
616
|
statusTR = messageTable.appendChild(dom.createElement('tr')); // ### find status in exception
|
|
682
|
-
if (!(
|
|
683
|
-
|
|
617
|
+
if (!(_context6.t0.response && _context6.t0.response.status && _context6.t0.response.status === 404)) {
|
|
618
|
+
_context6.next = 16;
|
|
684
619
|
break;
|
|
685
620
|
}
|
|
686
621
|
debug.log('Error 404 for chat file ' + chatDocument);
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
case 15:
|
|
690
|
-
return _context5.abrupt("return", _context5.sent);
|
|
691
|
-
case 18:
|
|
622
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
623
|
+
case 16:
|
|
692
624
|
debug.log('*** Error NON 404 for chat file ' + chatDocument);
|
|
693
|
-
statusTR.appendChild(widgets.errorMessageBlock(dom,
|
|
625
|
+
statusTR.appendChild(widgets.errorMessageBlock(dom, _context6.t0, 'pink'));
|
|
626
|
+
case 18:
|
|
627
|
+
return _context6.abrupt("return", statusTR);
|
|
628
|
+
case 19:
|
|
629
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
694
630
|
case 20:
|
|
695
|
-
return _context5.abrupt("return", statusTR);
|
|
696
|
-
case 21:
|
|
697
|
-
_context5.next = 23;
|
|
698
|
-
return renderMessageTable(date, live);
|
|
699
|
-
case 23:
|
|
700
|
-
return _context5.abrupt("return", _context5.sent);
|
|
701
|
-
case 24:
|
|
702
631
|
case "end":
|
|
703
|
-
return
|
|
632
|
+
return _context6.stop();
|
|
704
633
|
}
|
|
705
|
-
},
|
|
634
|
+
}, _callee6, null, [[2, 7]]);
|
|
706
635
|
}));
|
|
707
636
|
return _createMessageTable.apply(this, arguments);
|
|
708
637
|
};
|
|
709
|
-
createMessageTable = function _createMessageTable2(
|
|
638
|
+
createMessageTable = function _createMessageTable2(_x6, _x7) {
|
|
710
639
|
return _createMessageTable.apply(this, arguments);
|
|
711
640
|
};
|
|
712
641
|
removePreviousMessages = function _removePreviousMessag(backwards, messageTable) {
|
|
@@ -725,41 +654,32 @@ function _infiniteMessageArea() {
|
|
|
725
654
|
extr.messageTable = messageTable;
|
|
726
655
|
};
|
|
727
656
|
_insertPreviousMessages = function _insertPreviousMessag2() {
|
|
728
|
-
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
657
|
+
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(backwards) {
|
|
729
658
|
var extremity, date, live, todayDoc, doc, newMessageTable;
|
|
730
|
-
return _regenerator["default"].wrap(function
|
|
731
|
-
while (1) switch (
|
|
659
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
660
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
732
661
|
case 0:
|
|
733
662
|
extremity = backwards ? earliest : latest;
|
|
734
663
|
date = extremity.messageTable.date; // day in mssecs
|
|
735
|
-
|
|
736
|
-
if (!(backwards && earliest.limit && date <= earliest.limit)) {
|
|
737
|
-
_context4.next = 4;
|
|
738
|
-
break;
|
|
739
|
-
}
|
|
740
|
-
return _context4.abrupt("return", true);
|
|
741
|
-
case 4:
|
|
742
|
-
debug.log(' insertPreviousMessages: loadPrevious given date ' + date);
|
|
743
|
-
_context4.next = 7;
|
|
664
|
+
_context5.next = 4;
|
|
744
665
|
return dateFolder.loadPrevious(date, backwards);
|
|
745
|
-
case
|
|
746
|
-
date =
|
|
666
|
+
case 4:
|
|
667
|
+
date = _context5.sent;
|
|
747
668
|
// backwards
|
|
748
|
-
debug.log(' insertPreviousMessages: loadPrevious returns date ' + date);
|
|
749
669
|
debug.log("insertPreviousMessages: from ".concat(backwards ? 'backwards' : 'forwards', " loadPrevious: ").concat(date));
|
|
750
670
|
if (!(!date && !backwards && !liveMessageTable)) {
|
|
751
|
-
|
|
671
|
+
_context5.next = 9;
|
|
752
672
|
break;
|
|
753
673
|
}
|
|
754
|
-
|
|
674
|
+
_context5.next = 9;
|
|
755
675
|
return appendCurrentMessages();
|
|
756
|
-
case
|
|
676
|
+
case 9:
|
|
757
677
|
if (date) {
|
|
758
|
-
|
|
678
|
+
_context5.next = 11;
|
|
759
679
|
break;
|
|
760
680
|
}
|
|
761
|
-
return
|
|
762
|
-
case
|
|
681
|
+
return _context5.abrupt("return", true);
|
|
682
|
+
case 11:
|
|
763
683
|
// done
|
|
764
684
|
live = false;
|
|
765
685
|
if (!backwards) {
|
|
@@ -767,10 +687,10 @@ function _infiniteMessageArea() {
|
|
|
767
687
|
doc = dateFolder.leafDocumentFromDate(date);
|
|
768
688
|
live = doc.sameTerm(todayDoc); // Is this todays?
|
|
769
689
|
}
|
|
770
|
-
|
|
690
|
+
_context5.next = 15;
|
|
771
691
|
return createMessageTable(date, live);
|
|
772
|
-
case
|
|
773
|
-
newMessageTable =
|
|
692
|
+
case 15:
|
|
693
|
+
newMessageTable = _context5.sent;
|
|
774
694
|
extremity.messageTable = newMessageTable; // move pointer to earliest
|
|
775
695
|
if (backwards ? newestFirst : !newestFirst) {
|
|
776
696
|
// put on bottom or top
|
|
@@ -779,184 +699,64 @@ function _infiniteMessageArea() {
|
|
|
779
699
|
// put on top as we scroll back
|
|
780
700
|
div.insertBefore(newMessageTable, div.firstChild);
|
|
781
701
|
}
|
|
782
|
-
return
|
|
783
|
-
case
|
|
702
|
+
return _context5.abrupt("return", live);
|
|
703
|
+
case 19:
|
|
784
704
|
case "end":
|
|
785
|
-
return
|
|
705
|
+
return _context5.stop();
|
|
786
706
|
}
|
|
787
|
-
},
|
|
707
|
+
}, _callee5);
|
|
788
708
|
}));
|
|
789
709
|
return _insertPreviousMessages.apply(this, arguments);
|
|
790
710
|
};
|
|
791
|
-
insertPreviousMessages = function _insertPreviousMessag(
|
|
711
|
+
insertPreviousMessages = function _insertPreviousMessag(_x5) {
|
|
792
712
|
return _insertPreviousMessages.apply(this, arguments);
|
|
793
713
|
};
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
break;
|
|
803
|
-
}
|
|
804
|
-
return _context3.abrupt("return");
|
|
805
|
-
case 2:
|
|
806
|
-
if (!(0, _chatLogic.isReplaced)(message)) {
|
|
807
|
-
_context3.next = 4;
|
|
808
|
-
break;
|
|
809
|
-
}
|
|
810
|
-
return _context3.abrupt("return");
|
|
811
|
-
case 4:
|
|
812
|
-
thread = _solidLogic.store.any(null, ns.sioc('has_member'), message, message.doc());
|
|
813
|
-
id = _solidLogic.store.any(message, ns.sioc('id'), null, message.doc());
|
|
814
|
-
if (id && !thread) {
|
|
815
|
-
thread = _solidLogic.store.any(null, ns.sioc('has_member'), id, message.doc());
|
|
816
|
-
}
|
|
817
|
-
if (!options.thread) {
|
|
818
|
-
_context3.next = 20;
|
|
819
|
-
break;
|
|
820
|
-
}
|
|
821
|
-
if (!_solidLogic.store.holds(message, ns.sioc('has_reply'), options.thread)) {
|
|
822
|
-
_context3.next = 12;
|
|
823
|
-
break;
|
|
824
|
-
}
|
|
825
|
-
// root of thread
|
|
826
|
-
debug.log(' addMessage: displaying root of thread ' + thread);
|
|
827
|
-
_context3.next = 18;
|
|
828
|
-
break;
|
|
829
|
-
case 12:
|
|
830
|
-
if (!(thread && thread.sameTerm(options.thread))) {
|
|
831
|
-
_context3.next = 16;
|
|
832
|
-
break;
|
|
833
|
-
}
|
|
834
|
-
debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10));
|
|
835
|
-
_context3.next = 18;
|
|
836
|
-
break;
|
|
837
|
-
case 16:
|
|
838
|
-
debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10));
|
|
839
|
-
return _context3.abrupt("return");
|
|
840
|
-
case 18:
|
|
841
|
-
_context3.next = 26;
|
|
842
|
-
break;
|
|
843
|
-
case 20:
|
|
844
|
-
if (!thread) {
|
|
845
|
-
_context3.next = 25;
|
|
846
|
-
break;
|
|
847
|
-
}
|
|
848
|
-
debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10));
|
|
849
|
-
return _context3.abrupt("return");
|
|
850
|
-
case 25:
|
|
851
|
-
debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10));
|
|
852
|
-
case 26:
|
|
853
|
-
_context3.next = 28;
|
|
854
|
-
return insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext);
|
|
855
|
-
case 28:
|
|
856
|
-
case "end":
|
|
857
|
-
return _context3.stop();
|
|
858
|
-
}
|
|
859
|
-
}, _callee3);
|
|
860
|
-
}));
|
|
861
|
-
return _addMessage.apply(this, arguments);
|
|
862
|
-
};
|
|
863
|
-
addMessage = function _addMessage2(_x13, _x14) {
|
|
864
|
-
return _addMessage.apply(this, arguments);
|
|
865
|
-
};
|
|
866
|
-
_syncMessages = function _syncMessages3() {
|
|
867
|
-
_syncMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(chatChannel, messageTable) {
|
|
868
|
-
var displayed, ele, ele2, messages, stored, _iterator, _step, m;
|
|
869
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
870
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
871
|
-
case 0:
|
|
872
|
-
displayed = {};
|
|
873
|
-
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
874
|
-
if (ele.AJAR_subject) {
|
|
875
|
-
displayed[ele.AJAR_subject.uri] = true;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
messages = _solidLogic.store.each(chatChannel, ns.wf('message'), null, messageTable.chatDocument);
|
|
879
|
-
stored = {};
|
|
880
|
-
_iterator = _createForOfIteratorHelper(messages);
|
|
881
|
-
_context2.prev = 5;
|
|
882
|
-
_iterator.s();
|
|
883
|
-
case 7:
|
|
884
|
-
if ((_step = _iterator.n()).done) {
|
|
885
|
-
_context2.next = 15;
|
|
886
|
-
break;
|
|
887
|
-
}
|
|
888
|
-
m = _step.value;
|
|
889
|
-
stored[m.uri] = true;
|
|
890
|
-
if (displayed[m.uri]) {
|
|
891
|
-
_context2.next = 13;
|
|
892
|
-
break;
|
|
893
|
-
}
|
|
894
|
-
_context2.next = 13;
|
|
895
|
-
return addMessage(m, messageTable);
|
|
896
|
-
case 13:
|
|
897
|
-
_context2.next = 7;
|
|
898
|
-
break;
|
|
899
|
-
case 15:
|
|
900
|
-
_context2.next = 20;
|
|
901
|
-
break;
|
|
902
|
-
case 17:
|
|
903
|
-
_context2.prev = 17;
|
|
904
|
-
_context2.t0 = _context2["catch"](5);
|
|
905
|
-
_iterator.e(_context2.t0);
|
|
906
|
-
case 20:
|
|
907
|
-
_context2.prev = 20;
|
|
908
|
-
_iterator.f();
|
|
909
|
-
return _context2.finish(20);
|
|
910
|
-
case 23:
|
|
911
|
-
// eslint-disable-next-line space-in-parens
|
|
912
|
-
for (ele = messageTable.firstChild; ele;) {
|
|
913
|
-
ele2 = ele.nextSibling;
|
|
914
|
-
if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {
|
|
915
|
-
messageTable.removeChild(ele);
|
|
916
|
-
}
|
|
917
|
-
ele = ele2;
|
|
918
|
-
}
|
|
919
|
-
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
920
|
-
if (ele.AJAR_subject) {
|
|
921
|
-
// Refresh thumbs up etc
|
|
922
|
-
widgets.refreshTree(ele); // Things inside may have changed too
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
case 25:
|
|
926
|
-
case "end":
|
|
927
|
-
return _context2.stop();
|
|
928
|
-
}
|
|
929
|
-
}, _callee2, null, [[5, 17, 20, 23]]);
|
|
930
|
-
}));
|
|
931
|
-
return _syncMessages.apply(this, arguments);
|
|
714
|
+
addMessage = function _addMessage(message, messageTable) {
|
|
715
|
+
var latest = (0, _chatLogic.mostRecentVersion)(message);
|
|
716
|
+
// const content = store.any(latest, ns.sioc('content'))
|
|
717
|
+
if ((0, _chatLogic.isDeleted)(latest) && !options.showDeletedMessages) {
|
|
718
|
+
return; // ignore deleted messaged -- @@ could also leave a placeholder
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext); // fresh from elsewhere
|
|
932
722
|
};
|
|
933
|
-
syncMessages = function
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
723
|
+
syncMessages = function _syncMessages(about, messageTable) {
|
|
724
|
+
var displayed = {};
|
|
725
|
+
var ele, ele2;
|
|
726
|
+
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
727
|
+
if (ele.AJAR_subject) {
|
|
728
|
+
displayed[ele.AJAR_subject.uri] = true;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
var messages = _solidLogic.store.statementsMatching(about, ns.wf('message'), null, messageTable.chatDocument).map(function (st) {
|
|
732
|
+
return st.object;
|
|
733
|
+
});
|
|
734
|
+
var stored = {};
|
|
735
|
+
messages.forEach(function (m) {
|
|
736
|
+
stored[m.uri] = true;
|
|
737
|
+
if (!displayed[m.uri]) {
|
|
738
|
+
addMessage(m, messageTable);
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
// eslint-disable-next-line space-in-parens
|
|
743
|
+
for (ele = messageTable.firstChild; ele;) {
|
|
744
|
+
ele2 = ele.nextSibling;
|
|
745
|
+
if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {
|
|
746
|
+
messageTable.removeChild(ele);
|
|
747
|
+
}
|
|
748
|
+
ele = ele2;
|
|
749
|
+
}
|
|
750
|
+
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
751
|
+
if (ele.AJAR_subject) {
|
|
752
|
+
// Refresh thumbs up etc
|
|
753
|
+
widgets.refreshTree(ele); // Things inside may have changed too
|
|
754
|
+
}
|
|
953
755
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
*/
|
|
957
|
-
/* Add the live message block with entry field for today
|
|
958
|
-
*/
|
|
756
|
+
};
|
|
757
|
+
|
|
959
758
|
// Body of main function
|
|
759
|
+
|
|
960
760
|
options = options || {};
|
|
961
761
|
options.authorDateOnLeft = false; // @@ make a user optiosn
|
|
962
762
|
newestFirst = options.newestFirst === '1' || options.newestFirst === true; // hack for now
|
|
@@ -970,33 +770,23 @@ function _infiniteMessageArea() {
|
|
|
970
770
|
statusArea: statusArea,
|
|
971
771
|
div: statusArea
|
|
972
772
|
}; // logged on state, pointers to user's stuff
|
|
773
|
+
// const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable
|
|
973
774
|
earliest = {
|
|
974
775
|
messageTable: null
|
|
975
776
|
}; // Stuff about each end of the loaded days
|
|
976
777
|
latest = {
|
|
977
778
|
messageTable: null
|
|
978
779
|
};
|
|
979
|
-
if (options.thread) {
|
|
980
|
-
thread = options.thread;
|
|
981
|
-
threadRootMessage = _solidLogic.store.any(null, ns.sioc('has_reply'), thread, thread.doc());
|
|
982
|
-
if (threadRootMessage) {
|
|
983
|
-
threadTime = _solidLogic.store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc());
|
|
984
|
-
if (threadTime) {
|
|
985
|
-
earliest.limit = new Date(threadTime.value);
|
|
986
|
-
debug.log(' inifinite: thread start at ' + earliest.limit);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
780
|
lock = false;
|
|
991
|
-
|
|
781
|
+
_context12.next = 30;
|
|
992
782
|
return loadInitialContent();
|
|
993
|
-
case
|
|
994
|
-
return
|
|
995
|
-
case
|
|
783
|
+
case 30:
|
|
784
|
+
return _context12.abrupt("return", div);
|
|
785
|
+
case 31:
|
|
996
786
|
case "end":
|
|
997
|
-
return
|
|
787
|
+
return _context12.stop();
|
|
998
788
|
}
|
|
999
|
-
},
|
|
789
|
+
}, _callee12);
|
|
1000
790
|
}));
|
|
1001
791
|
return _infiniteMessageArea.apply(this, arguments);
|
|
1002
792
|
}
|