13.1.1 release

This commit is contained in:
Gaudenz Alder 2020-05-12 17:26:35 +02:00
parent 5876e39065
commit f539f1ff36
20 changed files with 2943 additions and 2654 deletions

View file

@ -1,3 +1,17 @@
12-MAY-2020: 13.1.1
- Adds noExitBtn option for embed mode
- Fixes group selection model
- Uses mxGraph 4.2.0 beta 2
11-MAY-2020: 13.1.0
- Adds support for pointer events in swimlanes
- Adds message in export/template response
- Adds grid to certain custom handles
- Changes to the selection model
- Uses mxGraph 4.2.0 beta 1
07-MAY-2020: 13.0.9
- Adds patch chain validation for real time

View file

@ -1 +1 @@
13.0.9
13.1.1

View file

@ -35,9 +35,9 @@ async function handleRequest(request)
confLicense = sParams.get('confLicense');
}
if (SEN == null)
if (licenseDump == null)
{
SEN = sParams.get('SEN');
licenseDump = sParams.get('licenseDump');
}
let email = params.get('email');
@ -52,22 +52,50 @@ async function handleRequest(request)
}
else if (confLicense != null && domain != null)
{
let msg = encodeURIComponent(('license:confLicense=' + confLicense + ',domain=' + domain));
let msg = encodeURIComponent(('license:cc-domain=' + domain + ',confLicense=' + confLicense));
let url = "https://log.diagrams.net/" + msg;
fetch(url);
}
else if (domain != null)
{
let msg = encodeURIComponent(('license:domain=' + domain));
let msg = encodeURIComponent(('license:cc-domain=' + domain));
let url = "https://log.diagrams.net/" + msg;
fetch(url);
}
if (licenseDump != null)
{
let msg = encodeURIComponent(('license:licenseDump=' + licenseDump));
let url = "https://log.diagrams.net/" + msg;
let msg = encodeURIComponent('license:cc-licenseDump=') + licenseDump;
let url = 'https://log.diagrams.net/' + msg;
fetch(url);
try
{
let licenseContent = decodeURIComponent(licenseDump);
let obj = JSON.parse(licenseContent);
// msg = encodeURIComponent(JSON.stringify(obj));
// url = 'https://log.diagrams.net/license:cc-obj-string' + msg;
// fetch(url);
if (obj != null && obj.installedDate != null)
{
msg = encodeURIComponent('license:cc-installDate:' + obj.installedDate + ',eval:' + obj.license.evaluation + ',active:' + obj.license.active);
url = 'https://log.diagrams.net/' + msg;
fetch(url);
if (obj.installedDate.startsWith('2019') && obj.license.active && obj.license.evaluation)
{
url = 'https://log.diagrams.net/license:cc-OMGWTFBBQ';
fetch(url);
}
}
}
catch (e)
{
let msg = encodeURIComponent('license:cc-error=') + e;
let url = 'https://log.diagrams.net/' + msg;
fetch(url);
}
}
if (domain != null)

View file

