solid-ui 2.4.32-8d90d955 → 2.4.32-9d930db7
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/{320.solid-ui.min.js → 670.solid-ui.min.js} +1 -1
- package/dist/805.solid-ui.min.js +3 -0
- package/dist/805.solid-ui.min.js.map +1 -0
- package/dist/solid-ui.js +1509 -2226
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
- package/lib/chat/bookmarks.js +42 -7
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +101 -226
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +136 -139
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +432 -618
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.js +3 -3
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +191 -323
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +276 -459
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +208 -299
- package/lib/chat/thread.js.map +1 -1
- package/lib/pad.js +8 -6
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +6 -5
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +0 -4
- package/lib/preferences.js.map +1 -1
- package/lib/tabs.js +10 -7
- package/lib/tabs.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts +2 -2
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -1
- package/lib/utils/keyHelpers/accessData.js +115 -59
- package/lib/utils/keyHelpers/accessData.js.map +1 -1
- package/lib/utils/keyHelpers/acl.js +14 -14
- package/lib/utils/keyHelpers/acl.js.map +1 -1
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/package.json +2 -3
- package/dist/376.solid-ui.min.js +0 -3
- package/dist/376.solid-ui.min.js.map +0 -1
- package/lib/utils/keyHelpers/otherHelpers.d.ts +0 -3
- package/lib/utils/keyHelpers/otherHelpers.d.ts.map +0 -1
- package/lib/utils/keyHelpers/otherHelpers.js +0 -22
- package/lib/utils/keyHelpers/otherHelpers.js.map +0 -1
- /package/dist/{376.solid-ui.min.js.LICENSE.txt → 805.solid-ui.min.js.LICENSE.txt} +0 -0
package/lib/chat/infinite.js
CHANGED
|
@@ -20,17 +20,19 @@ var _chatLogic = require("./chatLogic");
|
|
|
20
20
|
var _message = require("./message");
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
23
|
-
|
|
24
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
|
|
23
|
+
/**
|
|
26
24
|
* Contains the [[infiniteMessageArea]] class
|
|
27
25
|
* @packageDocumentation
|
|
28
|
-
*/
|
|
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
|
-
}
|
|
140
|
+
selectedMessageTable.selectedElement.scrollIntoView({
|
|
141
|
+
block: 'center'
|
|
142
|
+
});
|
|
168
143
|
}; // During initial load ONLY keep scroll to selected thing or bottom
|
|
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,37 +206,38 @@ 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
|
-
//
|
|
253
|
-
scrollBottom = div.scrollHeight - div.scrollTop;
|
|
254
|
-
|
|
221
|
+
// console.log(' chat/loadMoreWhereNeeded: Going now')
|
|
222
|
+
scrollBottom = div.scrollHeight - div.scrollTop;
|
|
223
|
+
debug.log('infinite scroll: adding above: top ' + div.scrollTop);
|
|
224
|
+
_context10.next = 14;
|
|
255
225
|
return earliest.messageTable.extendBackwards();
|
|
256
|
-
case
|
|
257
|
-
done =
|
|
226
|
+
case 14:
|
|
227
|
+
done = _context10.sent;
|
|
258
228
|
if (freeze) {
|
|
259
229
|
div.scrollTop = div.scrollHeight - scrollBottom;
|
|
260
230
|
}
|
|
261
231
|
if (fixScroll) fixScroll();
|
|
262
232
|
if (!done) {
|
|
263
|
-
|
|
233
|
+
_context10.next = 19;
|
|
264
234
|
break;
|
|
265
235
|
}
|
|
266
|
-
return
|
|
267
|
-
case
|
|
268
|
-
|
|
236
|
+
return _context10.abrupt("break", 21);
|
|
237
|
+
case 19:
|
|
238
|
+
_context10.next = 5;
|
|
269
239
|
break;
|
|
270
|
-
case
|
|
240
|
+
case 21:
|
|
271
241
|
if (!(options.selectedMessage &&
|
|
272
242
|
// we started in the middle not at the bottom
|
|
273
243
|
div.scrollHeight - div.scrollTop - div.clientHeight < magicZone &&
|
|
@@ -275,84 +245,78 @@ function _infiniteMessageArea() {
|
|
|
275
245
|
latest.messageTable && !latest.messageTable["final"] &&
|
|
276
246
|
// there is more data to come
|
|
277
247
|
latest.messageTable.extendForwards)) {
|
|
278
|
-
|
|
248
|
+
_context10.next = 33;
|
|
279
249
|
break;
|
|
280
250
|
}
|
|
281
251
|
scrollTop = div.scrollTop;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
(div.scrollHeight - div.scrollTop - div.clientHeight)
|
|
285
|
-
) */
|
|
286
|
-
_context13.next = 24;
|
|
252
|
+
debug.log('infinite scroll: adding below: bottom: ' + (div.scrollHeight - div.scrollTop - div.clientHeight));
|
|
253
|
+
_context10.next = 26;
|
|
287
254
|
return latest.messageTable.extendForwards();
|
|
288
|
-
case
|
|
289
|
-
done =
|
|
255
|
+
case 26:
|
|
256
|
+
done = _context10.sent;
|
|
290
257
|
// then add more data on the bottom
|
|
291
258
|
if (freeze) {
|
|
292
259
|
div.scrollTop = scrollTop; // while adding below keep same things in view
|
|
293
260
|
}
|
|
294
261
|
if (fixScroll) fixScroll();
|
|
295
262
|
if (!done) {
|
|
296
|
-
|
|
263
|
+
_context10.next = 31;
|
|
297
264
|
break;
|
|
298
265
|
}
|
|
299
|
-
return
|
|
300
|
-
case 29:
|
|
301
|
-
_context13.next = 20;
|
|
302
|
-
break;
|
|
266
|
+
return _context10.abrupt("break", 33);
|
|
303
267
|
case 31:
|
|
268
|
+
_context10.next = 21;
|
|
269
|
+
break;
|
|
270
|
+
case 33:
|
|
304
271
|
lock = false;
|
|
305
|
-
case
|
|
272
|
+
case 34:
|
|
306
273
|
case "end":
|
|
307
|
-
return
|
|
274
|
+
return _context10.stop();
|
|
308
275
|
}
|
|
309
|
-
},
|
|
276
|
+
}, _callee10);
|
|
310
277
|
}));
|
|
311
278
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
312
279
|
};
|
|
313
|
-
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(
|
|
280
|
+
loadMoreWhereNeeded = function _loadMoreWhereNeeded2(_x10, _x11) {
|
|
314
281
|
return _loadMoreWhereNeeded.apply(this, arguments);
|
|
315
282
|
};
|
|
316
283
|
_appendCurrentMessages = function _appendCurrentMessage2() {
|
|
317
|
-
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
284
|
+
_appendCurrentMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
318
285
|
var now, chatDocument, messageTable;
|
|
319
|
-
return _regenerator["default"].wrap(function
|
|
320
|
-
while (1) switch (
|
|
286
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
287
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
321
288
|
case 0:
|
|
322
289
|
now = new Date();
|
|
323
290
|
chatDocument = dateFolder.leafDocumentFromDate(now); /// ///////////////////////////////////////////////////////////
|
|
324
|
-
|
|
291
|
+
_context9.next = 4;
|
|
325
292
|
return createMessageTable(now, true);
|
|
326
293
|
case 4:
|
|
327
|
-
messageTable =
|
|
294
|
+
messageTable = _context9.sent;
|
|
328
295
|
div.appendChild(messageTable);
|
|
329
|
-
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
330
|
-
return _regenerator["default"].wrap(function
|
|
331
|
-
while (1) switch (
|
|
296
|
+
div.refresh = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
297
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
298
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
332
299
|
case 0:
|
|
333
|
-
|
|
300
|
+
_context8.next = 2;
|
|
334
301
|
return addNewChatDocumentIfNewDay(new Date());
|
|
335
302
|
case 2:
|
|
336
|
-
|
|
337
|
-
return syncMessages(chatChannel, messageTable);
|
|
338
|
-
case 4:
|
|
339
|
-
// @@ livemessagetable??
|
|
303
|
+
syncMessages(chatChannel, messageTable); // @@ livemessagetable??
|
|
340
304
|
desktopNotification(chatChannel);
|
|
341
|
-
case
|
|
305
|
+
case 4:
|
|
342
306
|
case "end":
|
|
343
|
-
return
|
|
307
|
+
return _context8.stop();
|
|
344
308
|
}
|
|
345
|
-
},
|
|
309
|
+
}, _callee8);
|
|
346
310
|
})); // The short chat version the live update listening is done in the pane but we do it in the widget @@
|
|
347
311
|
_solidLogic.store.updater.addDownstreamChangeListener(chatDocument, div.refresh); // Live update
|
|
348
312
|
liveMessageTable = messageTable;
|
|
349
313
|
latest.messageTable = liveMessageTable;
|
|
350
|
-
return
|
|
314
|
+
return _context9.abrupt("return", messageTable);
|
|
351
315
|
case 11:
|
|
352
316
|
case "end":
|
|
353
|
-
return
|
|
317
|
+
return _context9.stop();
|
|
354
318
|
}
|
|
355
|
-
},
|
|
319
|
+
}, _callee9);
|
|
356
320
|
}));
|
|
357
321
|
return _appendCurrentMessages.apply(this, arguments);
|
|
358
322
|
};
|
|
@@ -360,15 +324,15 @@ function _infiniteMessageArea() {
|
|
|
360
324
|
return _appendCurrentMessages.apply(this, arguments);
|
|
361
325
|
};
|
|
362
326
|
_addNewChatDocumentIfNewDay = function _addNewChatDocumentIf2() {
|
|
363
|
-
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
327
|
+
_addNewChatDocumentIfNewDay = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
364
328
|
var newChatDocument, oldChatDocument, sts;
|
|
365
|
-
return _regenerator["default"].wrap(function
|
|
366
|
-
while (1) switch (
|
|
329
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
330
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
367
331
|
case 0:
|
|
368
332
|
// @@ Remove listener from previous table as it is now static
|
|
369
333
|
newChatDocument = dateFolder.leafDocumentFromDate(new Date());
|
|
370
334
|
if (newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
|
|
371
|
-
|
|
335
|
+
_context7.next = 7;
|
|
372
336
|
break;
|
|
373
337
|
}
|
|
374
338
|
// It is a new day
|
|
@@ -377,7 +341,7 @@ function _infiniteMessageArea() {
|
|
|
377
341
|
delete liveMessageTable.inputRow;
|
|
378
342
|
}
|
|
379
343
|
oldChatDocument = latest.messageTable.chatDocument;
|
|
380
|
-
|
|
344
|
+
_context7.next = 6;
|
|
381
345
|
return appendCurrentMessages();
|
|
382
346
|
case 6:
|
|
383
347
|
// Adding a link in the document will ping listeners to add the new block too
|
|
@@ -391,318 +355,284 @@ function _infiniteMessageArea() {
|
|
|
391
355
|
}
|
|
392
356
|
case 7:
|
|
393
357
|
case "end":
|
|
394
|
-
return
|
|
358
|
+
return _context7.stop();
|
|
395
359
|
}
|
|
396
|
-
},
|
|
360
|
+
}, _callee7);
|
|
397
361
|
}));
|
|
398
362
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
399
363
|
};
|
|
400
364
|
addNewChatDocumentIfNewDay = function _addNewChatDocumentIf() {
|
|
401
365
|
return _addNewChatDocumentIfNewDay.apply(this, arguments);
|
|
402
366
|
};
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
407
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
408
|
-
case 0:
|
|
409
|
-
_scrollForwardButtonHandler = function _scrollForwardButtonH2() {
|
|
410
|
-
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(_event) {
|
|
411
|
-
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
412
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
413
|
-
case 0:
|
|
414
|
-
if (!messageTable.extendedForwards) {
|
|
415
|
-
_context8.next = 6;
|
|
416
|
-
break;
|
|
417
|
-
}
|
|
418
|
-
removePreviousMessages(false, messageTable);
|
|
419
|
-
messageTable.extendedForwards = false;
|
|
420
|
-
setScrollForwardButtonIcon();
|
|
421
|
-
_context8.next = 9;
|
|
422
|
-
break;
|
|
423
|
-
case 6:
|
|
424
|
-
_context8.next = 8;
|
|
425
|
-
return extendForwards();
|
|
426
|
-
case 8:
|
|
427
|
-
// async
|
|
428
|
-
latest.messageTable.scrollIntoView(newestFirst);
|
|
429
|
-
case 9:
|
|
430
|
-
case "end":
|
|
431
|
-
return _context8.stop();
|
|
432
|
-
}
|
|
433
|
-
}, _callee8);
|
|
434
|
-
}));
|
|
435
|
-
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
436
|
-
};
|
|
437
|
-
scrollForwardButtonHandler = function _scrollForwardButtonH(_x22) {
|
|
438
|
-
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
439
|
-
};
|
|
440
|
-
setScrollForwardButtonIcon = function _setScrollForwardButt() {
|
|
441
|
-
if (!scrollForwardButton) return;
|
|
442
|
-
var sense = messageTable.extendedForwards ? !newestFirst : newestFirst; // noun_T-Block_1114657_000000.svg
|
|
443
|
-
var scrollForwardIcon = messageTable["final"] ? 'noun_T-Block_1114657_000000.svg' : getScrollForwardButtonIcon(sense);
|
|
444
|
-
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollForwardIcon);
|
|
445
|
-
function getScrollForwardButtonIcon(sense) {
|
|
446
|
-
return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
_extendForwards = function _extendForwards3() {
|
|
450
|
-
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
451
|
-
var done;
|
|
452
|
-
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
453
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
454
|
-
case 0:
|
|
455
|
-
_context7.next = 2;
|
|
456
|
-
return insertPreviousMessages(false);
|
|
457
|
-
case 2:
|
|
458
|
-
done = _context7.sent;
|
|
459
|
-
return _context7.abrupt("return", done);
|
|
460
|
-
case 4:
|
|
461
|
-
case "end":
|
|
462
|
-
return _context7.stop();
|
|
463
|
-
}
|
|
464
|
-
}, _callee7);
|
|
465
|
-
}));
|
|
466
|
-
return _extendForwards.apply(this, arguments);
|
|
467
|
-
};
|
|
468
|
-
extendForwards = function _extendForwards2() {
|
|
469
|
-
return _extendForwards.apply(this, arguments);
|
|
470
|
-
};
|
|
471
|
-
setScrollBackbuttonIcon = function _setScrollBackbuttonI() {
|
|
472
|
-
if (!scrollBackbutton) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
var sense = messageTable.extendedBack ? !newestFirst : newestFirst;
|
|
476
|
-
var scrollBackIcon = messageTable.initial ? 'noun_T-Block_1114655_000000.svg' : getScrollbackIcon(sense);
|
|
477
|
-
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollBackIcon);
|
|
478
|
-
function getScrollbackIcon(sense) {
|
|
479
|
-
return sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
_extendBackwards = function _extendBackwards3() {
|
|
483
|
-
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
484
|
-
var done;
|
|
485
|
-
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
486
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
487
|
-
case 0:
|
|
488
|
-
_context6.next = 2;
|
|
489
|
-
return insertPreviousMessages(true);
|
|
490
|
-
case 2:
|
|
491
|
-
done = _context6.sent;
|
|
492
|
-
if (done) {
|
|
493
|
-
if (scrollBackbutton) {
|
|
494
|
-
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg'); // T
|
|
495
|
-
scrollBackbutton.disabled = true;
|
|
496
|
-
}
|
|
497
|
-
messageTable.initial = true;
|
|
498
|
-
} else {
|
|
499
|
-
messageTable.extendedBack = true;
|
|
500
|
-
}
|
|
501
|
-
setScrollBackbuttonIcon();
|
|
502
|
-
return _context6.abrupt("return", done);
|
|
503
|
-
case 6:
|
|
504
|
-
case "end":
|
|
505
|
-
return _context6.stop();
|
|
506
|
-
}
|
|
507
|
-
}, _callee6);
|
|
508
|
-
}));
|
|
509
|
-
return _extendBackwards.apply(this, arguments);
|
|
510
|
-
};
|
|
511
|
-
extendBackwards = function _extendBackwards2() {
|
|
512
|
-
return _extendBackwards.apply(this, arguments);
|
|
513
|
-
};
|
|
514
|
-
scrollBackbutton = null; // was let
|
|
515
|
-
scrollForwardButton = null; // was let
|
|
516
|
-
/// ///////////////// Scroll down adding more above
|
|
517
|
-
/// ////////////// Scroll up adding more below
|
|
518
|
-
/// ///////////////////////
|
|
519
|
-
/*
|
|
520
|
-
options = options || {}
|
|
521
|
-
options.authorDateOnLeft = true
|
|
522
|
-
const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now
|
|
523
|
-
const channelObject = new ChatChannel(chatChannel, options)
|
|
524
|
-
const dateFolder = channelObject.dateFolder
|
|
525
|
-
const div = dom.createElement('div')
|
|
526
|
-
const statusArea = div.appendChild(dom.createElement('div'))
|
|
527
|
-
const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff
|
|
528
|
-
*/
|
|
529
|
-
// debug.log('Options for called message Area', options)
|
|
530
|
-
messageTable = dom.createElement('table');
|
|
531
|
-
messageTable.style.width = '100%'; // fill the pane div
|
|
532
|
-
messageTable.extendBackwards = extendBackwards; // Make function available to scroll stuff
|
|
533
|
-
messageTable.extendForwards = extendForwards; // Make function available to scroll stuff
|
|
367
|
+
renderMessageTable = function _renderMessageTable(date, live) {
|
|
368
|
+
var scrollBackbutton;
|
|
369
|
+
var scrollForwardButton;
|
|
534
370
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
371
|
+
/// ///////////////// Scroll down adding more above
|
|
372
|
+
function extendBackwards() {
|
|
373
|
+
return _extendBackwards.apply(this, arguments);
|
|
374
|
+
}
|
|
375
|
+
function _extendBackwards() {
|
|
376
|
+
_extendBackwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
377
|
+
var done;
|
|
378
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
379
|
+
while (1) switch (_context.prev = _context.next) {
|
|
380
|
+
case 0:
|
|
381
|
+
_context.next = 2;
|
|
382
|
+
return insertPreviousMessages(true);
|
|
383
|
+
case 2:
|
|
384
|
+
done = _context.sent;
|
|
385
|
+
if (done) {
|
|
386
|
+
if (scrollBackbutton) {
|
|
387
|
+
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg'); // T
|
|
388
|
+
scrollBackbutton.disabled = true;
|
|
389
|
+
}
|
|
390
|
+
messageTable.initial = true;
|
|
547
391
|
} else {
|
|
548
|
-
messageTable.
|
|
392
|
+
messageTable.extendedBack = true;
|
|
549
393
|
}
|
|
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
|
-
|
|
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
|
-
}));
|
|
394
|
+
setScrollBackbuttonIcon();
|
|
395
|
+
return _context.abrupt("return", done);
|
|
396
|
+
case 6:
|
|
397
|
+
case "end":
|
|
398
|
+
return _context.stop();
|
|
399
|
+
}
|
|
400
|
+
}, _callee);
|
|
401
|
+
}));
|
|
402
|
+
return _extendBackwards.apply(this, arguments);
|
|
403
|
+
}
|
|
404
|
+
function setScrollBackbuttonIcon() {
|
|
405
|
+
if (!scrollBackbutton) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
var sense = messageTable.extendedBack ? !newestFirst : newestFirst;
|
|
409
|
+
var scrollBackIcon = messageTable.initial ? 'noun_T-Block_1114655_000000.svg' : getScrollbackIcon(sense);
|
|
410
|
+
scrollBackbutton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollBackIcon);
|
|
411
|
+
function getScrollbackIcon(sense) {
|
|
412
|
+
return sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function scrollBackbuttonHandler(_x8) {
|
|
416
|
+
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
417
|
+
} /// ////////////// Scroll up adding more below
|
|
418
|
+
function _scrollBackbuttonHandler() {
|
|
419
|
+
_scrollBackbuttonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
420
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
421
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
422
|
+
case 0:
|
|
423
|
+
if (!messageTable.extendedBack) {
|
|
424
|
+
_context2.next = 6;
|
|
425
|
+
break;
|
|
587
426
|
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
427
|
+
removePreviousMessages(true, messageTable);
|
|
428
|
+
messageTable.extendedBack = false;
|
|
429
|
+
setScrollBackbuttonIcon();
|
|
430
|
+
_context2.next = 8;
|
|
431
|
+
break;
|
|
432
|
+
case 6:
|
|
433
|
+
_context2.next = 8;
|
|
434
|
+
return extendBackwards();
|
|
435
|
+
case 8:
|
|
436
|
+
case "end":
|
|
437
|
+
return _context2.stop();
|
|
438
|
+
}
|
|
439
|
+
}, _callee2);
|
|
440
|
+
}));
|
|
441
|
+
return _scrollBackbuttonHandler.apply(this, arguments);
|
|
442
|
+
}
|
|
443
|
+
function extendForwards() {
|
|
444
|
+
return _extendForwards.apply(this, arguments);
|
|
445
|
+
}
|
|
446
|
+
function _extendForwards() {
|
|
447
|
+
_extendForwards = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
448
|
+
var done;
|
|
449
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
450
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
451
|
+
case 0:
|
|
452
|
+
_context3.next = 2;
|
|
453
|
+
return insertPreviousMessages(false);
|
|
454
|
+
case 2:
|
|
455
|
+
done = _context3.sent;
|
|
456
|
+
if (done) {
|
|
457
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + 'noun_T-Block_1114655_000000.svg');
|
|
458
|
+
scrollForwardButton.disabled = true;
|
|
459
|
+
messageTable["final"] = true;
|
|
611
460
|
} else {
|
|
612
|
-
messageTable.
|
|
461
|
+
messageTable.extendedForwards = true;
|
|
613
462
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
463
|
+
setScrollForwardButtonIcon();
|
|
464
|
+
return _context3.abrupt("return", done);
|
|
465
|
+
case 6:
|
|
466
|
+
case "end":
|
|
467
|
+
return _context3.stop();
|
|
468
|
+
}
|
|
469
|
+
}, _callee3);
|
|
470
|
+
}));
|
|
471
|
+
return _extendForwards.apply(this, arguments);
|
|
472
|
+
}
|
|
473
|
+
function setScrollForwardButtonIcon() {
|
|
474
|
+
var sense = messageTable.extendedForwards ? !newestFirst : newestFirst; // noun_T-Block_1114657_000000.svg
|
|
475
|
+
var scrollForwardIcon = messageTable["final"] ? 'noun_T-Block_1114657_000000.svg' : getScrollForwardButtonIcon(sense);
|
|
476
|
+
scrollForwardButton.firstChild.setAttribute('src', _iconBase.icons.iconBase + scrollForwardIcon);
|
|
477
|
+
function getScrollForwardButtonIcon(sense) {
|
|
478
|
+
return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg';
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
function scrollForwardButtonHandler(_x9) {
|
|
482
|
+
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
483
|
+
} /// ///////////////////////
|
|
484
|
+
/*
|
|
485
|
+
options = options || {}
|
|
486
|
+
options.authorDateOnLeft = true
|
|
487
|
+
const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now
|
|
488
|
+
const channelObject = new ChatChannel(chatChannel, options)
|
|
489
|
+
const dateFolder = channelObject.dateFolder
|
|
490
|
+
const div = dom.createElement('div')
|
|
491
|
+
const statusArea = div.appendChild(dom.createElement('div'))
|
|
492
|
+
const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff
|
|
493
|
+
*/
|
|
494
|
+
function _scrollForwardButtonHandler() {
|
|
495
|
+
_scrollForwardButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
496
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
497
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
498
|
+
case 0:
|
|
499
|
+
if (!messageTable.extendedForwards) {
|
|
500
|
+
_context4.next = 6;
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
removePreviousMessages(false, messageTable);
|
|
504
|
+
messageTable.extendedForwards = false;
|
|
505
|
+
setScrollForwardButtonIcon();
|
|
506
|
+
_context4.next = 9;
|
|
627
507
|
break;
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
508
|
+
case 6:
|
|
509
|
+
_context4.next = 8;
|
|
510
|
+
return extendForwards();
|
|
511
|
+
case 8:
|
|
512
|
+
// async
|
|
513
|
+
latest.messageTable.scrollIntoView(newestFirst);
|
|
514
|
+
case 9:
|
|
515
|
+
case "end":
|
|
516
|
+
return _context4.stop();
|
|
517
|
+
}
|
|
518
|
+
}, _callee4);
|
|
519
|
+
}));
|
|
520
|
+
return _scrollForwardButtonHandler.apply(this, arguments);
|
|
521
|
+
}
|
|
522
|
+
var messageTable = dom.createElement('table');
|
|
523
|
+
messageTable.extendBackwards = extendBackwards; // Make function available to scroll stuff
|
|
524
|
+
messageTable.extendForwards = extendForwards; // Make function available to scroll stuff
|
|
525
|
+
|
|
526
|
+
messageTable.date = date;
|
|
527
|
+
var chatDocument = dateFolder.leafDocumentFromDate(date);
|
|
528
|
+
messageTable.chatDocument = chatDocument;
|
|
529
|
+
messageTable.fresh = false;
|
|
530
|
+
messageTable.setAttribute('style', 'width: 100%;'); // fill that div!
|
|
531
|
+
if (live) {
|
|
532
|
+
messageTable["final"] = true;
|
|
533
|
+
liveMessageTable = messageTable;
|
|
534
|
+
latest.messageTable = messageTable;
|
|
535
|
+
var tr = (0, _message.renderMessageEditor)(channelObject, messageTable, userContext, options);
|
|
536
|
+
if (newestFirst) {
|
|
537
|
+
messageTable.insertBefore(tr, messageTable.firstChild); // If newestFirst
|
|
538
|
+
} else {
|
|
539
|
+
messageTable.appendChild(tr); // not newestFirst
|
|
540
|
+
}
|
|
541
|
+
messageTable.inputRow = tr;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/// ///// Infinite scroll
|
|
545
|
+
//
|
|
546
|
+
// @@ listen for swipe past end event not just button
|
|
547
|
+
if (options.infinite) {
|
|
548
|
+
var scrollBackbuttonTR = dom.createElement('tr');
|
|
549
|
+
var scrollBackbuttonCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
550
|
+
// up traingles: noun_1369237.svg
|
|
551
|
+
// down triangles: noun_1369241.svg
|
|
552
|
+
var scrollBackIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
553
|
+
scrollBackbutton = widgets.button(dom, _iconBase.icons.iconBase + scrollBackIcon, 'Previous messages ...');
|
|
554
|
+
scrollBackbuttonCell.style = 'width:3em; height:3em;';
|
|
555
|
+
scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false);
|
|
556
|
+
messageTable.extendedBack = false;
|
|
557
|
+
scrollBackbuttonCell.appendChild(scrollBackbutton);
|
|
558
|
+
setScrollBackbuttonIcon();
|
|
559
|
+
var dateCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
560
|
+
dateCell.style = 'text-align: center; vertical-align: middle; color: #888; font-style: italic;';
|
|
561
|
+
dateCell.textContent = widgets.shortDate(date.toISOString(), true); // no time, only date
|
|
562
|
+
|
|
563
|
+
// @@@@@@@@@@@ todo move this button to other end of message cell, o
|
|
564
|
+
var scrollForwardButtonCell = scrollBackbuttonTR.appendChild(dom.createElement('td'));
|
|
565
|
+
var scrollForwardIcon = newestFirst ? 'noun_1369241.svg' : 'noun_1369237.svg'; // down and up arrows respoctively
|
|
566
|
+
scrollForwardButton = widgets.button(dom, _iconBase.icons.iconBase + scrollForwardIcon, 'Later messages ...');
|
|
567
|
+
scrollForwardButtonCell.appendChild(scrollForwardButton);
|
|
568
|
+
scrollForwardButtonCell.style = 'width:3em; height:3em;';
|
|
569
|
+
scrollForwardButton.addEventListener('click', scrollForwardButtonHandler, false);
|
|
570
|
+
messageTable.extendedForward = false;
|
|
571
|
+
setScrollForwardButtonIcon();
|
|
572
|
+
messageTable.extendedForwards = false;
|
|
573
|
+
if (!newestFirst) {
|
|
574
|
+
// opposite end from the entry field
|
|
575
|
+
messageTable.insertBefore(scrollBackbuttonTR, messageTable.firstChild); // If not newestFirst
|
|
576
|
+
} else {
|
|
577
|
+
messageTable.appendChild(scrollBackbuttonTR); // newestFirst
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
var sts = _solidLogic.store.statementsMatching(null, ns.wf('message'), null, chatDocument);
|
|
581
|
+
if (!live && sts.length === 0) {
|
|
582
|
+
// not todays
|
|
583
|
+
// no need buttomns at the moment
|
|
584
|
+
// messageTable.style.visibility = 'collapse' // Hide files with no messages
|
|
585
|
+
}
|
|
586
|
+
sts.forEach(function (st) {
|
|
587
|
+
addMessage(st.object, messageTable);
|
|
588
|
+
});
|
|
589
|
+
messageTable.fresh = true;
|
|
590
|
+
|
|
591
|
+
// loadMessageTable(messageTable, chatDocument)
|
|
592
|
+
messageTable.fresh = false;
|
|
593
|
+
return messageTable;
|
|
659
594
|
};
|
|
660
595
|
_createMessageTable = function _createMessageTable3() {
|
|
661
|
-
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
596
|
+
_createMessageTable = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(date, live) {
|
|
662
597
|
var chatDocument, messageTable, statusTR;
|
|
663
|
-
return _regenerator["default"].wrap(function
|
|
664
|
-
while (1) switch (
|
|
598
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
599
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
665
600
|
case 0:
|
|
666
|
-
|
|
601
|
+
debug.log(' createMessageTable for ' + date);
|
|
667
602
|
chatDocument = dateFolder.leafDocumentFromDate(date);
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
return _solidLogic.store.fetcher.
|
|
671
|
-
case
|
|
672
|
-
|
|
603
|
+
_context6.prev = 2;
|
|
604
|
+
_context6.next = 5;
|
|
605
|
+
return _solidLogic.store.fetcher.load(chatDocument);
|
|
606
|
+
case 5:
|
|
607
|
+
_context6.next = 19;
|
|
673
608
|
break;
|
|
674
|
-
case
|
|
675
|
-
|
|
676
|
-
|
|
609
|
+
case 7:
|
|
610
|
+
_context6.prev = 7;
|
|
611
|
+
_context6.t0 = _context6["catch"](2);
|
|
677
612
|
messageTable = dom.createElement('table');
|
|
678
613
|
statusTR = messageTable.appendChild(dom.createElement('tr')); // ### find status in exception
|
|
679
|
-
if (!(
|
|
680
|
-
|
|
614
|
+
if (!(_context6.t0.response && _context6.t0.response.status && _context6.t0.response.status === 404)) {
|
|
615
|
+
_context6.next = 16;
|
|
681
616
|
break;
|
|
682
617
|
}
|
|
683
|
-
|
|
684
|
-
return renderMessageTable(date, live);
|
|
685
|
-
case 13:
|
|
686
|
-
return _context5.abrupt("return", _context5.sent);
|
|
618
|
+
debug.log('Error 404 for chat file ' + chatDocument);
|
|
619
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
687
620
|
case 16:
|
|
688
621
|
debug.log('*** Error NON 404 for chat file ' + chatDocument);
|
|
689
|
-
statusTR.appendChild(widgets.errorMessageBlock(dom,
|
|
622
|
+
statusTR.appendChild(widgets.errorMessageBlock(dom, _context6.t0, 'pink'));
|
|
690
623
|
case 18:
|
|
691
|
-
return
|
|
624
|
+
return _context6.abrupt("return", statusTR);
|
|
692
625
|
case 19:
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
case 21:
|
|
696
|
-
return _context5.abrupt("return", _context5.sent);
|
|
697
|
-
case 22:
|
|
626
|
+
return _context6.abrupt("return", renderMessageTable(date, live));
|
|
627
|
+
case 20:
|
|
698
628
|
case "end":
|
|
699
|
-
return
|
|
629
|
+
return _context6.stop();
|
|
700
630
|
}
|
|
701
|
-
},
|
|
631
|
+
}, _callee6, null, [[2, 7]]);
|
|
702
632
|
}));
|
|
703
633
|
return _createMessageTable.apply(this, arguments);
|
|
704
634
|
};
|
|
705
|
-
createMessageTable = function _createMessageTable2(
|
|
635
|
+
createMessageTable = function _createMessageTable2(_x6, _x7) {
|
|
706
636
|
return _createMessageTable.apply(this, arguments);
|
|
707
637
|
};
|
|
708
638
|
removePreviousMessages = function _removePreviousMessag(backwards, messageTable) {
|
|
@@ -721,44 +651,32 @@ function _infiniteMessageArea() {
|
|
|
721
651
|
extr.messageTable = messageTable;
|
|
722
652
|
};
|
|
723
653
|
_insertPreviousMessages = function _insertPreviousMessag2() {
|
|
724
|
-
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
654
|
+
_insertPreviousMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(backwards) {
|
|
725
655
|
var extremity, date, live, todayDoc, doc, newMessageTable;
|
|
726
|
-
return _regenerator["default"].wrap(function
|
|
727
|
-
while (1) switch (
|
|
656
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
657
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
728
658
|
case 0:
|
|
729
659
|
extremity = backwards ? earliest : latest;
|
|
730
660
|
date = extremity.messageTable.date; // day in mssecs
|
|
731
|
-
|
|
732
|
-
if (!(backwards && earliest.limit && date <= earliest.limit)) {
|
|
733
|
-
_context4.next = 7;
|
|
734
|
-
break;
|
|
735
|
-
}
|
|
736
|
-
if (liveMessageTable) {
|
|
737
|
-
_context4.next = 6;
|
|
738
|
-
break;
|
|
739
|
-
}
|
|
740
|
-
_context4.next = 6;
|
|
741
|
-
return appendCurrentMessages();
|
|
742
|
-
case 6:
|
|
743
|
-
return _context4.abrupt("return", true);
|
|
744
|
-
case 7:
|
|
745
|
-
_context4.next = 9;
|
|
661
|
+
_context5.next = 4;
|
|
746
662
|
return dateFolder.loadPrevious(date, backwards);
|
|
747
|
-
case
|
|
748
|
-
date =
|
|
663
|
+
case 4:
|
|
664
|
+
date = _context5.sent;
|
|
665
|
+
// backwards
|
|
666
|
+
debug.log("insertPreviousMessages: from ".concat(backwards ? 'backwards' : 'forwards', " loadPrevious: ").concat(date));
|
|
749
667
|
if (!(!date && !backwards && !liveMessageTable)) {
|
|
750
|
-
|
|
668
|
+
_context5.next = 9;
|
|
751
669
|
break;
|
|
752
670
|
}
|
|
753
|
-
|
|
671
|
+
_context5.next = 9;
|
|
754
672
|
return appendCurrentMessages();
|
|
755
|
-
case
|
|
673
|
+
case 9:
|
|
756
674
|
if (date) {
|
|
757
|
-
|
|
675
|
+
_context5.next = 11;
|
|
758
676
|
break;
|
|
759
677
|
}
|
|
760
|
-
return
|
|
761
|
-
case
|
|
678
|
+
return _context5.abrupt("return", true);
|
|
679
|
+
case 11:
|
|
762
680
|
// done
|
|
763
681
|
live = false;
|
|
764
682
|
if (!backwards) {
|
|
@@ -766,10 +684,10 @@ function _infiniteMessageArea() {
|
|
|
766
684
|
doc = dateFolder.leafDocumentFromDate(date);
|
|
767
685
|
live = doc.sameTerm(todayDoc); // Is this todays?
|
|
768
686
|
}
|
|
769
|
-
|
|
687
|
+
_context5.next = 15;
|
|
770
688
|
return createMessageTable(date, live);
|
|
771
|
-
case
|
|
772
|
-
newMessageTable =
|
|
689
|
+
case 15:
|
|
690
|
+
newMessageTable = _context5.sent;
|
|
773
691
|
extremity.messageTable = newMessageTable; // move pointer to earliest
|
|
774
692
|
if (backwards ? newestFirst : !newestFirst) {
|
|
775
693
|
// put on bottom or top
|
|
@@ -778,158 +696,64 @@ function _infiniteMessageArea() {
|
|
|
778
696
|
// put on top as we scroll back
|
|
779
697
|
div.insertBefore(newMessageTable, div.firstChild);
|
|
780
698
|
}
|
|
781
|
-
return
|
|
782
|
-
case
|
|
699
|
+
return _context5.abrupt("return", live);
|
|
700
|
+
case 19:
|
|
783
701
|
case "end":
|
|
784
|
-
return
|
|
702
|
+
return _context5.stop();
|
|
785
703
|
}
|
|
786
|
-
},
|
|
704
|
+
}, _callee5);
|
|
787
705
|
}));
|
|
788
706
|
return _insertPreviousMessages.apply(this, arguments);
|
|
789
707
|
};
|
|
790
|
-
insertPreviousMessages = function _insertPreviousMessag(
|
|
708
|
+
insertPreviousMessages = function _insertPreviousMessag(_x5) {
|
|
791
709
|
return _insertPreviousMessages.apply(this, arguments);
|
|
792
710
|
};
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
_context3.next = 2;
|
|
801
|
-
break;
|
|
802
|
-
}
|
|
803
|
-
return _context3.abrupt("return");
|
|
804
|
-
case 2:
|
|
805
|
-
/* if (isReplaced(message)) { //
|
|
806
|
-
return // this is old version
|
|
807
|
-
} */
|
|
808
|
-
thread = _solidLogic.store.any(null, ns.sioc('has_member'), message, message.doc());
|
|
809
|
-
id = _solidLogic.store.any(message, ns.sioc('id'), null, message.doc());
|
|
810
|
-
if (id && !thread) {
|
|
811
|
-
thread = _solidLogic.store.any(null, ns.sioc('has_member'), id, message.doc());
|
|
812
|
-
}
|
|
813
|
-
if (!options.thread) {
|
|
814
|
-
_context3.next = 15;
|
|
815
|
-
break;
|
|
816
|
-
}
|
|
817
|
-
if (!_solidLogic.store.holds(message, ns.sioc('has_reply'), options.thread)) {
|
|
818
|
-
_context3.next = 9;
|
|
819
|
-
break;
|
|
820
|
-
}
|
|
821
|
-
_context3.next = 13;
|
|
822
|
-
break;
|
|
823
|
-
case 9:
|
|
824
|
-
if (!(thread && thread.sameTerm(options.thread))) {
|
|
825
|
-
_context3.next = 12;
|
|
826
|
-
break;
|
|
827
|
-
}
|
|
828
|
-
_context3.next = 13;
|
|
829
|
-
break;
|
|
830
|
-
case 12:
|
|
831
|
-
return _context3.abrupt("return");
|
|
832
|
-
case 13:
|
|
833
|
-
_context3.next = 19;
|
|
834
|
-
break;
|
|
835
|
-
case 15:
|
|
836
|
-
if (!thread) {
|
|
837
|
-
_context3.next = 19;
|
|
838
|
-
break;
|
|
839
|
-
}
|
|
840
|
-
return _context3.abrupt("return");
|
|
841
|
-
case 19:
|
|
842
|
-
if (messageTable.fresh) {
|
|
843
|
-
_context3.next = 22;
|
|
844
|
-
break;
|
|
845
|
-
}
|
|
846
|
-
_context3.next = 22;
|
|
847
|
-
return insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext);
|
|
848
|
-
case 22:
|
|
849
|
-
case "end":
|
|
850
|
-
return _context3.stop();
|
|
851
|
-
}
|
|
852
|
-
}, _callee3);
|
|
853
|
-
}));
|
|
854
|
-
return _addMessage.apply(this, arguments);
|
|
855
|
-
};
|
|
856
|
-
addMessage = function _addMessage2(_x13, _x14) {
|
|
857
|
-
return _addMessage.apply(this, arguments);
|
|
858
|
-
};
|
|
859
|
-
_syncMessages = function _syncMessages3() {
|
|
860
|
-
_syncMessages = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(chatChannel, messageTable) {
|
|
861
|
-
var displayed, ele, ele2, messages, stored, _iterator, _step, m;
|
|
862
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
863
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
864
|
-
case 0:
|
|
865
|
-
displayed = {};
|
|
866
|
-
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
867
|
-
if (ele.AJAR_subject) {
|
|
868
|
-
displayed[ele.AJAR_subject.uri] = true;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
messages = _solidLogic.store.each(chatChannel, ns.wf('message'), null, messageTable.chatDocument);
|
|
872
|
-
stored = {};
|
|
873
|
-
_iterator = _createForOfIteratorHelper(messages);
|
|
874
|
-
_context2.prev = 5;
|
|
875
|
-
_iterator.s();
|
|
876
|
-
case 7:
|
|
877
|
-
if ((_step = _iterator.n()).done) {
|
|
878
|
-
_context2.next = 15;
|
|
879
|
-
break;
|
|
880
|
-
}
|
|
881
|
-
m = _step.value;
|
|
882
|
-
stored[m.uri] = true;
|
|
883
|
-
if (displayed[m.uri]) {
|
|
884
|
-
_context2.next = 13;
|
|
885
|
-
break;
|
|
886
|
-
}
|
|
887
|
-
_context2.next = 13;
|
|
888
|
-
return addMessage(m, messageTable);
|
|
889
|
-
case 13:
|
|
890
|
-
_context2.next = 7;
|
|
891
|
-
break;
|
|
892
|
-
case 15:
|
|
893
|
-
_context2.next = 20;
|
|
894
|
-
break;
|
|
895
|
-
case 17:
|
|
896
|
-
_context2.prev = 17;
|
|
897
|
-
_context2.t0 = _context2["catch"](5);
|
|
898
|
-
_iterator.e(_context2.t0);
|
|
899
|
-
case 20:
|
|
900
|
-
_context2.prev = 20;
|
|
901
|
-
_iterator.f();
|
|
902
|
-
return _context2.finish(20);
|
|
903
|
-
case 23:
|
|
904
|
-
// eslint-disable-next-line space-in-parens
|
|
905
|
-
for (ele = messageTable.firstChild; ele;) {
|
|
906
|
-
ele2 = ele.nextSibling;
|
|
907
|
-
if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {
|
|
908
|
-
messageTable.removeChild(ele);
|
|
909
|
-
}
|
|
910
|
-
ele = ele2;
|
|
911
|
-
}
|
|
912
|
-
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
913
|
-
if (ele.AJAR_subject) {
|
|
914
|
-
// Refresh thumbs up etc
|
|
915
|
-
widgets.refreshTree(ele); // Things inside may have changed too
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
case 25:
|
|
919
|
-
case "end":
|
|
920
|
-
return _context2.stop();
|
|
921
|
-
}
|
|
922
|
-
}, _callee2, null, [[5, 17, 20, 23]]);
|
|
923
|
-
}));
|
|
924
|
-
return _syncMessages.apply(this, arguments);
|
|
711
|
+
addMessage = function _addMessage(message, messageTable) {
|
|
712
|
+
var latest = (0, _chatLogic.mostRecentVersion)(message);
|
|
713
|
+
// const content = store.any(latest, ns.sioc('content'))
|
|
714
|
+
if ((0, _chatLogic.isDeleted)(latest) && !options.showDeletedMessages) {
|
|
715
|
+
return; // ignore deleted messaged -- @@ could also leave a placeholder
|
|
716
|
+
}
|
|
717
|
+
insertMessageIntoTable(channelObject, messageTable, message, messageTable.fresh, options, userContext); // fresh from elsewhere
|
|
925
718
|
};
|
|
926
|
-
syncMessages = function
|
|
927
|
-
|
|
719
|
+
syncMessages = function _syncMessages(about, messageTable) {
|
|
720
|
+
var displayed = {};
|
|
721
|
+
var ele, ele2;
|
|
722
|
+
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
723
|
+
if (ele.AJAR_subject) {
|
|
724
|
+
displayed[ele.AJAR_subject.uri] = true;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
var messages = _solidLogic.store.statementsMatching(about, ns.wf('message'), null, messageTable.chatDocument).map(function (st) {
|
|
728
|
+
return st.object;
|
|
729
|
+
});
|
|
730
|
+
var stored = {};
|
|
731
|
+
messages.forEach(function (m) {
|
|
732
|
+
stored[m.uri] = true;
|
|
733
|
+
if (!displayed[m.uri]) {
|
|
734
|
+
addMessage(m, messageTable);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
|
|
738
|
+
// eslint-disable-next-line space-in-parens
|
|
739
|
+
for (ele = messageTable.firstChild; ele;) {
|
|
740
|
+
ele2 = ele.nextSibling;
|
|
741
|
+
if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {
|
|
742
|
+
messageTable.removeChild(ele);
|
|
743
|
+
}
|
|
744
|
+
ele = ele2;
|
|
745
|
+
}
|
|
746
|
+
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
|
|
747
|
+
if (ele.AJAR_subject) {
|
|
748
|
+
// Refresh thumbs up etc
|
|
749
|
+
widgets.refreshTree(ele); // Things inside may have changed too
|
|
750
|
+
}
|
|
751
|
+
}
|
|
928
752
|
}; // ///////////////////////////////////////////////////////////////////////
|
|
929
753
|
// syncMessages
|
|
930
754
|
// Called once per original message displayed
|
|
931
755
|
/* Add a new messageTable at the top/bottom
|
|
932
|
-
|
|
756
|
+
*/
|
|
933
757
|
/* Remove message tables earlier than this one
|
|
934
758
|
*/
|
|
935
759
|
/* Load and render message table
|
|
@@ -963,33 +787,23 @@ function _infiniteMessageArea() {
|
|
|
963
787
|
statusArea: statusArea,
|
|
964
788
|
div: statusArea
|
|
965
789
|
}; // logged on state, pointers to user's stuff
|
|
790
|
+
// const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable
|
|
966
791
|
earliest = {
|
|
967
792
|
messageTable: null
|
|
968
793
|
}; // Stuff about each end of the loaded days
|
|
969
794
|
latest = {
|
|
970
795
|
messageTable: null
|
|
971
796
|
};
|
|
972
|
-
if (options.thread) {
|
|
973
|
-
thread = options.thread;
|
|
974
|
-
threadRootMessage = _solidLogic.store.any(null, ns.sioc('has_reply'), thread, thread.doc());
|
|
975
|
-
if (threadRootMessage) {
|
|
976
|
-
threadTime = _solidLogic.store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc());
|
|
977
|
-
if (threadTime) {
|
|
978
|
-
earliest.limit = new Date(threadTime.value);
|
|
979
|
-
// debug.log(' infinite: thread start at ' + earliest.limit)
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
797
|
lock = false;
|
|
984
|
-
|
|
798
|
+
_context12.next = 30;
|
|
985
799
|
return loadInitialContent();
|
|
986
|
-
case
|
|
987
|
-
return
|
|
988
|
-
case
|
|
800
|
+
case 30:
|
|
801
|
+
return _context12.abrupt("return", div);
|
|
802
|
+
case 31:
|
|
989
803
|
case "end":
|
|
990
|
-
return
|
|
804
|
+
return _context12.stop();
|
|
991
805
|
}
|
|
992
|
-
},
|
|
806
|
+
}, _callee12);
|
|
993
807
|
}));
|
|
994
808
|
return _infiniteMessageArea.apply(this, arguments);
|
|
995
809
|
}
|