@wiris/mathtype-ckeditor5 8.12.0 → 8.13.1
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/browser/index.js +1229 -159
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.umd.js +1238 -163
- package/dist/browser/index.umd.js.map +1 -1
- package/dist/browser/telemeter_wasm_bg.wasm +0 -0
- package/dist/index.js +17 -89
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/index.js +3 -0
- package/src/integration.js +8 -9
- package/src/plugin.js +8 -7
package/dist/browser/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ButtonView } from 'ckeditor5';
|
|
|
3
3
|
import { ClickObserver, XmlDataProcessor, UpcastWriter, HtmlDataProcessor } from 'ckeditor5';
|
|
4
4
|
import { Widget, viewToModelPositionOutsideModelElement, toWidget } from 'ckeditor5';
|
|
5
5
|
|
|
6
|
-
/*! @license DOMPurify 3.2.
|
|
6
|
+
/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
entries,
|
|
@@ -42,8 +42,10 @@ if (!construct) {
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
const arrayForEach = unapply(Array.prototype.forEach);
|
|
45
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
45
46
|
const arrayPop = unapply(Array.prototype.pop);
|
|
46
47
|
const arrayPush = unapply(Array.prototype.push);
|
|
48
|
+
const arraySplice = unapply(Array.prototype.splice);
|
|
47
49
|
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
48
50
|
const stringToString = unapply(String.prototype.toString);
|
|
49
51
|
const stringMatch = unapply(String.prototype.match);
|
|
@@ -199,7 +201,7 @@ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:x
|
|
|
199
201
|
// eslint-disable-next-line unicorn/better-regex
|
|
200
202
|
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
201
203
|
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
202
|
-
const TMPLIT_EXPR = seal(/\$\{[\w\W]
|
|
204
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
203
205
|
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
204
206
|
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
205
207
|
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
@@ -228,20 +230,11 @@ var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
|
228
230
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
229
231
|
const NODE_TYPE = {
|
|
230
232
|
element: 1,
|
|
231
|
-
attribute: 2,
|
|
232
233
|
text: 3,
|
|
233
|
-
cdataSection: 4,
|
|
234
|
-
entityReference: 5,
|
|
235
|
-
// Deprecated
|
|
236
|
-
entityNode: 6,
|
|
237
234
|
// Deprecated
|
|
238
235
|
progressingInstruction: 7,
|
|
239
236
|
comment: 8,
|
|
240
|
-
document: 9
|
|
241
|
-
documentType: 10,
|
|
242
|
-
documentFragment: 11,
|
|
243
|
-
notation: 12 // Deprecated
|
|
244
|
-
};
|
|
237
|
+
document: 9};
|
|
245
238
|
const getGlobal = function getGlobal() {
|
|
246
239
|
return typeof window === 'undefined' ? null : window;
|
|
247
240
|
};
|
|
@@ -299,9 +292,9 @@ const _createHooksMap = function _createHooksMap() {
|
|
|
299
292
|
function createDOMPurify() {
|
|
300
293
|
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
301
294
|
const DOMPurify = root => createDOMPurify(root);
|
|
302
|
-
DOMPurify.version = '3.2.
|
|
295
|
+
DOMPurify.version = '3.2.4';
|
|
303
296
|
DOMPurify.removed = [];
|
|
304
|
-
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
|
|
297
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
305
298
|
// Not running in a browser, provide a factory function
|
|
306
299
|
// so that you can pass your own Window
|
|
307
300
|
DOMPurify.isSupported = false;
|
|
@@ -1320,7 +1313,11 @@ function createDOMPurify() {
|
|
|
1320
1313
|
}
|
|
1321
1314
|
arrayPush(hooks[entryPoint], hookFunction);
|
|
1322
1315
|
};
|
|
1323
|
-
DOMPurify.removeHook = function (entryPoint) {
|
|
1316
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
1317
|
+
if (hookFunction !== undefined) {
|
|
1318
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1319
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
1320
|
+
}
|
|
1324
1321
|
return arrayPop(hooks[entryPoint]);
|
|
1325
1322
|
};
|
|
1326
1323
|
DOMPurify.removeHooks = function (entryPoint) {
|
|
@@ -1573,7 +1570,8 @@ var purify = createDOMPurify();
|
|
|
1573
1570
|
// Otherwise without the space
|
|
1574
1571
|
if (mathml.indexOf(` class="wrs_${customEditor}"`) !== -1) {
|
|
1575
1572
|
return mathml.replace(` class="wrs_${customEditor}"`, "");
|
|
1576
|
-
}
|
|
1573
|
+
}
|
|
1574
|
+
if (mathml.indexOf(`class="wrs_${customEditor}"`) !== -1) {
|
|
1577
1575
|
return mathml.replace(`class="wrs_${customEditor}"`, "");
|
|
1578
1576
|
}
|
|
1579
1577
|
// Non Trivial case: class attribute contains editor name.
|
|
@@ -3742,9 +3740,9 @@ var translations = {
|
|
|
3742
3740
|
* @returns {string} html sanitized.
|
|
3743
3741
|
* @static
|
|
3744
3742
|
*/ static htmlSanitize(html) {
|
|
3745
|
-
|
|
3743
|
+
const annotationRegex = /\<annotation.+\<\/annotation\>/;
|
|
3746
3744
|
// Get all the annotation content including the tags.
|
|
3747
|
-
|
|
3745
|
+
const annotation = html.match(annotationRegex);
|
|
3748
3746
|
// Sanitize html code without removing our supported MathML tags and attributes.
|
|
3749
3747
|
html = purify.sanitize(html, {
|
|
3750
3748
|
ADD_TAGS: [
|
|
@@ -4095,9 +4093,10 @@ var translations = {
|
|
|
4095
4093
|
if (position !== 0 && node.childNodes[position - 1].localName === "span" && node.childNodes[position].classList?.contains("Wirisformula")) {
|
|
4096
4094
|
node.childNodes[position - 1].remove();
|
|
4097
4095
|
return Util.getSelectedItem(target, isIframe, forceGetSelection);
|
|
4098
|
-
}
|
|
4096
|
+
}
|
|
4097
|
+
if (node.childNodes[position].classList?.contains("Wirisformula")) {
|
|
4099
4098
|
if (position > 0 && node.childNodes[position - 1].classList?.contains("Wirisformula") || position === 0) {
|
|
4100
|
-
|
|
4099
|
+
const emptySpan = document.createElement("span");
|
|
4101
4100
|
node.insertBefore(emptySpan, node.childNodes[position]);
|
|
4102
4101
|
return {
|
|
4103
4102
|
node: node.childNodes[position]
|
|
@@ -4523,7 +4522,7 @@ var translations = {
|
|
|
4523
4522
|
processImg(img);
|
|
4524
4523
|
// if it does contain a blob, then read that, replace the src with the decoded content, and process it
|
|
4525
4524
|
} else {
|
|
4526
|
-
|
|
4525
|
+
const reader = new FileReader();
|
|
4527
4526
|
reader.onload = function() {
|
|
4528
4527
|
img.setAttribute("src", reader.result);
|
|
4529
4528
|
processImg(img);
|
|
@@ -6131,7 +6130,7 @@ async function __wbg_init(input) {
|
|
|
6131
6130
|
*/ static async finish() {
|
|
6132
6131
|
if (!this.telemeter) return;
|
|
6133
6132
|
try {
|
|
6134
|
-
|
|
6133
|
+
const local_telemeter = this.telemeter;
|
|
6135
6134
|
this.telemeter = undefined;
|
|
6136
6135
|
await local_telemeter.finish();
|
|
6137
6136
|
} catch (e) {
|
|
@@ -6513,7 +6512,7 @@ class ContentManager {
|
|
|
6513
6512
|
} else {
|
|
6514
6513
|
this.setMathML(this.mathML);
|
|
6515
6514
|
}
|
|
6516
|
-
|
|
6515
|
+
const toolbar = this.updateToolbar();
|
|
6517
6516
|
this.onFocus();
|
|
6518
6517
|
if (this.deviceProperties.isIOS) {
|
|
6519
6518
|
const zoom = document.documentElement.clientWidth / window.innerWidth;
|
|
@@ -6522,12 +6521,12 @@ class ContentManager {
|
|
|
6522
6521
|
this.setKeyboardMode();
|
|
6523
6522
|
}
|
|
6524
6523
|
}
|
|
6525
|
-
|
|
6524
|
+
const trigger = this.dbclick ? "formula" : "button";
|
|
6526
6525
|
// Call Telemetry service to track the event.
|
|
6527
6526
|
try {
|
|
6528
6527
|
Telemeter.telemeter.track("OPENED_MTCT_EDITOR", {
|
|
6529
|
-
toolbar
|
|
6530
|
-
trigger
|
|
6528
|
+
toolbar,
|
|
6529
|
+
trigger
|
|
6531
6530
|
});
|
|
6532
6531
|
} catch (error) {
|
|
6533
6532
|
console.error("Error tracking OPENED_MTCT_EDITOR", error);
|
|
@@ -6728,14 +6727,12 @@ class ContentManager {
|
|
|
6728
6727
|
this.modalDialogInstance.closeDiv.focus();
|
|
6729
6728
|
keyboardEvent.stopPropagation();
|
|
6730
6729
|
keyboardEvent.preventDefault();
|
|
6731
|
-
} else {
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
keyboardEvent.preventDefault();
|
|
6738
|
-
}
|
|
6730
|
+
} else if (document.activeElement === this.modalDialogInstance.minimizeDiv) {
|
|
6731
|
+
// Focus on cancel button.
|
|
6732
|
+
if (!(this.modalDialogInstance.properties.state === "minimized")) {
|
|
6733
|
+
this.modalDialogInstance.cancelButton.focus();
|
|
6734
|
+
keyboardEvent.stopPropagation();
|
|
6735
|
+
keyboardEvent.preventDefault();
|
|
6739
6736
|
}
|
|
6740
6737
|
}
|
|
6741
6738
|
} else if (keyboardEvent.key === "Tab") {
|
|
@@ -7526,7 +7523,7 @@ var maxHoverIcon = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
|
|
|
7526
7523
|
try {
|
|
7527
7524
|
await Telemeter.telemeter.track("CLOSED_MTCT_EDITOR", {
|
|
7528
7525
|
toolbar: this.contentManager.toolbar,
|
|
7529
|
-
trigger
|
|
7526
|
+
trigger
|
|
7530
7527
|
});
|
|
7531
7528
|
} catch (error) {
|
|
7532
7529
|
console.error("Error tracking CLOSED_MTCT_EDITOR", error);
|
|
@@ -7894,27 +7891,27 @@ var maxHoverIcon = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
|
|
|
7894
7891
|
this.stackDiv.addEventListener("click", this.stack.bind(this), true);
|
|
7895
7892
|
this.minimizeDiv.addEventListener("click", this.minimize.bind(this), true);
|
|
7896
7893
|
this.closeDiv.addEventListener("click", this.cancelAction.bind(this));
|
|
7897
|
-
this.maximizeDiv.addEventListener("keypress",
|
|
7894
|
+
this.maximizeDiv.addEventListener("keypress", (e)=>{
|
|
7898
7895
|
if (e.key === "Enter" || e.key === " " || e.keyCode === 13 || e.keyCode === 32) {
|
|
7899
7896
|
// Handle enter and space.
|
|
7900
7897
|
e.target.click();
|
|
7901
7898
|
}
|
|
7902
7899
|
}, true);
|
|
7903
|
-
this.stackDiv.addEventListener("keypress",
|
|
7900
|
+
this.stackDiv.addEventListener("keypress", (e)=>{
|
|
7904
7901
|
if (e.key === "Enter" || e.key === " " || e.keyCode === 13 || e.keyCode === 32) {
|
|
7905
7902
|
// Handle enter and space.
|
|
7906
7903
|
e.target.click();
|
|
7907
7904
|
e.preventDefault();
|
|
7908
7905
|
}
|
|
7909
7906
|
}, true);
|
|
7910
|
-
this.minimizeDiv.addEventListener("keypress",
|
|
7907
|
+
this.minimizeDiv.addEventListener("keypress", (e)=>{
|
|
7911
7908
|
if (e.key === "Enter" || e.key === " " || e.keyCode === 13 || e.keyCode === 32) {
|
|
7912
7909
|
// Handle enter and space.
|
|
7913
7910
|
e.target.click();
|
|
7914
7911
|
e.preventDefault();
|
|
7915
7912
|
}
|
|
7916
7913
|
}, true);
|
|
7917
|
-
this.closeDiv.addEventListener("keypress",
|
|
7914
|
+
this.closeDiv.addEventListener("keypress", (e)=>{
|
|
7918
7915
|
if (e.key === "Enter" || e.key === " " || e.keyCode === 13 || e.keyCode === 32) {
|
|
7919
7916
|
// Handle enter and space.
|
|
7920
7917
|
e.target.click();
|
|
@@ -8924,7 +8921,7 @@ if (!String.prototype.startsWith) {
|
|
|
8924
8921
|
}
|
|
8925
8922
|
// Build the telemeter payload separated to delete null/undefined entries.
|
|
8926
8923
|
const mathml = element?.dataset?.mathml;
|
|
8927
|
-
|
|
8924
|
+
const payload = {
|
|
8928
8925
|
mathml_origin: mathmlOrigin ? MathML.safeXmlDecode(mathmlOrigin) : mathmlOrigin,
|
|
8929
8926
|
mathml: mathml ? MathML.safeXmlDecode(mathml) : mathml,
|
|
8930
8927
|
elapsed_time: Date.now() - this.editionProperties.editionStartTime,
|
|
@@ -9283,7 +9280,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9283
9280
|
attributes = {};
|
|
9284
9281
|
attributes.class = "wrs_modal_offline_warn";
|
|
9285
9282
|
this.offlineModalWarn = Util.createElement("span", attributes);
|
|
9286
|
-
|
|
9283
|
+
const generalStyle = `background-image: url(data:image/svg+xml;base64,${window.btoa(warnIcon)})`;
|
|
9287
9284
|
this.offlineModalWarn.setAttribute("style", generalStyle);
|
|
9288
9285
|
attributes = {};
|
|
9289
9286
|
attributes.class = "wrs_modal_offline_text_container";
|
|
@@ -9296,7 +9293,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9296
9293
|
attributes.class = "wrs_modal_offline_text";
|
|
9297
9294
|
this.offlineModalMessage2 = Util.createElement("p", attributes);
|
|
9298
9295
|
this.offlineModalMessage2.innerHTML = `Thank you for using MathType. We have detected you are disconnected from the network. We remind you that you'll need to be connected to use MathType. <br /><br />Please refresh the page if this message continues appearing.`;
|
|
9299
|
-
//Append offline modal elements
|
|
9296
|
+
// Append offline modal elements
|
|
9300
9297
|
this.offlineModalContent.appendChild(this.offlineModalClose);
|
|
9301
9298
|
this.offlineModalMessage.appendChild(this.offlineModalMessage1);
|
|
9302
9299
|
this.offlineModalMessage.appendChild(this.offlineModalMessage2);
|
|
@@ -9304,8 +9301,8 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9304
9301
|
this.offlineModalContent.appendChild(this.offlineModalWarn);
|
|
9305
9302
|
this.offlineModal.appendChild(this.offlineModalContent);
|
|
9306
9303
|
document.body.appendChild(this.offlineModal);
|
|
9307
|
-
|
|
9308
|
-
this.offlineModalClose.addEventListener("click",
|
|
9304
|
+
const modal = document.getElementById("wrs_modal_offline");
|
|
9305
|
+
this.offlineModalClose.addEventListener("click", ()=>{
|
|
9309
9306
|
modal.style.display = "none";
|
|
9310
9307
|
});
|
|
9311
9308
|
// Store editor name for telemetry purposes.
|
|
@@ -9315,7 +9312,8 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9315
9312
|
if (editorName.includes("Generic")) editorName = "Generic"; // Remove version from Generic editor.
|
|
9316
9313
|
let solutionTelemeter = editorName;
|
|
9317
9314
|
// If moodle, add information to hosts and solution.
|
|
9318
|
-
|
|
9315
|
+
const isMoodle = !!(typeof M === "object" && M !== null);
|
|
9316
|
+
let lms;
|
|
9319
9317
|
if (isMoodle) {
|
|
9320
9318
|
solutionTelemeter = "Moodle";
|
|
9321
9319
|
lms = {
|
|
@@ -9330,9 +9328,9 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9330
9328
|
}
|
|
9331
9329
|
}
|
|
9332
9330
|
// Get the OS and its version.
|
|
9333
|
-
|
|
9331
|
+
const OSData = this.getOS();
|
|
9334
9332
|
// Get the broswer and its version.
|
|
9335
|
-
|
|
9333
|
+
const broswerData = this.getBrowser();
|
|
9336
9334
|
// Create list of hosts to send to telemetry.
|
|
9337
9335
|
let hosts = [
|
|
9338
9336
|
{
|
|
@@ -9357,17 +9355,17 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9357
9355
|
lms
|
|
9358
9356
|
];
|
|
9359
9357
|
// Filter hosts to remove empty objects and empty keys.
|
|
9360
|
-
hosts = hosts.filter(
|
|
9358
|
+
hosts = hosts.filter((element)=>{
|
|
9361
9359
|
if (element) Object.keys(element).forEach((key)=>element[key] === "unknown" ? delete element[key] : {});
|
|
9362
9360
|
return element !== undefined;
|
|
9363
9361
|
});
|
|
9364
9362
|
// Initialize telemeter
|
|
9365
9363
|
Telemeter.init({
|
|
9366
9364
|
solution: {
|
|
9367
|
-
name:
|
|
9365
|
+
name: `MathType for ${solutionTelemeter}`,
|
|
9368
9366
|
version: this.version
|
|
9369
9367
|
},
|
|
9370
|
-
hosts
|
|
9368
|
+
hosts,
|
|
9371
9369
|
config: {
|
|
9372
9370
|
test: false,
|
|
9373
9371
|
debug: false,
|
|
@@ -9383,24 +9381,25 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9383
9381
|
* versionBrowser = Operating System version.
|
|
9384
9382
|
*/ getBrowser() {
|
|
9385
9383
|
// default value for OS just in case nothing is detected
|
|
9386
|
-
let detectedBrowser = "unknown"
|
|
9387
|
-
let
|
|
9384
|
+
let detectedBrowser = "unknown";
|
|
9385
|
+
let versionBrowser = "unknown";
|
|
9386
|
+
const userAgent = window.navigator.userAgent;
|
|
9388
9387
|
if (/Brave/.test(userAgent)) {
|
|
9389
9388
|
detectedBrowser = "brave";
|
|
9390
9389
|
if (userAgent.indexOf("Brave/")) {
|
|
9391
|
-
|
|
9390
|
+
const start = userAgent.indexOf("Brave") + 6;
|
|
9392
9391
|
let end = userAgent.substring(start).indexOf(" ");
|
|
9393
9392
|
end = end === -1 ? userAgent.lastIndexOf("") : end;
|
|
9394
9393
|
versionBrowser = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9395
9394
|
}
|
|
9396
9395
|
} else if (userAgent.indexOf("Edg/") !== -1) {
|
|
9397
9396
|
detectedBrowser = "edge_chromium";
|
|
9398
|
-
|
|
9397
|
+
const start = userAgent.indexOf("Edg/") + 4;
|
|
9399
9398
|
versionBrowser = userAgent.substring(start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9400
9399
|
} else if (/Edg/.test(userAgent)) {
|
|
9401
9400
|
detectedBrowser = "edge";
|
|
9402
9401
|
let start = userAgent.indexOf("Edg") + 3;
|
|
9403
|
-
start
|
|
9402
|
+
start += userAgent.substring(start).indexOf("/");
|
|
9404
9403
|
let end = userAgent.substring(start).indexOf(" ");
|
|
9405
9404
|
end = end === -1 ? userAgent.lastIndexOf("") : end;
|
|
9406
9405
|
versionBrowser = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
@@ -9414,7 +9413,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9414
9413
|
versionBrowser = userAgent.substring(start, end + start).replace("_", ".");
|
|
9415
9414
|
} else if (/OPR/.test(userAgent)) {
|
|
9416
9415
|
detectedBrowser = "opera";
|
|
9417
|
-
|
|
9416
|
+
const start = userAgent.indexOf("OPR/") + 4;
|
|
9418
9417
|
let end = userAgent.substring(start).indexOf(" ");
|
|
9419
9418
|
end = end === -1 ? userAgent.lastIndexOf("") : end;
|
|
9420
9419
|
versionBrowser = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
@@ -9445,19 +9444,24 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9445
9444
|
* versionOS = Operating System version.
|
|
9446
9445
|
*/ getOS() {
|
|
9447
9446
|
// default value for OS just in case nothing is detected
|
|
9448
|
-
let detectedOS = "unknown"
|
|
9447
|
+
let detectedOS = "unknown";
|
|
9448
|
+
let versionOS = "unknown";
|
|
9449
9449
|
// Retrieve properties to easily detect the OS
|
|
9450
|
-
|
|
9450
|
+
const userAgent = window.navigator.userAgent;
|
|
9451
|
+
const platform = window.navigator.platform;
|
|
9452
|
+
const macosPlatforms = [
|
|
9451
9453
|
"Macintosh",
|
|
9452
9454
|
"MacIntel",
|
|
9453
9455
|
"MacPPC",
|
|
9454
9456
|
"Mac68K"
|
|
9455
|
-
]
|
|
9457
|
+
];
|
|
9458
|
+
const windowsPlatforms = [
|
|
9456
9459
|
"Win32",
|
|
9457
9460
|
"Win64",
|
|
9458
9461
|
"Windows",
|
|
9459
9462
|
"WinCE"
|
|
9460
|
-
]
|
|
9463
|
+
];
|
|
9464
|
+
const iosPlatforms = [
|
|
9461
9465
|
"iPhone",
|
|
9462
9466
|
"iPad",
|
|
9463
9467
|
"iPod"
|
|
@@ -9466,20 +9470,20 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9466
9470
|
if (macosPlatforms.indexOf(platform) !== -1) {
|
|
9467
9471
|
detectedOS = "macos";
|
|
9468
9472
|
if (userAgent.indexOf("OS X") !== -1) {
|
|
9469
|
-
|
|
9470
|
-
|
|
9473
|
+
const start = userAgent.indexOf("OS X") + 5;
|
|
9474
|
+
const end = userAgent.substring(start).indexOf(" ");
|
|
9471
9475
|
versionOS = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9472
9476
|
}
|
|
9473
9477
|
} else if (iosPlatforms.indexOf(platform) !== -1) {
|
|
9474
9478
|
detectedOS = "ios";
|
|
9475
9479
|
if (userAgent.indexOf("OS ") !== -1) {
|
|
9476
|
-
|
|
9477
|
-
|
|
9480
|
+
const start = userAgent.indexOf("OS ") + 3;
|
|
9481
|
+
const end = userAgent.substring(start).indexOf(")");
|
|
9478
9482
|
versionOS = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9479
9483
|
}
|
|
9480
9484
|
} else if (windowsPlatforms.indexOf(platform) !== -1) {
|
|
9481
9485
|
detectedOS = "windows";
|
|
9482
|
-
|
|
9486
|
+
const start = userAgent.indexOf("Windows");
|
|
9483
9487
|
let end = userAgent.substring(start).indexOf(";");
|
|
9484
9488
|
if (end === -1) {
|
|
9485
9489
|
end = userAgent.substring(start).indexOf(")");
|
|
@@ -9487,7 +9491,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9487
9491
|
versionOS = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9488
9492
|
} else if (/Android/.test(userAgent)) {
|
|
9489
9493
|
detectedOS = "android";
|
|
9490
|
-
|
|
9494
|
+
const start = userAgent.indexOf("Android");
|
|
9491
9495
|
let end = userAgent.substring(start).indexOf(";");
|
|
9492
9496
|
if (end === -1) {
|
|
9493
9497
|
end = userAgent.substring(start).indexOf(")");
|
|
@@ -9496,8 +9500,8 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9496
9500
|
} else if (/CrOS/.test(userAgent)) {
|
|
9497
9501
|
detectedOS = "chromeos";
|
|
9498
9502
|
let start = userAgent.indexOf("CrOS ") + 5;
|
|
9499
|
-
start
|
|
9500
|
-
|
|
9503
|
+
start += userAgent.substring(start).indexOf(" ");
|
|
9504
|
+
const end = userAgent.substring(start).indexOf(")");
|
|
9501
9505
|
versionOS = userAgent.substring(start, end + start).replace("_", ".").replace(/[^\d.-]/g, "");
|
|
9502
9506
|
} else if (detectedOS === "unknown" && /Linux/.test(platform)) {
|
|
9503
9507
|
detectedOS = "linux";
|
|
@@ -9571,7 +9575,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9571
9575
|
this.core.editionProperties.isNewElement = true;
|
|
9572
9576
|
this.core.openModalDialog(this.target, this.isIframe);
|
|
9573
9577
|
} else {
|
|
9574
|
-
|
|
9578
|
+
const modal = document.getElementById("wrs_modal_offline");
|
|
9575
9579
|
modal.style.display = "block";
|
|
9576
9580
|
}
|
|
9577
9581
|
}
|
|
@@ -9583,7 +9587,7 @@ var warnIcon = "<svg width=\"16\" height=\"14\" viewBox=\"0 0 16 14\" fill=\"non
|
|
|
9583
9587
|
this.core.editionProperties.isNewElement = false;
|
|
9584
9588
|
this.core.openModalDialog(this.target, this.isIframe);
|
|
9585
9589
|
} else {
|
|
9586
|
-
|
|
9590
|
+
const modal = document.getElementById("wrs_modal_offline");
|
|
9587
9591
|
modal.style.display = "block";
|
|
9588
9592
|
}
|
|
9589
9593
|
}
|
|
@@ -9825,6 +9829,1145 @@ IntegrationModel.prototype.getSelectedItem = undefined;
|
|
|
9825
9829
|
"editorParameters"
|
|
9826
9830
|
];
|
|
9827
9831
|
|
|
9832
|
+
(function() {
|
|
9833
|
+
var HxOverrides = function() {};
|
|
9834
|
+
HxOverrides.__name__ = true;
|
|
9835
|
+
HxOverrides.dateStr = function(date) {
|
|
9836
|
+
var m = date.getMonth() + 1;
|
|
9837
|
+
var d = date.getDate();
|
|
9838
|
+
var h = date.getHours();
|
|
9839
|
+
var mi = date.getMinutes();
|
|
9840
|
+
var s = date.getSeconds();
|
|
9841
|
+
return date.getFullYear() + "-" + (m < 10 ? "0" + m : "" + m) + "-" + (d < 10 ? "0" + d : "" + d) + " " + (h < 10 ? "0" + h : "" + h) + ":" + (mi < 10 ? "0" + mi : "" + mi) + ":" + (s < 10 ? "0" + s : "" + s);
|
|
9842
|
+
};
|
|
9843
|
+
HxOverrides.strDate = function(s) {
|
|
9844
|
+
switch(s.length){
|
|
9845
|
+
case 8:
|
|
9846
|
+
var k = s.split(":");
|
|
9847
|
+
var d = new Date();
|
|
9848
|
+
d.setTime(0);
|
|
9849
|
+
d.setUTCHours(k[0]);
|
|
9850
|
+
d.setUTCMinutes(k[1]);
|
|
9851
|
+
d.setUTCSeconds(k[2]);
|
|
9852
|
+
return d;
|
|
9853
|
+
case 10:
|
|
9854
|
+
var k = s.split("-");
|
|
9855
|
+
return new Date(k[0], k[1] - 1, k[2], 0, 0, 0);
|
|
9856
|
+
case 19:
|
|
9857
|
+
var k = s.split(" ");
|
|
9858
|
+
var y = k[0].split("-");
|
|
9859
|
+
var t = k[1].split(":");
|
|
9860
|
+
return new Date(y[0], y[1] - 1, y[2], t[0], t[1], t[2]);
|
|
9861
|
+
default:
|
|
9862
|
+
throw "Invalid date format : " + s;
|
|
9863
|
+
}
|
|
9864
|
+
};
|
|
9865
|
+
HxOverrides.cca = function(s, index) {
|
|
9866
|
+
var x = s.charCodeAt(index);
|
|
9867
|
+
if (x != x) return undefined;
|
|
9868
|
+
return x;
|
|
9869
|
+
};
|
|
9870
|
+
HxOverrides.substr = function(s, pos, len) {
|
|
9871
|
+
if (pos != null && pos != 0 && len != null && len < 0) return "";
|
|
9872
|
+
if (len == null) len = s.length;
|
|
9873
|
+
if (pos < 0) {
|
|
9874
|
+
pos = s.length + pos;
|
|
9875
|
+
if (pos < 0) pos = 0;
|
|
9876
|
+
} else if (len < 0) len = s.length + len - pos;
|
|
9877
|
+
return s.substr(pos, len);
|
|
9878
|
+
};
|
|
9879
|
+
HxOverrides.remove = function(a, obj) {
|
|
9880
|
+
var i = 0;
|
|
9881
|
+
var l = a.length;
|
|
9882
|
+
while(i < l){
|
|
9883
|
+
if (a[i] == obj) {
|
|
9884
|
+
a.splice(i, 1);
|
|
9885
|
+
return true;
|
|
9886
|
+
}
|
|
9887
|
+
i++;
|
|
9888
|
+
}
|
|
9889
|
+
return false;
|
|
9890
|
+
};
|
|
9891
|
+
HxOverrides.iter = function(a) {
|
|
9892
|
+
return {
|
|
9893
|
+
cur: 0,
|
|
9894
|
+
arr: a,
|
|
9895
|
+
hasNext: function() {
|
|
9896
|
+
return this.cur < this.arr.length;
|
|
9897
|
+
},
|
|
9898
|
+
next: function() {
|
|
9899
|
+
return this.arr[this.cur++];
|
|
9900
|
+
}
|
|
9901
|
+
};
|
|
9902
|
+
};
|
|
9903
|
+
var IntIter = function(min, max) {
|
|
9904
|
+
this.min = min;
|
|
9905
|
+
this.max = max;
|
|
9906
|
+
};
|
|
9907
|
+
IntIter.__name__ = true;
|
|
9908
|
+
IntIter.prototype = {
|
|
9909
|
+
next: function() {
|
|
9910
|
+
return this.min++;
|
|
9911
|
+
},
|
|
9912
|
+
hasNext: function() {
|
|
9913
|
+
return this.min < this.max;
|
|
9914
|
+
},
|
|
9915
|
+
__class__: IntIter
|
|
9916
|
+
};
|
|
9917
|
+
var Std = function() {};
|
|
9918
|
+
Std.__name__ = true;
|
|
9919
|
+
Std["is"] = function(v, t) {
|
|
9920
|
+
return js.Boot.__instanceof(v, t);
|
|
9921
|
+
};
|
|
9922
|
+
Std.string = function(s) {
|
|
9923
|
+
return js.Boot.__string_rec(s, "");
|
|
9924
|
+
};
|
|
9925
|
+
Std["int"] = function(x) {
|
|
9926
|
+
return x | 0;
|
|
9927
|
+
};
|
|
9928
|
+
Std.parseInt = function(x) {
|
|
9929
|
+
var v = parseInt(x, 10);
|
|
9930
|
+
if (v == 0 && (HxOverrides.cca(x, 1) == 120 || HxOverrides.cca(x, 1) == 88)) v = parseInt(x);
|
|
9931
|
+
if (isNaN(v)) return null;
|
|
9932
|
+
return v;
|
|
9933
|
+
};
|
|
9934
|
+
Std.parseFloat = function(x) {
|
|
9935
|
+
return parseFloat(x);
|
|
9936
|
+
};
|
|
9937
|
+
Std.random = function(x) {
|
|
9938
|
+
return Math.floor(Math.random() * x);
|
|
9939
|
+
};
|
|
9940
|
+
var com = com || {};
|
|
9941
|
+
if (!com.wiris) com.wiris = {};
|
|
9942
|
+
if (!com.wiris.js) com.wiris.js = {};
|
|
9943
|
+
com.wiris.js.JsPluginTools = function() {
|
|
9944
|
+
this.tryReady();
|
|
9945
|
+
};
|
|
9946
|
+
com.wiris.js.JsPluginTools.__name__ = true;
|
|
9947
|
+
com.wiris.js.JsPluginTools.main = function() {
|
|
9948
|
+
var ev;
|
|
9949
|
+
ev = com.wiris.js.JsPluginTools.getInstance();
|
|
9950
|
+
haxe.Timer.delay($bind(ev, ev.tryReady), 100);
|
|
9951
|
+
};
|
|
9952
|
+
com.wiris.js.JsPluginTools.getInstance = function() {
|
|
9953
|
+
if (com.wiris.js.JsPluginTools.instance == null) com.wiris.js.JsPluginTools.instance = new com.wiris.js.JsPluginTools();
|
|
9954
|
+
return com.wiris.js.JsPluginTools.instance;
|
|
9955
|
+
};
|
|
9956
|
+
com.wiris.js.JsPluginTools.bypassEncapsulation = function() {
|
|
9957
|
+
if (window.com == null) window.com = {};
|
|
9958
|
+
if (window.com.wiris == null) window.com.wiris = {};
|
|
9959
|
+
if (window.com.wiris.js == null) window.com.wiris.js = {};
|
|
9960
|
+
if (window.com.wiris.js.JsPluginTools == null) window.com.wiris.js.JsPluginTools = com.wiris.js.JsPluginTools.getInstance();
|
|
9961
|
+
};
|
|
9962
|
+
com.wiris.js.JsPluginTools.prototype = {
|
|
9963
|
+
md5encode: function(content) {
|
|
9964
|
+
return haxe.Md5.encode(content);
|
|
9965
|
+
},
|
|
9966
|
+
doLoad: function() {
|
|
9967
|
+
this.ready = true;
|
|
9968
|
+
com.wiris.js.JsPluginTools.instance = this;
|
|
9969
|
+
com.wiris.js.JsPluginTools.bypassEncapsulation();
|
|
9970
|
+
},
|
|
9971
|
+
tryReady: function() {
|
|
9972
|
+
this.ready = false;
|
|
9973
|
+
if (js.Lib.document.readyState) {
|
|
9974
|
+
this.doLoad();
|
|
9975
|
+
this.ready = true;
|
|
9976
|
+
}
|
|
9977
|
+
if (!this.ready) haxe.Timer.delay($bind(this, this.tryReady), 100);
|
|
9978
|
+
},
|
|
9979
|
+
__class__: com.wiris.js.JsPluginTools
|
|
9980
|
+
};
|
|
9981
|
+
var haxe = haxe || {};
|
|
9982
|
+
haxe.Log = function() {};
|
|
9983
|
+
haxe.Log.__name__ = true;
|
|
9984
|
+
haxe.Log.trace = function(v, infos) {
|
|
9985
|
+
js.Boot.__trace(v, infos);
|
|
9986
|
+
};
|
|
9987
|
+
haxe.Log.clear = function() {
|
|
9988
|
+
js.Boot.__clear_trace();
|
|
9989
|
+
};
|
|
9990
|
+
haxe.Md5 = function() {};
|
|
9991
|
+
haxe.Md5.__name__ = true;
|
|
9992
|
+
haxe.Md5.encode = function(s) {
|
|
9993
|
+
return new haxe.Md5().doEncode(s);
|
|
9994
|
+
};
|
|
9995
|
+
haxe.Md5.prototype = {
|
|
9996
|
+
doEncode: function(str) {
|
|
9997
|
+
var x = this.str2blks(str);
|
|
9998
|
+
var a = 1732584193;
|
|
9999
|
+
var b = -271733879;
|
|
10000
|
+
var c = -1732584194;
|
|
10001
|
+
var d = 271733878;
|
|
10002
|
+
var i = 0;
|
|
10003
|
+
while(i < x.length){
|
|
10004
|
+
var olda = a;
|
|
10005
|
+
var oldb = b;
|
|
10006
|
+
var oldc = c;
|
|
10007
|
+
var oldd = d;
|
|
10008
|
+
a = this.ff(a, b, c, d, x[i], 7, -680876936);
|
|
10009
|
+
d = this.ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
10010
|
+
c = this.ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
10011
|
+
b = this.ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
10012
|
+
a = this.ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
10013
|
+
d = this.ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
10014
|
+
c = this.ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
10015
|
+
b = this.ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
10016
|
+
a = this.ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
10017
|
+
d = this.ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
10018
|
+
c = this.ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
10019
|
+
b = this.ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
10020
|
+
a = this.ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
10021
|
+
d = this.ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
10022
|
+
c = this.ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
10023
|
+
b = this.ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
10024
|
+
a = this.gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
10025
|
+
d = this.gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
10026
|
+
c = this.gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
10027
|
+
b = this.gg(b, c, d, a, x[i], 20, -373897302);
|
|
10028
|
+
a = this.gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
10029
|
+
d = this.gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
10030
|
+
c = this.gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
10031
|
+
b = this.gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
10032
|
+
a = this.gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
10033
|
+
d = this.gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
10034
|
+
c = this.gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
10035
|
+
b = this.gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
10036
|
+
a = this.gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
10037
|
+
d = this.gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
10038
|
+
c = this.gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
10039
|
+
b = this.gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
10040
|
+
a = this.hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
10041
|
+
d = this.hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
10042
|
+
c = this.hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
10043
|
+
b = this.hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
10044
|
+
a = this.hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
10045
|
+
d = this.hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
10046
|
+
c = this.hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
10047
|
+
b = this.hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
10048
|
+
a = this.hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
10049
|
+
d = this.hh(d, a, b, c, x[i], 11, -358537222);
|
|
10050
|
+
c = this.hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
10051
|
+
b = this.hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
10052
|
+
a = this.hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
10053
|
+
d = this.hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
10054
|
+
c = this.hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
10055
|
+
b = this.hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
10056
|
+
a = this.ii(a, b, c, d, x[i], 6, -198630844);
|
|
10057
|
+
d = this.ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
10058
|
+
c = this.ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
10059
|
+
b = this.ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
10060
|
+
a = this.ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
10061
|
+
d = this.ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
10062
|
+
c = this.ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
10063
|
+
b = this.ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
10064
|
+
a = this.ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
10065
|
+
d = this.ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
10066
|
+
c = this.ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
10067
|
+
b = this.ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
10068
|
+
a = this.ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
10069
|
+
d = this.ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
10070
|
+
c = this.ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
10071
|
+
b = this.ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
10072
|
+
a = this.addme(a, olda);
|
|
10073
|
+
b = this.addme(b, oldb);
|
|
10074
|
+
c = this.addme(c, oldc);
|
|
10075
|
+
d = this.addme(d, oldd);
|
|
10076
|
+
i += 16;
|
|
10077
|
+
}
|
|
10078
|
+
return this.rhex(a) + this.rhex(b) + this.rhex(c) + this.rhex(d);
|
|
10079
|
+
},
|
|
10080
|
+
ii: function(a, b, c, d, x, s, t) {
|
|
10081
|
+
return this.cmn(this.bitXOR(c, this.bitOR(b, ~d)), a, b, x, s, t);
|
|
10082
|
+
},
|
|
10083
|
+
hh: function(a, b, c, d, x, s, t) {
|
|
10084
|
+
return this.cmn(this.bitXOR(this.bitXOR(b, c), d), a, b, x, s, t);
|
|
10085
|
+
},
|
|
10086
|
+
gg: function(a, b, c, d, x, s, t) {
|
|
10087
|
+
return this.cmn(this.bitOR(this.bitAND(b, d), this.bitAND(c, ~d)), a, b, x, s, t);
|
|
10088
|
+
},
|
|
10089
|
+
ff: function(a, b, c, d, x, s, t) {
|
|
10090
|
+
return this.cmn(this.bitOR(this.bitAND(b, c), this.bitAND(~b, d)), a, b, x, s, t);
|
|
10091
|
+
},
|
|
10092
|
+
cmn: function(q, a, b, x, s, t) {
|
|
10093
|
+
return this.addme(this.rol(this.addme(this.addme(a, q), this.addme(x, t)), s), b);
|
|
10094
|
+
},
|
|
10095
|
+
rol: function(num, cnt) {
|
|
10096
|
+
return num << cnt | num >>> 32 - cnt;
|
|
10097
|
+
},
|
|
10098
|
+
str2blks: function(str) {
|
|
10099
|
+
var nblk = (str.length + 8 >> 6) + 1;
|
|
10100
|
+
var blks = new Array();
|
|
10101
|
+
var _g1 = 0, _g = nblk * 16;
|
|
10102
|
+
while(_g1 < _g){
|
|
10103
|
+
var i = _g1++;
|
|
10104
|
+
blks[i] = 0;
|
|
10105
|
+
}
|
|
10106
|
+
var i = 0;
|
|
10107
|
+
while(i < str.length){
|
|
10108
|
+
blks[i >> 2] |= HxOverrides.cca(str, i) << (str.length * 8 + i) % 4 * 8;
|
|
10109
|
+
i++;
|
|
10110
|
+
}
|
|
10111
|
+
blks[i >> 2] |= 128 << (str.length * 8 + i) % 4 * 8;
|
|
10112
|
+
var l = str.length * 8;
|
|
10113
|
+
var k = nblk * 16 - 2;
|
|
10114
|
+
blks[k] = l & 255;
|
|
10115
|
+
blks[k] |= (l >>> 8 & 255) << 8;
|
|
10116
|
+
blks[k] |= (l >>> 16 & 255) << 16;
|
|
10117
|
+
blks[k] |= (l >>> 24 & 255) << 24;
|
|
10118
|
+
return blks;
|
|
10119
|
+
},
|
|
10120
|
+
rhex: function(num) {
|
|
10121
|
+
var str = "";
|
|
10122
|
+
var hex_chr = "0123456789abcdef";
|
|
10123
|
+
var _g = 0;
|
|
10124
|
+
while(_g < 4){
|
|
10125
|
+
var j = _g++;
|
|
10126
|
+
str += hex_chr.charAt(num >> j * 8 + 4 & 15) + hex_chr.charAt(num >> j * 8 & 15);
|
|
10127
|
+
}
|
|
10128
|
+
return str;
|
|
10129
|
+
},
|
|
10130
|
+
addme: function(x, y) {
|
|
10131
|
+
var lsw = (x & 65535) + (y & 65535);
|
|
10132
|
+
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
10133
|
+
return msw << 16 | lsw & 65535;
|
|
10134
|
+
},
|
|
10135
|
+
bitAND: function(a, b) {
|
|
10136
|
+
var lsb = a & 1 & (b & 1);
|
|
10137
|
+
var msb31 = a >>> 1 & b >>> 1;
|
|
10138
|
+
return msb31 << 1 | lsb;
|
|
10139
|
+
},
|
|
10140
|
+
bitXOR: function(a, b) {
|
|
10141
|
+
var lsb = a & 1 ^ b & 1;
|
|
10142
|
+
var msb31 = a >>> 1 ^ b >>> 1;
|
|
10143
|
+
return msb31 << 1 | lsb;
|
|
10144
|
+
},
|
|
10145
|
+
bitOR: function(a, b) {
|
|
10146
|
+
var lsb = a & 1 | b & 1;
|
|
10147
|
+
var msb31 = a >>> 1 | b >>> 1;
|
|
10148
|
+
return msb31 << 1 | lsb;
|
|
10149
|
+
},
|
|
10150
|
+
__class__: haxe.Md5
|
|
10151
|
+
};
|
|
10152
|
+
haxe.Timer = function(time_ms) {
|
|
10153
|
+
var me = this;
|
|
10154
|
+
this.id = window.setInterval(function() {
|
|
10155
|
+
me.run();
|
|
10156
|
+
}, time_ms);
|
|
10157
|
+
};
|
|
10158
|
+
haxe.Timer.__name__ = true;
|
|
10159
|
+
haxe.Timer.delay = function(f, time_ms) {
|
|
10160
|
+
var t = new haxe.Timer(time_ms);
|
|
10161
|
+
t.run = function() {
|
|
10162
|
+
t.stop();
|
|
10163
|
+
f();
|
|
10164
|
+
};
|
|
10165
|
+
return t;
|
|
10166
|
+
};
|
|
10167
|
+
haxe.Timer.measure = function(f, pos) {
|
|
10168
|
+
var t0 = haxe.Timer.stamp();
|
|
10169
|
+
var r = f();
|
|
10170
|
+
haxe.Log.trace(haxe.Timer.stamp() - t0 + "s", pos);
|
|
10171
|
+
return r;
|
|
10172
|
+
};
|
|
10173
|
+
haxe.Timer.stamp = function() {
|
|
10174
|
+
return new Date().getTime() / 1000;
|
|
10175
|
+
};
|
|
10176
|
+
haxe.Timer.prototype = {
|
|
10177
|
+
run: function() {},
|
|
10178
|
+
stop: function() {
|
|
10179
|
+
if (this.id == null) return;
|
|
10180
|
+
window.clearInterval(this.id);
|
|
10181
|
+
this.id = null;
|
|
10182
|
+
},
|
|
10183
|
+
__class__: haxe.Timer
|
|
10184
|
+
};
|
|
10185
|
+
var js = js || {};
|
|
10186
|
+
js.Boot = function() {};
|
|
10187
|
+
js.Boot.__name__ = true;
|
|
10188
|
+
js.Boot.__unhtml = function(s) {
|
|
10189
|
+
return s.split("&").join("&").split("<").join("<").split(">").join(">");
|
|
10190
|
+
};
|
|
10191
|
+
js.Boot.__trace = function(v, i) {
|
|
10192
|
+
var msg = i != null ? i.fileName + ":" + i.lineNumber + ": " : "";
|
|
10193
|
+
msg += js.Boot.__string_rec(v, "");
|
|
10194
|
+
var d;
|
|
10195
|
+
if (typeof document != "undefined" && (d = document.getElementById("haxe:trace")) != null) d.innerHTML += js.Boot.__unhtml(msg) + "<br/>";
|
|
10196
|
+
else if (typeof console != "undefined" && console.log != null) console.log(msg);
|
|
10197
|
+
};
|
|
10198
|
+
js.Boot.__clear_trace = function() {
|
|
10199
|
+
var d = document.getElementById("haxe:trace");
|
|
10200
|
+
if (d != null) d.innerHTML = "";
|
|
10201
|
+
};
|
|
10202
|
+
js.Boot.isClass = function(o) {
|
|
10203
|
+
return o.__name__;
|
|
10204
|
+
};
|
|
10205
|
+
js.Boot.isEnum = function(e) {
|
|
10206
|
+
return e.__ename__;
|
|
10207
|
+
};
|
|
10208
|
+
js.Boot.getClass = function(o) {
|
|
10209
|
+
return o.__class__;
|
|
10210
|
+
};
|
|
10211
|
+
js.Boot.__string_rec = function(o, s) {
|
|
10212
|
+
if (o == null) return "null";
|
|
10213
|
+
if (s.length >= 5) return "<...>";
|
|
10214
|
+
var t = typeof o;
|
|
10215
|
+
if (t == "function" && (o.__name__ || o.__ename__)) t = "object";
|
|
10216
|
+
switch(t){
|
|
10217
|
+
case "object":
|
|
10218
|
+
if (o instanceof Array) {
|
|
10219
|
+
if (o.__enum__) {
|
|
10220
|
+
if (o.length == 2) return o[0];
|
|
10221
|
+
var str = o[0] + "(";
|
|
10222
|
+
s += "\t";
|
|
10223
|
+
var _g1 = 2, _g = o.length;
|
|
10224
|
+
while(_g1 < _g){
|
|
10225
|
+
var i = _g1++;
|
|
10226
|
+
if (i != 2) str += "," + js.Boot.__string_rec(o[i], s);
|
|
10227
|
+
else str += js.Boot.__string_rec(o[i], s);
|
|
10228
|
+
}
|
|
10229
|
+
return str + ")";
|
|
10230
|
+
}
|
|
10231
|
+
var l = o.length;
|
|
10232
|
+
var i;
|
|
10233
|
+
var str = "[";
|
|
10234
|
+
s += "\t";
|
|
10235
|
+
var _g = 0;
|
|
10236
|
+
while(_g < l){
|
|
10237
|
+
var i1 = _g++;
|
|
10238
|
+
str += (i1 > 0 ? "," : "") + js.Boot.__string_rec(o[i1], s);
|
|
10239
|
+
}
|
|
10240
|
+
str += "]";
|
|
10241
|
+
return str;
|
|
10242
|
+
}
|
|
10243
|
+
var tostr;
|
|
10244
|
+
try {
|
|
10245
|
+
tostr = o.toString;
|
|
10246
|
+
} catch (e) {
|
|
10247
|
+
return "???";
|
|
10248
|
+
}
|
|
10249
|
+
if (tostr != null && tostr != Object.toString) {
|
|
10250
|
+
var s2 = o.toString();
|
|
10251
|
+
if (s2 != "[object Object]") return s2;
|
|
10252
|
+
}
|
|
10253
|
+
var k = null;
|
|
10254
|
+
var str = "{\n";
|
|
10255
|
+
s += "\t";
|
|
10256
|
+
var hasp = o.hasOwnProperty != null;
|
|
10257
|
+
for(var k in o){
|
|
10258
|
+
if (hasp && !o.hasOwnProperty(k)) {
|
|
10259
|
+
continue;
|
|
10260
|
+
}
|
|
10261
|
+
if (k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
|
|
10262
|
+
continue;
|
|
10263
|
+
}
|
|
10264
|
+
if (str.length != 2) str += ", \n";
|
|
10265
|
+
str += s + k + " : " + js.Boot.__string_rec(o[k], s);
|
|
10266
|
+
}
|
|
10267
|
+
s = s.substring(1);
|
|
10268
|
+
str += "\n" + s + "}";
|
|
10269
|
+
return str;
|
|
10270
|
+
case "function":
|
|
10271
|
+
return "<function>";
|
|
10272
|
+
case "string":
|
|
10273
|
+
return o;
|
|
10274
|
+
default:
|
|
10275
|
+
return String(o);
|
|
10276
|
+
}
|
|
10277
|
+
};
|
|
10278
|
+
js.Boot.__interfLoop = function(cc, cl) {
|
|
10279
|
+
if (cc == null) return false;
|
|
10280
|
+
if (cc == cl) return true;
|
|
10281
|
+
var intf = cc.__interfaces__;
|
|
10282
|
+
if (intf != null) {
|
|
10283
|
+
var _g1 = 0, _g = intf.length;
|
|
10284
|
+
while(_g1 < _g){
|
|
10285
|
+
var i = _g1++;
|
|
10286
|
+
var i1 = intf[i];
|
|
10287
|
+
if (i1 == cl || js.Boot.__interfLoop(i1, cl)) return true;
|
|
10288
|
+
}
|
|
10289
|
+
}
|
|
10290
|
+
return js.Boot.__interfLoop(cc.__super__, cl);
|
|
10291
|
+
};
|
|
10292
|
+
js.Boot.__instanceof = function(o, cl) {
|
|
10293
|
+
try {
|
|
10294
|
+
if (o instanceof cl) {
|
|
10295
|
+
if (cl == Array) return o.__enum__ == null;
|
|
10296
|
+
return true;
|
|
10297
|
+
}
|
|
10298
|
+
if (js.Boot.__interfLoop(o.__class__, cl)) return true;
|
|
10299
|
+
} catch (e) {
|
|
10300
|
+
if (cl == null) return false;
|
|
10301
|
+
}
|
|
10302
|
+
switch(cl){
|
|
10303
|
+
case Int:
|
|
10304
|
+
return Math.ceil(o % 2147483648.0) === o;
|
|
10305
|
+
case Float:
|
|
10306
|
+
return typeof o == "number";
|
|
10307
|
+
case Bool:
|
|
10308
|
+
return o === true || o === false;
|
|
10309
|
+
case String:
|
|
10310
|
+
return typeof o == "string";
|
|
10311
|
+
case Dynamic:
|
|
10312
|
+
return true;
|
|
10313
|
+
default:
|
|
10314
|
+
if (o == null) return false;
|
|
10315
|
+
if (cl == Class && o.__name__ != null) return true;
|
|
10316
|
+
if (cl == Enum && o.__ename__ != null) return true;
|
|
10317
|
+
return o.__enum__ == cl;
|
|
10318
|
+
}
|
|
10319
|
+
};
|
|
10320
|
+
js.Boot.__cast = function(o, t) {
|
|
10321
|
+
if (js.Boot.__instanceof(o, t)) return o;
|
|
10322
|
+
else throw "Cannot cast " + Std.string(o) + " to " + Std.string(t);
|
|
10323
|
+
};
|
|
10324
|
+
js.Lib = function() {};
|
|
10325
|
+
js.Lib.__name__ = true;
|
|
10326
|
+
js.Lib.debug = function() {
|
|
10327
|
+
debugger;
|
|
10328
|
+
};
|
|
10329
|
+
js.Lib.alert = function(v) {
|
|
10330
|
+
alert(js.Boot.__string_rec(v, ""));
|
|
10331
|
+
};
|
|
10332
|
+
js.Lib.eval = function(code) {
|
|
10333
|
+
return eval(code);
|
|
10334
|
+
};
|
|
10335
|
+
js.Lib.setErrorHandler = function(f) {
|
|
10336
|
+
js.Lib.onerror = f;
|
|
10337
|
+
};
|
|
10338
|
+
function $bind(o, m) {
|
|
10339
|
+
var f = function() {
|
|
10340
|
+
return f.method.apply(f.scope, arguments);
|
|
10341
|
+
};
|
|
10342
|
+
f.scope = o;
|
|
10343
|
+
f.method = m;
|
|
10344
|
+
return f;
|
|
10345
|
+
}
|
|
10346
|
+
if (Array.prototype.indexOf) HxOverrides.remove = function(a, o) {
|
|
10347
|
+
var i = a.indexOf(o);
|
|
10348
|
+
if (i == -1) return false;
|
|
10349
|
+
a.splice(i, 1);
|
|
10350
|
+
return true;
|
|
10351
|
+
};
|
|
10352
|
+
Math.__name__ = [
|
|
10353
|
+
"Math"
|
|
10354
|
+
];
|
|
10355
|
+
Math.NaN = Number.NaN;
|
|
10356
|
+
Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
|
|
10357
|
+
Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
|
10358
|
+
Math.isFinite = function(i) {
|
|
10359
|
+
return isFinite(i);
|
|
10360
|
+
};
|
|
10361
|
+
Math.isNaN = function(i) {
|
|
10362
|
+
return isNaN(i);
|
|
10363
|
+
};
|
|
10364
|
+
String.prototype.__class__ = String;
|
|
10365
|
+
String.__name__ = true;
|
|
10366
|
+
Array.prototype.__class__ = Array;
|
|
10367
|
+
Array.__name__ = true;
|
|
10368
|
+
Date.prototype.__class__ = Date;
|
|
10369
|
+
Date.__name__ = [
|
|
10370
|
+
"Date"
|
|
10371
|
+
];
|
|
10372
|
+
var Int = {
|
|
10373
|
+
};
|
|
10374
|
+
var Dynamic = {
|
|
10375
|
+
};
|
|
10376
|
+
var Float = Number;
|
|
10377
|
+
Float.__name__ = [
|
|
10378
|
+
"Float"
|
|
10379
|
+
];
|
|
10380
|
+
var Bool = Boolean;
|
|
10381
|
+
Bool.__ename__ = [
|
|
10382
|
+
"Bool"
|
|
10383
|
+
];
|
|
10384
|
+
var Class = {
|
|
10385
|
+
};
|
|
10386
|
+
var Enum = {};
|
|
10387
|
+
if (typeof document != "undefined") js.Lib.document = document;
|
|
10388
|
+
if (typeof window != "undefined") {
|
|
10389
|
+
js.Lib.window = window;
|
|
10390
|
+
js.Lib.window.onerror = function(msg, url, line) {
|
|
10391
|
+
var f = js.Lib.onerror;
|
|
10392
|
+
if (f == null) return false;
|
|
10393
|
+
return f(msg, [
|
|
10394
|
+
url + ":" + line
|
|
10395
|
+
]);
|
|
10396
|
+
};
|
|
10397
|
+
}
|
|
10398
|
+
com.wiris.js.JsPluginTools.main();
|
|
10399
|
+
delete Array.prototype.__class__;
|
|
10400
|
+
})();
|
|
10401
|
+
(function() {
|
|
10402
|
+
var HxOverrides = function() {};
|
|
10403
|
+
HxOverrides.__name__ = true;
|
|
10404
|
+
HxOverrides.dateStr = function(date) {
|
|
10405
|
+
var m = date.getMonth() + 1;
|
|
10406
|
+
var d = date.getDate();
|
|
10407
|
+
var h = date.getHours();
|
|
10408
|
+
var mi = date.getMinutes();
|
|
10409
|
+
var s = date.getSeconds();
|
|
10410
|
+
return date.getFullYear() + "-" + (m < 10 ? "0" + m : "" + m) + "-" + (d < 10 ? "0" + d : "" + d) + " " + (h < 10 ? "0" + h : "" + h) + ":" + (mi < 10 ? "0" + mi : "" + mi) + ":" + (s < 10 ? "0" + s : "" + s);
|
|
10411
|
+
};
|
|
10412
|
+
HxOverrides.strDate = function(s) {
|
|
10413
|
+
switch(s.length){
|
|
10414
|
+
case 8:
|
|
10415
|
+
var k = s.split(":");
|
|
10416
|
+
var d = new Date();
|
|
10417
|
+
d.setTime(0);
|
|
10418
|
+
d.setUTCHours(k[0]);
|
|
10419
|
+
d.setUTCMinutes(k[1]);
|
|
10420
|
+
d.setUTCSeconds(k[2]);
|
|
10421
|
+
return d;
|
|
10422
|
+
case 10:
|
|
10423
|
+
var k = s.split("-");
|
|
10424
|
+
return new Date(k[0], k[1] - 1, k[2], 0, 0, 0);
|
|
10425
|
+
case 19:
|
|
10426
|
+
var k = s.split(" ");
|
|
10427
|
+
var y = k[0].split("-");
|
|
10428
|
+
var t = k[1].split(":");
|
|
10429
|
+
return new Date(y[0], y[1] - 1, y[2], t[0], t[1], t[2]);
|
|
10430
|
+
default:
|
|
10431
|
+
throw "Invalid date format : " + s;
|
|
10432
|
+
}
|
|
10433
|
+
};
|
|
10434
|
+
HxOverrides.cca = function(s, index) {
|
|
10435
|
+
var x = s.charCodeAt(index);
|
|
10436
|
+
if (x != x) return undefined;
|
|
10437
|
+
return x;
|
|
10438
|
+
};
|
|
10439
|
+
HxOverrides.substr = function(s, pos, len) {
|
|
10440
|
+
if (pos != null && pos != 0 && len != null && len < 0) return "";
|
|
10441
|
+
if (len == null) len = s.length;
|
|
10442
|
+
if (pos < 0) {
|
|
10443
|
+
pos = s.length + pos;
|
|
10444
|
+
if (pos < 0) pos = 0;
|
|
10445
|
+
} else if (len < 0) len = s.length + len - pos;
|
|
10446
|
+
return s.substr(pos, len);
|
|
10447
|
+
};
|
|
10448
|
+
HxOverrides.remove = function(a, obj) {
|
|
10449
|
+
var i = 0;
|
|
10450
|
+
var l = a.length;
|
|
10451
|
+
while(i < l){
|
|
10452
|
+
if (a[i] == obj) {
|
|
10453
|
+
a.splice(i, 1);
|
|
10454
|
+
return true;
|
|
10455
|
+
}
|
|
10456
|
+
i++;
|
|
10457
|
+
}
|
|
10458
|
+
return false;
|
|
10459
|
+
};
|
|
10460
|
+
HxOverrides.iter = function(a) {
|
|
10461
|
+
return {
|
|
10462
|
+
cur: 0,
|
|
10463
|
+
arr: a,
|
|
10464
|
+
hasNext: function() {
|
|
10465
|
+
return this.cur < this.arr.length;
|
|
10466
|
+
},
|
|
10467
|
+
next: function() {
|
|
10468
|
+
return this.arr[this.cur++];
|
|
10469
|
+
}
|
|
10470
|
+
};
|
|
10471
|
+
};
|
|
10472
|
+
var IntIter = function(min, max) {
|
|
10473
|
+
this.min = min;
|
|
10474
|
+
this.max = max;
|
|
10475
|
+
};
|
|
10476
|
+
IntIter.__name__ = true;
|
|
10477
|
+
IntIter.prototype = {
|
|
10478
|
+
next: function() {
|
|
10479
|
+
return this.min++;
|
|
10480
|
+
},
|
|
10481
|
+
hasNext: function() {
|
|
10482
|
+
return this.min < this.max;
|
|
10483
|
+
},
|
|
10484
|
+
__class__: IntIter
|
|
10485
|
+
};
|
|
10486
|
+
var Std = function() {};
|
|
10487
|
+
Std.__name__ = true;
|
|
10488
|
+
Std["is"] = function(v, t) {
|
|
10489
|
+
return js.Boot.__instanceof(v, t);
|
|
10490
|
+
};
|
|
10491
|
+
Std.string = function(s) {
|
|
10492
|
+
return js.Boot.__string_rec(s, "");
|
|
10493
|
+
};
|
|
10494
|
+
Std["int"] = function(x) {
|
|
10495
|
+
return x | 0;
|
|
10496
|
+
};
|
|
10497
|
+
Std.parseInt = function(x) {
|
|
10498
|
+
var v = parseInt(x, 10);
|
|
10499
|
+
if (v == 0 && (HxOverrides.cca(x, 1) == 120 || HxOverrides.cca(x, 1) == 88)) v = parseInt(x);
|
|
10500
|
+
if (isNaN(v)) return null;
|
|
10501
|
+
return v;
|
|
10502
|
+
};
|
|
10503
|
+
Std.parseFloat = function(x) {
|
|
10504
|
+
return parseFloat(x);
|
|
10505
|
+
};
|
|
10506
|
+
Std.random = function(x) {
|
|
10507
|
+
return Math.floor(Math.random() * x);
|
|
10508
|
+
};
|
|
10509
|
+
var com = com || {};
|
|
10510
|
+
if (!com.wiris) com.wiris = {};
|
|
10511
|
+
if (!com.wiris.js) com.wiris.js = {};
|
|
10512
|
+
com.wiris.js.JsPluginTools = function() {
|
|
10513
|
+
this.tryReady();
|
|
10514
|
+
};
|
|
10515
|
+
com.wiris.js.JsPluginTools.__name__ = true;
|
|
10516
|
+
com.wiris.js.JsPluginTools.main = function() {
|
|
10517
|
+
var ev;
|
|
10518
|
+
ev = com.wiris.js.JsPluginTools.getInstance();
|
|
10519
|
+
haxe.Timer.delay($bind(ev, ev.tryReady), 100);
|
|
10520
|
+
};
|
|
10521
|
+
com.wiris.js.JsPluginTools.getInstance = function() {
|
|
10522
|
+
if (com.wiris.js.JsPluginTools.instance == null) com.wiris.js.JsPluginTools.instance = new com.wiris.js.JsPluginTools();
|
|
10523
|
+
return com.wiris.js.JsPluginTools.instance;
|
|
10524
|
+
};
|
|
10525
|
+
com.wiris.js.JsPluginTools.bypassEncapsulation = function() {
|
|
10526
|
+
if (window.com == null) window.com = {};
|
|
10527
|
+
if (window.com.wiris == null) window.com.wiris = {};
|
|
10528
|
+
if (window.com.wiris.js == null) window.com.wiris.js = {};
|
|
10529
|
+
if (window.com.wiris.js.JsPluginTools == null) window.com.wiris.js.JsPluginTools = com.wiris.js.JsPluginTools.getInstance();
|
|
10530
|
+
};
|
|
10531
|
+
com.wiris.js.JsPluginTools.prototype = {
|
|
10532
|
+
md5encode: function(content) {
|
|
10533
|
+
return haxe.Md5.encode(content);
|
|
10534
|
+
},
|
|
10535
|
+
doLoad: function() {
|
|
10536
|
+
this.ready = true;
|
|
10537
|
+
com.wiris.js.JsPluginTools.instance = this;
|
|
10538
|
+
com.wiris.js.JsPluginTools.bypassEncapsulation();
|
|
10539
|
+
},
|
|
10540
|
+
tryReady: function() {
|
|
10541
|
+
this.ready = false;
|
|
10542
|
+
if (js.Lib.document.readyState) {
|
|
10543
|
+
this.doLoad();
|
|
10544
|
+
this.ready = true;
|
|
10545
|
+
}
|
|
10546
|
+
if (!this.ready) haxe.Timer.delay($bind(this, this.tryReady), 100);
|
|
10547
|
+
},
|
|
10548
|
+
__class__: com.wiris.js.JsPluginTools
|
|
10549
|
+
};
|
|
10550
|
+
var haxe = haxe || {};
|
|
10551
|
+
haxe.Log = function() {};
|
|
10552
|
+
haxe.Log.__name__ = true;
|
|
10553
|
+
haxe.Log.trace = function(v, infos) {
|
|
10554
|
+
js.Boot.__trace(v, infos);
|
|
10555
|
+
};
|
|
10556
|
+
haxe.Log.clear = function() {
|
|
10557
|
+
js.Boot.__clear_trace();
|
|
10558
|
+
};
|
|
10559
|
+
haxe.Md5 = function() {};
|
|
10560
|
+
haxe.Md5.__name__ = true;
|
|
10561
|
+
haxe.Md5.encode = function(s) {
|
|
10562
|
+
return new haxe.Md5().doEncode(s);
|
|
10563
|
+
};
|
|
10564
|
+
haxe.Md5.prototype = {
|
|
10565
|
+
doEncode: function(str) {
|
|
10566
|
+
var x = this.str2blks(str);
|
|
10567
|
+
var a = 1732584193;
|
|
10568
|
+
var b = -271733879;
|
|
10569
|
+
var c = -1732584194;
|
|
10570
|
+
var d = 271733878;
|
|
10571
|
+
var i = 0;
|
|
10572
|
+
while(i < x.length){
|
|
10573
|
+
var olda = a;
|
|
10574
|
+
var oldb = b;
|
|
10575
|
+
var oldc = c;
|
|
10576
|
+
var oldd = d;
|
|
10577
|
+
a = this.ff(a, b, c, d, x[i], 7, -680876936);
|
|
10578
|
+
d = this.ff(d, a, b, c, x[i + 1], 12, -389564586);
|
|
10579
|
+
c = this.ff(c, d, a, b, x[i + 2], 17, 606105819);
|
|
10580
|
+
b = this.ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
|
10581
|
+
a = this.ff(a, b, c, d, x[i + 4], 7, -176418897);
|
|
10582
|
+
d = this.ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
|
10583
|
+
c = this.ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
|
10584
|
+
b = this.ff(b, c, d, a, x[i + 7], 22, -45705983);
|
|
10585
|
+
a = this.ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
|
10586
|
+
d = this.ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
|
10587
|
+
c = this.ff(c, d, a, b, x[i + 10], 17, -42063);
|
|
10588
|
+
b = this.ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
|
10589
|
+
a = this.ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
|
10590
|
+
d = this.ff(d, a, b, c, x[i + 13], 12, -40341101);
|
|
10591
|
+
c = this.ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
|
10592
|
+
b = this.ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
|
10593
|
+
a = this.gg(a, b, c, d, x[i + 1], 5, -165796510);
|
|
10594
|
+
d = this.gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
|
10595
|
+
c = this.gg(c, d, a, b, x[i + 11], 14, 643717713);
|
|
10596
|
+
b = this.gg(b, c, d, a, x[i], 20, -373897302);
|
|
10597
|
+
a = this.gg(a, b, c, d, x[i + 5], 5, -701558691);
|
|
10598
|
+
d = this.gg(d, a, b, c, x[i + 10], 9, 38016083);
|
|
10599
|
+
c = this.gg(c, d, a, b, x[i + 15], 14, -660478335);
|
|
10600
|
+
b = this.gg(b, c, d, a, x[i + 4], 20, -405537848);
|
|
10601
|
+
a = this.gg(a, b, c, d, x[i + 9], 5, 568446438);
|
|
10602
|
+
d = this.gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
|
10603
|
+
c = this.gg(c, d, a, b, x[i + 3], 14, -187363961);
|
|
10604
|
+
b = this.gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
|
10605
|
+
a = this.gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
|
10606
|
+
d = this.gg(d, a, b, c, x[i + 2], 9, -51403784);
|
|
10607
|
+
c = this.gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
|
10608
|
+
b = this.gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
|
10609
|
+
a = this.hh(a, b, c, d, x[i + 5], 4, -378558);
|
|
10610
|
+
d = this.hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
|
10611
|
+
c = this.hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
|
10612
|
+
b = this.hh(b, c, d, a, x[i + 14], 23, -35309556);
|
|
10613
|
+
a = this.hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
|
10614
|
+
d = this.hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
|
10615
|
+
c = this.hh(c, d, a, b, x[i + 7], 16, -155497632);
|
|
10616
|
+
b = this.hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
|
10617
|
+
a = this.hh(a, b, c, d, x[i + 13], 4, 681279174);
|
|
10618
|
+
d = this.hh(d, a, b, c, x[i], 11, -358537222);
|
|
10619
|
+
c = this.hh(c, d, a, b, x[i + 3], 16, -722521979);
|
|
10620
|
+
b = this.hh(b, c, d, a, x[i + 6], 23, 76029189);
|
|
10621
|
+
a = this.hh(a, b, c, d, x[i + 9], 4, -640364487);
|
|
10622
|
+
d = this.hh(d, a, b, c, x[i + 12], 11, -421815835);
|
|
10623
|
+
c = this.hh(c, d, a, b, x[i + 15], 16, 530742520);
|
|
10624
|
+
b = this.hh(b, c, d, a, x[i + 2], 23, -995338651);
|
|
10625
|
+
a = this.ii(a, b, c, d, x[i], 6, -198630844);
|
|
10626
|
+
d = this.ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
|
10627
|
+
c = this.ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
|
10628
|
+
b = this.ii(b, c, d, a, x[i + 5], 21, -57434055);
|
|
10629
|
+
a = this.ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
|
10630
|
+
d = this.ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
|
10631
|
+
c = this.ii(c, d, a, b, x[i + 10], 15, -1051523);
|
|
10632
|
+
b = this.ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
|
10633
|
+
a = this.ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
|
10634
|
+
d = this.ii(d, a, b, c, x[i + 15], 10, -30611744);
|
|
10635
|
+
c = this.ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
|
10636
|
+
b = this.ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
|
10637
|
+
a = this.ii(a, b, c, d, x[i + 4], 6, -145523070);
|
|
10638
|
+
d = this.ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
|
10639
|
+
c = this.ii(c, d, a, b, x[i + 2], 15, 718787259);
|
|
10640
|
+
b = this.ii(b, c, d, a, x[i + 9], 21, -343485551);
|
|
10641
|
+
a = this.addme(a, olda);
|
|
10642
|
+
b = this.addme(b, oldb);
|
|
10643
|
+
c = this.addme(c, oldc);
|
|
10644
|
+
d = this.addme(d, oldd);
|
|
10645
|
+
i += 16;
|
|
10646
|
+
}
|
|
10647
|
+
return this.rhex(a) + this.rhex(b) + this.rhex(c) + this.rhex(d);
|
|
10648
|
+
},
|
|
10649
|
+
ii: function(a, b, c, d, x, s, t) {
|
|
10650
|
+
return this.cmn(this.bitXOR(c, this.bitOR(b, ~d)), a, b, x, s, t);
|
|
10651
|
+
},
|
|
10652
|
+
hh: function(a, b, c, d, x, s, t) {
|
|
10653
|
+
return this.cmn(this.bitXOR(this.bitXOR(b, c), d), a, b, x, s, t);
|
|
10654
|
+
},
|
|
10655
|
+
gg: function(a, b, c, d, x, s, t) {
|
|
10656
|
+
return this.cmn(this.bitOR(this.bitAND(b, d), this.bitAND(c, ~d)), a, b, x, s, t);
|
|
10657
|
+
},
|
|
10658
|
+
ff: function(a, b, c, d, x, s, t) {
|
|
10659
|
+
return this.cmn(this.bitOR(this.bitAND(b, c), this.bitAND(~b, d)), a, b, x, s, t);
|
|
10660
|
+
},
|
|
10661
|
+
cmn: function(q, a, b, x, s, t) {
|
|
10662
|
+
return this.addme(this.rol(this.addme(this.addme(a, q), this.addme(x, t)), s), b);
|
|
10663
|
+
},
|
|
10664
|
+
rol: function(num, cnt) {
|
|
10665
|
+
return num << cnt | num >>> 32 - cnt;
|
|
10666
|
+
},
|
|
10667
|
+
str2blks: function(str) {
|
|
10668
|
+
var nblk = (str.length + 8 >> 6) + 1;
|
|
10669
|
+
var blks = new Array();
|
|
10670
|
+
var _g1 = 0, _g = nblk * 16;
|
|
10671
|
+
while(_g1 < _g){
|
|
10672
|
+
var i = _g1++;
|
|
10673
|
+
blks[i] = 0;
|
|
10674
|
+
}
|
|
10675
|
+
var i = 0;
|
|
10676
|
+
while(i < str.length){
|
|
10677
|
+
blks[i >> 2] |= HxOverrides.cca(str, i) << (str.length * 8 + i) % 4 * 8;
|
|
10678
|
+
i++;
|
|
10679
|
+
}
|
|
10680
|
+
blks[i >> 2] |= 128 << (str.length * 8 + i) % 4 * 8;
|
|
10681
|
+
var l = str.length * 8;
|
|
10682
|
+
var k = nblk * 16 - 2;
|
|
10683
|
+
blks[k] = l & 255;
|
|
10684
|
+
blks[k] |= (l >>> 8 & 255) << 8;
|
|
10685
|
+
blks[k] |= (l >>> 16 & 255) << 16;
|
|
10686
|
+
blks[k] |= (l >>> 24 & 255) << 24;
|
|
10687
|
+
return blks;
|
|
10688
|
+
},
|
|
10689
|
+
rhex: function(num) {
|
|
10690
|
+
var str = "";
|
|
10691
|
+
var hex_chr = "0123456789abcdef";
|
|
10692
|
+
var _g = 0;
|
|
10693
|
+
while(_g < 4){
|
|
10694
|
+
var j = _g++;
|
|
10695
|
+
str += hex_chr.charAt(num >> j * 8 + 4 & 15) + hex_chr.charAt(num >> j * 8 & 15);
|
|
10696
|
+
}
|
|
10697
|
+
return str;
|
|
10698
|
+
},
|
|
10699
|
+
addme: function(x, y) {
|
|
10700
|
+
var lsw = (x & 65535) + (y & 65535);
|
|
10701
|
+
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
|
10702
|
+
return msw << 16 | lsw & 65535;
|
|
10703
|
+
},
|
|
10704
|
+
bitAND: function(a, b) {
|
|
10705
|
+
var lsb = a & 1 & (b & 1);
|
|
10706
|
+
var msb31 = a >>> 1 & b >>> 1;
|
|
10707
|
+
return msb31 << 1 | lsb;
|
|
10708
|
+
},
|
|
10709
|
+
bitXOR: function(a, b) {
|
|
10710
|
+
var lsb = a & 1 ^ b & 1;
|
|
10711
|
+
var msb31 = a >>> 1 ^ b >>> 1;
|
|
10712
|
+
return msb31 << 1 | lsb;
|
|
10713
|
+
},
|
|
10714
|
+
bitOR: function(a, b) {
|
|
10715
|
+
var lsb = a & 1 | b & 1;
|
|
10716
|
+
var msb31 = a >>> 1 | b >>> 1;
|
|
10717
|
+
return msb31 << 1 | lsb;
|
|
10718
|
+
},
|
|
10719
|
+
__class__: haxe.Md5
|
|
10720
|
+
};
|
|
10721
|
+
haxe.Timer = function(time_ms) {
|
|
10722
|
+
var me = this;
|
|
10723
|
+
this.id = window.setInterval(function() {
|
|
10724
|
+
me.run();
|
|
10725
|
+
}, time_ms);
|
|
10726
|
+
};
|
|
10727
|
+
haxe.Timer.__name__ = true;
|
|
10728
|
+
haxe.Timer.delay = function(f, time_ms) {
|
|
10729
|
+
var t = new haxe.Timer(time_ms);
|
|
10730
|
+
t.run = function() {
|
|
10731
|
+
t.stop();
|
|
10732
|
+
f();
|
|
10733
|
+
};
|
|
10734
|
+
return t;
|
|
10735
|
+
};
|
|
10736
|
+
haxe.Timer.measure = function(f, pos) {
|
|
10737
|
+
var t0 = haxe.Timer.stamp();
|
|
10738
|
+
var r = f();
|
|
10739
|
+
haxe.Log.trace(haxe.Timer.stamp() - t0 + "s", pos);
|
|
10740
|
+
return r;
|
|
10741
|
+
};
|
|
10742
|
+
haxe.Timer.stamp = function() {
|
|
10743
|
+
return new Date().getTime() / 1000;
|
|
10744
|
+
};
|
|
10745
|
+
haxe.Timer.prototype = {
|
|
10746
|
+
run: function() {},
|
|
10747
|
+
stop: function() {
|
|
10748
|
+
if (this.id == null) return;
|
|
10749
|
+
window.clearInterval(this.id);
|
|
10750
|
+
this.id = null;
|
|
10751
|
+
},
|
|
10752
|
+
__class__: haxe.Timer
|
|
10753
|
+
};
|
|
10754
|
+
var js = js || {};
|
|
10755
|
+
js.Boot = function() {};
|
|
10756
|
+
js.Boot.__name__ = true;
|
|
10757
|
+
js.Boot.__unhtml = function(s) {
|
|
10758
|
+
return s.split("&").join("&").split("<").join("<").split(">").join(">");
|
|
10759
|
+
};
|
|
10760
|
+
js.Boot.__trace = function(v, i) {
|
|
10761
|
+
var msg = i != null ? i.fileName + ":" + i.lineNumber + ": " : "";
|
|
10762
|
+
msg += js.Boot.__string_rec(v, "");
|
|
10763
|
+
var d;
|
|
10764
|
+
if (typeof document != "undefined" && (d = document.getElementById("haxe:trace")) != null) d.innerHTML += js.Boot.__unhtml(msg) + "<br/>";
|
|
10765
|
+
else if (typeof console != "undefined" && console.log != null) console.log(msg);
|
|
10766
|
+
};
|
|
10767
|
+
js.Boot.__clear_trace = function() {
|
|
10768
|
+
var d = document.getElementById("haxe:trace");
|
|
10769
|
+
if (d != null) d.innerHTML = "";
|
|
10770
|
+
};
|
|
10771
|
+
js.Boot.isClass = function(o) {
|
|
10772
|
+
return o.__name__;
|
|
10773
|
+
};
|
|
10774
|
+
js.Boot.isEnum = function(e) {
|
|
10775
|
+
return e.__ename__;
|
|
10776
|
+
};
|
|
10777
|
+
js.Boot.getClass = function(o) {
|
|
10778
|
+
return o.__class__;
|
|
10779
|
+
};
|
|
10780
|
+
js.Boot.__string_rec = function(o, s) {
|
|
10781
|
+
if (o == null) return "null";
|
|
10782
|
+
if (s.length >= 5) return "<...>";
|
|
10783
|
+
var t = typeof o;
|
|
10784
|
+
if (t == "function" && (o.__name__ || o.__ename__)) t = "object";
|
|
10785
|
+
switch(t){
|
|
10786
|
+
case "object":
|
|
10787
|
+
if (o instanceof Array) {
|
|
10788
|
+
if (o.__enum__) {
|
|
10789
|
+
if (o.length == 2) return o[0];
|
|
10790
|
+
var str = o[0] + "(";
|
|
10791
|
+
s += "\t";
|
|
10792
|
+
var _g1 = 2, _g = o.length;
|
|
10793
|
+
while(_g1 < _g){
|
|
10794
|
+
var i = _g1++;
|
|
10795
|
+
if (i != 2) str += "," + js.Boot.__string_rec(o[i], s);
|
|
10796
|
+
else str += js.Boot.__string_rec(o[i], s);
|
|
10797
|
+
}
|
|
10798
|
+
return str + ")";
|
|
10799
|
+
}
|
|
10800
|
+
var l = o.length;
|
|
10801
|
+
var i;
|
|
10802
|
+
var str = "[";
|
|
10803
|
+
s += "\t";
|
|
10804
|
+
var _g = 0;
|
|
10805
|
+
while(_g < l){
|
|
10806
|
+
var i1 = _g++;
|
|
10807
|
+
str += (i1 > 0 ? "," : "") + js.Boot.__string_rec(o[i1], s);
|
|
10808
|
+
}
|
|
10809
|
+
str += "]";
|
|
10810
|
+
return str;
|
|
10811
|
+
}
|
|
10812
|
+
var tostr;
|
|
10813
|
+
try {
|
|
10814
|
+
tostr = o.toString;
|
|
10815
|
+
} catch (e) {
|
|
10816
|
+
return "???";
|
|
10817
|
+
}
|
|
10818
|
+
if (tostr != null && tostr != Object.toString) {
|
|
10819
|
+
var s2 = o.toString();
|
|
10820
|
+
if (s2 != "[object Object]") return s2;
|
|
10821
|
+
}
|
|
10822
|
+
var k = null;
|
|
10823
|
+
var str = "{\n";
|
|
10824
|
+
s += "\t";
|
|
10825
|
+
var hasp = o.hasOwnProperty != null;
|
|
10826
|
+
for(var k in o){
|
|
10827
|
+
if (hasp && !o.hasOwnProperty(k)) {
|
|
10828
|
+
continue;
|
|
10829
|
+
}
|
|
10830
|
+
if (k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
|
|
10831
|
+
continue;
|
|
10832
|
+
}
|
|
10833
|
+
if (str.length != 2) str += ", \n";
|
|
10834
|
+
str += s + k + " : " + js.Boot.__string_rec(o[k], s);
|
|
10835
|
+
}
|
|
10836
|
+
s = s.substring(1);
|
|
10837
|
+
str += "\n" + s + "}";
|
|
10838
|
+
return str;
|
|
10839
|
+
case "function":
|
|
10840
|
+
return "<function>";
|
|
10841
|
+
case "string":
|
|
10842
|
+
return o;
|
|
10843
|
+
default:
|
|
10844
|
+
return String(o);
|
|
10845
|
+
}
|
|
10846
|
+
};
|
|
10847
|
+
js.Boot.__interfLoop = function(cc, cl) {
|
|
10848
|
+
if (cc == null) return false;
|
|
10849
|
+
if (cc == cl) return true;
|
|
10850
|
+
var intf = cc.__interfaces__;
|
|
10851
|
+
if (intf != null) {
|
|
10852
|
+
var _g1 = 0, _g = intf.length;
|
|
10853
|
+
while(_g1 < _g){
|
|
10854
|
+
var i = _g1++;
|
|
10855
|
+
var i1 = intf[i];
|
|
10856
|
+
if (i1 == cl || js.Boot.__interfLoop(i1, cl)) return true;
|
|
10857
|
+
}
|
|
10858
|
+
}
|
|
10859
|
+
return js.Boot.__interfLoop(cc.__super__, cl);
|
|
10860
|
+
};
|
|
10861
|
+
js.Boot.__instanceof = function(o, cl) {
|
|
10862
|
+
try {
|
|
10863
|
+
if (o instanceof cl) {
|
|
10864
|
+
if (cl == Array) return o.__enum__ == null;
|
|
10865
|
+
return true;
|
|
10866
|
+
}
|
|
10867
|
+
if (js.Boot.__interfLoop(o.__class__, cl)) return true;
|
|
10868
|
+
} catch (e) {
|
|
10869
|
+
if (cl == null) return false;
|
|
10870
|
+
}
|
|
10871
|
+
switch(cl){
|
|
10872
|
+
case Int:
|
|
10873
|
+
return Math.ceil(o % 2147483648.0) === o;
|
|
10874
|
+
case Float:
|
|
10875
|
+
return typeof o == "number";
|
|
10876
|
+
case Bool:
|
|
10877
|
+
return o === true || o === false;
|
|
10878
|
+
case String:
|
|
10879
|
+
return typeof o == "string";
|
|
10880
|
+
case Dynamic:
|
|
10881
|
+
return true;
|
|
10882
|
+
default:
|
|
10883
|
+
if (o == null) return false;
|
|
10884
|
+
if (cl == Class && o.__name__ != null) return true;
|
|
10885
|
+
if (cl == Enum && o.__ename__ != null) return true;
|
|
10886
|
+
return o.__enum__ == cl;
|
|
10887
|
+
}
|
|
10888
|
+
};
|
|
10889
|
+
js.Boot.__cast = function(o, t) {
|
|
10890
|
+
if (js.Boot.__instanceof(o, t)) return o;
|
|
10891
|
+
else throw "Cannot cast " + Std.string(o) + " to " + Std.string(t);
|
|
10892
|
+
};
|
|
10893
|
+
js.Lib = function() {};
|
|
10894
|
+
js.Lib.__name__ = true;
|
|
10895
|
+
js.Lib.debug = function() {
|
|
10896
|
+
debugger;
|
|
10897
|
+
};
|
|
10898
|
+
js.Lib.alert = function(v) {
|
|
10899
|
+
alert(js.Boot.__string_rec(v, ""));
|
|
10900
|
+
};
|
|
10901
|
+
js.Lib.eval = function(code) {
|
|
10902
|
+
return eval(code);
|
|
10903
|
+
};
|
|
10904
|
+
js.Lib.setErrorHandler = function(f) {
|
|
10905
|
+
js.Lib.onerror = f;
|
|
10906
|
+
};
|
|
10907
|
+
function $bind(o, m) {
|
|
10908
|
+
var f = function() {
|
|
10909
|
+
return f.method.apply(f.scope, arguments);
|
|
10910
|
+
};
|
|
10911
|
+
f.scope = o;
|
|
10912
|
+
f.method = m;
|
|
10913
|
+
return f;
|
|
10914
|
+
}
|
|
10915
|
+
if (Array.prototype.indexOf) HxOverrides.remove = function(a, o) {
|
|
10916
|
+
var i = a.indexOf(o);
|
|
10917
|
+
if (i == -1) return false;
|
|
10918
|
+
a.splice(i, 1);
|
|
10919
|
+
return true;
|
|
10920
|
+
};
|
|
10921
|
+
Math.__name__ = [
|
|
10922
|
+
"Math"
|
|
10923
|
+
];
|
|
10924
|
+
Math.NaN = Number.NaN;
|
|
10925
|
+
Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
|
|
10926
|
+
Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
|
10927
|
+
Math.isFinite = function(i) {
|
|
10928
|
+
return isFinite(i);
|
|
10929
|
+
};
|
|
10930
|
+
Math.isNaN = function(i) {
|
|
10931
|
+
return isNaN(i);
|
|
10932
|
+
};
|
|
10933
|
+
String.prototype.__class__ = String;
|
|
10934
|
+
String.__name__ = true;
|
|
10935
|
+
Array.prototype.__class__ = Array;
|
|
10936
|
+
Array.__name__ = true;
|
|
10937
|
+
Date.prototype.__class__ = Date;
|
|
10938
|
+
Date.__name__ = [
|
|
10939
|
+
"Date"
|
|
10940
|
+
];
|
|
10941
|
+
var Int = {
|
|
10942
|
+
};
|
|
10943
|
+
var Dynamic = {
|
|
10944
|
+
};
|
|
10945
|
+
var Float = Number;
|
|
10946
|
+
Float.__name__ = [
|
|
10947
|
+
"Float"
|
|
10948
|
+
];
|
|
10949
|
+
var Bool = Boolean;
|
|
10950
|
+
Bool.__ename__ = [
|
|
10951
|
+
"Bool"
|
|
10952
|
+
];
|
|
10953
|
+
var Class = {
|
|
10954
|
+
};
|
|
10955
|
+
var Enum = {};
|
|
10956
|
+
if (typeof document != "undefined") js.Lib.document = document;
|
|
10957
|
+
if (typeof window != "undefined") {
|
|
10958
|
+
js.Lib.window = window;
|
|
10959
|
+
js.Lib.window.onerror = function(msg, url, line) {
|
|
10960
|
+
var f = js.Lib.onerror;
|
|
10961
|
+
if (f == null) return false;
|
|
10962
|
+
return f(msg, [
|
|
10963
|
+
url + ":" + line
|
|
10964
|
+
]);
|
|
10965
|
+
};
|
|
10966
|
+
}
|
|
10967
|
+
com.wiris.js.JsPluginTools.main();
|
|
10968
|
+
})();
|
|
10969
|
+
delete Array.prototype.__class__; // @codingStandardsIgnoreEnd
|
|
10970
|
+
|
|
9828
10971
|
/**
|
|
9829
10972
|
* This class represents the MathType integration for CKEditor5.
|
|
9830
10973
|
* @extends {IntegrationModel}
|
|
@@ -10029,15 +11172,15 @@ IntegrationModel.prototype.getSelectedItem = undefined;
|
|
|
10029
11172
|
// When Latex is next to image/formula.
|
|
10030
11173
|
if (latexRange.startContainer.nodeType === 3 && latexRange.startContainer.previousSibling?.nodeType === 1) {
|
|
10031
11174
|
// Get the position of the latex to be replaced.
|
|
10032
|
-
|
|
11175
|
+
const latexEdited = `$$${Latex.getLatexFromMathML(MathML.safeXmlDecode(this.core.editionProperties.temporalImage.dataset.mathml))}$$`;
|
|
10033
11176
|
let data = latexRange.startContainer.data;
|
|
10034
11177
|
// Remove invisible characters.
|
|
10035
11178
|
data = data.replaceAll(String.fromCharCode(8288), "");
|
|
10036
11179
|
// Get to the start of the latex we are editing.
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
11180
|
+
const offset = data.indexOf(latexEdited);
|
|
11181
|
+
const dataOffset = data.substring(offset);
|
|
11182
|
+
const second$ = dataOffset.substring(2).indexOf("$$") + 4;
|
|
11183
|
+
const substring = dataOffset.substr(0, second$);
|
|
10041
11184
|
data = data.replace(substring, "");
|
|
10042
11185
|
if (!data) {
|
|
10043
11186
|
startPosition = writer.createPositionBefore(startNode);
|
|
@@ -10063,7 +11206,7 @@ IntegrationModel.prototype.getSelectedItem = undefined;
|
|
|
10063
11206
|
}
|
|
10064
11207
|
}
|
|
10065
11208
|
// Build the telemeter payload separated to delete null/undefined entries.
|
|
10066
|
-
|
|
11209
|
+
const payload = {
|
|
10067
11210
|
mathml_origin: mathmlOrigin ? MathML.safeXmlDecode(mathmlOrigin) : mathmlOrigin,
|
|
10068
11211
|
mathml: mathml ? MathML.safeXmlDecode(mathml) : mathml,
|
|
10069
11212
|
elapsed_time: Date.now() - this.core.editionProperties.editionStartTime,
|
|
@@ -10169,82 +11312,9 @@ var mathIcon = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adob
|
|
|
10169
11312
|
|
|
10170
11313
|
var chemIcon = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Generator: Adobe Illustrator 22.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 40.3 49.5\" style=\"enable-background:new 0 0 40.3 49.5;\" xml:space=\"preserve\">\n<style type=\"text/css\">\n\t.st0{fill:#A4CF61;}\n</style>\n<path class=\"st0\" d=\"M39.2,12.1c0-1.9-1.1-3.6-2.7-4.4L24.5,0.9l0,0c-0.7-0.4-1.5-0.6-2.4-0.6c-0.9,0-1.7,0.2-2.4,0.6l0,0L2.3,10.8\n\tl0,0C0.9,11.7,0,13.2,0,14.9h0v19.6h0c0,1.7,0.9,3.3,2.3,4.1l0,0l17.4,9.9l0,0c0.7,0.4,1.5,0.6,2.4,0.6c0.9,0,1.7-0.2,2.4-0.6l0,0\n\tl12.2-6.9h0c1.5-0.8,2.6-2.5,2.6-4.3c0-2.7-2.2-4.9-4.9-4.9c-0.9,0-1.8,0.3-2.5,0.7l0,0l-9.7,5.6l-12.3-7V17.8l12.3-7l9.9,5.7l0,0\n\tc0.7,0.4,1.5,0.6,2.4,0.6C37,17,39.2,14.8,39.2,12.1\"/>\n</svg>\n";
|
|
10171
11314
|
|
|
10172
|
-
var
|
|
10173
|
-
var version = "8.12.0";
|
|
10174
|
-
var description = "MathType Web for CKEditor5 editor";
|
|
10175
|
-
var keywords = [
|
|
10176
|
-
"chem",
|
|
10177
|
-
"chemistry",
|
|
10178
|
-
"chemtype",
|
|
10179
|
-
"ckeditor",
|
|
10180
|
-
"ckeditor5",
|
|
10181
|
-
"editor",
|
|
10182
|
-
"equation",
|
|
10183
|
-
"latex",
|
|
10184
|
-
"math",
|
|
10185
|
-
"mathml",
|
|
10186
|
-
"maths",
|
|
10187
|
-
"mathtype",
|
|
10188
|
-
"wiris"
|
|
10189
|
-
];
|
|
10190
|
-
var repository = "https://github.com/wiris/html-integrations/tree/master/packages/ckeditor5";
|
|
10191
|
-
var homepage = "https://www.wiris.com/";
|
|
10192
|
-
var bugs = {
|
|
10193
|
-
email: "support@wiris.com"
|
|
10194
|
-
};
|
|
10195
|
-
var license = "MIT";
|
|
10196
|
-
var author = "WIRIS Team (http://www.wiris.com)";
|
|
10197
|
-
var files = [
|
|
10198
|
-
"dist",
|
|
10199
|
-
"src",
|
|
10200
|
-
"icons",
|
|
10201
|
-
"theme",
|
|
10202
|
-
"lang"
|
|
10203
|
-
];
|
|
10204
|
-
var main = "src/plugin.js";
|
|
10205
|
-
var type = "module";
|
|
10206
|
-
var exports = {
|
|
10207
|
-
".": "./src/plugin.js",
|
|
10208
|
-
"./dist/*": "./dist/*",
|
|
10209
|
-
"./browser/*": null,
|
|
10210
|
-
"./src/*": "./src/*",
|
|
10211
|
-
"./theme/*": "./theme/*",
|
|
10212
|
-
"./package.json": "./package.json"
|
|
10213
|
-
};
|
|
10214
|
-
var scripts = {
|
|
10215
|
-
build: "node ./scripts/build-dist.mjs",
|
|
10216
|
-
"build:dist": "node ./scripts/build-dist.mjs",
|
|
10217
|
-
prepare: "npm run build:dist"
|
|
10218
|
-
};
|
|
10219
|
-
var dependencies = {
|
|
10220
|
-
"@wiris/mathtype-html-integration-devkit": "1.17.6"
|
|
10221
|
-
};
|
|
10222
|
-
var devDependencies = {
|
|
10223
|
-
"@ckeditor/ckeditor5-dev-build-tools": "^42.1.0",
|
|
10224
|
-
ckeditor5: ">=43.0.0"
|
|
10225
|
-
};
|
|
10226
|
-
var peerDependencies = {
|
|
10227
|
-
ckeditor5: ">=43.0.0"
|
|
10228
|
-
};
|
|
11315
|
+
var version = "8.13.1";
|
|
10229
11316
|
var packageInfo = {
|
|
10230
|
-
|
|
10231
|
-
version: version,
|
|
10232
|
-
description: description,
|
|
10233
|
-
keywords: keywords,
|
|
10234
|
-
repository: repository,
|
|
10235
|
-
homepage: homepage,
|
|
10236
|
-
bugs: bugs,
|
|
10237
|
-
license: license,
|
|
10238
|
-
author: author,
|
|
10239
|
-
files: files,
|
|
10240
|
-
main: main,
|
|
10241
|
-
type: type,
|
|
10242
|
-
exports: exports,
|
|
10243
|
-
scripts: scripts,
|
|
10244
|
-
dependencies: dependencies,
|
|
10245
|
-
devDependencies: devDependencies,
|
|
10246
|
-
peerDependencies: peerDependencies
|
|
10247
|
-
};
|
|
11317
|
+
version: version};
|
|
10248
11318
|
|
|
10249
11319
|
// CKEditor imports
|
|
10250
11320
|
let currentInstance = null; // eslint-disable-line import/no-mutable-exports
|
|
@@ -10276,7 +11346,7 @@ class MathType extends Plugin {
|
|
|
10276
11346
|
* Inherited from Plugin class: Executed when CKEditor5 is destroyed
|
|
10277
11347
|
*/ destroy() {
|
|
10278
11348
|
// eslint-disable-line class-methods-use-this
|
|
10279
|
-
currentInstance
|
|
11349
|
+
currentInstance?.destroy();
|
|
10280
11350
|
}
|
|
10281
11351
|
/**
|
|
10282
11352
|
* Create the MathType API Integration object
|
|
@@ -10482,7 +11552,7 @@ class MathType extends Plugin {
|
|
|
10482
11552
|
const mathAttributes = [
|
|
10483
11553
|
...viewItem.getAttributes()
|
|
10484
11554
|
].map(([key, value])=>` ${key}="${value}"`).join("");
|
|
10485
|
-
|
|
11555
|
+
const htmlContent = Util.htmlSanitize(`<img${mathAttributes}>`);
|
|
10486
11556
|
const modelNode = writer.createElement("mathml", {
|
|
10487
11557
|
htmlContent
|
|
10488
11558
|
});
|
|
@@ -10603,18 +11673,18 @@ class MathType extends Plugin {
|
|
|
10603
11673
|
function createDataString(modelItem, { writer: viewWriter }) {
|
|
10604
11674
|
const htmlDataProcessor = new HtmlDataProcessor(viewWriter.document);
|
|
10605
11675
|
// Load img element
|
|
10606
|
-
|
|
11676
|
+
const mathString = modelItem.getAttribute("htmlContent") || Parser.endParseSaveMode(modelItem.getAttribute("formula"));
|
|
10607
11677
|
const sourceMathElement = htmlDataProcessor.toView(mathString).getChild(0);
|
|
10608
11678
|
return clone(viewWriter, sourceMathElement);
|
|
10609
11679
|
}
|
|
10610
11680
|
// This stops the view selection getting into the <span>s and messing up caret movement
|
|
10611
11681
|
editor.editing.mapper.on("viewToModelPosition", viewToModelPositionOutsideModelElement(editor.model, (viewElement)=>viewElement.hasClass("ck-math-widget")));
|
|
10612
11682
|
// Keep a reference to the original get and set function.
|
|
10613
|
-
editor.data;
|
|
11683
|
+
const { get, set } = editor.data;
|
|
10614
11684
|
/**
|
|
10615
11685
|
* Hack to transform $$latex$$ into <math> in editor.getData()'s output.
|
|
10616
11686
|
*/ editor.data.on("get", (e)=>{
|
|
10617
|
-
|
|
11687
|
+
const output = e.return;
|
|
10618
11688
|
const parsedResult = Parser.endParse(output);
|
|
10619
11689
|
// Cleans all the semantics tag for safexml
|
|
10620
11690
|
// including the handwritten data points
|
|
@@ -10639,14 +11709,14 @@ class MathType extends Plugin {
|
|
|
10639
11709
|
formulas.forEach((formula)=>{
|
|
10640
11710
|
if (formula.includes('encoding="LaTeX"')) {
|
|
10641
11711
|
// LaTeX found.
|
|
10642
|
-
|
|
11712
|
+
const latex = `$$$${Latex.getLatexFromMathML(formula)}$$$`; // We add $$$ instead of $$ because the replace function ignores one $.
|
|
10643
11713
|
modifiedData = modifiedData.replace(formula, latex);
|
|
10644
11714
|
} else if (formula.includes("<img")) {
|
|
10645
11715
|
// If we found a formula image, we should find MathML data, and then substitute the entire image.
|
|
10646
11716
|
const regexp = /«math\b[^»]*»(.*?)«\/math»/g;
|
|
10647
11717
|
const safexml = formula.match(regexp);
|
|
10648
11718
|
if (safexml !== null) {
|
|
10649
|
-
|
|
11719
|
+
const decodeXML = MathML.safeXmlDecode(safexml[0]);
|
|
10650
11720
|
modifiedData = modifiedData.replace(formula, decodeXML);
|
|
10651
11721
|
}
|
|
10652
11722
|
}
|
|
@@ -10675,5 +11745,5 @@ class MathType extends Plugin {
|
|
|
10675
11745
|
}
|
|
10676
11746
|
}
|
|
10677
11747
|
|
|
10678
|
-
export { MathType as default };
|
|
11748
|
+
export { CKEditor5Integration, ChemTypeCommand, MathTypeCommand, MathType as default };
|
|
10679
11749
|
//# sourceMappingURL=index.js.map
|