@ -1,4 +1,4 @@
var mxClient={VERSION:"4.1.2",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&
var mxClient={VERSION:"4.2.0",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&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:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&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:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!==typeof InstallTrigger,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_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=
@ -26,7 +26,7 @@ unescape(c)):mxResources.resources[d]=c}}}},get:function(a,b,c){a=mxResources.re
"/resources/graph",null,a)})}};function mxPoint(a,b){this.x=null!=a?a:0;this.y=null!=b?b:0}mxPoint.prototype.x=null;mxPoint.prototype.y=null;mxPoint.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y};mxPoint.prototype.clone=function(){return mxUtils.clone(this)};function mxRectangle(a,b,c,d){mxPoint.call(this,a,b);this.width=null!=c?c:0;this.height=null!=d?d:0}mxRectangle.prototype=new mxPoint;mxRectangle.prototype.constructor=mxRectangle;mxRectangle.prototype.width=null;
mxRectangle.prototype.height=null;mxRectangle.prototype.setRect=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d};mxRectangle.prototype.getCenterX=function(){return this.x+this.width/2};mxRectangle.prototype.getCenterY=function(){return this.y+this.height/2};
mxRectangle.prototype.add=function(a){if(null!=a){var b=Math.min(this.x,a.x),c=Math.min(this.y,a.y),d=Math.max(this.x+this.width,a.x+a.width);a=Math.max(this.y+this.height,a.y+a.height);this.x=b;this.y=c;this.width=d-b;this.height=a-c}};mxRectangle.prototype.intersect=function(a){if(null!=a){var b=this.x+this.width,c=a.x+a.width,d=this.y+this.height,e=a.y+a.height;this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.width=Math.min(b,c)-this.x;this.height=Math.min(d,e)-this.y}};
mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};
mxRectangle.prototype.grow=function(a){this.x-=a;this.y-=a;this.width+=2*a;this.height+=2*a;return this};mxRectangle.prototype.getPoint=function(){return new mxPoint(this.x,this.y)};mxRectangle.prototype.rotate90=function(){var a=(this.width-this.height)/2;this.x+=a;this.y-=a;a=this.width;this.width=this.height;this.height=a};mxRectangle.prototype.equals=function(a){return null!=a&&a.x==this.x&&a.y==this.y&&a.width==this.width&&a.height==this.height};
mxRectangle.fromRectangle=function(a){return new mxRectangle(a.x,a.y,a.width,a.height)};
var mxEffects={animateChanges:function(a,b,c){var d=0,e=function(){for(var g=!1,k=0;k<b.length;k++){var l=b[k];if(l instanceof mxGeometryChange||l instanceof mxTerminalChange||l instanceof mxValueChange||l instanceof mxChildChange||l instanceof mxStyleChange){var m=a.getView().getState(l.cell||l.child,!1);if(null!=m)if(g=!0,l.constructor!=mxGeometryChange||a.model.isEdge(l.cell))mxUtils.setOpacity(m.shape.node,100*d/10);else{var n=a.getView().scale,p=(l.geometry.x-l.previous.x)*n,q=(l.geometry.y-
l.previous.y)*n,r=(l.geometry.width-l.previous.width)*n,n=(l.geometry.height-l.previous.height)*n;0==d?(m.x-=p,m.y-=q,m.width-=r,m.height-=n):(m.x+=p/10,m.y+=q/10,m.width+=r/10,m.height+=n/10);a.cellRenderer.redraw(m);mxEffects.cascadeOpacity(a,l.cell,100*d/10)}}}10>d&&g?(d++,window.setTimeout(e,f)):null!=c&&c()},f=30;e()},cascadeOpacity:function(a,b,c){for(var d=a.model.getChildCount(b),e=0;e<d;e++){var f=a.model.getChildAt(b,e),g=a.getView().getState(f);null!=g&&(mxUtils.setOpacity(g.shape.node,
@ -552,13 +552,13 @@ this.direction==mxConstants.DIRECTION_WEST);if(f){b=Math.min(a.width,b*this.scal
mxSwimlane.prototype.getArcSize=function(a,b,c){if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))return Math.min(a/2,Math.min(b/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));a=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;return c*a*3};mxSwimlane.prototype.isHorizontal=function(){return 1==mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)};
mxSwimlane.prototype.paintVertexShape=function(a,b,c,d,e){var f=this.getTitleSize(),g=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE),k=1==mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_LINE,1),l=0,f=this.isHorizontal()?Math.min(f,e):Math.min(f,d);a.translate(b,c);this.isRounded?(l=this.getArcSize(d,e,f),l=Math.min((this.isHorizontal()?e:d)-f,Math.min(f,l)),this.paintRoundedSwimlane(a,b,c,d,e,f,l,g,k)):this.paintSwimlane(a,b,c,d,e,f,g,k);g=mxUtils.getValue(this.style,
mxConstants.STYLE_SEPARATORCOLOR,mxConstants.NONE);this.paintSeparator(a,b,c,d,e,f,g);null!=this.image&&(e=this.getImageBounds(b,c,d,e),a.image(e.x-b,e.y-c,e.width,e.height,this.image,!1,!1,!1));this.glass&&(a.setShadow(!1),this.paintGlassEffect(a,0,0,d,f,l))};
mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f,g,k){a.begin();this.isHorizontal()?(a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.fillAndStroke(),f<e&&(g==mxConstants.NONE?a.pointerEvents=!1:a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),g==mxConstants.NONE?a.stroke():a.fillAndStroke())):(a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),a.fillAndStroke(),f<d&&(g==mxConstants.NONE?a.pointerEvents=!1:a.setFillColor(g),a.begin(),a.moveTo(f,
0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e),g==mxConstants.NONE?a.stroke():a.fillAndStroke()));k&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)};
mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g,k,l){a.begin();this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),a.fillAndStroke(),f<e&&(k==mxConstants.NONE?a.pointerEvents=!1:a.setFillColor(k),a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),k==mxConstants.NONE?a.stroke():a.fillAndStroke())):(a.moveTo(f,
0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f,e),a.fillAndStroke(),f<d&&(k==mxConstants.NONE?a.pointerEvents=!1:a.setFillColor(k),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),k==mxConstants.NONE?a.stroke():a.fillAndStroke()));l&&this.paintDivider(a,b,c,d,e,f,k==mxConstants.NONE)};
mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){g||a.setShadow(!1);a.begin();this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e));a.stroke()};mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};
mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a}mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};
mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]};
mxSwimlane.prototype.paintSwimlane=function(a,b,c,d,e,f,g,k){a.begin();var l=!0;null!=this.style&&(l="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));l||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1);this.isHorizontal()?(a.moveTo(0,f),a.lineTo(0,0),a.lineTo(d,0),a.lineTo(d,f),a.fillAndStroke(),f<e&&(g!=mxConstants.NONE&&l||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(0,f),a.lineTo(0,e),a.lineTo(d,e),a.lineTo(d,f),g==mxConstants.NONE?
a.stroke():a.fillAndStroke())):(a.moveTo(f,0),a.lineTo(0,0),a.lineTo(0,e),a.lineTo(f,e),a.fillAndStroke(),f<d&&(g!=mxConstants.NONE&&l||(a.pointerEvents=!1),g!=mxConstants.NONE&&a.setFillColor(g),a.begin(),a.moveTo(f,0),a.lineTo(d,0),a.lineTo(d,e),a.lineTo(f,e),g==mxConstants.NONE?a.stroke():a.fillAndStroke()));k&&this.paintDivider(a,b,c,d,e,f,g==mxConstants.NONE)};
mxSwimlane.prototype.paintRoundedSwimlane=function(a,b,c,d,e,f,g,k,l){a.begin();var m=!0;null!=this.style&&(m="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));m||null!=this.fill&&this.fill!=mxConstants.NONE||(a.pointerEvents=!1);this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,g),a.quadTo(d,0,d-Math.min(d/2,g),0),a.lineTo(Math.min(d/2,g),0),a.quadTo(0,0,0,g),a.lineTo(0,f),a.fillAndStroke(),f<e&&(k!=mxConstants.NONE&&m||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),
a.begin(),a.moveTo(0,f),a.lineTo(0,e-g),a.quadTo(0,e,Math.min(d/2,g),e),a.lineTo(d-Math.min(d/2,g),e),a.quadTo(d,e,d,e-g),a.lineTo(d,f),k==mxConstants.NONE?a.stroke():a.fillAndStroke())):(a.moveTo(f,0),a.lineTo(g,0),a.quadTo(0,0,0,Math.min(e/2,g)),a.lineTo(0,e-Math.min(e/2,g)),a.quadTo(0,e,g,e),a.lineTo(f,e),a.fillAndStroke(),f<d&&(k!=mxConstants.NONE&&m||(a.pointerEvents=!1),k!=mxConstants.NONE&&a.setFillColor(k),a.begin(),a.moveTo(f,e),a.lineTo(d-g,e),a.quadTo(d,e,d,e-Math.min(e/2,g)),a.lineTo(d,
Math.min(e/2,g)),a.quadTo(d,0,d-g,0),a.lineTo(f,0),k==mxConstants.NONE?a.stroke():a.fillAndStroke()));l&&this.paintDivider(a,b,c,d,e,f,k==mxConstants.NONE)};mxSwimlane.prototype.paintDivider=function(a,b,c,d,e,f,g){g||a.setShadow(!1);a.begin();this.isHorizontal()?(a.moveTo(0,f),a.lineTo(d,f)):(a.moveTo(f,0),a.lineTo(f,e));a.stroke()};
mxSwimlane.prototype.paintSeparator=function(a,b,c,d,e,f,g){g!=mxConstants.NONE&&(a.setStrokeColor(g),a.setDashed(!0),a.begin(),this.isHorizontal()?(a.moveTo(d,f),a.lineTo(d,e)):(a.moveTo(f,0),a.lineTo(d,0)),a.stroke(),a.setDashed(!1))};mxSwimlane.prototype.getImageBounds=function(a,b,c,d){return this.isHorizontal()?new mxRectangle(a+c-this.imageSize,b,this.imageSize,this.imageSize):new mxRectangle(a,b,this.imageSize,this.imageSize)};function mxGraphLayout(a){this.graph=a}
mxGraphLayout.prototype.graph=null;mxGraphLayout.prototype.useBoundingBox=!0;mxGraphLayout.prototype.parent=null;mxGraphLayout.prototype.moveCell=function(a,b,c){};mxGraphLayout.prototype.resizeCell=function(a,b){};mxGraphLayout.prototype.execute=function(a){};mxGraphLayout.prototype.getGraph=function(){return this.graph};mxGraphLayout.prototype.getConstraint=function(a,b,c,d){return this.graph.getCurrentCellStyle(b)[a]};
mxGraphLayout.traverse=function(a,b,c,d,e){if(null!=c&&null!=a&&(b=null!=b?b:!0,e=e||new mxDictionary,!e.get(a)&&(e.put(a,!0),d=c(a,d),null==d||d))&&(d=this.graph.model.getEdgeCount(a),0<d))for(var f=0;f<d;f++){var g=this.graph.model.getEdgeAt(a,f),k=this.graph.model.getTerminal(g,!0)==a;if(!b||k)k=this.graph.view.getVisibleTerminal(g,!k),this.traverse(k,b,c,g,e)}};
mxGraphLayout.prototype.isAncestor=function(a,b,c){if(!c)return this.graph.model.getParent(b)==a;if(b==a)return!1;for(;null!=b&&b!=a;)b=this.graph.model.getParent(b);return b==a};mxGraphLayout.prototype.isVertexMovable=function(a){return this.graph.isCellMovable(a)};mxGraphLayout.prototype.isVertexIgnored=function(a){return!this.graph.getModel().isVertex(a)||!this.graph.isCellVisible(a)};
mxGraphLayout.prototype.isEdgeIgnored=function(a){var b=this.graph.getModel();return!b.isEdge(a)||!this.graph.isCellVisible(a)||null==b.getTerminal(a,!0)||null==b.getTerminal(a,!1)};mxGraphLayout.prototype.setEdgeStyleEnabled=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_NOEDGESTYLE,b?"0":"1",[a])};mxGraphLayout.prototype.setOrthogonalEdge=function(a,b){this.graph.setCellStyles(mxConstants.STYLE_ORTHOGONAL,b?"1":"0",[a])};
@ -1107,9 +1107,9 @@ mxGraph.prototype.setCellWarning=function(a,b,c,d){if(null!=b&&0<b.length)return
mxGraph.prototype.startEditingAtCell=function(a,b){null!=b&&mxEvent.isMultiTouchEvent(b)||(null==a&&(a=this.getSelectionCell(),null==a||this.isCellEditable(a)||(a=null)),null!=a&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",a,"event",b)),this.cellEditor.startEditing(a,b),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",a,"event",b))))};mxGraph.prototype.getEditingValue=function(a,b){return this.convertValueToString(a)};
mxGraph.prototype.stopEditing=function(a){this.cellEditor.stopEditing(a);this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",a))};mxGraph.prototype.labelChanged=function(a,b,c){this.model.beginUpdate();try{var d=a.value;this.cellLabelChanged(a,b,this.isAutoSizeCell(a));this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",a,"value",b,"old",d,"event",c))}finally{this.model.endUpdate()}return a};
mxGraph.prototype.cellLabelChanged=function(a,b,c){this.model.beginUpdate();try{this.model.setValue(a,b),c&&this.cellSizeUpdated(a,!1)}finally{this.model.endUpdate()}};mxGraph.prototype.escape=function(a){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",a))};
mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed())if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(a){a=this.isCellSelected(a.cell);e=e||a;return!e||a}));null!=a&&(c=a)}this.selectCellForEvent(c,b)}else if(c=null,this.isSwimlaneSelectionEnabled()&&
(c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY())),null!=c){for(var f=c,d=[];null!=f;){var f=this.model.getParent(f),g=this.view.getState(f);this.isSwimlane(f)&&null!=g&&this.intersects(g,a.getGraphX(),a.getGraphY())&&d.push(f)}if(0<d.length)for(d=d.reverse(),d.splice(0,0,c),d.push(c),a=0;a<d.length-2;a++)this.isCellSelected(d[a])&&(c=d[a+1]);this.selectCellForEvent(c,b)}else this.isToggleEvent(b)||this.clearSelection()};
mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))};
mxGraph.prototype.click=function(a){var b=a.getEvent(),c=a.getCell(),d=new mxEventObject(mxEvent.CLICK,"event",b,"cell",c);a.isConsumed()&&d.consume();this.fireEvent(d);if(this.isEnabled()&&!mxEvent.isConsumed(b)&&!d.isConsumed()){if(null!=c){if(this.isTransparentClickEvent(b)){var e=!1;a=this.getCellAt(a.graphX,a.graphY,null,null,null,mxUtils.bind(this,function(a){var b=this.isCellSelected(a.cell);e=e||b;return!e||b||a.cell!=c&&this.model.isAncestor(a.cell,c)}));null!=a&&(c=a)}}else if(this.isSwimlaneSelectionEnabled()&&
(c=this.getSwimlaneAt(a.getGraphX(),a.getGraphY()),!this.isToggleEvent(b)&&null!=c)){d=c;for(a=[];null!=d;){var d=this.model.getParent(d),f=this.view.getState(d);this.isSwimlane(d)&&null!=f&&a.push(d)}if(0<a.length)for(a=a.reverse(),a.splice(0,0,c),a.push(c),d=0;d<a.length-2;d++)this.isCellSelected(a[d])&&(c=a[d+1])}null!=c?this.selectCellForEvent(c,b):this.isToggleEvent(b)||this.clearSelection()}};
mxGraph.prototype.isSiblingSelected=function(a){for(var b=this.model,c=b.getParent(a),d=b.getChildCount(c),e=0;e<d;e++){var f=b.getChildAt(c,e);if(a!=f&&this.isCellSelected(f))return!0}return!1};mxGraph.prototype.dblClick=function(a,b){var c=new mxEventObject(mxEvent.DOUBLE_CLICK,"event",a,"cell",b);this.fireEvent(c);!this.isEnabled()||mxEvent.isConsumed(a)||c.isConsumed()||null==b||!this.isCellEditable(b)||this.isEditing(b)||(this.startEditingAtCell(b,a),mxEvent.consume(a))};
mxGraph.prototype.tapAndHold=function(a){var b=a.getEvent(),c=new mxEventObject(mxEvent.TAP_AND_HOLD,"event",b,"cell",a.getCell());this.fireEvent(c);c.isConsumed()&&(this.panningHandler.panningTrigger=!1);this.isEnabled()&&!mxEvent.isConsumed(b)&&!c.isConsumed()&&this.connectionHandler.isEnabled()&&(b=this.view.getState(this.connectionHandler.marker.getCell(a)),null!=b&&(this.connectionHandler.marker.currentColor=this.connectionHandler.marker.validColor,this.connectionHandler.marker.markedState=b,
this.connectionHandler.marker.mark(),this.connectionHandler.first=new mxPoint(a.getGraphX(),a.getGraphY()),this.connectionHandler.edgeState=this.connectionHandler.createEdgeState(a),this.connectionHandler.previous=b,this.connectionHandler.fireEvent(new mxEventObject(mxEvent.START,"state",this.connectionHandler.previous))))};
mxGraph.prototype.scrollPointToVisible=function(a,b,c,d){if(this.timerAutoScroll||!this.ignoreScrollbars&&!mxUtils.hasScrollbars(this.container))this.allowAutoPanning&&!this.panningHandler.isActive()&&(null==this.panningManager&&(this.panningManager=this.createPanningManager()),this.panningManager.panTo(a+this.panDx,b+this.panDy));else{var e=this.container;d=null!=d?d:20;if(a>=e.scrollLeft&&b>=e.scrollTop&&a<=e.scrollLeft+e.clientWidth&&b<=e.scrollTop+e.clientHeight){var f=e.scrollLeft+e.clientWidth-
@ -1383,7 +1383,11 @@ function(a){null==this.graph.container||"hidden"==this.graph.container.style.vis
mxGraphHandler.prototype.enabled=!0;mxGraphHandler.prototype.highlightEnabled=!0;mxGraphHandler.prototype.cloneEnabled=!0;mxGraphHandler.prototype.moveEnabled=!0;mxGraphHandler.prototype.guidesEnabled=!1;mxGraphHandler.prototype.handlesVisible=!0;mxGraphHandler.prototype.guide=null;mxGraphHandler.prototype.currentDx=null;mxGraphHandler.prototype.currentDy=null;mxGraphHandler.prototype.updateCursor=!0;mxGraphHandler.prototype.selectEnabled=!0;mxGraphHandler.prototype.removeCellsFromParent=!0;
mxGraphHandler.prototype.removeEmptyParents=!1;mxGraphHandler.prototype.connectOnDrop=!1;mxGraphHandler.prototype.scrollOnMove=!0;mxGraphHandler.prototype.minimumSize=6;mxGraphHandler.prototype.previewColor="black";mxGraphHandler.prototype.htmlPreview=!1;mxGraphHandler.prototype.shape=null;mxGraphHandler.prototype.scaleGrid=!1;mxGraphHandler.prototype.rotationEnabled=!0;mxGraphHandler.prototype.maxLivePreview=0;mxGraphHandler.prototype.allowLivePreview=mxClient.IS_SVG;
mxGraphHandler.prototype.isEnabled=function(){return this.enabled};mxGraphHandler.prototype.setEnabled=function(a){this.enabled=a};mxGraphHandler.prototype.isCloneEnabled=function(){return this.cloneEnabled};mxGraphHandler.prototype.setCloneEnabled=function(a){this.cloneEnabled=a};mxGraphHandler.prototype.isMoveEnabled=function(){return this.moveEnabled};mxGraphHandler.prototype.setMoveEnabled=function(a){this.moveEnabled=a};mxGraphHandler.prototype.isSelectEnabled=function(){return this.selectEnabled};
mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};mxGraphHandler.prototype.getInitialCellForEvent=function(a){return a.getCell()};mxGraphHandler.prototype.isDelayedSelection=function(a,b){return this.graph.isCellSelected(a)};mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.setSelectEnabled=function(a){this.selectEnabled=a};mxGraphHandler.prototype.isRemoveCellsFromParent=function(){return this.removeCellsFromParent};mxGraphHandler.prototype.setRemoveCellsFromParent=function(a){this.removeCellsFromParent=a};
mxGraphHandler.prototype.isPropagateSelectionCell=function(a,b){var c=this.graph.model.getParent(a);if(b){var d=this.graph.getCellGeometry(a);return!this.graph.model.isEdge(a)&&!this.graph.model.isEdge(c)&&!this.graph.isSiblingSelected(a)&&(null==d||d.relative||!this.graph.isSwimlane(c))}return!this.graph.isCellSelected(c)};
mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=a.getState();if(!this.graph.isToggleEvent(a.getEvent())&&null!=b&&!this.graph.isCellSelected(b.cell)){a=this.graph.model;for(var c=this.graph.view.getState(a.getParent(b.cell));null!=c&&!this.graph.isCellSelected(c.cell)&&(a.isVertex(c.cell)||a.isEdge(c.cell))&&this.isPropagateSelectionCell(b.cell,!0);)b=c,c=this.graph.view.getState(this.graph.getModel().getParent(b.cell))}return null!=b?b.cell:null};
mxGraphHandler.prototype.isDelayedSelection=function(a,b){if(!this.graph.isToggleEvent(b.getEvent()))for(;null!=a;){if(this.graph.selectionCellsHandler.isHandled(a))return this.graph.cellEditor.getEditingCell()!=a;a=this.graph.model.getParent(a)}return!1};
mxGraphHandler.prototype.selectDelayed=function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null!=c){if(!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);null!=this.graph.view.getState(d)&&(c.isVertex(d)||c.isEdge(d))&&this.isPropagateSelectionCell(b,!1);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}}};mxGraphHandler.prototype.consumeMouseEvent=function(a,b){b.consume()};
mxGraphHandler.prototype.mouseDown=function(a,b){if(!b.isConsumed()&&this.isEnabled()&&this.graph.isEnabled()&&null!=b.getState()&&!mxEvent.isMultiTouchEvent(b.getEvent())){var c=this.getInitialCellForEvent(b);this.delayedSelection=this.isDelayedSelection(c,b);this.cell=null;this.isSelectEnabled()&&!this.delayedSelection&&this.graph.selectCellForEvent(c,b.getEvent());if(this.isMoveEnabled()){var d=this.graph.model,e=d.getGeometry(c);this.graph.isCellMovable(c)&&(!d.isEdge(c)||1<this.graph.getSelectionCount()||
null!=e.points&&0<e.points.length||null==d.getTerminal(c,!0)||null==d.getTerminal(c,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(b.getEvent())&&this.graph.isCellsCloneable())?this.start(c,b.getX(),b.getY()):this.delayedSelection&&(this.cell=c);this.cellWasClicked=!0;this.consumeMouseEvent(mxEvent.MOUSE_DOWN,b)}}};
mxGraphHandler.prototype.getGuideStates=function(){var a=this.graph.getDefaultParent(),b=this.graph.getModel(),c=mxUtils.bind(this,function(a){return null!=this.graph.view.getState(a)&&b.isVertex(a)&&null!=b.getGeometry(a)&&!b.getGeometry(a).relative});return this.graph.view.getCellStates(b.filterDescendants(c,a))};mxGraphHandler.prototype.getCells=function(a){return!this.delayedSelection&&this.graph.isCellMovable(a)?[a]:this.graph.getMovableCells(this.graph.getSelectionCells())};
@ -1411,7 +1415,6 @@ mxGraphHandler.prototype.resetLivePreview=function(){null!=this.allCells&&(this.
"");b.view.invalidate(b.cell)})),this.graph.view.validate())};mxGraphHandler.prototype.setHandlesVisibleForCells=function(a,b){if(this.handlesVisible!=b){this.handlesVisible=b;for(var c=0;c<a.length;c++){var d=this.graph.selectionCellsHandler.getHandler(a[c]);null!=d&&(d.setHandlesVisible(b),b&&d.redraw())}}};mxGraphHandler.prototype.setHighlightColor=function(a){null!=this.highlight&&this.highlight.setHighlightColor(a)};
mxGraphHandler.prototype.mouseUp=function(a,b){if(!b.isConsumed())if(this.livePreviewUsed&&this.resetLivePreview(),null==this.cell||null==this.first||null==this.shape&&!this.livePreviewUsed||null==this.currentDx||null==this.currentDy)this.isSelectEnabled()&&this.delayedSelection&&null!=this.cell&&this.selectDelayed(b);else{var c=this.graph,d=b.getCell();if(this.connectOnDrop&&null==this.target&&null!=d&&c.getModel().isVertex(d)&&c.isCellConnectable(d)&&c.isEdgeValid(null,this.cell,d))c.connectionHandler.connect(this.cell,
d,b.getEvent());else{var d=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),e=c.getView().scale,f=this.roundLength(this.currentDx/e),e=this.roundLength(this.currentDy/e),g=this.target;c.isSplitEnabled()&&c.isSplitTarget(g,this.cells,b.getEvent())?c.splitEdge(g,this.cells,null,f,e):this.moveCells(this.cells,f,e,d,this.target,b.getEvent())}}this.cellWasClicked&&this.consumeMouseEvent(mxEvent.MOUSE_UP,b);this.reset()};
mxGraphHandler.prototype.selectDelayed=function(a){this.graph.isCellSelected(this.cell)&&this.graph.popupMenuHandler.isPopupTrigger(a)||this.graph.selectCellForEvent(this.cell,a.getEvent())};
mxGraphHandler.prototype.reset=function(){this.livePreviewUsed&&(this.resetLivePreview(),this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!0));this.destroyShapes();this.removeHint();this.delayedSelection=!1;this.livePreviewUsed=this.livePreviewActive=null;this.cellWasClicked=!1;this.cellCount=this.currentDy=this.currentDx=this.suspended=null;this.cloning=!1;this.cell=this.cells=this.first=this.target=this.guides=this.pBounds=this.allCells=null};
mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,b,c){if(this.graph.getModel().isVertex(a)&&(a=this.graph.getView().getState(a),null!=a)){c=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(c),mxEvent.getClientY(c));var d=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);if(0!=d){b=Math.cos(-d);var d=Math.sin(-d),e=new mxPoint(a.getCenterX(),a.getCenterY());c=mxUtils.getRotatedPoint(c,b,d,e)}return!mxUtils.contains(a,c.x,c.y)}return!1};
mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){d&&(a=this.graph.getCloneableCells(a));var g=this.graph.getModel().getParent(this.cell);null==e&&this.isRemoveCellsFromParent()&&this.shouldRemoveCellsFromParent(g,a,f)&&(e=this.graph.getDefaultParent());d=d&&!this.graph.isCellLocked(e||this.graph.getDefaultParent());this.graph.getModel().beginUpdate();try{g=[];if(!d&&null!=e&&this.removeEmptyParents){for(var k=new mxDictionary,l=0;l<a.length;l++)k.put(a[l],!0);for(l=0;l<a.length;l++){var m=
@ -1444,7 +1447,8 @@ mxCellMarker.prototype.getMarkerColor=function(a,b,c){return c?this.validColor:t
mxCellMarker.prototype.intersects=function(a,b){return this.hotspotEnabled?mxUtils.intersectsHotspot(a,b.getGraphX(),b.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE):!0};mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler);this.graph.getModel().removeListener(this.resetHandler);this.highlight.destroy()};
function mxSelectionCellsHandler(a){mxEventSource.call(this);this.graph=a;this.handlers=new mxDictionary;this.graph.addMouseListener(this);this.refreshHandler=mxUtils.bind(this,function(a,c){this.isEnabled()&&this.refresh()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getModel().addListener(mxEvent.CHANGE,this.refreshHandler);this.graph.getView().addListener(mxEvent.SCALE,this.refreshHandler);this.graph.getView().addListener(mxEvent.TRANSLATE,this.refreshHandler);
this.graph.getView().addListener(mxEvent.SCALE_AND_TRANSLATE,this.refreshHandler);this.graph.getView().addListener(mxEvent.DOWN,this.refreshHandler);this.graph.getView().addListener(mxEvent.UP,this.refreshHandler)}mxUtils.extend(mxSelectionCellsHandler,mxEventSource);mxSelectionCellsHandler.prototype.graph=null;mxSelectionCellsHandler.prototype.enabled=!0;mxSelectionCellsHandler.prototype.refreshHandler=null;mxSelectionCellsHandler.prototype.maxHandlers=100;
mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};
mxSelectionCellsHandler.prototype.handlers=null;mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled};mxSelectionCellsHandler.prototype.setEnabled=function(a){this.enabled=a};mxSelectionCellsHandler.prototype.getHandler=function(a){return this.handlers.get(a)};mxSelectionCellsHandler.prototype.isHandled=function(a){return null!=this.getHandler(a)};mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit(function(a,b){b.reset.apply(b)})};
mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()};
mxSelectionCellsHandler.prototype.refresh=function(){var a=this.handlers;this.handlers=new mxDictionary;for(var b=this.getHandledSelectionCells(),c=0;c<b.length;c++){var d=this.graph.view.getState(b[c]);if(null!=d){var e=a.remove(b[c]);null!=e&&(e.state!=d?(e.destroy(),e=null):this.isHandlerActive(e)||(null!=e.refresh&&e.refresh(),e.redraw()));null==e&&(e=this.graph.createHandler(d),this.fireEvent(new mxEventObject(mxEvent.ADD,"state",d)));null!=e&&this.handlers.put(b[c],e)}}a.visit(mxUtils.bind(this,
function(a,b){this.fireEvent(new mxEventObject(mxEvent.REMOVE,"state",b.state));b.destroy()}))};mxSelectionCellsHandler.prototype.isHandlerActive=function(a){return null!=a.index};mxSelectionCellsHandler.prototype.updateHandler=function(a){var b=this.handlers.remove(a.cell);if(null!=b){var c=b.index,d=b.startX,e=b.startY;b.destroy();b=this.graph.createHandler(a);null!=b&&(this.handlers.put(a.cell,b),null!=c&&null!=d&&null!=e&&b.start(d,e,c))}};
mxSelectionCellsHandler.prototype.mouseDown=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(a,b){b.mouseDown.apply(b,c)})}};mxSelectionCellsHandler.prototype.mouseMove=function(a,b){if(this.graph.isEnabled()&&this.isEnabled()){var c=[a,b];this.handlers.visit(function(a,b){b.mouseMove.apply(b,c)})}};

