jqx-es 1.0.0
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/Bundle/jqx.browser.min.js +15 -0
- package/Bundle/jqx.min.js +15 -0
- package/LICENSE +674 -0
- package/README.md +59 -0
- package/build.js +17 -0
- package/index.js +99 -0
- package/lib/JQLBundle.js +15 -0
- package/package.json +27 -0
- package/src/DOM.js +77 -0
- package/src/DOMCleanup.js +89 -0
- package/src/EmbedResources.js +47 -0
- package/src/HTMLTags.js +18 -0
- package/src/HandlerFactory.js +31 -0
- package/src/JQxExtensionHelpers.js +276 -0
- package/src/JQxLog.js +144 -0
- package/src/JQxMethods.js +541 -0
- package/src/Popup.js +89 -0
- package/src/SyncedExternals.js +464 -0
- package/src/Utilities.js +126 -0
- package/src/tinyDOM.js +104 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { createElementFromHtmlString, insertPositions, inject2DOMTree, cleanupHtml, ATTRS} from "./DOM.js";
|
|
2
|
+
import { debugLog, Log, systemLog } from "./JQxLog.js";
|
|
3
|
+
import allMethods from "./JQxMethods.js";
|
|
4
|
+
import PopupFactory from "./Popup.js";
|
|
5
|
+
import HandleFactory from "./HandlerFactory.js";
|
|
6
|
+
import tagLib from "./HTMLTags.js";
|
|
7
|
+
import {
|
|
8
|
+
randomString, toDashedNotation, IS, truncateHtmlStr, tagFNFactory as $T,
|
|
9
|
+
truncate2SingleStr, logTime, hex2RGBA, styleFactory, toCamelcase
|
|
10
|
+
} from "./Utilities.js";
|
|
11
|
+
let static4Docs = {};
|
|
12
|
+
const {
|
|
13
|
+
instanceMethods, instanceGetters,isCommentOrTextNode, isNode,
|
|
14
|
+
isHtmlString, isArrayOfHtmlElements, isArrayOfHtmlStrings, ElemArray2HtmlString,
|
|
15
|
+
input2Collection, setCollectionFromCssSelector, addHandlerId, cssRuleEdit,
|
|
16
|
+
addFn, elems4Docs } = smallHelpersFactory();
|
|
17
|
+
|
|
18
|
+
/* region functions */
|
|
19
|
+
function smallHelpersFactory() {
|
|
20
|
+
const cssRuleEdit = styleFactory( { createWithId: `JQxStylesheet` } );
|
|
21
|
+
const addFn = (name, fn) => instanceMethods[name] = (self, ...params) => fn(self, ...params);
|
|
22
|
+
const instanceMethods = allMethods.instanceExtensions;
|
|
23
|
+
const instanceGetters = allMethods.factoryExtensions;
|
|
24
|
+
const isCommentOrTextNode = elem => IS(elem, Comment, Text);
|
|
25
|
+
const isNode = input => IS(input, Text, HTMLElement, Comment);
|
|
26
|
+
const isComment = input => IS(input, Comment);
|
|
27
|
+
const isText = input => IS(input, Text);
|
|
28
|
+
const isHtmlString = input => IS(input, String) && /^<|>$/.test(`${input}`.trim());
|
|
29
|
+
const isArrayOfHtmlStrings = input => IS(input, Array) && !input?.find(s => !isHtmlString(s));
|
|
30
|
+
const isArrayOfHtmlElements = input => IS(input, Array) && !input?.find(el => !isNode(el));
|
|
31
|
+
const ElemArray2HtmlString = elems => elems?.filter(el => el).reduce((acc, el) =>
|
|
32
|
+
acc.concat(isComment(el) ? `<!--${el.data}-->`
|
|
33
|
+
: isCommentOrTextNode(el) ? el.textContent
|
|
34
|
+
: el.outerHTML), ``);
|
|
35
|
+
const input2Collection = input =>
|
|
36
|
+
!input ? []
|
|
37
|
+
: IS(input, Proxy) ? [input.EL]
|
|
38
|
+
: IS(input, NodeList) ? [...input]
|
|
39
|
+
: isNode(input) ? [input]
|
|
40
|
+
: isArrayOfHtmlElements(input) ? input
|
|
41
|
+
: input.isJQx ? input.collection : undefined;
|
|
42
|
+
const setCollectionFromCssSelector = (input, root, self) => {
|
|
43
|
+
const selectorRoot = root !== document.body && (IS(input, String) && input.toLowerCase() !== "body") ? root : document;
|
|
44
|
+
let errorStr = undefined;
|
|
45
|
+
|
|
46
|
+
try { self.collection = [...selectorRoot.querySelectorAll(input)]; }
|
|
47
|
+
catch (err) { errorStr = `Invalid CSS querySelector. [${!IS(input, String) ? `Nothing valid given!` : input}]`; }
|
|
48
|
+
|
|
49
|
+
return errorStr ?? `CSS querySelector "${input}", output ${self.collection.length} element(s)`;
|
|
50
|
+
};
|
|
51
|
+
const addHandlerId = instance => {
|
|
52
|
+
const handleId = instance.data.get(`hid`) || `HID${randomString()}`;
|
|
53
|
+
instance.data.add({hid: handleId});
|
|
54
|
+
return `[data-hid="${handleId}"]`;
|
|
55
|
+
};
|
|
56
|
+
const elems4Docs = Object.entries(tagLib.tagsRaw)
|
|
57
|
+
.filter( ([,cando]) => cando)
|
|
58
|
+
.map( ([key,]) => key)
|
|
59
|
+
.sort( (a, b) => a.localeCompare(b));
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
instanceMethods, instanceGetters,isCommentOrTextNode, isNode, isComment, isText,
|
|
63
|
+
isHtmlString, isArrayOfHtmlElements, isArrayOfHtmlStrings, ElemArray2HtmlString,
|
|
64
|
+
input2Collection, setCollectionFromCssSelector, addHandlerId, cssRuleEdit,
|
|
65
|
+
addFn, elems4Docs };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function proxify(instance) {
|
|
69
|
+
return new Proxy( instance, { get: (obj, key) => proxyKeyFactory(obj, key, instance) } );
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function wrapExtension(method, instance) {
|
|
73
|
+
return (...args) => IS(method, Function) && method(proxify(instance), ...args);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function wrapGetter(method, instance) {
|
|
77
|
+
return (...args) => IS(method, Function) && method(proxify(instance), ...args);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function proxyKeyFactory(self, key, instance) {
|
|
81
|
+
switch(true) {
|
|
82
|
+
case IS(key, Symbol): return self;
|
|
83
|
+
case IS(+key, Number): return self.collection?.[key] || `ELEMENT WITH INDEX ${key} NOT FOUND`;
|
|
84
|
+
case !!(key in instanceGetters): return wrapGetter(instanceGetters[key], instance)();
|
|
85
|
+
case !!(key in instanceMethods): return wrapExtension(instanceMethods[key], instance);
|
|
86
|
+
default: return self[key];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function addJQxStaticMethods(jqx) {
|
|
91
|
+
const staticMethods = defaultStaticMethodsFactory(jqx);
|
|
92
|
+
Object.entries(Object.getOwnPropertyDescriptors(staticMethods))
|
|
93
|
+
.forEach( ([key, descriptor]) => {
|
|
94
|
+
Object.defineProperty(jqx, key, descriptor);
|
|
95
|
+
Object.defineProperty(static4Docs, key, descriptor); } );
|
|
96
|
+
return jqx;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function allowances(jqx) {
|
|
100
|
+
return {
|
|
101
|
+
allow: tagName => {
|
|
102
|
+
const isWebComponent = /-/.test(tagName);
|
|
103
|
+
const webComponentTagName = isWebComponent && tagName;
|
|
104
|
+
tagName = isWebComponent ? toCamelcase(tagName) : tagName.toLowerCase();
|
|
105
|
+
tagLib.allowTag(tagName);
|
|
106
|
+
|
|
107
|
+
if (!IS(jqx[tagName], Function)) {
|
|
108
|
+
Object.defineProperties( jqx, addGetters(tagName, true, jqx, webComponentTagName) );
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
prohibit: tagName => {
|
|
112
|
+
tagName = tagName.toLowerCase();
|
|
113
|
+
tagLib.prohibitTag(tagName);
|
|
114
|
+
|
|
115
|
+
if (IS(jqx[tagName], Function)) {
|
|
116
|
+
Object.defineProperties( jqx, addGetters(tagName, false, jqx) );
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function cssRemove(...rules) {
|
|
123
|
+
if (rules.length === 1) {
|
|
124
|
+
const ruleStr = String(rules.shift().trim());
|
|
125
|
+
rules = !ruleStr.startsWith(`!`)
|
|
126
|
+
? ruleStr.split(`,`).map(v => v.trim())
|
|
127
|
+
: [ruleStr.slice(1, -1)];
|
|
128
|
+
}
|
|
129
|
+
rules.map(rule => rule.startsWith(`!`) ? rule.slice(1, -1) : rule)
|
|
130
|
+
.forEach(rule => cssRuleEdit(rule, {removeRule: 1}));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function delegateFactory(handle) {
|
|
134
|
+
return function(type, origin, ...handlers) {
|
|
135
|
+
if (IS(origin, Function)) {
|
|
136
|
+
handlers.push(origin);
|
|
137
|
+
origin = undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return handlers.forEach(handler => handle(type, origin, handler));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function virtualFactory(jqx) {
|
|
145
|
+
return function(html, root, position) {
|
|
146
|
+
root = root?.isJQx ? root?.[0] : root;
|
|
147
|
+
position = position && Object.values(insertPositions).find(pos => position === pos) ? position : undefined;
|
|
148
|
+
const virtualElem = jqx(html, document.createElement(`br`));
|
|
149
|
+
if (root && !IS(root, HTMLBRElement)) {
|
|
150
|
+
virtualElem.collection.forEach(elem =>
|
|
151
|
+
position ? root.insertAdjacentElement(position, elem) : root.append(elem));
|
|
152
|
+
}
|
|
153
|
+
return virtualElem;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function combineObjectSources(...sources) {
|
|
158
|
+
const result = {};
|
|
159
|
+
|
|
160
|
+
for (const source of sources) {
|
|
161
|
+
const descriptors = Object.getOwnPropertyDescriptors(source);
|
|
162
|
+
Object.entries(descriptors).forEach( ([key, descriptor]) =>
|
|
163
|
+
!(key in result) && Object.defineProperty(result, key, descriptor) );
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function tagNotAllowed(tagName) {
|
|
170
|
+
console.error(`JQx: "${tagName}" not allowed, not rendered`);
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function tagGetterFactory(tagName, cando, jqx, webComponentTagName) {
|
|
175
|
+
tagName = toDashedNotation(webComponentTagName || tagName.toLowerCase());
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
get() {
|
|
179
|
+
return (...args) => {
|
|
180
|
+
if (!cando) { return tagNotAllowed(tagName) }
|
|
181
|
+
return jqx.virtual(cleanupHtml($T[tagName](...args)));
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
enumerable: false,
|
|
185
|
+
configurable: true,
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function addGetters(tag, cando, jqx, webComponentTagName) {
|
|
190
|
+
tag = tag.toLowerCase();
|
|
191
|
+
const jqxGetterForThisTag = tagGetterFactory(tag, cando, jqx, webComponentTagName);
|
|
192
|
+
|
|
193
|
+
return webComponentTagName
|
|
194
|
+
? { [webComponentTagName]: jqxGetterForThisTag, [toCamelcase(webComponentTagName)]: jqxGetterForThisTag, }
|
|
195
|
+
: { [tag]: jqxGetterForThisTag, [tag.toUpperCase()]: jqxGetterForThisTag, };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function defaultStaticMethodsFactory(jqx) {
|
|
199
|
+
return combineObjectSources(
|
|
200
|
+
Object.entries(tagLib.tagsRaw).reduce(staticTagsLambda(jqx), {}),
|
|
201
|
+
staticMethodsFactory(jqx));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function staticTagsLambda(jqx) {
|
|
205
|
+
return function(acc, [tag, cando]) {
|
|
206
|
+
cando && Object.defineProperties( acc, addGetters(tag, cando, jqx) );
|
|
207
|
+
return acc;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function staticMethodsFactory(jqx) {
|
|
212
|
+
const editCssRule = (ruleOrSelector, ruleObject) => cssRuleEdit(ruleOrSelector, ruleObject);
|
|
213
|
+
const allowProhibit = allowances(jqx);
|
|
214
|
+
return {
|
|
215
|
+
debugLog,
|
|
216
|
+
log: (...args) => Log(`fromStatic`, ...args),
|
|
217
|
+
insertPositions,
|
|
218
|
+
get at() { return insertPositions; },
|
|
219
|
+
editCssRules: (...rules) => rules.forEach(rule => cssRuleEdit(rule)),
|
|
220
|
+
editCssRule,
|
|
221
|
+
get setStyle() { /*deprecated*/return editCssRule; },
|
|
222
|
+
delegate: delegateFactory(HandleFactory()),
|
|
223
|
+
virtual: virtualFactory(jqx),
|
|
224
|
+
get fn() { return addFn; },
|
|
225
|
+
allowTag: allowProhibit.allow,
|
|
226
|
+
prohibitTag: allowProhibit.prohibit,
|
|
227
|
+
get lenient() { return tagLib.allowUnknownHtmlTags; },
|
|
228
|
+
get IS() { return IS; },
|
|
229
|
+
get Popup() {
|
|
230
|
+
if (!jqx.activePopup) {
|
|
231
|
+
Object.defineProperty(
|
|
232
|
+
jqx, `activePopup`, {
|
|
233
|
+
value: PopupFactory(jqx),
|
|
234
|
+
enumerable: false
|
|
235
|
+
} );
|
|
236
|
+
}
|
|
237
|
+
return jqx.activePopup;
|
|
238
|
+
},
|
|
239
|
+
popup: () => jqx.Popup,
|
|
240
|
+
createStyle: id => styleFactory({createWithId: id || `jqx${randomString()}`}),
|
|
241
|
+
editStylesheet: id => styleFactory({createWithId: id || `jqx${randomString()}`}),
|
|
242
|
+
removeCssRule: cssRemove,
|
|
243
|
+
removeCssRules: cssRemove,
|
|
244
|
+
text: (str, isComment = false) => isComment ? jqx.comment(str) : document.createTextNode(str),
|
|
245
|
+
node: (selector, root = document) => root.querySelector(selector, root),
|
|
246
|
+
nodes: (selector, root = document) => [...root.querySelectorAll(selector, root)],
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/* endregion functions */
|
|
250
|
+
|
|
251
|
+
export {
|
|
252
|
+
hex2RGBA,
|
|
253
|
+
addHandlerId,
|
|
254
|
+
isHtmlString,
|
|
255
|
+
isNode,
|
|
256
|
+
logTime,
|
|
257
|
+
toDashedNotation,
|
|
258
|
+
randomString,
|
|
259
|
+
isArrayOfHtmlStrings,
|
|
260
|
+
isArrayOfHtmlElements,
|
|
261
|
+
isCommentOrTextNode,
|
|
262
|
+
inject2DOMTree,
|
|
263
|
+
ElemArray2HtmlString,
|
|
264
|
+
input2Collection,
|
|
265
|
+
setCollectionFromCssSelector,
|
|
266
|
+
truncateHtmlStr,
|
|
267
|
+
truncate2SingleStr,
|
|
268
|
+
proxify,
|
|
269
|
+
addJQxStaticMethods,
|
|
270
|
+
createElementFromHtmlString,
|
|
271
|
+
insertPositions,
|
|
272
|
+
systemLog,
|
|
273
|
+
IS,
|
|
274
|
+
static4Docs,
|
|
275
|
+
elems4Docs,
|
|
276
|
+
};
|
package/src/JQxLog.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import jqx from "../index.js";
|
|
2
|
+
import {createElementFromHtmlString, element2DOM, insertPositions} from "./DOM.js";
|
|
3
|
+
import {IS, logTime,} from "./JQxExtensionHelpers.js";
|
|
4
|
+
import {logStyling} from "./EmbedResources.js";
|
|
5
|
+
let logSystem = false;
|
|
6
|
+
let useLogging = false;
|
|
7
|
+
let log2Console = true;
|
|
8
|
+
let reverseLogging = false;
|
|
9
|
+
let useHtml = true;
|
|
10
|
+
let editLogRule;
|
|
11
|
+
const getLogBox = () => jqx(`#logBox`);
|
|
12
|
+
const logBoxTextBoxId = `#jqx_logger`;
|
|
13
|
+
|
|
14
|
+
const setStyling4Log = setStyle => { logStyling?.forEach(selector => setStyle(selector)); };
|
|
15
|
+
|
|
16
|
+
const createLogElement = () => {
|
|
17
|
+
if (logStyling) {
|
|
18
|
+
setStyling4Log(editLogRule);
|
|
19
|
+
}
|
|
20
|
+
const jqx_logger_element_name = useHtml ? `div` : `pre`;
|
|
21
|
+
const loggingFieldSet = `<div id="logBox"><div class="legend"><div></div></div><${
|
|
22
|
+
jqx_logger_element_name} id="jqx_logger"></${jqx_logger_element_name}></div>`;
|
|
23
|
+
element2DOM(createElementFromHtmlString(loggingFieldSet), undefined, insertPositions.AfterBegin);
|
|
24
|
+
return jqx.node(logBoxTextBoxId);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const decodeForConsole = something => IS(something, String) &&
|
|
28
|
+
Object.assign(document.createElement(`textarea`), {innerHTML: something}).textContent || something;
|
|
29
|
+
|
|
30
|
+
const Log = (...args) => {
|
|
31
|
+
const isInstanceLog = args[0] === `fromStatic`;
|
|
32
|
+
args = isInstanceLog ? args.slice(1) : args;
|
|
33
|
+
if ( isInstanceLog && !useLogging) {
|
|
34
|
+
return args.forEach(arg => console.info(`${logTime()} ✔ ${decodeForConsole(arg)}`));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!useLogging) { return; }
|
|
38
|
+
|
|
39
|
+
if (!log2Console && !jqx.node(`#logBox`)) {
|
|
40
|
+
editLogRule = jqx.createStyle(`JQxLogCSS`);
|
|
41
|
+
createLogElement();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const logLine = arg => `${IS(arg, Object) ? JSON.stringify(arg, null, 2) : arg}\n`;
|
|
45
|
+
|
|
46
|
+
args.forEach( arg => log2Console
|
|
47
|
+
? console.info(`${logTime()} ✔ ${decodeForConsole(arg)}`)
|
|
48
|
+
: jqx.node(`#jqx_logger`).insertAdjacentHTML(
|
|
49
|
+
reverseLogging ? `afterbegin` : `beforeend`,
|
|
50
|
+
`<div class="entry">${logTime()} ${logLine(arg.replace(/\n/g, `<br>`))}</div>`)
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const logActive = {
|
|
55
|
+
on() { useLogging = true; Log(`Logging activated`); },
|
|
56
|
+
off() { useLogging = false; console.log(`Logging deactivated`) },
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const setSystemLog = {
|
|
60
|
+
on() { logSystem = true; },
|
|
61
|
+
off() { logSystem = false; },
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const systemLog = (...logTxt) => logSystem && Log(...logTxt);
|
|
65
|
+
|
|
66
|
+
const debugLog = {
|
|
67
|
+
get isConsole() { return log2Console === true; },
|
|
68
|
+
get isOn() { return useLogging; },
|
|
69
|
+
isVisible: function() { return jqx(`#jqx_logger`).is(`visible`); },
|
|
70
|
+
on() {
|
|
71
|
+
logActive.on();
|
|
72
|
+
setSystemLog.on();
|
|
73
|
+
if (!log2Console) {
|
|
74
|
+
getLogBox()?.addClass(`visible`);
|
|
75
|
+
}
|
|
76
|
+
Log(`Debug logging started. Every call to [jqx instance] is logged`);
|
|
77
|
+
return debugLog;
|
|
78
|
+
},
|
|
79
|
+
off() {
|
|
80
|
+
if (!getLogBox().isEmpty) {
|
|
81
|
+
setSystemLog.off();
|
|
82
|
+
Log(`Debug logging stopped`);
|
|
83
|
+
getLogBox()?.removeClass(`visible`);
|
|
84
|
+
}
|
|
85
|
+
logActive.off();
|
|
86
|
+
return debugLog;
|
|
87
|
+
},
|
|
88
|
+
toConsole: {
|
|
89
|
+
on() {
|
|
90
|
+
log2Console = true;
|
|
91
|
+
Log(`Started logging to console`);
|
|
92
|
+
return debugLog;
|
|
93
|
+
},
|
|
94
|
+
off() {
|
|
95
|
+
Log(`Stopped logging to console (except error messages)`);
|
|
96
|
+
log2Console = false;
|
|
97
|
+
return debugLog;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
remove() {
|
|
101
|
+
logActive.off();
|
|
102
|
+
setSystemLog.off();
|
|
103
|
+
getLogBox()?.remove();
|
|
104
|
+
console.clear();
|
|
105
|
+
console.log(`${logTime()} logging completely disabled and all entries removed`);
|
|
106
|
+
return debugLog;
|
|
107
|
+
},
|
|
108
|
+
log: function(...args) {
|
|
109
|
+
Log(...args);
|
|
110
|
+
return debugLog;
|
|
111
|
+
},
|
|
112
|
+
hide() {
|
|
113
|
+
getLogBox()?.removeClass(`visible`);
|
|
114
|
+
return debugLog;
|
|
115
|
+
},
|
|
116
|
+
show: () => {
|
|
117
|
+
getLogBox()?.addClass(`visible`);
|
|
118
|
+
return debugLog;
|
|
119
|
+
},
|
|
120
|
+
get reversed() {
|
|
121
|
+
return {
|
|
122
|
+
on: () => {
|
|
123
|
+
reverseLogging = true;
|
|
124
|
+
Log(`Reverse logging set: now logging bottom to top (latest first)`);
|
|
125
|
+
jqx(`#logBox .legend`).addClass(`reversed`);
|
|
126
|
+
return debugLog;
|
|
127
|
+
},
|
|
128
|
+
off: () => {
|
|
129
|
+
reverseLogging = false;
|
|
130
|
+
jqx(`#logBox .legend`).removeClass(`reversed`);
|
|
131
|
+
Log(`Reverse logging reset: now logging chronological (latest last)`);
|
|
132
|
+
return debugLog;
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
clear() {
|
|
137
|
+
jqx(logBoxTextBoxId).text(``);
|
|
138
|
+
console.clear();
|
|
139
|
+
Log(`Logging cleared`);
|
|
140
|
+
return debugLog;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export { Log, debugLog, systemLog };
|