Browse Source

7.7.8 release

Former-commit-id: a0e1f5478643a8956c3048540ce8aa88791c1ab5
Gaudenz Alder 7 years ago
parent
commit
f2add5fdf4

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+29-NOV-2017: 7.7.8
+
+- Removes dashed borders for editing paragraphs
+
 28-NOV-2017: 7.7.7
 
 - Adds Sitemap sidebar

+ 1 - 1
README.md

@@ -19,7 +19,7 @@ The [mxGraph documentation](https://jgraph.github.io/mxgraph/) provides a lot of
 
 Running
 -------
-The simplest way to run draw.io initially is to fork this project, [publish the master branch to GitHub pages](https://help.github.com/categories/github-pages-basics/) and the [pages sites](https://jgraph.github.io/drawio/war/index.html) will have the full editor functionality (sans the integrations).
+The simplest way to run draw.io initially is to fork this project, [publish the master branch to GitHub pages](https://help.github.com/categories/github-pages-basics/) and the [pages sites](https://jgraph.github.io/draw.io/war/index.html) will have the full editor functionality (sans the integrations).
 
 The full packaged .war of the client and servlets is built when the project is tagged and available on the [releases page](https://github.com/jgraph/draw.io/releases).
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-7.7.7
+7.7.8

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 11/28/2017 02:53 PM
+# 11/29/2017 09:42 AM
 
 app.html
 index.html?offline=1

+ 0 - 1
war/index.html

@@ -152,7 +152,6 @@
 			addMeta('apple-mobile-web-app-title', name);
 			addMeta('application-name', name);
 		})();
-
 	</script>
     <link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/plgmlhohecdddhbmmkncjdmlhcmaachm">
 	<link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">

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


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


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


+ 1 - 1
war/js/diagramly/Dialogs.js

@@ -2295,7 +2295,7 @@ var ParseDialog = function(editorUi, title)
 					graph.getModel().endUpdate();
 				}
 				
-				graph.setSelectionCells(listCell);
+				graph.setSelectionCell(listCell);
 				graph.scrollCellToVisible(graph.getSelectionCell());
 			}
 		}

+ 7 - 2
war/js/diagramly/EditorUi.js

@@ -31,6 +31,11 @@
 	EditorUi.isElectronApp = window != null && window.process != null &&
 		window.process.versions != null && window.process.versions['electron'] != null;
 
+	/**
+	 * Link for scratchpad help.
+	 */
+	EditorUi.scratchpadHelpLink = 'https://desk.draw.io/support/solutions/articles/16000042367';
+	
 	/**
 	 * Contains the default XML for an empty diagram.
 	 */
@@ -2153,7 +2158,7 @@
 			btn.setAttribute('title', mxResources.get('add'));
 			buttons.insertBefore(btn, buttons.firstChild);
 			
