12.6.7 release
This commit is contained in:
parent
95ebdb1a39
commit
acd6961ca7
81 changed files with 4684 additions and 3450 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
10-FEB-2020: 12.6.7
|
||||
|
||||
- Fixes clipping for edge labels in PDF output
|
||||
- Uses mxGraph 4.1.1 beta 7
|
||||
- Adds draft states
|
||||
|
||||
07-FEB-2020: 12.6.6
|
||||
|
||||
- Searches collapsed custom libraries
|
||||
- Fixes configured default libraries
|
||||
- Adds tags to configured libraries
|
||||
- Uses auth header for Google Drive
|
||||
- Uses mxGraph 4.1.1 beta 6
|
||||
|
||||
04-FEB-2020: 12.6.5
|
||||
|
||||
- Adds expand style for containers
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
12.6.5
|
||||
12.6.7
|
|
@ -50,49 +50,49 @@ b.push(e),b.push('"'))}0==a.innerHTML.length?b.push("/>"):(b.push(">"),b.push(a.
|
|||
d=0;d<b;d++)null!=a&&(c=a.ownerDocument.createElement("br"),a.appendChild(c));return c},button:function(a,b,c){c=null!=c?c:document;c=c.createElement("button");mxUtils.write(c,a);mxEvent.addListener(c,"click",function(a){b(a)});return c},para:function(a,b){var c=document.createElement("p");mxUtils.write(c,b);null!=a&&a.appendChild(c);return c},addTransparentBackgroundFilter:function(a){a.style.filter+="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mxClient.imageBasePath+"/transparent.gif', sizingMethod='scale')"},
|
||||
linkAction:function(a,b,c,d,e){return mxUtils.link(a,b,function(){c.execute(d)},e)},linkInvoke:function(a,b,c,d,e,f){return mxUtils.link(a,b,function(){c[d](e)},f)},link:function(a,b,c,d){var e=document.createElement("span");e.style.color="blue";e.style.textDecoration="underline";e.style.cursor="pointer";null!=d&&(e.style.paddingLeft=d+"px");mxEvent.addListener(e,"click",c);mxUtils.write(e,b);null!=a&&a.appendChild(e);return e},getDocumentSize:function(){var a=document.body,b=document.documentElement;
|
||||
try{return new mxRectangle(0,0,a.clientWidth||b.clientWidth,Math.max(a.clientHeight||0,b.clientHeight))}catch(c){return new mxRectangle}},fit:function(a){var b=mxUtils.getDocumentSize(),c=parseInt(a.offsetLeft),d=parseInt(a.offsetWidth),e=mxUtils.getDocumentScrollOrigin(a.ownerDocument),f=e.x,e=e.y,g=f+b.width;c+d>g&&(a.style.left=Math.max(f,g-d)+"px");c=parseInt(a.offsetTop);d=parseInt(a.offsetHeight);b=e+b.height;c+d>b&&(a.style.top=Math.max(e,b-d)+"px")},load:function(a){a=new mxXmlRequest(a,null,
|
||||
"GET",!1);a.send();return a},get:function(a,b,c,d,e,f){a=new mxXmlRequest(a,null,"GET");null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(a,c){mxUtils.get(a,function(a){var f=a.getStatus();200>f||299<f?g():(e[c]=a,d--,0==d&&b(e))},g)})(a[k],k);0==d&&b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,
|
||||
d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&(a=null);return a},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor){var d=new a.constructor,
|
||||
e;for(e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==
|
||||
b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b=
|
||||
"",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c])var d=mxUtils.getFunctionName(a[c].constructor),b=b+(c+" => ["+d+"]\n");else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return q;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/
|
||||
180),q=Math.sin(e*Math.PI/180);e=p*m+q*n;var m=-1*q*m+p*n,n=e*e,r=m*m,t=c*c,u=d*d,x=n/t+r/u;1<x?(c*=Math.sqrt(x),d*=Math.sqrt(x),f=0):(x=1,f===g&&(x=-1),f=x*Math.sqrt((t*u-t*r-u*n)/(t*r+u*n)));n=f*c*m/d;r=-1*f*d*e/c;k=p*n-q*r+k/2;l=q*n+p*r+l/2;t=Math.atan2((m-r)/d,(e-n)/c)-Math.atan2(0,1);f=0<=t?t:2*Math.PI+t;t=Math.atan2((-m-r)/d,(-e-n)/c)-Math.atan2((m-r)/d,(e-n)/c);e=0<=t?t:2*Math.PI+t;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/
|
||||
4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=q;d*=q;for(var y=Math.cos(f),B=Math.sin(f),r=-m*(n*B+d*y),t=-m*(c*B-p*y),q=[],A=0;A<g;++A){f+=e;var y=Math.cos(f),B=Math.sin(f),u=n*y-d*B+k,x=c*y+p*B+l,z=-m*(n*B+d*y),y=-m*(c*B-p*y),B=6*A;q[B]=Number(r+a);q[B+1]=Number(t+b);q[B+2]=Number(u-z+a);q[B+3]=Number(x-y+b);q[B+4]=Number(u+a);q[B+5]=Number(x+b);r=u+z;t=x+y}return q},getBoundingBox:function(a,b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);var d=Math.cos(b),e=Math.sin(b);c=null!=
|
||||
c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;
|
||||
var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=
|
||||
1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=
|
||||
d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b;
|
||||
b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|=(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g],e=mxUtils.ptSegDistSq(e.x,e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,
|
||||
mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=
|
||||
b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+
|
||||
d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y,f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},rectangleIntersectsSegment:function(a,b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;var e=b.y,
|
||||
g=c.y,l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b){var c=a.width,d=a.height,e=b.width,f=b.height;if(0>=e||0>=f||0>=c||0>=d)return!1;var g=a.x,k=a.y,l=b.x,m=b.y,e=e+l,f=f+m,c=c+g,d=d+k;return(e<l||e>g)&&(f<m||f>k)&&(c<g||c>l)&&(d<k||d>m)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=
|
||||
f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),
|
||||
a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(e=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=e.x,d+=e.y);e=a.getBoundingClientRect();null!=e&&(c+=e.left,d+=e.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){if(mxClient.IS_QUIRKS)return new mxPoint(a.body.scrollLeft,
|
||||
a.body.scrollTop);a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&
|
||||
a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-a.x,c-a.y)},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s")+"]+","g"),""):null},rtrim:function(a,
|
||||
b){return null!=a?a.replace(new RegExp("["+(b||"\\s")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&
|
||||
0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,
|
||||
arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxUtils.isVml(a)?a.style.filter=100<=b?"":"alpha(opacity="+b/5+")":mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":"alpha(opacity="+b+")":a.style.opacity=b/100},createImage:function(a){var b;mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(b=document.createElement(mxClient.VML_PREFIX+
|
||||
":image"),b.setAttribute("src",a),b.style.borderStyle="none"):(b=document.createElement("img"),b.setAttribute("src",a),b.setAttribute("border","0"));return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(a,e){var d=c.get(a);null==d&&(d=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),c.put(a,d));var g=c.get(e);null==g&&(g=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,g));d=mxCellPath.compare(d,g);return 0==d?0:0<d==b?1:-1});return a},getStylename:function(a){return null!=
|
||||
a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b)for(var c=a.split(";"),d=0,e=0;e<c.length;e++){if(c[e]==b)return d;d+=c[e].length+1}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];
|
||||
if(null!=a)for(var d=a.split(";"),e=0;e<d.length;e++)d[e]!=b&&c.push(d[e]);return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},setStyle:function(a,b,c){var d=null!=c&&("undefined"==
|
||||
typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();
|
||||
try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g;g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+
|
||||
g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=Math.round(b*mxConstants.LINE_HEIGHT)+
|
||||
"px";null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display=mxClient.IS_QUIRKS?"inline":
|
||||
"inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?
|
||||
(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),
|
||||
f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=b.getGraphBounds().clone();b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){var g=
|
||||
Math.floor(c)/c,k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-
|
||||
g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;">'+('<div style="position:absolute;overflow:hidden;width:'+e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+
|
||||
a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');b.close();c=b.createElement("div");
|
||||
c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform","translate("+k+","+
|
||||
l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();a.getGraphBounds();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";var d=document.createElement("pre");d.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(d);c=new mxWindow("Popup Window",
|
||||
c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),d=c.document.createElement("pre"),d.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(d))},alert:function(a){alert(a)},prompt:function(a,b){return prompt(a,
|
||||
null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;d=document.body.clientHeight||
|
||||
document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(a){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),mxUtils.br(e),g.setClosable(!0));
|
||||
g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(a){return"function"==typeof b?b(a):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(a){var b=d.cloneNode(!0),c=parseInt(b.style.width),e=
|
||||
parseInt(b.style.height);b.style.width=Math.round(c*a.view.scale)+"px";b.style.height=Math.round(e*a.view.scale)+"px";return b}));return a}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",
|
||||
"GET",!1);a.send();return a},get:function(a,b,c,d,e,f,g){a=new mxXmlRequest(a,null,"GET");var k=a.setRequestHeaders;g&&(a.setRequestHeaders=function(a,b){k.apply(this,arguments);for(var c in g)a.setRequestHeader(c,g[c])});null!=d&&a.setBinary(d);a.send(b,c,e,f);return a},getAll:function(a,b,c){for(var d=a.length,e=[],f=0,g=function(){0==f&&null!=c&&c();f++},k=0;k<a.length;k++)(function(a,c){mxUtils.get(a,function(a){var f=a.getStatus();200>f||299<f?g():(e[c]=a,d--,0==d&&b(e))},g)})(a[k],k);0==d&&
|
||||
b(e)},post:function(a,b,c,d){return(new mxXmlRequest(a,b)).send(c,d)},submit:function(a,b,c,d){return(new mxXmlRequest(a,b)).simulate(c,d)},loadInto:function(a,b,c){mxClient.IS_IE?b.onreadystatechange=function(){4==b.readyState&&c()}:b.addEventListener("load",c,!1);b.load(a)},getValue:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c);return a},getNumber:function(a,b,c){a=null!=a?a[b]:null;null==a&&(a=c||0);return Number(a)},getColor:function(a,b,c){a=null!=a?a[b]:null;null==a?a=c:a==mxConstants.NONE&&
|
||||
(a=null);return a},clone:function(a,b,c){c=null!=c?c:!1;var d=null;if(null!=a&&"function"==typeof a.constructor){var d=new a.constructor,e;for(e in a)e!=mxObjectIdentity.FIELD_NAME&&(null==b||0>mxUtils.indexOf(b,e))&&(d[e]=c||"object"!=typeof a[e]?a[e]:mxUtils.clone(a[e]))}return d},equalPoints:function(a,b){if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b)for(var c=0;c<a.length;c++)if(null!=a[c]&&null==b[c]||null==a[c]&&null!=b[c]||null!=a[c]&&
|
||||
null!=b[c]&&(a[c].x!=b[c].x||a[c].y!=b[c].y))return!1;return!0},equalEntries:function(a,b){var c=0;if(null==a&&null!=b||null!=a&&null==b||null!=a&&null!=b&&a.length!=b.length)return!1;if(null!=a&&null!=b){for(var d in b)c++;for(d in a)if(c--,!(mxUtils.isNaN(a[d])&&mxUtils.isNaN(b[d])||a[d]==b[d]))return!1}return 0==c},removeDuplicates:function(a){for(var b=new mxDictionary,c=[],d=0;d<a.length;d++)b.get(a[d])||(c.push(a[d]),b.put(a[d],!0));return c},isNaN:function(a){return"number"==typeof a&&isNaN(a)},
|
||||
extend:function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},toString:function(a){var b="",c;for(c in a)try{if(null==a[c])b+=c+" = [null]\n";else if("function"==typeof a[c])b+=c+" => [Function]\n";else if("object"==typeof a[c])var d=mxUtils.getFunctionName(a[c].constructor),b=b+(c+" => ["+d+"]\n");else b+=c+" = "+a[c]+"\n"}catch(e){b+=c+"="+e.message}return b},toRadians:function(a){return Math.PI*a/180},toDegree:function(a){return 180*a/Math.PI},arcToCurves:function(a,
|
||||
b,c,d,e,f,g,k,l){k-=a;l-=b;if(0===c||0===d)return q;c=Math.abs(c);d=Math.abs(d);var m=-k/2,n=-l/2,p=Math.cos(e*Math.PI/180),q=Math.sin(e*Math.PI/180);e=p*m+q*n;var m=-1*q*m+p*n,n=e*e,r=m*m,t=c*c,u=d*d,x=n/t+r/u;1<x?(c*=Math.sqrt(x),d*=Math.sqrt(x),f=0):(x=1,f===g&&(x=-1),f=x*Math.sqrt((t*u-t*r-u*n)/(t*r+u*n)));n=f*c*m/d;r=-1*f*d*e/c;k=p*n-q*r+k/2;l=q*n+p*r+l/2;t=Math.atan2((m-r)/d,(e-n)/c)-Math.atan2(0,1);f=0<=t?t:2*Math.PI+t;t=Math.atan2((-m-r)/d,(-e-n)/c)-Math.atan2((m-r)/d,(e-n)/c);e=0<=t?t:2*
|
||||
Math.PI+t;0==g&&0<e?e-=2*Math.PI:0!=g&&0>e&&(e+=2*Math.PI);g=2*e/Math.PI;g=Math.ceil(0>g?-1*g:g);e/=g;m=8/3*Math.sin(e/4)*Math.sin(e/4)/Math.sin(e/2);n=p*c;p*=d;c*=q;d*=q;for(var y=Math.cos(f),B=Math.sin(f),r=-m*(n*B+d*y),t=-m*(c*B-p*y),q=[],A=0;A<g;++A){f+=e;var y=Math.cos(f),B=Math.sin(f),u=n*y-d*B+k,x=c*y+p*B+l,z=-m*(n*B+d*y),y=-m*(c*B-p*y),B=6*A;q[B]=Number(r+a);q[B+1]=Number(t+b);q[B+2]=Number(u-z+a);q[B+3]=Number(x-y+b);q[B+4]=Number(u+a);q[B+5]=Number(x+b);r=u+z;t=x+y}return q},getBoundingBox:function(a,
|
||||
b,c){var d=null;if(null!=a&&null!=b&&0!=b){b=mxUtils.toRadians(b);var d=Math.cos(b),e=Math.sin(b);c=null!=c?c:new mxPoint(a.x+a.width/2,a.y+a.height/2);var f=new mxPoint(a.x,a.y);b=new mxPoint(a.x+a.width,a.y);var g=new mxPoint(b.x,a.y+a.height);a=new mxPoint(a.x,g.y);f=mxUtils.getRotatedPoint(f,d,e,c);b=mxUtils.getRotatedPoint(b,d,e,c);g=mxUtils.getRotatedPoint(g,d,e,c);a=mxUtils.getRotatedPoint(a,d,e,c);d=new mxRectangle(f.x,f.y,0,0);d.add(new mxRectangle(b.x,b.y,0,0));d.add(new mxRectangle(g.x,
|
||||
g.y,0,0));d.add(new mxRectangle(a.x,a.y,0,0))}return d},getRotatedPoint:function(a,b,c,d){d=null!=d?d:new mxPoint;var e=a.x-d.x;a=a.y-d.y;return new mxPoint(e*b-a*c+d.x,a*b+e*c+d.y)},getPortConstraints:function(a,b,c,d){b=mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT,mxUtils.getValue(b.style,c?mxConstants.STYLE_SOURCE_PORT_CONSTRAINT:mxConstants.STYLE_TARGET_PORT_CONSTRAINT,null));if(null==b)return d;d=b.toString();b=mxConstants.DIRECTION_MASK_NONE;c=0;1==mxUtils.getValue(a.style,mxConstants.STYLE_PORT_CONSTRAINT_ROTATION,
|
||||
0)&&(c=mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0));a=0;45<c?(a=1,135<=c&&(a=2)):-45>c&&(a=3,-135>=c&&(a=2));if(0<=d.indexOf(mxConstants.DIRECTION_NORTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:b|=mxConstants.DIRECTION_MASK_EAST;break;case 2:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:b|=mxConstants.DIRECTION_MASK_WEST}if(0<=d.indexOf(mxConstants.DIRECTION_WEST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_WEST;break;case 1:b|=mxConstants.DIRECTION_MASK_NORTH;
|
||||
break;case 2:b|=mxConstants.DIRECTION_MASK_EAST;break;case 3:b|=mxConstants.DIRECTION_MASK_SOUTH}if(0<=d.indexOf(mxConstants.DIRECTION_SOUTH))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:b|=mxConstants.DIRECTION_MASK_WEST;break;case 2:b|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:b|=mxConstants.DIRECTION_MASK_EAST}if(0<=d.indexOf(mxConstants.DIRECTION_EAST))switch(a){case 0:b|=mxConstants.DIRECTION_MASK_EAST;break;case 1:b|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:b|=
|
||||
mxConstants.DIRECTION_MASK_WEST;break;case 3:b|=mxConstants.DIRECTION_MASK_NORTH}return b},reversePortConstraints:function(a){var b;b=(a&mxConstants.DIRECTION_MASK_WEST)<<3;b|=(a&mxConstants.DIRECTION_MASK_NORTH)<<1;b|=(a&mxConstants.DIRECTION_MASK_SOUTH)>>1;return b|=(a&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(a,b,c){var d=-1;if(0<a.absolutePoints.length)for(var e=a.absolutePoints[0],f=null,g=1;g<a.absolutePoints.length;g++){var k=a.absolutePoints[g],e=mxUtils.ptSegDistSq(e.x,
|
||||
e.y,k.x,k.y,b,c);if(null==f||e<f)f=e,d=g-1;e=k}return d},getDirectedBounds:function(a,b,c,d,e){var f=mxUtils.getValue(c,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST);d=null!=d?d:mxUtils.getValue(c,mxConstants.STYLE_FLIPH,!1);e=null!=e?e:mxUtils.getValue(c,mxConstants.STYLE_FLIPV,!1);b.x=Math.round(Math.max(0,Math.min(a.width,b.x)));b.y=Math.round(Math.max(0,Math.min(a.height,b.y)));b.width=Math.round(Math.max(0,Math.min(a.width,b.width)));b.height=Math.round(Math.max(0,Math.min(a.height,
|
||||
b.height)));if(e&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||d&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.x,b.x=b.width,b.width=c;if(d&&(f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH)||e&&(f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST))c=b.y,b.y=b.height,b.height=c;d=mxRectangle.fromRectangle(b);f==mxConstants.DIRECTION_SOUTH?(d.y=b.x,d.x=b.height,d.width=b.y,d.height=b.width):f==mxConstants.DIRECTION_WEST?(d.y=b.height,
|
||||
d.x=b.width,d.width=b.x,d.height=b.y):f==mxConstants.DIRECTION_NORTH&&(d.y=b.width,d.x=b.y,d.width=b.height,d.height=b.x);return new mxRectangle(a.x+d.x,a.y+d.y,a.width-d.width-d.x,a.height-d.height-d.y)},getPerimeterPoint:function(a,b,c){for(var d=null,e=0;e<a.length-1;e++){var f=mxUtils.intersection(a[e].x,a[e].y,a[e+1].x,a[e+1].y,b.x,b.y,c.x,c.y);if(null!=f){var g=c.x-f.x,k=c.y-f.y,f={p:f,distSq:k*k+g*g};null!=f&&(null==d||d.distSq>f.distSq)&&(d=f)}}return null!=d?d.p:null},rectangleIntersectsSegment:function(a,
|
||||
b,c){var d=a.y,e=a.x,f=d+a.height,g=e+a.width;a=b.x;var k=c.x;b.x>c.x&&(a=c.x,k=b.x);k>g&&(k=g);a<e&&(a=e);if(a>k)return!1;var e=b.y,g=c.y,l=c.x-b.x;1E-7<Math.abs(l)&&(c=(c.y-b.y)/l,b=b.y-c*b.x,e=c*a+b,g=c*k+b);e>g&&(b=g,g=e,e=b);g>f&&(g=f);e<d&&(e=d);return e>g?!1:!0},contains:function(a,b,c){return a.x<=b&&a.x+a.width>=b&&a.y<=c&&a.y+a.height>=c},intersects:function(a,b){var c=a.width,d=a.height,e=b.width,f=b.height;if(0>=e||0>=f||0>=c||0>=d)return!1;var g=a.x,k=a.y,l=b.x,m=b.y,e=e+l,f=f+m,c=c+
|
||||
g,d=d+k;return(e<l||e>g)&&(f<m||f>k)&&(c<g||c>l)&&(d<k||d>m)},intersectsHotspot:function(a,b,c,d,e,f){d=null!=d?d:1;e=null!=e?e:0;f=null!=f?f:0;if(0<d){var g=a.getCenterX(),k=a.getCenterY(),l=a.width,m=a.height,n=mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE)*a.view.scale;0<n&&(mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,!0)?(k=a.y+n/2,m=n):(g=a.x+n/2,l=n));l=Math.max(e,l*d);m=Math.max(e,m*d);0<f&&(l=Math.min(l,f),m=Math.min(m,f));d=new mxRectangle(g-l/2,k-m/2,l,m);g=mxUtils.toRadians(mxUtils.getValue(a.style,
|
||||
mxConstants.STYLE_ROTATION)||0);0!=g&&(e=Math.cos(-g),f=Math.sin(-g),g=new mxPoint(a.getCenterX(),a.getCenterY()),a=mxUtils.getRotatedPoint(new mxPoint(b,c),e,f,g),b=a.x,c=a.y);return mxUtils.contains(d,b,c)}return!0},getOffset:function(a,b){for(var c=0,d=0,e=!1,f=a,g=document.body,k=document.documentElement;null!=f&&f!=g&&f!=k&&!e;){var l=mxUtils.getCurrentStyle(f);null!=l&&(e=e||"fixed"==l.position);f=f.parentNode}b||e||(e=mxUtils.getDocumentScrollOrigin(a.ownerDocument),c+=e.x,d+=e.y);e=a.getBoundingClientRect();
|
||||
null!=e&&(c+=e.left,d+=e.top);return new mxPoint(c,d)},getDocumentScrollOrigin:function(a){if(mxClient.IS_QUIRKS)return new mxPoint(a.body.scrollLeft,a.body.scrollTop);a=a.defaultView||a.parentWindow;return new mxPoint(null!=a&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=a&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(a,
|
||||
b,c){b=null!=b?b:!1;c=null!=c?c:!0;for(var d=null!=a?a.ownerDocument:document,e=d.body,f=d.documentElement,g=new mxPoint,k=!1;null!=a&&a!=e&&a!=f;){isNaN(a.scrollLeft)||isNaN(a.scrollTop)||(g.x+=a.scrollLeft,g.y+=a.scrollTop);var l=mxUtils.getCurrentStyle(a);null!=l&&(k=k||"fixed"==l.position);a=b?a.parentNode:null}!k&&c&&(a=mxUtils.getDocumentScrollOrigin(d),g.x+=a.x,g.y+=a.y);return g},convertPoint:function(a,b,c){var d=mxUtils.getScrollOrigin(a,!1);a=mxUtils.getOffset(a);a.x-=d.x;a.y-=d.y;return new mxPoint(b-
|
||||
a.x,c-a.y)},ltrim:function(a,b){return null!=a?a.replace(new RegExp("^["+(b||"\\s")+"]+","g"),""):null},rtrim:function(a,b){return null!=a?a.replace(new RegExp("["+(b||"\\s")+"]+$","g"),""):null},trim:function(a,b){return mxUtils.ltrim(mxUtils.rtrim(a,b),b)},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)&&("string"!=typeof a||0>a.toLowerCase().indexOf("0x"))},isInteger:function(a){return String(parseInt(a))===String(a)},mod:function(a,b){return(a%b+b)%b},intersection:function(a,b,
|
||||
c,d,e,f,g,k){var l=(k-f)*(c-a)-(g-e)*(d-b);g=((g-e)*(b-f)-(k-f)*(a-e))/l;e=((c-a)*(b-f)-(d-b)*(a-e))/l;return 0<=g&&1>=g&&0<=e&&1>=e?new mxPoint(a+g*(c-a),b+g*(d-b)):null},ptSegDistSq:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;0>=e*c+f*d?c=0:(e=c-e,f=d-f,a=e*c+f*d,c=0>=a?0:a*a/(c*c+d*d));e=e*e+f*f-c;0>e&&(e=0);return e},ptLineDist:function(a,b,c,d,e,f){return Math.abs((d-b)*e-(c-a)*f+c*b-d*a)/Math.sqrt((d-b)*(d-b)+(c-a)*(c-a))},relativeCcw:function(a,b,c,d,e,f){c-=a;d-=b;e-=a;f-=b;a=e*d-f*c;0==a&&
|
||||
(a=e*c+f*d,0<a&&(a=(e-c)*c+(f-d)*d,0>a&&(a=0)));return 0>a?-1:0<a?1:0},animateChanges:function(a,b){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(a,b,c){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(a,b,c,d,e,f){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(a,b){mxUtils.isVml(a)?a.style.filter=100<=b?"":"alpha(opacity="+b/5+")":mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?a.style.filter=100<=b?"":
|
||||
"alpha(opacity="+b+")":a.style.opacity=b/100},createImage:function(a){var b;mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(b=document.createElement(mxClient.VML_PREFIX+":image"),b.setAttribute("src",a),b.style.borderStyle="none"):(b=document.createElement("img"),b.setAttribute("src",a),b.setAttribute("border","0"));return b},sortCells:function(a,b){b=null!=b?b:!0;var c=new mxDictionary;a.sort(function(a,e){var d=c.get(a);null==d&&(d=mxCellPath.create(a).split(mxCellPath.PATH_SEPARATOR),c.put(a,
|
||||
d));var g=c.get(e);null==g&&(g=mxCellPath.create(e).split(mxCellPath.PATH_SEPARATOR),c.put(e,g));d=mxCellPath.compare(d,g);return 0==d?0:0<d==b?1:-1});return a},getStylename:function(a){return null!=a&&(a=a.split(";")[0],0>a.indexOf("="))?a:""},getStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0>a[c].indexOf("=")&&b.push(a[c])}return b},indexOfStylename:function(a,b){if(null!=a&&null!=b)for(var c=a.split(";"),d=0,e=0;e<c.length;e++){if(c[e]==b)return d;d+=c[e].length+
|
||||
1}return-1},addStylename:function(a,b){0>mxUtils.indexOfStylename(a,b)&&(null==a?a="":0<a.length&&";"!=a.charAt(a.length-1)&&(a+=";"),a+=b);return a},removeStylename:function(a,b){var c=[];if(null!=a)for(var d=a.split(";"),e=0;e<d.length;e++)d[e]!=b&&c.push(d[e]);return c.join(";")},removeAllStylenames:function(a){var b=[];if(null!=a){a=a.split(";");for(var c=0;c<a.length;c++)0<=a[c].indexOf("=")&&b.push(a[c])}return b.join(";")},setCellStyles:function(a,b,c,d){if(null!=b&&0<b.length){a.beginUpdate();
|
||||
try{for(var e=0;e<b.length;e++)if(null!=b[e]){var f=mxUtils.setStyle(a.getStyle(b[e]),c,d);a.setStyle(b[e],f)}}finally{a.endUpdate()}}},setStyle:function(a,b,c){var d=null!=c&&("undefined"==typeof c.length||0<c.length);if(null==a||0==a.length)d&&(a=b+"="+c+";");else if(a.substring(0,b.length+1)==b+"="){var e=a.indexOf(";");a=d?b+"="+c+(0>e?";":a.substring(e)):0>e||e==a.length-1?"":a.substring(e+1)}else{var f=a.indexOf(";"+b+"=");0>f?d&&(d=";"==a.charAt(a.length-1)?"":";",a=a+d+b+"="+c+";"):(e=a.indexOf(";",
|
||||
f+1),a=d?a.substring(0,f+1)+b+"="+c+(0>e?";":a.substring(e)):a.substring(0,f)+(0>e?";":a.substring(e)))}return a},setCellStyleFlags:function(a,b,c,d,e){if(null!=b&&0<b.length){a.beginUpdate();try{for(var f=0;f<b.length;f++)if(null!=b[f]){var g=mxUtils.setStyleFlag(a.getStyle(b[f]),c,d,e);a.setStyle(b[f],g)}}finally{a.endUpdate()}}},setStyleFlag:function(a,b,c,d){if(null==a||0==a.length)a=d||null==d?b+"="+c:b+"=0";else{var e=a.indexOf(b+"=");if(0>e)e=";"==a.charAt(a.length-1)?"":";",a=d||null==d?a+
|
||||
e+b+"="+c:a+e+b+"=0";else{var f=a.indexOf(";",e),g;g=0>f?a.substring(e+b.length+1):a.substring(e+b.length+1,f);g=null==d?parseInt(g)^c:d?parseInt(g)|c:parseInt(g)&~c;a=a.substring(0,e)+b+"="+g+(0<=f?a.substring(f):"")}}return a},getAlignmentAsPoint:function(a,b){var c=-.5,d=-.5;a==mxConstants.ALIGN_LEFT?c=0:a==mxConstants.ALIGN_RIGHT&&(c=-1);b==mxConstants.ALIGN_TOP?d=0:b==mxConstants.ALIGN_BOTTOM&&(d=-1);return new mxPoint(c,d)},getSizeForString:function(a,b,c,d,e){b=null!=b?b:mxConstants.DEFAULT_FONTSIZE;
|
||||
c=null!=c?c:mxConstants.DEFAULT_FONTFAMILY;var f=document.createElement("div");f.style.fontFamily=c;f.style.fontSize=Math.round(b)+"px";f.style.lineHeight=Math.round(b*mxConstants.LINE_HEIGHT)+"px";null!=e&&((e&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(f.style.fontWeight="bold"),(e&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(f.style.fontStyle="italic"),b=[],(e&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&b.push("underline"),(e&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&
|
||||
b.push("line-through"),0<b.length&&(f.style.textDecoration=b.join(" ")));f.style.position="absolute";f.style.visibility="hidden";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.style.zoom="1";null!=d?(f.style.width=d+"px",f.style.whiteSpace="normal"):f.style.whiteSpace="nowrap";f.innerHTML=a;document.body.appendChild(f);a=new mxRectangle(0,0,f.offsetWidth,f.offsetHeight);document.body.removeChild(f);return a},getViewXml:function(a,b,c,d,e){d=null!=d?d:0;e=null!=e?e:0;b=null!=b?b:1;null==
|
||||
c&&(c=[a.getModel().getRoot()]);var f=a.getView(),g=null,k=f.isEventsEnabled();f.setEventsEnabled(!1);var l=f.drawPane,m=f.overlayPane;a.dialect==mxConstants.DIALECT_SVG?(f.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),f.canvas.appendChild(f.drawPane),f.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g")):(f.drawPane=f.drawPane.cloneNode(!1),f.canvas.appendChild(f.drawPane),f.overlayPane=f.overlayPane.cloneNode(!1));f.canvas.appendChild(f.overlayPane);var n=f.getTranslate();f.translate=
|
||||
new mxPoint(d,e);b=new mxTemporaryCellStates(a.getView(),b,c);try{g=(new mxCodec).encode(a.getView())}finally{b.destroy(),f.translate=n,f.canvas.removeChild(f.drawPane),f.canvas.removeChild(f.overlayPane),f.drawPane=l,f.overlayPane=m,f.setEventsEnabled(k)}return g},getScaleForPageCount:function(a,b,c,d){if(1>a)return 1;c=null!=c?c:mxConstants.PAGE_FORMAT_A4_PORTRAIT;d=null!=d?d:0;var e=c.width-2*d;c=c.height-2*d;d=b.getGraphBounds().clone();b=b.getView().getScale();d.width/=b;d.height/=b;b=d.width;
|
||||
var f=Math.sqrt(a);d=Math.sqrt(b/d.height/(e/c));c=f*d;d=f/d;if(1>c&&d>a){var g=d/a;d=a;c/=g}1>d&&c>a&&(g=c/a,c=a,d/=g);g=Math.ceil(c)*Math.ceil(d);for(f=0;g>a;){var g=Math.floor(c)/c,k=Math.floor(d)/d;1==g&&(g=Math.floor(c-1)/c);1==k&&(k=Math.floor(d-1)/d);g=g>k?g:k;c*=g;d*=g;g=Math.ceil(c)*Math.ceil(d);f++;if(10<f)break}return e*c/b*.99999},show:function(a,b,c,d,e,f){c=null!=c?c:0;d=null!=d?d:0;null==b?b=window.open().document:b.open();9==document.documentMode&&b.writeln('\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=9"><![endif]--\x3e');
|
||||
var g=a.getGraphBounds(),k=Math.ceil(c-g.x),l=Math.ceil(d-g.y);null==e&&(e=Math.ceil(g.width+c)+Math.ceil(Math.ceil(g.x)-g.x));null==f&&(f=Math.ceil(g.height+d)+Math.ceil(Math.ceil(g.y)-g.y));if(mxClient.IS_IE||11==document.documentMode){d="<html><head>";g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)d+=g[c].outerHTML;d+="<style>";for(c=0;c<document.styleSheets.length;c++)try{d+=document.styleSheets[c].cssText}catch(m){}d=d+'</style></head><body style="margin:0px;">'+('<div style="position:absolute;overflow:hidden;width:'+
|
||||
e+"px;height:"+f+'px;"><div style="position:relative;left:'+k+"px;top:"+l+'px;">')+a.container.innerHTML;b.writeln(d+"</div></div></body><html>");b.close()}else{b.writeln("<html><head>");g=document.getElementsByTagName("base");for(c=0;c<g.length;c++)b.writeln(mxUtils.getOuterHtml(g[c]));d=document.getElementsByTagName("link");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));d=document.getElementsByTagName("style");for(c=0;c<d.length;c++)b.writeln(mxUtils.getOuterHtml(d[c]));b.writeln('</head><body style="margin:0px;"></body></html>');
|
||||
b.close();c=b.createElement("div");c.position="absolute";c.overflow="hidden";c.style.width=e+"px";c.style.height=f+"px";e=b.createElement("div");e.style.position="absolute";e.style.left=k+"px";e.style.top=l+"px";f=a.container.firstChild;for(d=null;null!=f;)g=f.cloneNode(!0),f==a.view.drawPane.ownerSVGElement?(c.appendChild(g),d=g):e.appendChild(g),f=f.nextSibling;b.body.appendChild(c);null!=e.firstChild&&b.body.appendChild(e);null!=d&&(d.style.minWidth="",d.style.minHeight="",d.firstChild.setAttribute("transform",
|
||||
"translate("+k+","+l+")"))}mxUtils.removeCursors(b.body);return b},printScreen:function(a){var b=window.open();a.getGraphBounds();mxUtils.show(a,b.document);a=function(){b.focus();b.print();b.close()};mxClient.IS_GC?b.setTimeout(a,500):a()},popup:function(a,b){if(b){var c=document.createElement("div");c.style.overflow="scroll";c.style.width="636px";c.style.height="460px";var d=document.createElement("pre");d.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," ");c.appendChild(d);
|
||||
c=new mxWindow("Popup Window",c,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0);c.setClosable(!0);c.setVisible(!0)}else mxClient.IS_NS?(c=window.open(),c.document.writeln("<pre>"+mxUtils.htmlEntities(a)+"</pre"),c.document.close()):(c=window.open(),d=c.document.createElement("pre"),d.innerHTML=mxUtils.htmlEntities(a,!1).replace(/\n/g,"<br>").replace(/ /g," "),c.document.body.appendChild(d))},alert:function(a){alert(a)},
|
||||
prompt:function(a,b){return prompt(a,null!=b?b:"")},confirm:function(a){return confirm(a)},error:function(a,b,c,d){var e=document.createElement("div");e.style.padding="20px";var f=document.createElement("img");f.setAttribute("src",d||mxUtils.errorImage);f.setAttribute("valign","bottom");f.style.verticalAlign="middle";e.appendChild(f);e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));e.appendChild(document.createTextNode(" "));mxUtils.write(e,a);a=document.body.clientWidth;
|
||||
d=document.body.clientHeight||document.documentElement.clientHeight;var g=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,e,(a-b)/2,d/4,b,null,!1,!0);c&&(mxUtils.br(e),b=document.createElement("p"),c=document.createElement("button"),mxClient.IS_IE?c.style.cssText="float:right":c.setAttribute("style","float:right"),mxEvent.addListener(c,"click",function(a){g.destroy()}),mxUtils.write(c,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),b.appendChild(c),e.appendChild(b),
|
||||
mxUtils.br(e),g.setClosable(!0));g.setVisible(!0);return g},makeDraggable:function(a,b,c,d,e,f,g,k,l,m){a=new mxDragSource(a,c);a.dragOffset=new mxPoint(null!=e?e:0,null!=f?f:mxConstants.TOOLTIP_VERTICAL_OFFSET);a.autoscroll=g;a.setGuidesEnabled(!1);null!=l&&(a.highlightDropTargets=l);null!=m&&(a.getDropTarget=m);a.getGraphForEvent=function(a){return"function"==typeof b?b(a):b};null!=d&&(a.createDragElement=function(){return d.cloneNode(!0)},k&&(a.createPreviewElement=function(a){var b=d.cloneNode(!0),
|
||||
c=parseInt(b.style.width),e=parseInt(b.style.height);b.style.width=Math.round(c*a.view.scale)+"px";b.style.height=Math.round(e*a.view.scale)+"px";return b}));return a}},mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",
|
||||
NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",
|
||||
OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",
|
||||
VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",
|
||||
|
@ -856,10 +856,10 @@ mxPrintPreview.prototype.renderPage=function(a,b,c,d,e,f){f=this.wnd.document;va
|
|||
b-2*this.border+"px",l.style.overflow="hidden",!mxClient.IS_IE||null!=f.documentMode&&5!=f.documentMode&&8!=f.documentMode&&7!=f.documentMode?(l.style.top=this.border+"px",l.style.left=this.border+"px"):(l.style.marginTop=this.border+"px",l.style.marginLeft=this.border+"px"),this.graph.dialect==mxConstants.DIALECT_VML&&(l.style.position="absolute"),g.appendChild(l),document.body.appendChild(g),k=l}catch(n){throw g.parentNode.removeChild(g),n;}e(k);return g};
|
||||
mxPrintPreview.prototype.getRoot=function(){var a=this.graph.view.currentRoot;null==a&&(a=this.graph.getModel().getRoot());return a};
|
||||
mxPrintPreview.prototype.addGraphFragment=function(a,b,c,d,e,f){var g=this.graph.getView();d=this.graph.container;this.graph.container=e;var k=g.getCanvas(),l=g.getBackgroundPane(),m=g.getDrawPane(),n=g.getOverlayPane(),p=c;if(this.graph.dialect==mxConstants.DIALECT_SVG){if(g.createSvg(),!mxClient.NO_FO){var q=g.getDrawPane().parentNode;q.getAttribute("transform");q.setAttribute("transformOrigin","0 0");q.setAttribute("transform","scale("+c+","+c+")translate("+a+","+b+")");c=1;b=a=0}}else this.graph.dialect==
|
||||
mxConstants.DIALECT_VML?g.createVml():g.createHtml();q=g.isEventsEnabled();g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var y=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p);this.graph.cellRenderer.redraw=function(a,b,c){if(null!=a){var d=x.get(a.cell);if(null!=d&&(d=g.getBoundingBox(d,!1),null!=d&&!mxUtils.intersects(y,
|
||||
d)))return}u.apply(this,arguments)}}a=null;try{var B=[this.getRoot()];a=new mxTemporaryCellStates(g,c,B,null,mxUtils.bind(this,function(a){return this.getLinkForCellState(a)}))}finally{if(mxClient.IS_IE)g.overlayPane.innerHTML="",g.canvas.style.overflow="hidden",g.canvas.style.position="relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)B=c.nextSibling,b=c.nodeName.toLowerCase(),"svg"==b?(c.style.overflow=
|
||||
"hidden",c.style.position="relative",c.style.top=this.marginTop+"px",c.setAttribute("width",f.width),c.setAttribute("height",f.height),c.style.width="",c.style.height=""):"default"!=c.style.cursor&&"div"!=b&&c.parentNode.removeChild(c),c=B;this.printBackgroundImage&&(e=e.getElementsByTagName("svg"),0<e.length&&(e[0].style.position="absolute"));g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(r);this.graph.container=d;this.graph.cellRenderer.redraw=u;g.canvas=k;g.backgroundPane=
|
||||
l;g.drawPane=m;g.overlayPane=n;g.translate=t;a.destroy();g.setEventsEnabled(q)}};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};
|
||||
mxConstants.DIALECT_VML?g.createVml():g.createHtml();q=g.isEventsEnabled();g.setEventsEnabled(!1);var r=this.graph.isEnabled();this.graph.setEnabled(!1);var t=g.getTranslate();g.translate=new mxPoint(a,b);var u=this.graph.cellRenderer.redraw,x=g.states;a=g.scale;if(this.clipping){var y=new mxRectangle((f.x+t.x)*a,(f.y+t.y)*a,f.width*a/p,f.height*a/p);this.graph.cellRenderer.redraw=function(a,b,c){if(null!=a){var d=x.get(a.cell);if(null!=d&&(d=g.getBoundingBox(d,!1),null!=d&&0<d.width&&0<d.height&&
|
||||
!mxUtils.intersects(y,d)))return}u.apply(this,arguments)}}a=null;try{var B=[this.getRoot()];a=new mxTemporaryCellStates(g,c,B,null,mxUtils.bind(this,function(a){return this.getLinkForCellState(a)}))}finally{if(mxClient.IS_IE)g.overlayPane.innerHTML="",g.canvas.style.overflow="hidden",g.canvas.style.position="relative",g.canvas.style.top=this.marginTop+"px",g.canvas.style.width=f.width+"px",g.canvas.style.height=f.height+"px";else for(c=e.firstChild;null!=c;)B=c.nextSibling,b=c.nodeName.toLowerCase(),
|
||||
"svg"==b?(c.style.overflow="hidden",c.style.position="relative",c.style.top=this.marginTop+"px",c.setAttribute("width",f.width),c.setAttribute("height",f.height),c.style.width="",c.style.height=""):"default"!=c.style.cursor&&"div"!=b&&c.parentNode.removeChild(c),c=B;this.printBackgroundImage&&(e=e.getElementsByTagName("svg"),0<e.length&&(e[0].style.position="absolute"));g.overlayPane.parentNode.removeChild(g.overlayPane);this.graph.setEnabled(r);this.graph.container=d;this.graph.cellRenderer.redraw=
|
||||
u;g.canvas=k;g.backgroundPane=l;g.drawPane=m;g.overlayPane=n;g.translate=t;a.destroy();g.setEventsEnabled(q)}};mxPrintPreview.prototype.getLinkForCellState=function(a){return this.graph.getLinkForCell(a.cell)};
|
||||
mxPrintPreview.prototype.insertBackgroundImage=function(a,b,c){var d=this.graph.backgroundImage;if(null!=d){var e=document.createElement("img");e.style.position="absolute";e.style.marginLeft=Math.round(b*this.scale)+"px";e.style.marginTop=Math.round(c*this.scale)+"px";e.setAttribute("width",Math.round(this.scale*d.width));e.setAttribute("height",Math.round(this.scale*d.height));e.src=d.src;a.insertBefore(e,a.firstChild)}};mxPrintPreview.prototype.getCoverPages=function(){return null};
|
||||
mxPrintPreview.prototype.getAppendices=function(){return null};mxPrintPreview.prototype.print=function(a){a=this.open(a);null!=a&&a.print()};mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)};function mxStylesheet(){this.styles={};this.putDefaultVertexStyle(this.createDefaultVertexStyle());this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}
|
||||
mxStylesheet.prototype.createDefaultVertexStyle=function(){var a={};a[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE;a[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter;a[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE;a[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER;a[mxConstants.STYLE_FILLCOLOR]="#C3D9FF";a[mxConstants.STYLE_STROKECOLOR]="#6482B9";a[mxConstants.STYLE_FONTCOLOR]="#774400";return a};
|
||||
|
@ -1213,7 +1213,8 @@ mxGraph.prototype.exitGroup=function(){var a=this.model.getRoot(),b=this.getCurr
|
|||
mxGraph.prototype.isValidRoot=function(a){return null!=a};mxGraph.prototype.getGraphBounds=function(){return this.view.getGraphBounds()};mxGraph.prototype.getCellBounds=function(a,b,c){var d=[a];b&&(d=d.concat(this.model.getEdges(a)));d=this.view.getBounds(d);if(c){c=this.model.getChildCount(a);for(var e=0;e<c;e++){var f=this.getCellBounds(this.model.getChildAt(a,e),b,!0);null!=d?d.add(f):d=f}}return d};
|
||||
mxGraph.prototype.getBoundingBoxFromGeometry=function(a,b){b=null!=b?b:!1;var c=null;if(null!=a)for(var d=0;d<a.length;d++)if(b||this.model.isVertex(a[d])){var e=this.getCellGeometry(a[d]);if(null!=e){var f=null;if(this.model.isEdge(a[d])){f=function(a){null!=a&&(null==g?g=new mxRectangle(a.x,a.y,0,0):g.add(new mxRectangle(a.x,a.y,0,0)))};null==this.model.getTerminal(a[d],!0)&&f(e.getTerminalPoint(!0));null==this.model.getTerminal(a[d],!1)&&f(e.getTerminalPoint(!1));e=e.points;if(null!=e&&0<e.length)for(var g=
|
||||
new mxRectangle(e[0].x,e[0].y,0,0),k=1;k<e.length;k++)f(e[k]);f=g}else k=this.model.getParent(a[d]),e.relative?this.model.isVertex(k)&&k!=this.view.currentRoot&&(g=this.getBoundingBoxFromGeometry([k],!1),null!=g&&(f=new mxRectangle(e.x*g.width,e.y*g.height,e.width,e.height),0<=mxUtils.indexOf(a,k)&&(f.x+=g.x,f.y+=g.y))):(f=mxRectangle.fromRectangle(e),this.model.isVertex(k)&&0<=mxUtils.indexOf(a,k)&&(g=this.getBoundingBoxFromGeometry([k],!1),null!=g&&(f.x+=g.x,f.y+=g.y))),null!=f&&null!=e.offset&&
|
||||
(f.x+=e.offset.x,f.y+=e.offset.y);null!=f&&(null==c?c=mxRectangle.fromRectangle(f):c.add(f))}}return c};mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a};
|
||||
(f.x+=e.offset.x,f.y+=e.offset.y),e=this.view.getState(a[d]),e=null!=e?e.style:this.getCellStyle(a[d]),null!=f&&null!=e&&(e=mxUtils.getValue(e,mxConstants.STYLE_ROTATION,0),0!=e&&(f=mxUtils.getBoundingBox(f,e)));null!=f&&(null==c?c=mxRectangle.fromRectangle(f):c.add(f))}}return c};mxGraph.prototype.refresh=function(a){this.view.clear(a,null==a);this.view.validate();this.sizeDidChange();this.fireEvent(new mxEventObject(mxEvent.REFRESH))};
|
||||
mxGraph.prototype.snap=function(a){this.gridEnabled&&(a=Math.round(a/this.gridSize)*this.gridSize);return a};
|
||||
mxGraph.prototype.snapDelta=function(a,b,c,d,e){var f=this.view.translate,g=this.view.scale;!c&&this.gridEnabled?(c=this.gridSize*g*.5,d||(d=b.x-(this.snap(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:this.snap(a.x/g)*g-d),e||(b=b.y-(this.snap(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:this.snap(a.y/g)*g-b)):(c=.5*g,d||(d=b.x-(Math.round(b.x/g-f.x)+f.x)*g,a.x=Math.abs(a.x-d)<c?0:Math.round(a.x/g)*g-d),e||(b=b.y-(Math.round(b.y/g-f.y)+f.y)*g,a.y=Math.abs(a.y-b)<c?0:Math.round(a.y/g)*g-b));return a};
|
||||
mxGraph.prototype.panGraph=function(a,b){if(this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container))this.container.scrollLeft=-a,this.container.scrollTop=-b;else{var c=this.view.getCanvas();if(this.dialect==mxConstants.DIALECT_SVG)if(0==a&&0==b){if(mxClient.IS_IE?c.setAttribute("transform","translate("+a+","+b+")"):c.removeAttribute("transform"),null!=this.shiftPreview1){for(var d=this.shiftPreview1.firstChild;null!=d;){var e=d.nextSibling;this.container.appendChild(d);d=e}null!=this.shiftPreview1.parentNode&&
|
||||
this.shiftPreview1.parentNode.removeChild(this.shiftPreview1);this.shiftPreview1=null;this.container.appendChild(c.parentNode);for(d=this.shiftPreview2.firstChild;null!=d;)e=d.nextSibling,this.container.appendChild(d),d=e;null!=this.shiftPreview2.parentNode&&this.shiftPreview2.parentNode.removeChild(this.shiftPreview2);this.shiftPreview2=null}}else{c.setAttribute("transform","translate("+a+","+b+")");if(null==this.shiftPreview1){this.shiftPreview1=document.createElement("div");this.shiftPreview1.style.position=
|
||||
|
@ -1602,7 +1603,8 @@ g,f.length)]);n.x=d;n.y=b.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(
|
|||
n.x,n.y);this.sizers[4].setCursor(f[mxUtils.mod(3+g,f.length)]);n.x=b.x;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[5],n.x,n.y);this.sizers[5].setCursor(f[mxUtils.mod(6+g,f.length)]);n.x=d;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[6],n.x,n.y);this.sizers[6].setCursor(f[mxUtils.mod(5+g,f.length)]);n.x=a;n.y=c;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[7],n.x,n.y);this.sizers[7].setCursor(f[mxUtils.mod(4+g,f.length)]);n.x=d+
|
||||
this.state.absoluteOffset.x;n.y=e+this.state.absoluteOffset.y;n=mxUtils.getRotatedPoint(n,k,l,m);this.moveSizerTo(this.sizers[8],n.x,n.y)}else 2<=this.state.width&&2<=this.state.height?this.moveSizerTo(this.sizers[0],d+this.state.absoluteOffset.x,e+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}null!=this.rotationShape&&(g=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),k=Math.cos(g),l=Math.sin(g),
|
||||
m=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),k,l,m),null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,n.x,n.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()?"hidden":""));null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"));if(null!=this.edgeHandlers)for(b=0;b<this.edgeHandlers.length;b++)this.edgeHandlers[b].redraw();
|
||||
if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)a=this.customHandles[b].shape.node.style.display,this.customHandles[b].redraw(),this.customHandles[b].shape.node.style.display=a,this.customHandles[b].shape.node.style.visibility=this.graph.isEditing()?"hidden":"";this.updateParentHighlight()};mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};
|
||||
if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)a=this.customHandles[b].shape.node.style.display,this.customHandles[b].redraw(),this.customHandles[b].shape.node.style.display=a,this.customHandles[b].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[b])?"":"hidden";this.updateParentHighlight()};mxVertexHandler.prototype.isCustomHandleVisible=function(a){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()};
|
||||
mxVertexHandler.prototype.getRotationHandlePosition=function(){return new mxPoint(this.bounds.x+this.bounds.width/2,this.bounds.y+this.rotationHandleVSpacing)};
|
||||
mxVertexHandler.prototype.updateParentHighlight=function(){if(null!=this.selectionBorder)if(null!=this.parentHighlight){var a=this.graph.model.getParent(this.state.cell);if(this.graph.model.isVertex(a)){var a=this.graph.view.getState(a),b=this.parentHighlight.bounds;null==a||b.x==a.x&&b.y==a.y&&b.width==a.width&&b.height==a.height||(this.parentHighlight.bounds=a,this.parentHighlight.redraw())}else this.parentHighlight.destroy(),this.parentHighlight=null}else this.parentHighlightEnabled&&(a=this.graph.model.getParent(this.state.cell),
|
||||
this.graph.model.isVertex(a)&&(a=this.graph.view.getState(a),null!=a&&(this.parentHighlight=this.createParentHighlightShape(a),this.parentHighlight.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.parentHighlight.pointerEvents=!1,this.parentHighlight.rotation=Number(a.style[mxConstants.STYLE_ROTATION]||"0"),this.parentHighlight.init(this.graph.getView().getOverlayPane()))))};
|
||||
mxVertexHandler.prototype.drawPreview=function(){null!=this.preview&&(this.preview.bounds=this.bounds,this.preview.node.parentNode==this.graph.container&&(this.preview.bounds.width=Math.max(0,this.preview.bounds.width-1),this.preview.bounds.height=Math.max(0,this.preview.bounds.height-1)),this.preview.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.preview.redraw());this.selectionBorder.bounds=this.bounds;this.selectionBorder.redraw();null!=this.parentHighlight&&this.parentHighlight.redraw()};
|
||||
|
@ -1674,8 +1676,9 @@ mxEdgeHandler.prototype.getHandleFillColor=function(a){a=0==a;var b=this.state.c
|
|||
mxEdgeHandler.prototype.redraw=function(a){this.abspoints=this.state.absolutePoints.slice();var b=this.graph.getModel().getGeometry(this.state.cell);if(null!=b&&(b=b.points,null!=this.bends&&0<this.bends.length&&null!=b)){null==this.points&&(this.points=[]);for(var c=1;c<this.bends.length-1;c++)null!=this.bends[c]&&null!=this.abspoints[c]&&(this.points[c-1]=b[c-1])}this.drawPreview();a||this.redrawHandles()};
|
||||
mxEdgeHandler.prototype.redrawHandles=function(){var a=this.state.cell,b=this.labelShape.bounds;this.label=new mxPoint(this.state.absoluteOffset.x,this.state.absoluteOffset.y);this.labelShape.bounds=new mxRectangle(Math.round(this.label.x-b.width/2),Math.round(this.label.y-b.height/2),b.width,b.height);b=this.graph.getLabel(a);this.labelShape.visible=null!=b&&0<b.length&&this.graph.isLabelMovable(a);if(null!=this.bends&&0<this.bends.length){var c=this.abspoints.length-1,a=this.abspoints[0],d=a.x,
|
||||
e=a.y,b=this.bends[0].bounds;this.bends[0].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[0].fill=this.getHandleFillColor(0);this.bends[0].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var c=this.abspoints[c],d=c.x,e=c.y,f=this.bends.length-1,b=this.bends[f].bounds;this.bends[f].bounds=new mxRectangle(Math.floor(d-b.width/2),Math.floor(e-b.height/2),b.width,b.height);this.bends[f].fill=this.getHandleFillColor(f);
|
||||
this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(a=this.abspoints[0],c=0;c<this.virtualBends.length;c++)null!=this.virtualBends[c]&&null!=this.abspoints[c+1]&&(d=this.abspoints[c+1],b=this.virtualBends[c],b.bounds=new mxRectangle(Math.floor(a.x+(d.x-a.x)/2-b.bounds.width/2),Math.floor(a.y+(d.y-a.y)/2-b.bounds.height/2),b.bounds.width,b.bounds.height),
|
||||
b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),a=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds));null!=this.labelShape&&this.labelShape.redraw();if(null!=this.customHandles)for(c=0;c<this.customHandles.length;c++)this.customHandles[c].redraw()};
|
||||
this.bends[f].redraw();this.manageLabelHandle&&this.checkLabelHandle(this.bends[f].bounds);this.redrawInnerBends(a,c)}if(null!=this.abspoints&&null!=this.virtualBends&&0<this.virtualBends.length)for(c=this.abspoints[0],a=0;a<this.virtualBends.length;a++)null!=this.virtualBends[a]&&null!=this.abspoints[a+1]&&(d=this.abspoints[a+1],b=this.virtualBends[a],b.bounds=new mxRectangle(Math.floor(c.x+(d.x-c.x)/2-b.bounds.width/2),Math.floor(c.y+(d.y-c.y)/2-b.bounds.height/2),b.bounds.width,b.bounds.height),
|
||||
b.redraw(),mxUtils.setOpacity(b.node,this.virtualBendOpacity),c=d,this.manageLabelHandle&&this.checkLabelHandle(b.bounds));null!=this.labelShape&&this.labelShape.redraw();if(null!=this.customHandles)for(a=0;a<this.customHandles.length;a++)b=this.customHandles[a].shape.node.style.display,this.customHandles[a].redraw(),this.customHandles[a].shape.node.style.display=b,this.customHandles[a].shape.node.style.visibility=this.isCustomHandleVisible(this.customHandles[a])?"":"hidden"};
|
||||
mxEdgeHandler.prototype.isCustomHandleVisible=function(a){return!this.graph.isEditing()&&1==this.state.view.graph.getSelectionCount()};
|
||||
mxEdgeHandler.prototype.setHandlesVisible=function(a){if(null!=this.bends)for(var b=0;b<this.bends.length;b++)this.bends[b].node.style.display=a?"":"none";if(null!=this.virtualBends)for(b=0;b<this.virtualBends.length;b++)this.virtualBends[b].node.style.display=a?"":"none";null!=this.labelShape&&(this.labelShape.node.style.display=a?"":"none");if(null!=this.customHandles)for(b=0;b<this.customHandles.length;b++)this.customHandles[b].setVisible(a)};
|
||||
mxEdgeHandler.prototype.redrawInnerBends=function(a,b){for(var c=1;c<this.bends.length-1;c++)if(null!=this.bends[c])if(null!=this.abspoints[c]){var d=this.abspoints[c].x,e=this.abspoints[c].y,f=this.bends[c].bounds;this.bends[c].node.style.visibility="visible";this.bends[c].bounds=new mxRectangle(Math.round(d-f.width/2),Math.round(e-f.height/2),f.width,f.height);this.manageLabelHandle?this.checkLabelHandle(this.bends[c].bounds):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(this.bends[c].bounds,
|
||||
this.labelShape.bounds)&&(w=mxConstants.HANDLE_SIZE+3,h=mxConstants.HANDLE_SIZE+3,this.bends[c].bounds=new mxRectangle(Math.round(d-w/2),Math.round(e-h/2),w,h));this.bends[c].redraw()}else this.bends[c].destroy(),this.bends[c]=null};mxEdgeHandler.prototype.checkLabelHandle=function(a){if(null!=this.labelShape){var b=this.labelShape.bounds;mxUtils.intersects(a,b)&&(a.getCenterY()<b.getCenterY()?b.y=a.y+a.height:b.y=a.y-b.height)}};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
CACHE MANIFEST
|
||||
|
||||
# THIS FILE WAS GENERATED. DO NOT MODIFY!
|
||||
# 02/04/2020 08:11 AM
|
||||
# 02/10/2020 01:55 PM
|
||||
|
||||
app.html
|
||||
index.html?offline=1
|
||||
|
|
3211
src/main/webapp/js/app.min.js
vendored
3211
src/main/webapp/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -952,6 +952,7 @@ App.main = function(callback, createUi)
|
|||
{
|
||||
EditorUi.debug('Using global configuration', window.DRAWIO_CONFIG);
|
||||
Editor.configure(window.DRAWIO_CONFIG);
|
||||
mxSettings.load();
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
@ -977,6 +978,7 @@ App.main = function(callback, createUi)
|
|||
{
|
||||
EditorUi.debug('Using local configuration', configData);
|
||||
Editor.configure(configData);
|
||||
mxSettings.load();
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
|
@ -1228,57 +1230,6 @@ App.prototype.init = function()
|
|||
}));
|
||||
}
|
||||
|
||||
var createFooter = mxUtils.bind(this, function(label, link, className, closeHandler, helpLink, clickHandler, noBlank)
|
||||
{
|
||||
var footer = document.createElement('div');
|
||||
footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
|
||||
'white-space:nowrap;left:50%;bottom:2px;';
|
||||
footer.className = className;
|
||||
|
||||
var icn = ((className == 'geStatusAlert') ? '<img src="' + mxClient.imageBasePath + '/warning.gif" border="0" ' +
|
||||
'style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>' : '');
|
||||
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
|
||||
footer.style.whiteSpace = 'nowrap';
|
||||
footer.innerHTML = '<a href="' + ((link != null) ? link : 'javascript:void(0)') +
|
||||
'" ' + ((!noBlank) ? 'target="_blank" ' : '') + 'style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
|
||||
icn + label + icn + '</a>' + ((helpLink != null) ? '<a href="' + helpLink +
|
||||
'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>' : '');
|
||||
|
||||
var img = document.createElement('img');
|
||||
|
||||
img.setAttribute('src', Dialog.prototype.closeImage);
|
||||
img.setAttribute('title', mxResources.get('close'));
|
||||
img.style.position = 'absolute';
|
||||
img.style.cursor = 'pointer';
|
||||
img.style.right = '10px';
|
||||
img.style.top = '12px';
|
||||
|
||||
footer.appendChild(img);
|
||||
|
||||
if (closeHandler)
|
||||
{
|
||||
mxEvent.addListener(img, 'click', mxUtils.bind(this, function(e)
|
||||
{
|
||||
closeHandler(e);
|
||||
mxEvent.consume(e);
|
||||
}));
|
||||
}
|
||||
|
||||
if (clickHandler != null)
|
||||
{
|
||||
footer.style.paddingRight = '40px';
|
||||
|
||||
mxEvent.addListener(footer, 'click', mxUtils.bind(this, function(e)
|
||||
{
|
||||
clickHandler(e);
|
||||
}));
|
||||
}
|
||||
|
||||
return footer;
|
||||
});
|
||||
|
||||
/**
|
||||
* Lazy-loading for individual backends
|
||||
*/
|
||||
|
@ -1505,11 +1456,12 @@ App.prototype.init = function()
|
|||
}
|
||||
});
|
||||
|
||||
var footer = createFooter('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
|
||||
var footer = this.createFooter('<img border="0" align="absmiddle" ' +
|
||||
'style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
|
||||
IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">' +
|
||||
mxUtils.htmlEntities(mxResources.get('installDrawio', null, 'Install draw.io')) + '</font>',
|
||||
'https://www.draw.io/index.html?offline=1',
|
||||
'geStatusMessage geBtn gePrimaryBtn', done, null, mxUtils.bind(this, function()
|
||||
mxUtils.htmlEntities(mxResources.get('installDrawio', null, 'Install draw.io')) + '</font>',
|
||||
'https://www.draw.io/index.html?offline=1', 'geStatusMessage geBtn gePrimaryBtn', done, null,
|
||||
mxUtils.bind(this, function()
|
||||
{
|
||||
// Show the prompt
|
||||
if (deferredPrompt != null)
|
||||
|
@ -1541,83 +1493,17 @@ App.prototype.init = function()
|
|||
}
|
||||
}));
|
||||
}
|
||||
else if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && (!this.editor.chromeless || this.editor.editable))
|
||||
else if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && urlParams['open'] == null &&
|
||||
(!this.editor.chromeless || this.editor.editable))
|
||||
{
|
||||
this.editor.addListener('fileLoaded', mxUtils.bind(this, function()
|
||||
{
|
||||
var file = this.getCurrentFile();
|
||||
var mode = (file != null) ? file.getMode() : null;
|
||||
|
||||
if ((mode == App.MODE_DEVICE || mode == App.MODE_BROWSER) && (!isLocalStorage || mxSettings.settings == null ||
|
||||
mxSettings.settings.closeDesktopFooter == null) && !this.footerShowing && urlParams['open'] == null)
|
||||
if (mode == App.MODE_DEVICE || mode == App.MODE_BROWSER)
|
||||
{
|
||||
mxUtils.get('https://api.github.com/repos/jgraph/drawio-desktop/releases/latest', mxUtils.bind(this, function(req)
|
||||
{
|
||||
var href = 'https://get.draw.io/';
|
||||
|
||||
try
|
||||
{
|
||||
var rel = JSON.parse(req.getText());
|
||||
|
||||
if (rel != null)
|
||||
{
|
||||
if (rel.tag_name != null && rel.name != null && rel.html_url != null)
|
||||
{
|
||||
if (mxClient.IS_MAC)
|
||||
{
|
||||
href = 'https://github.com/jgraph/drawio-desktop/releases/download/' +
|
||||
rel.tag_name + '/draw.io-' + rel.name + '.dmg';
|
||||
}
|
||||
else if (mxClient.IS_WIN)
|
||||
{
|
||||
href = 'https://github.com/jgraph/drawio-desktop/releases/download/' +
|
||||
rel.tag_name + '/draw.io-' + rel.name + '-windows-installer.exe';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignores parsing errors
|
||||
}
|
||||
|
||||
var closeHandler = mxUtils.bind(this, function()
|
||||
{
|
||||
footer.parentNode.removeChild(footer);
|
||||
this.footerShowing = false;
|
||||
this.hideFooter();
|
||||
|
||||
// Close permanently
|
||||
if (isLocalStorage && mxSettings.settings != null)
|
||||
{
|
||||
mxSettings.settings.closeDesktopFooter = Date.now();
|
||||
mxSettings.save();
|
||||
}
|
||||
});
|
||||
|
||||
var footer = createFooter('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
|
||||
IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">' +
|
||||
mxUtils.htmlEntities(mxResources.get('downloadDesktop')) + '</font>',
|
||||
href, 'geStatusMessage geBtn gePrimaryBtn', closeHandler, null, closeHandler);
|
||||
|
||||
// Push to after splash dialog background
|
||||
footer.style.zIndex = mxPopupMenu.prototype.zIndex;
|
||||
footer.style.padding = '18px 50px 12px 30px';
|
||||
footer.getElementsByTagName('img')[1].style.filter = 'invert(1)';
|
||||
document.body.appendChild(footer);
|
||||
this.footerShowing = true;
|
||||
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
|
||||
}), 500);
|
||||
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
|
||||
this.footerShowing = false;
|
||||
}), 60000);
|
||||
}));
|
||||
this.showDownloadDesktopFooter();
|
||||
}
|
||||
// else if ((!isLocalStorage || mxSettings.settings == null ||
|
||||
// mxSettings.settings.closeRateFooter == null) &&
|
||||
|
@ -1759,6 +1645,9 @@ App.prototype.init = function()
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Schedules a sanity check.
|
||||
*/
|
||||
App.prototype.scheduleSanityCheck = function()
|
||||
{
|
||||
if (this.sanityCheckThread == null)
|
||||
|
@ -1771,6 +1660,9 @@ App.prototype.scheduleSanityCheck = function()
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Stops sanity checks.
|
||||
*/
|
||||
App.prototype.stopSanityCheck = function()
|
||||
{
|
||||
if (this.sanityCheckThread != null)
|
||||
|
@ -1780,6 +1672,9 @@ App.prototype.stopSanityCheck = function()
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows a warning after some time with unsaved changes and autosave.
|
||||
*/
|
||||
App.prototype.sanityCheck = function()
|
||||
{
|
||||
var file = this.getCurrentFile();
|
||||
|
@ -1851,6 +1746,7 @@ App.prototype.isDriveDomain = function()
|
|||
(window.location.hostname == 'test.draw.io' ||
|
||||
window.location.hostname == 'www.draw.io' ||
|
||||
window.location.hostname == 'drive.draw.io' ||
|
||||
window.location.hostname == 'app.diagrams.net' ||
|
||||
window.location.hostname == 'jgraph.github.io');
|
||||
};
|
||||
|
||||
|
@ -1871,6 +1767,140 @@ App.prototype.getPusher = function()
|
|||
return this.pusher;
|
||||
};
|
||||
|
||||
/**
|
||||
* Shows a footer to download the desktop version once per session.
|
||||
*/
|
||||
App.prototype.showDownloadDesktopFooter = function()
|
||||
{
|
||||
if (!this.downloadDesktopFooterShown && !this.footerShowing && (!isLocalStorage ||
|
||||
mxSettings.settings == null || mxSettings.settings.closeDesktopFooter == null))
|
||||
{
|
||||
this.downloadDesktopFooterShown = true;
|
||||
|
||||
var closeHandler = mxUtils.bind(this, function()
|
||||
{
|
||||
footer.parentNode.removeChild(footer);
|
||||
this.footerShowing = false;
|
||||
this.hideFooter();
|
||||
|
||||
// Close permanently
|
||||
if (isLocalStorage && mxSettings.settings != null)
|
||||
{
|
||||
mxSettings.settings.closeDesktopFooter = Date.now();
|
||||
mxSettings.save();
|
||||
}
|
||||
});
|
||||
|
||||
var footer = this.createFooter('<img border="0" align="absmiddle" style="margin-top:-6px;cursor:pointer;margin-left:8px;margin-right:12px;width:24px;height:24px;" src="' +
|
||||
IMAGE_PATH + '/logo.png' + '"><font size="3" style="color:#ffffff;">' +
|
||||
mxUtils.htmlEntities(mxResources.get('downloadDesktop')) + '</font>',
|
||||
'https://get.draw.io/', 'geStatusMessage geBtn gePrimaryBtn', closeHandler, null, closeHandler);
|
||||
|
||||
// Push to after splash dialog background
|
||||
footer.style.zIndex = mxPopupMenu.prototype.zIndex;
|
||||
footer.style.padding = '18px 50px 12px 30px';
|
||||
footer.getElementsByTagName('img')[1].style.filter = 'invert(1)';
|
||||
document.body.appendChild(footer);
|
||||
this.footerShowing = true;
|
||||
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,0%)');
|
||||
}), 500);
|
||||
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
|
||||
this.footerShowing = false;
|
||||
}), 60000);
|
||||
|
||||
// Updates the download link to point to the right operating system
|
||||
mxUtils.get('https://api.github.com/repos/jgraph/drawio-desktop/releases/latest', mxUtils.bind(this, function(req)
|
||||
{
|
||||
try
|
||||
{
|
||||
var a = footer.getElementsByTagName('a')[0];
|
||||
var rel = JSON.parse(req.getText());
|
||||
|
||||
if (rel != null)
|
||||
{
|
||||
if (rel.tag_name != null && rel.name != null && rel.html_url != null)
|
||||
{
|
||||
if (mxClient.IS_MAC)
|
||||
{
|
||||
a.setAttribute('href', 'https://github.com/jgraph/drawio-desktop/releases/download/' +
|
||||
rel.tag_name + '/draw.io-' + rel.name + '.dmg');
|
||||
}
|
||||
else if (mxClient.IS_WIN)
|
||||
{
|
||||
a.setAttribute('href', 'https://github.com/jgraph/drawio-desktop/releases/download/' +
|
||||
rel.tag_name + '/draw.io-' + rel.name + '-windows-installer.exe');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignores parsing errors
|
||||
}
|
||||
}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a footer.
|
||||
*/
|
||||
App.prototype.createFooter = function(label, link, className, closeHandler, helpLink, clickHandler, noBlank)
|
||||
{
|
||||
var footer = document.createElement('div');
|
||||
footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
|
||||
'white-space:nowrap;left:50%;bottom:2px;';
|
||||
footer.className = className;
|
||||
|
||||
var icn = ((className == 'geStatusAlert') ? '<img src="' + mxClient.imageBasePath + '/warning.gif" border="0" ' +
|
||||
'style="margin-top:-4px;margin-right:8px;margin-left:8px;" valign="middle"/>' : '');
|
||||
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transform', 'translate(-50%,110%)');
|
||||
mxUtils.setPrefixedStyle(footer.style, 'transition', 'all 1s ease');
|
||||
footer.style.whiteSpace = 'nowrap';
|
||||
footer.innerHTML = '<a href="' + ((link != null) ? link : 'javascript:void(0)') +
|
||||
'" ' + ((!noBlank) ? 'target="_blank" ' : '') + 'style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;">' +
|
||||
icn + label + icn + '</a>' + ((helpLink != null) ? '<a href="' + helpLink +
|
||||
'" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;margin-right:8px;">Help</a>' : '');
|
||||
|
||||
var img = document.createElement('img');
|
||||
|
||||
img.setAttribute('src', Dialog.prototype.closeImage);
|
||||
img.setAttribute('title', mxResources.get('close'));
|
||||
img.style.position = 'absolute';
|
||||
img.style.cursor = 'pointer';
|
||||
img.style.right = '10px';
|
||||
img.style.top = '12px';
|
||||
|
||||
footer.appendChild(img);
|
||||
|
||||
if (closeHandler)
|
||||
{
|
||||
mxEvent.addListener(img, 'click', mxUtils.bind(this, function(e)
|
||||
{
|
||||
closeHandler(e);
|
||||
mxEvent.consume(e);
|
||||
}));
|
||||
}
|
||||
|
||||
if (clickHandler != null)
|
||||
{
|
||||
footer.style.paddingRight = '40px';
|
||||
|
||||
mxEvent.addListener(footer, 'click', mxUtils.bind(this, function(e)
|
||||
{
|
||||
clickHandler(e);
|
||||
}));
|
||||
}
|
||||
|
||||
return footer;
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -1960,44 +1990,6 @@ App.prototype.updateActionStates = function()
|
|||
this.actions.get('revisionHistory').setEnabled(this.isRevisionHistoryEnabled());
|
||||
};
|
||||
|
||||
/**
|
||||
* Updates draft in local storage
|
||||
*/
|
||||
App.prototype.updateDraft = function()
|
||||
{
|
||||
if (isLocalStorage && localStorage != null)
|
||||
{
|
||||
localStorage.setItem('.draft', JSON.stringify({modified:
|
||||
new Date().getTime(), data: this.getFileData()}));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the draft in local storage
|
||||
*/
|
||||
App.prototype.getDraft = function()
|
||||
{
|
||||
// FIXME: Handle multiple tabs
|
||||
// if (isLocalStorage && localStorage != null)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// var draft = localStorage.getItem('.draft');
|
||||
//
|
||||
// if (draft != null)
|
||||
// {
|
||||
// return JSON.parse(draft);
|
||||
// }
|
||||
// }
|
||||
// catch (e)
|
||||
// {
|
||||
// // ignore quota etc
|
||||
// }
|
||||
// }
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the specified entry to the recent file list in local storage
|
||||
*/
|
||||
|
@ -2074,24 +2066,6 @@ App.prototype.resetRecent = function(entry)
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the draft save in local storage
|
||||
*/
|
||||
App.prototype.removeDraft = function()
|
||||
{
|
||||
if (isLocalStorage && localStorage != null && urlParams['splash'] == '0')
|
||||
{
|
||||
try
|
||||
{
|
||||
localStorage.removeItem('.draft');
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignore quota etc
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the onbeforeunload for the application
|
||||
*/
|
||||
|
@ -2901,6 +2875,29 @@ App.prototype.start = function()
|
|||
// Listens to changes of the hash if not in embed or client mode
|
||||
if (urlParams['client'] != '1' && urlParams['embed'] != '1')
|
||||
{
|
||||
// Installs listener to claim current draft if there is one
|
||||
try
|
||||
{
|
||||
if (isLocalStorage)
|
||||
{
|
||||
window.addEventListener('storage', mxUtils.bind(this, function(evt)
|
||||
{
|
||||
var file = this.getCurrentFile();
|
||||
EditorUi.debug('storage event', evt, file);
|
||||
|
||||
if (file != null && evt.key == '.draft-alive-check' && evt.newValue != null && file.draftId != null)
|
||||
{
|
||||
this.draftAliveCheck = evt.newValue;
|
||||
file.saveDraft();
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
|
||||
// KNOWN: Does not work in quirks mode
|
||||
mxEvent.addListener(window, 'hashchange', mxUtils.bind(this, function(evt)
|
||||
{
|
||||
|
@ -3042,31 +3039,17 @@ App.prototype.start = function()
|
|||
{
|
||||
var id = this.getDiagramId();
|
||||
|
||||
if (urlParams['splash'] == '0' && (id == null || id.length == 0))
|
||||
if (EditorUi.enableDrafts && this.getServiceName() == 'draw.io' && (id == null || id.length == 0))
|
||||
{
|
||||
if (!mxClient.IS_CHROMEAPP)
|
||||
{
|
||||
var draft = this.getDraft();
|
||||
var fileData = (draft != null) ? draft.data : this.getFileData();
|
||||
var prev = Editor.useLocalStorage;
|
||||
this.createFile(this.defaultFilename, fileData, null, null, null, null, null, true);
|
||||
Editor.useLocalStorage = prev;
|
||||
|
||||
// Draft was used so the user should save the file
|
||||
if (draft != null)
|
||||
{
|
||||
var file = this.getCurrentFile();
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
file.addUnsavedStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.checkDrafts();
|
||||
}
|
||||
else if (urlParams['splash'] != '0')
|
||||
{
|
||||
this.loadFile(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.loadFile(id);
|
||||
this.createFile(this.defaultFilename, this.getFileData(), null, null, null, null, null, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3222,6 +3205,150 @@ App.prototype.start = function()
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks for orphaned drafts.
|
||||
*/
|
||||
App.prototype.loadDraft = function(xml, success)
|
||||
{
|
||||
this.createFile(this.defaultFilename, xml, null, null, mxUtils.bind(this, function()
|
||||
{
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
var file = this.getCurrentFile();
|
||||
|
||||
if (file != null)
|
||||
{
|
||||
file.fileChanged();
|
||||
|
||||
if (success != null)
|
||||
{
|
||||
success();
|
||||
}
|
||||
}
|
||||
}), 0);
|
||||
}), null, null, true);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks for orphaned drafts.
|
||||
*/
|
||||
App.prototype.checkDrafts = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Triggers storage event for other windows to mark active drafts
|
||||
var guid = Editor.guid();
|
||||
localStorage.setItem('.draft-alive-check', guid);
|
||||
|
||||
window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
localStorage.removeItem('.draft-alive-check');
|
||||
|
||||
this.getDatabaseItems(mxUtils.bind(this, function(items)
|
||||
{
|
||||
// Collects orphaned drafts
|
||||
var drafts = [];
|
||||
|
||||
for (var i = 0; i < items.length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
var key = items[i].key;
|
||||
|
||||
if (key != null && key.substring(0, 7) == '.draft_')
|
||||
{
|
||||
var obj = JSON.parse(items[i].data);
|
||||
|
||||
if (obj != null && obj.type == 'draft' && obj.aliveCheck != guid)
|
||||
{
|
||||
obj.key = key;
|
||||
drafts.push(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
if (drafts.length == 1)
|
||||
{
|
||||
this.loadDraft(drafts[0].data, mxUtils.bind(this, function()
|
||||
{
|
||||
this.removeDatabaseItem(drafts[0].key);
|
||||
}));
|
||||
}
|
||||
else if (drafts.length > 1)
|
||||
{
|
||||
var ts = new Date(drafts[0].modified);
|
||||
|
||||
var dlg = new DraftDialog(this, (drafts.length > 1) ? mxResources.get('selectDraft') :
|
||||
mxResources.get('draftFound', [ts.toLocaleDateString() + ' ' + ts.toLocaleTimeString()]),
|
||||
(drafts.length > 1) ? null : drafts[0].data, mxUtils.bind(this, function(index)
|
||||
{
|
||||
this.hideDialog();
|
||||
index = (index != '') ? index : 0;
|
||||
|
||||
this.loadDraft(drafts[index].data, mxUtils.bind(this, function()
|
||||
{
|
||||
this.removeDatabaseItem(drafts[index].key);
|
||||
}));
|
||||
}), mxUtils.bind(this, function(index, success)
|
||||
{
|
||||
index = (index != '') ? index : 0;
|
||||
|
||||
// Discard draft
|
||||
this.confirm(mxResources.get('areYouSure'), null, mxUtils.bind(this, function()
|
||||
{
|
||||
this.removeDatabaseItem(drafts[index].key);
|
||||
|
||||
if (success != null)
|
||||
{
|
||||
success();
|
||||
}
|
||||
}), mxResources.get('no'), mxResources.get('yes'));
|
||||
}), null, null, null, (drafts.length > 1) ? drafts : null);
|
||||
this.showDialog(dlg.container, 640, 480, true, false, mxUtils.bind(this, function(cancel)
|
||||
{
|
||||
if (urlParams['splash'] == '0')
|
||||
{
|
||||
this.createFile(this.defaultFilename, this.getFileData(), null, null, null, null, null, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.loadFile();
|
||||
}
|
||||
}));
|
||||
dlg.init();
|
||||
}
|
||||
else if (urlParams['splash'] != '0')
|
||||
{
|
||||
this.loadFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.createFile(this.defaultFilename, this.getFileData(), null, null, null, null, null, true);
|
||||
}
|
||||
}), mxUtils.bind(this, function()
|
||||
{
|
||||
if (urlParams['splash'] != '0')
|
||||
{
|
||||
this.loadFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.createFile(this.defaultFilename, this.getFileData(), null, null, null, null, null, true);
|
||||
}
|
||||
}));
|
||||
}), 0);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Translates this point by the given vector.
|
||||
*
|
||||
|
@ -3249,6 +3376,11 @@ App.prototype.showSplash = function(force)
|
|||
Editor.useLocalStorage = prev;
|
||||
}
|
||||
}), true);
|
||||
|
||||
if (this.mode == App.MODE_DEVICE || this.mode == App.MODE_BROWSER)
|
||||
{
|
||||
this.showDownloadDesktopFooter();
|
||||
}
|
||||
});
|
||||
|
||||
if (this.editor.isChromelessView())
|
||||
|
@ -3789,7 +3921,10 @@ App.prototype.saveFile = function(forceDialog, success)
|
|||
// FIXME: Invoke for local files
|
||||
var done = mxUtils.bind(this, function()
|
||||
{
|
||||
this.removeDraft();
|
||||
if (EditorUi.enableDrafts)
|
||||
{
|
||||
file.removeDraft();
|
||||
}
|
||||
|
||||
if (this.getCurrentFile() != file && !file.isModified())
|
||||
{
|
||||
|
@ -5491,7 +5626,7 @@ App.prototype.showAuthDialog = function(peer, showRememberOption, fn, closeFn)
|
|||
* readXml argument is used for import. Default is false. The optional
|
||||
* readLibrary argument is used for reading libraries. Default is false.
|
||||
*/
|
||||
App.prototype.convertFile = function(url, filename, mimeType, extension, success, error, executeRequest)
|
||||
App.prototype.convertFile = function(url, filename, mimeType, extension, success, error, executeRequest, headers)
|
||||
{
|
||||
var name = filename;
|
||||
|
||||
|
@ -5520,6 +5655,14 @@ App.prototype.convertFile = function(url, filename, mimeType, extension, success
|
|||
req.responseType = 'blob';
|
||||
}
|
||||
|
||||
if (headers)
|
||||
{
|
||||
for (var key in headers)
|
||||
{
|
||||
req.setRequestHeader(key, headers[key]);
|
||||
}
|
||||
}
|
||||
|
||||
req.onload = mxUtils.bind(this, function()
|
||||
{
|
||||
if (req.status >= 200 && req.status <= 299)
|
||||
|
@ -5662,7 +5805,7 @@ App.prototype.convertFile = function(url, filename, mimeType, extension, success
|
|||
{
|
||||
error({code: App.ERROR_TIMEOUT, retry: fn});
|
||||
}
|
||||
});
|
||||
}, headers);
|
||||
}
|
||||
else if (executeRequest != null)
|
||||
{
|
||||
|
@ -5670,7 +5813,7 @@ App.prototype.convertFile = function(url, filename, mimeType, extension, success
|
|||
}
|
||||
else
|
||||
{
|
||||
this.loadUrl(url, handleData, error, binary);
|
||||
this.loadUrl(url, handleData, error, binary, null, null, null, headers);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -157,5 +157,5 @@ if (urlParams['orgLayout'] == '1')
|
|||
mxscript(drawDevUrl + 'js/orgchart/bridge.min.js');
|
||||
mxscript(drawDevUrl + 'js/orgchart/bridge.collections.min.js');
|
||||
mxscript(drawDevUrl + 'js/orgchart/OrgChart.Layout.min.js');
|
||||
mxscript(drawDevUrl + 'js/orgchart/mxOrgChart.js');
|
||||
mxscript(drawDevUrl + 'js/orgchart/mxOrgChartLayout.js');
|
||||
}
|
||||
|
|
|
@ -5878,7 +5878,7 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
|
|||
/**
|
||||
* Constructs a new revision dialog
|
||||
*/
|
||||
var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, discardLabel, ignoreFn)
|
||||
var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, discardLabel, ignoreFn, drafts)
|
||||
{
|
||||
var div = document.createElement('div');
|
||||
|
||||
|
@ -5886,9 +5886,51 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
|
|||
titleDiv.style.marginTop = '0px';
|
||||
titleDiv.style.whiteSpace = 'nowrap';
|
||||
titleDiv.style.overflow = 'auto';
|
||||
titleDiv.style.lineHeight = 'normal';
|
||||
mxUtils.write(titleDiv, title);
|
||||
div.appendChild(titleDiv);
|
||||
|
||||
var select = document.createElement('select');
|
||||
|
||||
var draftSelected = mxUtils.bind(this, function()
|
||||
{
|
||||
doc = mxUtils.parseXml(drafts[select.value].data);
|
||||
node = editorUi.editor.extractGraphModel(doc.documentElement, true);
|
||||
currentPage = 0;
|
||||
|
||||
this.init();
|
||||
});
|
||||
|
||||
if (drafts != null)
|
||||
{
|
||||
select.style.marginLeft = '4px';
|
||||
|
||||
for (var i = 0; i < drafts.length; i++)
|
||||
{
|
||||
var opt = document.createElement('option');
|
||||
opt.setAttribute('value', i);
|
||||
var ts0 = new Date(drafts[i].created);
|
||||
var ts1 = new Date(drafts[i].modified);
|
||||
|
||||
mxUtils.write(opt, ts0.toLocaleDateString() + ' ' +
|
||||
ts0.toLocaleTimeString() + ' - ' +
|
||||
((ts0.toDateString() != ts1.toDateString() || true) ?
|
||||
ts1.toLocaleDateString() : ' ') +
|
||||
' ' + ts1.toLocaleTimeString());
|
||||
|
||||
select.appendChild(opt);
|
||||
}
|
||||
|
||||
titleDiv.appendChild(select);
|
||||
|
||||
mxEvent.addListener(select, 'change', draftSelected);
|
||||
}
|
||||
|
||||
if (xml == null)
|
||||
{
|
||||
xml = drafts[0].data;
|
||||
}
|
||||
|
||||
var container = document.createElement('div');
|
||||
container.style.position = 'absolute';
|
||||
container.style.border = '1px solid lightGray';
|
||||
|
@ -6003,7 +6045,26 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
|
|||
zoomActualBtn.style.margin = '2px';
|
||||
mxUtils.setOpacity(zoomActualBtn, 60);
|
||||
|
||||
var restoreBtn = mxUtils.button(discardLabel || mxResources.get('discard'), discardFn);
|
||||
var restoreBtn = mxUtils.button(discardLabel || mxResources.get('discard'), function()
|
||||
{
|
||||
discardFn.apply(this, [select.value, mxUtils.bind(this, function()
|
||||
{
|
||||
if (select.parentNode != null)
|
||||
{
|
||||
select.options[select.selectedIndex].parentNode.removeChild(select.options[select.selectedIndex]);
|
||||
|
||||
if (select.options.length > 0)
|
||||
{
|
||||
select.value = select.options[0].value;
|
||||
draftSelected();
|
||||
}
|
||||
else
|
||||
{
|
||||
editorUi.hideDialog(true);
|
||||
}
|
||||
}
|
||||
})]);
|
||||
});
|
||||
restoreBtn.className = 'geBtn';
|
||||
|
||||
var pageSelect = document.createElement('select');
|
||||
|
@ -6014,7 +6075,10 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
|
|||
pageSelect.style.marginRight = '6px';
|
||||
pageSelect.style.display = 'none';
|
||||
|
||||
var showBtn = mxUtils.button(editLabel || mxResources.get('edit'), editFn);
|
||||
var showBtn = mxUtils.button(editLabel || mxResources.get('edit'), function()
|
||||
{
|
||||
editFn.apply(this, [select.value])
|
||||
});
|
||||
showBtn.className = 'geBtn gePrimaryBtn';
|
||||
|
||||
var buttons = document.createElement('div');
|
||||
|
@ -6085,6 +6149,8 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
|
|||
parseDiagram(diagrams[currentPage]);
|
||||
}
|
||||
|
||||
pageSelect.innerHTML = '';
|
||||
|
||||
if (diagrams.length > 1)
|
||||
{
|
||||
pageSelect.style.display = '';
|
||||
|
@ -6104,6 +6170,10 @@ var DraftDialog = function(editorUi, title, xml, editFn, discardFn, editLabel, d
|
|||
pageSelect.appendChild(pageOption);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pageSelect.style.display = 'none';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8453,7 +8523,7 @@ var LibraryDialog = function(editorUi, name, library, initialImages, file, mode)
|
|||
else
|
||||
{
|
||||
addButton(data, mimeType, x, y, w, h, img, 'fixed', (mxEvent.isAltDown(evt)) ?
|
||||
null : img.substring(0, img.lastIndexOf('.')).replace(/_/g, ' '));
|
||||
null : img.substring(0, img.lastIndexOf('.')).replace(/_/g, ' '));
|
||||
div.scrollTop = div.scrollHeight;
|
||||
}
|
||||
};
|
||||
|
@ -8462,17 +8532,16 @@ var LibraryDialog = function(editorUi, name, library, initialImages, file, mode)
|
|||
function dropHandler(evt)
|
||||
{
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
errorShowed = false;
|
||||
evt.preventDefault();
|
||||
errorShowed = false;
|
||||
dropTargetIndex = getIndexForEvent(evt);
|
||||
|
||||
dropTargetIndex = getIndexForEvent(evt);
|
||||
|
||||
if (dragSourceIndex != null)
|
||||
if (dragSourceIndex != null)
|
||||
{
|
||||
if (dropTargetIndex != null && dropTargetIndex < div.children.length)
|
||||
{
|
||||
if (dropTargetIndex != null && dropTargetIndex < div.children.length)
|
||||
{
|
||||
images.splice((dropTargetIndex > dragSourceIndex) ? dropTargetIndex - 1 : dropTargetIndex,
|
||||
0, images.splice(dragSourceIndex, 1)[0]);
|
||||
0, images.splice(dragSourceIndex, 1)[0]);
|
||||
div.insertBefore(div.children[dragSourceIndex], div.children[dropTargetIndex]);
|
||||
}
|
||||
else
|
||||
|
@ -8481,13 +8550,13 @@ var LibraryDialog = function(editorUi, name, library, initialImages, file, mode)
|
|||
div.appendChild(div.children[dragSourceIndex]);
|
||||
}
|
||||
}
|
||||
else if (evt.dataTransfer.files.length > 0)
|
||||
{
|
||||
editorUi.importFiles(evt.dataTransfer.files, 0, 0, editorUi.maxImageSize, createImportHandler(evt));
|
||||
else if (evt.dataTransfer.files.length > 0)
|
||||
{
|
||||
editorUi.importFiles(evt.dataTransfer.files, 0, 0, editorUi.maxImageSize, createImportHandler(evt));
|
||||
}
|
||||
else if (mxUtils.indexOf(evt.dataTransfer.types, 'text/uri-list') >= 0)
|
||||
{
|
||||
var uri = decodeURIComponent(evt.dataTransfer.getData('text/uri-list'));
|
||||
else if (mxUtils.indexOf(evt.dataTransfer.types, 'text/uri-list') >= 0)
|
||||
{
|
||||
var uri = decodeURIComponent(evt.dataTransfer.getData('text/uri-list'));
|
||||
|
||||
if (/(\.jpg)($|\?)/i.test(uri) || /(\.png)($|\?)/i.test(uri) ||
|
||||
/(\.gif)($|\?)/i.test(uri) || /(\.svg)($|\?)/i.test(uri))
|
||||
|
@ -8498,10 +8567,10 @@ var LibraryDialog = function(editorUi, name, library, initialImages, file, mode)
|
|||
div.scrollTop = div.scrollHeight;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
};
|
||||
|
||||
mxEvent.addListener(div, 'dragover', dragOver);
|
||||
|
|
|
@ -21,6 +21,7 @@ DrawioFile = function(ui, data)
|
|||
this.data = data || '';
|
||||
this.shadowData = this.data;
|
||||
this.shadowPages = null;
|
||||
this.created = new Date().getTime();
|
||||
|
||||
// Creates the stats object
|
||||
this.stats = {
|
||||
|
@ -1362,6 +1363,57 @@ DrawioFile.prototype.addAllSavedStatus = function(status)
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the listener for automatically saving the diagram for local changes.
|
||||
*/
|
||||
DrawioFile.prototype.saveDraft = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.draftId == null)
|
||||
{
|
||||
this.draftId = Editor.guid();
|
||||
}
|
||||
|
||||
var draft = {type: 'draft',
|
||||
created: this.created,
|
||||
modified: new Date().getTime(),
|
||||
data: this.ui.getFileData(),
|
||||
title: this.getTitle(),
|
||||
aliveCheck: this.ui.draftAliveCheck};
|
||||
this.ui.setDatabaseItem('.draft_' + this.draftId,
|
||||
JSON.stringify(draft));
|
||||
|
||||
EditorUi.debug('draft saved', this.draftId, draft);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.error(e);
|
||||
|
||||
// Removes any stored draft
|
||||
this.removeDraft();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the listener for automatically saving the diagram for local changes.
|
||||
*/
|
||||
DrawioFile.prototype.removeDraft = function()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.draftId != null)
|
||||
{
|
||||
this.ui.removeDatabaseItem('.draft_' + this.draftId);
|
||||
EditorUi.debug('draft deleted', '.draft_' + this.draftId);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds the listener for automatically saving the diagram for local changes.
|
||||
*/
|
||||
|
@ -1379,19 +1431,6 @@ DrawioFile.prototype.addUnsavedStatus = function(err)
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Handle multiple tabs
|
||||
// if (this.ui.mode == null && urlParams['splash'] == '0')
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// this.ui.updateDraft();
|
||||
// this.setModified(false);
|
||||
// }
|
||||
// catch (e)
|
||||
// {
|
||||
// // Keeps modified flag unchanged
|
||||
// }
|
||||
// }
|
||||
var msg = this.getErrorMessage(err);
|
||||
|
||||
if (msg == null && this.lastSaved != null)
|
||||
|
@ -1435,6 +1474,11 @@ DrawioFile.prototype.addUnsavedStatus = function(err)
|
|||
'" class="geStatusAlert" style="overflow:hidden;">' + status +
|
||||
' (' + mxUtils.htmlEntities(err.message) + ')</div>');
|
||||
}
|
||||
|
||||
if (EditorUi.enableDrafts)
|
||||
{
|
||||
this.saveDraft();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -779,7 +779,8 @@ DriveClient.prototype.updateUser = function(success, error)
|
|||
{
|
||||
try
|
||||
{
|
||||
var url = 'https://www.googleapis.com/oauth2/v2/userinfo?alt=json&access_token=' + this.token;
|
||||
var url = 'https://www.googleapis.com/oauth2/v2/userinfo?alt=json';
|
||||
var headers = {'Authorization': 'Bearer ' + this.token};
|
||||
|
||||
this.ui.loadUrl(url, mxUtils.bind(this, function(data)
|
||||
{
|
||||
|
@ -807,7 +808,7 @@ DriveClient.prototype.updateUser = function(success, error)
|
|||
success();
|
||||
}
|
||||
}), error);
|
||||
}), error);
|
||||
}), error, null, null, null, null, headers);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
@ -972,8 +973,10 @@ DriveClient.prototype.getFile = function(id, success, error, readXml, readLibrar
|
|||
if (/\.v(dx|sdx?)$/i.test(resp.title) || /\.gliffy$/i.test(resp.title) ||
|
||||
(!this.ui.useCanvasForExport && binary))
|
||||
{
|
||||
var url = resp.downloadUrl + '&access_token=' + this.token;
|
||||
this.ui.convertFile(url, resp.title, resp.mimeType, this.extension, success, error);
|
||||
var url = resp.downloadUrl;
|
||||
var headers = {'Authorization': 'Bearer ' + this.token};
|
||||
|
||||
this.ui.convertFile(url, resp.title, resp.mimeType, this.extension, success, error, null, headers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1026,7 +1029,8 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
|
|||
{
|
||||
try
|
||||
{
|
||||
var url = resp.downloadUrl + '&access_token=' + this.token;
|
||||
var headers = {'Authorization': 'Bearer ' + this.token};
|
||||
var url = resp.downloadUrl;
|
||||
|
||||
// Loads XML to initialize realtime document if realtime is empty
|
||||
this.ui.loadUrl(url, mxUtils.bind(this, function(data)
|
||||
|
@ -1161,7 +1165,8 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
|
|||
}
|
||||
}), error, ((resp.mimeType != null && resp.mimeType.substring(0, 6) == 'image/' &&
|
||||
resp.mimeType.substring(0, 9) != 'image/svg')) || /\.png$/i.test(resp.title) ||
|
||||
/\.jpe?g$/i.test(resp.title) || /\.pdf$/i.test(resp.title));
|
||||
/\.jpe?g$/i.test(resp.title) || /\.pdf$/i.test(resp.title),
|
||||
null, null, null, headers);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
|
@ -1363,7 +1368,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
try
|
||||
{
|
||||
file.saveDelay = new Date().getTime() - t0;
|
||||
file.saveLevel = 17;
|
||||
file.saveLevel = 11;
|
||||
|
||||
if (resp == null)
|
||||
{
|
||||
|
@ -1376,7 +1381,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
|
||||
if (delta <= 0 || etag0 == resp.etag || (revision && head0 == resp.headRevisionId))
|
||||
{
|
||||
file.saveLevel = 18;
|
||||
file.saveLevel = 12;
|
||||
var reasons = [];
|
||||
|
||||
if (delta <= 0)
|
||||
|
@ -1502,13 +1507,21 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
var unknown = file.desc.mimeType != this.xmlMimeType && file.desc.mimeType != this.mimeType &&
|
||||
file.desc.mimeType != this.libraryMimeType;
|
||||
var acceptResponse = true;
|
||||
var timeoutThread = null;
|
||||
|
||||
// Allow for re-auth flow with 3x timeout
|
||||
var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
try
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
|
||||
}), 3 * this.ui.timeout);
|
||||
timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
|
||||
}), 3 * this.ui.timeout);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// Ignore window closed
|
||||
}
|
||||
|
||||
this.executeRequest(this.createUploadRequest(file.getId(), meta,
|
||||
data, revision || realOverwrite || unknown, binary,
|
||||
|
@ -1631,24 +1644,26 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
|
||||
if (realOverwrite)
|
||||
{
|
||||
file.saveLevel = 14;
|
||||
doExecuteSave(realOverwrite);
|
||||
}
|
||||
else
|
||||
{
|
||||
file.saveLevel = 15;
|
||||
var acceptResponse = true;
|
||||
file.saveLevel = 16;
|
||||
var timeoutThread = null;
|
||||
|
||||
// Allow for re-auth flow with 3x timeout
|
||||
var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
try
|
||||
{
|
||||
file.saveLevel = 11;
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
|
||||
}), 3 * this.ui.timeout);
|
||||
|
||||
file.saveLevel = 10;
|
||||
timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
|
||||
}), 3 * this.ui.timeout);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// Ignore window closed
|
||||
}
|
||||
|
||||
this.executeRequest({
|
||||
url: '/files/' + file.getId() + '?supportsTeamDrives=true&fields=' + this.catchupFields
|
||||
|
@ -1659,7 +1674,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
|
||||
if (acceptResponse)
|
||||
{
|
||||
file.saveLevel = 12;
|
||||
file.saveLevel = 10;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -1694,7 +1709,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
|
|||
|
||||
if (acceptResponse)
|
||||
{
|
||||
file.saveLevel = 13;
|
||||
file.saveLevel = 11;
|
||||
error(err);
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -78,6 +78,12 @@
|
|||
EditorUi.isElectronApp = window != null && window.process != null &&
|
||||
window.process.versions != null && window.process.versions['electron'] != null;
|
||||
|
||||
/**
|
||||
* Specifies if drafts should be saved in IndexedDB.
|
||||
*/
|
||||
EditorUi.enableDrafts = !mxClient.IS_CHROMEAPP && isLocalStorage &&
|
||||
!EditorUi.isElectronApp && urlParams['drafts'] != '0';
|
||||
|
||||
/**
|
||||
* Link for scratchpad help.
|
||||
*/
|
||||
|
@ -2841,14 +2847,14 @@
|
|||
* @param {number} dx X-coordinate of the translation.
|
||||
* @param {number} dy Y-coordinate of the translation.
|
||||
*/
|
||||
EditorUi.prototype.loadLibrary = function(file)
|
||||
EditorUi.prototype.loadLibrary = function(file, expand)
|
||||
{
|
||||
var doc = mxUtils.parseXml(file.getData());
|
||||
|
||||
if (doc.documentElement.nodeName == 'mxlibrary')
|
||||
{
|
||||
var images = JSON.parse(mxUtils.getTextContent(doc.documentElement));
|
||||
this.libraryLoaded(file, images, doc.documentElement.getAttribute('title'));
|
||||
this.libraryLoaded(file, images, doc.documentElement.getAttribute('title'), expand);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2873,7 +2879,7 @@
|
|||
* @param {number} dx X-coordinate of the translation.
|
||||
* @param {number} dy Y-coordinate of the translation.
|
||||
*/
|
||||
EditorUi.prototype.libraryLoaded = function(file, images, optionalTitle)
|
||||
EditorUi.prototype.libraryLoaded = function(file, images, optionalTitle, expand)
|
||||
{
|
||||
if (this.sidebar == null)
|
||||
{
|
||||
|
@ -2925,7 +2931,8 @@
|
|||
|
||||
// Adds new sidebar entry for this library
|
||||
var tmp = (optionalTitle != null && optionalTitle.length > 0) ? optionalTitle : file.getTitle();
|
||||
var contentDiv = this.sidebar.addPalette(file.getHash(), tmp, true, mxUtils.bind(this, function(content)
|
||||
var contentDiv = this.sidebar.addPalette(file.getHash(), tmp,
|
||||
(expand != null) ? expand : true, mxUtils.bind(this, function(content)
|
||||
{
|
||||
addImages(images, content);
|
||||
}));
|
||||
|
@ -2950,7 +2957,7 @@
|
|||
// Workaround for CSS error in IE8 (standards and quirks)
|
||||
if (!mxClient.IS_QUIRKS && document.documentMode != 8)
|
||||
{
|
||||
buttons.style.backgroundColor = 'inherit';
|
||||
buttons.style.backgroundColor = 'inherit';
|
||||
}
|
||||
|
||||
title.style.position = 'relative';
|
||||
|
@ -3209,7 +3216,7 @@
|
|||
{
|
||||
if (data != null && mimeType.substring(0, 6) == 'image/')
|
||||
{
|
||||
var style = 'shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image=' +
|
||||
var style = 'shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image=' +
|
||||
this.convertDataUri(data);
|
||||
var cells = [new mxCell('', new mxGeometry(0, 0, w, h), style)];
|
||||
cells[0].vertex = true;
|
||||
|
@ -6835,7 +6842,7 @@
|
|||
/**
|
||||
* Checks if the client is authorized and calls the next step.
|
||||
*/
|
||||
EditorUi.prototype.loadUrl = function(url, success, error, forceBinary, retry, dataUriPrefix, noBinary)
|
||||
EditorUi.prototype.loadUrl = function(url, success, error, forceBinary, retry, dataUriPrefix, noBinary, headers)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -6883,7 +6890,15 @@
|
|||
}
|
||||
else if (error != null)
|
||||
{
|
||||
error({message: mxResources.get('error') + ' ' + req.getStatus()}, req);
|
||||
if (req.getStatus() == 0)
|
||||
{
|
||||
// Handles CORS errors
|
||||
error({message: mxResources.get('accessDenied')}, req);
|
||||
}
|
||||
else
|
||||
{
|
||||
error({message: mxResources.get('error') + ' ' + req.getStatus()}, req);
|
||||
}
|
||||
}
|
||||
}), function(req)
|
||||
{
|
||||
|
@ -6897,7 +6912,7 @@
|
|||
{
|
||||
error({code: App.ERROR_TIMEOUT, retry: fn});
|
||||
}
|
||||
});
|
||||
}, headers);
|
||||
});
|
||||
|
||||
fn();
|
||||
|
@ -13542,10 +13557,106 @@
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Comments: We need these functions as wrapper of File functions in order to facilitate overriding them if comments are needed without having a file
|
||||
* (e.g. Confluence Plugin)
|
||||
*
|
||||
* Opens the application keystore.
|
||||
*/
|
||||
EditorUi.prototype.openDatabase = function(success, error)
|
||||
{
|
||||
if (this.database == null)
|
||||
{
|
||||
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB;
|
||||
|
||||
if (indexedDB != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var req = indexedDB.open('database', '1.0');
|
||||
|
||||
req.onupgradeneeded = function(e)
|
||||
{
|
||||
e.target.result.createObjectStore('objects', {keyPath: 'key'});
|
||||
}
|
||||
|
||||
req.onsuccess = mxUtils.bind(this, function(e)
|
||||
{
|
||||
this.database = e.target.result;
|
||||
success(this.database);
|
||||
});
|
||||
|
||||
req.onerror = error;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
error(e);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
success(this.database);
|
||||
}
|
||||
};
|
||||
|
||||
EditorUi.prototype.setDatabaseItem = function(key, data, success, error)
|
||||
{
|
||||
this.openDatabase(mxUtils.bind(this, function(db)
|
||||
{
|
||||
var trx = db.transaction(['objects'], 'readwrite');
|
||||
var req = trx.objectStore('objects').put({key: key, data: data});
|
||||
req.onsuccess = success;
|
||||
req.onerror = error;
|
||||
}), error);
|
||||
};
|
||||
|
||||
/**
|
||||
* Removes the item for the given key from the database.
|
||||
*/
|
||||
EditorUi.prototype.removeDatabaseItem = function(key, success, error)
|
||||
{
|
||||
this.openDatabase(mxUtils.bind(this, function(db)
|
||||
{
|
||||
var trx = db.transaction(['objects'], 'readwrite');
|
||||
var req = trx.objectStore('objects').delete(key);
|
||||
req.onsuccess = success;
|
||||
req.onerror = error;
|
||||
}), error);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns all items from the database.
|
||||
*/
|
||||
EditorUi.prototype.getDatabaseItems = function(success, error)
|
||||
{
|
||||
this.openDatabase(mxUtils.bind(this, function(db)
|
||||
{
|
||||
var trx = db.transaction(['objects'], 'readwrite');
|
||||
var req = trx.objectStore('objects').openCursor(
|
||||
IDBKeyRange.lowerBound(0));
|
||||
var items = [];
|
||||
|
||||
req.onsuccess = function(e)
|
||||
{
|
||||
if (e.target.result == null)
|
||||
{
|
||||
success(items);
|
||||
}
|
||||
else
|
||||
{
|
||||
items.push(e.target.result.value);
|
||||
e.target.result.continue();
|
||||
}
|
||||
};
|
||||
|
||||
req.onerror = error;
|
||||
}), error);
|
||||
};
|
||||
|
||||
/**
|
||||
* Comments: We need these functions as wrapper of File functions in order to facilitate
|
||||
* overriding them if comments are needed without having a file (e.g. Confluence Plugin)
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -413,12 +413,12 @@ GitHubClient.prototype.getFile = function(path, success, error, asLibrary, check
|
|||
// Should never be null
|
||||
if (this.token != null)
|
||||
{
|
||||
var url = this.baseUrl + '/repos/' + org + '/' + repo + '/contents/' +
|
||||
path + '?ref=' + ref + '&token=' + this.token;
|
||||
var url = this.baseUrl + '/repos/' + org + '/' + repo +
|
||||
'/contents/' + path + '?ref=' + ref;
|
||||
var headers = {'Authorization': 'token ' + this.token};
|
||||
tokens = path.split('/');
|
||||
var name = (tokens.length > 0) ? tokens[tokens.length - 1] : path;
|
||||
|
||||
this.ui.convertFile(url, name, null, this.extension, success, error);
|
||||
this.ui.convertFile(url, name, null, this.extension, success, error, null, headers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -550,6 +550,10 @@ GraphViewer.prototype.addSizeHandler = function()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (this.toolbar != null)
|
||||
{
|
||||
this.toolbar.style.width = Math.max(this.minToolbarWidth, container.offsetWidth) + 'px';
|
||||
}
|
||||
|
||||
updatingOverflow = false;
|
||||
}
|
||||
|
|
|
@ -381,6 +381,11 @@
|
|||
|
||||
function fn()
|
||||
{
|
||||
if (currentFile != null)
|
||||
{
|
||||
currentFile.removeDraft();
|
||||
}
|
||||
|
||||
editorUi.fileLoaded(null);
|
||||
};
|
||||
|
||||
|
@ -1024,7 +1029,9 @@
|
|||
{
|
||||
menu.addItem('Org. Chart', null, function()
|
||||
{
|
||||
mxOrgChart(editorUi);
|
||||
var graph = editorUi.editor.graph;
|
||||
var orgChartLayout = new mxOrgChartLayout(graph);
|
||||
orgChartLayout.execute(graph.getDefaultParent());
|
||||
}, parent, null, isGraphEnabled());
|
||||
}
|
||||
|
||||
|
|
|
@ -911,12 +911,20 @@ OneDriveClient.prototype.writeFile = function(url, data, method, contentType, su
|
|||
try
|
||||
{
|
||||
var acceptResponse = true;
|
||||
var timeoutThread = null;
|
||||
|
||||
var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
try
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, retry: doExecute});
|
||||
}), this.ui.timeout);
|
||||
timeoutThread = window.setTimeout(mxUtils.bind(this, function()
|
||||
{
|
||||
acceptResponse = false;
|
||||
error({code: App.ERROR_TIMEOUT, retry: doExecute});
|
||||
}), this.ui.timeout);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// Ignore window closed
|
||||
}
|
||||
|
||||
var req = new mxXmlRequest(url, data, method);
|
||||
|
||||
|
|
|
@ -252,103 +252,96 @@ var mxSettings =
|
|||
},
|
||||
parse: function(value)
|
||||
{
|
||||
if (value != null)
|
||||
var config = (value != null) ? JSON.parse(value) : null;
|
||||
|
||||
if (config == null || (config.configVersion != Editor.configVersion) ||
|
||||
(Editor.config != null && Editor.config.override))
|
||||
{
|
||||
var temp = JSON.parse(value);
|
||||
mxSettings.settings = null;
|
||||
mxSettings.init();
|
||||
}
|
||||
else
|
||||
{
|
||||
mxSettings.settings = config;
|
||||
|
||||
if (temp == null || (Editor.config != null && Editor.config.override) ||
|
||||
temp.configVersion != Editor.configVersion)
|
||||
if (mxSettings.settings.plugins == null)
|
||||
{
|
||||
mxSettings.settings = null;
|
||||
mxSettings.settings.plugins = [];
|
||||
}
|
||||
else
|
||||
|
||||
if (mxSettings.settings.recentColors == null)
|
||||
{
|
||||
mxSettings.settings = temp;
|
||||
mxSettings.settings.recentColors = [];
|
||||
}
|
||||
|
||||
if (mxSettings.settings.plugins == null)
|
||||
{
|
||||
mxSettings.settings.plugins = [];
|
||||
}
|
||||
if (mxSettings.settings.customFonts == null)
|
||||
{
|
||||
mxSettings.settings.customFonts = [];
|
||||
}
|
||||
|
||||
if (mxSettings.settings.recentColors == null)
|
||||
{
|
||||
mxSettings.settings.recentColors = [];
|
||||
}
|
||||
if (mxSettings.settings.libraries == null)
|
||||
{
|
||||
mxSettings.settings.libraries = Sidebar.prototype.defaultEntries;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.customFonts == null)
|
||||
{
|
||||
mxSettings.settings.customFonts = [];
|
||||
}
|
||||
if (mxSettings.settings.customLibraries == null)
|
||||
{
|
||||
mxSettings.settings.customLibraries = Editor.defaultCustomLibraries;
|
||||
}
|
||||
|
||||
// Newer configuration versions overwrite the default libraries
|
||||
if (Editor.config != null && temp.configVersion != Editor.configVersion)
|
||||
{
|
||||
mxSettings.settings.libraries = Sidebar.prototype.defaultEntries;
|
||||
}
|
||||
else if (mxSettings.settings.libraries == null)
|
||||
{
|
||||
mxSettings.settings.libraries = Sidebar.prototype.defaultEntries;
|
||||
}
|
||||
if (mxSettings.settings.ui == null)
|
||||
{
|
||||
mxSettings.settings.ui = '';
|
||||
}
|
||||
|
||||
if (mxSettings.settings.customLibraries == null)
|
||||
{
|
||||
mxSettings.settings.customLibraries = Editor.defaultCustomLibraries;
|
||||
}
|
||||
if (mxSettings.settings.formatWidth == null)
|
||||
{
|
||||
mxSettings.settings.formatWidth = mxSettings.defaultFormatWidth;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.ui == null)
|
||||
{
|
||||
mxSettings.settings.ui = '';
|
||||
}
|
||||
if (mxSettings.settings.lastAlert != null)
|
||||
{
|
||||
delete mxSettings.settings.lastAlert;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.formatWidth == null)
|
||||
{
|
||||
mxSettings.settings.formatWidth = mxSettings.defaultFormatWidth;
|
||||
}
|
||||
if (mxSettings.settings.createTarget == null)
|
||||
{
|
||||
mxSettings.settings.createTarget = false;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.lastAlert != null)
|
||||
{
|
||||
delete mxSettings.settings.lastAlert;
|
||||
}
|
||||
if (mxSettings.settings.pageFormat == null)
|
||||
{
|
||||
mxSettings.settings.pageFormat = mxGraph.prototype.pageFormat;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.createTarget == null)
|
||||
{
|
||||
mxSettings.settings.createTarget = false;
|
||||
}
|
||||
if (mxSettings.settings.search == null)
|
||||
{
|
||||
mxSettings.settings.search = true;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.pageFormat == null)
|
||||
{
|
||||
mxSettings.settings.pageFormat = mxGraph.prototype.pageFormat;
|
||||
}
|
||||
if (mxSettings.settings.showStartScreen == null)
|
||||
{
|
||||
mxSettings.settings.showStartScreen = true;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.search == null)
|
||||
{
|
||||
mxSettings.settings.search = true;
|
||||
}
|
||||
if (mxSettings.settings.gridColor == null)
|
||||
{
|
||||
mxSettings.settings.gridColor = mxGraphView.prototype.defaultGridColor;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.showStartScreen == null)
|
||||
{
|
||||
mxSettings.settings.showStartScreen = true;
|
||||
}
|
||||
if (mxSettings.settings.darkGridColor == null)
|
||||
{
|
||||
mxSettings.settings.darkGridColor = mxGraphView.prototype.defaultDarkGridColor;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.gridColor == null)
|
||||
{
|
||||
mxSettings.settings.gridColor = mxGraphView.prototype.defaultGridColor;
|
||||
}
|
||||
if (mxSettings.settings.autosave == null)
|
||||
{
|
||||
mxSettings.settings.autosave = true;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.darkGridColor == null)
|
||||
{
|
||||
mxSettings.settings.darkGridColor = mxGraphView.prototype.defaultDarkGridColor;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.autosave == null)
|
||||
{
|
||||
mxSettings.settings.autosave = true;
|
||||
}
|
||||
|
||||
if (mxSettings.settings.scratchpadSeen != null)
|
||||
{
|
||||
delete mxSettings.settings.scratchpadSeen;
|
||||
}
|
||||
if (mxSettings.settings.scratchpadSeen != null)
|
||||
{
|
||||
delete mxSettings.settings.scratchpadSeen;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -101,6 +101,11 @@
|
|||
*/
|
||||
Sidebar.prototype.enabledLibraries = null;
|
||||
|
||||
/**
|
||||
* Maximum number of custom libraries to preload into the search index.
|
||||
*/
|
||||
Sidebar.prototype.maxPreloadCount = 20;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -246,7 +251,6 @@
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Shows or hides a palette.
|
||||
*/
|
||||
|
@ -738,6 +742,8 @@
|
|||
// Adds custom sections first
|
||||
if (this.customEntries != null)
|
||||
{
|
||||
var preloadCount = 0;
|
||||
|
||||
for (var i = 0; i < this.customEntries.length; i++)
|
||||
{
|
||||
var section = this.customEntries[i];
|
||||
|
@ -750,35 +756,64 @@
|
|||
{
|
||||
(mxUtils.bind(this, function(lib)
|
||||
{
|
||||
this.addPalette(entry.id + '.' + k, this.editorUi.getResource(lib.title),
|
||||
false, mxUtils.bind(this, function(content, title)
|
||||
var data = null;
|
||||
var error = null;
|
||||
var content = null;
|
||||
var title = null;
|
||||
|
||||
var showError = mxUtils.bind(this, function(err, c)
|
||||
{
|
||||
var dataLoaded = mxUtils.bind(this, function(images)
|
||||
{
|
||||
this.addEntries(images);
|
||||
this.editorUi.addLibraryEntries(images, content);
|
||||
});
|
||||
var div = document.createElement('span');
|
||||
div.style.paddingBottom = '6px';
|
||||
div.style.paddingTop = '6px';
|
||||
div.style.fontSize = '11px';
|
||||
mxUtils.write(div, err);
|
||||
c.innerHTML = '<img align="top" src="' + mxGraph.prototype.warningImage.src + '"/> ';
|
||||
c.appendChild(div);
|
||||
});
|
||||
|
||||
var showError = mxUtils.bind(this, function(err)
|
||||
var barrier = mxUtils.bind(this, function()
|
||||
{
|
||||
if (content != null && title != null)
|
||||
{
|
||||
content.innerHTML = '';
|
||||
var div = document.createElement('div');
|
||||
div.style.color = 'rgb(179, 179, 179)';
|
||||
div.style.textAlign = 'center';
|
||||
div.style.paddingTop = '6px';
|
||||
mxUtils.write(div, err);
|
||||
content.appendChild(div);
|
||||
});
|
||||
|
||||
if (lib.data)
|
||||
{
|
||||
dataLoaded(lib.data);
|
||||
if (error != null)
|
||||
{
|
||||
content.style.display = 'block';
|
||||
title.innerHTML = '';
|
||||
mxUtils.write(title, this.editorUi.getResource(lib.title));
|
||||
showError(error, content);
|
||||
}
|
||||
else if (data != null)
|
||||
{
|
||||
this.editorUi.addLibraryEntries(data, content);
|
||||
content.style.display = 'block';
|
||||
title.innerHTML = '';
|
||||
mxUtils.write(title, this.editorUi.getResource(lib.title));
|
||||
}
|
||||
else
|
||||
{
|
||||
content.style.display = 'none';
|
||||
title.innerHTML = '';
|
||||
mxUtils.write(title, mxResources.get('loading') + '...');
|
||||
}
|
||||
}
|
||||
else
|
||||
});
|
||||
|
||||
if (lib.data == null && lib.url != null && (!lib.preload && preloadCount >= this.maxPreloadCount))
|
||||
{
|
||||
this.addPalette(entry.id + '.' + k, this.editorUi.getResource(lib.title),
|
||||
false, mxUtils.bind(this, function(content, title)
|
||||
{
|
||||
var dataLoaded = mxUtils.bind(this, function(images)
|
||||
{
|
||||
this.addEntries(images);
|
||||
this.editorUi.addLibraryEntries(images, content);
|
||||
});
|
||||
|
||||
content.style.display = 'none';
|
||||
title.innerHTML = '';
|
||||
mxUtils.write(title, mxResources.get('loading') + '...');
|
||||
|
||||
var url = lib.url;
|
||||
|
||||
if (!this.editorUi.editor.isCorsEnabledForUrl(url))
|
||||
|
@ -803,16 +838,77 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
showError(mxResources.get('notALibraryFile'));
|
||||
showError(mxResources.get('notALibraryFile'), content);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
showError(mxResources.get('error') + ': ' + e.message);
|
||||
showError(mxResources.get('error') + ': ' + e.message, content);
|
||||
}
|
||||
}));
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
this.addPalette(entry.id + '.' + k, this.editorUi.getResource(lib.title),
|
||||
false, mxUtils.bind(this, function(c, t)
|
||||
{
|
||||
content = c;
|
||||
title = t;
|
||||
barrier();
|
||||
}));
|
||||
|
||||
if (lib.data != null)
|
||||
{
|
||||
this.addEntries(lib.data);
|
||||
data = lib.data;
|
||||
barrier();
|
||||
}
|
||||
}));
|
||||
else if (lib.url != null)
|
||||
{
|
||||
preloadCount++;
|
||||
var url = lib.url;
|
||||
|
||||
if (!this.editorUi.editor.isCorsEnabledForUrl(url))
|
||||
{
|
||||
url = PROXY_URL + '?url=' + encodeURIComponent(url);
|
||||
}
|
||||
|
||||
this.editorUi.loadUrl(url, mxUtils.bind(this, function(temp)
|
||||
{
|
||||
try
|
||||
{
|
||||
var doc = mxUtils.parseXml(temp);
|
||||
|
||||
if (doc.documentElement.nodeName == 'mxlibrary')
|
||||
{
|
||||
data = JSON.parse(mxUtils.getTextContent(doc.documentElement));
|
||||
this.addEntries(data);
|
||||
barrier();
|
||||
}
|
||||
else
|
||||
{
|
||||
error = mxResources.get('notALibraryFile');
|
||||
barrier();
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
error = mxResources.get('error') + ': ' + e.message;
|
||||
barrier();
|
||||
}
|
||||
}), mxUtils.bind(this, function(e)
|
||||
{
|
||||
error = (e != null && e.message != null) ? e.message : e;
|
||||
barrier();
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
error = mxResources.get('invalidInput');
|
||||
barrier();
|
||||
}
|
||||
}
|
||||
}))(entry.libs[k]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2096,6 +2096,7 @@ EditorUi.prototype.initCanvas = function()
|
|||
var updateZoomTimeout = null;
|
||||
var cursorPosition = null;
|
||||
var scrollPosition = null;
|
||||
var filter = null;
|
||||
|
||||
var scheduleZoom = function(delay)
|
||||
{
|
||||
|
@ -2182,10 +2183,16 @@ EditorUi.prototype.initCanvas = function()
|
|||
}
|
||||
}
|
||||
|
||||
if (filter != null)
|
||||
{
|
||||
mainGroup.setAttribute('filter', filter);
|
||||
}
|
||||
|
||||
graph.cumulativeZoomFactor = 1;
|
||||
updateZoomTimeout = null;
|
||||
scrollPosition = null;
|
||||
cursorPosition = null;
|
||||
filter = null;
|
||||
}), (delay != null) ? delay : ((graph.isFastZoomEnabled()) ? ui.wheelZoomDelay : ui.lazyZoomDelay));
|
||||
}
|
||||
}, 0);
|
||||
|
@ -2237,6 +2244,12 @@ EditorUi.prototype.initCanvas = function()
|
|||
|
||||
if (graph.isFastZoomEnabled())
|
||||
{
|
||||
if (filter == null && mainGroup.getAttribute('filter') != '')
|
||||
{
|
||||
filter = mainGroup.getAttribute('filter');
|
||||
mainGroup.removeAttribute('filter');
|
||||
}
|
||||
|
||||
scrollPosition = new mxPoint(graph.container.scrollLeft, graph.container.scrollTop);
|
||||
|
||||
var cx = (ignoreCursorPosition) ? graph.container.scrollLeft + graph.container.clientWidth / 2 :
|
||||
|
|
|
@ -3686,32 +3686,28 @@
|
|||
|
||||
mxVertexHandler.prototype.createCustomHandles = function()
|
||||
{
|
||||
// Not rotatable means locked
|
||||
if (this.state.view.graph.getSelectionCount() == 1)
|
||||
if (this.graph.isCellRotatable(this.state.cell))
|
||||
// LATER: Make locked state independent of rotatable flag, fix toggle if default is false
|
||||
//if (this.graph.isCellResizable(this.state.cell) || this.graph.isCellMovable(this.state.cell))
|
||||
{
|
||||
if (this.graph.isCellRotatable(this.state.cell))
|
||||
// LATER: Make locked state independent of rotatable flag, fix toggle if default is false
|
||||
//if (this.graph.isCellResizable(this.state.cell) || this.graph.isCellMovable(this.state.cell))
|
||||
var name = this.state.style['shape'];
|
||||
|
||||
if (mxCellRenderer.defaultShapes[name] == null &&
|
||||
mxStencilRegistry.getStencil(name) == null)
|
||||
{
|
||||
var name = this.state.style['shape'];
|
||||
name = mxConstants.SHAPE_RECTANGLE;
|
||||
}
|
||||
|
||||
if (mxCellRenderer.defaultShapes[name] == null &&
|
||||
mxStencilRegistry.getStencil(name) == null)
|
||||
{
|
||||
name = mxConstants.SHAPE_RECTANGLE;
|
||||
}
|
||||
var fn = handleFactory[name];
|
||||
|
||||
var fn = handleFactory[name];
|
||||
if (fn == null && this.state.shape != null && this.state.shape.isRoundable())
|
||||
{
|
||||
fn = handleFactory[mxConstants.SHAPE_RECTANGLE];
|
||||
}
|
||||
|
||||
if (fn == null && this.state.shape != null && this.state.shape.isRoundable())
|
||||
{
|
||||
fn = handleFactory[mxConstants.SHAPE_RECTANGLE];
|
||||
}
|
||||
|
||||
if (fn != null)
|
||||
{
|
||||
return fn(this.state);
|
||||
}
|
||||
if (fn != null)
|
||||
{
|
||||
return fn(this.state);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3720,22 +3716,19 @@
|
|||
|
||||
mxEdgeHandler.prototype.createCustomHandles = function()
|
||||
{
|
||||
if (this.state.view.graph.getSelectionCount() == 1)
|
||||
var name = this.state.style['shape'];
|
||||
|
||||
if (mxCellRenderer.defaultShapes[name] == null &&
|
||||
mxStencilRegistry.getStencil(name) == null)
|
||||
{
|
||||
var name = this.state.style['shape'];
|
||||
name = mxConstants.SHAPE_CONNECTOR;
|
||||
}
|
||||
|
||||
if (mxCellRenderer.defaultShapes[name] == null &&
|
||||
mxStencilRegistry.getStencil(name) == null)
|
||||
{
|
||||
name = mxConstants.SHAPE_CONNECTOR;
|
||||
}
|
||||
var fn = handleFactory[name];
|
||||
|
||||
var fn = handleFactory[name];
|
||||
|
||||
if (fn != null)
|
||||
{
|
||||
return fn(this.state);
|
||||
}
|
||||
if (fn != null)
|
||||
{
|
||||
return fn(this.state);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
607
src/main/webapp/js/orgchart/mxOrgChartLayout.js
Normal file
607
src/main/webapp/js/orgchart/mxOrgChartLayout.js
Normal file
|
@ -0,0 +1,607 @@
|
|||
/**
|
||||
* Copyright (c) 2019-2020, JGraph Ltd
|
||||
*/
|
||||
/**
|
||||
* Class: mxOrgChartLayout
|
||||
*
|
||||
* Extends <mxGraphLayout> to implement organization chart layout algorithm.
|
||||
* The vertices need to be connected for this layout to work, vertices
|
||||
* with no connections are ignored.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* (code)
|
||||
* var layout = new mxOrgChartLayout(graph);
|
||||
* layout.execute(graph.getDefaultParent());
|
||||
* (end)
|
||||
*
|
||||
*/
|
||||
function mxOrgChartLayout(graph)
|
||||
{
|
||||
mxGraphLayout.call(this, graph);
|
||||
};
|
||||
|
||||
/**
|
||||
* Extends mxGraphLayout.
|
||||
*/
|
||||
mxOrgChartLayout.prototype = new mxGraphLayout();
|
||||
mxOrgChartLayout.prototype.constructor = mxOrgChartLayout;
|
||||
|
||||
/**
|
||||
* Function: execute
|
||||
*
|
||||
* Implements <mxGraphLayout.execute>. This operates on all children of the
|
||||
* given parent.
|
||||
*/
|
||||
mxOrgChartLayout.prototype.execute = function(parent)
|
||||
{
|
||||
this.graph.model.beginUpdate();
|
||||
try
|
||||
{
|
||||
RPOrgChart.main(this.graph, parent);
|
||||
}
|
||||
finally
|
||||
{
|
||||
this.graph.model.endUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
Bridge.define('RPOrgChart',
|
||||
{
|
||||
statics: {
|
||||
config: {
|
||||
init: function() {
|
||||
|
||||
}
|
||||
},
|
||||
main: function (graph, parent) {
|
||||
Bridge.Console.log = console.log;
|
||||
Bridge.Console.error = console.error;
|
||||
Bridge.Console.debug = console.debug;
|
||||
|
||||
RPOrgChart.graph = graph;
|
||||
RPOrgChart.parent = parent;
|
||||
RPOrgChart.buildChart(true);
|
||||
},
|
||||
|
||||
diagram: {},
|
||||
dataSource: {},
|
||||
|
||||
buildChart: function (initData) {
|
||||
if (initData) {
|
||||
RPOrgChart.initDiagram();
|
||||
}
|
||||
RPOrgChart.positionBoxes();
|
||||
},
|
||||
|
||||
collapseAllBoxes: function(boxContainer, isCollapsed) {
|
||||
var en = boxContainer.getBoxesById().getValues().getEnumerator();
|
||||
while (en.moveNext()) {
|
||||
var box = en.getCurrent();
|
||||
if (!box.IsSpecial) {
|
||||
box.IsCollapsed = isCollapsed;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
generateData: function ()
|
||||
{
|
||||
var dataSource = new OrgChart.Test.TestDataSource();
|
||||
|
||||
var graph = RPOrgChart.graph;
|
||||
var cells = graph.getChildVertices(RPOrgChart.parent);
|
||||
|
||||
for (var i = 0; i < cells.length; i++)
|
||||
{
|
||||
var cell = cells[i];
|
||||
|
||||
if (cell.geometry != null && cell.vertex && cell.parent == RPOrgChart.parent) //Vertices and first level children only
|
||||
{
|
||||
// Find cell parent. If it has more than one parent, take first parent (should be an error?)
|
||||
var parentId = null;
|
||||
|
||||
var incomingEdge = graph.getIncomingEdges(cell)[0];
|
||||
|
||||
if (incomingEdge != null && incomingEdge.source != null)
|
||||
{
|
||||
parentId = incomingEdge.source.id;
|
||||
}
|
||||
|
||||
var item = new OrgChart.Test.TestDataItem();
|
||||
item.Id = cell.id;
|
||||
item.ParentId = parentId;
|
||||
dataSource.Items.add(item.getId(), item);
|
||||
}
|
||||
}
|
||||
|
||||
return dataSource;
|
||||
},
|
||||
|
||||
initDiagram: function () {
|
||||
var dataSource = RPOrgChart.generateData();
|
||||
|
||||
RPOrgChart.dataSource = dataSource;
|
||||
|
||||
var boxContainer = new OrgChart.Layout.BoxContainer.$ctor1(dataSource);
|
||||
RPOrgChart.diagram = new OrgChart.Layout.Diagram();
|
||||
|
||||
var diagram = RPOrgChart.diagram;
|
||||
diagram.setBoxes(boxContainer);
|
||||
|
||||
var linearLayoutStrategy = new OrgChart.Layout.LinearLayoutStrategy();
|
||||
linearLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("linear", linearLayoutStrategy);
|
||||
|
||||
var multiLineHangerLayoutStrategy = new OrgChart.Layout.MultiLineHangerLayoutStrategy();
|
||||
multiLineHangerLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
multiLineHangerLayoutStrategy.MaxSiblingsPerRow = 2;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("hanger2", multiLineHangerLayoutStrategy);
|
||||
|
||||
multiLineHangerLayoutStrategy = new OrgChart.Layout.MultiLineHangerLayoutStrategy();
|
||||
multiLineHangerLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
multiLineHangerLayoutStrategy.MaxSiblingsPerRow = 4;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("hanger4", multiLineHangerLayoutStrategy);
|
||||
|
||||
var singleColumnLayoutStrategy = new OrgChart.Layout.SingleColumnLayoutStrategy();
|
||||
singleColumnLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Right;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("singleColumnRight", singleColumnLayoutStrategy);
|
||||
|
||||
singleColumnLayoutStrategy = new OrgChart.Layout.SingleColumnLayoutStrategy();
|
||||
singleColumnLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Left;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("singleColumnLeft", singleColumnLayoutStrategy);
|
||||
|
||||
var fishboneLayoutStrategy = new OrgChart.Layout.MultiLineFishboneLayoutStrategy();
|
||||
fishboneLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
fishboneLayoutStrategy.MaxGroups = 1;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("fishbone1", fishboneLayoutStrategy);
|
||||
|
||||
fishboneLayoutStrategy = new OrgChart.Layout.MultiLineFishboneLayoutStrategy();
|
||||
fishboneLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
fishboneLayoutStrategy.MaxGroups = 2;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("fishbone2", fishboneLayoutStrategy);
|
||||
|
||||
var hstackLayoutStrategy = new OrgChart.Layout.StackingLayoutStrategy();
|
||||
hstackLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.InvalidValue;
|
||||
hstackLayoutStrategy.Orientation = OrgChart.Layout.StackOrientation.SingleRowHorizontal;
|
||||
hstackLayoutStrategy.ParentChildSpacing = 10;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("hstack", hstackLayoutStrategy);
|
||||
|
||||
var vstackLayoutStrategy = new OrgChart.Layout.StackingLayoutStrategy();
|
||||
vstackLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.InvalidValue;
|
||||
vstackLayoutStrategy.Orientation = OrgChart.Layout.StackOrientation.SingleColumnVertical;
|
||||
vstackLayoutStrategy.ParentChildSpacing = 10;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("vstack", vstackLayoutStrategy);
|
||||
|
||||
vstackLayoutStrategy = new OrgChart.Layout.StackingLayoutStrategy();
|
||||
vstackLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.InvalidValue;
|
||||
vstackLayoutStrategy.Orientation = OrgChart.Layout.StackOrientation.SingleColumnVertical;
|
||||
vstackLayoutStrategy.SiblingSpacing = 20;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("vstackMiddle", vstackLayoutStrategy);
|
||||
|
||||
vstackLayoutStrategy = new OrgChart.Layout.StackingLayoutStrategy();
|
||||
vstackLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.InvalidValue;
|
||||
vstackLayoutStrategy.Orientation = OrgChart.Layout.StackOrientation.SingleColumnVertical;
|
||||
vstackLayoutStrategy.SiblingSpacing = 50;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("vstackTop", vstackLayoutStrategy);
|
||||
|
||||
var assistantsLayoutStrategy = new OrgChart.Layout.FishboneAssistantsLayoutStrategy();
|
||||
assistantsLayoutStrategy.ParentAlignment = OrgChart.Layout.BranchParentAlignment.Center;
|
||||
diagram.LayoutSettings.LayoutStrategies.add("assistants", assistantsLayoutStrategy);
|
||||
|
||||
diagram.LayoutSettings.DefaultLayoutStrategyId = "vstack";
|
||||
diagram.LayoutSettings.DefaultAssistantLayoutStrategyId = "assistants";
|
||||
//diagram.LayoutSettings.setBranchSpacing(5);
|
||||
},
|
||||
|
||||
getBoxLevel: function(boxContainer, box) {
|
||||
var level = 0;
|
||||
var obj = {};
|
||||
while (box.ParentId > 0) {
|
||||
if (!boxContainer.getBoxesById().tryGetValue(box.ParentId, obj)) {
|
||||
break;
|
||||
}
|
||||
box = obj.v;
|
||||
level++;
|
||||
}
|
||||
|
||||
return level;
|
||||
},
|
||||
|
||||
onLayoutStateChanged: function (sender, args) {
|
||||
if (args.State.getCurrentOperation() === OrgChart.Layout.LayoutState.Operation.PreprocessVisualTree) {
|
||||
// When layout algorithm is ready to preprocess the tree,
|
||||
// we need to have box sizes ready -> hence have to render visible boxes in HTML.
|
||||
// Rendering can happen at earlier time, but it's just more convenient to do it here,
|
||||
// to utilize some readily available information about visual tree.
|
||||
RPOrgChart.renderBoxes();
|
||||
}
|
||||
},
|
||||
|
||||
renderBoxes: function () {
|
||||
var visitorFunc = function (node) {
|
||||
var box = node.Element;
|
||||
|
||||
if (box.getIsDataBound()) {
|
||||
// we're being run when nodes have already been marked as visible or hidden,
|
||||
// based on IsCollapsed attribute of each Box
|
||||
// so use this knowledge to prevent unnecessary rendering of invisible branches
|
||||
if (node.State.IsHidden) {
|
||||
return true;
|
||||
}
|
||||
|
||||
box.Size = RPOrgChart.getBoxElementSize(box.DataId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
RPOrgChart.diagram.getVisualTree().IterateParentFirst(visitorFunc);
|
||||
},
|
||||
|
||||
//TODO implement this
|
||||
getBranchOptimizerFunc: function () {
|
||||
// var value = $("input[name='SelectBranchOptimizer']:checked").val();
|
||||
var func = RPOrgChart['branchOptimizer' + 'AllHanger4'];
|
||||
return func;
|
||||
},
|
||||
|
||||
branchOptimizerAllLinear: function(node) {
|
||||
return node.getIsAssistantRoot() ? null : "linear";
|
||||
},
|
||||
|
||||
branchOptimizerAllHanger2: function(node) {
|
||||
return node.getIsAssistantRoot() ? null : "hanger2";
|
||||
},
|
||||
|
||||
branchOptimizerAllHanger4: function(node) {
|
||||
return node.getIsAssistantRoot() ? null : "hanger4";
|
||||
},
|
||||
|
||||
branchOptimizerAllFishbone1: function(node) {
|
||||
return node.getIsAssistantRoot() ? null : "fishbone1";
|
||||
},
|
||||
|
||||
branchOptimizerAllFishbone2: function (node) {
|
||||
return node.getIsAssistantRoot() ? null : "fishbone2";
|
||||
},
|
||||
|
||||
branchOptimizerAllSingleColumnLeft: function (node) {
|
||||
return node.getIsAssistantRoot() ? null : "singleColumnRight";
|
||||
},
|
||||
|
||||
branchOptimizerAllSingleColumnRight: function (node) {
|
||||
return node.getIsAssistantRoot() ? null : "singleColumnLeft";
|
||||
},
|
||||
|
||||
branchOptimizerStackers: function(node) {
|
||||
if (node.getIsAssistantRoot()) {
|
||||
return null;
|
||||
}
|
||||
return node.Level === 0 // this is Node for boxContainer.SystemRoot, which is not visible itself
|
||||
? "vstackTop"
|
||||
: node.Level === 1 // this is children of SystemRoot - they appear as roots in the diagram
|
||||
? "vstackMiddle"
|
||||
: "hstack";
|
||||
|
||||
},
|
||||
|
||||
branchOptimizerSmart: function(node) {
|
||||
if (node.getIsAssistantRoot()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var childCount = node.getChildCount();
|
||||
|
||||
if (childCount <= 1) {
|
||||
return "vstack";
|
||||
}
|
||||
|
||||
var nonLeafChildren = 0;
|
||||
for (var i = 0; i < childCount; i++) {
|
||||
if (node.Children.getItem(i).getChildCount() > 0) {
|
||||
nonLeafChildren++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nonLeafChildren <= 1) {
|
||||
if (childCount <= 4) {
|
||||
return "vstack";
|
||||
}
|
||||
if (childCount <= 8) {
|
||||
return "fishbone1";
|
||||
}
|
||||
return "fishbone2";
|
||||
}
|
||||
|
||||
return "hanger4";
|
||||
},
|
||||
|
||||
boxSizeFunc: function (dataId) {
|
||||
// ChartLayoutAlgorithm requires this function to accept data ID
|
||||
// so have to convert it to Box ID first, to get rendered visual element
|
||||
var boxId = RPOrgChart.diagram.getBoxes().getBoxesByDataId().getItem(dataId).Id;
|
||||
return RPOrgChart.diagram.getBoxes().getBoxesById().getItem(boxId).Size;
|
||||
},
|
||||
|
||||
getBoxElementSize: function (boxId) {
|
||||
var geo = RPOrgChart.graph.model.cells[boxId].geometry;
|
||||
return new OrgChart.Layout.Size.$ctor1(geo.width, geo.height);
|
||||
},
|
||||
|
||||
positionBoxes: function () {
|
||||
var diagram = RPOrgChart.diagram;
|
||||
|
||||
var state = new OrgChart.Layout.LayoutState(diagram);
|
||||
|
||||
state.addOperationChanged(RPOrgChart.onLayoutStateChanged);
|
||||
state.BoxSizeFunc = Bridge.fn.bind(this, RPOrgChart.boxSizeFunc, null, true);
|
||||
state.LayoutOptimizerFunc = Bridge.fn.bind(this, RPOrgChart.getBranchOptimizerFunc(), null, true);
|
||||
|
||||
OrgChart.Layout.LayoutAlgorithm.Apply(state);
|
||||
|
||||
var diagramBoundary = OrgChart.Layout.LayoutAlgorithm.ComputeBranchVisualBoundingRect(diagram.getVisualTree());
|
||||
|
||||
var offsetx = -diagramBoundary.getLeft() + diagramBoundary.getTop();
|
||||
|
||||
var graph = RPOrgChart.graph;
|
||||
var cells = graph.model.cells;
|
||||
|
||||
var visitorVertexFunc = function (node)
|
||||
{
|
||||
if (node.State.IsHidden) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var box = node.Element;
|
||||
|
||||
if (box.getIsDataBound()) {
|
||||
var cell = cells[box.DataId];
|
||||
var geo = cell.geometry.clone();
|
||||
geo.x = node.State.TopLeft.X + offsetx;
|
||||
geo.y = node.State.TopLeft.Y;
|
||||
graph.model.setGeometry(cell, geo);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
var visitorEdgeFunc = function (node)
|
||||
{
|
||||
// Render connectors
|
||||
if (node.State.Connector != null) {
|
||||
|
||||
var cell = cells[node.Element.DataId];
|
||||
|
||||
var outgoingEdge = graph.getOutgoingEdges(cell);
|
||||
|
||||
var uniquePoints = {};
|
||||
|
||||
//Sort segments points from top to bottom or left to right + add offset
|
||||
for (var ix = 0; ix < node.State.Connector.Segments.length; ix++)
|
||||
{
|
||||
var edge = node.State.Connector.Segments[ix];
|
||||
edge.mark = 1 << ix; //TODO Support up to 31 segments. In this a limit?
|
||||
edge.From.X += offsetx;
|
||||
edge.To.X += offsetx;
|
||||
var fx = edge.From.X, fy = edge.From.Y, tx = edge.To.X, ty = edge.To.Y;
|
||||
|
||||
if ((fx == tx && fy > ty) || (fy == ty && fx > tx))
|
||||
{
|
||||
var tmp = edge.From;
|
||||
edge.From = edge.To;
|
||||
edge.To = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
//Collecting points including intersection of segments
|
||||
for (var ix = 0; ix < node.State.Connector.Segments.length; ix++)
|
||||
{
|
||||
var edge = node.State.Connector.Segments[ix];
|
||||
var fx = edge.From.X, fy = edge.From.Y, tx = edge.To.X, ty = edge.To.Y;
|
||||
var fp = new mxPoint(fx, fy);
|
||||
fp.mark = edge.mark;
|
||||
var up = uniquePoints[fx + ',' + fy];
|
||||
|
||||
if (up != null)
|
||||
{
|
||||
up.mark |= fp.mark;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniquePoints[fx + ',' + fy] = fp;
|
||||
}
|
||||
|
||||
var tp = new mxPoint(tx, ty);
|
||||
tp.mark = edge.mark;
|
||||
var up = uniquePoints[tx + ',' + ty];
|
||||
|
||||
if (up != null)
|
||||
{
|
||||
up.mark |= tp.mark;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniquePoints[tx + ',' + ty] = tp;
|
||||
}
|
||||
|
||||
//Find intersections
|
||||
for (var j = ix + 1; j < node.State.Connector.Segments.length; j++)
|
||||
{
|
||||
var e2 = node.State.Connector.Segments[j];
|
||||
var fx2 = e2.From.X, fy2 = e2.From.Y, tx2 = e2.To.X, ty2 = e2.To.Y;
|
||||
|
||||
if (fx == tx && fy <= fy2 && ty >= fy2 && fx2 <= fx && tx2 >= fx) //Ver |_ Hor
|
||||
{
|
||||
var ip = new mxPoint(fx, fy2);
|
||||
ip.mark = edge.mark | e2.mark;
|
||||
var up = uniquePoints[fx + ',' + fy2];
|
||||
|
||||
if (up != null)
|
||||
{
|
||||
up.mark |= ip.mark;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniquePoints[fx + ',' + fy2] = ip;
|
||||
}
|
||||
}
|
||||
else if (fy == ty && fx <= fx2 && tx >= fx2 && fy2 <= fy && ty2 >= fy) //Hor _| Ver
|
||||
{
|
||||
var ip = new mxPoint(fx2, fy);
|
||||
ip.mark = edge.mark | e2.mark;
|
||||
var up = uniquePoints[fx2 + ',' + fy]
|
||||
|
||||
if (up != null)
|
||||
{
|
||||
up.mark |= ip.mark;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniquePoints[fx2 + ',' + fy] = ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Sort points on y then x
|
||||
var pointsArr = [];
|
||||
|
||||
for (var k in uniquePoints)
|
||||
{
|
||||
pointsArr.push(uniquePoints[k]);
|
||||
}
|
||||
|
||||
pointsArr.sort(function(a, b)
|
||||
{
|
||||
var dy = a.y - b.y;
|
||||
|
||||
return dy == 0? a.x - b.x : dy;
|
||||
});
|
||||
|
||||
function pointOnCell(geo, p)
|
||||
{
|
||||
return p.x >= geo.x && p.x <= geo.x + geo.width && p.y >= geo.y && p.y <= geo.y + geo.height;
|
||||
};
|
||||
|
||||
function adjustEdgeGeoAndStyle(edge, edgePoints)
|
||||
{
|
||||
var eGeo = edge.geometry.clone();
|
||||
eGeo.points = edgePoints;
|
||||
graph.model.setGeometry(edge, eGeo);
|
||||
|
||||
//Remove entry and exit points
|
||||
graph.setCellStyles('entryX', null, [edge]);
|
||||
graph.setCellStyles('entryY', null, [edge]);
|
||||
graph.setCellStyles('exitX', null, [edge]);
|
||||
graph.setCellStyles('exitY', null, [edge]);
|
||||
//Set type orthogonal
|
||||
graph.setCellStyles('edgeStyle', 'orthogonalEdgeStyle', [edge]);
|
||||
};
|
||||
|
||||
var outgoingEdge = graph.getOutgoingEdges(cell);
|
||||
|
||||
//Simple case of a single segment. TODO Handle this case earlier
|
||||
if (pointsArr.length == 2 && outgoingEdge.length == 1)
|
||||
{
|
||||
adjustEdgeGeoAndStyle(outgoingEdge[0], pointsArr);
|
||||
}
|
||||
else
|
||||
{
|
||||
var srcGeo = cell.geometry;
|
||||
var srcP;
|
||||
|
||||
//Find src starting point //TODO It should be first point always?
|
||||
for (var i = 0; i < pointsArr.length; i++)
|
||||
{
|
||||
if (pointOnCell(srcGeo, pointsArr[i]))
|
||||
{
|
||||
srcP = pointsArr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var selected;
|
||||
|
||||
function getNextPoint(lp)
|
||||
{
|
||||
for (var i = 0; i < pointsArr.length; i++)
|
||||
{
|
||||
var p = pointsArr[i];
|
||||
if (selected[p.x + ',' + p.y]) continue;
|
||||
|
||||
if (p.mark & lp.mark)
|
||||
{
|
||||
selected[p.x + ',' + p.y] = true;
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 0; j < outgoingEdge.length; j++)
|
||||
{
|
||||
if (outgoingEdge[j].target != null)
|
||||
{
|
||||
selected = {};
|
||||
selected[srcP.x + ',' + srcP.y] = true;
|
||||
var trgGeo = outgoingEdge[j].target.geometry;
|
||||
|
||||
var edgePoints = [srcP];
|
||||
var lp = srcP;
|
||||
var safeGuard = 0;
|
||||
//Is BFS better?
|
||||
while (safeGuard < 1000)
|
||||
{
|
||||
safeGuard++;
|
||||
var np = getNextPoint(lp);
|
||||
|
||||
//retract, then remove this point
|
||||
if (np == null)
|
||||
{
|
||||
edgePoints.pop();
|
||||
lp = edgePoints[edgePoints.length - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
edgePoints.push(np);
|
||||
lp = np;
|
||||
if (pointOnCell(trgGeo, np)) break;
|
||||
}
|
||||
}
|
||||
|
||||
//Remove retracted points TODO can we do it in a better way?
|
||||
if (edgePoints.length > 2)
|
||||
{
|
||||
var spX = edgePoints[0].x;
|
||||
var lpX = edgePoints[edgePoints.length - 1].x;
|
||||
|
||||
for (var i = edgePoints.length - 2; i > 0; i--)
|
||||
{
|
||||
if ((spX > lpX && edgePoints[i].x < lpX) || (spX < lpX && edgePoints[i].x < spX))
|
||||
{
|
||||
edgePoints.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var eGeo = outgoingEdge[j].geometry.clone();
|
||||
eGeo.points = edgePoints;
|
||||
RPOrgChart.graph.model.setGeometry(outgoingEdge[j], eGeo);
|
||||
|
||||
//Fix edge points and style
|
||||
adjustEdgeGeoAndStyle(outgoingEdge[j], edgePoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
diagram.getVisualTree().IterateParentFirst(visitorVertexFunc);
|
||||
diagram.getVisualTree().IterateParentFirst(visitorEdgeFunc);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Bridge.init();
|
2708
src/main/webapp/js/viewer.min.js
vendored
2708
src/main/webapp/js/viewer.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "draw.io",
|
||||
"version": "12.5.3",
|
||||
"version": "12.6.5",
|
||||
"description": "draw.io desktop",
|
||||
"main": "electron.js",
|
||||
"scripts": {
|
||||
|
@ -32,6 +32,6 @@
|
|||
"crc": "^3.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^7.1.9"
|
||||
"electron": "^8.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -681,4 +681,32 @@ Draw.loadPlugin(function(ui)
|
|||
success(revs, restoreFn);
|
||||
}, error);
|
||||
};
|
||||
|
||||
//============= Support Action ===============
|
||||
ui.actions.addAction('support...', function()
|
||||
{
|
||||
ui.remoteInvoke('getPageInfo', [true], null, function(info)
|
||||
{
|
||||
var url = info.url;
|
||||
|
||||
if (url != null)
|
||||
{
|
||||
var wikiPos = url.indexOf('/wiki/');
|
||||
|
||||
if (wikiPos > -1)
|
||||
{
|
||||
url = url.substring(0, wikiPos);
|
||||
}
|
||||
|
||||
ui.openLink(url + '/wiki/plugins/servlet/ac/com.mxgraph.confluence.plugins.diagramly/support');
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.openLink('https://about.draw.io/support/');
|
||||
}
|
||||
}, function()
|
||||
{
|
||||
ui.openLink('https://about.draw.io/support/');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Открита е чернова за {1}. За да продължите, я качете в редактора или я откажете.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Опцията плъзгане и пускане не се поддържа за изображения. Желаете ли да импортирате вместо това?
|
||||
dropboxCharsNotAllowed=Следните знаци не са позволени: \ / : ? * " |
|
||||
check=Проверка
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound={1} nacrt pronađen. Učitajte ga u uređivač ili ga odbacite kako biste nastavili.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Prevlačenje nije podržano kada je riječ o slikama. Želite li uvesti umjesto toga?
|
||||
dropboxCharsNotAllowed=Sljedeći znakovi nisu dozvoljeni: \ / : ? * " |
|
||||
check=Provjeri
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Fosc
|
||||
didYouMeanToExportToPdf=Voleu exportar-ho a PDF?
|
||||
draftFound=S'ha trobat un esborrany per a '{1}'. Carrega'l a l'editor o descarta'l per continuar.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Les imatges no es poden arrossegar i deixar anar. Voleu importar-les?
|
||||
dropboxCharsNotAllowed=No es permeten aquests caràcters: \ / : ? * " |
|
||||
check=Comprova
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Byl nalezen koncept pro '{1}'. Abyste mohli pokračovat, nahrajte ho do editoru nebo jej zahoďte.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Pro obrázky není funkce Drag & Drop k dispozici. Chcete ho místo toho naimportovat?
|
||||
dropboxCharsNotAllowed=Následující znaky nejsou povoleny: \ / : ? * " |
|
||||
check=Zkontrolovat
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Et udkast for '{1}' blev fundet. Load det i editoren eller kasser det for at fortsætte.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag & drop er ikke understøttet for billeder Vil du importere i stedet?
|
||||
dropboxCharsNotAllowed=Følgende tegn er ikke tilladt: \ / : ? * " |
|
||||
check=Tjek
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Wollten Sie als PDF exportieren?
|
||||
draftFound=Ein Entwurf für '{1}' wurde gefunden. Setzen Sie die Bearbeitung fort oder verwerfen Sie die Änderungen.
|
||||
selectDraft=Wählen Sie einen Entwurf zur Bearbeitung:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=Unzulässige Zeichen: \ / : ? * " |
|
||||
check=Prüfen
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Έχει βρεθει ένα σχέδιο για το '{1}' . Φορτώστε το στον επεξεργαστή ή απορρίψτε το για να συνεχίσετε.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Το Drag & Drop δεν υποστηρίζεται για τις εικόνες. Θα θέλατε να τις εισάγετε παρόλα αυτά;
|
||||
dropboxCharsNotAllowed=Οι παρακάτω χαρακτήρες δεν υποστηρίζονται: \ / : ? * " |
|
||||
check=Έλεγχος
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Se encontró un borrador para '{1}'. Cárguelo en el editor o descártelo para continuar.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=La opción de arrastrar y soltar no está soportada para las imágenes. ¿En lugar de eso, le gustaría importar?
|
||||
dropboxCharsNotAllowed=Los siguientes caracteres no están permitidos: \ / : ? * " |
|
||||
check=Verificar
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Tume
|
||||
didYouMeanToExportToPdf=Kas soovisid PDFi eksportida?
|
||||
draftFound=Mustand {1} jaoks on leitud. Lae see töötluskeskkonda või tühista jätkamiseks.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Piltidele puudub pukseerimise tugi. Kas sooviksid selle asemel importida?
|
||||
dropboxCharsNotAllowed=Järgnevad tähemärgid pole lubatud: \ / : ? * " |
|
||||
check=Kontrolli
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=پیش نویس '{1}' یافت شد. آن را به داخل ویرایشگر بارگذاری کنید و یا آن را برای ادامه دادن حذف کنید.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=حرکت و کشیدن و انداختن برای تصاویر امکانپذیر نیست. آیا می خواهید بجای آن تصاویر را وارد کنید؟
|
||||
dropboxCharsNotAllowed=کاراکترهای زیر مجاز نمی باشند: \ / : ? * " |
|
||||
check=بررسی کردن
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Vedos tiedostolle '{1}' on löytynyt. Lataa se muokattavaksi tai hylkää se jatkaaksesi.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Vedä ja pudota'-toiminto ei tue kuvia. Haluatko tuoda kuvat?
|
||||
dropboxCharsNotAllowed=Seuraavat merkit eivät ole sallittuja: \ / : ? * " |
|
||||
check=Tarkista
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Isang draft para sa '{1}' ang nahanap. Ikarga ito sa loob ng editor o isantabi ito para magpatuloy
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Ang paghila at paglagay ay hindi suportado para sa mga imahe. Gusto mo bang mag angkat na lang?
|
||||
dropboxCharsNotAllowed=Ang mga sumusunod na simbolo ay hindi pinahihintulutan: \ / : ? * " |
|
||||
check=Alamin
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Un brouillon pour '{1}' a été trouvé. Pour poursuivre, souhaitez-vous l'afficher dans l'éditeur ou l'ignorer ?
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Le glisser-déposer n'est pas supporté pour les images. Voulez-vous importer à la place?
|
||||
dropboxCharsNotAllowed=Les caractères suivants ne sont pas autorisés : \ / : ? * " |
|
||||
check=Vérifier
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=Valores separados por vírgulas (CSV)
|
|||
dark=Escuro
|
||||
didYouMeanToExportToPdf=Referíaste a exportar a PDF?
|
||||
draftFound=Atopouse un borrador para '{1}'. Carrégao no editor ou descártao para continuares.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Arrastre e solte non está implementado para imaxes. Prefires importalas?
|
||||
dropboxCharsNotAllowed=Os seguintes caracteres non están permitidos: \ / : ? * " |
|
||||
check=Validar
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=נמצאה טיוטה עבור '{1}'. טען אותה אל העורך או מחק אותה כדי להמשיך.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=גרירה אינה נתמכת עבור תמונות. תרצה לייבא תמונה במקום?
|
||||
dropboxCharsNotAllowed=התווים הבאים אינם מותרים לשימוש: / \ : ? * " |
|
||||
check=בדוק
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Vázlat találva a '{1}'-hoz. Töltse a szerkesztőbe, vagy dobja el a folytatásért.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Fogd és vidd nincs támogatva képekhez. Szeretné-e importálni?
|
||||
dropboxCharsNotAllowed=A következő betűk nem engedélyezettek: \ / : ? * " |
|
||||
check=Ellenőriz
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=csv
|
|||
dark=dark
|
||||
didYouMeanToExportToPdf=didYouMeanToExportToPdf
|
||||
draftFound=draftFound
|
||||
selectDraft=selectDraft
|
||||
dragAndDropNotSupported=dragAndDropNotSupported
|
||||
dropboxCharsNotAllowed=dropboxCharsNotAllowed
|
||||
check=check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Draf untuk '{1}' ditemukan. Muat ke editor atau buang untuk melanjutkan.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Tidak mendukung seret dan jatuhkan untuk gambar. Anda ingin mengimpor?
|
||||
dropboxCharsNotAllowed=Karakter berikut tidak diizinkan: \ / : ? * " |
|
||||
check=Cek
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=È stata trovata una bozza per '{1}'. Caricala nell'editor o scartala per continuare.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop delle immagini non supportato. Vuoi importare?
|
||||
dropboxCharsNotAllowed=I seguenti caratteri non sono permessi: \ / : ? * " |
|
||||
check=Controlla
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=黒
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=ドラフト{1}が見つかりました。読み込む、または廃棄する。
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=画像のドラッグアンドドロップには対応していません。その代わりに画像読み込みを選択しますか?
|
||||
dropboxCharsNotAllowed=次の文字は使用できません: \ / : ? * " |
|
||||
check=チェック
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound={1}'의 임시저장이 확인되었습니다. 편집하시려면 불러오기를 클릭하시고, 계속하시려면 취소를 클릭해 주시기 바랍니다.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=이미지 드래그하여 붙여넣기는 지원되지 않습니다. 이미지를 불러오시겠습니까?
|
||||
dropboxCharsNotAllowed=다음 문자는 사용할 수 없습니다. \ / : ? * " |
|
||||
check=확인
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Draf bagi '{1}' telah dijumpai. Muat ia ke dalam editor atau buang untuk meneruskan.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Seret dan lepas tidak disokong untuk imej. Adakah anda mahu mengimport?
|
||||
dropboxCharsNotAllowed=Aksara-aksara berikut tidak dibenarkan: \ / : ? * " |
|
||||
check=Semak
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Donker
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Een concept van '{1}' is gevonden. Laad het in de editor of negeer het om door te gaan.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Slepen en plaatsen is niet beschikbaar voor afbeeldingen. Wilt u in plaats daarvan importeren?
|
||||
dropboxCharsNotAllowed=De volgende tekens zijn niet toegestaan: \ / : ? * " |
|
||||
check=Controleren
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Et utkast av '{1}' er funnet. Last det ned i editoren eller forkast det for å fortsette.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Dra og slipp funksjon er ikke tilgjengelig for bilder. Vil du importere i stedet for?
|
||||
dropboxCharsNotAllowed=Følgende tegn er ikke tillatt: \ / : ? * " |
|
||||
check=Sjekk
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Znaleziono wersję roboczą {1}. Załaduj ją do edytora lub odrzuć, by kontynuować.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Przeciągnij i upuść dla obrazów nie jest wspierane. Czy chcesz zamiast tego użyć importowania?
|
||||
dropboxCharsNotAllowed=Następujące znaki są niedozwolone: \ / : ? * " |
|
||||
check=Sprawdź
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Foi encontrado um rascunho para '{1}'. Carregue no editor ou descarte para continuar.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Arraste e solte não suportados para imagens. Gostaria de importar?
|
||||
dropboxCharsNotAllowed=Os seguintes caracteres não são permitidos: \/:?*"|
|
||||
check=Validar
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Encontrado um projeto. Carregar no editor ou rejeitar para continuar.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Arrastar e largar não suportado para imagens. Deseja importar?
|
||||
dropboxCharsNotAllowed=Os seguintes caracteres não são permitidos: \/:?*"|
|
||||
check=Verificar
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=O schiță pentru '{1}' a fost găsită. Încarc-o în editor sau înlătureaz-o pentru a continua.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported= „Drag and Drop” nu este suportat pentru imagini. Doriți să importați in schimb?
|
||||
dropboxCharsNotAllowed=Următoarele caractere nu sunt permise: \ / : ? * " |
|
||||
check=Verifică
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Темная
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Был обнаружен черновик '{1}'. Загрузите его в редактор или откажитесь, чтобы продолжить.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Перетаскивание изображений не поддерживается. Импортировать изображение?
|
||||
dropboxCharsNotAllowed=Следующие символы не допускаются: \ / : ? * " |
|
||||
check=Проверить
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Pronađen nacrt
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Prevlačenje nije podržano
|
||||
dropboxCharsNotAllowed=Sledeći znaci nisu dozvoljeni: \ / : ? * " |
|
||||
check=Provera
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Ett utkast för '{1}' har lokaliserats. Ladda utkastet till behandlaren eller ta bort det för att fortsätta.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Dra-och-släpp tillåts ej för bilder. Vill du istället importera?
|
||||
dropboxCharsNotAllowed=Följande tecken får inte användas: \ / : ? * " |
|
||||
check=Kontroll
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=A draft for '{1}' has been found. Load it into the editor or discard it to continue.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Drag and drop not supported for images. Would you like to import instead?
|
||||
dropboxCharsNotAllowed=The following characters are not allowed: \ / : ? * " |
|
||||
check=Check
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=พบฉบับร่างของ '{1}' แล้ว โหลดไปยังตัวแก้ไขหรือยกเลิกเพื่อดำเนินการต่อ
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=รูปภาพไม่รองรับการลากและวาง คุณต้องการนำเข้าแทนหรือไม่
|
||||
dropboxCharsNotAllowed=ไม่อนุญาตให้ใช้อักขระต่อไปนี้: \ / : ? * " |
|
||||
check=ตรวจสอบ
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Taslak (1) için bulundu. Editöre yükleyiniz veya devam etmek için iptal ediniz.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Desteklenmeyen resimleri sürükle ve at. Veya bu resimleri geri çağırmak ister misiniz ?
|
||||
dropboxCharsNotAllowed=Bu karakterler desteklenmemektedir : \ / : ? * " |
|
||||
check=Kontrol ediniz
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Темно
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Знайдено чернетку '{1}'. Завантажте її в виправник або відмовтеся, щоб продовжити.
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Перетягування зображень не підтримуємо. Чи бажаєте натомість привнести його?
|
||||
dropboxCharsNotAllowed=Перелічені знаки не підтримувані: \ / : ? * " |
|
||||
check=Перевірити
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=Tìm thấy một bản nháp cho '{1}'. Tải lại bản nháp này hoặc loại bỏ bản nháp để tiếp tục
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=Kéo và thả không hỗ trợ cho hình ảnh. Thay vào đó, bạn có muốn nhập hình ảnh vào không?
|
||||
dropboxCharsNotAllowed=Những kí tự sau không được chấp nhận: \ / : ? * " |
|
||||
check=Kiểm tra
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=Did you mean to export to PDF?
|
||||
draftFound=發現現有的「{1}」的草圖。要載入它進行編輯或是丟棄以繼續?
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=不支援圖片拖放。是否使用匯入選項?
|
||||
dropboxCharsNotAllowed=不得使用以下字元:\ / : ? * " |
|
||||
check=檢查
|
||||
|
|
|
@ -103,6 +103,7 @@ csv=CSV
|
|||
dark=Dark
|
||||
didYouMeanToExportToPdf=是否要导出到 PDF?
|
||||
draftFound={1} 的草稿已经找到。将其加载到编辑器或将其丢弃以继续。
|
||||
selectDraft=Select a draft to continue editing:
|
||||
dragAndDropNotSupported=暂不支持图片拖放功能。是否要使用导入?
|
||||
dropboxCharsNotAllowed=系统不允许使用下列字符:\ / : ? * " |
|
||||
check=核查
|
||||
|
|
|
@ -6,7 +6,7 @@ if (workbox)
|
|||
workbox.precaching.precacheAndRoute([
|
||||
{
|
||||
"url": "js/app.min.js",
|
||||
"revision": "e4bdc7bc591e4ac5a3efc3a8cd0c0c90"
|
||||
"revision": "6a5b4f7606a4f4123ad03042a50c7ede"
|
||||
},
|
||||
{
|
||||
"url": "index.html",
|
||||
|
@ -90,7 +90,7 @@ if (workbox)
|
|||
},
|
||||
{
|
||||
"url": "resources/dia.txt",
|
||||
"revision": "9d820f5a07c86de75410ae2616f1e416"
|
||||
"revision": "26b509d2e116e5ad6162e54153779e89"
|
||||
},
|
||||
{
|
||||
"url": "images/delete.png",
|
||||
|
|
Loading…
Reference in a new issue