Selaa lähdekoodia

13.9.0 release

David Benson [draw.io] 4 vuotta sitten
vanhempi
commit
7121378ab7

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+04-NOV-2020: 13.9.0
+
+- Disables Trello in IE11
+- Uses mxGraph 4.2.1 beta 24
+
 03-NOV-2020: 13.8.9
 
 - Adds block overflow cell style

+ 1 - 1
VERSION

@@ -1 +1 @@
-13.8.9
+13.9.0

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2 - 1
etc/mxgraph/mxClient.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1355 - 1353
src/main/webapp/js/app.min.js


+ 2 - 2
src/main/webapp/js/diagramly/App.js

@@ -532,7 +532,7 @@ App.getStoredMode = function()
 				// Loads Trello for all browsers but < IE10 if not disabled or if enabled and in embed mode
 				if (typeof window.TrelloClient === 'function')
 				{
-					if (urlParams['tr'] != '0' && isSvgBrowser &&
+					if (urlParams['tr'] != '0' && isSvgBrowser && !mxClient.IS_IE11 &&
 							(document.documentMode == null || document.documentMode >= 10))
 					{
 						// Immediately loads client
@@ -913,7 +913,7 @@ App.main = function(callback, createUi)
 				}
 				
 				// Loads Trello for all browsers but < IE10 if not disabled or if enabled and in embed mode
-				if (typeof window.TrelloClient === 'function' &&
+				if (typeof window.TrelloClient === 'function' && !mxClient.IS_IE11 &&
 					(typeof window.Trello === 'undefined' && window.DrawTrelloClientCallback != null &&
 					(((urlParams['embed'] != '1' && urlParams['tr'] != '0') || (urlParams['embed'] == '1' &&
 					urlParams['tr'] == '1')) && (navigator.userAgent == null ||

+ 1 - 1
src/main/webapp/js/diagramly/EditorUi.js

@@ -3848,7 +3848,7 @@
 							', ' + this.drive.user.email+ ')' : ''));
 					}
 					
-					var id = (fileHash != null) ? fileHash : window.location.hash;
+					var id = (notFoundMessage != null) ? null : ((fileHash != null) ? fileHash : window.location.hash);
 					
 					// #U handles case where we tried to fallback to Google File and
 					// hash property still shows the public URL we tried to load

+ 77 - 24
src/main/webapp/js/diagramly/Extensions.js

@@ -3789,6 +3789,41 @@ LucidImporter = {};
 			return blockStyles[m.n];
 		});
 		
+		//Add missing block that defauls to center
+		var newlines = [0], nl = 0;
+		
+		while ((nl = txt.indexOf('\n', nl)) > 0)
+		{
+			nl++;
+			newlines.push(nl);
+		}
+		
+		var expectedS = 0;
+		
+		for (var i = 0; i < globalStyles.length; i++)
+		{
+			if (globalStyles[i].s > newlines[expectedS])
+			{
+				globalStyles.splice(i, 0, {s: newlines[expectedS], n: 'a', v: 'center'});
+			}
+			else
+			{
+				while(i < globalStyles.length && globalStyles[i].s == newlines[expectedS])
+				{
+					i++
+				}
+				
+				i--; //Since loop will increment again
+			}
+			
+			expectedS++;
+		}
+		
+		if (newlines[expectedS] != null)
+		{
+			globalStyles.push({s: newlines[expectedS], n: 'a', v: 'center'});
+		}
+		
 		var html = '', ends = m.slice();
 
 		ends.sort(function(a, b)
@@ -3827,7 +3862,7 @@ LucidImporter = {};
 					openBlockTags.push('ol');
 				}
 				
-				str += 'style="margin: 0px; list-style-type:';
+				str += 'style="margin: 0px; padding: 10px;list-style-position: inside; list-style-type:';
 				
 				if (t.v == 'hl')
 				{
@@ -3879,42 +3914,35 @@ LucidImporter = {};
 
 			if (t != null)
 			{
-				str += '<li style="text-align:' + (styles['a']? styles['a'].v : 'left') + '>';
+				str += '<li style="text-align:' + (styles['a']? styles['a'].v : 'center') + '">';
 				openBlockTags.push('li');
 				str += '<span style="';
 				openBlockTags.push('span');
 			}
 			
-			var ml = '';
-			var mr = '';
-			
-			
 			if (!listActive)
 			{
 				var tmp = styles['a']? styles['a'].v : 'center';
 				
-				// Handles overflow text
-				if (tmp == 'center')
+				if (tmp == 'left')
 				{
-					ml = 'margin-left: -100%;';
-					mr = 'margin-right: -100%;';
+					tmp = 'flex-start';
 				}
 				else if (tmp == 'right')
 				{
-					ml = 'margin-left: -100%;';
+					tmp = 'flex-end';
 				}
-				
-				str += 'text-align: ' + tmp + ';';
+				str += 'display: flex; justify-content: ' + tmp + ';';
 			}
 			
 			if (styles['il'])
 			{
-				ml = 'margin-left: ' + Math.round(styles['il'].v * scale - (listActive? 21 : 0)) + 'px;';
+				str += 'margin-left: ' + Math.max(0, Math.round(styles['il'].v * scale - (listActive? 28 : 0))) + 'px;';
 			}
 
 			if (styles['ir'])
 			{
-				mr = 'margin-right: ' + Math.round(styles['ir'].v * scale) + 'px;';
+				str += 'margin-right: ' + Math.round(styles['ir'].v * scale) + 'px;';
 			}
 
 			if (styles['mt'])
@@ -3927,7 +3955,7 @@ LucidImporter = {};
 				str += 'margin-bottom: ' + Math.round(styles['mb'].v * scale) + 'px;';
 			}
 
-			str += ml + mr + '">';
+			str += '">';
 
 			return str;
 		};
@@ -4213,7 +4241,7 @@ LucidImporter = {};
 				{
 					for (var i = 0; i < m.length; i++)
 					{
-						if (m[i].s > 0 || (m[i].e != null && m[i].e < txt.length))
+						if (m[i].s > 0 || (m[i].e != null && m[i].e < txt.length) || m[i].n == 't')
 						{
 							isLastLblHTML = true;
 							break;
@@ -4300,7 +4328,7 @@ LucidImporter = {};
 	
 	function getLabelStyle(properties, noLblStyle)
 	{
-		var style = 'whiteSpace=wrap;' + (noLblStyle? 'html=1;' : 
+		var style = 'whiteSpace=wrap;' + (noLblStyle? 'overflow=block;html=1;' : 
 				getFontSize(properties) +
 				getFontColor(properties) + 
 				getFontStyle(properties) +
@@ -4326,7 +4354,7 @@ LucidImporter = {};
 		}
 		
 		s += 'whiteSpace=wrap;' + 
-		  (noLblStyle? (hasStyle(style, 'html')? '' : 'html=1;') : 
+		  (noLblStyle? (hasStyle(style, 'overflow')? '' : 'overflow=block;') + (hasStyle(style, 'html')? '' : 'html=1;') : 
 			addStyle(mxConstants.STYLE_FONTSIZE, style, properties, action, cell) +			
 			addStyle(mxConstants.STYLE_FONTCOLOR, style, properties, action, cell) +			
 			addStyle(mxConstants.STYLE_FONTSTYLE, style, properties, action, cell) +		
@@ -4911,6 +4939,7 @@ LucidImporter = {};
 			{
 				deg += 90;
 				cell.geometry.rotate90();
+				cell.geometry.isRotated = true;
 				h = false;
 			}
 			else if (mxUtils.indexOf(rccw, action.Class) >= 0)
@@ -5386,9 +5415,14 @@ LucidImporter = {};
 							implicitY = (exit.x == entry.x);
 						}
 					}
+
+					// Anchor points and arrows					
+					var p1, p2;
 					
-					// Anchor points and arrows
-					var p1 = updateEndpoint(cell, p.Endpoint1, true, implicitY);
+					if (source == null || !source.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it
+					{
+						p1 = updateEndpoint(cell, p.Endpoint1, true, implicitY);
+					}
 					
 					if (source != null && p1 != null)
 					{
@@ -5401,7 +5435,10 @@ LucidImporter = {};
 						LucidImporter.stylePointsSet.add(source);
 					}
 					
-					var p2 = updateEndpoint(cell, p.Endpoint2, false, implicitY);
+					if (target == null || !target.geometry.isRotated) //TODO Rotate the endpoint instead of ignoring it
+					{
+						p2 = updateEndpoint(cell, p.Endpoint2, false, implicitY);
+					}
 					
 					if (target != null && p2 != null)
 					{
@@ -5726,6 +5763,20 @@ LucidImporter = {};
 						queue.push(obj);
 					}
 				}
+				
+				if (g.Generators != null)
+				{
+					for (var key in g.Generators)
+					{
+						//TODO We don't support any generators currently, so probably we should mark any generator as unknow shape
+						if (g.Generators[key].ClassName == 'OrgChart2018')
+						{
+							LucidImporter.hasUnknownShapes = true;
+							console.log('Lucid diagram has an Org Chart!');
+							//createOrgChart(obj, graph, lookup, queue);
+						}
+					}
+				}
 			}
 			else
 			{
@@ -5745,6 +5796,8 @@ LucidImporter = {};
 					{
 						if (obj.GeneratorData.p.ClassName == 'OrgChart2018')
 						{
+							LucidImporter.hasUnknownShapes = true;
+							console.log('Lucid diagram has an Org Chart!');
 							//createOrgChart(obj, graph, lookup, queue);
 						}
 					}
@@ -6476,7 +6529,7 @@ LucidImporter = {};
 				if (hasTxt)
 				{
 					v.value = convertText(p[mainTxtFld]);
-					v.style += (isLastLblHTML? '' : 
+					v.style += (isLastLblHTML? 'overflow=block;' : 
 							getFontSize(p[mainTxtFld]) +
 							getFontColor(p[mainTxtFld]) + 
 							getFontStyle(p[mainTxtFld]) +
@@ -7457,7 +7510,7 @@ LucidImporter = {};
 					v.insert(tab[i]);
 					tab[i].value = convertText(p["Tab_" + i]);
 					
-					tab[i].style += (isLastLblHTML? 'html=1;' :
+					tab[i].style += (isLastLblHTML? 'overflow=block;html=1;' :
 									getFontSize(p["Tab_" + i]) +
 									getFontColor(p["Tab_" + i]) + 
 									getFontStyle(p["Tab_" + i]) +

+ 19 - 8
src/main/webapp/js/diagramly/GitHubClient.js

@@ -828,7 +828,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		dlg.okButton.parentNode.removeChild(dlg.okButton);
 	}
 	
-	var createLink = mxUtils.bind(this, function(label, exec, padding)
+	var createLink = mxUtils.bind(this, function(label, exec, padding, underline)
 	{
 		var link = document.createElement('a');
 		link.setAttribute('title', label);
@@ -836,6 +836,11 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		mxUtils.write(link,  label);
 		mxEvent.addListener(link, 'click', exec);
 		
+		if (underline)
+		{
+			link.style.textDecoration = 'underline';
+		}
+		
 		if (padding != null)
 		{
 			var temp = listItem.cloneNode();
@@ -857,7 +862,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		{
 			path = null;
 			selectRepo();
-		})));
+		}), null, true));
 		
 		if (!hideRef)
 		{
@@ -866,7 +871,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 			{
 				path = null;
 				selectRef();
-			})));
+			}), null, true));
 		}
 		
 		if (path != null && path.length > 0)
