Browse Source

13.0.8 release

David Benson [draw.io] 5 years ago
parent
commit
4727adfcd3

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+05-MAY-2020: 13.0.8
+
+- Adds ctrl+enter for table cells
+
 05-MAY-2020: 13.0.7
 
 - Uses mxGraph 4.1.2 beta 6

+ 1 - 1
VERSION

@@ -1 +1 @@
-13.0.7
+13.0.8

+ 8 - 1
etc/license-worker/license.js

@@ -20,6 +20,7 @@ async function handleRequest(request)
 	let reqBodyTxt = new TextDecoder("utf-8").decode(reqBody.value);
 	let params = new URL('http://dummy.com?' + reqBodyTxt).searchParams;
 	let domain = params.get('domain');
+	let confLicense = params.get('confLicense');
 	
 	//Try Query string parameters
 	if (domain == null)
@@ -38,9 +39,15 @@ async function handleRequest(request)
 		let url = "https://log.diagrams.net/" + msg;
 		fetch(url);
 	}
+	else if (confLicense != null && domain != null)
+	{
+		let msg = encodeURIComponent(('license:confLicense=' + confLicense + ',domain=' + domain));
+		let url = "https://log.diagrams.net/" + msg;
+		fetch(url);
+	}
 	else if (domain != null)
 	{
-		let msg = encodeURIComponent(('license:atlas-cloud:' + domain));
+		let msg = encodeURIComponent(('license:domain=' + domain));
 		let url = "https://log.diagrams.net/" + msg;
 		fetch(url);
 	}

+ 51 - 55
src/main/webapp/connect/confluence/macroEditor-1-4-8.html

@@ -36,77 +36,73 @@
 		AC.logError(message, url, linenumber, colno, err);
 	};
 	
-	var xdm_e = AC.getSiteUrl();
 	var baseUrl = AC.getBaseUrl();
-	var license = AC.getUrlParam('lic', false);
 	var connectUrl = baseUrl + '/atlassian-connect';
 	var head = document.getElementsByTagName('head')[0];
-	var licenseValid = true;
+	
 	
 	var script = document.createElement('script');
 	script.setAttribute('data-options', 'resize:false;margin:false');
-	
-	if (license != null && xdm_e != null)
+
+	// Main
+	script.onload = function()
 	{
-		if (license == 'none')
+		var xdm_e = AC.getSiteUrl();
+		var license = AC.getUrlParam('lic', false);
+		
+		if (license != null && xdm_e != null)
 		{
-			var hostParse = document.createElement('a');
-			hostParse.href = xdm_e;
-			var hostname = hostParse.hostname;
-			
-			if (hostname != null)
+			if (license == 'none')
 			{
- 				if (hostname.indexOf('.ngrok.io') > -1)
-				{
-					console.log("License status = ", license);
-				}
-				else
+				var hostParse = document.createElement('a');
+				hostParse.href = xdm_e;
+				var hostname = hostParse.hostname;
+				
+				if (hostname != null)
 				{
-					var xhr = new XMLHttpRequest();
-		
-					xhr.onreadystatechange = function()
+	 				if (hostname.indexOf('.ngrok.io') > -1)
 					{
-					    if (xhr.readyState == XMLHttpRequest.DONE && xhr.status >= 200 && xhr.status <= 299)
-					    {
-					        var resp = xhr.responseText;
-		
-							if (resp != null && resp.length > 0)
-							{
-								var lic = JSON.parse(resp);
+						console.log("License status = ", license);
+					}
+					else
+					{
+			        	AP.request({
+			                type: 'GET',
+			                url: '/rest/atlassian-connect/1/addons/com.mxgraph.confluence.plugins.diagramly',
+			                contentType: 'application/json;charset=UTF-8',
+			                success: function (resp) 
+			                {
+			                    resp = JSON.parse(resp);
+ 			
+								var xhr = new XMLHttpRequest();
 								
-								if (lic != null && lic.atlasCloudLic != null)
+								xhr.onreadystatechange = function()
 								{
-									licenseValid = true;
-								}
-							}
-					    }
-					};
-		
-					xhr.open('POST', '/license?domain=' + hostname, true);
-					xhr.send(null);
+								    if (xhr.readyState == XMLHttpRequest.DONE && xhr.status >= 200 && xhr.status <= 299)
+								    {
+								        var resp = xhr.responseText;
+					
+										if (resp != null && resp.length > 0)
+										{
+											var lic = JSON.parse(resp);
+											
+											if (lic != null && lic.atlasCloudLic != null)
+											{
+												// decide whether valid and close if not
+												// AP.dialog.close();
+											}
+										}
+								    }
+								};
+					
+								xhr.open('POST', '/license?domain=' + hostname + '&confLicense=' + license + '&SEN=' + resp.license? resp.license.supportEntitlementNumber : 'Unlicensed', true);
+								xhr.send(null);
+			                }
+			        	});
+					}
 				}
 			}
 		}
