10.0.24 release
This commit is contained in:
parent
9c72843d09
commit
1d722cebfe
11 changed files with 82 additions and 65 deletions
|
@ -1,3 +1,11 @@
|
|||
08-JAN-2019: 10.0.25
|
||||
|
||||
- Ignores previous attribute in checksum
|
||||
|
||||
08-JAN-2019: 10.0.24
|
||||
|
||||
- Fixes critical bug with collaborative editing
|
||||
|
||||
08-JAN-2019: 10.0.23
|
||||
|
||||
- Adds debug output for checksum errors
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.0.23
|
||||
10.0.24
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 01/08/2019 02:25 PM
|
||||
# 01/08/2019 04:47 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
24
src/main/webapp/js/app.min.js
vendored
24
src/main/webapp/js/app.min.js
vendored
|
@ -7875,7 +7875,7 @@ this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnab
|
|||
var ErrorDialog=function(a,c,b,d,e,g,k,l,n,f,h){n=null!=n?n:!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(){n&&a.hideDialog();null!=e&&e()});q.className="geBtn";b.appendChild(q);null!=k&&(d=mxUtils.button(k,function(){n&&a.hideDialog();null!=l&&l()}),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.23";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.24";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,
|
||||
|
@ -7936,11 +7936,11 @@ null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getM
|
|||
this.getSearch(["url"]):null!=b?this.fileLoaded(b):d()}),!0)}else d();return c};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 b=mxUtils.bind(this,function(){this.isActive()||(this.editor.graph.removeMouseListener(c),this.editor.removeListener("hideDialog",b),this.editor.graph.removeListener(b),null!=window.requestAnimationFrame?window.requestAnimationFrame(a):
|
||||
a())}),c={mouseDown:function(){},mouseMove:function(){},mouseUp:b};this.editor.graph.addListener(mxEvent.EDITING_STOPPED,b);this.editor.graph.addListener(mxEvent.ESCAPE,b);this.editor.graph.addMouseListener(c);this.editor.addListener("hideDialog",b)}else null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a()};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,d=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0,b.cellCount=0);
|
||||
for(var h=0;h<a.length;h++){this.updatePageRoot(a[h]);var e=a[h].node.cloneNode(!1);e.removeAttribute("name");d.root=a[h].root;var g=f.encode(d);this.editor.graph.saveViewState(a[h].viewState,g,!0);e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length,b.cellCount+=d.getDescendants(d.root).length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=
|
||||
b&&"height"!=b?c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var h=a.attributes[f].name,e=null!=b?b(a,h,a.attributes[f].value,!0):a.attributes[f].value;null!=e&&(d^=this.hashValue(h,
|
||||
b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,k){};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 b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);
|
||||
return mxUtils.getXml(b)};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 b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;
|
||||
if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
b&&"height"!=b?d&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var h=a.attributes[f].name,e=null!=b?b(a,h,a.attributes[f].value,!0):a.attributes[f].value;
|
||||
null!=e&&(d^=this.hashValue(h,b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,k){};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 b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));
|
||||
b.appendChild(c);return mxUtils.getXml(b)};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 b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=
|
||||
this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,h=mxUtils.bind(this,function(b,c){0==b.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,
|
||||
"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f)):this.addLibraryEntries(b,c)});if(null!=this.sidebar&&null!=b)for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
||||
"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);c=null!=c&&0<c.length?c:a.getTitle();var m=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){h(b,a)}));this.repositionLibrary(d);
|
||||
|
@ -8188,7 +8188,7 @@ this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getSta
|
|||
arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,d,e,g){var f=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(f.getSvg(d,e,g)),"image/svg+xml");else{var h=a.getFileData(!0,null,null,null,null,!0),k=f.getGraphBounds(),l=Math.floor(k.width*e/f.view.scale),m=Math.floor(k.height*e/f.view.scale);
|
||||
h.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=d?d:"none")+"&w="+l+"&h="+m+"&border="+g+"&xml="+encodeURIComponent(h))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=
|
||||
c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==c){a.contains(f.previous)&&(d=f.child);
|
||||
break}}return d}})();EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellPrototype=new mxCell;
|
||||
break}}return d}})();EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectIdentity:!0,mxTransient:!0};
|
||||
EditorUi.prototype.patchPages=function(a,c,b,d,e){var g={},k=[],l={},n={},f={},h={};if(null!=d&&null!=d[EditorUi.DIFF_UPDATE])for(var m in d[EditorUi.DIFF_UPDATE])g[m]=d[EditorUi.DIFF_UPDATE][m];if(null!=c[EditorUi.DIFF_REMOVE])for(d=0;d<c[EditorUi.DIFF_REMOVE].length;d++)n[c[EditorUi.DIFF_REMOVE][d]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(d=0;d<c[EditorUi.DIFF_INSERT].length;d++)l[c[EditorUi.DIFF_INSERT][d].previous]=c[EditorUi.DIFF_INSERT][d];if(null!=c[EditorUi.DIFF_UPDATE])for(m in c[EditorUi.DIFF_UPDATE])d=
|
||||
c[EditorUi.DIFF_UPDATE][m],null!=d.previous&&(h[d.previous]=m);if(null!=a){var p="";for(d=0;d<a.length;d++){var q=a[d].getId();f[q]=a[d];null!=h[p]||n[q]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][q]&&null!=c[EditorUi.DIFF_UPDATE][q].previous||(h[p]=q);p=q}}var u={},v=mxUtils.bind(this,function(a){var d=null!=a?a.getId():"";if(null!=a&&!u[d]){u[d]=!0;k.push(a);var m=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][d]:null;null!=m&&(this.updatePageRoot(a),null!=m.name&&a.setName(m.name),
|
||||
null!=m.view&&this.patchViewState(a,m.view),null!=m.cells&&this.patchPage(a,m.cells,g[a.getId()],e),!b||null==m.cells&&null==m.view||(a.needsUpdate=!0))}a=h[d];null!=a&&(delete h[d],v(f[a]));a=l[d];null!=a&&(delete l[d],x(a))}),x=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=f[a.getId()];null==c?v(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});v();for(m in h)v(f[h[m]]),
|
||||
|
@ -8201,7 +8201,7 @@ u=e.getCell(h.id),null!=u&&(e.setTerminal(u,e.getCell(h.source),!0),e.setTermina
|
|||
EditorUi.prototype.patchCellRecursive=function(a,c,b,d,e){for(var g=d[b.getId()],k=null!=g&&null!=g.inserted?g.inserted:{},l=null!=g&&null!=g.moved?g.moved:{},n=0,g=c.getChildCount(b),f="",h=0;h<g;h++){var m=c.getChildAt(b,h).getId();null==l[f]&&(null==e[EditorUi.DIFF_UPDATE]||null==e[EditorUi.DIFF_UPDATE][m]||null==e[EditorUi.DIFF_UPDATE][m].previous&&null==e[EditorUi.DIFF_UPDATE][m].parent)&&(l[f]=m);f=m}var p=mxUtils.bind(this,function(f){var g=null!=f?f.getId():"";null!=f&&(c.getChildAt(b,n)!=
|
||||
f&&c.add(b,f,n),this.patchCellRecursive(a,c,f,d,e),n++);f=l[g];null!=f&&(delete l[g],p(c.getCell(f)));f=k[g];null!=f&&(delete k[g],p(this.getCellForJson(f)))});p();for(var q in l)p(c.getCell(l[q])),delete l[q];for(q in k)p(this.getCellForJson(k[q])),delete k[q]};
|
||||
EditorUi.prototype.patchCell=function(a,c,b,d){if(null!=c&&null!=b){if(null==d||null==d.xmlValue&&(null==d.value||""==d.value))null!=b.value?a.setValue(c,b.value):null!=b.xmlValue&&a.setValue(c,mxUtils.parseXml(b.xmlValue).documentElement);null!=d&&null!=d.style||null==b.style||a.setStyle(c,b.style);null!=b.visible&&a.setVisible(c,1==b.visible);null!=b.collapsed&&a.setCollapsed(c,1==b.collapsed);null!=b.vertex&&(c.vertex=1==b.vertex);null!=b.edge&&(c.edge=1==b.edge);null!=b.connectable&&(c.connectable=
|
||||
1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var e in b)e in this.cellPrototype||(c[e]=b[e])}};
|
||||
1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var e in b)this.cellProperties[e]||(c[e]=b[e])}};
|
||||
EditorUi.prototype.getPagesForNode=function(a){var c=this.editor.extractGraphModel(a,!0);null!=c&&(a=c);a=a.getElementsByTagName("diagram");for(var c=[],b=0;b<a.length;b++){var d=new DiagramPage(a[b]);this.updatePageRoot(d);c.push(d)}return c};
|
||||
EditorUi.prototype.diffPages=function(a,c){for(var b=[],d=[],e={},g={},k={},l=null,n=0;n<c.length;n++)g[c[n].getId()]={page:c[n],prev:l},l=c[n];l=null;for(n=0;n<a.length;n++){var f=a[n].getId(),h=g[f];if(null==h)d.push(f);else{var m=this.diffPage(a[n],h.page),p={};0<Object.keys(m).length&&(p.cells=m);m=this.diffViewState(a[n],h.page);0<Object.keys(m).length&&(p.view=m);if((null!=h.prev?null==l:null!=l)||null!=l&&null!=h.prev&&l.getId()!=h.prev.getId())p.previous=null!=h.prev?h.prev.getId():"";null!=
|
||||
h.page.getName()&&a[n].getName()!=h.page.getName()&&(p.name=h.page.getName());0<Object.keys(p).length&&(k[f]=p)}delete g[a[n].getId()];l=a[n]}for(f in g)h=g[f],b.push({data:mxUtils.getXml(h.page.node),previous:null!=h.prev?h.prev.getId():""});0<Object.keys(k).length&&(e[EditorUi.DIFF_UPDATE]=k);0<d.length&&(e[EditorUi.DIFF_REMOVE]=d);0<b.length&&(e[EditorUi.DIFF_INSERT]=b);return e};
|
||||
|
@ -8209,13 +8209,13 @@ EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]=
|
|||
EditorUi.prototype.diffCellRecursive=function(a,c,b,d,e){d=null!=d?d:{};var g=b[a.getId()];delete b[a.getId()];if(null==g)e.push(a.getId());else{var k=this.diffCell(a,g.cell);if(null!=k.parent||(null!=g.prev?null==c:null!=c)||null!=c&&null!=g.prev&&c.getId()!=g.prev.getId())k.previous=null!=g.prev?g.prev.getId():"";0<Object.keys(k).length&&(d[a.getId()]=k)}g=a.getChildCount();c=null;for(k=0;k<g;k++){var l=a.getChildAt(k);this.diffCellRecursive(l,c,b,d,e);c=l}return d};
|
||||
EditorUi.prototype.diffPage=function(a,c){var b=[],d=[],e={};this.updatePageRoot(a);this.updatePageRoot(c);var g=this.createCellLookup(c.root),k=this.diffCellRecursive(a.root,null,g,k,d),l;for(l in g){var n=g[l];b.push(this.getJsonForCell(n.cell,n.prev))}0<Object.keys(k).length&&(e[EditorUi.DIFF_UPDATE]=k);0<d.length&&(e[EditorUi.DIFF_REMOVE]=d);0<b.length&&(e[EditorUi.DIFF_INSERT]=b);return e};
|
||||
EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,d=c.viewState,e={};c==this.currentPage&&(d=this.editor.graph.getViewState());if(null!=b&&null!=d)for(var g in this.viewStateProperties){var k=JSON.stringify(b[g]),l=JSON.stringify(d[g]);k!=l&&(e[g]=l)}return e};
|
||||
EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var d in a)d in this.cellPrototype||(c[d]=a[d]);return c};
|
||||
EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var d in a)this.cellProperties[d]||(c[d]=a[d]);return c};
|
||||
EditorUi.prototype.getJsonForCell=function(a,c){var b={id:a.getId()};a.vertex&&(b.vertex=1);a.edge&&(b.edge=1);a.connectable||(b.connectable=0);null!=a.parent&&(b.parent=a.parent.getId());null!=c&&(b.previous=c.getId());null!=a.source&&(b.source=a.source.getId());null!=a.target&&(b.target=a.target.getId());null!=a.style&&(b.style=a.style);null!=a.geometry&&(b.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(b.collapsed=1);a.visible||(b.visible=0);null!=a.value&&("object"===typeof a.value&&
|
||||
"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var d in a)"mxObjectId"==d||d in this.cellPrototype||(b[d]=a[d]);return b};
|
||||
"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var d in a)this.cellProperties[d]||"function"===typeof a[d]||(b[d]=a[d]);return b};
|
||||
EditorUi.prototype.diffCell=function(a,c){function b(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var d={};a.vertex!=c.vertex&&(d.vertex=c.vertex?1:0);a.edge!=c.edge&&(d.edge=c.edge?1:0);a.connectable!=c.connectable&&(d.connectable=c.connectable?1:0);if((null!=a.parent?null==c.parent:null!=c.parent)||null!=a.parent&&null!=c.parent&&a.parent.getId()!=c.parent.getId())d.parent=null!=c.parent?c.parent.getId():"";
|
||||
if((null!=a.source?null==c.source:null!=c.source)||null!=a.source&&null!=c.source&&a.source.getId()!=c.source.getId())d.source=null!=c.source?c.source.getId():"";if((null!=a.target?null==c.target:null!=c.target)||null!=a.target&&null!=c.target&&a.target.getId()!=c.target.getId())d.target=null!=c.target?c.target.getId():"";b(a.value)&&b(c.value)?a.value.isEqualNode(c.value)||(d.xmlValue=mxUtils.getXml(c.value)):a.value!=c.value&&(b(c.value)?d.xmlValue=mxUtils.getXml(c.value):d.value=null!=c.value?
|
||||
c.value:"");a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)||(d.geometry=mxUtils.getXml(this.codec.encode(c.geometry)));for(var e in a)"mxObjectId"==e||e in this.cellPrototype||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);for(e in c)e in a||"mxObjectId"==e||e in this.cellPrototype||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);return d};
|
||||
EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:17,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
c.value:"");a.style!=c.style&&(d.style=c.style);a.visible!=c.visible&&(d.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(d.collapsed=c.collapsed?1:0);this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)||(d.geometry=mxUtils.getXml(this.codec.encode(c.geometry)));for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof c[e]||a[e]==c[e]||(d[e]=void 0===c[e]?null:c[e]);for(e in c)e in a||this.cellProperties[e]||"function"===typeof a[e]||"function"===typeof c[e]||a[e]==
|
||||
c[e]||(d[e]=void 0===c[e]?null:c[e]);return d};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var d=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,d)==JSON.stringify(c,d)};var mxSettings={currentVersion:17,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},isCreateTarget:function(){return mxSettings.settings.createTarget},setCreateTarget:function(a){mxSettings.settings.createTarget=a},getPageFormat:function(){return mxSettings.settings.pageFormat},setPageFormat:function(a){mxSettings.settings.pageFormat=
|
||||
|
|
10
src/main/webapp/js/atlas-viewer.min.js
vendored
10
src/main/webapp/js/atlas-viewer.min.js
vendored
|
@ -2905,11 +2905,11 @@ null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getM
|
|||
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,b){var c=0,d=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0,b.cellCount=0);
|
||||
for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var m=a[e].node.cloneNode(!1);m.removeAttribute("name");d.root=a[e].root;var k=f.encode(d);this.editor.graph.saveViewState(a[e].viewState,k,!0);m.appendChild(k);null!=b&&(b.eltCount+=m.getElementsByTagName("*").length,b.nodeCount+=m.getElementsByTagName("mxCell").length,b.cellCount+=d.getDescendants(d.root).length);c=(c<<5)-c+this.hashValue(m,function(a,c,b,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=
|
||||
c&&"height"!=c?b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){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,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(c^=this.hashValue(e,
|
||||
b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}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=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
c&&"height"!=c?d&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){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,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;
|
||||
null!=g&&(c^=this.hashValue(e,b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}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=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,
|
||||
"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
||||
"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);
|
||||
|
|
58
src/main/webapp/js/atlas.min.js
vendored
58
src/main/webapp/js/atlas.min.js
vendored
|
@ -7542,8 +7542,8 @@ function(){a.hideDialog();e(l.value,p.value)});c.appendChild(n);n.className="geB
|
|||
null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,P,null!=T&&0<T.length?T:null,null,function(){a.hideDialog()},null,b)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function k(a,b,d,f,k){null!=S&&(S.style.backgroundColor="transparent",S.style.border="1px solid transparent");F.removeAttribute("disabled");P=b;T=d;S=a;aa=f;Z=k;S.style.backgroundColor=p;S.style.border=n}function v(b,d,f,c,m,e,q,t,z){var u=document.createElement("div");u.className="geTemplate";
|
||||
u.style.height=Q+"px";u.style.width=L+"px";null!=c&&0<c.length&&u.setAttribute("title",c);if(null!=e)u.style.backgroundImage="url("+e+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){k(u,null,null,b,q)}),mxEvent.addListener(u,"dblclick",function(a){y()});else if(null!=b&&0<b.length){f=z||TEMPLATE_PATH+"/"+b.substring(0,b.length-4)+".png";u.style.backgroundImage="url("+f+")";u.style.backgroundPosition=
|
||||
"center center";u.style.backgroundRepeat="no-repeat";var v=!1;mxEvent.addListener(u,"click",function(f){F.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;mxUtils.get(f,mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&(k(u,a.getText(),d),v&&y())}))});mxEvent.addListener(u,"dblclick",function(a){v=!0})}else u.innerHTML=
|
||||
'<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",m&&k(u),null!=t?mxEvent.addListener(u,"click",t):(mxEvent.addListener(u,"click",function(a){k(u)}),mxEvent.addListener(u,"dblclick",function(a){y()}));N.appendChild(u)}function z(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(w(),mxEvent.consume(a))});var a=null,b;for(b in U){var f=document.createElement("div"),k=mxResources.get(b),
|
||||
c=U[b];null==k&&(k=b.substring(0,1).toUpperCase()+b.substring(1));18<k.length&&(k=k.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",k+" ("+c.length+")");mxUtils.write(f,f.getAttribute("title"));null!=d&&(f.style.padding=d);Y.appendChild(f);null==a&&(a=f,a.style.backgroundColor=l);(function(b,d){mxEvent.addListener(f,"click",function(){a!=d&&(a.style.backgroundColor=
|
||||
'<table width="100%" height="100%" style="line-height:1em;"><tr><td align="center" valign="middle">'+mxResources.get(f)+"</td></tr></table>",m&&k(u),null!=t?mxEvent.addListener(u,"click",t):(mxEvent.addListener(u,"click",function(a){k(u)}),mxEvent.addListener(u,"dblclick",function(a){y()}));N.appendChild(u)}function z(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(w(),mxEvent.consume(a))});var a=null,b;for(b in U){var f=document.createElement("div"),c=mxResources.get(b),
|
||||
k=U[b];null==c&&(c=b.substring(0,1).toUpperCase()+b.substring(1));18<c.length&&(c=c.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;";f.setAttribute("title",c+" ("+k.length+")");mxUtils.write(f,f.getAttribute("title"));null!=d&&(f.style.padding=d);Y.appendChild(f);null==a&&(a=f,a.style.backgroundColor=l);(function(b,d){mxEvent.addListener(f,"click",function(){a!=d&&(a.style.backgroundColor=
|
||||
"",a=d,a.style.backgroundColor=l,N.scrollTop=0,N.innerHTML="",C=0,O=U[b],A=null,w())})})(b,f)}w()}b=null!=b?b:!0;g=null!=g?g:!1;l=null!=l?l:"#ebf2f9";p=null!=p?p:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var D=document.createElement("div");D.style.height="100%";var B=document.createElement("div");B.style.whiteSpace="nowrap";B.style.height="46px";b&&D.appendChild(B);var x=document.createElement("img");x.setAttribute("border","0");x.setAttribute("align","absmiddle");
|
||||
x.style.width="40px";x.style.height="40px";x.style.marginRight="10px";x.style.paddingBottom="4px";x.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&B.appendChild(x);
|
||||
b&&mxUtils.write(B,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");x=".xml";a.mode==App.MODE_GOOGLE&&null!=a.drive?x=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?x=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?x=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?x=a.gitHub.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(x=a.trello.extension);var G=document.createElement("input");
|
||||
|
@ -7578,7 +7578,7 @@ a.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources
|
|||
null;mxEvent.addListener(b,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(b,"dragover",mxUtils.bind(this,function(f){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=a.highlightElement(b));f.stopPropagation();f.preventDefault()}));mxEvent.addListener(b,"drop",mxUtils.bind(this,function(b){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,
|
||||
function(a,b,d,c,m,e,q,t){f(a,t)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!mxEvent.isControlDown(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=b.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)($|\?)/i.test(c)&&f(decodeURIComponent(c))}b.stopPropagation();b.preventDefault()}),!1)}};b=document.createElement("div");b.style.marginTop=mxClient.IS_QUIRKS?"22px":"14px";b.style.textAlign=
|
||||
"right";c=mxUtils.button(mxResources.get("cancel"),function(){a.spinner.stop();a.hideDialog()});c.className="geBtn";a.editor.cancelFirst&&b.appendChild(c);ImageDialog.filePicked=function(a){a.action==google.picker.Action.PICKED&&null!=a.docs[0].thumbnails&&(a=a.docs[0].thumbnails[a.docs[0].thumbnails.length-1],null!=a&&(n.value=a.url));n.focus()};if(Graph.fileSupport){var m=document.createElement("input");m.setAttribute("multiple","multiple");m.setAttribute("type","file");if(null==document.documentMode){mxEvent.addListener(m,
|
||||
"change",function(b){a.importFiles(m.files,0,0,a.maxImageSize,function(a,b,d,k,c,m){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){m.click()});q.className="geBtn";b.appendChild(q)}}document.createElement("canvas").getContext&&"data:image/"==n.value.substring(0,11)&&"data:image/svg"!=n.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,
|
||||
"change",function(b){a.importFiles(m.files,0,0,a.maxImageSize,function(a,b,d,c,m,e){f(a)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},!0)});var q=mxUtils.button(mxResources.get("open"),function(){m.click()});q.className="geBtn";b.appendChild(q)}}document.createElement("canvas").getContext&&"data:image/"==n.value.substring(0,11)&&"data:image/svg"!=n.value.substring(0,14)&&(q=mxUtils.button(mxResources.get("crop"),function(){var b=new CropImageDialog(a,
|
||||
n.value,function(a){n.value=a});a.showDialog(b.container,200,185,!0,!0);b.init()}),q.className="geBtn",b.appendChild(q));"undefined"!=typeof google&&"undefined"!=typeof google.picker&&window.self===window.top&&(q=mxUtils.button(mxResources.get("search"),function(){if(null==a.imageSearchPicker){var b=(new google.picker.PickerBuilder).setLocale(mxLanguage).addView(google.picker.ViewId.IMAGE_SEARCH).enableFeature(google.picker.Feature.NAV_HIDDEN);a.imageSearchPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.imageSearchPicker.setVisible(!0)}),
|
||||
q.className="geBtn",b.appendChild(q),null!=a.drive&&"1"==urlParams.photos&&(q=mxUtils.button(mxResources.get("googlePlus"),function(){a.spinner.spin(document.body,mxResources.get("authorizing"))&&a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();if(null==a.photoPicker){var b=gapi.auth.getToken().access_token,b=(new google.picker.PickerBuilder).setAppId(a.drive.appId).setLocale(mxLanguage).setOAuthToken(b).addView(google.picker.ViewId.PHOTOS).addView(google.picker.ViewId.PHOTO_ALBUMS).addView(google.picker.ViewId.PHOTO_UPLOAD);
|
||||
a.photoPicker=b.setCallback(function(a){ImageDialog.filePicked(a)}).build()}a.photoPicker.setVisible(!0)}))}),q.className="geBtn",b.appendChild(q)));mxEvent.addListener(n,"keypress",function(a){13==a.keyCode&&f(n.value)});q=mxUtils.button(mxResources.get("apply"),function(){f(n.value)});q.className="geBtn gePrimaryBtn";b.appendChild(q);a.editor.cancelFirst||b.appendChild(c);Graph.fileSupport&&(b.style.marginTop="120px",p.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",p.style.backgroundPosition=
|
||||
|
@ -7681,7 +7681,7 @@ v.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13
|
|||
b=0;null!=d&&d!=a;)d=d.nextSibling,b++;return b}function p(b,d,c,m,k,e,q,g,h){try{if(null==d||"image/"==d.substring(0,6))if(null==b&&null!=q||null==w[b]){var B=function(){C.innerHTML="";C.style.cursor="pointer";C.style.whiteSpace="nowrap";C.style.textOverflow="ellipsis";mxUtils.write(C,null!=K.title&&0<K.title.length?K.title:mxResources.get("untitled"));C.style.color=null==K.title||0==K.title.length?"#d0d0d0":""};t.style.backgroundImage="";u.style.display="none";var x=k,n=e;if(k>a.maxImageSize||e>
|
||||
a.maxImageSize){var A=Math.min(1,Math.min(a.maxImageSize/Math.max(1,k)),a.maxImageSize/Math.max(1,e));k*=A;e*=A}x>n?(n=Math.round(100*n/x),x=100):(x=Math.round(100*x/n),n=100);var G=document.createElement("div");G.setAttribute("draggable","true");G.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";G.style.position="relative";G.style.cursor="move";mxUtils.setPrefixedStyle(G.style,"transition","transform .1s ease-in-out");if(null!=b){var E=document.createElement("img");E.setAttribute("src",z.convert(b));
|
||||
E.style.width=x+"px";E.style.height=n+"px";E.style.margin="10px";E.style.paddingBottom=Math.floor((100-n)/2)+"px";E.style.paddingLeft=Math.floor((100-x)/2)+"px";G.appendChild(E)}else if(null!=q){var F=a.stringToCells(a.editor.graph.decompress(q.xml));0<F.length&&(a.sidebar.createThumb(F,100,100,G,null,!0,!1),G.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",G.firstChild.style.cursor="")}var I=document.createElement("img");I.setAttribute("src",Editor.closeImage);I.setAttribute("border",
|
||||
"0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,d){mxEvent.addListener(I,"click",function(c){w[b]=null;for(var k=0;k<f.length;k++)if(null!=f[k].data&&f[k].data==b||null!=f[k].xml&&null!=d&&f[k].xml==d.xml){f.splice(k,1);break}G.parentNode.removeChild(a);0==f.length&&
|
||||
"0");I.setAttribute("title",mxResources.get("delete"));I.setAttribute("align","top");I.style.paddingTop="4px";I.style.position="absolute";I.style.marginLeft="-12px";I.style.zIndex="1";I.style.cursor="pointer";mxEvent.addListener(I,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,d){mxEvent.addListener(I,"click",function(c){w[b]=null;for(var m=0;m<f.length;m++)if(null!=f[m].data&&f[m].data==b||null!=f[m].xml&&null!=d&&f[m].xml==d.xml){f.splice(m,1);break}G.parentNode.removeChild(a);0==f.length&&
|
||||
(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",u.style.display="");mxEvent.consume(c)});mxEvent.addListener(I,"dblclick",function(a){mxEvent.consume(a)})})(G,b,q);G.appendChild(I);G.style.marginBottom="30px";var C=document.createElement("div");C.style.position="absolute";C.style.boxSizing="border-box";C.style.bottom="-18px";C.style.left="10px";C.style.right="10px";C.style.backgroundColor="#ffffff";C.style.overflow="hidden";C.style.textAlign="center";var K=null;null!=b?(K={data:b,
|
||||
w:k,h:e,title:h},null!=g&&(K.aspect=g),w[b]=E,f.push(K)):null!=q&&(q.aspect="fixed",f.push(q),K=q);mxEvent.addListener(C,"keydown",function(a){13==a.keyCode&&null!=v&&(v(),v=null,mxEvent.consume(a))});B();G.appendChild(C);mxEvent.addListener(C,"mousedown",function(a){"true"!=C.getAttribute("contentEditable")&&mxEvent.consume(a)});F=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var d=new FilenameDialog(a,K.title||"",mxResources.get("ok"),
|
||||
function(a){null!=a&&(K.title=a,B())},mxResources.get("enterValue"));a.showDialog(d.container,300,80,!0,!0);d.init();mxEvent.consume(b)}else if("true"!=C.getAttribute("contentEditable")){null!=v&&(v(),v=null);if(null==K.title||0==K.title.length)C.innerHTML="";C.style.textOverflow="";C.style.whiteSpace="";C.style.cursor="text";C.style.color="";C.setAttribute("contentEditable","true");C.focus();document.execCommand("selectAll",!1,null);v=function(){C.removeAttribute("contentEditable");C.style.cursor=
|
||||
|
@ -7693,17 +7693,17 @@ decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.te
|
|||
":");null==c&&(c=a.defaultLibraryName+".xml");var q=document.createElement("input");q.setAttribute("value",c);q.style.marginRight="20px";q.style.marginLeft="10px";q.style.width="500px";null==g||g.isRenamable()||q.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};m.appendChild(q);var t=document.createElement("div");t.style.borderWidth=
|
||||
"1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var u=document.createElement("div");u.style.position="absolute";u.style.width="640px";u.style.top="260px";u.style.textAlign="center";u.style.fontSize="22px";u.style.color="#a0c3ff";
|
||||
mxUtils.write(u,mxResources.get("dragImagesHere"));b.appendChild(u);var w={},y=null,k=null,v=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=v&&(v(),v=null,mxEvent.consume(a))};mxEvent.addListener(t,"mousedown",c);mxEvent.addListener(t,"pointerdown",c);mxEvent.addListener(t,"touchstart",c);var z=new mxUrlConverter,D=!1;if(null!=e)for(c=0;c<e.length;c++)m=e[c],p(m.data,null,0,0,m.w,m.h,m,m.aspect,m.title);mxEvent.addListener(t,"dragleave",function(a){u.style.cursor=
|
||||
"";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==u){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var B=function(b){return function(d,f,c,k,m,e,q,u,g){null!=g&&(/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name))?a.importVisio(g,mxUtils.bind(this,function(d){a.spinner.stop();p(d,f,c,k,m,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," "))})):null!=g&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(d,g.name)?
|
||||
a.parseFile(g,mxUtils.bind(this,function(d){4==d.readyState&&(a.spinner.stop(),200<=d.status&&299>=d.status&&(p(d.responseText,f,c,k,m,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(p(d,f,c,k,m,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",d);mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,
|
||||
"";for(var b=mxEvent.getSource(a);null!=b;){if(b==t||b==u){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var B=function(b){return function(d,f,c,m,k,e,q,u,g){null!=g&&(/(\.vsdx)($|\?)/i.test(g.name)||/(\.vssx)($|\?)/i.test(g.name))?a.importVisio(g,mxUtils.bind(this,function(d){a.spinner.stop();p(d,f,c,m,k,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," "))})):null!=g&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(d,g.name)?
|
||||
a.parseFile(g,mxUtils.bind(this,function(d){4==d.readyState&&(a.spinner.stop(),200<=d.status&&299>=d.status&&(p(d.responseText,f,c,m,k,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(p(d,f,c,m,k,e,q,"fixed",mxEvent.isAltDown(b)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",d);mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,
|
||||
"drop",d);b.appendChild(t);e=document.createElement("div");e.style.textAlign="right";e.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&e.appendChild(c);m=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(f),d=q.value;/(\.xml)$/i.test(d)||(d+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,d,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,
|
||||
"filename="+encodeURIComponent(d)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});m.setAttribute("id","btnDownload");m.className="geBtn";e.appendChild(m);var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(x,"change",function(b){D=!1;a.importFiles(x.files,0,0,a.maxImageSize,function(a,d,f,c,k,m,e,q,t){B(b)(a,d,f,c,k,m,e,q,t);x.value=""});t.scrollTop=t.scrollHeight}),m=mxUtils.button(mxResources.get("import"),
|
||||
"filename="+encodeURIComponent(d)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});m.setAttribute("id","btnDownload");m.className="geBtn";e.appendChild(m);var x=document.createElement("input");x.setAttribute("multiple","multiple");x.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(x,"change",function(b){D=!1;a.importFiles(x.files,0,0,a.maxImageSize,function(a,d,f,c,m,k,e,q,t){B(b)(a,d,f,c,m,k,e,q,t);x.value=""});t.scrollTop=t.scrollHeight}),m=mxUtils.button(mxResources.get("import"),
|
||||
function(){null!=v&&(v(),v=null);x.click()}),m.setAttribute("id","btnAddImage"),m.className="geBtn",e.appendChild(m));m=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=v&&(v(),v=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,d){D=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}p(a,null,0,0,b,d);t.scrollTop=t.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";
|
||||
e.appendChild(m);this.saveBtnClickHandler=function(b,d,f,c){a.saveLibrary(b,d,f,c)};m=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=v&&(v(),v=null);this.saveBtnClickHandler(q.value,f,g,h)}));m.setAttribute("id","btnSave");m.className="geBtn gePrimaryBtn";e.appendChild(m);a.editor.cancelFirst||e.appendChild(c);b.appendChild(e);this.container=b},EditShapeDialog=function(a,c,b,e,g){e=null!=e?e:300;g=null!=g?g:120;var h,l,p=document.createElement("table"),n=document.createElement("tbody");
|
||||
p.style.cellPadding="4px";h=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,b);h.appendChild(l);n.appendChild(h);h=document.createElement("tr");l=document.createElement("td");var d=document.createElement("textarea");d.style.outline="none";d.style.resize="none";d.style.width=e-200+"px";d.style.height=g+"px";this.textarea=d;this.init=function(){d.focus();d.scrollTop=0};l.appendChild(d);h.appendChild(l);l=document.createElement("td");
|
||||
b=document.createElement("div");b.style.position="relative";b.style.border="1px solid gray";b.style.top="6px";b.style.width="200px";b.style.height=g+4+"px";b.style.overflow="hidden";b.style.marginBottom="16px";mxEvent.disableContextMenu(b);l.appendChild(b);var f=new Graph(b);f.setEnabled(!1);var m=a.editor.graph.cloneCell(c);f.addCells([m]);b=f.view.getState(m);var q="";null!=b.shape&&null!=b.shape.stencil&&(q=mxUtils.getPrettyXml(b.shape.stencil.desc));mxUtils.write(d,q||"");b=f.getGraphBounds();
|
||||
g=Math.min(160/b.width,(g-40)/b.height);f.view.scaleAndTranslate(g,20/g-b.x,20/g-b.y);h.appendChild(l);n.appendChild(h);h=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&l.appendChild(g);a.isOffline()||(b=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),
|
||||
b.className="geBtn",l.appendChild(b));var t=function(b,f,c){var k=d.value,m=mxUtils.parseXml(k),k=mxUtils.getPrettyXml(m.documentElement),m=m.documentElement.getElementsByTagName("parsererror");if(null!=m&&0<m.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),m=!b.model.contains(f),!c||m||k!=q){k=a.editor.graph.compress(k);b.getModel().beginUpdate();try{if(m){var e=a.editor.graph.getInsertPoint();f.geometry.x=e.x;
|
||||
f.geometry.y=e.y;b.addCell(f)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+k+")",[f])}catch(D){throw D;}finally{b.getModel().endUpdate()}m&&b.setSelectionCell(f)}};b=mxUtils.button(mxResources.get("preview"),function(){t(f,m,!1)});b.className="geBtn";l.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(g);h.appendChild(l);n.appendChild(h);p.appendChild(n);this.container=
|
||||
b.className="geBtn",l.appendChild(b));var t=function(b,f,c){var m=d.value,e=mxUtils.parseXml(m),m=mxUtils.getPrettyXml(e.documentElement),e=e.documentElement.getElementsByTagName("parsererror");if(null!=e&&0<e.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),e=!b.model.contains(f),!c||e||m!=q){m=a.editor.graph.compress(m);b.getModel().beginUpdate();try{if(e){var t=a.editor.graph.getInsertPoint();f.geometry.x=t.x;
|
||||
f.geometry.y=t.y;b.addCell(f)}b.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+m+")",[f])}catch(D){throw D;}finally{b.getModel().endUpdate()}e&&b.setSelectionCell(f)}};b=mxUtils.button(mxResources.get("preview"),function(){t(f,m,!1)});b.className="geBtn";l.appendChild(b);b=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,c,!0)});b.className="geBtn gePrimaryBtn";l.appendChild(b);a.editor.cancelFirst||l.appendChild(g);h.appendChild(l);n.appendChild(h);p.appendChild(n);this.container=
|
||||
p},CustomDialog=function(a,c,b,e,g,h,l,p){var n=document.createElement("div");n.appendChild(c);c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";null!=l&&c.appendChild(l);l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=e&&e()});l.className="geBtn";p&&(l.style.display="none");a.editor.cancelFirst&&c.appendChild(l);a.isOffline()||null==h||(p=mxUtils.button(mxResources.get("help"),function(){a.openLink(h)}),p.className="geBtn",c.appendChild(p));
|
||||
g=mxUtils.button(g||mxResources.get("ok"),function(){a.hideDialog();null!=b&&b()});c.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||c.appendChild(l);n.appendChild(c);this.cancelBtn=l;this.okButton=g;this.container=n},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+
|
||||
mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+mxResources.get("showAll",null,"+ Show all")+
|
||||
|
@ -7875,7 +7875,7 @@ this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnab
|
|||
var ErrorDialog=function(a,c,b,e,g,h,l,p,n,d,f){n=null!=n?n:!0;var m=document.createElement("div");m.style.textAlign="center";if(null!=c){var q=document.createElement("div");q.style.padding="0px";q.style.margin="0px";q.style.fontSize="18px";q.style.paddingBottom="16px";q.style.marginBottom="16px";q.style.borderBottom="1px solid #c0c0c0";q.style.color="gray";mxUtils.write(q,c);m.appendChild(q)}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!=h&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();h()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=d&&(d=mxUtils.button(d,function(){null!=f&&f()}),d.className="geBtn",b.appendChild(d));var t=mxUtils.button(e,function(){n&&a.hideDialog();null!=g&&g()});t.className="geBtn";b.appendChild(t);null!=l&&(e=mxUtils.button(l,function(){n&&a.hideDialog();null!=p&&p()}),e.className="geBtn gePrimaryBtn",
|
||||
b.appendChild(e));this.init=function(){t.focus()};m.appendChild(b);this.container=m};
|
||||
(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,e){e.ui=a.ui;return b};a.afterDecode=function(a,b,e){e.previousColor=e.color;e.previousImage=e.image;e.previousFormat=e.format;null!=e.foldingEnabled&&(e.foldingEnabled=!e.foldingEnabled);null!=e.mathEnabled&&(e.mathEnabled=!e.mathEnabled);null!=e.shadowVisible&&(e.shadowVisible=!e.shadowVisible);return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.0.23";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,e,t){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,e,t);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,e){e.ui=a.ui;return b};a.afterDecode=function(a,b,e){e.previousColor=e.color;e.previousImage=e.image;e.previousFormat=e.format;null!=e.foldingEnabled&&(e.foldingEnabled=!e.foldingEnabled);null!=e.mathEnabled&&(e.mathEnabled=!e.mathEnabled);null!=e.shadowVisible&&(e.shadowVisible=!e.shadowVisible);return e};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="10.0.24";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,e,t){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,e,t);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 d=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=f+"/log?severity="+d+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+
|
||||
":lnum:"+encodeURIComponent(c)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=t&&null!=t.stack?"&stack="+encodeURIComponent(t.stack):"")}}catch(y){}};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,
|
||||
|
@ -7920,8 +7920,8 @@ function(b,d){try{var c=this.editor.graph.pageVisible;null!=g&&(this.editor.grap
|
|||
if(h||w==mxConstants.NONE)w=null;var l=this.editor.graph.getSvg(w,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(l);this.convertImages(l,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();u('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=d+".svg",q=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();u(a)}),e)}}catch(G){this.handleError(G)}};
|
||||
EditorUi.prototype.createDownloadRequest=function(a,b,c,e,t,g){var d=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var f="",k="";if(d.width*d.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};d="0";"pdf"==b&&0==g&&(k="&allPages=1");if("xmlpng"==b&&(d="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){f="&from="+g;break}g=this.editor.graph.background;
|
||||
"png"==b&&t&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+f+k+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+e+"&embedXml="+d+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&
|
||||
0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,e=null,m=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),q()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),q=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(m,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){q();m()}));q();m()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,m=null,q=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),
|
||||
mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),t()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),t=mxUtils.bind(this,function(){window.clearTimeout(m);m=window.setTimeout(q,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){t();q()}));t();q()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&
|
||||
!this.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,d){c.alert(a.tooltip)});return b}var d=null,c=this;if(null!=a&&0<a.length&&(d=mxUtils.parseXml(a),a=null!=d?d.documentElement:null,null!=
|
||||
a&&"updates"==a.nodeName)){var e=this.editor.graph,g=e.getModel();g.beginUpdate();var h=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=g.getCell(a.getAttribute("id"));if(null!=l){try{var k=a.getAttribute("value");if(null!=k){var v=mxUtils.parseXml(k).documentElement;if(null!=v)if("1"==v.getAttribute("replace-value"))g.setValue(l,v);else for(var p=v.attributes,n=0;n<p.length;n++)e.setAttributeForCell(l,p[n].nodeName,0<p[n].nodeValue.length?p[n].nodeValue:null)}}catch(E){null!=
|
||||
window.console&&console.log("Error in value for "+l.id+": "+E)}try{var B=a.getAttribute("style");null!=B&&e.model.setStyle(l,B)}catch(E){null!=window.console&&console.log("Error in style for "+l.id+": "+E)}try{var x=a.getAttribute("icon");if(null!=x){var G=0<x.length?JSON.parse(x):null;null!=G&&G.append||e.removeCellOverlays(l);null!=G&&e.addCellOverlay(l,b(G))}}catch(E){null!=window.console&&console.log("Error in icon for "+l.id+": "+E)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),
|
||||
|
@ -7936,11 +7936,11 @@ null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getM
|
|||
this.getSearch(["url"]):null!=b?this.fileLoaded(b):c()}),!0)}else c();return d};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 b=mxUtils.bind(this,function(){this.isActive()||(this.editor.graph.removeMouseListener(d),this.editor.removeListener("hideDialog",b),this.editor.graph.removeListener(b),null!=window.requestAnimationFrame?window.requestAnimationFrame(a):
|
||||
a())}),d={mouseDown:function(){},mouseMove:function(){},mouseUp:b};this.editor.graph.addListener(mxEvent.EDITING_STOPPED,b);this.editor.graph.addListener(mxEvent.ESCAPE,b);this.editor.graph.addMouseListener(d);this.editor.addListener("hideDialog",b)}else null!=window.requestAnimationFrame?window.requestAnimationFrame(a):a()};EditorUi.prototype.getHashValueForPages=function(a,b){var d=0,c=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0,b.cellCount=0);
|
||||
for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var g=a[e].node.cloneNode(!1);g.removeAttribute("name");c.root=a[e].root;var h=f.encode(c);this.editor.graph.saveViewState(a[e].viewState,h,!0);g.appendChild(h);null!=b&&(b.eltCount+=g.getElementsByTagName("*").length,b.nodeCount+=g.getElementsByTagName("mxCell").length,b.cellCount+=c.getDescendants(c.root).length);d=(d<<5)-d+this.hashValue(g,function(a,b,d,c){return!c||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=
|
||||
b&&"height"!=b?d:Math.round(d)},b)<<0}return d};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,m=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=m&&(d^=this.hashValue(e,
|
||||
b,c)+this.hashValue(m,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,e,g,h,w){};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 b=mxUtils.createXmlDocument(),d=b.createElement("mxlibrary");mxUtils.setTextContent(d,JSON.stringify(a));b.appendChild(d);
|
||||
return mxUtils.getXml(b)};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 b=this.sidebar.palettes[a];if(null!=b){for(var d=0;d<b.length;d++)b[d].parentNode.removeChild(b[d]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;
|
||||
if(null==a){var d=this.sidebar.palettes["L.scratchpad"];null==d&&(d=this.sidebar.palettes.search);null!=d&&(a=d[d.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var d=b.lastChild,c=d.previousSibling;b.insertBefore(d,a);b.insertBefore(c,d)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var d=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,d,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
b&&"height"!=b?c&&"mxCell"==a.nodeName&&"previous"==b?null:d:Math.round(d)},b)<<0}return d};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if("object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,m=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;
|
||||
null!=m&&(d^=this.hashValue(e,b,c)+this.hashValue(m,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,e,g,h,w){};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 b=mxUtils.createXmlDocument(),d=b.createElement("mxlibrary");mxUtils.setTextContent(d,JSON.stringify(a));
|
||||
b.appendChild(d);return mxUtils.getXml(b)};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 b=this.sidebar.palettes[a];if(null!=b){for(var d=0;d<b.length;d++)b[d].parentNode.removeChild(b[d]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=
|
||||
this.sidebar.container;if(null==a){var d=this.sidebar.palettes["L.scratchpad"];null==d&&(d=this.sidebar.palettes.search);null!=d&&(a=d[d.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var d=b.lastChild,c=d.previousSibling;b.insertBefore(d,a);b.insertBefore(c,d)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var d=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,d,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(b,d){0==b.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,
|
||||
"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),d.appendChild(f)):this.addLibraryEntries(b,d)});if(null!=this.sidebar&&null!=b)for(var m=0;m<b.length;m++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
||||
"fixed"==a.aspect&&(d+="aspect=fixed;");return this.sidebar.createVertexTemplate(d+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[m]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);
|
||||
|
@ -8043,8 +8043,8 @@ a;/^https?:\/\//.test(d)&&!this.isCorsEnabledForUrl(d)&&(d=PROXY_URL+"?url="+enc
|
|||
null!=d&&(l.beginPath(),l.rect(0,0,k,m),l.fillStyle=d,l.fill());l.scale(n,n);mxClient.IS_SF?window.setTimeout(function(){l.drawImage(f,B/n,B/n);a(e)},0):(l.drawImage(f,B/n,B/n),a(e))}catch(K){null!=g&&g(K)}});f.onerror=function(a){null!=g&&g(a)};try{v&&this.editor.graph.addSvgShadow(c,c);var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(D,
|
||||
c,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(e)}catch(A){null!=g&&g(A)}}),c,p)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.isCorsEnabledForUrl(d)?"chrome-extension://"!=
|
||||
d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,e){null==e&&(e=this.createImageUrlConverter());var d=0,f=c||{};c=mxUtils.bind(this,function(c,g){for(var k=a.getElementsByTagName(c),m=0;m<k.length;m++)mxUtils.bind(this,function(c){var k=e.convert(c.getAttribute(g));if(null!=k&&"data:"!=k.substring(0,5)){var m=f[k];null==m?(d++,this.convertImageToDataUri(k,function(e){null!=e&&(f[k]=e,c.setAttribute(g,
|
||||
e));d--;0==d&&b(a)})):c.setAttribute(g,m)}else null!=k&&c.setAttribute(g,k)})(k[m])});c("image","xlink:href");c("img","src");0==d&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,e,g,h){try{var d=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);g=null!=g?g:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(d){if((9==document.documentMode||10==document.documentMode)&&
|
||||
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}h=null!=h?h:"data:image/png;base64,";f=h+this.base64Encode(f)}b(f)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},d,this.timeout,function(){g&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(k){null!=c&&c(k)}};EditorUi.prototype.isCorsEnabledForUrl=
|
||||
e));d--;0==d&&b(a)})):c.setAttribute(g,m)}else null!=k&&c.setAttribute(g,k)})(k[m])});c("image","xlink:href");c("img","src");0==d&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,e,g,h){try{var d=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);g=null!=g?g:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(d){if((9==document.documentMode||10==document.documentMode)&&
|
||||
"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}h=null!=h?h:"data:image/png;base64,";e=h+this.base64Encode(e)}b(e)}}else null!=c&&c({code:App.ERROR_UNKNOWN},a)}),function(){null!=c&&c({code:App.ERROR_UNKNOWN})},d,this.timeout,function(){g&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(k){null!=c&&c(k)}};EditorUi.prototype.isCorsEnabledForUrl=
|
||||
function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};EditorUi.prototype.convertImageToDataUri=
|
||||
function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var d=new Image,c=this;this.crossOriginImages&&(d.crossOrigin="anonymous");d.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=d.height;a.width=d.width;e.drawImage(d,0,0);try{b(a.toDataURL())}catch(w){b(c.svgBrokenImage.src)}};d.onerror=function(){b(c.svgBrokenImage.src)};d.src=a}};EditorUi.prototype.importXml=
|
||||
function(a,b,c,e,g){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){var m=mxUtils.parseXml(a),k=this.editor.extractGraphModel(m.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var h=k.getElementsByTagName("diagram");if(1==h.length)k=mxUtils.parseXml(f.decompress(mxUtils.getTextContent(h[0]))).documentElement;else if(1<h.length){f.model.beginUpdate();try{for(a=0;a<h.length;a++){h[a].removeAttribute("id");var l=this.updatePageRoot(new DiagramPage(h[a])),
|
||||
|
@ -8068,8 +8068,8 @@ a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,m)):null!=k&&null!
|
|||
(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,v));d||null==n||n(f);return f};EditorUi.prototype.base64Encode=function(a){for(var b="",d=0,c=a.length,e,g,h;d<c;){e=a.charCodeAt(d++)&255;if(d==c){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}g=a.charCodeAt(d++);if(d==c){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);
|
||||
b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);b+="=";break}h=a.charCodeAt(d++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(h&192)>>6);b+=
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,e,g,h,l,n,k,v,p,D){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;v=null!=v?v:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var q=p||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0,6)&&a[t].size>q){m=!0;break}var u=mxUtils.bind(this,function(){var k=this.editor.graph,m=k.gridSize;
|
||||
g=null!=g?g:mxUtils.bind(this,function(a,b,c,e,f,k,g,m,h){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,m,h,d,D)});h=null!=h?h:mxUtils.bind(this,function(a){k.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,t=q,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--t){this.spinner.stop();if(null!=n)n(u);else{var d=[];k.getModel().beginUpdate();
|
||||
try{for(var c=0;c<u.length;c++){var e=u[c]();null!=e&&(d=d.concat(e))}}finally{k.getModel().endUpdate()}}h(d)}}),x=0;x<q;x++)mxUtils.bind(this,function(d){var h=a[d],q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var q=a.target.result,t=q.indexOf(","),n=decodeURIComponent(escape(atob(q.substring(t+1)))),u=mxUtils.parseXml(n),n=u.getElementsByTagName("svg");if(0<n.length){var n=n[0],x=D?null:n.getAttribute("content");
|
||||
g=null!=g?g:mxUtils.bind(this,function(a,b,c,e,f,k,g,m,h){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,e,f,k,g,m,h,d,D)});h=null!=h?h:mxUtils.bind(this,function(a){k.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,t=q,u=[],w=mxUtils.bind(this,function(a,b){u[a]=b;if(0==--t){this.spinner.stop();if(null!=n)n(u);else{var c=[];k.getModel().beginUpdate();
|
||||
try{for(var d=0;d<u.length;d++){var e=u[d]();null!=e&&(c=c.concat(e))}}finally{k.getModel().endUpdate()}}h(c)}}),x=0;x<q;x++)mxUtils.bind(this,function(d){var h=a[d],q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==l||l(h))if("image/"==h.type.substring(0,6))if("image/svg"==h.type.substring(0,9)){var q=a.target.result,t=q.indexOf(","),n=decodeURIComponent(escape(atob(q.substring(t+1)))),u=mxUtils.parseXml(n),n=u.getElementsByTagName("svg");if(0<n.length){var n=n[0],x=D?null:n.getAttribute("content");
|
||||
null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(x,!0)));null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x));null==x||"<mxfile "!==x.substring(0,8)&&"<mxGraphModel "!==x.substring(0,14)?w(d,mxUtils.bind(this,function(){try{if(q.substring(0,t+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var f=a[0],l=parseFloat(f.getAttribute("width")),v=parseFloat(f.getAttribute("height")),n=f.getAttribute("viewBox");if(null==n||0==n.length)f.setAttribute("viewBox",
|
||||
"0 0 "+l+" "+v);else if(isNaN(l)||isNaN(v)){var p=n.split(" ");3<p.length&&(l=parseFloat(p[2]),v=parseFloat(p[3]))}q=this.createSvgDataUri(mxUtils.getXml(f));var w=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,v)),x=g(q,h.type,b+d*m,c+d*m,Math.max(1,Math.round(l*w)),Math.max(1,Math.round(v*w)),h.name);if(isNaN(l)||isNaN(v)){var D=new Image;D.onload=mxUtils.bind(this,function(){l=Math.max(1,D.width);v=Math.max(1,D.height);x[0].geometry.width=l;x[0].geometry.height=v;f.setAttribute("viewBox","0 0 "+
|
||||
l+" "+v);q=this.createSvgDataUri(mxUtils.getXml(f));var a=q.indexOf(";");0<a&&(q=q.substring(0,a)+q.substring(q.indexOf(",",a+1)));k.setCellStyles("image",q,[x[0]])});D.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(fa){}return null})):w(d,mxUtils.bind(this,function(){return g(x,"text/xml",b+d*m,c+d*m,0,0,h.name)}))}else w(d,mxUtils.bind(this,function(){return null}))}else{n=!1;if("image/png"==h.type){var A=D?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var y=
|
||||
|
@ -8188,7 +8188,7 @@ this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getSta
|
|||
arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,e,g,h){var d=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,g,h)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),k=d.getGraphBounds(),l=Math.floor(k.width*g/d.view.scale),m=Math.floor(k.height*g/d.view.scale);
|
||||
f.length<=MAX_REQUEST_SIZE&&l*m<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+l+"&h="+m+"&border="+h+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=
|
||||
c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var e=b.changes.length-1;0<=e;e--){var g=b.changes[e];if(g.constructor==mxChildChange&&null!=g.child&&g.child.id==c){a.contains(g.previous)&&(d=g.child);
|
||||
break}}return d}})();EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellPrototype=new mxCell;
|
||||
break}}return d}})();EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectIdentity:!0,mxTransient:!0};
|
||||
EditorUi.prototype.patchPages=function(a,c,b,e,g){var h={},l=[],p={},n={},d={},f={};if(null!=e&&null!=e[EditorUi.DIFF_UPDATE])for(var m in e[EditorUi.DIFF_UPDATE])h[m]=e[EditorUi.DIFF_UPDATE][m];if(null!=c[EditorUi.DIFF_REMOVE])for(e=0;e<c[EditorUi.DIFF_REMOVE].length;e++)n[c[EditorUi.DIFF_REMOVE][e]]=!0;if(null!=c[EditorUi.DIFF_INSERT])for(e=0;e<c[EditorUi.DIFF_INSERT].length;e++)p[c[EditorUi.DIFF_INSERT][e].previous]=c[EditorUi.DIFF_INSERT][e];if(null!=c[EditorUi.DIFF_UPDATE])for(m in c[EditorUi.DIFF_UPDATE])e=
|
||||
c[EditorUi.DIFF_UPDATE][m],null!=e.previous&&(f[e.previous]=m);if(null!=a){var q="";for(e=0;e<a.length;e++){var t=a[e].getId();d[t]=a[e];null!=f[q]||n[t]||null!=c[EditorUi.DIFF_UPDATE]&&null!=c[EditorUi.DIFF_UPDATE][t]&&null!=c[EditorUi.DIFF_UPDATE][t].previous||(f[q]=t);q=t}}var u={},w=mxUtils.bind(this,function(a){var e=null!=a?a.getId():"";if(null!=a&&!u[e]){u[e]=!0;l.push(a);var k=null!=c[EditorUi.DIFF_UPDATE]?c[EditorUi.DIFF_UPDATE][e]:null;null!=k&&(this.updatePageRoot(a),null!=k.name&&a.setName(k.name),
|
||||
null!=k.view&&this.patchViewState(a,k.view),null!=k.cells&&this.patchPage(a,k.cells,h[a.getId()],g),!b||null==k.cells&&null==k.view||(a.needsUpdate=!0))}a=f[e];null!=a&&(delete f[e],w(d[a]));a=p[e];null!=a&&(delete p[e],y(a))}),y=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var c=d[a.getId()];null==c?w(a):(c.root=a.root,this.currentPage==c?this.editor.graph.model.setRoot(c.root):b&&(c.needsUpdate=!0))});w();for(m in f)w(d[f[m]]),
|
||||
|
@ -8201,7 +8201,7 @@ u=g.getCell(f.id),null!=u&&(g.setTerminal(u,g.getCell(f.source),!0),g.setTermina
|
|||
EditorUi.prototype.patchCellRecursive=function(a,c,b,e,g){for(var h=e[b.getId()],l=null!=h&&null!=h.inserted?h.inserted:{},p=null!=h&&null!=h.moved?h.moved:{},n=0,h=c.getChildCount(b),d="",f=0;f<h;f++){var m=c.getChildAt(b,f).getId();null==p[d]&&(null==g[EditorUi.DIFF_UPDATE]||null==g[EditorUi.DIFF_UPDATE][m]||null==g[EditorUi.DIFF_UPDATE][m].previous&&null==g[EditorUi.DIFF_UPDATE][m].parent)&&(p[d]=m);d=m}var q=mxUtils.bind(this,function(d){var f=null!=d?d.getId():"";null!=d&&(c.getChildAt(b,n)!=
|
||||
d&&c.add(b,d,n),this.patchCellRecursive(a,c,d,e,g),n++);d=p[f];null!=d&&(delete p[f],q(c.getCell(d)));d=l[f];null!=d&&(delete l[f],q(this.getCellForJson(d)))});q();for(var t in p)q(c.getCell(p[t])),delete p[t];for(t in l)q(this.getCellForJson(l[t])),delete l[t]};
|
||||
EditorUi.prototype.patchCell=function(a,c,b,e){if(null!=c&&null!=b){if(null==e||null==e.xmlValue&&(null==e.value||""==e.value))null!=b.value?a.setValue(c,b.value):null!=b.xmlValue&&a.setValue(c,mxUtils.parseXml(b.xmlValue).documentElement);null!=e&&null!=e.style||null==b.style||a.setStyle(c,b.style);null!=b.visible&&a.setVisible(c,1==b.visible);null!=b.collapsed&&a.setCollapsed(c,1==b.collapsed);null!=b.vertex&&(c.vertex=1==b.vertex);null!=b.edge&&(c.edge=1==b.edge);null!=b.connectable&&(c.connectable=
|
||||
1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var g in b)g in this.cellPrototype||(c[g]=b[g])}};
|
||||
1==b.connectable);null!=b.geometry&&a.setGeometry(c,this.codec.decode(mxUtils.parseXml(b.geometry).documentElement));null!=b.source&&a.setTerminal(c,a.getCell(b.source),!0);null!=b.target&&a.setTerminal(c,a.getCell(b.target),!1);for(var g in b)this.cellProperties[g]||(c[g]=b[g])}};
|
||||
EditorUi.prototype.getPagesForNode=function(a){var c=this.editor.extractGraphModel(a,!0);null!=c&&(a=c);a=a.getElementsByTagName("diagram");for(var c=[],b=0;b<a.length;b++){var e=new DiagramPage(a[b]);this.updatePageRoot(e);c.push(e)}return c};
|
||||
EditorUi.prototype.diffPages=function(a,c){for(var b=[],e=[],g={},h={},l={},p=null,n=0;n<c.length;n++)h[c[n].getId()]={page:c[n],prev:p},p=c[n];p=null;for(n=0;n<a.length;n++){var d=a[n].getId(),f=h[d];if(null==f)e.push(d);else{var m=this.diffPage(a[n],f.page),q={};0<Object.keys(m).length&&(q.cells=m);m=this.diffViewState(a[n],f.page);0<Object.keys(m).length&&(q.view=m);if((null!=f.prev?null==p:null!=p)||null!=p&&null!=f.prev&&p.getId()!=f.prev.getId())q.previous=null!=f.prev?f.prev.getId():"";null!=
|
||||
f.page.getName()&&a[n].getName()!=f.page.getName()&&(q.name=f.page.getName());0<Object.keys(q).length&&(l[d]=q)}delete h[a[n].getId()];p=a[n]}for(d in h)f=h[d],b.push({data:mxUtils.getXml(f.page.node),previous:null!=f.prev?f.prev.getId():""});0<Object.keys(l).length&&(g[EditorUi.DIFF_UPDATE]=l);0<e.length&&(g[EditorUi.DIFF_REMOVE]=e);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
|
||||
|
@ -8209,13 +8209,13 @@ EditorUi.prototype.createCellLookup=function(a,c,b){b=null!=b?b:{};b[a.getId()]=
|
|||
EditorUi.prototype.diffCellRecursive=function(a,c,b,e,g){e=null!=e?e:{};var h=b[a.getId()];delete b[a.getId()];if(null==h)g.push(a.getId());else{var l=this.diffCell(a,h.cell);if(null!=l.parent||(null!=h.prev?null==c:null!=c)||null!=c&&null!=h.prev&&c.getId()!=h.prev.getId())l.previous=null!=h.prev?h.prev.getId():"";0<Object.keys(l).length&&(e[a.getId()]=l)}h=a.getChildCount();c=null;for(l=0;l<h;l++){var p=a.getChildAt(l);this.diffCellRecursive(p,c,b,e,g);c=p}return e};
|
||||
EditorUi.prototype.diffPage=function(a,c){var b=[],e=[],g={};this.updatePageRoot(a);this.updatePageRoot(c);var h=this.createCellLookup(c.root),l=this.diffCellRecursive(a.root,null,h,l,e),p;for(p in h){var n=h[p];b.push(this.getJsonForCell(n.cell,n.prev))}0<Object.keys(l).length&&(g[EditorUi.DIFF_UPDATE]=l);0<e.length&&(g[EditorUi.DIFF_REMOVE]=e);0<b.length&&(g[EditorUi.DIFF_INSERT]=b);return g};
|
||||
EditorUi.prototype.diffViewState=function(a,c){var b=a.viewState,e=c.viewState,g={};c==this.currentPage&&(e=this.editor.graph.getViewState());if(null!=b&&null!=e)for(var h in this.viewStateProperties){var l=JSON.stringify(b[h]),p=JSON.stringify(e[h]);l!=p&&(g[h]=p)}return g};
|
||||
EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var e in a)e in this.cellPrototype||(c[e]=a[e]);return c};
|
||||
EditorUi.prototype.getCellForJson=function(a){var c=null!=a.geometry?this.codec.decode(mxUtils.parseXml(a.geometry).documentElement):null,b=a.value;null!=a.xmlValue&&(b=mxUtils.parseXml(a.xmlValue).documentElement);c=new mxCell(b,c,a.style);c.connectable=0!=a.connectable;c.collapsed=1==a.collapsed;c.visible=0!=a.visible;c.vertex=1==a.vertex;c.edge=1==a.edge;c.id=a.id;for(var e in a)this.cellProperties[e]||(c[e]=a[e]);return c};
|
||||
EditorUi.prototype.getJsonForCell=function(a,c){var b={id:a.getId()};a.vertex&&(b.vertex=1);a.edge&&(b.edge=1);a.connectable||(b.connectable=0);null!=a.parent&&(b.parent=a.parent.getId());null!=c&&(b.previous=c.getId());null!=a.source&&(b.source=a.source.getId());null!=a.target&&(b.target=a.target.getId());null!=a.style&&(b.style=a.style);null!=a.geometry&&(b.geometry=mxUtils.getXml(this.codec.encode(a.geometry)));a.collapsed&&(b.collapsed=1);a.visible||(b.visible=0);null!=a.value&&("object"===typeof a.value&&
|
||||
"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var e in a)"mxObjectId"==e||e in this.cellPrototype||(b[e]=a[e]);return b};
|
||||
"number"===typeof a.value.nodeType&&"string"===typeof a.value.nodeName&&"function"===typeof a.value.getAttribute?b.xmlValue=mxUtils.getXml(a.value):b.value=a.value);for(var e in a)this.cellProperties[e]||"function"===typeof a[e]||(b[e]=a[e]);return b};
|
||||
EditorUi.prototype.diffCell=function(a,c){function b(a){return null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute}var e={};a.vertex!=c.vertex&&(e.vertex=c.vertex?1:0);a.edge!=c.edge&&(e.edge=c.edge?1:0);a.connectable!=c.connectable&&(e.connectable=c.connectable?1:0);if((null!=a.parent?null==c.parent:null!=c.parent)||null!=a.parent&&null!=c.parent&&a.parent.getId()!=c.parent.getId())e.parent=null!=c.parent?c.parent.getId():"";
|
||||
if((null!=a.source?null==c.source:null!=c.source)||null!=a.source&&null!=c.source&&a.source.getId()!=c.source.getId())e.source=null!=c.source?c.source.getId():"";if((null!=a.target?null==c.target:null!=c.target)||null!=a.target&&null!=c.target&&a.target.getId()!=c.target.getId())e.target=null!=c.target?c.target.getId():"";b(a.value)&&b(c.value)?a.value.isEqualNode(c.value)||(e.xmlValue=mxUtils.getXml(c.value)):a.value!=c.value&&(b(c.value)?e.xmlValue=mxUtils.getXml(c.value):e.value=null!=c.value?
|
||||
c.value:"");a.style!=c.style&&(e.style=c.style);a.visible!=c.visible&&(e.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(e.collapsed=c.collapsed?1:0);this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)||(e.geometry=mxUtils.getXml(this.codec.encode(c.geometry)));for(var g in a)"mxObjectId"==g||g in this.cellPrototype||a[g]==c[g]||(e[g]=void 0===c[g]?null:c[g]);for(g in c)g in a||"mxObjectId"==g||g in this.cellPrototype||a[g]==c[g]||(e[g]=void 0===c[g]?null:c[g]);return e};
|
||||
EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var e=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,e)==JSON.stringify(c,e)};var mxSettings={currentVersion:17,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
c.value:"");a.style!=c.style&&(e.style=c.style);a.visible!=c.visible&&(e.visible=c.visible?1:0);a.collapsed!=c.collapsed&&(e.collapsed=c.collapsed?1:0);this.isObjectEqual(a.geometry,c.geometry,new mxGeometry)||(e.geometry=mxUtils.getXml(this.codec.encode(c.geometry)));for(var g in a)this.cellProperties[g]||"function"===typeof a[g]||"function"===typeof c[g]||a[g]==c[g]||(e[g]=void 0===c[g]?null:c[g]);for(g in c)g in a||this.cellProperties[g]||"function"===typeof a[g]||"function"===typeof c[g]||a[g]==
|
||||
c[g]||(e[g]=void 0===c[g]?null:c[g]);return e};EditorUi.prototype.isObjectEqual=function(a,c,b){if(null==a&&null==c)return!0;if(null!=a?null==c:null!=c)return!1;var e=function(a,c){return null==b||b[a]!=c?!0===c?1:c:void 0};return JSON.stringify(a,e)==JSON.stringify(c,e)};var mxSettings={currentVersion:17,defaultFormatWidth:600>screen.width?"0":"240",key:".drawio-config",getLanguage:function(){return mxSettings.settings.language},setLanguage:function(a){mxSettings.settings.language=a},getUi:function(){return mxSettings.settings.ui},setUi:function(a){mxSettings.settings.ui=a},getShowStartScreen:function(){return mxSettings.settings.showStartScreen},setShowStartScreen:function(a){mxSettings.settings.showStartScreen=a},getGridColor:function(){return mxSettings.settings.gridColor},
|
||||
setGridColor:function(a){mxSettings.settings.gridColor=a},getAutosave:function(){return mxSettings.settings.autosave},setAutosave:function(a){mxSettings.settings.autosave=a},getResizeImages:function(){return mxSettings.settings.resizeImages},setResizeImages:function(a){mxSettings.settings.resizeImages=a},getOpenCounter:function(){return mxSettings.settings.openCounter},setOpenCounter:function(a){mxSettings.settings.openCounter=a},getLibraries:function(){return mxSettings.settings.libraries},setLibraries:function(a){mxSettings.settings.libraries=
|
||||
a},addCustomLibrary:function(a){mxSettings.load();0>mxUtils.indexOf(mxSettings.settings.customLibraries,a)&&("L.scratchpad"===a?mxSettings.settings.customLibraries.splice(0,0,a):mxSettings.settings.customLibraries.push(a));mxSettings.save()},removeCustomLibrary:function(a){mxSettings.load();mxUtils.remove(a,mxSettings.settings.customLibraries);mxSettings.save()},getCustomLibraries:function(){return mxSettings.settings.customLibraries},getPlugins:function(){return mxSettings.settings.plugins},setPlugins:function(a){mxSettings.settings.plugins=
|
||||
a},getRecentColors:function(){return mxSettings.settings.recentColors},setRecentColors:function(a){mxSettings.settings.recentColors=a},getFormatWidth:function(){return parseInt(mxSettings.settings.formatWidth)},setFormatWidth:function(a){mxSettings.settings.formatWidth=a},isCreateTarget:function(){return mxSettings.settings.createTarget},setCreateTarget:function(a){mxSettings.settings.createTarget=a},getPageFormat:function(){return mxSettings.settings.pageFormat},setPageFormat:function(a){mxSettings.settings.pageFormat=
|
||||
|
@ -8448,8 +8448,8 @@ window.location.hostname||"test.draw.io"==window.location.hostname||"drive.draw.
|
|||
mxClient.IS_SVG||a.isOffline()||((new Image).src=IMAGE_PATH+"/help.png");a.actions.addAction("new...",function(){var b=a.isOffline(),c=new NewDialog(a,b);a.showDialog(c.container,b?350:620,b?70:440,!0,!0,function(b){b&&null==a.getCurrentFile()&&a.showSplash()});c.init()});a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,
|
||||
function(b,c,d,e,f,g,h,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,h,!l,m,n)}),!0,null,"svg")}));a.actions.put("exportXml",new Action(mxResources.get("formatXml")+"...",function(){var b=document.createElement("div");b.style.whiteSpace="nowrap";var c=null==a.pages||1>=a.pages.length,d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatXml"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";b.appendChild(d);var f=a.addCheckbox(b,mxResources.get("selectionOnly"),
|
||||
!1,e.isSelectionEmpty()),g=a.addCheckbox(b,mxResources.get(c?"compressed":"allPages"),!0);g.style.marginBottom="16px";mxEvent.addListener(f,"change",function(){f.checked?g.setAttribute("disabled","disabled"):g.removeAttribute("disabled")});b=new CustomDialog(a,b,mxUtils.bind(this,function(){a.downloadFile("xml",c?!g.checked:null,null,!f.checked,c?null:!g.checked)}),null,mxResources.get("export"));a.showDialog(b.container,300,146,!0,!0)}));a.actions.put("exportUrl",new Action(mxResources.get("url")+
|
||||
"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,k,f,g,h,l,m){a.createHtml(b,
|
||||
c,d,e,k,f,g,h,l,m,mxUtils.bind(this,function(b,c){var d=a.getBaseFilename(g),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,
|
||||
"...",function(){a.showPublishLinkDialog(mxResources.get("url"),!0,null,null,function(b,c,d,e,f,g){b=new EmbedDialog(a,a.createLink(b,c,d,e,f,g,null,!0));a.showDialog(b.container,440,240,!0,!0);b.init()})}));a.actions.put("exportHtml",new Action(mxResources.get("formatHtmlEmbedded")+"...",function(){a.spinner.spin(document.body,mxResources.get("loading"))&&a.getPublicUrl(a.getCurrentFile(),function(b){a.spinner.stop();a.showHtmlDialog(mxResources.get("export"),null,b,function(b,c,d,e,f,k,g,h,l,m){a.createHtml(b,
|
||||
c,d,e,f,k,g,h,l,m,mxUtils.bind(this,function(b,c){var d=a.getBaseFilename(g),e='\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n<!DOCTYPE html>\n<html>\n<head>\n<title>'+mxUtils.htmlEntities(d)+'</title>\n<meta charset="utf-8"/>\n</head>\n<body>'+b+"\n"+c+"\n</body>\n</html>";a.saveData(d+".html","html",e,"text/html")}))})})}));a.actions.put("exportPdf",new Action(mxResources.get("formatPdf")+"...",function(){if(a.isOffline()||a.printPdfExport)a.showDialog((new PrintDialog(a,
|
||||
mxResources.get("formatPdf"))).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0);else{var b=null==a.pages||1>=a.pages.length,c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxResources.get("formatPdf"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(d);var d=function(){g!=this&&this.checked?l.removeAttribute("disabled"):(l.setAttribute("disabled","disabled"),l.checked=!1)},f=146;
|
||||
if(a.pdfPageExport&&!b){var g=a.addRadiobox(c,"pages",mxResources.get("allPages"),!0),f=a.addRadiobox(c,"pages",mxResources.get("currentPage",null,"Current Page"),!1),h=a.addRadiobox(c,"pages",mxResources.get("selectionOnly"),!1,e.isSelectionEmpty()),l=a.addCheckbox(c,mxResources.get("crop"),!1,!0);mxEvent.addListener(g,"change",d);mxEvent.addListener(f,"change",d);mxEvent.addListener(h,"change",d);f=205}else h=a.addCheckbox(c,mxResources.get("selectionOnly"),!1,e.isSelectionEmpty()),l=a.addCheckbox(c,
|
||||
mxResources.get("crop"),!e.pageVisible||!a.pdfPageExport,!a.pdfPageExport),a.pdfPageExport||mxEvent.addListener(h,"change",d);c=new CustomDialog(a,c,mxUtils.bind(this,function(){a.downloadFile("pdf",null,null,!h.checked,b?!0:!g.checked,!l.checked)}),null,mxResources.get("export"));a.showDialog(c.container,300,f,!0,!0)}}));a.actions.addAction("open...",function(){a.pickFile()});a.actions.addAction("close",function(){function b(){a.fileLoaded(null)}var c=a.getCurrentFile();null!=c&&c.isModified()?a.confirm(mxResources.get("allChangesLost"),
|
||||
|
|
|
@ -29,9 +29,12 @@ EditorUi.prototype.viewStateProperties = {background: true, backgroundImage: tru
|
|||
foldingEnabled: true, pageScale: true, mathEnabled: true, pageFormat: true};
|
||||
|
||||
/**
|
||||
* Contains all known cell properties that should be ignored in generic diff sync.
|
||||
* Contains all known cell properties that should be ignored for a generic cell diff.
|
||||
*/
|
||||
EditorUi.prototype.cellPrototype = new mxCell();
|
||||
EditorUi.prototype.cellProperties = {id: true, value: true, xmlValue: true, vertex: true, edge: true,
|
||||
visible: true, collapsed: true, connectable: true, parent: true, children: true, previous: true,
|
||||
source: true, target: true, edges: true, geometry: true, style: true,
|
||||
mxObjectIdentity: true, mxTransient: true};
|
||||
|
||||
/**
|
||||
* Removes all labels, user objects and styles from the given node in-place.
|
||||
|
@ -573,7 +576,7 @@ EditorUi.prototype.patchCell = function(model, cell, diff, resolve)
|
|||
|
||||
for (var key in diff)
|
||||
{
|
||||
if (!(key in this.cellPrototype))
|
||||
if (!this.cellProperties[key])
|
||||
{
|
||||
cell[key] = diff[key];
|
||||
}
|
||||
|
@ -867,7 +870,7 @@ EditorUi.prototype.getCellForJson = function(json)
|
|||
|
||||
for (var key in json)
|
||||
{
|
||||
if (!(key in this.cellPrototype))
|
||||
if (!this.cellProperties[key])
|
||||
{
|
||||
cell[key] = json[key];
|
||||
}
|
||||
|
@ -953,7 +956,8 @@ EditorUi.prototype.getJsonForCell = function(cell, previous)
|
|||
|
||||
for (var key in cell)
|
||||
{
|
||||
if (key != 'mxObjectId' && !(key in this.cellPrototype))
|
||||
if (!this.cellProperties[key] &&
|
||||
typeof cell[key] !== 'function')
|
||||
{
|
||||
result[key] = cell[key];
|
||||
}
|
||||
|
@ -1053,11 +1057,11 @@ EditorUi.prototype.diffCell = function(oldCell, newCell)
|
|||
}
|
||||
|
||||
// Compares all keys from oldCell to newCell and uses null in the diff
|
||||
// to force the attribute to be removed in the receinving client
|
||||
// to force the attribute to be removed in the receiving client
|
||||
for (var key in oldCell)
|
||||
{
|
||||
if (key != 'mxObjectId' && !(key in this.cellPrototype) &&
|
||||
oldCell[key] != newCell[key])
|
||||
if (!this.cellProperties[key] && typeof oldCell[key] !== 'function' &&
|
||||
typeof newCell[key] !== 'function' && oldCell[key] != newCell[key])
|
||||
{
|
||||
diff[key] = (newCell[key] === undefined) ? null : newCell[key];
|
||||
}
|
||||
|
@ -1067,8 +1071,8 @@ EditorUi.prototype.diffCell = function(oldCell, newCell)
|
|||
for (var key in newCell)
|
||||
{
|
||||
if (!(key in oldCell) &&
|
||||
key != 'mxObjectId' && !(key in this.cellPrototype) &&
|
||||
oldCell[key] != newCell[key])
|
||||
!this.cellProperties[key] && typeof oldCell[key] !== 'function' &&
|
||||
typeof newCell[key] !== 'function' && oldCell[key] != newCell[key])
|
||||
{
|
||||
diff[key] = (newCell[key] === undefined) ? null : newCell[key];
|
||||
}
|
||||
|
|
|
@ -2417,6 +2417,11 @@
|
|||
{
|
||||
return Math.round(value);
|
||||
}
|
||||
// Workaround for previous in patch written to mxCell in 10.0.23
|
||||
else if (isXml && obj.nodeName == 'mxCell' && key == 'previous')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
return value;
|
||||
|
|
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.23",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.24",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.23",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.24",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/")||
|
||||
|
|
10
src/main/webapp/js/viewer.min.js
vendored
10
src/main/webapp/js/viewer.min.js
vendored
|
@ -2905,11 +2905,11 @@ null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getM
|
|||
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,b){var c=0,d=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0,b.cellCount=0);
|
||||
for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var m=a[e].node.cloneNode(!1);m.removeAttribute("name");d.root=a[e].root;var k=f.encode(d);this.editor.graph.saveViewState(a[e].viewState,k,!0);m.appendChild(k);null!=b&&(b.eltCount+=m.getElementsByTagName("*").length,b.nodeCount+=m.getElementsByTagName("mxCell").length,b.cellCount+=d.getDescendants(d.root).length);c=(c<<5)-c+this.hashValue(m,function(a,c,b,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=
|
||||
c&&"height"!=c?b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){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,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(c^=this.hashValue(e,
|
||||
b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}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=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
c&&"height"!=c?d&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){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,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;
|
||||
null!=g&&(c^=this.hashValue(e,b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}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=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};
|
||||
};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,
|
||||
"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
|
||||
"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);
|
||||
|
|
Loading…
Reference in a new issue