Gaudenz Alder преди 8 години
родител
ревизия
44d42778fb

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+08-JUN-2017: 6.7.8
+
+- Fixes saving local files in MS Edge
+- Fixes binary after text export in Safari
+- Fixes title for offline iOS homescreen app
+
 06-JUN-2017: 6.7.7
 
 - Fixes broken links in cache.manifest

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.7.7
+6.7.8

+ 28 - 16
src/com/mxgraph/io/gliffy/importer/GliffyDiagramConverter.java

@@ -38,6 +38,7 @@ import com.mxgraph.model.mxCell;
 import com.mxgraph.model.mxGeometry;
 import com.mxgraph.util.mxDomUtils;
 import com.mxgraph.util.mxPoint;
+import com.mxgraph.util.mxUtils;
 import com.mxgraph.util.mxXmlUtils;
 import com.mxgraph.view.mxGraphHeadless;
 
@@ -371,12 +372,13 @@ public class GliffyDiagramConverter
 				
 				if(style.lastIndexOf("fillColor") == -1)
 					style.append("fillColor=" + shape.fillColor).append(";");
-				
 				if(style.lastIndexOf("strokeColor") == -1)
 					style.append("strokeColor=" + shape.strokeColor).append(";");
-
-				if(shape.gradient && !gliffyObject.isGradientIgnored() && style.lastIndexOf("gradient") == -1)
+				
+				if (style.lastIndexOf("gradient") == -1 && shape.gradient && !gliffyObject.isGradientIgnored())
+				{
 					style.append("gradientColor=" + gliffyObject.getGradientColor() + ";gradientDirection=north;");
+				}
 
 				// opacity value is wrong for venn circles, so ignore it and use the one in the mapping
 				if (!gliffyObject.isVennCircle())
@@ -460,22 +462,12 @@ public class GliffyDiagramConverter
 				style.append("image=data:image/svg+xml,").append(res.getBase64EncodedData()).append(";");
 			} 
 		} 