View file

@ -90,7 +90,7 @@
<span data-i18n="configJSONInst">Write draw.io JSON configuration in the editor below then click save. If you need help, please refer to</span> <a href="https://desk.draw.io/support/solutions/articles/16000058316" target="_blank" data-i18n="thisPage">this page</a>.
<br>
<div id="jsonMsg">&nbsp;</div>
<pre class="line-numbers language-json" style="height: 400px"><code contenteditable="true" id="configJSON" class="language-json"></code></pre>
<pre class="line-numbers language-json" style="height: 400px"><code contenteditable="true" id="configJSON" class="language-json" style="height: 100%; width: 100%; display: block"></code></pre>
<div>
<button id="saveConfigBtn" class="aui-button aui-button-primary" data-i18n="save">Save</button>
</div>

View file

@ -2,7 +2,7 @@
"name": "draw.io",
"description": "draw.io add-on for Confluence",
"key": "com.mxgraph.confluence.plugins.diagramly",
"baseUrl": "https://ca14f165.ngrok.io",
"baseUrl": "https://confluence.draw.io",
"enableLicensing": true,
"apiMigrations": {
"gdpr": true

View file

@ -183,7 +183,7 @@
if (resp != null && resp.license != null)
{
var xhr = new XMLHttpRequest();
xhr.open('POST', '/license?licenseDump=' + JSON.stringify(resp), true);
xhr.open('POST', '/license?licenseDump=' + encodeURIComponent(JSON.stringify(resp)), true);
xhr.send(null);
}
}

