Browse Source

6.9.5 release

Former-commit-id: c9558cc13f26a24eb21bfb67539b47996f3de01b
Gaudenz Alder 8 years ago
parent
commit
3786c901d0

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+24-JUL-2017: 6.9.5
+
+- Fixes anchor links in lightbox for viewer
+- Fixes event state for page links in labels
+
 24-JUL-2017: 6.9.4
 
 - Fixes hyperlinks in viewer

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.9.4
+6.9.5

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 07/24/2017 08:02 AM
+# 07/24/2017 01:54 PM
 
 app.html
 index.html?offline=1

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


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


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


+ 39 - 21
war/js/diagramly/App.js

@@ -746,19 +746,24 @@ App.prototype.init = function()
 	/**
 	 * Basic adds for all backends.
 	 */
-	this.basicAds = ['<a title="HTML5 JavaScript Diagramming" target="_blank" href="https://github.com/jgraph/draw.io">' +
-		'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:12px;" src="images/glyphicons_github.png"/>Fork us on GitHub</a>',
-		'<a title="' + mxResources.get('loveIt', ['draw.io']) + '" target="_blank" href="https://www.facebook.com/sharer.php?u=' + 
-		encodeURIComponent('https://www.draw.io') + '">' +
+	this.basicAds = ['<a title="' + mxResources.get('loveIt', ['draw.io']) +
+		'" target="_blank" href="https://twitter.com/intent/tweet?text=' +
+		encodeURIComponent(mxResources.get('loveIt', ['www.draw.io'])) +
+		'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=280,width=640\');return false;"\'>' +
+		'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:8px;" src="' +
+		Editor.tweetImage + '"/>' + mxResources.get('loveIt', ['draw.io']) + '</a>',
+		'<a title="HTML5 JavaScript Diagramming" target="_blank" href="https://github.com/jgraph/draw.io">' +
+		'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:8px;" src="images/glyphicons_github.png"/>' +
+		'Fork us on GitHub</a>',
+		'<a title="' + mxResources.get('loveIt', ['draw.io']) +
+		'" target="_blank" href="https://www.facebook.com/sharer.php?u=' + 
+		encodeURIComponent('https://www.draw.io') +
+		'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=520,width=640\');return false;"\'>' +
 		'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:8px;" src="' +
 		Editor.facebookImage + '"/>' + mxResources.get('loveIt', ['draw.io']) + '</a>',
 		'<a title="draw.io Offline App" href="https://www.draw.io/app" target="_blank">' +
-		'<img border="0" align="absmiddle" style="margin-top:-4px;" src="images/download.png"/>&nbsp;&nbsp;draw.io Offline App</a>',
-		'<a title="' + mxResources.get('loveIt', ['draw.io']) + '" target="_blank" href="https://twitter.com/intent/tweet?text=' + 
-			encodeURIComponent(mxUtils.trim(mxResources.get('loveIt', ['']))) + '&url=' +
-			encodeURIComponent('https://www.draw.io') + '&via=drawio">' +
-		'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:8px;" src="' +
-		Editor.tweetImage + '"/>' + mxResources.get('loveIt', ['draw.io']) + '</a>'];
+		'<img border="0" align="absmiddle" style="margin-top:-1px;padding-right:8px;" src="images/download.png"/>' +
+		'draw.io Offline App</a>'];
 
 	/**
 	 * Creates github client.
@@ -858,10 +863,15 @@ App.prototype.init = function()
 						// Changes the footer ads for Google Accounts
 						if (this.updateAd != null)
 						{
-							this.adsHtml = this.basicAds.concat(['<a title="Google Docs Add-on" href="https://chrome.google.com/webstore/detail/drawio-diagrams/clpbjldiohnnmfmkngmaohehlnfkmoea" target="_blank">' +
+							this.adsHtml = this.basicAds.concat([
+								'<a title="' + mxResources.get('loveIt', ['draw.io']) +
+								'" target="_blank" href="https://plus.google.com/share?url=' + encodeURIComponent('https://www.draw.io') +
+								'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=520,width=480\');return false;"\'>' +
+								'<img border="0" align="absmiddle" style="margin-top:-2px;padding-right:8px;" src="images/glyphicons_google.png"/>' + mxResources.get('loveIt', ['draw.io']) + '</a>',
+								'<a title="Google Docs Add-on" href="https://chrome.google.com/webstore/detail/drawio-diagrams/clpbjldiohnnmfmkngmaohehlnfkmoea" target="_blank">' +
 								'<img border="0" align="absmiddle" style="margin-top:-4px;" src="images/glyphicons_star.png"/>&nbsp;&nbsp;Google Docs Add-on</a>',
 								'<a title="Google Chrome App" href="https://chrome.google.com/webstore/detail/drawio-desktop/pebppomjfocnoigkeepgbmcifnnlndla" target="_blank">' +
-								'<img border="0" align="absmiddle" style="margin-top:-4px;" src="images/glyphicons_star.png"/>&nbsp;&nbsp;Google Chrome App</a>',
+								'<img border="0" align="absmiddle" style="margin-top:-4px;" src="images/download.png"/>&nbsp;&nbsp;Google Chrome App</a>',
 								'<a title="Please help us to 5 stars" href="https://chrome.google.com/webstore/detail/drawio-pro/onlkggianjhjenigcpigpjehhpplldkc/reviews" target="_blank">' +
 								'<img border="0" align="absmiddle" style="margin-top:-4px;" src="images/glyphicons_star.png"/>&nbsp;&nbsp;Please help us to 5 stars</a>']);
 							this.updateAd(this.adsHtml.length - 1);
@@ -992,22 +1002,25 @@ App.prototype.init = function()
 	{
 		this.adsHtml = this.basicAds;
 		mxUtils.setPrefixedStyle(td.style, 'transition', 'all 1s ease');
-		var lastAd = this.adsHtml.length - 1;
+		var lastAd = null;
 		var thread = null;
 		
 		this.updateAd = function(index)
 		{
-			if (this.adsHtml.length == 0 && td.parentNode != null)
+			if (this.adsHtml.length == 0)
 			{
-				window.clearInterval(thread);
-				td.parentNode.removeChild(td);
+				if (td.parentNode != null)
+				{
+					window.clearInterval(thread);
+					td.parentNode.removeChild(td);
+				}
 			}
 			else
 			{
 				if (index == lastAd)
 				{
-					index = this.adsHtml.length - 1;
 					lastAd = null;
+					index = 0;
 				}
 
 				if (index != lastAd)
@@ -1034,12 +1047,18 @@ App.prototype.init = function()
 		mxEvent.addListener(td, 'click', mxUtils.bind(this, function()
 		{
 			this.adsHtml.splice(lastAd, 1);
-			this.updateAd(Math.round(Math.random() * (this.adsHtml.length - 1)));
+			lastAd = null;
+			this.updateAd(0);
 		}));
 
 		if (mxSettings.getOpenCounter() < 3)
 		{
 			this.adsHtml.push(td.innerHTML);
+			lastAd = this.adsHtml.length - 1;
+		}
+		else if (mxSettings.getOpenCounter() < 4)
+		{
+			this.updateAd(0);
 		}
 		else
 		{
@@ -2333,13 +2352,13 @@ App.prototype.start = function()
  */
 App.prototype.showSplash = function(force)
 {
-	var serviceCount = this.getServiceCount(false);
+	var serviceCount = this.getServiceCount(false) + 1;
 	
 	var showSecondDialog = mxUtils.bind(this, function()
 	{
 		var dlg = new SplashDialog(this);
 		
-		this.showDialog(dlg.container, 340, (serviceCount < 2) ? 180 : 260, true, true,
+		this.showDialog(dlg.container, 340, (serviceCount < 2 || mxClient.IS_CHROMEAPP) ? 160 : 260, true, true,
 			mxUtils.bind(this, function(cancel)
 			{
 				// Creates a blank diagram if the dialog is closed
@@ -2363,7 +2382,6 @@ App.prototype.showSplash = function(force)
 	}
 	else if (this.mode == null || force)
 	{
-		serviceCount++;
 		var rowLimit = (serviceCount <= 4) ? 2 : 3;
 		
 		var dlg = new StorageDialog(this, mxUtils.bind(this, function()

+ 30 - 41
war/js/diagramly/Dialogs.js

@@ -513,24 +513,28 @@ var SplashDialog = function(editorUi)
 		service = mxResources.get('device');
 	}
 
-	hd.appendChild(logo);
-	
-	mxUtils.write(hd, service);
-		
-	div.appendChild(hd);
-
 	var buttons = document.createElement('div');
+	buttons.style.margin = '4px 0px 0px 0px';
 	
+	if (!mxClient.IS_CHROMEAPP)
+	{
+		hd.appendChild(logo);
+		mxUtils.write(hd, service);
+		div.appendChild(hd);
+		buttons.style.border = '1px solid #d3d3d3';
+		buttons.style.borderWidth = '1px 0px 1px 0px';
+		buttons.style.padding = '18px 0px 24px 0px';
+	}
+	else
+	{
+		buttons.style.padding = '24px 0px 28px 0px';
+	}
+
 	if (mxClient.IS_QUIRKS)
 	{
 		buttons.style.whiteSpace = 'nowrap';
 		buttons.style.cssFloat = 'left';
 	}
-
-	buttons.style.border = '1px solid #d3d3d3';
-	buttons.style.borderWidth = '1px 0px 1px 0px';
-	buttons.style.padding = '18px 0px 24px 0px';
-	buttons.style.margin = '4px 0px 0px 0px';
 	
 	var btn = document.createElement('button');
 	btn.className = 'geBigButton';
@@ -698,39 +702,24 @@ var SplashDialog = function(editorUi)
 			});
 		}
 		
-		if (serviceCount > 1)
+		var link = document.createElement('a');
+		link.setAttribute('href', 'javascript:void(0)');
+		link.style.display = 'block';
+		link.style.marginTop = '8px';
+		mxUtils.write(link, mxResources.get('notUsingService', [storage]));
+		
+		mxEvent.addListener(link, 'click', function()
 		{
-			var link = document.createElement('a');
-			link.setAttribute('href', 'javascript:void(0)');
-			link.style.display = 'block';
-			link.style.marginTop = '8px';
-			mxUtils.write(link, mxResources.get('notUsingService', [storage]));
-			
-			mxEvent.addListener(link, 'click', function()
-			{
-				editorUi.hideDialog(false);
-				editorUi.setMode(null);
-				editorUi.clearMode();
-				editorUi.showSplash(true);
-			});
-			
-			buttons.appendChild(link);
-		}
+			editorUi.hideDialog(false);
+			editorUi.setMode(null);
+			editorUi.clearMode();
+			editorUi.showSplash(true);
+		});
+		
+		buttons.appendChild(link);
 	}
-	
+		
 	div.appendChild(buttons);
-	
-	// Changes Chrome App dialog
-	if (serviceCount < 2)
-	{
-		hd.style.paddingTop = '12px';
-		hd.innerHTML = '';
-		mxUtils.write(hd, mxResources.get('chooseAnOption') + ':');
-		buttons.style.border = 'none';
-		buttons.style.padding = '16px 0px 0px 0px';
-		btn.style.marginBottom = '0px';
-	}
-	
 	this.container = div;
 };
 

+ 9 - 4
war/js/diagramly/GraphViewer.js

@@ -1152,7 +1152,11 @@ GraphViewer.prototype.addClickHandler = function(graph, ui)
 			if (href != null && !(graph.isExternalProtocol(href) || graph.isBlankLink(href)))
 			{
 				// Hides lightbox if any links are clicked
-				ui.destroy();
+				// Async handling needed for anchors to work
+				window.setTimeout(function()
+				{
+					ui.destroy();
+				}, 0);
 			}
 		}
 		else
@@ -1187,7 +1191,8 @@ GraphViewer.prototype.showLightbox = function()
 {
 	if (this.graphConfig.lightbox == 'open' || window.self !== window.top)
 	{
-		var p = (this.layersEnabled) ? '&layers=1' : '';
+		var url = 'https://www.draw.io/?client=1&lightbox=1&close=1&edit=_blank&target=blank';
+		url += (this.layersEnabled) ? '&layers=1' : '';
 		
 		if (typeof window.postMessage !== 'undefined' && (document.documentMode == null || document.documentMode >= 10))
 		{
@@ -1203,13 +1208,13 @@ GraphViewer.prototype.showLightbox = function()
 			});
 			
 			mxEvent.addListener(window, 'message', receive);
-			wnd = window.open('https://www.draw.io/?client=1&lightbox=1&close=1&edit=_blank' + p);
+			wnd = window.open(url);
 		}
 		else
 		{
 			// Data is pulled from global variable after tab loads
 			window.drawdata = this.xml;
-			window.open('https://www.draw.io/?client=1&lightbox=1&edit=_blank' + p);
+			window.open(url);
 		}
 	}
 	else