-			if (!this.isOffline() && file.title == '.scratchpad')
+			if (!this.isOffline() && file.title == '.scratchpad' && EditorUi.scratchpadHelpLink != null)
 			{
 				var link = document.createElement('span');
 				link.setAttribute('title', mxResources.get('help'));
@@ -2163,7 +2168,7 @@
 				
 				mxEvent.addGestureListeners(link, mxUtils.bind(this, function(evt)
 				{
-					this.openLink('https://desk.draw.io/support/solutions/articles/16000042367');
+					this.openLink(EditorUi.scratchpadHelpLink);
 					mxEvent.consume(evt);
 				}));
 				

+ 83 - 28
war/js/diagramly/graphml/mxGraphMlCodec.js

@@ -21,26 +21,73 @@ mxGraphMlCodec.prototype.decode = function (xml, callback)
 		var pageElement = graphs[i];
 
 		var graph = this.createMxGraph();
-        graph.getModel().beginUpdate();
-        
-        this.nodesMap = {};
-    	this.edges = [];
-        this.importGraph(pageElement, graph, graph.getDefaultParent());
-    	
-    	for (var i = 0; i < this.edges.length; i++)
-		{
-    		var edgesObj = this.edges[i];
-    		var edges = edgesObj.edges;
-    		var parent = edgesObj.parent;
-    		var dx = edgesObj.dx, dy = edgesObj.dy;
-
-	    	for (var j = 0; j < edges.length; j++)
-	    	{
-	    		this.importEdge(edges[j], graph, parent, dx, dy);
-	    	}
-		}
+		var model = graph.getModel();
+		
+        model.beginUpdate();
+        try 
+        {
+	        this.nodesMap = {};
+	    	this.edges = [];
+	        this.importGraph(pageElement, graph, graph.getDefaultParent());
+	    	
+	    	for (var i = 0; i < this.edges.length; i++)
+			{
+	    		var edgesObj = this.edges[i];
+	    		var edges = edgesObj.edges;
+	    		var parent = edgesObj.parent;
+	    		var dx = edgesObj.dx, dy = edgesObj.dy;
+	
+		    	for (var j = 0; j < edges.length; j++)
+		    	{
+		    		this.importEdge(edges[j], graph, parent, dx, dy);
+		    	}
+			}
+        }
+        catch(e)
+        {
+        	console.log(e);
+        }
+        finally
+        {
+        	model.endUpdate();
+        }
     	
-    	graph.getModel().endUpdate();
+    	//update edges' labels to convert their labels relative coordinate to ours
+        model.beginUpdate();
+        try 
+        {
+        	var cells = graph.getModel().cells;
+        	
+        	for (var id in cells)
+    		{
+        		var cell = cells[id];
+        		var geo = cell.geometry;
+        		
+        		if (cell.parent && cell.parent.edge && geo.relative)
+    			{
+        			var state = graph.view.getState(cell.parent);
+        			var abdPs = state.absolutePoints;
+        			var p0 = abdPs[0];
+        			var pe = abdPs[abdPs.length - 1];
+        			
+        			geo.relative = false;
+        			
+        			var ratio = geo.x;
+        			geo.x = p0.x + ratio * (pe.x - p0.x);
+        			geo.y = p0.y + ratio * (pe.y - p0.y);
+        			
+        			console.log(ratio);
+    			}
+    		}
+        }
+        catch(e)
+        {
+        	console.log(e);
+        }
+        finally
+        {
+        	model.endUpdate();
+        }
     	
         mxFile += this.processPage(graph, i+1);
 	}
