Browse Source

7.0.8 release

Former-commit-id: 618eff1544e7c763d12219cba21d8256044d6a1d
Gaudenz Alder 8 years ago
parent
commit
e463c32564

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+11-AUG-2017: 7.0.8
+
+- Fixes error handling in Confluence Cloud add-on
+
 10-AUG-2017: 7.0.7
 
 - Adds anonymize plugin (p=anon)

+ 1 - 1
VERSION

@@ -1 +1 @@
-7.0.7
+7.0.8

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 08/10/2017 11:05 AM
+# 08/11/2017 12:06 PM
 
 app.html
 index.html?offline=1

+ 1 - 1
war/electron.js

@@ -57,7 +57,7 @@ function createWindow (opt = {}) {
 	mainWindow.loadURL(wurl)
 
 	// Open the DevTools.
-	//if (__DEV__)
+	if (__DEV__)
 	{
 		mainWindow.webContents.openDevTools()
 	}

File diff suppressed because it is too large
+ 240 - 239
war/js/app.min.js


File diff suppressed because it is too large
+ 302 - 302
war/js/atlas-viewer.min.js


File diff suppressed because it is too large
+ 541 - 540
war/js/atlas.min.js


+ 9 - 1
war/js/diagramly/App.js

@@ -492,6 +492,14 @@ App.main = function(callback)
 			
 			if (temp != null)
 			{
+				// Used to request draw.io sources in dev mode
+				var drawDevUrl = '';
+
+				if (urlParams['drawdev'] == '1')
+				{
+					drawDevUrl = document.location.protocol + '//drawhost.jgraph.com/';
+				}
+				
 				// Mapping from key to URL in App.plugins
 				var t = temp.split(';');
 				
@@ -501,7 +509,7 @@ App.main = function(callback)
 					
 					if (url != null)
 					{
-						mxscript(url);
+						mxscript(drawDevUrl + url);
 					}
 					else if (window.console != null)
 					{

+ 12 - 0
war/js/diagramly/ElectronApp.js

@@ -801,5 +801,17 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 		}), 0);
 	};
 	
+	EditorUi.prototype.createImageUrlConverter = function()
+	{
+		var converter = new mxUrlConverter();
+		converter.updateBaseUrl();
+		return converter;
+	};
+	
+	EditorUi.prototype.isCorsEnabledForUrl = function()
+	{
+		return true;
+	}
+
 	EditorUi.prototype.addBeforeUnloadListener = function() {};
 })();

+ 42 - 3
war/js/diagramly/Extensions.js

@@ -2085,9 +2085,10 @@
 			
 			if (p != null)
 			{
+				//adds label
 				cell.value = convertText(p);
 
-				//adds labels and font size
+				//adds font size
 				var isV = 0;
 				
 				if (p.Text != null)
@@ -2108,7 +2109,7 @@
 									isV = 1;
 
 									var fontSize = currM.v;
-									fontSize = fontSize / 2;
+									fontSize = Math.round(fontSize / 1.7);
 									cell.style += 'fontSize=' + fontSize + ';';
 								}
 							}
@@ -2119,7 +2120,45 @@
 				
 				if (isV == 0)
 				{
-					cell.style += 'fontSize=9;';
+					cell.style += 'fontSize=10;';
+				}
+				
+				//adds font color
+				var isC = 0;
+				
+				if (p.Text != null)
+				{
+					if (p.Text.m != null)
+					{
+						var m = p.Text.m;
+						var i = 0;
+						
+						while ((isC == 0) && (i < m.length))
+						{
+							var currM = m[i];
+							
+							if (currM.n == 'c')
+							{
+								if (currM.v != null)
+								{
+									isC = 1;
+									
+									var currV = currM.v;
+									
+									if (currV.charAt(0) != '#')
+									{
+										currV = '#' + currV;
+									}
+
+									var currV = currV.substring(0, 7);
+
+									cell.style += mxConstants.STYLE_FONTCOLOR + '=' + currV + ';';
+								}
+							}
+							
+							i++;
+						}
+					}
 				}
 				
 				// Converts images

File diff suppressed because it is too large
+ 99 - 99
war/js/embed-static.min.js


File diff suppressed because it is too large
+ 114 - 114
war/js/extensions.min.js


+ 82 - 30
war/js/mxgraph/Shapes.js

@@ -1346,7 +1346,7 @@
 	    var x = line1Start.x + (a * (line1End.x - line1Start.x));
 	    var y = line1Start.y + (a * (line1End.y - line1Start.y));
 