@@ -882,7 +887,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 					{
 						path = tokens.slice(0, index + 1).join('/');
 						selectFile();
-					})));
+					}), null, true));
 				})(i);
 			}
 		}
@@ -892,6 +897,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 	
 	var error = mxUtils.bind(this, function(err)
 	{
+		// Pass a dummy notFoundMessage to bypass special handling 
 		this.ui.handleError(err, null, mxUtils.bind(this, function()
 		{
 			this.ui.spinner.stop();
@@ -909,7 +915,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 			{
 				this.ui.hideDialog();
 			}
-		}));
+		}), null, {});
 	});
 	
 	// Adds paging for repos, branches and files (files limited to 1000 by API)
@@ -1057,7 +1063,7 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		}), error, true);
 	});
 
-	var selectRef = mxUtils.bind(this, function(page)
+	var selectRef = mxUtils.bind(this, function(page, auto)
 	{
 		if (page == null)
 		{
@@ -1114,6 +1120,12 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 			{
 				mxUtils.write(div, mxResources.get('noFiles'));
 			}
+			else if (branches.length == 1 && auto)
+			{
+				ref = branches[0].name;
+				path = '';
+				selectFile();
+			}
 			else
 			{
 				for (var i = 0; i < branches.length; i++)
@@ -1270,10 +1282,9 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 						{
 							org = repository.owner.login;
 							repo = repository.name;
-							ref = repository.default_branch;
 							path = '';
 	
-							selectFile();
+							selectRef(null, true);
 						})));
 						
 						div.appendChild(temp);

+ 27 - 15
src/main/webapp/js/diagramly/GitLabClient.js

@@ -744,7 +744,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 		dlg.okButton.parentNode.removeChild(dlg.okButton);
 	}
 	
-	var createLink = mxUtils.bind(this, function(label, fn, padding)
+	var createLink = mxUtils.bind(this, function(label, fn, padding, underline)
 	{
 		var link = document.createElement('a');
 		link.setAttribute('title', label);
@@ -752,6 +752,11 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 		mxUtils.write(link,  label);
 		mxEvent.addListener(link, 'click', fn);
 
+		if (underline)
+		{
+			link.style.textDecoration = 'underline';
+		}
+		
 		if (padding != null)
 		{
 			var temp = listItem.cloneNode();
@@ -773,7 +778,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 		{
 			path = null;
 			selectRepo();
-		})));
+		}), null, true));
 		
 		if (!hideRef)
 		{
@@ -782,7 +787,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 			{
 				path = null;
 				selectRef();
-			})));
+			}), null, true));
 		}
 		
 		if (path != null && path.length > 0)