+ 5 - 3
war/js/diagramly/Pages.js

@@ -17,8 +17,9 @@ function DiagramPage(node)
 {
 	this.node = node;
 	
-	// Create GUID for page
-	if (!this.node.hasAttribute('id'))
+	// Create GUID for page (first part is workaround for old versions of IE)
+	if ((this.node.hasAttribute == null && this.node.getAttribute('id') == null) ||
+		(this.node.hasAttribute != null && !this.node.hasAttribute('id')))
 	{
 		// Make global if used anywhere else
 		function guid()
@@ -604,7 +605,8 @@ EditorUi.prototype.updatePageRoot = function(page)
 EditorUi.prototype.selectPage = function(page, quiet)
 {
 	quiet = (quiet != null) ? quiet : false;
-	this.editor.graph.stopEditing();
+	this.editor.graph.isMouseDown = false;
+	this.editor.graph.reset();
 	
 	var edit = this.editor.graph.model.createUndoableEdit();
 	

File diff suppressed because it is too large
+ 110 - 2098
war/js/diagramly/sidebar/Sidebar-Atlassian.js


File diff suppressed because it is too large
+ 46 - 835
war/js/diagramly/sidebar/Sidebar-Mockup.js


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


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

@@ -1442,7 +1442,7 @@ var EditDataDialog = function(ui, cell)
 	var nameInput = document.createElement('input');
 	nameInput.setAttribute('placeholder', mxResources.get('enterPropertyName'));
 	nameInput.setAttribute('type', 'text');
-	nameInput.setAttribute('size', (mxClient.IS_QUIRKS || mxClient.IS_IE11) ? '18' : '22');
+	nameInput.setAttribute('size', (mxClient.IS_IE || mxClient.IS_IE11) ? '18' : '22');
 	nameInput.style.marginLeft = '2px';
 
 	newProp.appendChild(nameInput);

+ 10 - 3
war/js/mxgraph/EditorUi.js

@@ -320,7 +320,14 @@ EditorUi = function(editor, container, lightbox)
 	// Workaround for page scroll if embedded via iframe
 	if (window.self === window.top && graph.container.parentNode != null)
 	{
-		graph.container.focus();
+		try
+		{
+			graph.container.focus();
+		}
+		catch (e)
+		{
+			// ignores error in old versions of IE
+		}
 	}
 
    	// Keeps graph container focused on mouse down
@@ -1637,8 +1644,8 @@ EditorUi.prototype.initCanvas = function()
 				mxEvent.consume(evt);
 			}), Editor.editLargeImage, mxResources.get('openInNewWindow'));
 		}