-	    if (a > 0 && a <= 1)// on line1?
+	    if (a >= 0 && a <= 1)// on line1?
 	    	{
 		  	  var dx = line2End.x - x;
 			  var dy = line2End.y - y;
@@ -1400,12 +1400,21 @@
 		var cx = bounds.getCenterX();
 		var cy = bounds.getCenterY();
 		
-		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
+		var p1 = new mxPoint(cx, cy);
+		
+		if (orthogonal)
+		{
+			if (next.x < x || next.x > x + w)
+				p1.y = next.y;
+			else
+				p1.x = next.x;
+		}
+		
+		return mxPerimeter.getPerimeterPoint(points, p1, next);
 	};
 	
 	mxStyleRegistry.putValue('parallelogramPerimeter', mxPerimeter.ParallelogramPerimeter);
 	
-	
 	//Trapezoid Perimeter
 	mxPerimeter.TrapezoidPerimeter = function (bounds, vertex, next, orthogonal)
 	{
@@ -1429,7 +1438,17 @@
 		var cx = bounds.getCenterX();
 		var cy = bounds.getCenterY();
 		
-		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
+		var p1 = new mxPoint(cx, cy);
+		
+		if (orthogonal)
+		{
+			if (next.x < x || next.x > x + w)
+				p1.y = next.y;
+			else
+				p1.x = next.x;
+		}
+
+		return mxPerimeter.getPerimeterPoint(points, p1, next);
 	};
 	
 	mxStyleRegistry.putValue('trapezoidPerimeter', mxPerimeter.TrapezoidPerimeter);
@@ -1458,7 +1477,17 @@
 						new mxPoint(x + w - dx, y + h), new mxPoint(x, y + h),
 						new mxPoint(x + dx, cy), new mxPoint(x, y)];
 		
-		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
+		var p1 = new mxPoint(cx, cy);
+		
+		if (orthogonal)
+		{
+			if (next.x < x || next.x > x + w)
+				p1.y = next.y;
+			else
+				p1.x = next.x;
+		}
+		
+		return mxPerimeter.getPerimeterPoint(points, p1, next);
 	};
 	
 	mxStyleRegistry.putValue('stepPerimeter', mxPerimeter.StepPerimeter);
@@ -1487,7 +1516,17 @@
 						new mxPoint(x + w - dx, y + h), new mxPoint(x + dx, y + h),
 						new mxPoint(x, cy), new mxPoint(x + dx, y)];
 		
-		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
+		var p1 = new mxPoint(cx, cy);
+		
+		if (orthogonal)
+		{
+			if (next.x < x || next.x > x + w)
+				p1.y = next.y;
+			else
+				p1.x = next.x;
+		}
+		
+		return mxPerimeter.getPerimeterPoint(points, p1, next);
 	};
 	
 	mxStyleRegistry.putValue('hexagonPerimeter2', mxPerimeter.HexagonPerimeter2);
@@ -2521,11 +2560,10 @@
 		};
 	}
 	
-	
 	// Handlers are only added if mxVertexHandler is defined (ie. not in embedded graph)
 	if (typeof mxVertexHandler !== 'undefined')
 	{
-		function createHandle(state, keys, getPositionFn, setPositionFn, ignoreGrid)
+		function createHandle(state, keys, getPositionFn, setPositionFn, ignoreGrid, redrawEdges)
 		{
 			var handle = new mxHandle(state, null, mxVertexHandler.prototype.secondaryHandleImage);
 			
@@ -2536,11 +2574,26 @@
 					this.copyStyle(keys[i]);
 				}
 			};
-
+			
 			handle.getPosition = getPositionFn;
 			handle.setPosition = setPositionFn;
 			handle.ignoreGrid = (ignoreGrid != null) ? ignoreGrid : true;
 			
+			// Overridden to update connected edges
+			if (redrawEdges)
+			{
+				var positionChanged = handle.positionChanged;
+				
+				handle.positionChanged = function()
+				{
+					positionChanged.apply(this, arguments);
+					
+					// Redraws connected edges TODO: Include child edges
+					state.view.invalidate(this.state.cell);
+					state.view.validate();
+				};
+			}
+			
 			return handle;
 		};
 		
@@ -2589,7 +2642,7 @@
 				}, function(bounds, pt)
 				{
 					this.state.style['size'] = Math.max(0, Math.min(max, (pt.x - bounds.x) / (bounds.width * 0.75)));
-				})];
+				}, null, true)];
 				
 				if (mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
 				{
@@ -2600,7 +2653,7 @@
 			};
 		};
 		
-		function createDisplayHandleFunction(defaultValue, allowArcHandle, max)
+		function createDisplayHandleFunction(defaultValue, allowArcHandle, max, redrawEdges)
 		{
 			max = (max != null) ? max : 1;
 			
@@ -2614,7 +2667,7 @@
 				}, function(bounds, pt)
 				{
 					this.state.style['size'] = Math.max(0, Math.min(max, (pt.x - bounds.x) / bounds.width));
-				})];
+				}, null, redrawEdges)];
 				
 				if (allowArcHandle && mxUtils.getValue(state.style, mxConstants.STYLE_ROUNDED, false))
 				{
@@ -3134,8 +3187,8 @@
 					this.state.style['size'] = Math.max(0, Math.min(1, (bounds.y + bounds.height - pt.y) / bounds.height));
 				})];
 			},