@@ -798,7 +803,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 					{
 						path = tokens.slice(0, index + 1).join('/');
 						selectFile();
-					})));
+					}), null, true));
 				})(i);
 			}
 		}
@@ -971,7 +976,7 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 		}), error, true);
 	});
 
-	var selectRef = mxUtils.bind(this, function(page)
+	var selectRef = mxUtils.bind(this, function(page, auto)
 	{
 		if (page == null)
 		{
@@ -1028,6 +1033,12 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 			{
 				mxUtils.write(div, mxResources.get('noFiles'));
 			}
+			else if (branches.length == 1 && auto)
+			{
+				ref = branches[0].name;
+				path = '';
+				selectFile();
+			}
 			else
 			{
 				for (var i = 0; i < branches.length; i++)
@@ -1158,15 +1169,18 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 									{
 										org = tokens[0];
 										repo = tokens[1];
-										ref = 'master';
 										path = null;
+										ref = null;
 										
 										if (tokens.length > 2)
 										{
-											path = encodeURIComponent(tokens.slice(2, tokens.length).join('/'));
+											ref = encodeURIComponent(tokens.slice(2, tokens.length).join('/'));
+											selectFile();
+										}
+										else
+										{
+											selectRef(null, true);
 										}
-										
-										selectFile();
 									}
 									else
 									{
@@ -1198,10 +1212,9 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 							{
 								org = repository.owner.username;
 								repo = repository.path;
-								ref = repository.default_branch || 'master';
 								path = '';
-		
-								selectFile();
+								
+								selectRef(null, true);
 							})));
 							
 							div.appendChild(temp);
@@ -1225,10 +1238,9 @@ GitLabClient.prototype.showGitLabDialog = function(showFiles, fn)
 									{
 										org = group.full_path;
 										repo = project.path;
-										ref = project.default_branch || 'master';
 										path = '';
-				
-										selectFile();
+	
+										selectRef(null, true);
 									})));
 	
 									div.appendChild(temp);

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 280 - 279
src/main/webapp/js/extensions.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 4 - 2
src/main/webapp/js/sanitizer/sanitizer.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 72 - 70
src/main/webapp/js/viewer-static.min.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 72 - 70
src/main/webapp/js/viewer.min.js