@@ -739,7 +786,9 @@ mxGraphMlCodec.prototype.handleTemplates = function (template, userTags, node, s
 {
 	if (template)
 	{
-		var header = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g>';
+		var w = node.geometry.width;
+		var h = node.geometry.height;
+		var header = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+ w + ' ' + h +'"><g>';
 		var footer = '</g></svg>';
 		
 		//TODO optimize this! probably only the text before defs has bindings
@@ -754,10 +803,10 @@ mxGraphMlCodec.prototype.handleTemplates = function (template, userTags, node, s
 	        switch (matches[1])
 	        {
 	        	case "width":
-	        		replacement = node.geometry.width;
+	        		replacement = w;
 	        	break;
 	        	case "height":
-	        		replacement = node.geometry.height;
+	        		replacement = h;
 	    		break;
 	        }
 	        
@@ -1031,6 +1080,8 @@ mxGraphMlCodec.prototype.handleCompoundShape = function (node, styleMap, mlStyle
 				
 				var maxX = xShift.x;
 				var initX = xShift.x;
+				xShift.lx = xShift.x;
+				
 				//TODO We need two passes to determine the header size!
 				if (rows)
 				{
@@ -1040,6 +1091,7 @@ mxGraphMlCodec.prototype.handleCompoundShape = function (node, styleMap, mlStyle
 					for (var i = 0; i < rows.length; i++)
 					{
 						xShift.x = initX;
+						xShift.lx = initX;
 						y = this.addRow(rows[i], node, (i & 1), y, xShift, rowMapping, defRowStyle);
 						maxX = Math.max(xShift.x, maxX);
 					}
@@ -1089,7 +1141,7 @@ mxGraphMlCodec.prototype.addRow = function(row, parent, odd, y, xShift, rowMappi
 	}
 	
 	var height = parseFloat(rowStyle["height"]);
-	cell.geometry = new mxGeometry(xShift.x, y, parent.geometry.width - xShift.x, height);
+	cell.geometry = new mxGeometry(xShift.lx, y, parent.geometry.width - xShift.lx, height);
 
 	var lblObj = row["Labels"];
 	
@@ -1101,12 +1153,14 @@ mxGraphMlCodec.prototype.addRow = function(row, parent, odd, y, xShift, rowMappi
 	
 	var subRow = row["y:Row"];
 
+	xShift.lx = 0;
 	if (rowStyle["startSize"])
 	{
-		xShift.x += parseFloat(rowStyle["startSize"]);
+		xShift.lx = parseFloat(rowStyle["startSize"]);
+		xShift.x += xShift.lx;
 	}
 	
-	var initX = xShift.x, maxX = xShift.x;
+	var initX = xShift.x, maxX = xShift.x, initLx = xShift.lx;
 	var subY = 0;
 	if (subRow)
 	{
@@ -1116,6 +1170,7 @@ mxGraphMlCodec.prototype.addRow = function(row, parent, odd, y, xShift, rowMappi
 		for (var i = 0; i < subRow.length; i++)
 		{
 			xShift.x = initX;
+			xShift.lx = initLx;
 			subY = this.addRow(subRow[i], cell, (i & 1), subY, xShift, rowMapping, defRowStyle);
 			maxX = Math.max(xShift.x, maxX) 
 		}
@@ -1220,7 +1275,7 @@ mxGraphMlCodec.prototype.addNodeGeo = function (node, geoObj, dx, dy)
 	}
 };
 
-//TODO handle ports
+//TODO handle other ports cases
 mxGraphMlCodec.prototype.importEdge = function (edgeElement, graph, parent, dx, dy)
 {
 	var data = this.getDirectChildNamedElements(edgeElement, mxGraphMlConstants.DATA);
@@ -1248,7 +1303,7 @@ mxGraphMlCodec.prototype.importEdge = function (edgeElement, graph, parent, dx,
 		} 
 		else if (dataObj.key == this.edgesKeys[mxGraphMlConstants.EDGE_STYLE].key) 
 		{
-			console.log(dataObj);
+//			console.log(dataObj);
 			this.addEdgeStyle(edge, dataObj, style);
 		}
 		else if (dataObj.key == this.edgesKeys[mxGraphMlConstants.EDGE_LABELS].key) 
@@ -1639,7 +1694,7 @@ mxGraphMlCodec.prototype.addLabels = function (node, LblObj, nodeStyle)
 				//TODO calculate the absolute value based on edge start/end points only, then orthogonal distance. Finally, convert it back to mxGraph relative point
 				if (ratio)
 				{
-					lGeo.x = 2 * parseFloat(ratio) - 2;
+					lGeo.x = parseFloat(ratio);//2 * parseFloat(ratio) - 2;
 				}
 				
 				if (distance)

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


+ 1 - 1
war/js/mxgraph/EditorUi.js

@@ -3590,7 +3590,7 @@ EditorUi.prototype.showBackgroundImageDialog = function(apply)
 {
 	apply = (apply != null) ? apply : mxUtils.bind(this, function(image)
 	{
-		var change = new ChangeGraphBackground(this, null, image);
+		var change = new ChangePageSetup(this, null, image);
 		change.ignoreColor = true;
 		
 		this.editor.graph.model.execute(change);

+ 1 - 0
war/js/mxgraph/Format.js

@@ -1502,6 +1502,7 @@ ArrangePanel.prototype.addGroupOps = function(div)
 	var cell = graph.getSelectionCell();
 	var ss = this.format.getSelectionState();
 	var count = 0;
+	var btn = null;
 	
 	div.style.paddingTop = '8px';
 	div.style.paddingBottom = '6px';

+ 2 - 1
war/js/mxgraph/Graph.js

@@ -1566,6 +1566,7 @@ Graph.prototype.replacePlaceholders = function(cell, str)
 {
 	var result = [];
 	var last = 0;
+	var math = [];
 	
 	while (match = this.placeholderPattern.exec(str))
 	{
@@ -6020,7 +6021,7 @@ if (typeof mxVertexHandler != 'undefined')
 		{
 		    if (window.getSelection)
 		    {
-		        sel = window.getSelection();
+		        var sel = window.getSelection();
 		        
 		        if (sel.getRangeAt && sel.rangeCount)
 		        {

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


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


+ 0 - 3
war/styles/grapheditor.css

@@ -10,9 +10,6 @@
 .geMenubarContainer .geItem, .geToolbar .geButton, .geToolbar .geLabel, .geSidebarContainer .geTitle {
 	cursor:pointer !important;
 }
-.geContentEditable div, .geContentEditable table, .geContentEditable table td {
-	border: 1px dashed lightGray;
-}
 .geBackgroundPage {
   	-webkit-box-shadow:0px 0px 3px 0px #d9d9d9;
 	-moz-box-shadow:0px 0px 3px 0px #d9d9d9;

File diff suppressed because it is too large
+ 1 - 1
war/templates/engineering/electrical_1.xml