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