10.4.4 release
This commit is contained in:
parent
5587c6c084
commit
9c7881b67b
7 changed files with 23 additions and 18 deletions
|
@ -1,3 +1,8 @@
|
|||
12-MAR-2019: 10.4.4
|
||||
|
||||
- Adds blob.core.windows.net to known CORS urls
|
||||
- Fixes loading of Visio templates via proxy
|
||||
|
||||
12-MAR-2019: 10.4.3
|
||||
|
||||
- Uses mxGraph 4.0.1 beta 1
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.4.3
|
||||
10.4.4
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 03/12/2019 09:54 AM
|
||||
# 03/12/2019 02:49 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
16
src/main/webapp/js/app.min.js
vendored
16
src/main/webapp/js/app.min.js
vendored
|
@ -8095,12 +8095,12 @@ a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.Mat
|
|||
MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var c=Editor.prototype.init;Editor.prototype.init=function(){c.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,
|
||||
b){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");if(null!=f&&0<f.length){var d=document.createElement("script");d.type="text/javascript";d.src=a;f[0].parentNode.appendChild(d)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;
|
||||
var b=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,c,f,d){void 0!==c?b.push(c.replace(/\\'/g,"'")):void 0!==f?b.push(f.replace(/\\"/g,'"')):void 0!==d&&b.push(d);return""});/,\s*$/.test(a)&&b.push("");return b};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
|
||||
this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(f){if(null!=f){var d="http://"==f.substring(0,7)||"https://"==
|
||||
f.substring(0,8);d&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!d||f.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=f.substring(0,19)&&(f=b.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,
|
||||
mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(EditorUi.prototype.svgBrokenImage.src)});else{var c=new Image;EditorUi.prototype.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);try{b(a.toDataURL())}catch(H){b(EditorUi.prototype.svgBrokenImage.src)}};c.onerror=function(){b(EditorUi.prototype.svgBrokenImage.src)};c.src=a}};Editor.prototype.convertImages=
|
||||
function(a,b,c,f){null==f&&(f=this.createImageUrlConverter());var d=0,k=c||{};c=mxUtils.bind(this,function(c,p){for(var e=a.getElementsByTagName(c),g=0;g<e.length;g++)mxUtils.bind(this,function(c){var e=f.convert(c.getAttribute(p));if(null!=e&&"data:"!=e.substring(0,5)){var g=k[e];null==g?(d++,this.convertImageToDataUri(e,function(f){null!=f&&(k[e]=f,c.setAttribute(p,f));d--;0==d&&b(a)})):c.setAttribute(p,g)}else null!=e&&c.setAttribute(p,e)})(e[g])});c("image","xlink:href");c("img","src");0==d&&
|
||||
b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=0,f=a.length,d,k,p;c<f;){d=a.charCodeAt(c++)&255;if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);b+="==";break}k=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<
|
||||
4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b};
|
||||
this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(f){if(null!=
|
||||
f){var d="http://"==f.substring(0,7)||"https://"==f.substring(0,8);d&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!d||f.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&c.isCorsEnabledForUrl(f)?"chrome-extension://"!=f.substring(0,19)&&(f=b.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=
|
||||
function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(EditorUi.prototype.svgBrokenImage.src)});else{var c=new Image;EditorUi.prototype.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,0,0);try{b(a.toDataURL())}catch(H){b(EditorUi.prototype.svgBrokenImage.src)}};c.onerror=function(){b(EditorUi.prototype.svgBrokenImage.src)};
|
||||
c.src=a}};Editor.prototype.convertImages=function(a,b,c,f){null==f&&(f=this.createImageUrlConverter());var d=0,k=c||{};c=mxUtils.bind(this,function(c,p){for(var e=a.getElementsByTagName(c),g=0;g<e.length;g++)mxUtils.bind(this,function(c){var e=f.convert(c.getAttribute(p));if(null!=e&&"data:"!=e.substring(0,5)){var g=k[e];null==g?(d++,this.convertImageToDataUri(e,function(f){null!=f&&(k[e]=f,c.setAttribute(p,f));d--;0==d&&b(a)})):c.setAttribute(p,g)}else null!=e&&c.setAttribute(p,e)})(e[g])});c("image",
|
||||
"xlink:href");c("img","src");0==d&&b(a)};Editor.prototype.base64Encode=function(a){for(var b="",c=0,f=a.length,d,k,p;c<f;){d=a.charCodeAt(c++)&255;if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);b+="==";break}k=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&
|
||||
3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b};
|
||||
Editor.prototype.loadUrl=function(a,b,c,f,d,k){try{var p=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var e=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(p){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),
|
||||
d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}k=null!=k?k:"data:image/png;base64,";f=k+this.base64Encode(f)}b(f)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},p,this.timeout,function(){d&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:e})})});e()}catch(M){null!=c&&c(M)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
|
||||
"g"),"")},c=this.fontCss.split("url("),f=0,d={},k=mxUtils.bind(this,function(){if(0==f){for(var k=[c[0]],p=1;p<c.length;p++){var e=c[p].indexOf(")");k.push('url("');k.push(d[b(c[p].substring(0,e))]);k.push('"'+c[p].substring(e))}this.resolvedFontCss=k.join("");a()}});if(0<c.length)for(var p=1;p<c.length;p++){var e=c[p].indexOf(")"),g=null,v=c[p].indexOf("format(",e);0<v&&(g=b(c[p].substring(v+7,c[p].indexOf(")",v))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var b="application/x-font-ttf";
|
||||
|
@ -8219,7 +8219,7 @@ document.createElement("canvas"),F=new Image;F.onload=function(){try{J.getContex
|
|||
var ErrorDialog=function(a,c,b,d,e,g,l,m,n,q,f){n=null!=n?n:!0;var k=document.createElement("div");k.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);k.appendChild(p)}c=
|
||||
document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=q&&(q=mxUtils.button(q,function(){null!=f&&f()}),q.className="geBtn",b.appendChild(q));var t=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()});
|
||||
t.className="geBtn";b.appendChild(t);null!=l&&(d=mxUtils.button(l,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){t.focus()};k.appendChild(b);this.container=k};
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.4.3";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.4.4";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,d,e);else if(EditorUi.enableLogging)try{if(a!=
|
||||
EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=k+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+
|
||||
encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(v){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):
|
||||
"")}catch(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(p){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.dev){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
|
||||
|
@ -8971,7 +8971,7 @@ App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var
|
|||
isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,e=new CreateDialog(this,e,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==l&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
|
||||
this.getFileData(/(\.xml)$/i.test(a)||0>a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,g,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(e.container,460,m>n?390:270,!0,!0);e.init()}else this.save(b.getTitle(),
|
||||
d)}};
|
||||
App.prototype.loadTemplate=function(a,c,b,d){var e=!1,g=a;this.editor.isCorsEnabledForUrl(g)||(g="t="+(new Date).getTime(),g=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+g,e=!0);var l=null!=d?d:a;this.loadUrl(g,mxUtils.bind(this,function(d){try{var g=e?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(g))this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&(new XMLHttpRequest).upload&&
|
||||
App.prototype.loadTemplate=function(a,c,b,d){var e=!1,g=a;this.editor.isCorsEnabledForUrl(g)||(g="t="+(new Date).getTime(),g=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+g,e=!0);var l=null!=d?d:a;this.loadUrl(g,mxUtils.bind(this,function(d){try{var g=e?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(g))this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&(new XMLHttpRequest).upload&&
|
||||
this.isRemoteFileFormat(g,l))this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(g))this.convertLucidChart(g,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(g))g=this.extractGraphModelFromPng(d);c(g)}}catch(q){b(q)}}),b,/(\.png)($|\?)/i.test(l)||
|
||||
/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,e)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
|
||||
App.prototype.createFile=function(a,c,b,d,e,g,l,m){d=m?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var n=mxUtils.bind(this,function(){this.spinner.stop()}),q=mxUtils.bind(this,function(a){n();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==l&&null!=this.stateArg&&null!=this.stateArg.folderId&&(l=this.stateArg.folderId),
|
||||
|
|
|
@ -3223,7 +3223,7 @@ App.prototype.loadTemplate = function(url, onload, onerror, templateFilename)
|
|||
|
||||
if (/(\.v(dx|sdx?))($|\?)/i.test(filterFn) || this.isVisioData(data))
|
||||
{
|
||||
this.importVisio(this.base64ToBlob(data.substring(data.indexOf(',') + 1)), function(xml)
|
||||
this.importVisio(this.base64ToBlob(responseData.substring(responseData.indexOf(',') + 1)), function(xml)
|
||||
{
|
||||
onload(xml);
|
||||
}, onerror, filterFn);
|
||||
|
|
|
@ -940,7 +940,6 @@
|
|||
return a;
|
||||
};
|
||||
|
||||
//TODO This function is a replica of EditorUi one, it is planned to replace all calls to EditorUi one to point to this one
|
||||
/**
|
||||
* Returns true if the given URL is known to have CORS headers.
|
||||
*/
|
||||
|
@ -955,6 +954,7 @@
|
|||
url.substring(0, 34) === 'https://raw.githubusercontent.com/' ||
|
||||
url.substring(0, 23) === 'https://cdn.rawgit.com/' ||
|
||||
url.substring(0, 19) === 'https://rawgit.com/' ||
|
||||
/^https?:\/\/[^\/]*\.blob.core.windows.net\//.test(url) ||
|
||||
/^https?:\/\/[^\/]*\.iconfinder.com\//.test(url) ||
|
||||
/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(url) ||
|
||||
/^https?:\/\/[^\/]*\.github\.io\//.test(url);
|
||||
|
|
12
src/main/webapp/js/viewer.min.js
vendored
12
src/main/webapp/js/viewer.min.js
vendored
|
@ -2780,12 +2780,12 @@ a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.Mat
|
|||
MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,
|
||||
d){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var c=document.getElementsByTagName("script");if(null!=c&&0<c.length){var f=document.createElement("script");f.type="text/javascript";f.src=a;c[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;
|
||||
var d=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,b,c,f){void 0!==b?d.push(b.replace(/\\'/g,"'")):void 0!==c?d.push(c.replace(/\\"/g,'"')):void 0!==f&&d.push(f);return""});/,\s*$/.test(a)&&d.push("");return d};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
|
||||
this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var d=a.convert,b=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==
|
||||
c.substring(0,8);f&&!navigator.onLine?c=EditorUi.prototype.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(c)?"chrome-extension://"!=c.substring(0,19)&&(c=d.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,d){if(/(\.svg)$/i.test(a))mxUtils.get(a,
|
||||
mxUtils.bind(this,function(a){d(this.createSvgDataUri(a.getText()))}),function(){d(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),c=a.getContext("2d");a.height=b.height;a.width=b.width;c.drawImage(b,0,0);try{d(a.toDataURL())}catch(H){d(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){d(EditorUi.prototype.svgBrokenImage.src)};b.src=a}};Editor.prototype.convertImages=
|
||||
function(a,d,b,c){null==c&&(c=this.createImageUrlConverter());var f=0,e=b||{};b=mxUtils.bind(this,function(b,g){for(var l=a.getElementsByTagName(b),p=0;p<l.length;p++)mxUtils.bind(this,function(b){var l=c.convert(b.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var p=e[l];null==p?(f++,this.convertImageToDataUri(l,function(c){null!=c&&(e[l]=c,b.setAttribute(g,c));f--;0==f&&d(a)})):b.setAttribute(g,p)}else null!=l&&b.setAttribute(g,l)})(l[p])});b("image","xlink:href");b("img","src");0==f&&
|
||||
d(a)};Editor.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,f,e,g;b<c;){f=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);d+="==";break}e=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<
|
||||
4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);d+="=";break}g=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return d};
|
||||
this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var d=a.convert,b=this;a.convert=function(c){if(null!=
|
||||
c){var f="http://"==c.substring(0,7)||"https://"==c.substring(0,8);f&&!navigator.onLine?c=EditorUi.prototype.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(c)?"chrome-extension://"!=c.substring(0,19)&&(c=d.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=
|
||||
function(a,d){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){d(this.createSvgDataUri(a.getText()))}),function(){d(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),c=a.getContext("2d");a.height=b.height;a.width=b.width;c.drawImage(b,0,0);try{d(a.toDataURL())}catch(H){d(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){d(EditorUi.prototype.svgBrokenImage.src)};
|
||||
b.src=a}};Editor.prototype.convertImages=function(a,d,b,c){null==c&&(c=this.createImageUrlConverter());var f=0,e=b||{};b=mxUtils.bind(this,function(b,g){for(var l=a.getElementsByTagName(b),p=0;p<l.length;p++)mxUtils.bind(this,function(b){var l=c.convert(b.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var p=e[l];null==p?(f++,this.convertImageToDataUri(l,function(c){null!=c&&(e[l]=c,b.setAttribute(g,c));f--;0==f&&d(a)})):b.setAttribute(g,p)}else null!=l&&b.setAttribute(g,l)})(l[p])});b("image",
|
||||
"xlink:href");b("img","src");0==f&&d(a)};Editor.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,f,e,g;b<c;){f=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);d+="==";break}e=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&
|
||||
3)<<4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);d+="=";break}g=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return d};
|
||||
Editor.prototype.loadUrl=function(a,d,b,c,f,e){try{var g=c||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);f=null!=f?f:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=d){var c=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var c=Array(a.length),
|
||||
f=0;f<a.length;f++)c[f]=String.fromCharCode(a[f]);c=c.join("")}e=null!=e?e:"data:image/png;base64,";c=e+this.base64Encode(c)}d(c)}}else null!=b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){f&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(S){null!=b&&b(S)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var d=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
|
||||
"g"),"")},b=this.fontCss.split("url("),c=0,f={},e=mxUtils.bind(this,function(){if(0==c){for(var e=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");e.push('url("');e.push(f[d(b[g].substring(0,l))]);e.push('"'+b[g].substring(l))}this.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var l=b[g].indexOf(")"),p=null,n=b[g].indexOf("format(",l);0<n&&(p=d(b[g].substring(n+7,b[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;c++;var d="application/x-font-ttf";
|
||||
|
|
Loading…
Reference in a new issue