-		else
-		{
-			licenseValid = true;
-		}
-	}
-
-	// Main
-	script.onload = function()
-	{
-		if (!licenseValid)
-		{
-			setTimeout(function()
-			{
-				if (!licenseValid)
-				{
-					alert("Please install a license for the draw.io app");
-					AP.dialog.close();
-				}
-			}, 3000);
-		}
 
 		AP.resize('100%', '100%');
 

File diff suppressed because it is too large
+ 10 - 10
src/main/webapp/js/app.min.js


+ 37 - 14
src/main/webapp/js/mxgraph/EditorUi.js

@@ -3736,6 +3736,42 @@ EditorUi.prototype.hideDialog = function(cancel, isEsc)
 	}
 };
 
+/**
+ * Handles ctrl+enter keystroke to clone cells.
+ */
+EditorUi.prototype.ctrlEnter = function()
+{
+	var graph = this.editor.graph;
+
+	if (graph.isEnabled())
+	{
+		try
+		{
+			var cells = graph.getSelectionCells();
+		    var lookup = new mxDictionary();
+		    var newCells = [];
+
+		    for (var i = 0; i < cells.length; i++)
+		    {
+		    	// Clones table rows instead of cells
+		    	var cell = (graph.isTableCell(cells[i])) ? graph.model.getParent(cells[i]) : cells[i];
+		    	
+		    	if (cell != null && !lookup.get(cell))
+		    	{
+		    		lookup.put(cell, true);
+		            newCells.push(cell);
+		        }
+		    }
+		    
+			graph.setSelectionCells(graph.duplicateCells(newCells, false));
+		}
+		catch (e)
+		{
+			this.handleError(e);
+		}
+	}
+};
+
 /**
  * Display a color dialog.
  */
@@ -4526,20 +4562,7 @@ EditorUi.prototype.createKeyHandler = function(editor)
 	{
 		keyHandler.bindControlKey(36, function() { if (graph.isEnabled()) { graph.foldCells(true); }}); // Ctrl+Home
 		keyHandler.bindControlKey(35, function() { if (graph.isEnabled()) { graph.foldCells(false); }}); // Ctrl+End
-		keyHandler.bindControlKey(13, function()
-		{
-			if (graph.isEnabled())
-			{
-				try
-				{
-					graph.setSelectionCells(graph.duplicateCells(graph.getSelectionCells(), false));
-				}
-				catch (e)
-				{
-					ui.handleError(e);
-				}
-			}
-		}); // Ctrl+Enter
+		keyHandler.bindControlKey(13, function() { ui.ctrlEnter(); }); // Ctrl+Enter
 		keyHandler.bindAction(8, false, 'delete'); // Backspace
 		keyHandler.bindAction(8, true, 'deleteAll'); // Shift+Backspace
 		keyHandler.bindAction(46, false, 'delete'); // Delete

+ 1 - 2
src/main/webapp/js/mxgraph/Graph.js

@@ -4347,8 +4347,7 @@ Graph.prototype.createCrossFunctionalSwimlane = function(rowCount, colCount, w,
 	w = (w != null) ? w : 120;
 	h = (h != null) ? h : 120;
 	
-	var s = 'swimlane;html=1;whiteSpace=wrap;' +
-		'collapsible=0;recursiveResize=0;expand=0;';
+	var s = 'swimlane;html=1;whiteSpace=wrap;collapsible=0;recursiveResize=0;expand=0;';
 	
 	var table = this.createVertex(null, null, '', 0, 0,
 		colCount * w, rowCount * h, s + 'containerType=table;container=0;dropTarget=0;' +

File diff suppressed because it is too large
+ 601 - 601
src/main/webapp/js/viewer.min.js


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

@@ -6,7 +6,7 @@ if (workbox)
 	workbox.precaching.precacheAndRoute([
   {
     "url": "js/app.min.js",
-    "revision": "31ef97ea7228e3d7ceb877ee7fe69503"
+    "revision": "8f905199962cb01eba11ac54b40cd630"
   },
   {
     "url": "js/extensions.min.js",