-
-		if (graph.lightbox && this.container != document.body)
+		
+		if (graph.lightbox && (urlParams['close'] == '1' || this.container != document.body))
 		{
 			addButton(mxUtils.bind(this, function(evt)
 			{

+ 28 - 17
war/js/mxgraph/Graph.js

@@ -1053,7 +1053,17 @@ Graph.prototype.labelLinkClicked = function(state, elt, evt)
 		}
 		else
 		{
-			window.open(href, target);
+			// Avoids page reload for anchors (workaround for IE but used everywhere)
+			if (href.substring(0, this.baseUrl.length) == this.baseUrl &&
+				href.charAt(this.baseUrl.length) == '#' &&
+				target == '_top' && window == window.top)
+			{
+				window.location.hash = href.split('#')[1];
+			}
+			else
+			{
+				window.open(href, target);
+			}
 		}
 		
 		mxEvent.consume(evt);
@@ -4509,19 +4519,7 @@ if (typeof mxVertexHandler != 'undefined')
 							
 							if (beforeClick != null)
 			    			{
-								// Workaround for no click events on touch
-								if (mxClient.IS_TOUCH)
-								{
-									mxEvent.addGestureListeners(links[i], null, null, beforeClick);
-									mxEvent.addListener(links[i], 'click', function(evt)
-									{
-										mxEvent.consume(evt);
-									});
-								}
-								else
-								{
-									mxEvent.addListener(links[i], 'click', beforeClick);
-								}
+								mxEvent.addGestureListeners(links[i], null, null, beforeClick);
 			    			}
 						}
 					}
@@ -4616,9 +4614,12 @@ if (typeof mxVertexHandler != 'undefined')
 			    	var source = me.getSource();
 			    	
 			    	// Ignores clicks on links and collapse/expand icon
-			    	if (source.nodeName.toLowerCase() != 'a' && !me.isConsumed() &&
+			    	if (source.nodeName.toLowerCase() != 'a' &&
+			    		(Math.abs(this.scrollLeft - graph.container.scrollLeft) < tol &&
+			        	Math.abs(this.scrollTop - graph.container.scrollTop) < tol) &&
 			    		(me.getState() == null || !me.isSource(me.getState().control)) &&
-			    		(mxEvent.isLeftMouseButton(me.getEvent()) || mxEvent.isTouchEvent(me.getEvent())))
+			    		(mxEvent.isLeftMouseButton(me.getEvent()) ||
+			    		mxEvent.isTouchEvent(me.getEvent())))
 			    	{
 				    	if (this.currentLink != null) 
 				    	{
@@ -4641,7 +4642,17 @@ if (typeof mxVertexHandler != 'undefined')
 								}
 								else
 								{
-									window.open(this.currentLink, target);
+									// Avoids page reload for anchors (workaround for IE but used everywhere)
+									if (this.currentLink.substring(0, graph.baseUrl.length) == graph.baseUrl &&
+										this.currentLink.charAt(graph.baseUrl.length) == '#' &&
+										target == '_top' && window == window.top)
+									{
+										window.location.hash = this.currentLink.split('#')[1];
+									}
+									else
+									{
+										window.open(this.currentLink, target);
+									}
 								}
 					    		
 					    		me.consume();

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


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