File diff suppressed because one or more lines are too long

View file

@ -1047,6 +1047,16 @@ App.prototype.fullscreenImage = (!mxClient.IS_SVG) ? IMAGE_PATH + '/fullscreen.p
*/
App.prototype.warnInterval = 300000;
/**
*
*/
App.prototype.compactMode = false;
/**
*
*/
App.prototype.fullscreenMode = false;
/**
* Overriden UI settings depending on mode.
*/
@ -5899,7 +5909,6 @@ App.prototype.updateHeader = function()
}
var initialPosition = this.hsplitPosition;
var collapsed = false;
if (uiTheme == 'dark')
{
@ -5908,14 +5917,21 @@ App.prototype.updateHeader = function()
mxEvent.addListener(this.fullscreenElement, 'click', mxUtils.bind(this, function(evt)
{
var visible = this.fullscreenMode;
if (uiTheme != 'atlas' && urlParams['embed'] != '1')
{
this.toggleCompactMode(!collapsed);
this.toggleCompactMode(visible);
}
this.toggleFormatPanel(!collapsed);
this.hsplitPosition = (!collapsed) ? 0 : initialPosition;
collapsed = !collapsed;
if (!visible)
{
initialPosition = this.hsplitPosition;
}
this.hsplitPosition = (visible) ? initialPosition : 0;
this.toggleFormatPanel(visible);
this.fullscreenMode = !visible;
mxEvent.consume(evt);
}));
@ -5981,9 +5997,11 @@ App.prototype.updateHeader = function()
/**
* Adds the listener for automatically saving the diagram for local changes.
*/
App.prototype.toggleCompactMode = function(forceHide)
App.prototype.toggleCompactMode = function(visible)
{
if (!forceHide && this.appIcon.style.display == 'none')
visible = (visible != null) ? visible : this.compactMode;
if (visible)
{
this.menubar.container.style.position = 'absolute';
this.menubar.container.style.paddingLeft = '59px';
@ -6015,6 +6033,8 @@ App.prototype.toggleCompactMode = function(forceHide)
this.refresh();
this.toggleElement.style.backgroundImage = 'url(\'' + this.chevronDownImage + '\')';
}
this.compactMode = !visible;
};
/**

View file

@ -5504,8 +5504,7 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
{
if (diagramNode != null)
{
diagramNode = parseGraphModel(mxUtils.parseXml(Graph.decompress(
mxUtils.getTextContent(diagramNode))).documentElement);
diagramNode = parseGraphModel(Editor.parseDiagramNode(diagramNode));
}
return diagramNode;
@ -6010,14 +6009,15 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
graph.fit(8);
graph.center();
}
return dataNode;
};
function parseDiagram(diagramNode)
{
if (diagramNode != null)
{
diagramNode = parseGraphModel(mxUtils.parseXml(Graph.decompress(
mxUtils.getTextContent(diagramNode))).documentElement);
diagramNode = parseGraphModel(Editor.parseDiagramNode(diagramNode));
}
return diagramNode;

View file

@ -298,7 +298,8 @@
{
var fillColor = mxUtils.getValue(state.style, mxConstants.STYLE_FILLCOLOR, null);
return fillColor == null || fillColor == mxConstants.NONE;
return format.editorUi.editor.graph.isSwimlane(state.vertices[0]) ||
fillColor == null || fillColor == mxConstants.NONE;
}},
{name: 'moveCells', dispName: 'Move Cells on Fold', type: 'bool', defVal: false, isVisible: function(state, format)
{
@ -3941,10 +3942,61 @@
var stylenames = ['plain-gray', 'plain-blue', 'plain-green', 'plain-turquoise',
'plain-orange', 'plain-yellow', 'plain-red', 'plain-pink', 'plain-purple', 'gray',
'blue', 'green', 'turquoise', 'orange', 'yellow', 'red', 'pink', 'purple'];
function updateScheme(colorsets)
// Maximum palettes to switch the switcher
var maxEntries = 10;
// Selector
var switcher = document.createElement('div');
switcher.style.whiteSpace = 'nowrap';
switcher.style.position = 'relative';
switcher.style.textAlign = 'center';
var dots = [];
for (var i = 0; i < this.defaultColorSchemes.length; i++)
{
function addButton(colorset)
var dot = document.createElement('div');
dot.style.display = 'inline-block';
dot.style.width = '6px';
dot.style.height = '6px';
dot.style.marginLeft = '4px';
dot.style.marginRight = '3px';
dot.style.borderRadius = '3px';
dot.style.cursor = 'pointer';
dot.style.background = 'transparent';
dot.style.border = '1px solid #b5b6b7';
(mxUtils.bind(this, function(index)
{
mxEvent.addListener(dot, 'click', mxUtils.bind(this, function()
{
setScheme(index);
}));
}))(i);
mxEvent.add
dots.push(dot);
switcher.appendChild(dot);
}
var setScheme = mxUtils.bind(this, function(index)
{
if (this.editorUi.currentScheme != null)
{
dots[this.editorUi.currentScheme].style.background = 'transparent';
}
this.editorUi.currentScheme = index;
updateScheme(this.defaultColorSchemes[this.editorUi.currentScheme]);
dots[this.editorUi.currentScheme].style.background = '#84d7ff';
});
var updateScheme = mxUtils.bind(this, function(colorsets)
{
var addButton = mxUtils.bind(this, function(colorset)
{
var btn = mxUtils.button('', function(evt)
{
@ -4022,7 +4074,7 @@
btn.className = 'geStyleButton';
btn.style.width = '36px';
btn.style.height = '30px';
btn.style.height = (this.defaultColorSchemes.length <= maxEntries) ? '24px' : '30px';
btn.style.margin = '0px 6px 6px 0px';
if (colorset != null)
@ -4081,7 +4133,7 @@
}
picker.appendChild(btn);
};
});
picker.innerHTML = '';
@ -4094,25 +4146,30 @@
addButton(colorsets[i]);
}
};
});
if (this.editorUi.currentScheme == null)
{
this.editorUi.currentScheme = 0;
setScheme((uiTheme == 'dark') ? 1 : 0);
}
else
{
setScheme(this.editorUi.currentScheme);
}
var bottom = (this.defaultColorSchemes.length <= maxEntries) ? 28 : 8;
var left = document.createElement('div');
left.style.cssText = 'position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;' +
left.style.cssText = 'position:absolute;left:10px;top:8px;bottom:' + bottom + 'px;width:20px;margin:4px;opacity:0.5;' +
'background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);';
mxEvent.addListener(left, 'click', mxUtils.bind(this, function()
{
this.editorUi.currentScheme = mxUtils.mod(this.editorUi.currentScheme - 1, this.defaultColorSchemes.length);
updateScheme(this.defaultColorSchemes[this.editorUi.currentScheme]);
setScheme(mxUtils.mod(this.editorUi.currentScheme - 1, this.defaultColorSchemes.length));
}));
var right = document.createElement('div');
right.style.cssText = 'position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;' +
right.style.cssText = 'position:absolute;left:202px;top:8px;bottom:' + bottom + 'px;width:20px;margin:4px;opacity:0.5;' +
'background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);';
if (this.defaultColorSchemes.length > 1)
@ -4123,8 +4180,7 @@
mxEvent.addListener(right, 'click', mxUtils.bind(this, function()
{
this.editorUi.currentScheme = mxUtils.mod(this.editorUi.currentScheme + 1, this.defaultColorSchemes.length);
updateScheme(this.defaultColorSchemes[this.editorUi.currentScheme]);
setScheme(mxUtils.mod(this.editorUi.currentScheme + 1, this.defaultColorSchemes.length));
}));
// Hover state
@ -4145,6 +4201,11 @@
updateScheme(this.defaultColorSchemes[this.editorUi.currentScheme]);
if (this.defaultColorSchemes.length <= maxEntries)
{
div.appendChild(switcher);
}
return div;
};

View file

@ -10776,21 +10776,25 @@
var tmp = extractDiagramXml(data.xml);
this.spinner.stop();
var dlg = new DraftDialog(this, mxResources.get('draftFound', [data.name || this.defaultFilename]),
var dlg = new DraftDialog(this, mxResources.get('draftFound',
[data.name || this.defaultFilename]),
tmp, mxUtils.bind(this, function()
{
this.hideDialog();
parent.postMessage(JSON.stringify({event: 'draft', result: 'edit', message: data}), '*');
parent.postMessage(JSON.stringify({event: 'draft',
result: 'edit', message: data}), '*');
}), mxUtils.bind(this, function()
{
this.hideDialog();
parent.postMessage(JSON.stringify({event: 'draft', result: 'discard', message: data}), '*');
parent.postMessage(JSON.stringify({event: 'draft',
result: 'discard', message: data}), '*');
}), (data.editKey) ? mxResources.get(data.editKey) : null,
(data.discardKey) ? mxResources.get(data.discardKey) : null,
(data.ignore) ? mxUtils.bind(this, function()
{
this.hideDialog();
parent.postMessage(JSON.stringify({event: 'draft', result: 'ignore', message: data}), '*');
parent.postMessage(JSON.stringify({event: 'draft',
result: 'ignore', message: data}), '*');
}) : null);
this.showDialog(dlg.container, 640, 480, true, false, mxUtils.bind(this, function(cancel)
{
@ -10806,7 +10810,8 @@
}
catch (e)
{
parent.postMessage(JSON.stringify({event: 'draft', error: e.toString(), message: data}), '*');
parent.postMessage(JSON.stringify({event: 'draft',
error: e.toString(), message: data}), '*');
}
return;
@ -10819,7 +10824,8 @@
var enableSearchDocs = data.enableSearch == 1;
var enableCustomTemp = data.enableCustomTemp == 1;
var dlg = new NewDialog(this, false, data.callback != null, mxUtils.bind(this, function(xml, name)
var dlg = new NewDialog(this, false, data.callback != null,
mxUtils.bind(this, function(xml, name)
{
xml = xml || this.emptyDiagramXml;
@ -10827,7 +10833,8 @@
if (data.callback != null)
{
parent.postMessage(JSON.stringify({event: 'template', xml: xml,
blank: xml == this.emptyDiagramXml, name: name}), '*');
blank: xml == this.emptyDiagramXml, name: name,
message: data}), '*');
}
else
{
@ -10881,9 +10888,10 @@
}
else if (data.action == 'textContent')
{
//TODO Remove this message and use remove invokation instead
//TODO Remove this message and use remote invokation instead
var allPagesTxt = this.getDiagramTextContent();
parent.postMessage(JSON.stringify({event: 'textContent', data: allPagesTxt, message: data}), '*');
parent.postMessage(JSON.stringify({event: 'textContent',
data: allPagesTxt, message: data}), '*');
return;
}
else if (data.action == 'status')
@ -11071,6 +11079,9 @@
var msg = this.createLoadMessage('export');
// Attaches incoming message
msg.message = data;
// Forces new HTML format if pages exists
if (data.format == 'html2' || (data.format == 'html' && (urlParams['pages'] != '0' ||
(this.pages != null && this.pages.length > 1))))
@ -11168,6 +11179,16 @@
urlParams['saveAndExit'] = data.saveAndExit;
}
if (data.noSaveBtn != null && urlParams['noSaveBtn'] == null)
{
urlParams['noSaveBtn'] = data.noSaveBtn;
}
if (data.noExitBtn != null && urlParams['noExitBtn'] == null)
{
urlParams['noExitBtn'] = data.noExitBtn;
}
if (data.title != null && this.buttonContainer != null)
{
var tmp = document.createElement('span');
@ -11408,19 +11429,22 @@
}
}
button = document.createElement('a');
mxUtils.write(button, mxResources.get('exit'));
button.setAttribute('title', mxResources.get('exit'));
button.className = 'geBigButton geBigStandardButton';
button.style.marginLeft = '6px';
button.style.marginRight = '20px';
mxEvent.addListener(button, 'click', mxUtils.bind(this, function()
if (urlParams['noExitBtn'] != '1')
{
this.actions.get('exit').funct();
}));
div.appendChild(button);
button = document.createElement('a');
mxUtils.write(button, mxResources.get('exit'));
button.setAttribute('title', mxResources.get('exit'));
button.className = 'geBigButton geBigStandardButton';
button.style.marginLeft = '6px';
button.style.marginRight = '20px';
mxEvent.addListener(button, 'click', mxUtils.bind(this, function()
{
this.actions.get('exit').funct();
}));
div.appendChild(button);
}
this.toolbar.container.appendChild(div);
this.toolbar.staticElements.push(div);

View file

@ -576,12 +576,12 @@ EditorUi.initMinimalTheme = function()
};
// Overridden to toggle window instead
EditorUi.prototype.toggleFormatPanel = function(forceHide)
EditorUi.prototype.toggleFormatPanel = function(visible)
{
if (this.formatWindow != null)
{
this.formatWindow.window.setVisible((forceHide) ?
false : !this.formatWindow.window.isVisible());
this.formatWindow.window.setVisible((visible != null) ?
visible : !this.formatWindow.window.isVisible());
}
else
{

View file

@ -2683,115 +2683,67 @@ FilenameDialog.createFileTypes = function(editorUi, nameInput, types)
return result;
};
// Selects ancestors before descendants
var graphHandlerGetInitialCellForEvent = mxGraphHandler.prototype.getInitialCellForEvent;
mxGraphHandler.prototype.getInitialCellForEvent = function(me)
{
var cell = graphHandlerGetInitialCellForEvent.apply(this, arguments);
var model = this.graph.getModel();
var psel = model.getParent(this.graph.getSelectionCell());
var parent = model.getParent(cell);
if (psel == null || (psel != cell && psel != parent))
{
while (!this.graph.isCellSelected(cell) &&
!this.graph.isCellSelected(parent) &&
(!this.graph.isContainer(parent) ||
this.graph.isPart(cell)) &&
model.isVertex(parent))
{
cell = parent;
parent = this.graph.getModel().getParent(cell);
}
}
return cell;
};
// Selection is delayed to mouseup if ancestor is selected
var graphHandlerIsDelayedSelection = mxGraphHandler.prototype.isDelayedSelection;
mxGraphHandler.prototype.isDelayedSelection = function(cell, me)
/**
* Selects tables before cells and rows.
*/
var mxGraphHandlerIsPropagateSelectionCell = mxGraphHandler.prototype.isPropagateSelectionCell;
mxGraphHandler.prototype.isPropagateSelectionCell = function(cell, immediate)
{
if (this.graph.cellEditor.getEditingCell() == cell)
var result = false;
var parent = this.graph.model.getParent(cell)
if (immediate)
{
return false;
var geo = this.graph.getCellGeometry(cell);
return !this.graph.model.isEdge(cell) &&
!this.graph.model.isEdge(parent) &&
!this.graph.isSiblingSelected(cell) &&
(geo == null || geo.relative ||
!this.graph.isContainer(parent) ||
this.graph.isPart(cell));
}
else
{
var result = graphHandlerIsDelayedSelection.apply(this, arguments);
result = mxGraphHandlerIsPropagateSelectionCell.apply(this, arguments);
if (!result)
if (this.graph.isTableCell(cell) || this.graph.isTableRow(cell))
{
var model = this.graph.getModel();
var parent = model.getParent(cell);
var table = parent;
while (parent != null)
if (!this.graph.isTable(table))
{
// Inconsistency for unselected parent swimlane is intended for easier moving
// of stack layouts where the container title section is too far away
if (this.graph.isCellSelected(parent) && model.isVertex(parent))
{
result = true;
break;
}
parent = model.getParent(parent);
}
}
return result;
}
};
// Delayed selection of parent group
mxGraphHandler.prototype.selectDelayed = function(me)
{
if (!this.graph.popupMenuHandler.isPopupTrigger(me))
{
var cell = me.getCell();
if (cell == null)
{
cell = this.cell;
}
// Selects folded cell for hit on folding icon
var state = this.graph.view.getState(cell)
if (state != null && me.isSource(state.control))
{
this.graph.selectCellForEvent(cell, me.getEvent());
}
else
{
if (!this.graph.isToggleEvent(me.getEvent()))
{
var model = this.graph.getModel();
var parent = model.getParent(cell);
while (!this.graph.isCellSelected(parent) && model.isVertex(parent))
{
cell = parent;
parent = model.getParent(cell);
}
table = this.graph.model.getParent(table);
}
this.graph.selectCellForEvent(cell, me.getEvent());
result = !this.graph.selectionCellsHandler.isHandled(table) ||
this.graph.isCellSelected(cell) || (this.graph.isTableCell(cell) &&
this.graph.isCellSelected(parent));
}
}
return result;
};
// Returns last selected ancestor
/**
* Returns last selected ancestor
*/
mxPopupMenuHandler.prototype.getCellForPopupEvent = function(me)
{
var cell = me.getCell();
var model = this.graph.getModel();
var parent = model.getParent(cell);
var state = this.graph.view.getState(parent);
var selected = this.graph.isCellSelected(cell);
while (model.isVertex(parent) && !this.graph.isContainer(parent))
while (state != null && (model.isVertex(parent) || model.isEdge(parent)))
{
if (this.graph.isCellSelected(parent))
var temp = this.graph.isCellSelected(parent);
selected = selected || temp;
if (temp || (!selected && (this.graph.isTableCell(cell) ||
this.graph.isTableRow(cell))))
{
cell = parent;
}

View file

@ -2452,12 +2452,14 @@ EditorUi.prototype.addChromelessClickHandler = function()
/**
*
*/
EditorUi.prototype.toggleFormatPanel = function(forceHide)
EditorUi.prototype.toggleFormatPanel = function(visible)
{
visible = (visible != null) ? visible : this.formatWidth == 0;
if (this.format != null)
{
this.formatWidth = (forceHide || this.formatWidth > 0) ? 0 : 240;
this.formatContainer.style.display = (forceHide || this.formatWidth > 0) ? '' : 'none';
this.formatWidth = (visible) ? 240 : 0;
this.formatContainer.style.display = (visible) ? '' : 'none';
this.refresh();
this.format.refresh();
this.fireEvent(new mxEventObject('formatWidthChanged'));

View file

@ -1510,10 +1510,10 @@ ArrangePanel.prototype.init = function()
this.container.appendChild(this.addAlign(this.createPanel()));
this.container.appendChild(this.addDistribute(this.createPanel()));
}
else if (ss.vertices.length == 1 && ss.edges.length == 0 &&
(graph.isTable(ss.vertices[0]) ||
if (graph.isTable(ss.vertices[0]) ||
graph.isTableRow(ss.vertices[0]) ||
graph.isTableCell(ss.vertices[0])))
graph.isTableCell(ss.vertices[0]))
{
this.container.appendChild(this.addTable(this.createPanel()));
}

View file

@ -253,6 +253,46 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
}
}
}
else if (this.isTableCell(state.cell))
{
var box = new mxRectangle(me.getGraphX(), me.getGraphY());
box.grow(1);
var table = this.model.getParent(this.model.getParent(state.cell));
if (mxUtils.intersects(box, new mxRectangle(state.x, state.y, 1, state.height)) ||
mxUtils.intersects(box, new mxRectangle(state.x + state.width, state.y, 1, state.height)))
{
this.setSelectionCell(table);
start.point = new mxPoint(me.getGraphX(), me.getGraphY());
start.selected = this.isCellSelected(state.cell);
start.state = this.view.getState(table);
start.event = me;
var handler = this.selectionCellsHandler.getHandler(table);
if (handler != null)
{
start.handle = handler.getHandleForEvent(me);
}
}
else if (mxUtils.intersects(box, new mxRectangle(state.x, state.y, state.width, 1)) ||
mxUtils.intersects(box, new mxRectangle(state.x, state.y + state.height, state.width, 1)))
{
this.setSelectionCell(table);
start.point = new mxPoint(me.getGraphX(), me.getGraphY());
start.selected = this.isCellSelected(state.cell);
start.state = this.view.getState(table);
start.event = me;
var handler = this.selectionCellsHandler.getHandler(table);
if (handler != null)
{
start.handle = handler.getHandleForEvent(me);
}
}
}
}
}
}
@ -400,6 +440,16 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
this.graphHandler.reset();
me.consume();
}
else if (handler != null && this.isTable(state.cell))
{
handler.start(me.getGraphX(), me.getGraphX(), start.handle);
start.state = null;
start.event = null;
start.point = null;
start.handle = null;
start.selected = false;
me.consume();
}
}
}
}
@ -410,17 +460,17 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
if (state != null)
{
var cursor = null;
// Checks if state was removed in call to stopEditing above
if (this.model.isEdge(state.cell))
{
var cursor = null;
var box = new mxRectangle(me.getGraphX(), me.getGraphY());
box.grow(mxEdgeHandler.prototype.handleImage.width / 2);
var pts = state.absolutePoints;
if (pts != null)
{
var box = new mxRectangle(me.getGraphX(), me.getGraphY());
box.grow(mxEdgeHandler.prototype.handleImage.width / 2);
if (state.text != null && state.text.boundingBox != null &&
mxUtils.contains(state.text.boundingBox, me.getGraphX(), me.getGraphY()))
{
@ -449,12 +499,28 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
}
}
}
if (cursor != null)
{
state.setCursor(cursor);
}
}
else if (this.isTableCell(state.cell))
{
var box = new mxRectangle(me.getGraphX(), me.getGraphY());
box.grow(1);
if (mxUtils.intersects(box, new mxRectangle(state.x, state.y, 1, state.height)) ||
mxUtils.intersects(box, new mxRectangle(state.x + state.width, state.y, 1, state.height)))
{
cursor ='col-resize';
}
else if (mxUtils.intersects(box, new mxRectangle(state.x, state.y, state.width, 1)) ||
mxUtils.intersects(box, new mxRectangle(state.x, state.y + state.height, state.width, 1)))
{
cursor ='row-resize';
}
}
if (cursor != null)
{
state.setCursor(cursor);
}
}
}
}
@ -942,10 +1008,13 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
this.graph.setSelectionCell(target || edge);
};
// Shows connection points only if cell not selected
// Shows connection points only if cell not selected and parent table not handled
this.connectionHandler.constraintHandler.isStateIgnored = function(state, source)
{
return source && state.view.graph.isCellSelected(state.cell);
var graph = state.view.graph;
return source && (graph.isCellSelected(state.cell) || (graph.isTableRow(state.cell) &&
graph.selectionCellsHandler.isHandled(graph.model.getParent(state.cell))));
};
// Updates constraint handler if the selection changes
@ -1517,7 +1586,8 @@ Graph.prototype.init = function(container)
*/
Graph.prototype.isPart = function(cell)
{
return mxUtils.getValue(this.getCurrentCellStyle(cell), 'part', '0') == '1';
return mxUtils.getValue(this.getCurrentCellStyle(cell), 'part', '0') == '1' ||
this.isTableCell(cell) || this.isTableRow(cell);
};
/**
@ -3977,6 +4047,13 @@ HoverIcons.prototype.repaint = function()
bds.grow(this.arrowSpacing);
var handler = this.graph.selectionCellsHandler.getHandler(this.currentState.cell);
if (this.graph.isTableRow(this.currentState.cell))
{
handler = this.graph.selectionCellsHandler.getHandler(
this.graph.model.getParent(this.currentState.cell));
}
var rotationBbox = null;
if (handler != null)
@ -4329,13 +4406,12 @@ Graph.prototype.createTable = function(rowCount, colCount, w, h)
h = (h != null) ? h : 30;
return this.createParent(this.createVertex(null, null, '', 0, 0, colCount * w, rowCount * h,
'swimlane;startSize=0;html=1;whiteSpace=wrap;container=0;collapsible=0;containerType=table;fillColor=none;' +
'childLayout=tableLayout;resizeLast=1;resizeParent=0;horizontalStack=0;dropTarget=0;'),
'collapsible=0;html=1;whiteSpace=wrap;container=1;childLayout=tableLayout;'),
this.createParent(this.createVertex(null, null, '', 0, 0, colCount * w, h,
'shape=partialRectangle;html=1;whiteSpace=wrap;container=0;collapsible=0;points=[[0,0.5],[1,0.5]];' +
'fillColor=none;strokeColor=none;portConstraint=eastwest;resizeLast=1;resizeParent=0;part=1;'),
'collapsible=0;dropTarget=0;pointerEvents=0;fillColor=none;strokeColor=none;' +
'points=[[0,0.5],[1,0.5]];portConstraint=eastwest;'),
this.createVertex(null, null, '', 0, 0, w, h,
'shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;part=1;fillColor=none;left=0;top=0;'),
'shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;'),
colCount, w, 0), rowCount, 0, h);
};
@ -4358,10 +4434,10 @@ Graph.prototype.createCrossFunctionalSwimlane = function(rowCount, colCount, w,
table.geometry.height += t;
var row = this.createVertex(null, null, '', 0, t, colCount * w + t, h,
s + 'horizontal=0;points=[[0,0.5],[1,0.5]];part=1;portConstraint=eastwest;' +
s + 'horizontal=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;' +
'resizeLast=1;resizeParent=0;container=0;');
table.insert(this.createParent(row, this.createVertex(null, null, '',
t, 0, w, h, s + 'connectable=0;part=1;'), colCount, w, 0));
t, 0, w, h, s + 'connectable=0;'), colCount, w, 0));
if (rowCount > 1)
{
@ -4369,7 +4445,7 @@ Graph.prototype.createCrossFunctionalSwimlane = function(rowCount, colCount, w,
return this.createParent(table, this.createParent(row,
this.createVertex(null, null, '', t, 0, w, h,
s + 'connectable=0;part=1;startSize=0;'),
s + 'connectable=0;startSize=0;'),
colCount, w, 0), rowCount - 1, 0, h);
}
else
@ -4401,7 +4477,7 @@ Graph.prototype.isTable = function(cell)
{
var style = this.getCellStyle(cell);
return style != null && style['containerType'] == 'table';
return style != null && style['childLayout'] == 'tableLayout';
};
/**
@ -5874,8 +5950,7 @@ if (typeof mxVertexHandler != 'undefined')
// Clears labels on table cells
for (var i = 0; i < cells.length; i++)
{
if (this.isTableCell(cells[i]) ||
this.isTableRow(cells[i]))
if (this.isTableCell(cells[i]))
{
this.labelChanged(cells[i], '');
}
@ -6447,8 +6522,9 @@ if (typeof mxVertexHandler != 'undefined')
for (var i = 0; i < cells.length; i++)
{
if (this.isCellDeletable(cells[i]) && this.isTransparentState(
this.view.getState(cells[i])))
if (this.isCellDeletable(cells[i]) &&
this.isTransparentState(
this.view.getState(cells[i])))
{
cellsToRemove.push(cells[i]);
}
@ -8346,6 +8422,20 @@ if (typeof mxVertexHandler != 'undefined')
var mxCellEditorStartEditing = mxCellEditor.prototype.startEditing;
mxCellEditor.prototype.startEditing = function(cell, trigger)
{
// Redirect editing for tables
if (this.graph.isTable(cell) && !this.graph.isSwimlane(cell) &&
this.graph.model.getChildCount(cell) > 0)
{
cell = this.graph.model.getChildAt(cell, 0);
}
// Redirect editing for table rows
if (this.graph.isTableRow(cell) && !this.graph.isSwimlane(cell) &&
this.graph.model.getChildCount(cell) > 0)
{
cell = this.graph.model.getChildAt(cell, 0);
}
mxCellEditorStartEditing.apply(this, arguments);
// Overrides class in case of HTML content to add
@ -9081,6 +9171,25 @@ if (typeof mxVertexHandler != 'undefined')
(!this.graph.isTable(this.state.cell) ||
this.graph.isCellSelected(this.state.cell)));
};
/**
* Adds selection border inset for table cells and rows.
*/
mxVertexHandler.prototype.getSelectionBorderInset = function()
{
var result = 0;
if (this.graph.isTableRow(this.state.cell))
{
result = 1;
}
else if (this.graph.isTableCell(this.state.cell))
{
result = 2;
}
return result;
};
/**
* Adds custom handles for table cells.
@ -9088,18 +9197,8 @@ if (typeof mxVertexHandler != 'undefined')
var vertexHandlerGetSelectionBorderBounds = mxVertexHandler.prototype.getSelectionBorderBounds;
mxVertexHandler.prototype.getSelectionBorderBounds = function()
{
var bounds = vertexHandlerGetSelectionBorderBounds.apply(this, arguments);
if (this.graph.isTableRow(this.state.cell))
{
bounds.grow(-2);
}
else if (this.graph.isTableCell(this.state.cell))
{
bounds.grow(-3);
}
return bounds;
return vertexHandlerGetSelectionBorderBounds.apply(this, arguments).grow(
-this.getSelectionBorderInset());
};
/**
@ -9232,6 +9331,14 @@ if (typeof mxVertexHandler != 'undefined')
this.moveHandles[i].style.visibility = (visible) ? '' : 'hidden';
}
}
if (this.cornerHandles != null)
{
for (var i = 0; i < this.cornerHandles.length; i++)
{
this.cornerHandles[i].node.style.visibility = (visible) ? '' : 'hidden';
}
}
};
/**
@ -9264,7 +9371,8 @@ if (typeof mxVertexHandler != 'undefined')
}
// Checks if custom handles are overlapping with the shape border
var handlePadding = this.graph.isTable(this.state.cell) || this.graph.cellEditor.getEditingCell() == this.state.cell;
var handlePadding = this.graph.isTable(this.state.cell) ||
this.graph.cellEditor.getEditingCell() == this.state.cell;
if (!handlePadding)
{
@ -9297,6 +9405,12 @@ if (typeof mxVertexHandler != 'undefined')
{
tol /= 2;
// Makes room for row move handle
if (this.graph.isTable(this.state.cell))
{
tol += 7;
}
result.x = this.sizers[0].bounds.width + tol;
result.y = this.sizers[0].bounds.height + tol;
}
@ -10074,13 +10188,14 @@ if (typeof mxVertexHandler != 'undefined')
// Adds handle to move row
var moveHandle = mxUtils.createImage(Editor.rowMoveImage);
moveHandle.style.position = 'absolute';
moveHandle.style.cursor = 'move';
moveHandle.style.cursor = 'pointer';
moveHandle.style.width = '7px';
moveHandle.style.height = '4px';
moveHandle.rowState = rowState;
mxEvent.addGestureListeners(moveHandle, mxUtils.bind(this, function(evt)
{
this.graph.setSelectionCell(rowState.cell);
this.graph.graphHandler.start(this.state.cell,
mxEvent.getClientX(evt), mxEvent.getClientY(evt),
[rowState.cell]);
@ -10097,6 +10212,23 @@ if (typeof mxVertexHandler != 'undefined')
}))(this.graph.view.getState(model.getChildAt(this.state.cell, i)));
}
}
// Draws corner rectangles for single selected table cells and rows
else if (this.graph.getSelectionCount() == 1 &&
(this.graph.isTableCell(this.state.cell) ||
this.graph.isTableRow(this.state.cell)))
{
this.cornerHandles = [];
for (var i = 0; i < 4; i++)
{
var shape = new mxRectangleShape(new mxRectangle(0, 0, 4, 4),
'#ffffff', mxConstants.HANDLE_STROKECOLOR);
shape.dialect = (this.graph.dialect != mxConstants.DIALECT_SVG) ?
mxConstants.DIALECT_VML : mxConstants.DIALECT_SVG;
shape.init(this.graph.view.getOverlayPane());
this.cornerHandles.push(shape);
}
}
var update = mxUtils.bind(this, function()
{
@ -10234,6 +10366,7 @@ if (typeof mxVertexHandler != 'undefined')
mxEdgeHandler.prototype.updateLinkHint = mxVertexHandler.prototype.updateLinkHint;
// Creates special handles
var edgeHandlerInit = mxEdgeHandler.prototype.init;
mxEdgeHandler.prototype.init = function()
{
@ -10294,6 +10427,7 @@ if (typeof mxVertexHandler != 'undefined')
});
};
// Updates special handles
var vertexHandlerRedrawHandles = mxVertexHandler.prototype.redrawHandles;
mxVertexHandler.prototype.redrawHandles = function()
{
@ -10302,12 +10436,33 @@ if (typeof mxVertexHandler != 'undefined')
for (var i = 0; i < this.moveHandles.length; i++)
{
this.moveHandles[i].style.left = (this.moveHandles[i].rowState.x +
this.moveHandles[i].rowState.width + 10) + 'px';
this.moveHandles[i].rowState.width - 3) + 'px';
this.moveHandles[i].style.top = (this.moveHandles[i].rowState.y +
this.moveHandles[i].rowState.height * 3 / 4) + 'px';
this.moveHandles[i].rowState.height / 2 - 2) + 'px';
}
}
if (this.cornerHandles != null)
{
var inset = this.getSelectionBorderInset();
var ch = this.cornerHandles;
var w = ch[0].bounds.width / 2;
var h = ch[0].bounds.height / 2;
ch[0].bounds.x = this.state.x - w + inset;
ch[0].bounds.y = this.state.y - h + inset;
ch[0].redraw();
ch[1].bounds.x = ch[0].bounds.x + this.state.width - 2 * inset;
ch[1].bounds.y = ch[0].bounds.y;
ch[1].redraw();
ch[2].bounds.x = ch[0].bounds.x;
ch[2].bounds.y = this.state.y + this.state.height - 2 * inset;
ch[2].redraw();
ch[3].bounds.x = ch[1].bounds.x;
ch[3].bounds.y = ch[2].bounds.y;
ch[3].redraw();
}
// Shows rotation handle only if one vertex is selected
if (this.rotationShape != null && this.rotationShape.node != null)
{
@ -10344,6 +10499,7 @@ if (typeof mxVertexHandler != 'undefined')
}
};
// Destroys special handles
var vertexHandlerDestroy = mxVertexHandler.prototype.destroy;
mxVertexHandler.prototype.destroy = function()
{
@ -10359,6 +10515,16 @@ if (typeof mxVertexHandler != 'undefined')
this.moveHandles = null;
}
if (this.cornerHandles != null)
{
for (var i = 0; i < this.cornerHandles.length; i++)
{
this.cornerHandles[i].node.parentNode.removeChild(this.cornerHandles[i].node);
}
this.cornerHandles = null;
}
if (this.linkHint != null)
{
this.linkHint.parentNode.removeChild(this.linkHint);

View file

@ -3147,7 +3147,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(max, (pt.x - bounds.x) / (bounds.width * 0.75)));
}, null, true)];
}, false, true)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3175,13 +3175,8 @@
var fixed = (fixedDefaultValue != null) ? mxUtils.getValue(this.state.style, 'fixedSize', '0') != '0' : null;
var size = (fixed) ? (pt.x - bounds.x) : Math.max(0, Math.min(max, (pt.x - bounds.x) / bounds.width));
if (fixed && !mxEvent.isAltDown(me.getEvent()))
{
size = state.view.graph.snap(size);
}
this.state.style['size'] = size;
}, null, redrawEdges)];
}, false, redrawEdges)];
if (allowArcHandle && mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3206,7 +3201,7 @@
{
this.state.style['size'] = Math.round(Math.max(0, Math.min(Math.min(bounds.width, pt.x - bounds.x),
Math.min(bounds.height, pt.y - bounds.y))) / factor);
})];
}, false)];
if (allowArcHandle && mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3472,7 +3467,7 @@
(mxUtils.getValue(this.state.style, mxConstants.STYLE_HORIZONTAL, 1) == 1) ?
Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y))) :
Math.round(Math.max(0, Math.min(bounds.width, pt.x - bounds.x)));
})];
}, false)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED))
{
@ -3525,7 +3520,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(0.5, (pt.x - bounds.x) / bounds.width));
})];
}, false)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3573,7 +3568,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.round(Math.max(0, Math.min(bounds.height, (pt.y - bounds.y) * 4 / 3)));
})];
}, false)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3592,7 +3587,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(1, (bounds.x + bounds.width - pt.x) / bounds.width));
})];
}, false)];
},
'callout': function(state)
{
@ -3608,7 +3603,7 @@
var base = Math.max(0, Math.min(bounds.width, mxUtils.getValue(this.state.style, 'base', CalloutShape.prototype.base)));
this.state.style['size'] = Math.round(Math.max(0, Math.min(bounds.height, bounds.y + bounds.height - pt.y)));
this.state.style['position'] = Math.round(Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width)) * 100) / 100;
}), createHandle(state, ['position2'], function(bounds)
}, false), createHandle(state, ['position2'], function(bounds)
{
var position2 = Math.max(0, Math.min(1, mxUtils.getValue(this.state.style, 'position2', CalloutShape.prototype.position2)));
@ -3616,7 +3611,7 @@
}, function(bounds, pt)
{
this.state.style['position2'] = Math.round(Math.max(0, Math.min(1, (pt.x - bounds.x) / bounds.width)) * 100) / 100;
}), createHandle(state, ['base'], function(bounds)
}, false), createHandle(state, ['base'], function(bounds)
{
var size = Math.max(0, Math.min(bounds.height, mxUtils.getValue(this.state.style, 'size', CalloutShape.prototype.size)));
var position = Math.max(0, Math.min(1, mxUtils.getValue(this.state.style, 'position', CalloutShape.prototype.position)));
@ -3628,7 +3623,7 @@
var position = Math.max(0, Math.min(1, mxUtils.getValue(this.state.style, 'position', CalloutShape.prototype.position)));
this.state.style['base'] = Math.round(Math.max(0, Math.min(bounds.width, pt.x - bounds.x - position * bounds.width)));
})];
}, false)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3649,7 +3644,7 @@
{
this.state.style['dx'] = Math.round(Math.max(0, Math.min(bounds.width, pt.x - bounds.x)));
this.state.style['dy'] = Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y)));
})];
}, false)];
if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
{
@ -3686,7 +3681,7 @@
{
this.state.style['dx'] = Math.round(Math.max(0, Math.min(bounds.width, pt.x - bounds.x)));
this.state.style['dy'] = Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y)));
})];
}, false)];
},
'tee': function(state)
{
@ -3700,7 +3695,7 @@
{
this.state.style['dx'] = Math.round(Math.max(0, Math.min(bounds.width / 2, (pt.x - bounds.x - bounds.width / 2)) * 2));
this.state.style['dy'] = Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y)));
})];
}, false)];
},
'singleArrow': createArrowHandleFunction(1),
'doubleArrow': createArrowHandleFunction(0.5),
@ -3728,7 +3723,7 @@
this.state.style['tabWidth'] = Math.round(tw);
this.state.style['tabHeight'] = Math.round(Math.max(0, Math.min(bounds.height, pt.y - bounds.y)));
})];
}, false)];
},
'document': function(state)
{
@ -3740,7 +3735,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(1, (bounds.y + bounds.height - pt.y) / bounds.height));
})];
}, false)];
},
'tape': function(state)
{
@ -3752,7 +3747,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(1, ((pt.y - bounds.y) / bounds.height) * 2));
})];
}, false)];
},
'offPageConnector': function(state)
{
@ -3764,7 +3759,7 @@
}, function(bounds, pt)
{
this.state.style['size'] = Math.max(0, Math.min(1, (bounds.y + bounds.height - pt.y) / bounds.height));
})];
}, false)];
},
'step': createDisplayHandleFunction(StepShape.prototype.size, true, null, true, StepShape.prototype.fixedSize),
'hexagon': createDisplayHandleFunction(HexagonShape.prototype.size, true, 0.5, true),

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,7 @@ if (workbox)
workbox.precaching.precacheAndRoute([
{
"url": "js/app.min.js",
"revision": "a32ef17f69e1f38d2c7f3235cd2e2dbc"
"revision": "c4d44518a5a7965e2f40e649f395e629"
},
{
"url": "js/extensions.min.js",