13.0.7 release

This commit is contained in:
David Benson [draw.io] 2020-05-05 01:17:55 +01:00
parent 5edbf1dbdb
commit ff0b4e7ae8
13 changed files with 1870 additions and 1763 deletions

View file

@ -1,3 +1,7 @@
05-MAY-2020: 13.0.7
- Uses mxGraph 4.1.2 beta 6
03-MAY-2020: 13.0.6
- Disables deltas for OneDrive real time

View file

@ -1 +1 @@
13.0.6
13.0.7

View file

@ -38,6 +38,12 @@ async function handleRequest(request)
let url = "https://log.diagrams.net/" + msg;
fetch(url);
}
else if (domain != null)
{
let msg = encodeURIComponent(('license:atlas-cloud:' + domain));
let url = "https://log.diagrams.net/" + msg;
fetch(url);
}
if (domain != null)
{

View file

@ -722,8 +722,8 @@ y)));this.limitX=Math.max(this.limitX,y);p+=u}null!=f&&(t=r?2:0,u=r?l?this.rankT
q.push(new mxPoint(t,u-x)),q.push(new mxPoint(t,u))):(this.layout.edgeStyle==mxHierarchicalEdgeStyle.CURVE&&q.push(new mxPoint(u-x,t)),q.push(new mxPoint(u,t))));a.isReversed&&this.processReversedEdge(a,n);this.layout.setEdgePoints(n,q);b=0==b?this.parallelEdgeSpacing:0<b?-b:-b+this.parallelEdgeSpacing;e++}a.temp[0]=101207}};
mxCoordinateAssignment.prototype.setVertexLocation=function(a){var b=a.cell,c=a.x[0]-a.width/2,d=a.y[0]-a.height/2;this.rankTopY[a.minRank]=Math.min(this.rankTopY[a.minRank],d);this.rankBottomY[a.minRank]=Math.max(this.rankBottomY[a.minRank],d+a.height);this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(b,c,d):this.layout.setVertexLocation(b,d,c);this.limitX=Math.max(this.limitX,c+a.width)};
mxCoordinateAssignment.prototype.processReversedEdge=function(a,b){};function mxSwimlaneOrdering(a){this.layout=a}mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage;mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering;mxSwimlaneOrdering.prototype.layout=null;
mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots)for(var d=a.roots,c=[],e=0;e<d.length;e++)mxCellPath.create(d[e]),c[e]=a.vertexMapper.get(d[e]);a.visit(function(a,c,d,e,m){e=null!=a&&a.swimlaneIndex==c.swimlaneIndex&&c.isAncestor(a);m=null!=a&&null!=d&&a.swimlaneIndex<c.swimlaneIndex&&d.source==c;e?(d.invert(),mxUtils.remove(d,a.connectsAsSource),c.connectsAsSource.push(d),a.connectsAsTarget.push(d),mxUtils.remove(d,
c.connectsAsTarget)):m&&(d.invert(),mxUtils.remove(d,a.connectsAsTarget),c.connectsAsTarget.push(d),a.connectsAsSource.push(d),mxUtils.remove(d,c.connectsAsSource));a=mxCellPath.create(c.cell);delete b[a]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;
mxSwimlaneOrdering.prototype.execute=function(a){a=this.layout.getModel();var b=mxUtils.clone(a.vertexMapper,null,!0),c=null;if(null!=a.roots)for(var d=a.roots,c=[],e=0;e<d.length;e++)c[e]=a.vertexMapper.get(d[e]);a.visit(function(a,c,d,e,m){e=null!=a&&a.swimlaneIndex==c.swimlaneIndex&&c.isAncestor(a);m=null!=a&&null!=d&&a.swimlaneIndex<c.swimlaneIndex&&d.source==c;e?(d.invert(),mxUtils.remove(d,a.connectsAsSource),c.connectsAsSource.push(d),a.connectsAsTarget.push(d),mxUtils.remove(d,c.connectsAsTarget)):
m&&(d.invert(),mxUtils.remove(d,a.connectsAsTarget),c.connectsAsTarget.push(d),a.connectsAsSource.push(d),mxUtils.remove(d,c.connectsAsSource));a=mxCellPath.create(c.cell);delete b[a]},c,!0,null)};function mxHierarchicalLayout(a,b,c){mxGraphLayout.call(this,a);this.orientation=null!=b?b:mxConstants.DIRECTION_NORTH;this.deterministic=null!=c?c:!0}var mxHierarchicalEdgeStyle={ORTHOGONAL:1,POLYLINE:2,STRAIGHT:3,CURVE:4};mxHierarchicalLayout.prototype=new mxGraphLayout;
mxHierarchicalLayout.prototype.constructor=mxHierarchicalLayout;mxHierarchicalLayout.prototype.roots=null;mxHierarchicalLayout.prototype.resizeParent=!1;mxHierarchicalLayout.prototype.maintainParentLocation=!1;mxHierarchicalLayout.prototype.moveParent=!1;mxHierarchicalLayout.prototype.parentBorder=0;mxHierarchicalLayout.prototype.intraCellSpacing=30;mxHierarchicalLayout.prototype.interRankCellSpacing=100;mxHierarchicalLayout.prototype.interHierarchySpacing=60;
mxHierarchicalLayout.prototype.parallelEdgeSpacing=10;mxHierarchicalLayout.prototype.orientation=mxConstants.DIRECTION_NORTH;mxHierarchicalLayout.prototype.fineTuning=!0;mxHierarchicalLayout.prototype.tightenToSource=!0;mxHierarchicalLayout.prototype.disableEdgeStyle=!0;mxHierarchicalLayout.prototype.traverseAncestors=!0;mxHierarchicalLayout.prototype.model=null;mxHierarchicalLayout.prototype.edgesCache=null;mxHierarchicalLayout.prototype.edgeSourceTermCache=null;
mxHierarchicalLayout.prototype.edgesTargetTermCache=null;mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE;mxHierarchicalLayout.prototype.getModel=function(){return this.model};
@ -1394,11 +1394,11 @@ mxGraphHandler.prototype.start=function(a,b,c,d){this.cell=a;this.first=mxUtils.
var e=this.graph.model.getParent(a),f=2>this.graph.model.getChildCount(e),g=new mxDictionary;a=this.graph.getOpposites(this.graph.getEdges(this.cell),this.cell);for(b=0;b<a.length;b++)c=this.graph.view.getState(a[b]),null==c||g.get(c)||g.put(c,!0);this.guide.isStateIgnored=mxUtils.bind(this,function(a){var b=this.graph.model.getParent(a.cell);return null!=a.cell&&(!this.cloning&&this.isCellMoving(a.cell)||a.cell!=(this.target||e)&&!f&&!g.get(a)&&(null==this.target||2<=this.graph.model.getChildCount(this.target))&&
b!=(this.target||e))})}};mxGraphHandler.prototype.addStates=function(a,b){var c=this.graph.view.getState(a),d=0;if(null!=c&&null==b.get(a)){b.put(a,c);d++;for(var c=this.graph.model.getChildCount(a),e=0;e<c;e++)d+=this.addStates(this.graph.model.getChildAt(a,e),b)}return d};mxGraphHandler.prototype.isCellMoving=function(a){return null!=this.allCells.get(a)};
mxGraphHandler.prototype.useGuidesForEvent=function(a){return null!=this.guide?this.guide.isEnabledForEvent(a.getEvent())&&!this.graph.isConstrainedEvent(a.getEvent()):!0};mxGraphHandler.prototype.snap=function(a){var b=this.scaleGrid?this.graph.view.scale:1;a.x=this.graph.snap(a.x/b)*b;a.y=this.graph.snap(a.y/b)*b;return a};
mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a){return this.graph.model.getParent(this.cell)!=a};
mxGraphHandler.prototype.getDelta=function(a){a=mxUtils.convertPoint(this.graph.container,a.getX(),a.getY());return new mxPoint(a.x-this.first.x-this.graph.panDx,a.y-this.first.y-this.graph.panDy)};mxGraphHandler.prototype.updateHint=function(a){};mxGraphHandler.prototype.removeHint=function(){};mxGraphHandler.prototype.roundLength=function(a){return Math.round(100*a)/100};mxGraphHandler.prototype.isValidDropTarget=function(a,b){return this.graph.model.getParent(this.cell)!=a};
mxGraphHandler.prototype.checkPreview=function(){this.livePreviewActive&&this.cloning?(this.resetLivePreview(),this.livePreviewActive=!1):this.maxLivePreview>=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&this.livePreviewActive||(this.livePreviewUsed=this.livePreviewActive=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))};
mxGraphHandler.prototype.mouseMove=function(a,b){var c=this.graph;if(b.isConsumed()||!c.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended)!this.isMoveEnabled()&&!this.isCloneEnabled()||!this.updateCursor||b.isConsumed()||null==b.getState()&&null==b.sourceState||c.isMouseDown||(d=c.getCursorForMouseEvent(b),null==d&&c.isEnabled()&&c.isCellMovable(b.getCell())&&(d=c.getModel().isEdge(b.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=
d&&null!=b.sourceState&&b.sourceState.setCursor(d));else if(mxEvent.isMultiTouchEvent(b.getEvent()))this.reset();else{var d=this.getDelta(b),e=c.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(d.x)>e||Math.abs(d.y)>e){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var e=c.isCloneEvent(b.getEvent())&&c.isCellsCloneable()&&this.isCloneEnabled(),f=c.isGridEnabledEvent(b.getEvent()),g=b.getCell(),k=!0,l=null;this.cloning=e;c.isDropEnabled()&&
this.highlightEnabled&&(l=c.getDropTarget(this.cells,b.getEvent(),g,e));var m=c.getView().getState(l),n=!1;null!=m&&(e||this.isValidDropTarget(l))?(this.target!=l&&(this.target=l,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),n=!0):(this.target=null,this.connectOnDrop&&null!=g&&1==this.cells.length&&c.getModel().isVertex(g)&&c.isCellConnectable(g)&&(m=c.getView().getState(g),null!=m&&(g=null==c.getEdgeValidationError(null,this.cell,g)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
this.highlightEnabled&&(l=c.getDropTarget(this.cells,b.getEvent(),g,e));var m=c.getView().getState(l),n=!1;null!=m&&(e||this.isValidDropTarget(l,b))?(this.target!=l&&(this.target=l,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),n=!0):(this.target=null,this.connectOnDrop&&null!=g&&1==this.cells.length&&c.getModel().isVertex(g)&&c.isCellConnectable(g)&&(m=c.getView().getState(g),null!=m&&(g=null==c.getEdgeValidationError(null,this.cell,g)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR,
this.setHighlightColor(g),n=!0)));null!=m&&n?this.highlight.highlight(m):this.highlight.hide();null!=this.guide&&this.useGuidesForEvent(b)?(d=this.guide.move(this.bounds,d,f,e),k=!1):d=this.graph.snapDelta(d,this.bounds,!f,!1,!1);null!=this.guide&&k&&this.guide.hide();c.isConstrainedEvent(b.getEvent())&&(Math.abs(d.x)>Math.abs(d.y)?d.y=0:d.x=0);this.checkPreview();if(this.currentDx!=d.x||this.currentDy!=d.y)this.currentDx=d.x,this.currentDy=d.y,this.updatePreview()}this.updateHint(b);this.consumeMouseEvent(mxEvent.MOUSE_MOVE,
b);mxEvent.consume(b.getEvent())}};mxGraphHandler.prototype.updatePreview=function(a){this.livePreviewUsed&&!a?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()};
mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())};

View file

@ -46,7 +46,7 @@
var script = document.createElement('script');
script.setAttribute('data-options', 'resize:false;margin:false');
if (!licenseValid && license != null && xdm_e != null)
if (license != null && xdm_e != null)
{
if (license == 'none')
{

File diff suppressed because one or more lines are too long

View file

@ -305,7 +305,7 @@ var com;
var filename = zipEntry.name;
var name = filename.toLowerCase();
var nameLen = name.length;
if (name.indexOf('.xml') == nameLen - 4 || name.indexOf('.xml.rels') == nameLen - 9) //xml files
if (name.indexOf('.xml') == nameLen - 4 || name.indexOf('.rels') == nameLen - 5) //xml files
{
filesCount++;
zipEntry.async("string").then(function (str)
@ -8852,10 +8852,72 @@ var com;
}
else {
return o1 === o2;
} })(childName, "ForeignData")) {
} })(childName, "ForeignData"))
{
function getForeignRel(elem, filename)
{
var fdChild = elem.firstChild;
while (fdChild != null)
{
if (fdChild.nodeType == 1)
{
var fdElem = fdChild;
var grandchildName = fdElem.nodeName;
if (grandchildName.toLowerCase() == "rel")
{
var rid = fdElem.getAttribute("r:id");
if (rid != null && !(rid.length === 0))
{
var index = filename.lastIndexOf('/');
var pre = "";
var post = "";
try
{
pre = filename.substring(0, index);
post = filename.substring(index, filename.length);
}
catch (e)
{
return;
}
var relElem = model.getRelationship(rid, pre + "/_rels" + post + ".rels");
if (relElem != null)
{
var target = relElem.getAttribute("Target") || "";
var type = relElem.getAttribute("Type");
index = target.lastIndexOf('/');
try
{
target = target.substring(index + 1, target.length);
}
catch (e)
{
return;
}
return {type: type, target: target};
}
return;
}
}
}
fdChild = fdChild.nextSibling;
}
}
var filename = elem.ownerDocument.vsdxFileName; //was getDocumentURI()
var iType = elem.getAttribute("ForeignType");
var compression = elem.getAttribute("CompressionType") || "";
var typeTarget = null;
if ((function (o1, o2) { if (o1 && o1.equals) {
return o1.equals(o2);
}
@ -8885,70 +8947,66 @@ var com;
} })(iType, "EnhMetaFile")) {
compression = "png"; //we convert emf files to png
}
else if (iType == "Object") //This is a very basic support for embedded visio objects by looking for associated image
{
typeTarget = getForeignRel(elem, filename);
if (typeTarget.type.indexOf('/oleObject') > 0)
{
var relElem = model.getRelationship("rId1", "visio/embeddings/_rels/" + typeTarget.target + ".rels");
if (relElem != null)
{
var target = relElem.getAttribute("Target");
var type = relElem.getAttribute("Type");
try
{
var index = target.lastIndexOf('/');
target = target.substring(index + 1, target.length);
}
catch (e)
{
return;
}
compression = "png";
typeTarget = {type: type, target: target};
}
else
{
return;
}
}
}
else {
return;
}
var fdChild = elem.firstChild;
if (fdChild != null) {
if (fdChild != null && (fdChild.nodeType == 1)) {
var fdElem = fdChild;
var grandchildName = fdElem.nodeName;
if ((function (o1, o2) { if (o1 && o1.equals) {
return o1.equals(o2);
}
else {
return o1 === o2;
} })(grandchildName.toLowerCase(), "rel")) {
var rid = fdElem.getAttribute("r:id");
if (rid != null && !(rid.length === 0)) {
var index = filename.lastIndexOf('/');
var pre = "";
var post = "";
try {
pre = filename.substring(0, index);
post = filename.substring(index, filename.length);
}
catch (e) {
return;
}
;
var relElem = model.getRelationship(rid, pre + "/_rels" + post + ".rels");
if (relElem != null) {
var target = relElem.getAttribute("Target") || "";
var type = relElem.getAttribute("Type");
index = target.lastIndexOf('/');
try {
target = target.substring(index + 1, target.length);
}
catch (e) {
return;
}
;
if (type != null && (function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(type, "image")) {
this.imageData = ({});
var iData = model.getMedia(com.mxgraph.io.mxVsdxCodec.vsdxPlaceholder + "/media/" + target);
if (!iData)
{
/* put */ (this.imageData["iData"] = Shape.ERROR_IMAGE);
/* put */ (this.imageData["iType"] = 'svg+xml');
}
else
{
/* put */ (this.imageData["iData"] = iData);
if ((function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(target.toLowerCase(), ".bmp")) {
compression = "jpg";
}
/* put */ (this.imageData["iType"] = compression);
}
}
}
else {
}
return;
}
}
if (typeTarget == null)
{
typeTarget = getForeignRel(elem, filename);
}
var type = typeTarget.type, target = typeTarget.target;
if (type != null && (function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(type, "image"))
{
this.imageData = ({});
var iData = model.getMedia(com.mxgraph.io.mxVsdxCodec.vsdxPlaceholder + "/media/" + target);
if (!iData)
{
/* put */ (this.imageData["iData"] = Shape.ERROR_IMAGE);
/* put */ (this.imageData["iType"] = 'svg+xml');
}
else
{
/* put */ (this.imageData["iData"] = iData);
if ((function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(target.toLowerCase(), ".bmp")) {
compression = "jpg";
}
/* put */ (this.imageData["iType"] = compression);
}
fdChild = fdChild.nextSibling;
}
}
else if ((function (o1, o2) { if (o1 && o1.equals) {

File diff suppressed because one or more lines are too long

View file

@ -103,10 +103,16 @@ Editor.useLocalStorage = typeof(Storage) != 'undefined' && mxClient.IS_IOS;
Editor.moveImage = (mxClient.IS_SVG) ? 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjI4cHgiIGhlaWdodD0iMjhweCI+PGc+PC9nPjxnPjxnPjxnPjxwYXRoIHRyYW5zZm9ybT0idHJhbnNsYXRlKDIuNCwyLjQpc2NhbGUoMC44KXJvdGF0ZSg0NSwxMiwxMikiIHN0cm9rZT0iIzI5YjZmMiIgZmlsbD0iIzI5YjZmMiIgZD0iTTE1LDNsMi4zLDIuM2wtMi44OSwyLjg3bDEuNDIsMS40MkwxOC43LDYuN0wyMSw5VjNIMTV6IE0zLDlsMi4zLTIuM2wyLjg3LDIuODlsMS40Mi0xLjQyTDYuNyw1LjNMOSwzSDNWOXogTTksMjEgbC0yLjMtMi4zbDIuODktMi44N2wtMS40Mi0xLjQyTDUuMywxNy4zTDMsMTV2Nkg5eiBNMjEsMTVsLTIuMywyLjNsLTIuODctMi44OWwtMS40MiwxLjQybDIuODksMi44N0wxNSwyMWg2VjE1eiIvPjwvZz48L2c+PC9nPjwvc3ZnPgo=' :
IMAGE_PATH + '/move.png';
/**
*
*/
Editor.rowMoveImage = (mxClient.IS_SVG) ? 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=' :
IMAGE_PATH + '/thumb_horz.png';
/**
* Images below are for lightbox and embedding toolbars.
*/
Editor.helpImage = (mxClient.IS_SVG) ? 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTExIDE4aDJ2LTJoLTJ2MnptMS0xNkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTAtMTRjLTIuMjEgMC00IDEuNzktNCA0aDJjMC0xLjEuOS0yIDItMnMyIC45IDIgMmMwIDItMyAxLjc1LTMgNWgyYzAtMi4yNSAzLTIuNSAzLTUgMC0yLjIxLTEuNzktNC00LTR6Ii8+PC9zdmc+' :
Editor.helpImage = (mxClient.IS_SVG) ? 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAEBAMAAACw6DhOAAAAGFBMVEUzMzP///9tbW1QUFCKiopBQUF8fHxfX1/IXlmXAAAAFElEQVQImWNgNVdzYBAUFBRggLMAEzYBy29kEPgAAAAASUVORK5CYII=' :
IMAGE_PATH + '/help.png';
/**
@ -2707,28 +2713,35 @@ FilenameDialog.createFileTypes = function(editorUi, nameInput, types)
var graphHandlerIsDelayedSelection = mxGraphHandler.prototype.isDelayedSelection;
mxGraphHandler.prototype.isDelayedSelection = function(cell, me)
{
var result = graphHandlerIsDelayedSelection.apply(this, arguments);
if (!result)
if (this.graph.cellEditor.getEditingCell() == cell)
{
var model = this.graph.getModel();
var parent = model.getParent(cell);
while (parent != null)
{
// 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 false;
}
else
{
var result = graphHandlerIsDelayedSelection.apply(this, arguments);
if (!result)
{
var model = this.graph.getModel();
var parent = model.getParent(cell);
while (parent != null)
{
// 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;
}
return result;
};
// Delayed selection of parent group

View file

@ -151,6 +151,22 @@ EditorUi = function(editor, container, lightbox)
// Creates hover icons
this.hoverIcons = this.createHoverIcons();
// Hides hover icons when cells are moved
if (graph.graphHandler != null)
{
var graphHandlerStart = graph.graphHandler.start;
graph.graphHandler.start = function()
{
if (ui.hoverIcons != null)
{
ui.hoverIcons.reset();
}
graphHandlerStart.apply(this, arguments);
};
}
// Adds tooltip when mouse is over scrollbars to show space-drag panning option
mxEvent.addListener(this.diagramContainer, 'mousemove', mxUtils.bind(this, function(evt)
{

View file

@ -594,7 +594,9 @@ Graph = function(container, model, renderHint, stylesheet, themes, standalone)
for (var i = 0; i < cells.length; i++)
{
var cell = this.graph.getCompositeParent(cells[i]);
// Moves composite parent with exception of selected table rows
var cell = (!this.graph.isTableRow(cells[i]) || !this.graph.isCellSelected(cells[i])) ?
this.graph.getCompositeParent(cells[i]) : cells[i];
if (cell != null && !lookup.get(cell))
{
@ -4327,13 +4329,13 @@ 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,
'html=1;whiteSpace=wrap;container=0;collapsible=0;containerType=table;fillColor=none;' +
'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;'),
this.createParent(this.createVertex(null, null, '', 0, 0, colCount * w, h,
'html=1;whiteSpace=wrap;container=0;collapsible=0;points=[[0,0.5],[1,0.5]];fillColor=none;' +
'portConstraint=eastwest;resizeLast=1;resizeParent=0;part=1;'),
'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;'),
this.createVertex(null, null, '', 0, 0, w, h,
'html=1;whiteSpace=wrap;connectable=0;part=1;fillColor=none;'),
'shape=partialRectangle;html=1;whiteSpace=wrap;connectable=0;part=1;fillColor=none;left=0;top=0;'),
colCount, w, 0), rowCount, 0, h);
};
@ -4382,7 +4384,7 @@ Graph.prototype.createCrossFunctionalSwimlane = function(rowCount, colCount, w,
*/
Graph.prototype.isTableCell = function(cell)
{
return this.isTableRow(this.model.getParent(cell));
return this.model.isVertex(cell) && this.isTableRow(this.model.getParent(cell));
};
/**
@ -4390,7 +4392,7 @@ Graph.prototype.isTableCell = function(cell)
*/
Graph.prototype.isTableRow = function(cell)
{
return this.isTable(this.model.getParent(cell));
return this.model.isVertex(cell) && this.isTable(this.model.getParent(cell));
};
/**
@ -4513,13 +4515,21 @@ function TableLayout(graph)
/**
* Extends mxGraphLayout.
*/
TableLayout.prototype = new mxGraphLayout();
TableLayout.prototype = new mxStackLayout();
TableLayout.prototype.constructor = TableLayout;
/**
* Table layout is always vertical.
*/
TableLayout.prototype.isHorizontal = function()
{
return false;
};
/**
* Function: getLayout
*
* Implements <mxGraphLayout.execute>.
* Returns the child cells and sum of their widths or heights.
*/
TableLayout.prototype.getLayout = function(parent, vertical)
{
@ -4575,14 +4585,15 @@ TableLayout.prototype.execute = function(parent)
// Updates row geometry
row = row.clone();
row.height = (row.height / sh) * h;
row.width = table.width;
row.x = offset.x;
row.y = y;
row.y = Math.round(y);
row.width = table.width;
var rh = (row.height / sh) * h;
y += rh;
row.height = Math.round(y) - row.y;
model.setGeometry(rows[i], row);
y += row.height;
// Updates cells
var off = this.graph.getActualStartSize(rows[i]);
@ -4598,14 +4609,15 @@ TableLayout.prototype.execute = function(parent)
// Updates cell geometry
cell = cell.clone();
cell.width = (cell.width / sw) * w;
cell.height = row.height;
cell.x = Math.round(x);
cell.y = 0;
cell.x = x;
cell.height = Math.round(rh);
var cw = (cell.width / sw) * w;
x += cw;
cell.width = Math.round(x) - cell.x;
model.setGeometry(cells[j], cell);
x += cell.width;
}
}
}
@ -8830,17 +8842,18 @@ if (typeof mxVertexHandler != 'undefined')
return new mxRectangle(0, 0, (state.text == null) ? 30 : state.text.size * scale + 20, 30);
};
// Hold alt to ignore drop target
var mxGraphHandlerMoveCells = mxGraphHandler.prototype.moveCells;
mxGraphHandler.prototype.moveCells = function(cells, dx, dy, clone, target, evt)
/**
* Function: isValidDropTarget
*
* Returns true if the given cell is a valid drop target.
*/
mxGraphHandlerIsValidDropTarget = mxGraphHandler.prototype.isValidDropTarget;
mxGraphHandler.prototype.isValidDropTarget = function(target, me)
{
if (mxEvent.isAltDown(evt))
{
target = null;
}
mxGraphHandlerMoveCells.apply(this, arguments);
return mxGraphHandlerIsValidDropTarget.apply(this, arguments) &&
!mxEvent.isAltDown(me.getEvent) && (this.cells.length > 1 ||
!this.graph.isTableRow(this.cells[0]) ||
this.graph.isTable(target));
};
/**
@ -8985,21 +8998,6 @@ if (typeof mxVertexHandler != 'undefined')
return shape;
};
/**
* Non resizable shapes have stronger selection shape.
*/
var vertexHandlerGetSelectionStrokeWidth = mxVertexHandler.prototype.getSelectionStrokeWidth;
mxVertexHandler.prototype.getSelectionStrokeWidth = function(bounds)
{
// LATER: Use strokewidth 1 when active
return this.graph.cellEditor.getEditingCell() == this.state.cell ||
(!this.graph.isTable(this.state.cell) ||
!this.graph.isCellSelected(this.state.cell)) &&
!this.graph.isTableRow(this.state.cell) &&
!this.graph.isTableCell(this.state.cell) ?
vertexHandlerGetSelectionStrokeWidth.apply(this, arguments) : 2;
};
/**
* Moves rotation handle to top, right corner.
@ -9095,11 +9093,11 @@ if (typeof mxVertexHandler != 'undefined')
if (this.graph.isTableRow(this.state.cell))
{
bounds.grow(-1);
bounds.grow(-2);
}
else if (this.graph.isTableCell(this.state.cell))
{
bounds.grow(-2);
bounds.grow(-3);
}
return bounds;
@ -9133,6 +9131,7 @@ if (typeof mxVertexHandler != 'undefined')
{
if (rowState != null && model.isVertex(rowState.cell))
{
// Adds handle to change row height
var shape = new mxLine(new mxRectangle(), mxVertexHandler.TABLE_HANDLE_COLOR, 2);
var handle = new mxHandle(rowState, 'row-resize', null, shape);
handle.tableHandle = true;
@ -9147,9 +9146,9 @@ if (typeof mxVertexHandler != 'undefined')
{
this.shape.bounds.x = this.state.x;
this.shape.bounds.width = this.state.width;
this.shape.bounds.y = this.state.y + this.state.height + dy;
this.shape.bounds.y = this.state.y + this.state.height +
dy * this.graph.view.scale;
this.shape.bounds.height = 1;
this.shape.node.style.zOrder = -1;
this.shape.redraw();
}
};
@ -9177,6 +9176,7 @@ if (typeof mxVertexHandler != 'undefined')
{
if (colState != null)
{
// Adds handle to change column width
var shape = new mxLine(new mxRectangle(), mxVertexHandler.TABLE_HANDLE_COLOR, 2, true);
var handle = new mxHandle(colState, 'col-resize', null, shape);
handle.tableHandle = true;
@ -9189,10 +9189,12 @@ if (typeof mxVertexHandler != 'undefined')
{
if (this.shape != null && this.state.shape != null)
{
this.shape.bounds.x = this.state.x + this.state.width + dx;
this.shape.bounds.x = this.state.x + this.state.width +
dx * this.graph.view.scale;
this.shape.bounds.width = 1;
this.shape.bounds.y = tableState.y + start.y;
this.shape.bounds.height = tableState.height - start.y - start.height;
this.shape.bounds.y = tableState.y + start.y * this.graph.view.scale;
this.shape.bounds.height = tableState.height -
(start.height + start.y) * this.graph.view.scale;
this.shape.redraw();
}
};
@ -9214,7 +9216,8 @@ if (typeof mxVertexHandler != 'undefined')
}
}
return handles;
// Reserve gives point handles precedence over line handles
return (handles != null) ? handles.reverse() : null;
};
var vertexHandlerSetHandlesVisible = mxVertexHandler.prototype.setHandlesVisible;
@ -9222,10 +9225,13 @@ if (typeof mxVertexHandler != 'undefined')
mxVertexHandler.prototype.setHandlesVisible = function(visible)
{
vertexHandlerSetHandlesVisible.apply(this, arguments);
if (this.rowMoveHandle != null)
if (this.moveHandles != null)
{
this.rowMoveHandle.style.visibility = (visible) ? '' : 'hidden';
for (var i = 0; i < this.moveHandles.length; i++)
{
this.moveHandles[i].style.visibility = (visible) ? '' : 'hidden';
}
}
};
@ -9242,16 +9248,6 @@ if (typeof mxVertexHandler != 'undefined')
}
};
/**
* Adds handle padding for editing cells and exceptions.
*/
mxVertexHandler.prototype.isTableHandler = function()
{
return this.graph.isTableCell(this.state.cell) ||
this.graph.isTableRow(this.state.cell) ||
this.graph.isTable(this.state.cell);
};
/**
* Adds handle padding for editing cells and exceptions.
*/
@ -10062,43 +10058,54 @@ if (typeof mxVertexHandler != 'undefined')
this.rotationShape.node.setAttribute('title', mxResources.get('rotateTooltip'));
}
this.rowState = null;
if (this.graph.isTableRow(this.state.cell))
if (this.graph.isTable(this.state.cell))
{
this.rowState = this.state;
}
else if (this.graph.isTableCell(this.state.cell))
{
this.rowState = this.graph.view.getState(
this.graph.model.getParent(this.state.cell));
}
var graph = this.graph;
var model = graph.model;
// Special handles for moving rows
this.moveHandles = [];
if (this.rowState != null)
{
this.rowMoveHandle = mxUtils.createImage(Editor.moveImage);
this.rowMoveHandle.style.position = 'absolute';
this.rowMoveHandle.style.cursor = 'pointer';
this.rowMoveHandle.style.width = '24px';
this.rowMoveHandle.style.height = '24px';
this.graph.container.appendChild(this.rowMoveHandle);
mxEvent.addGestureListeners(this.rowMoveHandle, mxUtils.bind(this, function(evt)
for (var i = 0; i < model.getChildCount(this.state.cell); i++)
{
this.graph.graphHandler.start(this.state.cell,
mxEvent.getClientX(evt), mxEvent.getClientY(evt), [this.rowState.cell]);
this.graph.graphHandler.cellWasClicked = true;
this.graph.isMouseTrigger = mxEvent.isMouseEvent(evt);
this.graph.isMouseDown = true;
mxEvent.consume(evt);
}));
(mxUtils.bind(this, function(rowState)
{
if (rowState != null && model.isVertex(rowState.cell))
{
// Adds handle to move row
var moveHandle = mxUtils.createImage(Editor.rowMoveImage);
moveHandle.style.position = 'absolute';
moveHandle.style.cursor = 'move';
moveHandle.style.width = '7px';
moveHandle.style.height = '4px';
moveHandle.rowState = rowState;
mxEvent.addGestureListeners(moveHandle, mxUtils.bind(this, function(evt)
{
this.graph.graphHandler.start(this.state.cell,
mxEvent.getClientX(evt), mxEvent.getClientY(evt),
[rowState.cell]);
this.graph.graphHandler.cellWasClicked = true;
this.graph.isMouseTrigger = mxEvent.isMouseEvent(evt);
this.graph.isMouseDown = true;
mxEvent.consume(evt);
}));
this.moveHandles.push(moveHandle);
this.graph.container.appendChild(moveHandle);
}
}))(this.graph.view.getState(model.getChildAt(this.state.cell, i)));
}
}
var update = mxUtils.bind(this, function()
{
if (this.specialHandle != null)
{
this.specialHandle.node.style.display = (this.graph.isEnabled() && this.graph.getSelectionCount() < this.graph.graphHandler.maxCells) ? '' : 'none';
this.specialHandle.node.style.display = (this.graph.isEnabled() &&
this.graph.getSelectionCount() < this.graph.graphHandler.maxCells) ?
'' : 'none';
}
this.redrawHandles();
@ -10290,17 +10297,22 @@ if (typeof mxVertexHandler != 'undefined')
var vertexHandlerRedrawHandles = mxVertexHandler.prototype.redrawHandles;
mxVertexHandler.prototype.redrawHandles = function()
{
if (this.rowMoveHandle != null && this.rowState != null)
{
if (this.moveHandles != null)
{
this.rowMoveHandle.style.left = (this.rowState.x + this.rowState.width) + 'px';
this.rowMoveHandle.style.top = (this.rowState.y + this.rowState.height) + 'px';
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].style.top = (this.moveHandles[i].rowState.y +
this.moveHandles[i].rowState.height * 3 / 4) + 'px';
}
}
// Shows rotation handle only if one vertex is selected
if (this.rotationShape != null && this.rotationShape.node != null)
{
this.rotationShape.node.style.display = (this.rowMoveHandle == null &&
this.rotationShape.node.style.display = (this.moveHandles == null &&
(this.graph.getSelectionCount() == 1 && (this.index == null ||
this.index == mxEvent.ROTATION_HANDLE))) ? '' : 'none';
}
@ -10338,11 +10350,14 @@ if (typeof mxVertexHandler != 'undefined')
{
vertexHandlerDestroy.apply(this, arguments);
if (this.rowMoveHandle != null)
if (this.moveHandles != null)
{
this.rowMoveHandle.parentNode.removeChild(this.rowMoveHandle);
this.rowMoveHandle = null;
this.rowState = null;
for (var i = 0; i < this.moveHandles.length; i++)
{
this.moveHandles[i].parentNode.removeChild(this.moveHandles[i]);
}
this.moveHandles = null;
}
if (this.linkHint != null)

File diff suppressed because one or more lines are too long

View file

@ -6,11 +6,11 @@ if (workbox)
workbox.precaching.precacheAndRoute([
{
"url": "js/app.min.js",
"revision": "893a2614b11aec42f563c307818eac5c"
"revision": "31ef97ea7228e3d7ceb877ee7fe69503"
},
{
"url": "js/extensions.min.js",
"revision": "befa93c9f4f16312a26fb8d5450061cd"
"revision": "b6311ad55b3030c29977e2d8689eaa8e"
},
{
"url": "js/stencils.min.js",