-			'step': createDisplayHandleFunction(StepShape.prototype.size, true),
-			'hexagon': createDisplayHandleFunction(HexagonShape.prototype.size, true, 0.5),
+			'step': createDisplayHandleFunction(StepShape.prototype.size, true, null, true),
+			'hexagon': createDisplayHandleFunction(HexagonShape.prototype.size, true, 0.5, true),
 			'curlyBracket': createDisplayHandleFunction(CurlyBracketShape.prototype.size, false),
 			'display': createDisplayHandleFunction(DisplayShape.prototype.size, false),
 			'cube': createCubeHandleFunction(1, CubeShape.prototype.size, false),
@@ -3420,19 +3473,18 @@
 		                                new mxConnectionConstraint(new mxPoint(1, 0.65), false),
 										new mxConnectionConstraint(new mxPoint(0.25, 1), false),
 										new mxConnectionConstraint(new mxPoint(0.75, 0), false)];
-	// TODO: Relative ports
 	StepShape.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.25, 0), true),
-                                       new mxConnectionConstraint(new mxPoint(0.5, 0), true),
-                                       new mxConnectionConstraint(new mxPoint(0.75, 0), true),
-                                       new mxConnectionConstraint(new mxPoint(0.25, 1), true),
-  	        	            		 	new mxConnectionConstraint(new mxPoint(0.5, 1), true),
-  	        	            		 	new mxConnectionConstraint(new mxPoint(0.75, 1), true),
-	                                   new mxConnectionConstraint(new mxPoint(0.1, 0.25), false),
-	                                   new mxConnectionConstraint(new mxPoint(0.2, 0.5), false),
-	                                   new mxConnectionConstraint(new mxPoint(0.1, 0.75), false),
-	                                   new mxConnectionConstraint(new mxPoint(0.9, 0.25), false),
-		                                new mxConnectionConstraint(new mxPoint(1, 0.5), false),
-		                                new mxConnectionConstraint(new mxPoint(0.9, 0.75), false)];
+									new mxConnectionConstraint(new mxPoint(0.5, 0), true),
+									new mxConnectionConstraint(new mxPoint(0.75, 0), true),
+									new mxConnectionConstraint(new mxPoint(0.25, 1), true),
+									new mxConnectionConstraint(new mxPoint(0.5, 1), true),
+									new mxConnectionConstraint(new mxPoint(0.75, 1), true),
+									new mxConnectionConstraint(new mxPoint(0.1, 0.25), true),
+									new mxConnectionConstraint(new mxPoint(0.2, 0.5), true),
+									new mxConnectionConstraint(new mxPoint(0.1, 0.75), true),
+									new mxConnectionConstraint(new mxPoint(0.9, 0.25), true),
+									new mxConnectionConstraint(new mxPoint(1, 0.5), true),
+									new mxConnectionConstraint(new mxPoint(0.9, 0.75), true)];
 	mxLine.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0, 0.5), false),
 	                                new mxConnectionConstraint(new mxPoint(0.25, 0.5), false),
 	                                new mxConnectionConstraint(new mxPoint(0.75, 0.5), false),
@@ -3450,13 +3502,13 @@
 	mxHexagon.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.375, 0), true),
 	                                    new mxConnectionConstraint(new mxPoint(0.5, 0), true),
 	                                   new mxConnectionConstraint(new mxPoint(0.625, 0), true),
-	                                   new mxConnectionConstraint(new mxPoint(0.125, 0.25), false),
+	                                   new mxConnectionConstraint(new mxPoint(0.125, 0.25), true),
 	                                   new mxConnectionConstraint(new mxPoint(0, 0.5), true),
-	                                   new mxConnectionConstraint(new mxPoint(0.125, 0.75), false),
-	                                   new mxConnectionConstraint(new mxPoint(0.875, 0.25), false),
+	                                   new mxConnectionConstraint(new mxPoint(0.125, 0.75), true),
+	                                   new mxConnectionConstraint(new mxPoint(0.875, 0.25), true),
 	                                   new mxConnectionConstraint(new mxPoint(0, 0.5), true),
 	                                   new mxConnectionConstraint(new mxPoint(1, 0.5), true),
-	                                   new mxConnectionConstraint(new mxPoint(0.875, 0.75), false),
+	                                   new mxConnectionConstraint(new mxPoint(0.875, 0.75), true),
 	                                   new mxConnectionConstraint(new mxPoint(0.375, 1), true),
 	                                    new mxConnectionConstraint(new mxPoint(0.5, 1), true),
 	                                   new mxConnectionConstraint(new mxPoint(0.625, 1), true)];

