Browse Source

6.8.14 release

Former-commit-id: 5b75c0f48b788cd7bdee3db04b550cb9de1946ee
Gaudenz Alder 8 years ago
parent
commit
46544bd690

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+11-JUL-2017: 6.8.14
+
+- Fixes VSDX export for non-numeric IDs
+- Fixes drag and drop to splash screen
+
 10-JUL-2017: 6.8.13
 
 - Adds Alt+Click to select cells behind cells

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.8.13
+6.8.14

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 07/10/2017 04:19 PM
+# 07/11/2017 05:30 PM
 
 app.html
 index.html?offline=1

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


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


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


+ 4 - 0
war/js/diagramly/Dialogs.js

@@ -3327,6 +3327,10 @@ var ImageDialog = function(editorUi, title, initialValue, fn, ignoreExisting, co
 	var linkInput = document.createElement('input');
 	linkInput.setAttribute('value', initialValue);
 	linkInput.setAttribute('type', 'text');
+	linkInput.setAttribute('spellcheck', 'false');
+	linkInput.setAttribute('autocorrect', 'off');
+	linkInput.setAttribute('autocomplete', 'off');
+	linkInput.setAttribute('autocapitalize', 'off');
 	linkInput.style.marginTop = '6px';
 	var realWidth = (Graph.fileSupport) ? 420 : 340;
 	linkInput.style.width = realWidth + ((mxClient.IS_QUIRKS) ? 20 : -20) + 'px';

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

@@ -7004,7 +7004,7 @@
 		
 				mxEvent.addListener(elts[i], 'dragover', mxUtils.bind(this, function(evt)
 				{
-					if (this.editor.graph.isEnabled())
+					if (this.editor.graph.isEnabled() || urlParams['embed'] != '1')
 					{
 						// IE 10 does not implement pointer-events so it can't have a drop highlight
 						if (dropElt == null && (!mxClient.IS_IE || (document.documentMode > 10 && document.documentMode < 12)))
@@ -7025,7 +7025,7 @@
 				    	dropElt = null;
 				    }
 					
-					if (this.editor.graph.isEnabled())
+					if (this.editor.graph.isEnabled() || urlParams['embed'] != '1')
 					{
 						if (evt.dataTransfer.files.length > 0)
 						{

+ 35 - 14
war/js/diagramly/vsdx/VsdxExport.js

@@ -6,6 +6,9 @@ function VsdxExport(editorUi)
 	var that = this;
 	
 	var vsdxCanvas = new mxVsdxCanvas2D();
+	
+	var idsMap = {};
+	var idsCounter = 1;
 	/**
 	 * Fill the required files in vsdx format which are constants in our exporter
 	 * @param zip JSZip of vsdx file
@@ -68,6 +71,18 @@ function VsdxExport(editorUi)
 		return (doc.createElementNS != null) ? doc.createElementNS(ns, name) : doc.createElement(name);
 	};
 
+	function getCellVsdxId(cellId)
+	{
+		var vsdxId = idsMap[cellId];
+		
+		if (vsdxId == null)
+		{
+			vsdxId = idsCounter++;
+			idsMap[cellId] = vsdxId;
+		}
+		return vsdxId;
+	};
+	
 	function getGraphAttributes(graph) 
 	{
 		var attr = {};
@@ -378,9 +393,10 @@ function VsdxExport(editorUi)
 		var state = graph.view.getState(cell);
 		
 		var shape = createElt(xmlDoc, that.XMLNS, "Shape");
-		shape.setAttribute("ID", cell.id);
-		shape.setAttribute("NameU", "Dynamic connector." + cell.id);
-		shape.setAttribute("Name", "Dynamic connector." + cell.id);
+		var vsdxId = getCellVsdxId(cell.id);
+		shape.setAttribute("ID", vsdxId);
+		shape.setAttribute("NameU", "Dynamic connector." + vsdxId);
+		shape.setAttribute("Name", "Dynamic connector." + vsdxId);
 		shape.setAttribute("Type", "Shape");
 		shape.setAttribute("Master", "4"); //Dynamic Connector Master
 			
@@ -420,8 +436,8 @@ function VsdxExport(editorUi)
 		shape.appendChild(createCellElemScaled("EndY", parentHeight - bounds.y + pe.y, xmlDoc, "_WALKGLUE(EndTrigger,BegTrigger,WalkPreference)"));
 
 		//Formula is used to make the edge dynamic (specify source id and target id)
-		shape.appendChild(createCellElem("BegTrigger", "2", xmlDoc, cell.source? "_XFTRIGGER(Sheet."+ cell.source.id +"!EventXFMod)" : null));
-		shape.appendChild(createCellElem("EndTrigger", "2", xmlDoc, cell.target? "_XFTRIGGER(Sheet."+ cell.target.id +"!EventXFMod)" : null));
+		shape.appendChild(createCellElem("BegTrigger", "2", xmlDoc, cell.source? "_XFTRIGGER(Sheet."+ getCellVsdxId(cell.source.id) +"!EventXFMod)" : null));
+		shape.appendChild(createCellElem("EndTrigger", "2", xmlDoc, cell.target? "_XFTRIGGER(Sheet."+ getCellVsdxId(cell.target.id) +"!EventXFMod)" : null));
 		shape.appendChild(createCellElem("ConFixedCode", "6", xmlDoc));
 		shape.appendChild(createCellElem("LayerMember", "0", xmlDoc));
 
@@ -485,10 +501,12 @@ function VsdxExport(editorUi)
 				geo.relative = 0;
 			}
 			
+			var vsdxId = getCellVsdxId(cell.id);
+			
 			if (!cell.treatAsSingle && cell.getChildCount() > 0) //Group 
 			{
 				//Create group shape as an empty shape with no geo
-				var shape = createShape(cell.id+"10000", geo, xmlDoc, parentHeight);
+				var shape = createShape(vsdxId + "10000", geo, xmlDoc, parentHeight);
 				shape.setAttribute("Type", "Group");
 				
 				//Create group shape
@@ -530,7 +548,7 @@ function VsdxExport(editorUi)
 			else if (cell.vertex)
 			{
 	
-				var shape = createShape(cell.id, geo, xmlDoc, parentHeight);
+				var shape = createShape(vsdxId, geo, xmlDoc, parentHeight);
 				
 				var state = graph.view.getState(cell);
 
@@ -631,18 +649,18 @@ function VsdxExport(editorUi)
 				if (cell.source)
 				{
 					var connect = createElt(xmlDoc, that.XMLNS, "Connect");
-					connect.setAttribute("FromSheet", cell.id);
+					connect.setAttribute("FromSheet", getCellVsdxId(cell.id));
 					connect.setAttribute("FromCell", "BeginX");
-					connect.setAttribute("ToSheet", cell.source.id);
+					connect.setAttribute("ToSheet", getCellVsdxId(cell.source.id));
 					connects.appendChild(connect);
 				}
 				
 				if (cell.target)
 				{
 					var connect = createElt(xmlDoc, that.XMLNS, "Connect");
-					connect.setAttribute("FromSheet", cell.id);
+					connect.setAttribute("FromSheet", getCellVsdxId(cell.id));
 					connect.setAttribute("FromCell", "EndX");
-					connect.setAttribute("ToSheet", cell.target.id);
+					connect.setAttribute("ToSheet", getCellVsdxId(cell.target.id));
 					connects.appendChild(connect);
 				}
 			}
@@ -689,7 +707,7 @@ function VsdxExport(editorUi)
 			pageSheet.appendChild(createCellElem("PageScale", modelAttr['pageScale'], pagesXmlDoc));
 			pageSheet.appendChild(createCellElem("DrawingScale", 1, pagesXmlDoc));
 		
-			var relE = createElt(pagesXmlDoc, "Rel");
+			var relE = createElt(pagesXmlDoc, that.XMLNS,"Rel");
 			relE.setAttribute("r:id", "rId" + i);
 
 			//Layer (not needed!, it works without it)
@@ -785,10 +803,13 @@ function VsdxExport(editorUi)
 			{
 				var zip = new JSZip();
 			    
+				//init class global variables
 				vsdxCanvas.init(zip);
+				idsMap = {};
+				idsCounter = 1;
 				
-				pages = {};
-				modelsAttr = {};
+				var pages = {};
+				var modelsAttr = {};
 				
 				var pagesCount = editorUi.pages != null? editorUi.pages.length : 1;
 				

+ 50 - 9
war/js/diagramly/vsdx/mxVsdxCanvas2D.js

@@ -635,7 +635,10 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 
 		var charSect = this.createElt("Section");
 		charSect.setAttribute('N', 'Character');
-		
+
+		var pSect = this.createElt("Section");
+		pSect.setAttribute('N', 'Paragraph');
+
 		var text = this.createElt("Text");
 
 		var rgb2hex = function (rgb){
@@ -646,10 +649,10 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 			  ("0" + parseInt(rgb[3],10).toString(16)).slice(-2) : '';
 		};
 		
-		var rowIndex = 0;
+		var rowIndex = 0, pIndex = 0;
 		var calcW = 0, calcH = 0, lastW = 0, lastH = 0, lineH = 0;
 		
-		var createTextRow = function(styleMap, charSect, textEl, txt) 
+		var createTextRow = function(styleMap, charSect, pSect, textEl, txt) 
 		{
 			var fontSize = styleMap['fontSize'];
 			var fontFamily = styleMap['fontFamily'];
@@ -709,6 +712,25 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 			
 			charSect.appendChild(charRow);
 			
+//			var pRow = that.createElt("Row");
+//			pRow.setAttribute('IX', pIndex);
+//			
+//			var align = 1; //center is default
+//			
+//			switch(styleMap['align'])
+//			{
+//				case 'left': align = 0; break;
+//				case 'center': align = 1; break;
+//				case 'right': align = 2; break;
+//			}
+			
+//			pRow.appendChild(that.createCellElem("HorzAlign", align));
+//			pRow.appendChild(that.createCellElem("SpLine", "-1.2"));
+//			pSect.appendChild(pRow);
+			
+//			var pp = that.createElt("pp");
+//			pp.setAttribute('IX', pIndex++);
+//			textEl.appendChild(pp);
 			var cp = that.createElt("cp");
 			cp.setAttribute('IX', rowIndex++);
 			textEl.appendChild(cp);
@@ -727,33 +749,51 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 						fontColor: pStyle['fontColor'] || that.cellState.style["fontColor"],
 						fontSize: pStyle['fontSize'] || that.cellState.style["fontSize"],
 						fontFamily: pStyle['fontFamily'] || that.cellState.style["fontFamily"],
+						align: pStyle['align'] || that.cellState.style["align"],
 						bold: pStyle['bold'],
 						italic: pStyle['italic'],
 						underline: pStyle['underline']
 					};
-					createTextRow(styleMap, charSect, text, ch[i].textContent);
+					createTextRow(styleMap, charSect, pSect, text, ch[i].textContent);
 				} 
 				else if (ch[i].nodeType == 1) 
 				{ //element
+					var nodeName = ch[i].nodeName.toUpperCase();
 					var chLen = ch[i].childNodes.length;
 					var style = window.getComputedStyle(ch[i], null);
 					var styleMap = {
 						bold: style.getPropertyValue('font-weight') == 'bold' || pStyle['bold'],
 						italic: style.getPropertyValue('font-style') == 'italic' || pStyle['italic'],
 						underline: style.getPropertyValue('text-decoration').indexOf('underline') >= 0 || pStyle['underline'],
+						align: style.getPropertyValue('text-align'),
 						fontColor: rgb2hex(style.getPropertyValue('color')),
 						fontSize: parseFloat(style.getPropertyValue('font-size')),
 						fontFamily: style.getPropertyValue('font-family').replace(/"/g, ''), //remove quotes
-						blockElem: style.getPropertyValue('display') == 'block'
+						blockElem: style.getPropertyValue('display') == 'block' || nodeName == "BR" || nodeName == "LI"
 					};
-					if (chLen > 0 /*&& !(chLen == 1 && ch[i].childNodes[0].nodeType == 3)*/) 
+					
+//					if (nodeName == "OL" || nodeName == "UL")
+//					{
+//						var pRow = that.createElt("Row");
+//						pRow.setAttribute('IX', pIndex);
+//						
+//						pRow.appendChild(that.createCellElem("HorzAlign", "0"));
+//						pRow.appendChild(that.createCellElem("Bullet", "1"));
+//						pSect.appendChild(pRow);
+//						
+//						var pp = that.createElt("pp");
+//						pp.setAttribute('IX', pIndex++);
+//						text.appendChild(pp);
+//					}
+					
+					if (chLen > 0)
 					{
-						createTextRow(styleMap, charSect, text, ""); //to handle block elements if any
+						createTextRow(styleMap, charSect, pSect, text, ""); //to handle block elements if any
 						processNodeChildren(ch[i].childNodes, styleMap);
 					}
 					else
 					{
-						createTextRow(styleMap, charSect, text, ch[i].textContent);
+						createTextRow(styleMap, charSect, pSect, text, ch[i].textContent);
 					}
 				}
 			}
@@ -774,7 +814,7 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 				fontSize: that.cellState.style["fontSize"],
 				fontFamily: that.cellState.style["fontFamily"]
 			};
-			createTextRow(styleMap, charSect, text, str);
+			createTextRow(styleMap, charSect, pSect, text, str);
 		}
 		
 		var wShift = 0;
@@ -814,6 +854,7 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f
 		
 		
 		this.shape.appendChild(charSect);
+//		this.shape.appendChild(pSect);
 		this.shape.appendChild(text);
 //		if (overflow != null)
 //		{

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


+ 5 - 0
war/js/mxgraph/Dialogs.js

@@ -582,6 +582,11 @@ var TextareaDialog = function(editorUi, title, url, fn, cancelFn, cancelTitle, w
 		nameInput.setAttribute('wrap', 'off');
 	}
 	
+	nameInput.setAttribute('spellcheck', 'false');
+	nameInput.setAttribute('autocorrect', 'off');
+	nameInput.setAttribute('autocomplete', 'off');
+	nameInput.setAttribute('autocapitalize', 'off');
+	
 	mxUtils.write(nameInput, url || '');
 	nameInput.style.resize = 'none';
 	nameInput.style.width = w + 'px';

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


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


File diff suppressed because it is too large
+ 51 - 50
war/js/vsdx.min.js


File diff suppressed because it is too large
+ 1 - 1
war/shortcuts.svg