10.0.17 release
This commit is contained in:
parent
93c17ee9f7
commit
92044b9f5d
20 changed files with 1149 additions and 1131 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
03-JAN-2019: 10.0.17
|
||||
|
||||
- Fixes sync for PNG files in desktop app
|
||||
- Fixes handling of auth error in Drive
|
||||
- Uses main app ID for Drive viewer
|
||||
- Fixes clipping in Google add-ons
|
||||
- Uses mxGraph 3.9.13 beta 2
|
||||
- Fixes redo button state
|
||||
- Removes debug output
|
||||
|
||||
02-JAN-2019: 10.0.16
|
||||
|
||||
- Handles shadow change during catchup
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
10.0.16
|
||||
10.0.17
|
|
@ -1085,8 +1085,7 @@ mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(th
|
|||
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
||||
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
||||
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=mxUtils.bind(this,function(a){if(!b.get(a)&&this.model.contains(a))if(this.model.isEdge(a)||this.model.isVertex(a))b.put(a,!0),c.push(a);else for(var e=this.model.getChildCount(a),f=0;f<e;f++)d(this.model.getChildAt(a,f))}),e=0;e<a.length;e++){var f=a[e];if(f.constructor!=mxRootChange){var g=null;f instanceof mxChildChange?g=f.child:null!=f.cell&&f.cell instanceof mxCell&&(g=f.cell);null!=g&&d(g)}}return c};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};
|
||||
mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?this.model.contains(d.previous)&&!this.model.contains(d.parent)&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)this.model.contains(a[c])||b.push(a[c]);this.removeSelectionCells(b)};
|
||||
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
|
||||
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
||||
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 01/02/2019 11:59 AM
|
||||
# 01/03/2019 02:35 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
|
@ -249,7 +249,7 @@
|
|||
graph.getPageSize = function()
|
||||
{
|
||||
return new mxRectangle(0, 0, this.pageFormat.width * this.pageScale,
|
||||
this.pageFormat.height * this.pageScale);
|
||||
this.pageFormat.height * this.pageScale);
|
||||
};
|
||||
|
||||
graph.getPageLayout = function()
|
||||
|
@ -285,9 +285,9 @@
|
|||
var page = this.graph.getPageSize();
|
||||
|
||||
return new mxRectangle(this.scale * (this.translate.x + layout.x * page.width),
|
||||
this.scale * (this.translate.y + layout.y * page.height),
|
||||
this.scale * layout.width * page.width,
|
||||
this.scale * layout.height * page.height);
|
||||
this.scale * (this.translate.y + layout.y * page.height),
|
||||
this.scale * layout.width * page.width,
|
||||
this.scale * layout.height * page.height);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -300,13 +300,14 @@
|
|||
{
|
||||
var s = Math.min(data.w / b.width, data.h / b.height);
|
||||
graph.view.scaleAndTranslate(s,
|
||||
Math.floor(data.border / s - b.x),
|
||||
Math.floor(data.border / s - b.y));
|
||||
Math.floor(data.border / s - Math.floor(b.x)),
|
||||
Math.floor(data.border / s - Math.floor(b.y)));
|
||||
}
|
||||
else
|
||||
{
|
||||
graph.view.scaleAndTranslate(data.scale, Math.floor(data.border - b.x),
|
||||
Math.floor(data.border - b.y));
|
||||
graph.view.scaleAndTranslate(data.scale,
|
||||
Math.floor(data.border - Math.floor(b.x)),
|
||||
Math.floor(data.border - Math.floor(b.y)));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -354,7 +355,8 @@
|
|||
x0 -= layout.x * pf.width;
|
||||
y0 -= layout.y * pf.height;
|
||||
|
||||
if (preview == null) {
|
||||
if (preview == null)
|
||||
{
|
||||
preview = new mxPrintPreview(graph, scale, pf, border, x0, y0);
|
||||
preview.printBackgroundImage = true;
|
||||
preview.autoOrigin = autoOrigin;
|
||||
|
|
1455
src/main/webapp/js/app.min.js
vendored
1455
src/main/webapp/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
27
src/main/webapp/js/atlas-viewer.min.js
vendored
27
src/main/webapp/js/atlas-viewer.min.js
vendored
|
@ -1194,8 +1194,7 @@ mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(th
|
|||
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
||||
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
||||
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=mxUtils.bind(this,function(a){if(!b.get(a)&&this.model.contains(a))if(this.model.isEdge(a)||this.model.isVertex(a))b.put(a,!0),c.push(a);else for(var e=this.model.getChildCount(a),f=0;f<e;f++)d(this.model.getChildAt(a,f))}),e=0;e<a.length;e++){var f=a[e];if(f.constructor!=mxRootChange){var g=null;f instanceof mxChildChange?g=f.child:null!=f.cell&&f.cell instanceof mxCell&&(g=f.cell);null!=g&&d(g)}}return c};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};
|
||||
mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?this.model.contains(d.previous)&&!this.model.contains(d.parent)&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)this.model.contains(a[c])||b.push(a[c]);this.removeSelectionCells(b)};
|
||||
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
|
||||
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
||||
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
||||
|
@ -2301,7 +2300,7 @@ a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenter
|
|||
l(b,this.arrowRight);l(e,this.arrowLeft);l(d,this.arrowUp);l(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
|
||||
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
|
||||
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(!this.graph.getModel().contains(a))return null;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.update=function(a,b,e){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,e))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);
|
||||
this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,e)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==e||!mxUtils.contains(this.bbox,b,e))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
|
||||
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
|
||||
|
@ -2643,7 +2642,7 @@ mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new Ou
|
|||
null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
|
||||
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};
|
||||
Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.stats={joined:0,reloads:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgReceived:0,msgSent:0,cacheHits:0,cacheMiss:0,conflicts:0,timeouts:0};
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.stats={merges:0,joined:0,reloads:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgReceived:0,msgSent:0,cacheHits:0,cacheMiss:0,conflicts:0,timeouts:0};
|
||||
DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};DrawioFile.prototype.updateFile=function(a,b,e){this.getLatestVersion(mxUtils.bind(this,function(d){try{null!=e&&e()||(null!=d?this.mergeFile(d,a,b):this.reloadFile(a,b))}catch(k){null!=b&&b(k)}}),b)};
|
||||
DrawioFile.prototype.mergeFile=function(a,b,e){try{var d=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement);this.checkShadow(d);this.shadowPages=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);this.backupPatch=this.isModified()?this.ui.diffPages(d,this.ui.pages):null;var k=[this.ui.diffPages(d,this.shadowPages)];if(!this.ignorePatches(k)){var l=this.ui.patchPages(d,k[0]),p=this.ui.getHashValueForPages(l),q=this.ui.getHashValueForPages(this.shadowPages);
|
||||
"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",k,"checksum",q==p,p);if(null!=p&&p!=q){var u=this.compressReportData(this.getAnonymizedXmlForPages(l));this.checksumError(e,k,"Checksum: "+p+"\nCurrent: "+q+"\nPatched:\n"+u);return}this.patch(k,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null);this.checkPages()}this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(c){this.invalidChecksum=
|
||||
|
@ -2652,9 +2651,9 @@ DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUt
|
|||
DrawioFile.prototype.checkPages=function(){this.ui.getCurrentFile()!=this||null!=this.ui.pages&&0!=this.ui.pages.length||this.sendErrorReport("Pages is null or empty","ShadowPages: "+(null!=this.shadowPages)+"\nShadowData: "+(null!=this.shadowData))};
|
||||
DrawioFile.prototype.checkShadow=function(a){if(null==a||0==a.length){var b=null==this.shadowData?"null":this.compressReportData(this.ui.anonymizeString(this.shadowData),null,1E3);this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:"null")+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:"null")+"\nShadowData: "+b)}};
|
||||
DrawioFile.prototype.compressReportData=function(a,b,e){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");null!=e&&null!=a&&a.length>e&&(a=a.substring(0,e)+"[...]");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b,e){try{var d=this.getCurrentUser(),k=null!=d?this.ui.hashValue(d.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var l=this.getTitle(),p=l.lastIndexOf("."),d="none";0<p&&(d=l.substring(p));var q=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.getId()+" ("+this.getMode()+")"+(null!=
|
||||
this.sync?"\nClient="+this.sync.clientId:"")+"\nUser="+k+"\nExt="+d+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+q)}catch(u){}};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),2E4),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b,e){try{var d=this.getCurrentUser(),k=null!=d?this.ui.hashValue(d.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var l=this.getTitle(),p=l.lastIndexOf("."),d="none";0<p&&(d=l.substring(p));var q=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+
|
||||
")"+(null!=this.sync?"\nClient="+this.sync.clientId:"")+"\nUser="+k+"\nExt="+d+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+q)}catch(u){}};
|
||||
DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.reloads++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),l=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(l,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=this.stats);
|
||||
null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}catch(d){null!=b&&b(d)}};
|
||||
DrawioFile.prototype.copyFile=function(a,b){this.constructor!=DriveFile||this.isRestricted()?this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this)):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,b)}catch(e){b(e)}}),b,!0)};DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,e=0;e<a.length&&b;e++)b=b&&0==Object.keys(a[e]).length;return b};
|
||||
|
@ -2664,8 +2663,8 @@ l.mathEnabled?(this.ui.editor.updateGraphComponents(),l.refresh()):(q!=l.folding
|
|||
DrawioFile.prototype.save=function(a,b,e,d,k,l){if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};
|
||||
DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};
|
||||
DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};
|
||||
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&(this.ui.setFileData(a),this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.stats.openTimestamp=(new Date).toISOString(),this.stats.openShadowLength=null!=this.shadowData?this.shadowData.length:0);this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};
|
||||
DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.startSync=function(){"auto"==DrawioFile.SYNC&&"1"!=urlParams.stealth&&(this.sync=new DrawioFileSync(this),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};
|
||||
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&(this.ui.setFileData(a),this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};
|
||||
DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(this.sync=new DrawioFileSync(this),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};
|
||||
DrawioFile.prototype.getChannelId=function(){return this.ui.editor.graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};
|
||||
DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
|
||||
DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
|
||||
|
@ -2938,10 +2937,10 @@ this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};Edit
|
|||
mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d,e){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),
|
||||
n=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(g=mxResources.get("cancel"),n=function(){c();f.retry()}),404==f.code||404==f.status||403==f.code){a=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+='<br><a href="https://drive.google.com/open?id='+k+'" target="_blank">'+
|
||||
mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?a=mxUtils.htmlEntities(f.response.error):"undefined"!==window.App&&(f.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(a=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,a,g,d,n,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()};EditorUi.prototype.showError=
|
||||
function(a,b,d,e,k,h,m,l,v,p,q,t,z){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,k,h,m,t,l,v);this.showDialog(a.container,p||340,q||(null!=b&&120<b.length?180:150),!0,!1,z);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,k){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,
|
||||
a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,k)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=
|
||||
function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,e=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(e,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=
|
||||
urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",
|
||||
function(a,b,d,e,k,h,m,l,v,p,q,t,z){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,k,h,m,t,l,v);this.showDialog(a.container,p||340,q||(null!=b&&120<b.length?180:150),!0,!1,z);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,k){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,
|
||||
function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,k);this.showDialog(a.container,340,90,!0,!1);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};
|
||||
EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,e=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(e,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=
|
||||
function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",
|
||||
!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,k){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)this.showTextDialog(b+":",a);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&
|
||||
"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(v){}}else this.createEchoRequest(a,b,d,e,k).simulate(document,"_blank")}};
|
||||
EditorUi.prototype.createEchoRequest=function(a,b,d,e,k,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=k?"&format="+k:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),m=0;m<e;++m){for(var k=1024*m,l=Math.min(k+1024,d),p=Array(l-k),q=0;k<l;++q,++k)p[q]=c[k].charCodeAt(0);f[m]=new Uint8Array(p)}return new Blob(f,
|
||||
|
@ -3144,7 +3143,7 @@ this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change
|
|||
!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=
|
||||
function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=
|
||||
urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&
|
||||
a);this.actions.get("redo").setEnabled(this.canUndo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
|
||||
a);this.actions.get("redo").setEnabled(this.canRedo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
|
||||
this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,
|
||||
function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';
|
||||
break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,
|
||||
|
|
634
src/main/webapp/js/atlas.min.js
vendored
634
src/main/webapp/js/atlas.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -856,6 +856,11 @@ var ConfirmDialog = function(editorUi, message, okFn, cancelFn, okLabel, cancelL
|
|||
btns.style.marginTop = '16px';
|
||||
}
|
||||
|
||||
this.init = function()
|
||||
{
|
||||
okBtn.focus();
|
||||
};
|
||||
|
||||
this.container = div;
|
||||
};
|
||||
|
||||
|
@ -3287,7 +3292,8 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
|
|||
|
||||
mxEvent.addListener(nameInput, 'keypress', function(e)
|
||||
{
|
||||
if (e.keyCode == 13)
|
||||
if (editorUi.dialog.container.firstChild == outer &&
|
||||
e.keyCode == 13)
|
||||
{
|
||||
create();
|
||||
}
|
||||
|
@ -4810,20 +4816,26 @@ var AboutDialog = function(editorUi)
|
|||
img.style.height = '219px';
|
||||
img.setAttribute('src', IMAGE_PATH + '/logo-flat.png');
|
||||
}
|
||||
|
||||
|
||||
if (uiTheme == 'dark')
|
||||
{
|
||||
img.style.filter = 'grayscale(100%) invert(100%)';
|
||||
}
|
||||
|
||||
div.appendChild(img);
|
||||
mxUtils.br(div);
|
||||
|
||||
var clr = (uiTheme == 'dark') ? '#cccccc' : '#505050';
|
||||
var v = document.createElement('small');
|
||||
v.innerHTML = 'v ' + EditorUi.VERSION;
|
||||
v.style.color = '#505050';
|
||||
v.style.color = clr;
|
||||
div.appendChild(v);
|
||||
|
||||
mxUtils.br(div);
|
||||
mxUtils.br(div);
|
||||
|
||||
var small = document.createElement('small');
|
||||
small.style.color = '#505050';
|
||||
small.style.color = clr;
|
||||
small.innerHTML = '© 2005-2018 <a href="https://about.draw.io/" style="color:inherit;" target="_blank">JGraph Ltd</a>.<br>All Rights Reserved.';
|
||||
div.appendChild(small);
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ DrawioFile.prototype.reportEnabled = true;
|
|||
* Specifies if notify events should be ignored.
|
||||
*/
|
||||
DrawioFile.prototype.stats = {
|
||||
merges: 0, /* number of calls to merge */
|
||||
joined: 0, /* number of join messages received */
|
||||
reloads: 0, /* number of times the file was reloaded */
|
||||
checksumErrors: 0, /* number of checksum errors */
|
||||
|
@ -413,7 +414,7 @@ DrawioFile.prototype.checksumError = function(error, patches, details)
|
|||
|
||||
var data = this.compressReportData(
|
||||
this.getAnonymizedXmlForPages(
|
||||
this.shadowPages));
|
||||
this.shadowPages), 20000);
|
||||
var json = this.compressReportData(
|
||||
JSON.stringify(patches, null, 2));
|
||||
|
||||
|
@ -458,7 +459,7 @@ DrawioFile.prototype.sendErrorReport = function(title, details, error)
|
|||
|
||||
EditorUi.sendReport(title + ' ' + new Date().toISOString() + ':' +
|
||||
'\n\nBrowser=' + navigator.userAgent +
|
||||
'\nFile=' + this.getId() + ' (' + this.getMode() + ')' +
|
||||
'\nFile=' + this.ui.hashValue(this.getId()) + ' (' + this.getMode() + ')' +
|
||||
((this.sync != null) ? ('\nClient=' + this.sync.clientId) : '') +
|
||||
'\nUser=' + uid +
|
||||
'\nExt=' + ext +
|
||||
|
@ -919,9 +920,6 @@ DrawioFile.prototype.open = function()
|
|||
|
||||
// Updates shadow in case any page IDs have been updated
|
||||
this.shadowData = mxUtils.getXml(this.ui.getXmlFileData());
|
||||
this.stats.openTimestamp = new Date().toISOString();
|
||||
this.stats.openShadowLength = (this.shadowData != null) ?
|
||||
this.shadowData.length : 0;
|
||||
}
|
||||
|
||||
this.installListeners();
|
||||
|
@ -982,7 +980,9 @@ DrawioFile.prototype.loadPatchDescriptor = function(success, error)
|
|||
*/
|
||||
DrawioFile.prototype.startSync = function()
|
||||
{
|
||||
if (DrawioFile.SYNC == 'auto' && urlParams['stealth'] != '1')
|
||||
if ((DrawioFile.SYNC == 'auto' && urlParams['stealth'] != '1') &&
|
||||
(urlParams['rt'] == '1' || !this.ui.editor.chromeless ||
|
||||
this.ui.editor.editable))
|
||||
{
|
||||
this.sync = new DrawioFileSync(this);
|
||||
this.sync.start();
|
||||
|
|
|
@ -864,6 +864,8 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
|
|||
|
||||
if (!this.file.ignorePatches(patches))
|
||||
{
|
||||
this.file.stats.merges++;
|
||||
|
||||
// Patches the shadow document
|
||||
for (var i = 0; i < patches.length; i++)
|
||||
{
|
||||
|
@ -998,8 +1000,6 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
|
|||
this.resetUpdateStatusThread();
|
||||
this.catchupRetryCount = 0;
|
||||
|
||||
console.log('fileSaved');
|
||||
|
||||
if (this.isConnected() && !this.file.inConflictState && !this.redirectDialogShowing)
|
||||
{
|
||||
// Computes diff and checksum
|
||||
|
|
|
@ -13,19 +13,9 @@ DriveClient = function(editorUi)
|
|||
|
||||
// New mime type for XML files
|
||||
this.xmlMimeType = 'application/vnd.jgraph.mxfile';
|
||||
|
||||
if (this.ui.editor.isChromelessView() && urlParams['rt'] != '1')
|
||||
{
|
||||
// Workaround for Google Drive requiring the user to click on the file in the
|
||||
// drive UI when not using this scope (user other scope with rt=1 URL param)
|
||||
this.appId = '850530949725';
|
||||
this.clientId = '850530949725.apps.googleusercontent.com';
|
||||
this.scopes = ['https://www.googleapis.com/auth/drive.readonly', 'openid'];
|
||||
|
||||
// Only used for writing files which is disabled in viewer app
|
||||
this.mimeType = 'all_types_supported';
|
||||
}
|
||||
else if (this.ui.isDriveDomain())
|
||||
|
||||
// Reading files now possible with no initial click in drive
|
||||
if (this.ui.isDriveDomain())
|
||||
{
|
||||
this.appId = '671128082532';
|
||||
this.clientId = '671128082532.apps.googleusercontent.com';
|
||||
|
@ -388,7 +378,8 @@ DriveClient.prototype.executeRequest = function(req, success, error)
|
|||
(resp.error.code == 403 && reason != 'rateLimitExceeded')))
|
||||
{
|
||||
// Shows an error if we're authenticated but the server still doesn't allow it
|
||||
if (resp.error.code == 403 && this.user != null)
|
||||
if ((resp.error.code == 403 && this.user != null) ||
|
||||
(resp.error.code == 401 && this.user != null && reason == 'authError'))
|
||||
{
|
||||
if (error != null)
|
||||
{
|
||||
|
|
|
@ -3591,7 +3591,7 @@
|
|||
{
|
||||
var resume = (this.spinner != null && this.spinner.pause != null) ? this.spinner.pause() : function() {};
|
||||
|
||||
this.showDialog(new ConfirmDialog(this, msg, function()
|
||||
var dlg = new ConfirmDialog(this, msg, function()
|
||||
{
|
||||
resume();
|
||||
|
||||
|
@ -3607,7 +3607,9 @@
|
|||
{
|
||||
cancelFn();
|
||||
}
|
||||
}, okLabel, cancelLabel).container, 340, 90, true, false);
|
||||
}, okLabel, cancelLabel);
|
||||
this.showDialog(dlg.container, 340, 90, true, false);
|
||||
dlg.init();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -11310,7 +11312,7 @@
|
|||
|
||||
// Updates undo history states
|
||||
this.actions.get('undo').setEnabled(this.canUndo() && editable);
|
||||
this.actions.get('redo').setEnabled(this.canUndo() && editable);
|
||||
this.actions.get('redo').setEnabled(this.canRedo() && editable);
|
||||
|
||||
// Disables menus
|
||||
this.menus.get('edit').setEnabled(active);
|
||||
|
|
|
@ -693,6 +693,8 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
|
|||
{
|
||||
var doSave = mxUtils.bind(this, function(data, enc)
|
||||
{
|
||||
var savedData = this.data;
|
||||
|
||||
// Makes sure no changes get lost while the file is saved
|
||||
var prevModified = this.isModified;
|
||||
var modified = this.isModified();
|
||||
|
@ -736,7 +738,7 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
|
|||
var lastDesc = this.stat;
|
||||
this.stat = stat2;
|
||||
|
||||
this.fileSaved(data, lastDesc, mxUtils.bind(this, function()
|
||||
this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
|
||||
{
|
||||
this.contentChanged();
|
||||
|
||||
|
|
7
src/main/webapp/js/embed-static.min.js
vendored
7
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.16",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.17",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/")||
|
||||
|
@ -1118,8 +1118,7 @@ mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(th
|
|||
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
||||
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
||||
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=mxUtils.bind(this,function(a){if(!b.get(a)&&this.model.contains(a))if(this.model.isEdge(a)||this.model.isVertex(a))b.put(a,!0),c.push(a);else for(var e=this.model.getChildCount(a),f=0;f<e;f++)d(this.model.getChildAt(a,f))}),e=0;e<a.length;e++){var f=a[e];if(f.constructor!=mxRootChange){var g=null;f instanceof mxChildChange?g=f.child:null!=f.cell&&f.cell instanceof mxCell&&(g=f.cell);null!=g&&d(g)}}return c};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};
|
||||
mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?this.model.contains(d.previous)&&!this.model.contains(d.parent)&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)this.model.contains(a[c])||b.push(a[c]);this.removeSelectionCells(b)};
|
||||
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
|
||||
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
||||
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
||||
|
@ -1640,7 +1639,7 @@ a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenter
|
|||
f(b,this.arrowRight);f(c,this.arrowLeft);f(d,this.arrowUp);f(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
|
||||
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
|
||||
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(!this.graph.getModel().contains(a))return null;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.update=function(a,b,c){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,c))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);
|
||||
this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,c)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==c||!mxUtils.contains(this.bbox,b,c))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
|
||||
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
|
||||
|
|
|
@ -1971,6 +1971,7 @@ var OutlineWindow = function(editorUi, x, y, w, h)
|
|||
*/
|
||||
var LayersWindow = function(editorUi, x, y, w, h)
|
||||
{
|
||||
console.log('dialog.bg', Dialog.backdropColor);
|
||||
var graph = editorUi.editor.graph;
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
@ -1984,7 +1985,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
|
|||
var tbarHeight = (!EditorUi.compactUi) ? '30px' : '26px';
|
||||
|
||||
var listDiv = document.createElement('div')
|
||||
listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#dcdcdc' : '#e5e5e5';
|
||||
listDiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? '#dcdcdc' : Dialog.backdropColor;
|
||||
listDiv.style.position = 'absolute';
|
||||
listDiv.style.overflow = 'auto';
|
||||
listDiv.style.left = '0px';
|
||||
|
@ -2223,7 +2224,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
|
|||
ldiv.style.padding = '4px';
|
||||
ldiv.style.height = '22px';
|
||||
ldiv.style.display = 'block';
|
||||
ldiv.style.backgroundColor = 'whiteSmoke';
|
||||
ldiv.style.backgroundColor = (Dialog.backdropColor == 'white') ? 'whiteSmoke' : Dialog.backdropColor;
|
||||
ldiv.style.borderWidth = '0px 0px 1px 0px';
|
||||
ldiv.style.borderColor = '#c3c3c3';
|
||||
ldiv.style.borderStyle = 'solid';
|
||||
|
@ -2436,7 +2437,7 @@ var LayersWindow = function(editorUi, x, y, w, h)
|
|||
|
||||
if (graph.getDefaultParent() == child)
|
||||
{
|
||||
ldiv.style.background = '#e6eff8';
|
||||
ldiv.style.background = (Dialog.backdropColor == 'white') ? '#e6eff8' : '#505759';
|
||||
ldiv.style.fontWeight = (graph.isEnabled()) ? 'bold' : '';
|
||||
selectionLayer = child;
|
||||
}
|
||||
|
|
|
@ -3749,10 +3749,14 @@ HoverIcons.prototype.getState = function(state)
|
|||
if (state != null)
|
||||
{
|
||||
var cell = state.cell;
|
||||
|
||||
// Uses connectable parent vertex if child is not connectable
|
||||
if (this.graph.getModel().isVertex(cell) && !this.graph.isCellConnectable(cell))
|
||||
|
||||
if (!this.graph.getModel().contains(cell))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else if (this.graph.getModel().isVertex(cell) && !this.graph.isCellConnectable(cell))
|
||||
{
|
||||
// Uses connectable parent vertex if child is not connectable
|
||||
var parent = this.graph.getModel().getParent(cell);
|
||||
|
||||
if (this.graph.getModel().isVertex(parent) && this.graph.isCellConnectable(parent))
|
||||
|
|
|
@ -1081,7 +1081,7 @@ Sidebar.prototype.addMiscPalette = function(expand)
|
|||
return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Shape Group');
|
||||
}),
|
||||
this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;left=0;right=0;fillColor=none;', 120, 60, '', 'Partial Rectangle'),
|
||||
this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;top=0;bottom=1;fillColor=none;routingCenterX=-0.5;', 120, 60, '', 'Partial Rectangle'),
|
||||
this.createVertexTemplateEntry('shape=partialRectangle;whiteSpace=wrap;html=1;bottom=1;right=1;left=1;top=0;fillColor=none;routingCenterX=-0.5;', 120, 60, '', 'Partial Rectangle'),
|
||||
this.createEdgeTemplateEntry('edgeStyle=segmentEdgeStyle;endArrow=classic;html=1;', 50, 50, '', 'Manual Line', null, lineTags + 'manual'),
|
||||
this.createEdgeTemplateEntry('shape=filledEdge;rounded=0;fixDash=1;endArrow=none;strokeWidth=10;fillColor=#ffffff;edgeStyle=orthogonalEdgeStyle;', 60, 40, '', 'Filled Edge'),
|
||||
this.createEdgeTemplateEntry('edgeStyle=elbowEdgeStyle;elbow=horizontal;endArrow=classic;html=1;', 50, 50, '', 'Horizontal Elbow', null, lineTags + 'elbow horizontal'),
|
||||
|
|
7
src/main/webapp/js/reader.min.js
vendored
7
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.16",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.17",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/")||
|
||||
|
@ -1118,8 +1118,7 @@ mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(th
|
|||
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
||||
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
||||
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=mxUtils.bind(this,function(a){if(!b.get(a)&&this.model.contains(a))if(this.model.isEdge(a)||this.model.isVertex(a))b.put(a,!0),c.push(a);else for(var e=this.model.getChildCount(a),f=0;f<e;f++)d(this.model.getChildAt(a,f))}),e=0;e<a.length;e++){var f=a[e];if(f.constructor!=mxRootChange){var g=null;f instanceof mxChildChange?g=f.child:null!=f.cell&&f.cell instanceof mxCell&&(g=f.cell);null!=g&&d(g)}}return c};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};
|
||||
mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?this.model.contains(d.previous)&&!this.model.contains(d.parent)&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)this.model.contains(a[c])||b.push(a[c]);this.removeSelectionCells(b)};
|
||||
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
|
||||
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
||||
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
||||
|
@ -1640,7 +1639,7 @@ a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenter
|
|||
f(b,this.arrowRight);f(c,this.arrowLeft);f(d,this.arrowUp);f(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
|
||||
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
|
||||
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(!this.graph.getModel().contains(a))return null;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.update=function(a,b,c){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,c))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);
|
||||
this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,c)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==c||!mxUtils.contains(this.bbox,b,c))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
|
||||
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
|
||||
|
|
27
src/main/webapp/js/viewer.min.js
vendored
27
src/main/webapp/js/viewer.min.js
vendored
|
@ -1194,8 +1194,7 @@ mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(th
|
|||
mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)};mxGraph.prototype.createStylesheet=function(){return new mxStylesheet};mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)};mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer};mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)};mxGraph.prototype.getModel=function(){return this.model};mxGraph.prototype.getView=function(){return this.view};
|
||||
mxGraph.prototype.getStylesheet=function(){return this.stylesheet};mxGraph.prototype.setStylesheet=function(a){this.stylesheet=a};mxGraph.prototype.getSelectionModel=function(){return this.selectionModel};mxGraph.prototype.setSelectionModel=function(a){this.selectionModel=a};
|
||||
mxGraph.prototype.getSelectionCellsForChanges=function(a){for(var b=new mxDictionary,c=[],d=mxUtils.bind(this,function(a){if(!b.get(a)&&this.model.contains(a))if(this.model.isEdge(a)||this.model.isVertex(a))b.put(a,!0),c.push(a);else for(var e=this.model.getChildCount(a),f=0;f<e;f++)d(this.model.getChildAt(a,f))}),e=0;e<a.length;e++){var f=a[e];if(f.constructor!=mxRootChange){var g=null;f instanceof mxChildChange?g=f.child:null!=f.cell&&f.cell instanceof mxCell&&(g=f.cell);null!=g&&d(g)}}return c};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.removeSelectionCells(this.getRemovedCellsForChanges(a));this.view.validate();this.sizeDidChange()};
|
||||
mxGraph.prototype.getRemovedCellsForChanges=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];if(d instanceof mxRootChange)break;else d instanceof mxChildChange?this.model.contains(d.previous)&&!this.model.contains(d.parent)&&(b=b.concat(this.model.getDescendants(d.child))):d instanceof mxVisibleChange&&(b=b.concat(this.model.getDescendants(d.cell)))}return b};
|
||||
mxGraph.prototype.graphModelChanged=function(a){for(var b=0;b<a.length;b++)this.processChange(a[b]);this.updateSelection();this.view.validate();this.sizeDidChange()};mxGraph.prototype.updateSelection=function(){for(var a=this.getSelectionCells(),b=[],c=0;c<a.length;c++)this.model.contains(a[c])||b.push(a[c]);this.removeSelectionCells(b)};
|
||||
mxGraph.prototype.processChange=function(a){if(a instanceof mxRootChange)this.clearSelection(),this.setDefaultParent(null),this.removeStateForCell(a.previous),this.resetViewOnRootChange&&(this.view.scale=1,this.view.translate.x=0,this.view.translate.y=0),this.fireEvent(new mxEventObject(mxEvent.ROOT));else if(a instanceof mxChildChange){var b=this.model.getParent(a.child);this.view.invalidate(a.child,!0,!0);if(!this.model.contains(b)||this.isCellCollapsed(b))this.view.invalidate(a.child,!0,!0),this.removeStateForCell(a.child),
|
||||
this.view.currentRoot==a.child&&this.home();b!=a.previous&&(null!=b&&this.view.invalidate(b,!1,!1),null!=a.previous&&this.view.invalidate(a.previous,!1,!1))}else a instanceof mxTerminalChange||a instanceof mxGeometryChange?(a instanceof mxTerminalChange||null==a.previous&&null!=a.geometry||null!=a.previous&&!a.previous.equals(a.geometry))&&this.view.invalidate(a.cell):a instanceof mxValueChange?this.view.invalidate(a.cell,!1,!1):a instanceof mxStyleChange?(this.view.invalidate(a.cell,!0,!0),a=this.view.getState(a.cell),
|
||||
null!=a&&(a.style=null)):null!=a.cell&&a.cell instanceof mxCell&&this.removeStateForCell(a.cell)};mxGraph.prototype.removeStateForCell=function(a){for(var b=this.model.getChildCount(a),c=0;c<b;c++)this.removeStateForCell(this.model.getChildAt(a,c));this.view.invalidate(a,!1,!0);this.view.removeState(a)};
|
||||
|
@ -2301,7 +2300,7 @@ a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenter
|
|||
l(b,this.arrowRight);l(e,this.arrowLeft);l(d,this.arrowUp);l(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
|
||||
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
|
||||
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.getState=function(a){if(null!=a){a=a.cell;if(!this.graph.getModel().contains(a))return null;if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a)}return a};
|
||||
HoverIcons.prototype.update=function(a,b,e){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,e))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);
|
||||
this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,e)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==e||!mxUtils.contains(this.bbox,b,e))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
|
||||
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
|
||||
|
@ -2643,7 +2642,7 @@ mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new Ou
|
|||
null,Editor.ctrlKey+"+Shift+O");l.setToggleAction(!0);l.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};Actions.prototype.addAction=function(a,b,e,d,k){var l;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),l=mxResources.get(a)+"..."):l=mxResources.get(a);return this.put(a,new Action(l,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};
|
||||
function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;this.visible=!0}mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};
|
||||
Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||""};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.stats={joined:0,reloads:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgReceived:0,msgSent:0,cacheHits:0,cacheMiss:0,conflicts:0,timeouts:0};
|
||||
DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=18E5;DrawioFile.prototype.inConflictState=!1;DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.stats={merges:0,joined:0,reloads:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgReceived:0,msgSent:0,cacheHits:0,cacheMiss:0,conflicts:0,timeouts:0};
|
||||
DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};DrawioFile.prototype.updateFile=function(a,b,e){this.getLatestVersion(mxUtils.bind(this,function(d){try{null!=e&&e()||(null!=d?this.mergeFile(d,a,b):this.reloadFile(a,b))}catch(k){null!=b&&b(k)}}),b)};
|
||||
DrawioFile.prototype.mergeFile=function(a,b,e){try{var d=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement);this.checkShadow(d);this.shadowPages=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);this.backupPatch=this.isModified()?this.ui.diffPages(d,this.ui.pages):null;var k=[this.ui.diffPages(d,this.shadowPages)];if(!this.ignorePatches(k)){var l=this.ui.patchPages(d,k[0]),p=this.ui.getHashValueForPages(l),q=this.ui.getHashValueForPages(this.shadowPages);
|
||||
"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",k,"checksum",q==p,p);if(null!=p&&p!=q){var u=this.compressReportData(this.getAnonymizedXmlForPages(l));this.checksumError(e,k,"Checksum: "+p+"\nCurrent: "+q+"\nPatched:\n"+u);return}this.patch(k,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null);this.checkPages()}this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(c){this.invalidChecksum=
|
||||
|
@ -2652,9 +2651,9 @@ DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUt
|
|||
DrawioFile.prototype.checkPages=function(){this.ui.getCurrentFile()!=this||null!=this.ui.pages&&0!=this.ui.pages.length||this.sendErrorReport("Pages is null or empty","ShadowPages: "+(null!=this.shadowPages)+"\nShadowData: "+(null!=this.shadowData))};
|
||||
DrawioFile.prototype.checkShadow=function(a){if(null==a||0==a.length){var b=null==this.shadowData?"null":this.compressReportData(this.ui.anonymizeString(this.shadowData),null,1E3);this.sendErrorReport("Shadow is null or empty","Shadow: "+(null!=a?a.length:"null")+"\nShadowPages: "+(null!=this.shadowPages?this.shadowPages.length:"null")+"\nShadowData: "+b)}};
|
||||
DrawioFile.prototype.compressReportData=function(a,b,e){null!=a&&a.length>(null!=b?b:1E4)&&(a=this.ui.editor.graph.compress(a)+"\n");null!=e&&null!=a&&a.length>e&&(a=a.substring(0,e)+"[...]");return a};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages)),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b,e){try{var d=this.getCurrentUser(),k=null!=d?this.ui.hashValue(d.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var l=this.getTitle(),p=l.lastIndexOf("."),d="none";0<p&&(d=l.substring(p));var q=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.getId()+" ("+this.getMode()+")"+(null!=
|
||||
this.sync?"\nClient="+this.sync.clientId:"")+"\nUser="+k+"\nExt="+d+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+q)}catch(u){}};
|
||||
DrawioFile.prototype.checksumError=function(a,b,e){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(null!=b)for(a=0;a<b.length;a++)this.ui.anonymizePatch(b[a]);var d=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),2E4),k=this.compressReportData(JSON.stringify(b,null,2));this.sendErrorReport("Checksum Error","Patches:\n"+k+(null!=e?"\n\n"+e:"")+"\n\nData:\n"+d)}catch(l){}};
|
||||
DrawioFile.prototype.sendErrorReport=function(a,b,e){try{var d=this.getCurrentUser(),k=null!=d?this.ui.hashValue(d.id):"unknown";null!=this.stats.start&&(this.stats.uptime=Math.round(((new Date).getTime()-(new Date(this.stats.start)).getTime())/1E3));var l=this.getTitle(),p=l.lastIndexOf("."),d="none";0<p&&(d=l.substring(p));var q=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+
|
||||
")"+(null!=this.sync?"\nClient="+this.sync.clientId:"")+"\nUser="+k+"\nExt="+d+"\nSize="+this.getSize()+"\nSync="+DrawioFile.SYNC+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+"\n\nStack:\n"+q)}catch(u){}};
|
||||
DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.reloads++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),l=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(l,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=this.stats);
|
||||
null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}catch(d){null!=b&&b(d)}};
|
||||
DrawioFile.prototype.copyFile=function(a,b){this.constructor!=DriveFile||this.isRestricted()?this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this)):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,b)}catch(e){b(e)}}),b,!0)};DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,e=0;e<a.length&&b;e++)b=b&&0==Object.keys(a[e]).length;return b};
|
||||
|
@ -2664,8 +2663,8 @@ l.mathEnabled?(this.ui.editor.updateGraphComponents(),l.refresh()):(q!=l.folding
|
|||
DrawioFile.prototype.save=function(a,b,e,d,k,l){if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))};
|
||||
DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};
|
||||
DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};
|
||||
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&(this.ui.setFileData(a),this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.stats.openTimestamp=(new Date).toISOString(),this.stats.openShadowLength=null!=this.shadowData?this.shadowData.length:0);this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};
|
||||
DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.startSync=function(){"auto"==DrawioFile.SYNC&&"1"!=urlParams.stealth&&(this.sync=new DrawioFileSync(this),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};
|
||||
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&(this.ui.setFileData(a),this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};DrawioFile.prototype.getRevisions=function(a,b){a(null)};
|
||||
DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(this.sync=new DrawioFileSync(this),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};
|
||||
DrawioFile.prototype.getChannelId=function(){return this.ui.editor.graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};
|
||||
DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
|
||||
DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
|
||||
|
@ -2938,10 +2937,10 @@ this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};Edit
|
|||
mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d,e){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){a=mxUtils.htmlEntities(mxResources.get("unknownError"));var g=mxResources.get("ok"),
|
||||
n=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(g=mxResources.get("cancel"),n=function(){c();f.retry()}),404==f.code||404==f.status||403==f.code){a=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied"));var k=window.location.hash;null!=k&&"#G"==k.substring(0,2)&&(k=k.substring(2),a+='<br><a href="https://drive.google.com/open?id='+k+'" target="_blank">'+
|
||||
mxUtils.htmlEntities(mxResources.get("tryOpeningViaThisPage"))+"</a>")}else null!=f.message?a=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?a=mxUtils.htmlEntities(f.response.error):"undefined"!==window.App&&(f.code==App.ERROR_TIMEOUT?a=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(a=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,a,g,d,n,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()};EditorUi.prototype.showError=
|
||||
function(a,b,d,e,k,h,m,l,v,p,q,t,z){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,k,h,m,t,l,v);this.showDialog(a.container,p||340,q||(null!=b&&120<b.length?180:150),!0,!1,z);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,k){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};this.showDialog((new ConfirmDialog(this,
|
||||
a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,k)).container,340,90,!0,!1)};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=
|
||||
function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,e=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(e,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=
|
||||
urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",
|
||||
function(a,b,d,e,k,h,m,l,v,p,q,t,z){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,k,h,m,t,l,v);this.showDialog(a.container,p||340,q||(null!=b&&120<b.length?180:150),!0,!1,z);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,k){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,
|
||||
function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,k);this.showDialog(a.container,340,90,!0,!1);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};
|
||||
EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(this.editor.graph.compress(b))));return c};EditorUi.prototype.saveCanvas=function(a,b,d){var c="jpeg"==d?"jpg":d,e=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(e,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=
|
||||
function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",
|
||||
!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,k){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else if(mxClient.IS_IOS)this.showTextDialog(b+":",a);else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&
|
||||
"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(v){}}else this.createEchoRequest(a,b,d,e,k).simulate(document,"_blank")}};
|
||||
EditorUi.prototype.createEchoRequest=function(a,b,d,e,k,h){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=k?"&format="+k:"")+(null!=h?"&base64="+h:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),m=0;m<e;++m){for(var k=1024*m,l=Math.min(k+1024,d),p=Array(l-k),q=0;k<l;++q,++k)p[q]=c[k].charCodeAt(0);f[m]=new Uint8Array(p)}return new Blob(f,
|
||||
|
@ -3144,7 +3143,7 @@ this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change
|
|||
!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;a&&isLocalStorage&&("1"==urlParams.browser||mxClient.IS_IOS)&&c++;mxClient.IS_IOS||c++;return c};EditorUi.prototype.updateUi=
|
||||
function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);d="1"!=
|
||||
urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&
|
||||
a);this.actions.get("redo").setEnabled(this.canUndo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
|
||||
a);this.actions.get("redo").setEnabled(this.canRedo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
|
||||
this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,
|
||||
function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,k=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';
|
||||
break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=k&&(this.offlineStatus.innerHTML=b,k=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,
|
||||
|
|
Loading…
Reference in a new issue