+ 0 - 8
src/main/webapp/plugins/cConf-1-4-8.js

@@ -83,14 +83,6 @@ Draw.loadPlugin(function(ui)
 		}
 	};
 
-	ui.menus.get('file').funct = function(menu, parent)
-	{
-		menu.addItem(mxResources.get('licenseRequired'), null, function()
-		{
-    		// do nothing
-   		}, parent, null, false);
-	}
-
 	renameAction.funct = function()
 	{
 		var dlg = new FilenameDialog(ui, macroData.diagramDisplayName || "",

+ 4 - 4
src/main/webapp/service-worker.js

@@ -6,11 +6,11 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "3e50dacb5bb77762c4c4d7b60a64b42a"
+    "revision": "ba949a7880b7f0f7dd49a3993e11459d"
   },
   {
     "url": "js/extensions.min.js",
-    "revision": "f6ef0ecfaec19207c9055321a022eb0b"
+    "revision": "ebdcf852f629fdbc947e218b706bde69"
   },
   {
     "url": "js/stencils.min.js",
@@ -58,7 +58,7 @@ if (workbox)
   },
   {
     "url": "js/viewer-static.min.js",
-    "revision": "263fa2266c897727106c9566926b95fc"
+    "revision": "21df05f85415f0010d687c0a8cd07658"
   },
   {
     "url": "connect/jira/editor-1-3-3.html",
@@ -102,7 +102,7 @@ if (workbox)
   },
   {
     "url": "plugins/cConf-1-4-8.js",
-    "revision": "b90f7c0ca27b5e406b5bf2566711c421"
+    "revision": "5f51c9102e55474da1f3012c011d6191"
   },
   {
     "url": "connect/confluence/connectUtils-1-4-8.js",