-		// swimlanes have children w/o uid so their children are converted here ad hoc
+		// swimlanes have children without uid so their children are converted here ad hoc
 		else if (gliffyObject.isSwimlane())
 		{
 			cell.setVertex(true);
 			style.append(StencilTranslator.translate(gliffyObject.uid)).append(";");
 
-			boolean vertical = true;
-			
-			if (gliffyObject.uid.startsWith(GliffyObject.H_SWIMLANE))
-			{
-				vertical = false;
-				cell.getGeometry().setWidth(gliffyObject.height);
-				cell.getGeometry().setHeight(gliffyObject.width);
-				style.append("horizontal=0;");
-			}
-
 			GliffyObject header = gliffyObject.children.get(0);// first child is the header of the swimlane
 			
 			GliffyShape shape = header.graphic.getShape();
@@ -484,6 +476,12 @@ public class GliffyDiagramConverter
 			style.append("fillColor=" + shape.fillColor).append(";");
 			style.append("strokeColor=" + shape.strokeColor).append(";");
 			style.append("whiteSpace=wrap;");
+			
+			double rads = Math.toRadians(gliffyObject.rotation);
+			mxPoint pivot = new mxPoint(gliffyObject.width/ 2, gliffyObject.height / 2);
+			double cos = Math.cos(rads);
+			double sin = Math.sin(rads);
+			mxPoint baseP = mxUtils.getRotatedPoint(new mxPoint(0, 0), cos, sin, pivot);
 
 			for (int i = 1; i < gliffyObject.children.size(); i++) // rest of the children are lanes
 			{
@@ -492,19 +490,33 @@ public class GliffyDiagramConverter
 
 				GliffyShape gs = gLane.graphic.getShape();
 				StringBuilder laneStyle = new StringBuilder();
-				laneStyle.append("swimlane;swimlaneLine=0;" + (vertical ? "" : "horizontal=0;"));
+				laneStyle.append("swimlane;swimlaneLine=0;");
 				laneStyle.append("strokeWidth=" + gs.strokeWidth).append(";");
 				laneStyle.append("shadow=" + (gs.dropShadow ? 1 : 0)).append(";");
 				laneStyle.append("fillColor=" + gs.fillColor).append(";");
 				laneStyle.append("strokeColor=" + gs.strokeColor).append(";");
 				laneStyle.append("whiteSpace=wrap;html=1;");
+				
+				mxGeometry childGeometry = null;
+				
+				if(gliffyObject.rotation != 0) 
+				{
+					laneStyle.append("rotation=" + gliffyObject.rotation).append(";");
+					mxPoint pointAbs = new mxPoint(gLane.x, gLane.y );
+					pointAbs = mxUtils.getRotatedPoint(pointAbs, cos, sin, pivot);
+					childGeometry = new mxGeometry(pointAbs.getX()  - baseP.getX(), pointAbs.getY() - baseP.getY(), gLane.width, gLane.height);
+				}
+				else 
+				{
+					childGeometry = new mxGeometry(gLane.x, gLane.y, gLane.width, gLane.height);
+				}
 
 				mxCell mxLane = new mxCell();
 				mxLane.setVertex(true);
 				cell.insert(mxLane);
 				mxLane.setValue(gLane.children.get(0).getText());
 				mxLane.setStyle(laneStyle.toString());
-				mxGeometry childGeometry = new mxGeometry(gLane.x, gLane.y, vertical ? gLane.width : gLane.height, vertical ? gLane.height : gLane.width);
+				
 				mxLane.setGeometry(childGeometry);
 				gLane.mxObject = mxLane;
 			}

+ 0 - 5
src/com/mxgraph/online/SaveServlet.java

@@ -22,11 +22,6 @@ public class SaveServlet extends HttpServlet
 	 */
 	private static final long serialVersionUID = 1L;
 
-	/**
-	 * 
-	 */
-	public static String ALLOW_COMPRESSION = "allowCompression";
-
 	/**
 	 * 
 	 */

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 06/06/2017 09:45 PM
+# 06/08/2017 03:21 PM
 
 app.html
 index.html?offline=1

Файловите разлики са ограничени, защото са твърде много
+ 22 - 22
war/js/app.min.js


Файловите разлики са ограничени, защото са твърде много
+ 18 - 18
war/js/atlas-viewer.min.js


Файловите разлики са ограничени, защото са твърде много
+ 20 - 20
war/js/atlas.min.js


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

@@ -1473,20 +1473,17 @@ App.prototype.updateDocumentTitle = function()
 	if (!this.editor.graph.lightbox)
 	{
 		var title = this.editor.appName;
-
+		var file = this.getCurrentFile();
+		
 		if (this.isOfflineApp())
 		{
 			title += ' app';
 		}
-		else
+		
+		if (file != null)
 		{
-			var file = this.getCurrentFile();
-			
-			if (file != null)
-			{
-				var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
-				title = filename + ' - ' + title;
-			}
+			var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename;
+			title = filename + ' - ' + title;
 		}
 		
 		document.title = title;

+ 11 - 6
war/js/diagramly/EditorUi.js

@@ -2519,11 +2519,12 @@
 	 */
 	EditorUi.prototype.isLocalFileSave = function()
 	{
-		return (urlParams['save'] != 'remote' && (mxClient.IS_IE ||
+		// Workaround for failing local saves in MS Edge Creators Update
+		return !mxClient.IS_EDGE && ((urlParams['save'] != 'remote' && (mxClient.IS_IE ||
 			(typeof window.Blob !== 'undefined' && typeof window.URL !== 'undefined')) &&
 			document.documentMode != 9 && document.documentMode != 8 &&
 			document.documentMode != 7 && !mxClient.IS_QUIRKS) ||
-			this.isOfflineApp() || mxClient.IS_IOS;
+			this.isOfflineApp() || mxClient.IS_IOS);
 	};
 	
 	/**
@@ -2573,13 +2574,17 @@
 		{
 			var a = document.createElement('a');
 			
-			if (typeof a.download !== 'undefined' || this.isOffline())
+			// Workaround for mxXmlRequest.simulate no longer working in Safari
+			// if this is used (ie PNG export broken after XML export in Safari).
+			var useDownload = !mxClient.IS_SF && typeof a.download !== 'undefined';
+			
+			if (useDownload || this.isOffline())
 			{
 				a.href = URL.createObjectURL((base64Encoded) ?
 					this.base64ToBlob(data, mimeType) :
 					new Blob([data], {type: mimeType}));
 				
-				if (typeof a.download !== 'undefined')
+				if (useDownload)
 				{
 					a.download = filename;
 				}
@@ -2593,12 +2598,12 @@
 				
 				try
 				{
-					a.click();
-					
 					window.setTimeout(function()
 					{
 						URL.revokeObjectURL(a.href);
 					}, 0);
+
+					a.click();
 					a.parentNode.removeChild(a);
 				}
 				catch (e)

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
war/js/embed-static.min.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
war/js/reader.min.js


Файловите разлики са ограничени, защото са твърде много
+ 18 - 18
war/js/viewer.min.js