+ 4 - 4
war/js/mxgraph/Sidebar.js

@@ -934,16 +934,16 @@ Sidebar.prototype.addGeneralPalette = function(expand)
 		this.createVertexTemplateEntry('ellipse;shape=doubleEllipse;whiteSpace=wrap;html=1;aspect=fixed;', 80, 80, '', 'Double Circle', null, null, 'double circle'),
 	 	this.createVertexTemplateEntry('shape=process;whiteSpace=wrap;html=1;', 120, 60, '', 'Process', null, null, 'process task'),
 	 	this.createVertexTemplateEntry('rhombus;whiteSpace=wrap;html=1;', 80, 80, '', 'Diamond', null, null, 'diamond rhombus if condition decision conditional question test'),
-	 	this.createVertexTemplateEntry('shape=parallelogram;whiteSpace=wrap;html=1;', 120, 60, '', 'Parallelogram'),
-	 	this.createVertexTemplateEntry('shape=hexagon;perimeter=hexagonPerimeter;whiteSpace=wrap;html=1;', 120, 80, '', 'Hexagon', null, null, 'hexagon preparation'),
+	 	this.createVertexTemplateEntry('shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;', 120, 60, '', 'Parallelogram'),
+	 	this.createVertexTemplateEntry('shape=hexagon;perimeter=hexagonPerimeter2;whiteSpace=wrap;html=1;', 120, 80, '', 'Hexagon', null, null, 'hexagon preparation'),
 	 	this.createVertexTemplateEntry('triangle;whiteSpace=wrap;html=1;', 60, 80, '', 'Triangle', null, null, 'triangle logic inverter buffer'),
 	 	this.createVertexTemplateEntry('shape=cylinder;whiteSpace=wrap;html=1;', 60, 80, '', 'Cylinder', null, null, 'cylinder data database'),
 	 	this.createVertexTemplateEntry('ellipse;shape=cloud;whiteSpace=wrap;html=1;', 120, 80, '', 'Cloud', null, null, 'cloud network'),
 	 	this.createVertexTemplateEntry('shape=document;whiteSpace=wrap;html=1;', 120, 80, '', 'Document'),
 	 	this.createVertexTemplateEntry('shape=internalStorage;whiteSpace=wrap;html=1;', 80, 80, '', 'Internal Storage'),
 	 	this.createVertexTemplateEntry('shape=cube;whiteSpace=wrap;html=1;', 120, 80, '', 'Cube'),
-	 	this.createVertexTemplateEntry('shape=step;whiteSpace=wrap;html=1;', 120, 80, '', 'Step'),
-	 	this.createVertexTemplateEntry('shape=trapezoid;whiteSpace=wrap;html=1;', 120, 60, '', 'Trapezoid'),
+	 	this.createVertexTemplateEntry('shape=step;perimeter=stepPerimeter;whiteSpace=wrap;html=1;', 120, 80, '', 'Step'),
+	 	this.createVertexTemplateEntry('shape=trapezoid;perimeter=trapezoidPerimeter;whiteSpace=wrap;html=1;', 120, 60, '', 'Trapezoid'),
 	 	this.createVertexTemplateEntry('shape=tape;whiteSpace=wrap;html=1;', 120, 100, '', 'Tape'),
 	 	this.createVertexTemplateEntry('shape=note;whiteSpace=wrap;html=1;', 80, 100, '', 'Note'),
 	    this.createVertexTemplateEntry('shape=card;whiteSpace=wrap;html=1;', 80, 100, '', 'Card'),

File diff suppressed because it is too large
+ 99 - 99
war/js/reader.min.js


File diff suppressed because it is too large
+ 302 - 302
war/js/viewer.min.js


+ 1 - 1
war/package.json

@@ -29,4 +29,4 @@
   "devDependencies": {
     "electron": "^1.6.12"
   }
-}
+}

+ 9 - 1
war/plugins/anonymize.js

@@ -85,6 +85,9 @@ Draw.loadPlugin(function(editorUi)
 		model.beginUpdate();
 		try
 		{
+			// Queue used to fix ancestor placeholders
+			var queue = [];
+
 			for (var id in model.cells)
 			{
 				var cell = model.cells[id];
@@ -99,7 +102,12 @@ Draw.loadPlugin(function(editorUi)
 					label = anonymizeString(label);
 				}
 				
-				model.setValue(cell, label);
+				queue.push({cell: cell, label: label});
+			}
+			
+			for (var i = 0; i < queue.length; i++)
+			{
+				model.setValue(queue[i].cell, queue[i].label);
 			}
 		}
 		finally