wirispluginengine 7.15.0.1425 → 7.16.0.1424
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 482e16f6b50f19d33bfb8b6f95e8a71dee7f2d33
|
4
|
+
data.tar.gz: e44e015ad6637b9e70e81faf5b5dfbb05226ae7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc7519c59b7e39e7c3eba655e6e87906bbbfd3199dc0f9c7ae739403108e8ce11b285a4cf8593b39dd767de9cb2e83ae4a8e0286727ecb01d4f77ea35d55e7ee
|
7
|
+
data.tar.gz: 3121ea5cbcd9005cd575b7022b7473e9b5c14c1508406c0b434ac985e1000441fe1e8ebd7d3d07f7a70a8874f1cc5b1b3d5ebc5ba7cf791e34745f8206977b28
|
@@ -888,6 +888,62 @@ com.wiris.js.JsBrowser.prototype = {
|
|
888
888
|
,dataBrowser: null
|
889
889
|
,__class__: com.wiris.js.JsBrowser
|
890
890
|
}
|
891
|
+
com.wiris.js.JsCharacters = $hxClasses["com.wiris.js.JsCharacters"] = function() { }
|
892
|
+
com.wiris.js.JsCharacters.__name__ = ["com","wiris","js","JsCharacters"];
|
893
|
+
com.wiris.js.JsCharacters.getSafeXMLCharactersEntities = function() {
|
894
|
+
return { tagOpener : "«", tagCloser : "»", doubleQuote : "¨", realDoubleQuote : """};
|
895
|
+
}
|
896
|
+
com.wiris.js.JsCharacters.getXMLCharacters = function() {
|
897
|
+
return { id : "xmlCharacters", tagOpener : "<", tagCloser : ">", doubleQuote : "\"", ampersand : "&", quote : "'"};
|
898
|
+
}
|
899
|
+
com.wiris.js.JsCharacters.getSafeXMLCharacters = function() {
|
900
|
+
return { id : "safeXmlCharacters", tagOpener : "«", tagCloser : "»", doubleQuote : "¨", ampersand : "§", quote : "`", realDoubleQuote : "¨"};
|
901
|
+
}
|
902
|
+
com.wiris.js.JsMathML = $hxClasses["com.wiris.js.JsMathML"] = function() { }
|
903
|
+
com.wiris.js.JsMathML.__name__ = ["com","wiris","js","JsMathML"];
|
904
|
+
com.wiris.js.JsMathML.decodeSafeMathML = function(input) {
|
905
|
+
var safeXMLCharactersEntities = com.wiris.js.JsCharacters.getSafeXMLCharactersEntities();
|
906
|
+
var xmlCharacters = com.wiris.js.JsCharacters.getXMLCharacters();
|
907
|
+
var safeXMLCharacters = com.wiris.js.JsCharacters.getSafeXMLCharacters();
|
908
|
+
var tagOpenerEntity = safeXMLCharactersEntities.tagOpener;
|
909
|
+
var tagCloserEntity = safeXMLCharactersEntities.tagCloser;
|
910
|
+
var doubleQuoteEntity = safeXMLCharactersEntities.doubleQuote;
|
911
|
+
var realDoubleQuoteEntity = safeXMLCharactersEntities.realDoubleQuote;
|
912
|
+
var inputCopy = input.slice();
|
913
|
+
inputCopy = inputCopy.split(tagOpenerEntity).join(safeXMLCharacters.tagOpener);
|
914
|
+
inputCopy = inputCopy.split(tagCloserEntity).join(safeXMLCharacters.tagCloser);
|
915
|
+
inputCopy = inputCopy.split(doubleQuoteEntity).join(safeXMLCharacters.doubleQuote);
|
916
|
+
inputCopy = inputCopy.split(realDoubleQuoteEntity).join(safeXMLCharacters.realDoubleQuote);
|
917
|
+
var tagOpener = safeXMLCharacters.tagOpener;
|
918
|
+
var tagCloser = safeXMLCharacters.tagCloser;
|
919
|
+
var doubleQuote = safeXMLCharacters.doubleQuote;
|
920
|
+
var realDoubleQuote = safeXMLCharacters.realDoubleQuote;
|
921
|
+
var ampersand = safeXMLCharacters.ampersand;
|
922
|
+
var quote = safeXMLCharacters.quote;
|
923
|
+
inputCopy = inputCopy.split(tagOpener).join(xmlCharacters.tagOpener);
|
924
|
+
inputCopy = inputCopy.split(tagCloser).join(xmlCharacters.tagCloser);
|
925
|
+
inputCopy = inputCopy.split(doubleQuote).join(xmlCharacters.doubleQuote);
|
926
|
+
inputCopy = inputCopy.split(ampersand).join(xmlCharacters.ampersand);
|
927
|
+
inputCopy = inputCopy.split(quote).join(xmlCharacters.quote);
|
928
|
+
var returnValue = "";
|
929
|
+
var currentEntity = null;
|
930
|
+
var i = 0;
|
931
|
+
while(i < inputCopy.length) {
|
932
|
+
var character = inputCopy.charAt(i);
|
933
|
+
if(currentEntity == null) {
|
934
|
+
if(character == "$") currentEntity = ""; else returnValue += character;
|
935
|
+
} else if(character == ";") {
|
936
|
+
returnValue += "&" + currentEntity;
|
937
|
+
currentEntity = null;
|
938
|
+
} else if(character.match(new EReg("([a-zA-Z0-9#._-] | '-')",""))) currentEntity += character; else {
|
939
|
+
returnValue += "$" + "currentEntity";
|
940
|
+
currentEntity = null;
|
941
|
+
i -= 1;
|
942
|
+
}
|
943
|
+
i++;
|
944
|
+
}
|
945
|
+
return returnValue;
|
946
|
+
}
|
891
947
|
com.wiris.js.JsPluginListener = $hxClasses["com.wiris.js.JsPluginListener"] = function() { }
|
892
948
|
com.wiris.js.JsPluginListener.__name__ = ["com","wiris","js","JsPluginListener"];
|
893
949
|
com.wiris.js.JsPluginListener.prototype = {
|
@@ -948,6 +1004,7 @@ com.wiris.js.JsPluginViewer = $hxClasses["com.wiris.js.JsPluginViewer"] = functi
|
|
948
1004
|
this.zoom = 1;
|
949
1005
|
this.viewer = "";
|
950
1006
|
this.lang = "inherit";
|
1007
|
+
this.safeXml = false;
|
951
1008
|
this.ready = false;
|
952
1009
|
this.extension = "@param.configuration.script.extension@";
|
953
1010
|
this.localpath = "@param.configuration.script.local.path@";
|
@@ -1027,8 +1084,8 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1027
1084
|
data += "&metrics=true¢erbaseline=false&mml=" + StringTools.urlEncode(mml);
|
1028
1085
|
data += "&lang=" + this.lang;
|
1029
1086
|
if(this.zoom != 1) data += "&zoom=" + this.zoom;
|
1030
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1031
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1087
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 917, className : "com.wiris.js.JsPluginViewer", methodName : "callService"});
|
1088
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 919, className : "com.wiris.js.JsPluginViewer", methodName : "callService"});
|
1032
1089
|
con.open("POST",url,false);
|
1033
1090
|
con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
|
1034
1091
|
con.send(data);
|
@@ -1040,8 +1097,8 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1040
1097
|
var url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/service" + this.extension;
|
1041
1098
|
var data = "service=latex2mathml";
|
1042
1099
|
data += "&latex=" + StringTools.urlEncode(latex);
|
1043
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1044
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1100
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 851, className : "com.wiris.js.JsPluginViewer", methodName : "latexToMathml"});
|
1101
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 853, className : "com.wiris.js.JsPluginViewer", methodName : "latexToMathml"});
|
1045
1102
|
var onloadFunc = function(e) {
|
1046
1103
|
try {
|
1047
1104
|
var mathml = haxe.Json.parse(con.responseText).result.text;
|
@@ -1063,7 +1120,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1063
1120
|
e.target.wiris.callbackFunc(mathmlSpan);
|
1064
1121
|
_g.parseElement(mathmlSpan,asynchronously);
|
1065
1122
|
} catch( e1 ) {
|
1066
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("LatexToMathml call failed!",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1123
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("LatexToMathml call failed!",{ fileName : "JsPluginViewer.hx", lineNumber : 879, className : "com.wiris.js.JsPluginViewer", methodName : "latexToMathml"});
|
1067
1124
|
}
|
1068
1125
|
};
|
1069
1126
|
con.open("POST",url,asynchronously);
|
@@ -1074,7 +1131,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1074
1131
|
con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
|
1075
1132
|
con.onload = onloadFunc;
|
1076
1133
|
con.onerror = function(e) {
|
1077
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("LatexToMathml call failed!",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1134
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("LatexToMathml call failed!",{ fileName : "JsPluginViewer.hx", lineNumber : 892, className : "com.wiris.js.JsPluginViewer", methodName : "latexToMathml"});
|
1078
1135
|
};
|
1079
1136
|
con.send(data);
|
1080
1137
|
}
|
@@ -1101,8 +1158,8 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1101
1158
|
url = (this.absoluteURL.length > 0?this.absoluteURL:this.baseURL + this.localpath) + "/showimage" + this.extension;
|
1102
1159
|
if(new com.wiris.js.JsBrowser().isIE()) data = "?formula=" + md5 + "&lang=" + this.lang + "&useragent=IE"; else data = "?formula=" + md5 + "&lang=" + this.lang;
|
1103
1160
|
data += "&version=" + com.wiris.js.JsPluginViewer.VERSION;
|
1104
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1105
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("GET:" + data,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1161
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 729, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"});
|
1162
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("GET:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 731, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"});
|
1106
1163
|
con.open("GET",url + data,asynchronously);
|
1107
1164
|
con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
|
1108
1165
|
var onloadFunc = function(e) {
|
@@ -1122,7 +1179,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1122
1179
|
var scaledWitdh = result.width * scaleDpi | 0;
|
1123
1180
|
var scaledBaseLine = result.baseline * scaleDpi | 0;
|
1124
1181
|
if(result.height > 0) {
|
1125
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(_g.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber :
|
1182
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(_g.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber : 755, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"});
|
1126
1183
|
e1.target.wiris.img.style.verticalAlign = "-" + _g.calculateAlignment(scaledHeight,scaledBaseLine) + "px";
|
1127
1184
|
e1.target.wiris.img.style.height = "" + scaledHeight + "px";
|
1128
1185
|
e1.target.wiris.img.style.width = "" + scaledWitdh + "px";
|
@@ -1166,7 +1223,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1166
1223
|
con.wiris.container = container;
|
1167
1224
|
con.onload = onloadFunc1;
|
1168
1225
|
con.onerror = function(e1) {
|
1169
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("ShowImage call failed!",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1226
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("ShowImage call failed!",{ fileName : "JsPluginViewer.hx", lineNumber : 819, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"});
|
1170
1227
|
};
|
1171
1228
|
con.send(data);
|
1172
1229
|
} else getResultFunc(e);
|
@@ -1180,7 +1237,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1180
1237
|
con.wiris.asynchronously = asynchronously;
|
1181
1238
|
con.onload = onloadFunc;
|
1182
1239
|
con.onerror = function(e) {
|
1183
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("ShowImage call failed!",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1240
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("ShowImage call failed!",{ fileName : "JsPluginViewer.hx", lineNumber : 839, className : "com.wiris.js.JsPluginViewer", methodName : "callShowimage"});
|
1184
1241
|
};
|
1185
1242
|
con.send(null);
|
1186
1243
|
}
|
@@ -1197,8 +1254,8 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1197
1254
|
data = "metrics=true¢erbaseline=false&mml=" + StringTools.urlEncode(mml);
|
1198
1255
|
data += "&lang=" + this.lang;
|
1199
1256
|
if(this.zoom != 1) data += "&zoom=" + this.zoom;
|
1200
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1201
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1257
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Calling: " + url,{ fileName : "JsPluginViewer.hx", lineNumber : 658, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"});
|
1258
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("POST:" + data,{ fileName : "JsPluginViewer.hx", lineNumber : 660, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"});
|
1202
1259
|
con.open("POST",url,false);
|
1203
1260
|
con.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=utf-8");
|
1204
1261
|
con.send(data);
|
@@ -1207,7 +1264,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1207
1264
|
if(i >= 0) {
|
1208
1265
|
var scaleDpi = 1;
|
1209
1266
|
var h = this.queryToParams(HxOverrides.substr(s,i + 1,null));
|
1210
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(h.get("formula"),{ fileName : "JsPluginViewer.hx", lineNumber :
|
1267
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(h.get("formula"),{ fileName : "JsPluginViewer.hx", lineNumber : 670, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"});
|
1211
1268
|
if(h.exists("dpi")) scaleDpi = this.zoom * (Std.parseInt(h.get("dpi")) / 96);
|
1212
1269
|
baseline = Std.parseInt(h.get("cb")) / scaleDpi | 0;
|
1213
1270
|
height = Std.parseInt(h.get("ch")) / scaleDpi | 0;
|
@@ -1216,7 +1273,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1216
1273
|
}
|
1217
1274
|
img.src = con.responseText;
|
1218
1275
|
if(height > 0) {
|
1219
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber :
|
1276
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.calculateAlignment(height,baseline),{ fileName : "JsPluginViewer.hx", lineNumber : 681, className : "com.wiris.js.JsPluginViewer", methodName : "callCreateImage"});
|
1220
1277
|
img.style.verticalAlign = "-" + this.calculateAlignment(height,baseline) + "px";
|
1221
1278
|
img.style.height = "" + height + "px";
|
1222
1279
|
img.style.width = "" + width + "px";
|
@@ -1244,12 +1301,12 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1244
1301
|
} else return com.wiris.js.JsPluginViewer.TECH;
|
1245
1302
|
}
|
1246
1303
|
,processMathML: function(mml,container,asynchronously,callbackFunc) {
|
1247
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(mml,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1304
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(mml,{ fileName : "JsPluginViewer.hx", lineNumber : 603, className : "com.wiris.js.JsPluginViewer", methodName : "processMathML"});
|
1248
1305
|
var img = js.Lib.document.createElement("img");
|
1249
1306
|
if(this.performanceenabled == null) this.performanceenabled = this.isPerformanceEnabled();
|
1250
1307
|
if(this.mode == com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE && this.performanceenabled) this.callShowimage(container,mml,img,asynchronously,callbackFunc); else if(this.mode == com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE && !this.performanceenabled) this.callCreateImage(mml,img); else img.src = this.baseURL + this.localpath + "/showimage" + this.extension + "?mml=" + StringTools.urlEncode(mml);
|
1251
1308
|
container.appendChild(img);
|
1252
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(img.src,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1309
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(img.src,{ fileName : "JsPluginViewer.hx", lineNumber : 617, className : "com.wiris.js.JsPluginViewer", methodName : "processMathML"});
|
1253
1310
|
}
|
1254
1311
|
,getMathML_IE7: function(mathNode0) {
|
1255
1312
|
var mathml = "";
|
@@ -1303,7 +1360,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1303
1360
|
var mathml = null;
|
1304
1361
|
var browser = new com.wiris.js.JsBrowser();
|
1305
1362
|
if(browser.getBrowser() == "Explorer" && (browser.getVersion() == "6" || browser.getVersion() == "7") && navigator.appVersion.indexOf("Trident") == -1) {
|
1306
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Is ie7",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1363
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Is ie7",{ fileName : "JsPluginViewer.hx", lineNumber : 472, className : "com.wiris.js.JsPluginViewer", methodName : "replaceNodes"});
|
1307
1364
|
mathml = this.getMathML_IE7(mathNode);
|
1308
1365
|
}
|
1309
1366
|
var container = js.Lib.document.createElement("span");
|
@@ -1444,11 +1501,56 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1444
1501
|
}
|
1445
1502
|
this.replaceNodes(arr,0,asynchronously,callbackFunc);
|
1446
1503
|
}
|
1447
|
-
,parseDocument: function(asynchronously,callbackFunc) {
|
1448
|
-
this.parseElement(js.Lib.document,asynchronously,callbackFunc);
|
1504
|
+
,parseDocument: function(asynchronously,callbackFunc,safeXml) {
|
1505
|
+
if(safeXml) this.parseSafeMathMLElement(js.Lib.document,asynchronously,callbackFunc); else this.parseElement(js.Lib.document,asynchronously,callbackFunc);
|
1506
|
+
}
|
1507
|
+
,getMathMLPositionsAtNode: function(node,mathmlPositions) {
|
1508
|
+
var safeXMLCharacters = com.wiris.js.JsCharacters.getSafeXMLCharacters();
|
1509
|
+
if(node.nodeType == 3) {
|
1510
|
+
var startMathmlTag = safeXMLCharacters.tagOpener + "math";
|
1511
|
+
var endMathmlTag = safeXMLCharacters.tagOpener + "/math" + safeXMLCharacters.tagCloser;
|
1512
|
+
var start = node.textContent.indexOf(startMathmlTag);
|
1513
|
+
var end = 0;
|
1514
|
+
while(start != -1) {
|
1515
|
+
end = node.textContent.indexOf(endMathmlTag,start + startMathmlTag.length);
|
1516
|
+
if(end == -1) break;
|
1517
|
+
var nextMathML = node.textContent.indexOf(startMathmlTag,end + endMathmlTag.length);
|
1518
|
+
if(nextMathML >= 0 && end > nextMathML) break;
|
1519
|
+
var safeMathml = node.textContent.substring(start,end + endMathmlTag.length);
|
1520
|
+
node.textContent = node.textContent.substring(0,start) + node.textContent.substring(end + endMathmlTag.length);
|
1521
|
+
node = node.splitText(start);
|
1522
|
+
start = node.textContent.indexOf(startMathmlTag);
|
1523
|
+
mathmlPositions.push({ safeMML : safeMathml, nextElement : node});
|
1524
|
+
}
|
1525
|
+
}
|
1526
|
+
}
|
1527
|
+
,getMathMLPositionsAtElementAndChildren: function(element,mathmlPositions) {
|
1528
|
+
this.getMathMLPositionsAtNode(element,mathmlPositions);
|
1529
|
+
if(element.childNodes.length > 0) {
|
1530
|
+
var _g1 = 0, _g = element.childNodes.length;
|
1531
|
+
while(_g1 < _g) {
|
1532
|
+
var i = _g1++;
|
1533
|
+
var child = element.childNodes[i];
|
1534
|
+
this.getMathMLPositionsAtElementAndChildren(child,mathmlPositions);
|
1535
|
+
}
|
1536
|
+
}
|
1537
|
+
}
|
1538
|
+
,parseSafeMathMLElement: function(element,asynchronously,callbackFunc) {
|
1539
|
+
if(!this.ready) throw "Document is not loaded.";
|
1540
|
+
var mathmlPositions = [];
|
1541
|
+
this.getMathMLPositionsAtElementAndChildren(js.Lib.document,mathmlPositions);
|
1542
|
+
var _g1 = 0, _g = mathmlPositions.length;
|
1543
|
+
while(_g1 < _g) {
|
1544
|
+
var i = _g1++;
|
1545
|
+
var mathmlPosition = mathmlPositions[i];
|
1546
|
+
var newNode = document.createElement("math");
|
1547
|
+
mathmlPosition.nextElement.parentNode.insertBefore(newNode,mathmlPosition.nextElement);
|
1548
|
+
newNode.outerHTML = com.wiris.js.JsMathML.decodeSafeMathML(mathmlPosition.safeMML);
|
1549
|
+
}
|
1550
|
+
this.parseElement(element,asynchronously,callbackFunc);
|
1449
1551
|
}
|
1450
1552
|
,doLoad: function() {
|
1451
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("doLoad",{ fileName : "JsPluginViewer.hx", lineNumber :
|
1553
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("doLoad",{ fileName : "JsPluginViewer.hx", lineNumber : 120, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"});
|
1452
1554
|
this.scriptName = "WIRISplugins.js";
|
1453
1555
|
var col;
|
1454
1556
|
col = js.Lib.document.getElementsByTagName("script");
|
@@ -1467,7 +1569,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1467
1569
|
var query = HxOverrides.substr(src,k + 1,null);
|
1468
1570
|
this.params = this.queryToParams(query);
|
1469
1571
|
}
|
1470
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.baseURL,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1572
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace(this.baseURL,{ fileName : "JsPluginViewer.hx", lineNumber : 139, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"});
|
1471
1573
|
}
|
1472
1574
|
}
|
1473
1575
|
this.tech = this.getTechnology();
|
@@ -1496,18 +1598,19 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1496
1598
|
this.absoluteURL = "/wirispluginengine/integration";
|
1497
1599
|
}
|
1498
1600
|
this.ready = true;
|
1499
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Tech:" + this.tech,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1601
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Tech:" + this.tech,{ fileName : "JsPluginViewer.hx", lineNumber : 169, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"});
|
1500
1602
|
if(this.params.exists("viewer")) this.viewer = this.params.get("viewer");
|
1501
1603
|
this.asyncParam = this.params.exists("async") && this.params.get("async") == "true"?true:false;
|
1502
1604
|
if(this.params.exists("zoom")) this.zoom = Std.parseFloat(this.params.get("zoom"));
|
1503
1605
|
if(this.params.exists("dpi")) this.zoom *= Std.parseFloat(this.params.get("dpi")) / 96;
|
1504
1606
|
if(this.params.exists("lang")) this.lang = this.params.get("lang"); else this.lang = "en";
|
1607
|
+
if(this.params.exists("safeXml")) this.safeXml = this.params.get("safeXml") == "true"?true:false; else this.safeXml = false;
|
1505
1608
|
if(this.lang == "inherit") this.lang = js.Lib.document.getElementsByTagName("html")[0].lang;
|
1506
|
-
if(this.viewer == "image") this.parseDocument(); else if(this.viewer == "latex") this.parseLatexDocument(this.asyncParam); else if(this.viewer == "all") {
|
1609
|
+
if(this.viewer == "image") this.parseDocument(this.asyncParam,null,this.safeXml); else if(this.viewer == "latex") this.parseLatexDocument(this.asyncParam); else if(this.viewer == "all") {
|
1507
1610
|
this.parseLatexDocument(this.asyncParam);
|
1508
1611
|
this.parseDocument(this.asyncParam);
|
1509
1612
|
}
|
1510
|
-
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Language:" + this.lang,{ fileName : "JsPluginViewer.hx", lineNumber :
|
1613
|
+
if(com.wiris.js.JsPluginViewer.DEBUG) haxe.Log.trace("Language:" + this.lang,{ fileName : "JsPluginViewer.hx", lineNumber : 205, className : "com.wiris.js.JsPluginViewer", methodName : "doLoad"});
|
1511
1614
|
com.wiris.js.JsPluginViewer.instance = this;
|
1512
1615
|
com.wiris.js.JsPluginViewer.bypassEncapsulation();
|
1513
1616
|
}
|
@@ -1526,6 +1629,7 @@ com.wiris.js.JsPluginViewer.prototype = {
|
|
1526
1629
|
,ready: null
|
1527
1630
|
,javaServicePath: null
|
1528
1631
|
,tech: null
|
1632
|
+
,safeXml: null
|
1529
1633
|
,lang: null
|
1530
1634
|
,wiriseditormathmlattribute: null
|
1531
1635
|
,performanceenabled: null
|
@@ -3790,7 +3894,7 @@ js.XMLHttpRequest = window.XMLHttpRequest?XMLHttpRequest:window.ActiveXObject?fu
|
|
3790
3894
|
com.wiris.js.JsPluginViewer.USE_CREATE_IMAGE = 1;
|
3791
3895
|
com.wiris.js.JsPluginViewer.DEBUG = false;
|
3792
3896
|
com.wiris.js.JsPluginViewer.TECH = "ruby";
|
3793
|
-
com.wiris.js.JsPluginViewer.VERSION = "7.
|
3897
|
+
com.wiris.js.JsPluginViewer.VERSION = "7.16.0.1424";
|
3794
3898
|
com.wiris.system.JsDOMUtils.TOUCHHOLD_MOVE_MARGIN = 10;
|
3795
3899
|
com.wiris.system.JsDOMUtils.browser = new com.wiris.system.JsBrowser();
|
3796
3900
|
com.wiris.system.JsDOMUtils.initialized = false;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module WirisPlugin
|
2
|
+
include Wiris
|
3
|
+
require('com/wiris/plugin/storage/StorageAndCache.rb')
|
4
|
+
require('com/wiris/plugin/storage/StorageAndCache.rb')
|
5
|
+
class S3StorageAndCacheExample
|
6
|
+
extend StorageAndCacheInterface
|
7
|
+
|
8
|
+
include Wiris
|
9
|
+
|
10
|
+
def initialize()
|
11
|
+
super()
|
12
|
+
end
|
13
|
+
def init(obj, config, cache, cacheFormula)
|
14
|
+
end
|
15
|
+
def codeDigest(content)
|
16
|
+
return nil
|
17
|
+
end
|
18
|
+
def decodeDigest(digest)
|
19
|
+
return nil
|
20
|
+
end
|
21
|
+
def retreiveData(digest, service)
|
22
|
+
return Bytes::ofString("")::getData()
|
23
|
+
end
|
24
|
+
def storeData(digest, service, stream)
|
25
|
+
end
|
26
|
+
def deleteCache()
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
@@ -51,6 +51,31 @@ length - 1
|
|
51
51
|
span = IntegerTools::max(0,endIndex - beginIndex)
|
52
52
|
return Std::substr(s,beginIndex,span)
|
53
53
|
end
|
54
|
+
def self.compareVersions(a, b)
|
55
|
+
va = Std::split(a,".")
|
56
|
+
vb = Std::split(b,".")
|
57
|
+
i = 0
|
58
|
+
while i < va::length()
|
59
|
+
na = Std::parseInt(va::_(i))
|
60
|
+
nb = 0
|
61
|
+
if i < vb::length()
|
62
|
+
nb = Std::parseInt(vb::_(i))
|
63
|
+
end
|
64
|
+
n = na - nb
|
65
|
+
if n != 0
|
66
|
+
return n
|
67
|
+
end
|
68
|
+
i+=1
|
69
|
+
end
|
70
|
+
while i < vb::length()
|
71
|
+
nb = Std::parseInt(vb::_(i))
|
72
|
+
if nb != 0
|
73
|
+
return -nb
|
74
|
+
end
|
75
|
+
i+=1
|
76
|
+
end
|
77
|
+
return 0
|
78
|
+
end
|
54
79
|
|
55
80
|
end
|
56
81
|
end
|
data/resources/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.16.0.1424
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wirispluginengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.16.0.1424
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wiris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/com/wiris/plugin/impl/TextFilter.rb
|
89
89
|
- lib/com/wiris/plugin/impl/TextFilterTags.rb
|
90
90
|
- lib/com/wiris/plugin/impl/TextServiceImpl.rb
|
91
|
+
- lib/com/wiris/plugin/storage/S3StorageAndCacheExample.rb
|
91
92
|
- lib/com/wiris/plugin/storage/StorageAndCache.rb
|
92
93
|
- lib/com/wiris/util/json/JSon.rb
|
93
94
|
- lib/com/wiris/util/json/JSonIntegerFormat.rb
|