10.0.10 release
This commit is contained in:
parent
88ea2aa915
commit
db25525b24
10 changed files with 549 additions and 531 deletions
|
@ -1,3 +1,7 @@
|
|||
28-DEC-2018: 10.0.10
|
||||
|
||||
- Fixes for error logging
|
||||
|
||||
27-DEC-2018: 10.0.9
|
||||
|
||||
- Fixes sync for unsaved files in Desktop
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.0.9
|
||||
10.0.10
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 12/27/2018 08:50 AM
|
||||
# 12/28/2018 09:29 AM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
7
src/main/webapp/js/app.min.js
vendored
7
src/main/webapp/js/app.min.js
vendored
|
@ -7399,8 +7399,9 @@ DrawioFile.prototype.mergeFile=function(a,c,b){try{var d=null!=this.shadowPages?
|
|||
this.inConflictState=!0;null!=window.console&&"1"==urlParams.test&&console.log(m);null!=b&&b(m);try{var f=this.getCurrentUser(),h=null!=f?this.ui.hashValue(f.id):"unknown";EditorUi.sendReport("Error in mergeFile "+(new Date).toISOString()+":\n\nFile="+this.getId()+" ("+this.getMode()+")\n"+(null!=this.sync?"Client="+this.sync.clientId+"\n":"")+"User="+h+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStack:\n"+m.stack)}catch(p){}}};
|
||||
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var c=new mxCodec(mxUtils.createXmlDocument()),b=c.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var e=this.ui.anonymizeNode(c.encode(new mxGraphModel(a[d].root)));e.setAttribute("id",a[d].getId());null!=a[d].getName()&&e.setAttribute("name",this.ui.anonymizeString(a[d].getName()));a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,e);b.appendChild(e)}return mxUtils.getPrettyXml(b)};
|
||||
DrawioFile.prototype.checkPages=function(){this.ui.getCurrentFile()!=this||null!=this.ui.pages&&0!=this.ui.pages.length||this.sendErrorReport("Pages is null or empty","ShadowPages: "+(null!=this.shadowPages)+"\nShadowData: "+(null!=this.shadowData))};
|
||||
DrawioFile.prototype.checkShadow=function(a){null!=a&&0!=a.length||this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+(null!=this.shadowData?this.shadowData.length:0))};DrawioFile.prototype.compressReportData=function(a,c){null!=a&&a.length>(null!=c?c:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,c,b){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),e=this.compressReportData(JSON.stringify(c,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+e)(null!=b?0+b:"")+"\nData:\n"+d}catch(g){}};
|
||||
DrawioFile.prototype.checkShadow=function(a){if(null==a||0==a.length){var c=null==this.shadowData?"null":this.compressReportData(this.ui.anonymizeString(this.shadowData),null,1E3);this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+c)}};
|
||||
DrawioFile.prototype.compressReportData=function(a,c,b){null!=a&&a.length>(null!=c?c:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");null!=b&&null!=a&&a.length>b&&(a=a.substring(0,b)+"[...]");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,c,b){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=c)for(a=0;a<c.length;a++)this.ui.anonymizePatch(c[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),e=this.compressReportData(JSON.stringify(c,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+e+(null!=b?"\n\n"+b:"")+"\n\nData:\n"+d)}catch(g){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,c){try{var b=this.getCurrentUser(),d=null!=b?this.ui.hashValue(b.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var e=this.getTitle(),g=e.lastIndexOf("."),b="none";0<g&&(b=e.substring(g));var k=Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.getId()+" ("+this.getMode()+")"+(null!=this.sync?"\nClient="+
|
||||
this.sync.clientId:"")+"\nUser="+d+"\nExt="+b+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=c?"\n\n"+c:"")+"\n\nStack:\n"+k)}catch(n){}};
|
||||
DrawioFile.prototype.reloadFile=function(a,c){try{this.ui.spinner.stop();var b=mxUtils.bind(this,function(){this.stats.reloads++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),c=this.ui.editor.graph.getSelectionCells(),g=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(g,b,c);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=this.stats);
|
||||
|
@ -7873,7 +7874,7 @@ this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnab
|
|||
var ErrorDialog=function(a,c,b,d,e,g,k,n,l,f,h){l=null!=l?l:!0;var m=document.createElement("div");m.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="16px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";mxUtils.write(p,c);m.appendChild(p)}c=document.createElement("div");c.style.padding="6px";c.innerHTML=b;m.appendChild(c);b=document.createElement("div");
|
||||
b.style.marginTop="16px";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!=f&&(f=mxUtils.button(f,function(){null!=h&&h()}),f.className="geBtn",b.appendChild(f));var q=mxUtils.button(d,function(){l&&a.hideDialog();null!=e&&e()});q.className="geBtn";b.appendChild(q);null!=k&&(d=mxUtils.button(k,function(){l&&a.hideDialog();null!=n&&n()}),d.className="geBtn gePrimaryBtn",
|
||||
b.appendChild(d));this.init=function(){q.focus()};m.appendChild(b);this.container=m};
|
||||
(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.0.9";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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==
|
||||
(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.0.10";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;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",h=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=h+"/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(x){}};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(m){}};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(m){}};EditorUi.debug=function(){if(null!=window.console&&"1"==urlParams.test){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);console.log.apply(console,
|
||||
|
|
37
src/main/webapp/js/atlas-viewer.min.js
vendored
37
src/main/webapp/js/atlas-viewer.min.js
vendored
|
@ -2008,8 +2008,8 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
|
|||
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
|
||||
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
|
||||
var PrintDialog=function(a,b){this.create(a,b)};
|
||||
PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(g.value)/100;isNaN(b)&&(b=1,g.value="100%");var b=.75*b,n=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,r=1/e.pageScale;if(d){var k=q.checked?1:parseInt(f.value);isNaN(k)||(r=mxUtils.getScaleForPageCount(k,e,n))}e.getGraphBounds();var y=k=0,n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*b);n.height=Math.ceil(n.height*b);r*=b;!d&&e.pageVisible?(b=e.getPageLayout(),k-=b.x*n.width,y-=b.y*n.height):
|
||||
d=!0;d=PrintDialog.createPrintPreview(e,r,n,0,k,y,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var u=document.createElement("span");mxUtils.write(u," "+mxResources.get("fitPage"));
|
||||
PrintDialog.prototype.create=function(a){function b(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,n=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,r=1/e.pageScale;if(b){var k=q.checked?1:parseInt(f.value);isNaN(k)||(r=mxUtils.getScaleForPageCount(k,e,n))}e.getGraphBounds();var y=k=0,n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*d);n.height=Math.ceil(n.height*d);r*=d;!b&&e.pageVisible?(d=e.getPageLayout(),k-=d.x*n.width,y-=d.y*n.height):
|
||||
b=!0;b=PrintDialog.createPrintPreview(e,r,n,0,k,y,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var u=document.createElement("span");mxUtils.write(u," "+mxResources.get("fitPage"));
|
||||
k.appendChild(u);mxEvent.addListener(u,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);p.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);u=document.createElement("span");mxUtils.write(u," "+mxResources.get("posterPrint")+":");k.appendChild(u);mxEvent.addListener(u,
|
||||
"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);p.appendChild(d);mxEvent.addListener(c,"change",
|
||||
function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);d.appendChild(k);p.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
|
||||
|
@ -2024,8 +2024,8 @@ l.appendChild(c);mxUtils.write(l,mxResources.get("gridSize")+":");var g=document
|
|||
":");k.appendChild(l);l=document.createElement("td");var n=document.createElement("a");n.style.textDecoration="underline";n.style.cursor="pointer";n.style.color="#a0a0a0";var r=d.backgroundImage;mxEvent.addListener(n,"click",function(c){a.showBackgroundImageDialog(function(a){r=a;e()});mxEvent.consume(c)});e();l.appendChild(n);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");l.colSpan=2;l.style.paddingTop="16px";l.setAttribute("align","right");var h=
|
||||
mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&l.appendChild(h);var m=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==g.value&&d.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,r,u.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=r?r.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
|
||||
c.ignoreColor&&c.ignoreImage||d.model.execute(c)});m.className="geBtn gePrimaryBtn";l.appendChild(m);a.editor.cancelFirst||l.appendChild(h);k.appendChild(l);q.appendChild(k);p.appendChild(q);this.container=p};
|
||||
PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||g!=document.activeElement&&n!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],C?"custom"==b.key&&(q.value=b.key,C=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
|
||||
e.height==b.format.height?(q.value=b.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(u.style.display="",f.style.display="none"):(g.value=e.width/100,n.value=e.height/100,l.setAttribute("checked","checked"),
|
||||
PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,d){if(d||g!=document.activeElement&&n!=document.activeElement){a=!1;for(c=0;c<h.length;c++)d=h[c],C?"custom"==d.key&&(q.value=d.key,C=!1):null!=d.format&&("a4"==d.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==d.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==d.format.width&&
|
||||
e.height==d.format.height?(q.value=d.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==d.format.height&&e.height==d.format.width&&(q.value=d.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(u.style.display="",f.style.display="none"):(g.value=e.width/100,n.value=e.height/100,l.setAttribute("checked","checked"),
|
||||
q.value="custom",u.style.display="none",f.style.display="")}}b="format-"+b;var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var u=document.createElement("div");u.style.marginLeft="4px";u.style.width="210px";
|
||||
u.style.height="24px";l.style.marginRight="6px";u.appendChild(l);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));u.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";u.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));u.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height="24px";var g=document.createElement("input");
|
||||
g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var n=document.createElement("input");n.setAttribute("size","7");n.style.textAlign="right";f.appendChild(n);mxUtils.write(f," in");u.style.display="none";f.style.display="none";for(var r={},h=PageSetupDialog.getFormats(),m=0;m<h.length;m++){var w=h[m];r[w.key]=w;var v=document.createElement("option");v.setAttribute("value",w.key);mxUtils.write(v,w.title);q.appendChild(v)}var C=!1;k();a.appendChild(q);mxUtils.br(a);
|
||||
|
@ -2039,16 +2039,16 @@ mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),c.styl
|
|||
mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
|
||||
null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",g="";if(a.isGridEnabled()){g=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",g=a.gridSize*this.scale*this.gridSteps):
|
||||
d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);g=-Math.round(g-mxUtils.mod(this.translate.x*this.scale-c,g))+"px "+-Math.round(g-mxUtils.mod(this.translate.y*this.scale-e,g))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=g,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
|
||||
b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
|
||||
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
|
||||
this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,r=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var m=
|
||||
new mxRectangle(d*g.x,d*g.y,e.width*r,e.height*r),k=(a=a&&Math.min(m.width,m.height)>this.minPageBreakDist)?Math.ceil(c/m.height)-1:0,v=a?Math.ceil(b/m.width)-1:0,q=h.x+b,y=h.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*m.height)),
|
||||
new mxPoint(Math.round(q),Math.round(h.y+(b+1)*m.height))]:[new mxPoint(Math.round(h.x+(b+1)*m.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*m.width),Math.round(y))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
||||
var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
|
||||
!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),r=Math.floor(Math.min(0,
|
||||
c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+r*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-r)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
|
||||
a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=l.apply(this,arguments),g=b.getParent(d);
|
||||
if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
|
||||
b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var d=this.graph.gridSize*this.scale;d<this.minGridSize;)d*=2;for(var c=this.gridSteps*d,b=[],g=1;g<this.gridSteps;g++){var e=g*d;b.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
|
||||
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+b.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(d,b){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
|
||||
this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+d,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+b,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,d,c){var b=this.view.scale,g=this.view.translate,e=this.pageFormat,r=b*this.pageScale,h=this.view.getBackgroundPageBounds();d=h.width;c=h.height;var m=
|
||||
new mxRectangle(b*g.x,b*g.y,e.width*r,e.height*r),k=(a=a&&Math.min(m.width,m.height)>this.minPageBreakDist)?Math.ceil(c/m.height)-1:0,v=a?Math.ceil(d/m.width)-1:0,q=h.x+d,y=h.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:v,d=0;d<=c;d++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(d+1)*m.height)),
|
||||
new mxPoint(Math.round(q),Math.round(h.y+(d+1)*m.height))]:[new mxPoint(Math.round(h.x+(d+1)*m.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(d+1)*m.width),Math.round(y))];null!=a[d]?(a[d].points=b,a[d].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[d]=b)}for(d=c;d<a.length;d++)a[d].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
||||
var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(d,c){return this.isConnecting()?
|
||||
!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),d=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,b=this.graph.pageFormat,g=this.graph.pageScale,e=b.width*g,b=b.height*g,g=Math.floor(Math.min(0,d)/e),r=Math.floor(Math.min(0,
|
||||
c)/b);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+r*b),this.scale*(Math.ceil(Math.max(1,d+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/b)-r)*b)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
|
||||
a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,d,c,b,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var d=this.graph.getModel(),c=d.getParent(this.graph.getSelectionCell()),b=l.apply(this,arguments),g=d.getParent(b);
|
||||
if(null==c||c!=b&&c!=g)for(;!this.graph.isCellSelected(b)&&!this.graph.isCellSelected(g)&&d.isVertex(g)&&!this.graph.isContainer(g);)b=g,g=this.graph.getModel().getParent(b);return b};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,d){var c=p.apply(this,arguments);if(!c)for(var b=this.graph.getModel(),g=b.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&b.isVertex(g)){c=!0;break}g=b.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
|
||||
function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&&
|
||||
(a=c),c=b.getParent(c);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;d.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
|
||||
this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||d.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
|
||||
|
@ -2651,8 +2651,9 @@ DrawioFile.prototype.mergeFile=function(a,b,e){try{var d=null!=this.shadowPages?
|
|||
this.inConflictState=!0;null!=window.console&&"1"==urlParams.test&&console.log(g);null!=e&&e(g);try{var c=this.getCurrentUser(),f=null!=c?this.ui.hashValue(c.id):"unknown";EditorUi.sendReport("Error in mergeFile "+(new Date).toISOString()+":\n\nFile="+this.getId()+" ("+this.getMode()+")\n"+(null!=this.sync?"Client="+this.sync.clientId+"\n":"")+"User="+f+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStack:\n"+g.stack)}catch(n){}}};
|
||||
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var k=this.ui.anonymizeNode(b.encode(new mxGraphModel(a[d].root)));k.setAttribute("id",a[d].getId());null!=a[d].getName()&&k.setAttribute("name",this.ui.anonymizeString(a[d].getName()));a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,k);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
|
||||
DrawioFile.prototype.checkPages=function(){this.ui.getCurrentFile()!=this||null!=this.ui.pages&&0!=this.ui.pages.length||this.sendErrorReport("Pages is null or empty","ShadowPages: "+(null!=this.shadowPages)+"\nShadowData: "+(null!=this.shadowData))};
|
||||
DrawioFile.prototype.checkShadow=function(a){null!=a&&0!=a.length||this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+(null!=this.shadowData?this.shadowData.length:0))};DrawioFile.prototype.compressReportData=function(a,b){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k)(null!=e?0+e:"")+"\nData:\n"+d}catch(l){}};
|
||||
DrawioFile.prototype.checkShadow=function(a){if(null==a||0==a.length){var b=null==this.shadowData?"null":this.compressReportData(this.ui.anonymizeString(this.shadowData),null,1E3);this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+b)}};
|
||||
DrawioFile.prototype.compressReportData=function(a,b,e){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");null!=e&&null!=a&&a.length>e&&(a=a.substring(0,e)+"[...]");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b){try{var e=this.getCurrentUser(),d=null!=e?this.ui.hashValue(e.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var k=this.getTitle(),l=k.lastIndexOf("."),e="none";0<l&&(e=k.substring(l));var p=Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.getId()+" ("+this.getMode()+")"+(null!=this.sync?"\nClient="+
|
||||
this.sync.clientId:"")+"\nUser="+d+"\nExt="+e+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+p)}catch(q){}};
|
||||
DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.reloads++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),l=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(l,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=this.stats);
|
||||
|
@ -2903,7 +2904,7 @@ window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chro
|
|||
mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):d()}),!0)}else d();return b};EditorUi.prototype.isActive=function(){return this.editor.graph.isEditing()||this.editor.graph.isMouseDown||null!=this.dialog};EditorUi.prototype.runWhenIdle=function(a){if(this.isActive()){var c=mxUtils.bind(this,function(){this.isActive()||(this.editor.graph.removeMouseListener(b),
|
||||
this.editor.removeListener("hideDialog",c),this.editor.graph.removeListener(c),null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a())}),b={mouseDown:function(){},mouseMove:function(){},mouseUp:c};this.editor.graph.addListener(mxEvent.EDITING_STOPPED,c);this.editor.graph.addListener(mxEvent.ESCAPE,c);this.editor.graph.addMouseListener(b);this.editor.addListener("hideDialog",c)}else null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a()};EditorUi.prototype.getHashValueForPages=
|
||||
function(a){for(var c=0,b=new mxGraphModel,d=new mxCodec,e=0;e<a.length;e++){this.updatePageRoot(a[e]);var h=a[e].node.cloneNode(!1);h.removeAttribute("name");b.root=a[e].root;var m=d.encode(b);this.editor.graph.saveViewState(a[e].viewState,m,!0);h.appendChild(m);c=(c<<5)-c+this.hashValue(h)<<0}return c};EditorUi.prototype.hashValue=function(a,b){var c=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,
|
||||
b));if(null!=a.attributes)for(var d=0;d<a.attributes.length;d++){var f=a.attributes[d].name,e=null!=b?b(a,f,!0):a.attributes[d].value;null!=e&&(c^=this.hashValue(f,b)+this.hashValue(e,b))}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)c=(c<<5)-c+this.hashValue(a.childNodes[d],b)<<0}else if(null!=a&&"function"!==typeof a){f=String(a);for(d=e=0;d<f.length;d++)e=(e<<5)-e+f.charCodeAt(d)<<0;c^=e}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
|
||||
b));if(null!=a.attributes)for(var d=0;d<a.attributes.length;d++){var e=a.attributes[d].name,f=null!=b?b(a,e,!0):a.attributes[d].value;null!=f&&(c^=this.hashValue(e,b)+this.hashValue(f,b))}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)c=(c<<5)-c+this.hashValue(a.childNodes[d],b)<<0}else if(null!=a&&"function"!==typeof a){e=String(a);for(d=f=0;d<e.length;d++)f=(f<<5)-f+e.charCodeAt(d)<<0;c^=f}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
|
||||
EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=
|
||||
mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
|
||||
delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=
|
||||
|
@ -3046,7 +3047,7 @@ function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(h.name)||/(\.vs(x|sx?))($
|
|||
mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
||||
mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);
|
||||
if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var l=Math.round(c/g),n=Math.round(f/g),p=document.createElement("canvas");p.width=l;p.height=n;p.getContext("2d").drawImage(a,0,0,l,n);var r=p.toDataURL();if(r.length<b.length){var q=document.createElement("canvas");q.width=l;q.height=n;var u=q.toDataURL();r!==u&&(b=r,c=l,f=n)}}}catch(B){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=
|
||||
d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=l;l+=b;return a.substring(c,l)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<
|
||||
d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,c){var b=l;l+=c;return a.substring(b,l)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<
|
||||
16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var l=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,l);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,l-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,
|
||||
b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(l-8,a.length);break}k+=a.substring(l-8,l-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),
|
||||
"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(r){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=
|
||||
|
|
959
src/main/webapp/js/atlas.min.js
vendored
959
src/main/webapp/js/atlas.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -360,28 +360,38 @@ DrawioFile.prototype.checkShadow = function(shadow)
|
|||
{
|
||||
if (shadow == null || shadow.length == 0)
|
||||
{
|
||||
var data = (this.shadowData == null) ? 'null' :
|
||||
this.compressReportData(
|
||||
this.ui.anonymizeString(
|
||||
this.shadowData),
|
||||
null, 1000);
|
||||
|
||||
this.sendErrorReport(
|
||||
'Shadow is null or empty',
|
||||
'Shadow: ' + ((shadow != null) ? shadow.length : 0) +
|
||||
'\nShadowPages: ' + ((this.shadowPages != null) ?
|
||||
this.shadowPages.length : 0) +
|
||||
'\nShadowData: ' + ((this.shadowData != null) ?
|
||||
this.shadowData.length : 0));
|
||||
'\nShadowData: ' + data);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the listener for automatically saving the diagram for local changes.
|
||||
*/
|
||||
DrawioFile.prototype.compressReportData = function(data, max)
|
||||
DrawioFile.prototype.compressReportData = function(data, limit, max)
|
||||
{
|
||||
max = (max != null) ? max : 10000;
|
||||
limit = (limit != null) ? limit : 10000;
|
||||
|
||||
if (data != null && data.length > max)
|
||||
if (data != null && data.length > limit)
|
||||
{
|
||||
data = this.ui.editor.graph.compress(data) + '\n';
|
||||
}
|
||||
|
||||
if (max != null && data != null && data.length > max)
|
||||
{
|
||||
data = data.substring(0, max) + '[...]';
|
||||
}
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
|
@ -423,9 +433,9 @@ DrawioFile.prototype.checksumError = function(error, patches, details)
|
|||
|
||||
this.sendErrorReport(
|
||||
'Checksum Error',
|
||||
'Patches:\n' + json)
|
||||
((details != null) ? (+ '\n' + details) : '') +
|
||||
'\nData:\n' + data;
|
||||
'Patches:\n' + json +
|
||||
((details != null) ? ('\n\n' + details) : '') +
|
||||
'\n\nData:\n' + data);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
|
2
src/main/webapp/js/embed-static.min.js
vendored
2
src/main/webapp/js/embed-static.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.9",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.10",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
2
src/main/webapp/js/reader.min.js
vendored
2
src/main/webapp/js/reader.min.js
vendored
|
@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
|
|||
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
|
||||
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
||||
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.9",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"10.0.10",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
|
||||
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
|
||||
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
|
||||
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
|
||||
|
|
37
src/main/webapp/js/viewer.min.js
vendored
37
src/main/webapp/js/viewer.min.js
vendored
|
@ -2008,8 +2008,8 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
|
|||
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
|
||||
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
|
||||
var PrintDialog=function(a,b){this.create(a,b)};
|
||||
PrintDialog.prototype.create=function(a){function b(a){var d=q.checked||c.checked,b=parseInt(g.value)/100;isNaN(b)&&(b=1,g.value="100%");var b=.75*b,n=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,r=1/e.pageScale;if(d){var k=q.checked?1:parseInt(f.value);isNaN(k)||(r=mxUtils.getScaleForPageCount(k,e,n))}e.getGraphBounds();var y=k=0,n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*b);n.height=Math.ceil(n.height*b);r*=b;!d&&e.pageVisible?(b=e.getPageLayout(),k-=b.x*n.width,y-=b.y*n.height):
|
||||
d=!0;d=PrintDialog.createPrintPreview(e,r,n,0,k,y,d);d.open();a&&PrintDialog.printPreview(d)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var u=document.createElement("span");mxUtils.write(u," "+mxResources.get("fitPage"));
|
||||
PrintDialog.prototype.create=function(a){function b(a){var b=q.checked||c.checked,d=parseInt(g.value)/100;isNaN(d)&&(d=1,g.value="100%");var d=.75*d,n=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,r=1/e.pageScale;if(b){var k=q.checked?1:parseInt(f.value);isNaN(k)||(r=mxUtils.getScaleForPageCount(k,e,n))}e.getGraphBounds();var y=k=0,n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*d);n.height=Math.ceil(n.height*d);r*=d;!b&&e.pageVisible?(d=e.getPageLayout(),k-=d.x*n.width,y-=d.y*n.height):
|
||||
b=!0;b=PrintDialog.createPrintPreview(e,r,n,0,k,y,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,d,k,l=document.createElement("table");l.style.width="100%";l.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var q=document.createElement("input");q.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(q);var u=document.createElement("span");mxUtils.write(u," "+mxResources.get("fitPage"));
|
||||
k.appendChild(u);mxEvent.addListener(u,"click",function(a){q.checked=!q.checked;c.checked=!q.checked;mxEvent.consume(a)});mxEvent.addListener(q,"change",function(){c.checked=!q.checked});d.appendChild(k);p.appendChild(d);d=d.cloneNode(!1);var c=document.createElement("input");c.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);u=document.createElement("span");mxUtils.write(u," "+mxResources.get("posterPrint")+":");k.appendChild(u);mxEvent.addListener(u,
|
||||
"click",function(a){c.checked=!c.checked;q.checked=!c.checked;mxEvent.consume(a)});d.appendChild(k);var f=document.createElement("input");f.setAttribute("value","1");f.setAttribute("type","number");f.setAttribute("min","1");f.setAttribute("size","4");f.setAttribute("disabled","disabled");f.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(f);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);p.appendChild(d);mxEvent.addListener(c,"change",
|
||||
function(){c.checked?f.removeAttribute("disabled"):f.setAttribute("disabled","disabled");q.checked=!c.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var g=document.createElement("input");g.setAttribute("value","100 %");g.setAttribute("size","5");g.style.width="50px";k.appendChild(g);d.appendChild(k);p.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2;
|
||||
|
@ -2024,8 +2024,8 @@ l.appendChild(c);mxUtils.write(l,mxResources.get("gridSize")+":");var g=document
|
|||
":");k.appendChild(l);l=document.createElement("td");var n=document.createElement("a");n.style.textDecoration="underline";n.style.cursor="pointer";n.style.color="#a0a0a0";var r=d.backgroundImage;mxEvent.addListener(n,"click",function(c){a.showBackgroundImageDialog(function(a){r=a;e()});mxEvent.consume(c)});e();l.appendChild(n);k.appendChild(l);q.appendChild(k);k=document.createElement("tr");l=document.createElement("td");l.colSpan=2;l.style.paddingTop="16px";l.setAttribute("align","right");var h=
|
||||
mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});h.className="geBtn";a.editor.cancelFirst&&l.appendChild(h);var m=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==g.value&&d.setGridSize(parseInt(g.value));var c=new ChangePageSetup(a,f,r,u.get());c.ignoreColor=d.background==f;c.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=r?r.src:null);d.pageFormat.width==c.previousFormat.width&&d.pageFormat.height==c.previousFormat.height&&
|
||||
c.ignoreColor&&c.ignoreImage||d.model.execute(c)});m.className="geBtn gePrimaryBtn";l.appendChild(m);a.editor.cancelFirst||l.appendChild(h);k.appendChild(l);q.appendChild(k);p.appendChild(q);this.container=p};
|
||||
PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,b){if(b||g!=document.activeElement&&n!=document.activeElement){a=!1;for(c=0;c<h.length;c++)b=h[c],C?"custom"==b.key&&(q.value=b.key,C=!1):null!=b.format&&("a4"==b.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==b.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==b.format.width&&
|
||||
e.height==b.format.height?(q.value=b.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==b.format.height&&e.height==b.format.width&&(q.value=b.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(u.style.display="",f.style.display="none"):(g.value=e.width/100,n.value=e.height/100,l.setAttribute("checked","checked"),
|
||||
PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,c,d){if(d||g!=document.activeElement&&n!=document.activeElement){a=!1;for(c=0;c<h.length;c++)d=h[c],C?"custom"==d.key&&(q.value=d.key,C=!1):null!=d.format&&("a4"==d.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==d.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==d.format.width&&
|
||||
e.height==d.format.height?(q.value=d.key,l.setAttribute("checked","checked"),l.defaultChecked=!0,l.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):e.width==d.format.height&&e.height==d.format.width&&(q.value=d.key,l.removeAttribute("checked"),l.defaultChecked=!1,l.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(u.style.display="",f.style.display="none"):(g.value=e.width/100,n.value=e.height/100,l.setAttribute("checked","checked"),
|
||||
q.value="custom",u.style.display="none",f.style.display="")}}b="format-"+b;var l=document.createElement("input");l.setAttribute("name",b);l.setAttribute("type","radio");l.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var q=document.createElement("select");q.style.marginBottom="8px";q.style.width="202px";var u=document.createElement("div");u.style.marginLeft="4px";u.style.width="210px";
|
||||
u.style.height="24px";l.style.marginRight="6px";u.appendChild(l);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));u.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";u.appendChild(p);var c=document.createElement("span");c.style.width="100px";mxUtils.write(c,mxResources.get("landscape"));u.appendChild(c);var f=document.createElement("div");f.style.marginLeft="4px";f.style.width="210px";f.style.height="24px";var g=document.createElement("input");
|
||||
g.setAttribute("size","7");g.style.textAlign="right";f.appendChild(g);mxUtils.write(f," in x ");var n=document.createElement("input");n.setAttribute("size","7");n.style.textAlign="right";f.appendChild(n);mxUtils.write(f," in");u.style.display="none";f.style.display="none";for(var r={},h=PageSetupDialog.getFormats(),m=0;m<h.length;m++){var w=h[m];r[w.key]=w;var v=document.createElement("option");v.setAttribute("value",w.key);mxUtils.write(v,w.title);q.appendChild(v)}var C=!1;k();a.appendChild(q);mxUtils.br(a);
|
||||
|
@ -2039,16 +2039,16 @@ mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),c.styl
|
|||
mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
|
||||
null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",g="";if(a.isGridEnabled()){g=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",g=a.gridSize*this.scale*this.gridSteps):
|
||||
d="url("+this.gridImage+")";var e=c=0;null!=a.view.backgroundPageShape&&(e=this.getBackgroundPageBounds(),c=1+e.x,e=1+e.y);g=-Math.round(g-mxUtils.mod(this.translate.x*this.scale-c,g))+"px "+-Math.round(g-mxUtils.mod(this.translate.y*this.scale-e,g))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=g,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
|
||||
b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],g=1;g<this.gridSteps;g++){var e=g*b;d.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
|
||||
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
|
||||
this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+b,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+d,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,g=this.view.translate,e=this.pageFormat,r=d*this.pageScale,h=this.view.getBackgroundPageBounds();b=h.width;c=h.height;var m=
|
||||
new mxRectangle(d*g.x,d*g.y,e.width*r,e.height*r),k=(a=a&&Math.min(m.width,m.height)>this.minPageBreakDist)?Math.ceil(c/m.height)-1:0,v=a?Math.ceil(b/m.width)-1:0,q=h.x+b,y=h.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:v,b=0;b<=c;b++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(b+1)*m.height)),
|
||||
new mxPoint(Math.round(q),Math.round(h.y+(b+1)*m.height))]:[new mxPoint(Math.round(h.x+(b+1)*m.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(b+1)*m.width),Math.round(y))];null!=a[b]?(a[b].points=d,a[b].redraw()):(d=new mxPolyline(d,this.pageBreakColor),d.dialect=this.dialect,d.isDashed=this.pageBreakDashed,d.pointerEvents=!1,d.init(this.view.backgroundPane),d.redraw(),a[b]=d)}for(b=c;b<a.length;b++)a[b].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
||||
var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
|
||||
!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,g=this.graph.pageScale,e=d.width*g,d=d.height*g,g=Math.floor(Math.min(0,b)/e),r=Math.floor(Math.min(0,
|
||||
c)/d);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+r*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-r)*d)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
|
||||
a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=l.apply(this,arguments),g=b.getParent(d);
|
||||
if(null==c||c!=d&&c!=g)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(g)&&b.isVertex(g)&&!this.graph.isContainer(g);)d=g,g=this.graph.getModel().getParent(d);return d};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=p.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),g=d.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&d.isVertex(g)){c=!0;break}g=d.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
|
||||
b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=g,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var d=this.graph.gridSize*this.scale;d<this.minGridSize;)d*=2;for(var c=this.gridSteps*d,b=[],g=1;g<this.gridSteps;g++){var e=g*d;b.push("M 0 "+e+" L "+c+" "+e+" M "+e+" 0 L "+e+" "+c)}return'<svg width="'+
|
||||
c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+b.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(d,b){a.apply(this,arguments);if(null!=this.shiftPreview1){var c=
|
||||
this.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);var f=this.gridSize*this.view.scale*this.view.gridSteps,f=-Math.round(f-mxUtils.mod(this.view.translate.x*this.view.scale+d,f))+"px "+-Math.round(f-mxUtils.mod(this.view.translate.y*this.view.scale+b,f))+"px";c.style.backgroundPosition=f}};mxGraph.prototype.updatePageBreaks=function(a,d,c){var b=this.view.scale,g=this.view.translate,e=this.pageFormat,r=b*this.pageScale,h=this.view.getBackgroundPageBounds();d=h.width;c=h.height;var m=
|
||||
new mxRectangle(b*g.x,b*g.y,e.width*r,e.height*r),k=(a=a&&Math.min(m.width,m.height)>this.minPageBreakDist)?Math.ceil(c/m.height)-1:0,v=a?Math.ceil(d/m.width)-1:0,q=h.x+d,y=h.y+c;null==this.horizontalPageBreaks&&0<k&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<v&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?k:v,d=0;d<=c;d++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(h.x),Math.round(h.y+(d+1)*m.height)),
|
||||
new mxPoint(Math.round(q),Math.round(h.y+(d+1)*m.height))]:[new mxPoint(Math.round(h.x+(d+1)*m.width),Math.round(h.y)),new mxPoint(Math.round(h.x+(d+1)*m.width),Math.round(y))];null!=a[d]?(a[d].points=b,a[d].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[d]=b)}for(d=c;d<a.length;d++)a[d].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
|
||||
var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,c){for(var f=0;f<d.length;f++)if(this.graph.getModel().isVertex(d[f])){var g=this.graph.getCellGeometry(d[f]);if(null!=g&&g.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(d,c){return this.isConnecting()?
|
||||
!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),d=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,b=this.graph.pageFormat,g=this.graph.pageScale,e=b.width*g,b=b.height*g,g=Math.floor(Math.min(0,d)/e),r=Math.floor(Math.min(0,
|
||||
c)/b);return new mxRectangle(this.scale*(this.translate.x+g*e),this.scale*(this.translate.y+r*b),this.scale*(Math.ceil(Math.max(1,d+a.width/this.scale)/e)-g)*e,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/b)-r)*b)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
|
||||
a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,d,c,b,g,e){var f=k.apply(this,arguments);null==e||e||mxEvent.addListener(f,"mousedown",function(a){mxEvent.consume(a)});return f};var l=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var d=this.graph.getModel(),c=d.getParent(this.graph.getSelectionCell()),b=l.apply(this,arguments),g=d.getParent(b);
|
||||
if(null==c||c!=b&&c!=g)for(;!this.graph.isCellSelected(b)&&!this.graph.isCellSelected(g)&&d.isVertex(g)&&!this.graph.isContainer(g);)b=g,g=this.graph.getModel().getParent(b);return b};var p=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,d){var c=p.apply(this,arguments);if(!c)for(var b=this.graph.getModel(),g=b.getParent(a);null!=g;){if(this.graph.isCellSelected(g)&&b.isVertex(g)){c=!0;break}g=b.getParent(g)}return c};mxGraphHandler.prototype.selectDelayed=
|
||||
function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&&
|
||||
(a=c),c=b.getParent(c);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;d.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
|
||||
this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||d.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
|
||||
|
@ -2651,8 +2651,9 @@ DrawioFile.prototype.mergeFile=function(a,b,e){try{var d=null!=this.shadowPages?
|
|||
this.inConflictState=!0;null!=window.console&&"1"==urlParams.test&&console.log(g);null!=e&&e(g);try{var c=this.getCurrentUser(),f=null!=c?this.ui.hashValue(c.id):"unknown";EditorUi.sendReport("Error in mergeFile "+(new Date).toISOString()+":\n\nFile="+this.getId()+" ("+this.getMode()+")\n"+(null!=this.sync?"Client="+this.sync.clientId+"\n":"")+"User="+f+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStack:\n"+g.stack)}catch(n){}}};
|
||||
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var k=this.ui.anonymizeNode(b.encode(new mxGraphModel(a[d].root)));k.setAttribute("id",a[d].getId());null!=a[d].getName()&&k.setAttribute("name",this.ui.anonymizeString(a[d].getName()));a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,k);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
|
||||
DrawioFile.prototype.checkPages=function(){this.ui.getCurrentFile()!=this||null!=this.ui.pages&&0!=this.ui.pages.length||this.sendErrorReport("Pages is null or empty","ShadowPages: "+(null!=this.shadowPages)+"\nShadowData: "+(null!=this.shadowData))};
|
||||
DrawioFile.prototype.checkShadow=function(a){null!=a&&0!=a.length||this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+(null!=this.shadowData?this.shadowData.length:0))};DrawioFile.prototype.compressReportData=function(a,b){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k)(null!=e?0+e:"")+"\nData:\n"+d}catch(l){}};
|
||||
DrawioFile.prototype.checkShadow=function(a){if(null==a||0==a.length){var b=null==this.shadowData?"null":this.compressReportData(this.ui.anonymizeString(this.shadowData),null,1E3);this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:0)+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:0)+"\nShadowData: "+b)}};
|
||||
DrawioFile.prototype.compressReportData=function(a,b,e){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");null!=e&&null!=a&&a.length>e&&(a=a.substring(0,e)+"[...]");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b){try{var e=this.getCurrentUser(),d=null!=e?this.ui.hashValue(e.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var k=this.getTitle(),l=k.lastIndexOf("."),e="none";0<l&&(e=k.substring(l));var p=Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.getId()+" ("+this.getMode()+")"+(null!=this.sync?"\nClient="+
|
||||
this.sync.clientId:"")+"\nUser="+d+"\nExt="+e+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+p)}catch(q){}};
|
||||
DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.reloads++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),l=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(l,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=this.stats);
|
||||
|
@ -2903,7 +2904,7 @@ window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chro
|
|||
mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):d()}),!0)}else d();return b};EditorUi.prototype.isActive=function(){return this.editor.graph.isEditing()||this.editor.graph.isMouseDown||null!=this.dialog};EditorUi.prototype.runWhenIdle=function(a){if(this.isActive()){var c=mxUtils.bind(this,function(){this.isActive()||(this.editor.graph.removeMouseListener(b),
|
||||
this.editor.removeListener("hideDialog",c),this.editor.graph.removeListener(c),null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a())}),b={mouseDown:function(){},mouseMove:function(){},mouseUp:c};this.editor.graph.addListener(mxEvent.EDITING_STOPPED,c);this.editor.graph.addListener(mxEvent.ESCAPE,c);this.editor.graph.addMouseListener(b);this.editor.addListener("hideDialog",c)}else null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a()};EditorUi.prototype.getHashValueForPages=
|
||||
function(a){for(var c=0,b=new mxGraphModel,d=new mxCodec,e=0;e<a.length;e++){this.updatePageRoot(a[e]);var h=a[e].node.cloneNode(!1);h.removeAttribute("name");b.root=a[e].root;var m=d.encode(b);this.editor.graph.saveViewState(a[e].viewState,m,!0);h.appendChild(m);c=(c<<5)-c+this.hashValue(h)<<0}return c};EditorUi.prototype.hashValue=function(a,b){var c=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,
|
||||
b));if(null!=a.attributes)for(var d=0;d<a.attributes.length;d++){var f=a.attributes[d].name,e=null!=b?b(a,f,!0):a.attributes[d].value;null!=e&&(c^=this.hashValue(f,b)+this.hashValue(e,b))}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)c=(c<<5)-c+this.hashValue(a.childNodes[d],b)<<0}else if(null!=a&&"function"!==typeof a){f=String(a);for(d=e=0;d<f.length;d++)e=(e<<5)-e+f.charCodeAt(d)<<0;c^=e}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
|
||||
b));if(null!=a.attributes)for(var d=0;d<a.attributes.length;d++){var e=a.attributes[d].name,f=null!=b?b(a,e,!0):a.attributes[d].value;null!=f&&(c^=this.hashValue(e,b)+this.hashValue(f,b))}if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)c=(c<<5)-c+this.hashValue(a.childNodes[d],b)<<0}else if(null!=a&&"function"!==typeof a){e=String(a);for(d=f=0;d<e.length;d++)f=(f<<5)-f+e.charCodeAt(d)<<0;c^=f}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
|
||||
EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=
|
||||
mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
|
||||
delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=
|
||||
|
@ -3046,7 +3047,7 @@ function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(h.name)||/(\.vs(x|sx?))($
|
|||
mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
|
||||
mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,k,h){k=null!=k?k:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);
|
||||
if(e&&this.isResampleImage(b,h))try{var g=Math.max(c/k,f/k);if(1<g){var l=Math.round(c/g),n=Math.round(f/g),p=document.createElement("canvas");p.width=l;p.height=n;p.getContext("2d").drawImage(a,0,0,l,n);var r=p.toDataURL();if(r.length<b.length){var q=document.createElement("canvas");q.width=l;q.height=n;var u=q.toDataURL();r!==u&&(b=r,c=l,f=n)}}}catch(B){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var e=0;256>e;e++)for(var d=e,k=0;8>k;k++)d=1==(d&1)?3988292384^d>>>1:d>>>1,EditorUi.prototype.crcTable[e]=
|
||||
d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,b){var c=l;l+=b;return a.substring(c,l)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<
|
||||
d;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b[d+c])&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,k){function c(a,c){var b=l;l+=c;return a.substring(b,l)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<
|
||||
16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var l=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=k&&k();else if(c(a,4),"IHDR"!=c(a,4))null!=k&&k();else{c(a,17);k=a.substring(0,l);do{var n=f(a);if("IDAT"==c(a,4)){k=a.substring(0,l-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;e=this.updateCRC(e,
|
||||
b,0,4);e=this.updateCRC(e,d,0,d.length);k+=g(d.length)+b+d+g(e^4294967295);k+=a.substring(l-8,a.length);break}k+=a.substring(l-8,l-4+n);c(a,n);c(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(k):Base64.encode(k,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,e){a=d.substring(a+8,a+8+e);"zTXt"==c?(e=a.indexOf(String.fromCharCode(0)),
|
||||
"mxGraphModel"==a.substring(0,e)&&(a=this.editor.graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(r){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=
|
||||
|
|
Loading…
Reference in a new issue