瀏覽代碼

6.9.6 release

Former-commit-id: aaef9a94ebab7077df3faa147b75d3bf53f3a3a1
David Benson 8 年之前
父節點
當前提交
f6c39a8edb
共有 100 個文件被更改,包括 2687 次插入4620 次删除
  1. 5 0
      ChangeLog
  2. 1 1
      VERSION
  3. 2 0
      src/com/mxgraph/io/vsdx/Style.java
  4. 9 9
      war/WEB-INF/appengine-web.xml
  5. 1 1
      war/cache.manifest
  6. 1 0
      war/index.html
  7. 917 1022
      war/js/app.min.js
  8. 1 1
      war/js/atlas-viewer.min.js
  9. 723 829
      war/js/atlas.min.js
  10. 31 33
      war/js/diagramly/App.js
  11. 6 0
      war/js/diagramly/Devel.js
  12. 18 10
      war/js/diagramly/Dialogs.js
  13. 32 13
      war/js/diagramly/DriveClient.js
  14. 1 1
      war/js/diagramly/EditorUi.js
  15. 134 64
      war/js/diagramly/ElectronApp.js
  16. 114 64
      war/js/diagramly/GitHubClient.js
  17. 414 0
      war/js/diagramly/mxEquiSpacedGuides.js
  18. 12 147
      war/js/diagramly/sidebar/Sidebar-Advanced.js
  19. 16 232
      war/js/diagramly/sidebar/Sidebar-Android.js
  20. 8 84
      war/js/diagramly/sidebar/Sidebar-Cabinet.js
  21. 25 247
      war/js/diagramly/sidebar/Sidebar-EIP.js
  22. 4 82
      war/js/diagramly/sidebar/Sidebar-ER.js
  23. 18 200
      war/js/diagramly/sidebar/Sidebar-Floorplan.js
  24. 12 192
      war/js/diagramly/sidebar/Sidebar-GCP.js
  25. 10 126
      war/js/diagramly/sidebar/Sidebar-Ios.js
  26. 32 510
      war/js/diagramly/sidebar/Sidebar-Ios7.js
  27. 2 22
      war/js/diagramly/sidebar/Sidebar-LeanMapping.js
  28. 4 59
      war/js/diagramly/sidebar/Sidebar-Network.js
  29. 1 1
      war/js/embed-static.min.js
  30. 1 1
      war/js/reader.min.js
  31. 1 1
      war/js/viewer.min.js
  32. 1 1
      war/styles/grapheditor.css
  33. 2 12
      war/templates/business/accd.xml
  34. 2 12
      war/templates/business/archimate.xml
  35. 2 12
      war/templates/business/bpmn.xml
  36. 2 12
      war/templates/business/business_model_1.xml
  37. 2 12
      war/templates/business/business_model_2.xml
  38. 二進制
      war/templates/business/ishikawa_1.png
  39. 2 0
      war/templates/business/ishikawa_1.xml
  40. 二進制
      war/templates/business/ishikawa_2.png
  41. 2 0
      war/templates/business/ishikawa_2.xml
  42. 2 12
      war/templates/business/pert_1.xml
  43. 2 12
      war/templates/business/pert_2.xml
  44. 2 12
      war/templates/business/timeline_1.xml
  45. 2 12
      war/templates/business/timeline_2.xml
  46. 2 12
      war/templates/charts/coc.xml
  47. 2 12
      war/templates/charts/org_chart_1.xml
  48. 2 12
      war/templates/charts/org_chart_2.xml
  49. 2 12
      war/templates/engineering/cabinet.xml
  50. 2 12
      war/templates/engineering/electrical_1.xml
  51. 2 12
      war/templates/engineering/electrical_2.xml
  52. 2 12
      war/templates/flowcharts/cross_functional_flowchart.xml
  53. 2 12
      war/templates/flowcharts/data_flow_1.xml
  54. 2 12
      war/templates/flowcharts/data_flow_2.xml
  55. 2 1
      war/templates/flowcharts/data_flow_3.xml
  56. 2 12
      war/templates/flowcharts/epc.xml
  57. 2 0
      war/templates/index.xml
  58. 2 1
      war/templates/layout/blog_wireframe.xml
  59. 2 12
      war/templates/layout/bootstrap.xml
  60. 2 12
      war/templates/layout/wireframe.xml
  61. 2 12
      war/templates/maps/concept_map.xml
  62. 2 1
      war/templates/maps/site_map.xml
  63. 2 12
      war/templates/network/Internet.xml
  64. 2 12
      war/templates/network/active_directory.xml
  65. 2 12
      war/templates/network/aws.xml
  66. 2 12
      war/templates/network/aws_3d.xml
  67. 2 12
      war/templates/network/azure.xml
  68. 2 12
      war/templates/network/cisco.xml
  69. 2 12
      war/templates/network/citrix.xml
  70. 2 12
      war/templates/network/lan.xml
  71. 2 12
      war/templates/network/telecomm.xml
  72. 2 12
      war/templates/network/veeam.xml
  73. 2 12
      war/templates/network/wireless_home_network.xml
  74. 2 12
      war/templates/other/block.xml
  75. 2 12
      war/templates/other/decision_tree.xml
  76. 2 12
      war/templates/other/educational.xml
  77. 2 12
      war/templates/other/floor_plan.xml
  78. 2 12
      war/templates/other/infographic_1.xml
  79. 2 12
      war/templates/other/infographic_2.xml
  80. 2 12
      war/templates/other/lan_plan.xml
  81. 2 12
      war/templates/software/class_1.xml
  82. 2 12
      war/templates/software/class_2.xml
  83. 2 12
      war/templates/software/component.xml
  84. 2 1
      war/templates/software/database_1.xml
  85. 2 12
      war/templates/software/database_2.xml
  86. 2 12
      war/templates/software/database_3.xml
  87. 2 12
      war/templates/software/eip.xml
  88. 2 12
      war/templates/software/entity_relationship.xml
  89. 2 12
      war/templates/tables/authority_matrix.xml
  90. 2 1
      war/templates/tables/gantt_1.xml
  91. 2 12
      war/templates/tables/gantt_2.xml
  92. 2 12
      war/templates/tables/gantt_3.xml
  93. 2 1
      war/templates/uml/activity_diagram_1.xml
  94. 2 12
      war/templates/uml/activity_diagram_2.xml
  95. 2 12
      war/templates/uml/sequence_1.xml
  96. 2 1
      war/templates/uml/sequence_2.xml
  97. 2 12
      war/templates/uml/state_machine.xml
  98. 2 12
      war/templates/uml/sysml.xml
  99. 2 12
      war/templates/uml/uml_1.xml
  100. 0 0
      war/templates/uml/uml_2.xml

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+26-JUL-2017: 6.9.6
+
+- Switches to Google Cloud SDK
+- Adds fishbone diagram templates in business section
+
 24-JUL-2017: 6.9.5
 
 - Fixes anchor links in lightbox for viewer

+ 1 - 1
VERSION

@@ -1 +1 @@
-6.9.5
+6.9.6

+ 2 - 0
src/com/mxgraph/io/vsdx/Style.java

@@ -102,6 +102,8 @@ public class Style
 		catch (Exception e)
 		{
 			// TODO handle exception correctly
+			//For numbers outside Integer range (usually unused/deleted shape), we just set the id to -1
+			this.Id = -1;
 		}
 		
 		cacheCells(model);

+ 9 - 9
war/WEB-INF/appengine-web.xml

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
 	<application>drawdotio</application>
 	<!-- IMPORTANT! DO NOT CHANGE THIS VALUE IN SOURCE CONTROL! -->
@@ -14,16 +14,16 @@
 
 	<!-- FOR LOCAL TESTING OF EMBED2 WITH DYNAMIC LOADING -->
 	<static-files>
-		<include path="/styles/**" >
-			<http-header name="Access-Control-Allow-Origin" value="*" />
+		<include path="/styles/**">
+			<http-header name="Access-Control-Allow-Origin" value="*"/>
     	</include>
-    	<include path="/stencils/**" >
-			<http-header name="Access-Control-Allow-Origin" value="*" />
+    	<include path="/stencils/**">
+			<http-header name="Access-Control-Allow-Origin" value="*"/>
     	</include>
-    	<include path="/shapes/**" >
-			<http-header name="Access-Control-Allow-Origin" value="*" />
+    	<include path="/shapes/**">
+			<http-header name="Access-Control-Allow-Origin" value="*"/>
     	</include>
-    	<include path="/**" />
+    	<include path="/**"/>
 	</static-files>
 
 	<instance-class>F2</instance-class>
@@ -31,4 +31,4 @@
     	<min-idle-instances>1</min-idle-instances>
     	<max-idle-instances>1</max-idle-instances>
 	</automatic-scaling>
-</appengine-web-app>
+</appengine-web-app>

+ 1 - 1
war/cache.manifest

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

+ 1 - 0
war/index.html

@@ -346,6 +346,7 @@
 		{
 			// Electron
 			mxscript('js/diagramly/ElectronApp.js');
+			mxscript('js/diagramly/Extensions.js');
 		}
 		
 		// Adds basic error handling

文件差異過大導致無法顯示
+ 917 - 1022
war/js/app.min.js


文件差異過大導致無法顯示
+ 1 - 1
war/js/atlas-viewer.min.js


文件差異過大導致無法顯示
+ 723 - 829
war/js/atlas.min.js


+ 31 - 33
war/js/diagramly/App.js

@@ -749,16 +749,17 @@ App.prototype.init = function()
 	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;"\'>' +
+		'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,' +
+		'left=\'+((screen.width-640)/2)+\',top=\'+((screen.height-280)/3)+\',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;"\'>' +
+		'" 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,' +
+		'left=\'+((screen.width-640)/2)+\',top=\'+((screen.height-520)/3)+\',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">' +
@@ -866,7 +867,8 @@ App.prototype.init = function()
 							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;"\'>' +
+								'" onclick="javascript:window.open(this.href, \'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,' +
+								'left=\'+((screen.width-480)/2)+\',top=\'+((screen.height-520)/3)+\',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>',
@@ -1000,18 +1002,23 @@ App.prototype.init = function()
 	
 	if (td != null)
 	{
+		this.basicAds.push(td.innerHTML);
 		this.adsHtml = this.basicAds;
 		mxUtils.setPrefixedStyle(td.style, 'transition', 'all 1s ease');
-		var lastAd = null;
+		var lastAd = this.adsHtml.length - 1;
 		var thread = null;
 		
 		this.updateAd = function(index)
 		{
+			if (this.adsHtml.length == 1)
+			{
+				window.clearInterval(thread);
+			}
+			
 			if (this.adsHtml.length == 0)
 			{
 				if (td.parentNode != null)
 				{
-					window.clearInterval(thread);
 					td.parentNode.removeChild(td);
 				}
 			}
@@ -1019,29 +1026,25 @@ App.prototype.init = function()
 			{
 				if (index == lastAd)
 				{
-					lastAd = null;
-					index = 0;
+					index++;
 				}
 
-				if (index != lastAd)
+				mxUtils.setPrefixedStyle(td.style, 'transform', 'scale(0)');
+				td.style.opacity = '0';
+			
+				window.setTimeout(mxUtils.bind(this, function()
 				{
-					mxUtils.setPrefixedStyle(td.style, 'transform', 'scale(0)');
-					td.style.opacity = '0';
+					td.innerHTML = this.adsHtml[index];
+					mxUtils.setPrefixedStyle(td.style, 'transform', 'scale(1)');
+					td.style.opacity = '1';
 					lastAd = index;
-				
-					window.setTimeout(mxUtils.bind(this, function()
-					{
-						td.innerHTML = this.adsHtml[index];
-						mxUtils.setPrefixedStyle(td.style, 'transform', 'scale(1)');
-						td.style.opacity = '1';
-					}), 1000);
-				}
+				}), 1000);
 			}
 		};
 		
 		thread = window.setInterval(mxUtils.bind(this, function()
 		{
-			this.updateAd(Math.round(Math.random() * (this.adsHtml.length - 1)));
+			this.updateAd(Math.round(Math.random() * (this.adsHtml.length - 2)));
 		}), 180000);
 		
 		mxEvent.addListener(td, 'click', mxUtils.bind(this, function()
@@ -1051,18 +1054,12 @@ App.prototype.init = function()
 			this.updateAd(0);
 		}));
 
-		if (mxSettings.getOpenCounter() < 3)
+		if (mxSettings.getOpenCounter() > 10)
 		{
-			this.adsHtml.push(td.innerHTML);
-			lastAd = this.adsHtml.length - 1;
-		}
-		else if (mxSettings.getOpenCounter() < 4)
-		{
-			this.updateAd(0);
-		}
-		else
-		{
-			this.updateAd(Math.round(Math.random() * (this.adsHtml.length - 1)));
+			window.setTimeout(mxUtils.bind(this, function()
+			{
+				this.updateAd(0);
+			}), 15000);
 		}
 	}
 	
@@ -2358,7 +2355,8 @@ App.prototype.showSplash = function(force)
 	{
 		var dlg = new SplashDialog(this);
 		
-		this.showDialog(dlg.container, 340, (serviceCount < 2 || mxClient.IS_CHROMEAPP) ? 160 : 260, true, true,
+		this.showDialog(dlg.container, 340, (serviceCount < 2 ||
+			mxClient.IS_CHROMEAPP || EditorUi.isElectronApp) ? 200 : 260, true, true,
 			mxUtils.bind(this, function(cancel)
 			{
 				// Creates a blank diagram if the dialog is closed

+ 6 - 0
war/js/diagramly/Devel.js

@@ -111,4 +111,10 @@ mxscript(drawDevUrl + 'js/diagramly/ruler/mxRuler.js');
 if (urlParams['bridges'] == '1')
 {
 	mxscript(drawDevUrl + 'js/diagramly/mxEdgeBridge.js');
+}
+
+//EquiSpaced Guides
+if (urlParams['equiGuides'] == '1')
+{
+	mxscript(drawDevUrl + 'js/diagramly/mxEquiSpacedGuides.js');
 }

+ 18 - 10
war/js/diagramly/Dialogs.js

@@ -144,6 +144,13 @@ var StorageDialog = function(editorUi, fn, rowLimit)
 		{
 			label.style.paddingTop = '5px';
 			label.style.whiteSpace = 'normal';
+			
+			// Handles special case
+			if (mxClient.IS_IOS)
+			{
+				button.style.padding = '0px 10px 20px 10px';
+				button.style.top = '6px';
+			}
 		}
 		
 		button.appendChild(label);
@@ -516,7 +523,12 @@ var SplashDialog = function(editorUi)
 	var buttons = document.createElement('div');
 	buttons.style.margin = '4px 0px 0px 0px';
 	
-	if (!mxClient.IS_CHROMEAPP)
+	var btn = document.createElement('button');
+	btn.className = 'geBigButton';
+	btn.style.overflow = 'hidden';
+	btn.style.width = '340px';
+	
+	if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
 	{
 		hd.appendChild(logo);
 		mxUtils.write(hd, service);
@@ -524,10 +536,12 @@ var SplashDialog = function(editorUi)
 		buttons.style.border = '1px solid #d3d3d3';
 		buttons.style.borderWidth = '1px 0px 1px 0px';
 		buttons.style.padding = '18px 0px 24px 0px';
+		btn.style.marginBottom = '8px';
 	}
 	else
 	{
-		buttons.style.padding = '24px 0px 28px 0px';
+		buttons.style.padding = '42px 0px 56px 0px';
+		btn.style.marginBottom = '12px';
 	}
 
 	if (mxClient.IS_QUIRKS)
@@ -535,13 +549,7 @@ var SplashDialog = function(editorUi)
 		buttons.style.whiteSpace = 'nowrap';
 		buttons.style.cssFloat = 'left';
 	}
-	
-	var btn = document.createElement('button');
-	btn.className = 'geBigButton';
-	btn.style.marginBottom = '8px';
-	btn.style.overflow = 'hidden';
-	btn.style.width = '340px';
-	
+
 	if (mxClient.IS_QUIRKS)
 	{
 		btn.style.width = '340px';
@@ -605,7 +613,7 @@ var SplashDialog = function(editorUi)
 		storage = mxResources.get('browser');
 	}
 	
-	if (!mxClient.IS_CHROMEAPP)
+	if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp)
 	{
 		var driveUser = (editorUi.drive != null) ? editorUi.drive.getUser() : null;
 		

+ 32 - 13
war/js/diagramly/DriveClient.js

@@ -1290,24 +1290,43 @@ DriveClient.prototype.pickFolder = function(fn)
 		});
 		
 		// Does not show picker if there are no folders in the root
-		this.executeRequest(gapi.client.drive.children.list({'folderId': 'root', 'maxResults': 1,
-			'q': 'trashed=false and mimeType=\'application/vnd.google-apps.folder\''}),
-			mxUtils.bind(this, function(res)
+		var nextPage = mxUtils.bind(this, function(token)
 		{
-			if (res == null || res.items == null || res.items.length == 0)
+			var query = {'folderId': 'root', 'maxResults': 1, 'q': 'trashed=false and mimeType=\'application/vnd.google-apps.folder\''};
+			
+			if (token != null)
 			{
-				// Simulates a pick event
-				this.ui.spinner.stop();
-				fn({'action': google.picker.Action.PICKED, 'docs': [{'type': 'folder', 'id': 'root'}]});
+				query.pageToken = token;
 			}
-			else
+			
+			this.executeRequest(gapi.client.drive.children.list(query), mxUtils.bind(this, function(res)
+			{
+				if (res == null || res.items == null || res.items.length == 0)
+				{
+					if (res != null && res.nextPageToken != null)
+					{
+						// Next page can still contain results, see
+						// https://stackoverflow.com/questions/23741845
+						nextPage(res.nextPageToken);
+					}
+					else
+					{
+						// Simulates a pick event
+						this.ui.spinner.stop();
+						fn({'action': google.picker.Action.PICKED, 'docs': [{'type': 'folder', 'id': 'root'}]});						
+					}
+				}
+				else
+				{
+					showPicker();
+				}
+			}), mxUtils.bind(this, function(err)
 			{
 				showPicker();
-			}
-		}), mxUtils.bind(this, function(err)
-		{
-			showPicker();
-		}));
+			}));
+		});
+		
+		nextPage(null);
 	}
 };
 

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

@@ -2198,7 +2198,7 @@
     		}
     	}
 
-		EditorUi.prototype.footerHeight = (screen.width >= 780 && screen.height >= 240) ? 46 : 0;
+		EditorUi.prototype.footerHeight = (screen.width >= 760 && screen.height >= 240) ? 46 : 0;
 		
 		// Fetches footer from page
 		EditorUi.prototype.createFooter = function()

+ 134 - 64
war/js/diagramly/ElectronApp.js

@@ -143,16 +143,16 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 			           
 		        if (paths !== undefined && paths[0] != null)
 		        {
-		        	var fs = require('fs');
 		        	var path = paths[0];
-		        	var index = path.lastIndexOf('.png');
-		        	var isPng = index > -1 && index == path.length - 4;
-		        	var encoding = (isPng || /\.gif$/i.test(path) || /\.jpe?g$/i.test(path) ||
-		        		/\.vsdx$/i.test(path)) ? 'base64' : 'utf-8'
+		        	var asImage = /\.png$/i.test(path) || /\.gif$/i.test(path) || /\.jpe?g$/i.test(path);
+		        	var encoding = (asImage || /\.vsdx$/i.test(path) || /\.vssx$/i.test(path)) ?
+		        		'base64' : 'utf-8';
 
 					if (editorUi.spinner.spin(document.body, mxResources.get('loading')))
 					{
-			        	fs.readFile(path, encoding, mxUtils.bind(this, function (e, data)
+			        	var fs = require('fs');
+
+						fs.readFile(path, encoding, mxUtils.bind(this, function (e, data)
 			        	{
 			        		if (e)
 			        		{
@@ -163,53 +163,116 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 			        		{
 								try
 								{
-									if (isPng)
+									if (data.substring(0, 26) == '{"state":"{\\"Properties\\":')
 									{
-										var tmp = editorUi.extractGraphModelFromPng(data);
-										
-										if (tmp != null)
+										editorUi.importLucidChart(data, 0, 0, null, function()
 										{
-											data = tmp;
-										}
+											editorUi.spinner.stop();
+										});
 									}
-									
-									if (!editorUi.isOffline() && new XMLHttpRequest().upload && editorUi.isRemoteFileFormat(data, path))
+									else
 									{
-										// Asynchronous parsing via server
-										editorUi.parseFile(editorUi.base64ToBlob(data, 'application/octet-stream'), mxUtils.bind(this, function(xhr)
+										if (/\.png$/i.test(path))
 										{
-											if (xhr.readyState == 4)
+											var tmp = editorUi.extractGraphModelFromPng(data);
+											
+											if (tmp != null)
 											{
-												editorUi.spinner.stop();
-												
-												if (xhr.status >= 200 && xhr.status <= 299)
+												asImage = false;
+												data = tmp;
+											}
+										}
+										else if (/\.svg$/i.test(path))
+						    			{
+											// LATER: Use importXml without throwing exception if no data
+						    				// Checks if SVG contains content attribute
+					    					var root = mxUtils.parseXml(data);
+				    						var svgs = root.getElementsByTagName('svg');
+				    						
+				    						if (svgs.length > 0)
+					    					{
+				    							var svgRoot = svgs[0];
+						    					var cont = svgRoot.getAttribute('content');
+		
+						    					if (cont != null && cont.charAt(0) != '<' && cont.charAt(0) != '%')
+						    					{
+						    						cont = unescape((window.atob) ? atob(cont) : Base64.decode(cont, true));
+						    					}
+						    					
+						    					if (cont != null && cont.charAt(0) == '%')
+						    					{
+						    						cont = decodeURIComponent(cont);
+						    					}
+		
+						    					if (cont != null && (cont.substring(0, 8) === '<mxfile ' ||
+						    						cont.substring(0, 14) === '<mxGraphModel '))
+						    					{
+						    						asImage = false;
+						    						data = cont;
+						    					}
+						    					else
+						    					{
+						    						asImage = true;
+						    						data = btoa(data);
+						    					}
+					    					}
+						    			}
+										else if (!editorUi.isOffline() && new XMLHttpRequest().upload && editorUi.isRemoteFileFormat(data, path))
+										{
+											// Asynchronous parsing via server
+											editorUi.parseFile(editorUi.base64ToBlob(data, 'application/octet-stream'), mxUtils.bind(this, function(xhr)
+											{
+												if (xhr.readyState == 4)
 												{
+													editorUi.spinner.stop();
 													
-													editorUi.editor.graph.setSelectionCells(editorUi.insertTextAt(xhr.responseText, 0, 0, true));
+													if (xhr.status >= 200 && xhr.status <= 299)
+													{
+														
+														editorUi.editor.graph.setSelectionCells(editorUi.insertTextAt(xhr.responseText, 0, 0, true));
+													}
 												}
-											}
-										}), path);
-									}
-									else if (isPng || /\.gif$/i.test(path) || /\.jpe?g$/i.test(path))
-									{
-										var img = new Image();
-										img.onload = function()
+											}), path);
+										}
+										
+										if (asImage)
 										{
-											editorUi.resizeImage(img, img.src, function(data2, w, h)
+											var img = new Image();
+											img.onload = function()
+											{
+												editorUi.resizeImage(img, img.src, function(data2, w, h)
+												{
+													editorUi.spinner.stop();
+													var pt = graph.getInsertPoint();
+													graph.setSelectionCell(graph.insertVertex(null, null, '', pt.x, pt.y, w, h,
+														'shape=image;aspect=fixed;image=' + editorUi.convertDataUri(data2) + ';'));
+												}, true);
+											};
+											
+											img.onerror = function(e)
 											{
 												editorUi.spinner.stop();
-												var pt = graph.getInsertPoint();
-												graph.setSelectionCell(graph.insertVertex(null, null, '', pt.x, pt.y, w, h,
-													'shape=image;aspect=fixed;image=' + editorUi.convertDataUri(data2) + ';'));
-											}, true);
-										};
-										
-										img.src = 'data:image/png;base64,' + data;
-									}
-									else if (data != null)
-									{
-										editorUi.spinner.stop();
-										graph.setSelectionCells(editorUi.importXml(data));
+												editorUi.handleError();
+											};
+											
+											var format = path.substring(path.lastIndexOf('.') + 1);
+											
+											if (format == 'svg')
+											{
+												format = 'svg+xml';
+											}
+											
+											img.src = 'data:image/' + format + ';base64,' + data;
+										}
+										else
+										{
+											editorUi.spinner.stop();
+											
+											if (data != null)
+											{
+												graph.setSelectionCells(editorUi.importXml(data));
+											}
+										}
 									}
 								}
 								catch(e)
@@ -229,8 +292,6 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 		
 		this.actions.addAction('new...', mxUtils.bind(this, function()
 		{
-			mxLog.debug(this.getCurrentFile());
-
 			if (this.getCurrentFile() == null)
 			{
 				oldNew();
@@ -703,32 +764,41 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 			}
 		}
 	};
-	
+
 	EditorUi.prototype.saveData = function(filename, format, data, mimeType, base64Encoded)
 	{
 		const electron = require('electron');
 		var remote = electron.remote;
 		var dialog = remote.dialog;
-
-        var path = dialog.showSaveDialog({defaultPath: filename});
-
-        if (path != null)
-        {
-			this.fileObject = new Object();
-			this.fileObject.path = path;
-			this.fileObject.name = path.replace(/^.*[\\\/]/, '');
-			var isImage = mimeType != null && mimeType.startsWith('image');
-			this.fileObject.type = base64Encoded ? 'base64' : 'utf-8';
-			var fs = require('fs');
-			
-			fs.writeFile(this.fileObject.path, data, this.fileObject.type, mxUtils.bind(this, function (e)
-		    {
-				if (e)
-				{
-					this.handleError({message: mxResources.get('errorSavingFile')});
-				}
-        	}));
-		}
+		var resume = (this.spinner != null && this.spinner.pause != null) ? this.spinner.pause() : function() {};
+		
+		// Spinner.stop is asynchronous so we must invoke save dialog asynchronously
+		// to give the spinner some time to stop spinning
+		window.setTimeout(mxUtils.bind(this, function()
+		{
+			var path = dialog.showSaveDialog({defaultPath: filename});
+	
+	        if (path != null)
+	        {
+				var fs = require('fs');
+				resume();
+				
+				var fileObject = new Object();
+				fileObject.path = path;
+				fileObject.name = path.replace(/^.*[\\\/]/, '');
+				fileObject.type = (base64Encoded) ? 'base64' : 'utf-8';
+				
+				fs.writeFile(fileObject.path, data, fileObject.type, mxUtils.bind(this, function (e)
+			    {
+					this.spinner.stop();
+					
+					if (e)
+					{
+						this.handleError({message: mxResources.get('errorSavingFile')});
+					}
+	        	}));
+			}
+		}), 0);
 	};
 	
 	EditorUi.prototype.addBeforeUnloadListener = function() {};

+ 114 - 64
war/js/diagramly/GitHubClient.js

@@ -861,7 +861,9 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 	
 	// Adds paging for repos and branches (files limited to 1000 by API)
 	var pageSize = 100;
-	
+	var nextPageDiv = null;
+	var scrollFn = null;
+
 	var selectRef = mxUtils.bind(this, function(page)
 	{
 		if (page == null)
@@ -875,18 +877,42 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		dlg.okButton.setAttribute('disabled', 'disabled');
 		this.ui.spinner.spin(div, mxResources.get('loading'));
 		
+		if (nextPageDiv != null && nextPageDiv.parentNode != null)
+		{
+			nextPageDiv.parentNode.removeChild(nextPageDiv);
+		}
+		
+		nextPageDiv = document.createElement('a');
+		nextPageDiv.style.display = 'block';
+		nextPageDiv.setAttribute('href', 'javascript:void(0);');
+		mxUtils.write(nextPageDiv, mxResources.get('more') + '...');
+		
+		var nextPage = mxUtils.bind(this, function()
+		{
+			mxEvent.removeListener(div, 'scroll', scrollFn);
+			selectRef(page + 1);
+		});
+		
+		mxEvent.addListener(nextPageDiv, 'click', nextPage);
+		
 		this.executeRequest(req, mxUtils.bind(this, function(req)
 		{
 			this.ui.spinner.stop();
-			updatePathInfo(true);
-			var branches = JSON.parse(req.getText());
 			
-			div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
+			if (page == 1)
 			{
-				path = null;
-				selectRepo();
-			})));
-			mxUtils.br(div);
+				updatePathInfo(true);
+				
+				div.appendChild(createLink('../ [Up]', mxUtils.bind(this, function()
+				{
+					path = null;
+					selectRepo();
+				})));
+				
+				mxUtils.br(div);
+			}
+
+			var branches = JSON.parse(req.getText());
 			
 			if (branches == null || branches.length == 0)
 			{
@@ -910,16 +936,17 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 				
 				if (branches.length == pageSize)
 				{
-					var nextPage = mxUtils.bind(this, function()
+					div.appendChild(nextPageDiv);
+					
+					scrollFn = function()
 					{
-						if (div.scrollTop == div.scrollHeight - div.offsetHeight)
+						if (div.scrollTop >= div.scrollHeight - div.offsetHeight)
 						{
-							mxEvent.removeListener(div, 'scroll', nextPage);
-							selectRef(page + 1);
+							nextPage();
 						}
-					});
+					};
 					
-					mxEvent.addListener(div, 'scroll', nextPage);
+					mxEvent.addListener(div, 'scroll', scrollFn);
 				}
 			}
 		}), error);
@@ -938,6 +965,24 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 		dlg.okButton.setAttribute('disabled', 'disabled');
 		this.ui.spinner.spin(div, mxResources.get('loading'));
 		
+		if (nextPageDiv != null && nextPageDiv.parentNode != null)
+		{
+			nextPageDiv.parentNode.removeChild(nextPageDiv);
+		}
+		
+		nextPageDiv = document.createElement('a');
+		nextPageDiv.style.display = 'block';
+		nextPageDiv.setAttribute('href', 'javascript:void(0);');
+		mxUtils.write(nextPageDiv, mxResources.get('more') + '...');
+		
+		var nextPage = mxUtils.bind(this, function()
+		{
+			mxEvent.removeListener(div, 'scroll', scrollFn);
+			selectRepo(page + 1);
+		});
+		
+		mxEvent.addListener(nextPageDiv, 'click', nextPage);
+		
 		this.executeRequest(req, mxUtils.bind(this, function(req)
 		{
 			this.ui.spinner.stop();
@@ -949,60 +994,64 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 			}
 			else
 			{
-				div.appendChild(createLink(mxResources.get('enterValue') + '...', mxUtils.bind(this, function()
+				if (page == 1)
 				{
-					var dlg = new FilenameDialog(this.ui, 'org/repo/ref', mxResources.get('ok'), mxUtils.bind(this, function(value)
+					div.appendChild(createLink(mxResources.get('enterValue') + '...', mxUtils.bind(this, function()
 					{
-						if (value != null)
+						var dlg = new FilenameDialog(this.ui, 'org/repo/ref', mxResources.get('ok'), mxUtils.bind(this, function(value)
 						{
-							var tokens = value.split('/');
-							
-							if (tokens.length > 1)
+							if (value != null)
 							{
-								var tmpOrg = tokens[0];
-								var tmpRepo = tokens[1];
-
-								if (tokens.length < 3)
-								{
-									org = tmpOrg;
-									repo = tmpRepo;
-									ref = null;
-									path = null;
-									
-									selectRef();
-								}
-								else if (this.ui.spinner.spin(div, mxResources.get('loading')))
+								var tokens = value.split('/');
+								
+								if (tokens.length > 1)
 								{
-									var tmpRef = encodeURIComponent(tokens.slice(2, tokens.length).join('/'));
-									
-									this.getFile(tmpOrg + '/' + tmpRepo + '/' + tmpRef, mxUtils.bind(this, function(file)
+									var tmpOrg = tokens[0];
+									var tmpRepo = tokens[1];
+	
+									if (tokens.length < 3)
 									{
-										this.ui.spinner.stop();
-										org = file.meta.org;
-										repo = file.meta.repo;
-										ref = decodeURIComponent(file.meta.ref);
-										path = '';
+										org = tmpOrg;
+										repo = tmpRepo;
+										ref = null;
+										path = null;
 										
-										selectFile();
-									}), mxUtils.bind(this, function(err)
+										selectRef();
+									}
+									else if (this.ui.spinner.spin(div, mxResources.get('loading')))
 									{
-										this.ui.spinner.stop();
-										this.ui.handleError({message: mxResources.get('fileNotFound')});
-									}));
+										var tmpRef = encodeURIComponent(tokens.slice(2, tokens.length).join('/'));
+										
+										this.getFile(tmpOrg + '/' + tmpRepo + '/' + tmpRef, mxUtils.bind(this, function(file)
+										{
+											this.ui.spinner.stop();
+											org = file.meta.org;
+											repo = file.meta.repo;
+											ref = decodeURIComponent(file.meta.ref);
+											path = '';
+											
+											selectFile();
+										}), mxUtils.bind(this, function(err)
+										{
+											this.ui.spinner.stop();
+											this.ui.handleError({message: mxResources.get('fileNotFound')});
+										}));
+									}
+								}
+								else
+								{
+									this.ui.spinner.stop();
+									this.ui.handleError({message: mxResources.get('invalidName')});
 								}
 							}
-							else
-							{
-								this.ui.spinner.stop();
-								this.ui.handleError({message: mxResources.get('invalidName')});
-							}
-						}
-					}), mxResources.get('enterValue'));
-					this.ui.showDialog(dlg.container, 300, 80, true, false);
-					dlg.init();
-				})));
-				mxUtils.br(div);
-				mxUtils.br(div);
+						}), mxResources.get('enterValue'));
+						this.ui.showDialog(dlg.container, 300, 80, true, false);
+						dlg.init();
+					})));
+					
+					mxUtils.br(div);
+					mxUtils.br(div);
+				}
 				
 				for (var i = 0; i < repos.length; i++)
 				{
@@ -1024,16 +1073,17 @@ GitHubClient.prototype.showGitHubDialog = function(showFiles, fn)
 
 			if (repos.length == pageSize)
 			{
-				var nextPage = mxUtils.bind(this, function()
+				div.appendChild(nextPageDiv);
+				
+				scrollFn = function()
 				{
-					if (div.scrollTop == div.scrollHeight - div.offsetHeight)
+					if (div.scrollTop >= div.scrollHeight - div.offsetHeight)
 					{
-						mxEvent.removeListener(div, 'scroll', nextPage);
-						selectRepo(page + 1);
+						nextPage();
 					}
-				});
+				};
 				
-				mxEvent.addListener(div, 'scroll', nextPage);
+				mxEvent.addListener(div, 'scroll', scrollFn);
 			}
 		}), error);
 	});

+ 414 - 0
war/js/diagramly/mxEquiSpacedGuides.js

@@ -0,0 +1,414 @@
+/**
+ * Copyright (c) 2017, CTI LOGIC
+ * Copyright (c) 2006-2017, JGraph Ltd
+ * Copyright (c) 2006-2017, Gaudenz Alder
+ * 
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+//TODO integrate this code in mxGuide
+mxGuide.prototype.move_orig = mxGuide.prototype.move;
+mxGuide.prototype.move = function (bounds, delta, gridEnabled)
+{
+    var point = mxGuide.prototype.move_orig.call(this, bounds, delta, gridEnabled);
+
+    var guide = this;
+    var newState = new mxCellState();
+    var tt = this.getGuideTolerance();
+    var scale = this.graph.getView().scale;
+    var isShift = this.isShiftDown;
+
+    newState.x = bounds.x + this.graph.snap(delta.x / scale) * scale;
+    newState.y = bounds.y + this.graph.snap(delta.y / scale) * scale;
+    newState.width = bounds.width;
+    newState.height = bounds.height;
+
+    var verticalCells = [];
+    var horizontalCells = [];
+    var yShift = point.y;
+    var xShift = point.x;
+    
+    if (this.states != null && bounds != null && delta != null) 
+    {
+      var selCells = this.graph.getSelectionCells();
+      
+      //although states are defined as cellState, it has some mxRectangles!
+      var states = [];
+      
+      for (var i = 0; i < this.states.length; i++)
+	  {
+    	  var state = this.states[i];
+    	  var found = false;
+    	  
+    	  if (state instanceof mxCellState)
+		  {
+    		  for (var j = 0; j < selCells.length; j++)
+    		  {
+        		  if (selCells[j] == state.cell)
+    			  {
+        			  found = true;
+        			  break;
+    			  }
+    		  }		  
+		  
+	    	  if (!found)
+			  {
+	    		  if ((newState.x >= state.x && newState.x <= (state.x + state.width))
+	    	              || (state.x >= newState.x && state.x <= (newState.x + newState.width))) 
+	    		  {
+		            verticalCells.push(state);
+		          }
+	    		  else if ((newState.y >= state.y && newState.y <= (state.y + state.height))
+			            || (state.y >= newState.y && state.y <= (newState.y + newState.height))) 
+	    		  {
+		            horizontalCells.push(state)
+		          }
+			  }
+		  }
+	  }
+      
+      var eqCy = 0;
+      var eqCx = 0;
+      var dy = 0.0;
+      var dx = 0.0;
+      var shift = 5 * scale;
+      var vPoints = [];
+      
+      if (verticalCells.length > 1) 
+      {
+        if (!isShift) 
+        {
+          verticalCells.push(newState)
+        }
+        
+        verticalCells.sort(function(s1, s2)
+		{
+          return s1.y - s2.y;
+        });
+        
+        var firstX = 0;
+        
+        for (var i = 0; i < verticalCells.length - 1; i++)
+  	  	{
+            var s1 = verticalCells[i];
+            var s2 = verticalCells[i + 1];
+            
+            if (firstX == 0) firstX = s1.x + s1.width;
+            
+            vPoints.push(new mxPoint(firstX, s1.y + s1.height + shift));
+            vPoints.push(new mxPoint(firstX, s2.y - shift));
+            
+            if (dy == 0.0) 
+            {
+              dy = s1.y + s1.height - s2.y;
+              eqCy = 1;
+            }
+            else if (Math.abs(dy - (s1.y + s1.height - s2.y)) < tt) 
+            {
+              eqCy += 1;
+            }
+        }
+      }
+      
+      var hPoints = [];
+      
+      if (horizontalCells.length > 1) 
+      {
+        if (!isShift) 
+        {
+          horizontalCells.push(newState)
+        }
+        
+        horizontalCells.sort(function(s1, s2)
+		{
+          return s1.x - s2.x;
+        });
+
+        var firstY = 0;
+        
+        for (var i = 0; i < horizontalCells.length - 1; i++)
+  	  	{
+            var s1 = horizontalCells[i];
+            var s2 = horizontalCells[i + 1];
+            
+            if (firstY == 0) firstY = s1.y + s1.height;
+
+            hPoints.push(new mxPoint(s1.x + s1.width + shift, firstY));
+            hPoints.push(new mxPoint(s2.x - shift, firstY));
+            
+            if (dx == 0.0) 
+            {
+              dx = s1.x + s1.width - s2.x;
+              eqCx = 1;
+            }
+            else if (Math.abs(dx - (s1.x + s1.width - s2.x)) < tt) 
+            {
+              eqCx += 1;
+            }
+        }
+      }
+      
+      var createEqGuide = function(p1, p2, curGuide, isVer)
+      {
+        var points = [];
+        var dx = 0.0;
+        var dy = 0.0;
+        
+        if (isVer) 
+        {
+          dx = shift;
+          dy = 0;
+        }
+        else 
+        {
+          dx = 0;
+          dy = shift;
+        }
+        
+        points.push(new mxPoint(p1.x - dx, p1.y - dy));
+        points.push(new mxPoint(p1.x + dx, p1.y + dy));
+        points.push(p1);
+        points.push(p2);
+        points.push(new mxPoint(p2.x - dx, p2.y - dy));
+        points.push(new mxPoint(p2.x + dx, p2.y + dy));
+
+        if (curGuide != null) 
+        {
+          curGuide.points = points;
+          return curGuide;
+        }
+        else
+        {
+          var guideEq = new mxPolyline(points, mxConstants.GUIDE_COLOR, mxConstants.GUIDE_STROKEWIDTH);
+          guideEq.dialect = mxConstants.DIALECT_SVG;
+          guideEq.pointerEvents = false;
+          guideEq.init(guide.graph.getView().getOverlayPane());
+          return guideEq;
+        }
+      };
+
+      var adjustXShift = function () 
+      {
+        var startState = horizontalCells.shift();
+        var startDx = newState.x - startState.x;
+        var endState = horizontalCells.pop();
+        var endDx = newState.x - endState.x;
+        
+        if (Math.sign(startDx) == Math.sign(endDx)) 
+        {
+          if (Math.sign(startDx) < 0) 
+          {
+            var newX = startState.x - Math.abs(dx) - bounds.width;
+            xShift = newX - bounds.x;
+          }
+          else 
+          {
+            var newX = endState.x + endState.width + Math.abs(dx);
+            xShift = newX - bounds.x;
+          }
+        }
+      }
+      
+      var adjustYShift = function()
+      {
+        var startState = verticalCells.shift();
+        var startDy = newState.y - startState.y;
+        var endState = verticalCells.pop();
+        var endDy = newState.y - endState.y;
+        
+        if (Math.sign(startDy) == Math.sign(endDy)) 
+        {
+          if (startDy.signum < 0) 
+          {
+            var newY = startState.y - Math.abs(dy) - bounds.height;
+            yShift = newY - bounds.y;
+          }
+          else 
+          {
+            var newY = endState.y + endState.height + Math.abs(dy);
+            yShift = newY - bounds.y;
+          }
+        }
+      };
+      
+      if (eqCx > 1 && eqCx == horizontalCells.length - 1) 
+      {
+        var guidesArr = [];
+        var curArr = guide.guidesArrHor;
+        
+        for (var i = 0; i < hPoints.length; i += 2) 
+        {
+          var p1 = hPoints[i];
+          var p2 = hPoints[i+1];
+          var guideEq = createEqGuide(p1, p2, curArr != null ? curArr[i/2] : null);
+          guideEq.node.style.visibility = "visible";
+          guideEq.redraw();
+          guidesArr.push(guideEq);
+        }
+        guide.guidesArrHor = guidesArr;
+        
+        if (isShift) 
+        {
+          adjustXShift();
+        }
+      }
+      else if (isShift && horizontalCells.length == 2) 
+      {
+        adjustXShift();
+      }
+      else if (isShift && horizontalCells.length > 0) 
+      { //center align
+        var minX = Number.MAX_VALUE;
+        var closestCell = horizontalCells[0];
+        
+        for (var i = 0; i < horizontalCells.length; i++) 
+        {
+        	var cell = horizontalCells[i];
+            var dx = Math.abs(cell.x - newState.x);
+            
+            if (dx < minX) 
+            {
+              minX = dx;
+              closestCell = cell;
+            }
+        }
+        
+        var cy = closestCell.getCenterY();
+        var newY = cy - bounds.height/2;
+        yShift = newY - bounds.y;
+      }
+      else if (guide.guidesArrHor != null) 
+      {
+    	  for (var i = 0; i < guide.guidesArrHor.length; i++) 
+          {
+    		  guide.guidesArrHor[i].node.style.visibility = "hidden";
+          }
+      }
+      
+      if (eqCy > 1 && eqCy == verticalCells.length - 1) 
+      {
+        var guidesArr = [];
+        var curArr = guide.guidesArrVer;
+        
+        for (i = 0; i < vPoints.length; i += 2)
+        {
+          var p1 = vPoints[i];
+          var p2 = vPoints[i+1];
+          var guideEq = createEqGuide(p1, p2, curArr != null ? curArr[i/2] : null, true);
+          guideEq.node.style.visibility = "visible";
+          guideEq.redraw();
+          guidesArr.push(guideEq);
+        }
+        
+        guide.guidesArrVer = guidesArr;
+        
+        if (isShift) 
+        {
+          adjustYShift();
+        }
+      } 
+      else if (isShift && verticalCells.length == 2) 
+      {
+        adjustYShift();
+      }
+      else if (isShift && verticalCells.length > 0) 
+      { //center align
+        var minY = Number.MAX_VALUE;
+        var closestCell = verticalCells[0];
+        
+        for (var i = 0; i < verticalCells.length; i++) 
+        {
+        	var cell = verticalCells[i];
+            var dy = Math.abs(cell.y - newState.y);
+            
+            if (dy < minY) 
+            {
+                minY = dy;
+                closestCell = cell;
+            }
+        }
+        
+        var cx = closestCell.getCenterX();
+        var newX = cx - bounds.width/2;
+        xShift = newX - bounds.x;
+      }
+      else if (guide.guidesArrVer != null)
+      {
+    	  for (var i = 0; i < guide.guidesArrVer.length; i++) 
+          {
+    		  guide.guidesArrVer[i].node.style.visibility = "hidden";
+          }
+      }
+    }
+    return new mxPoint(xShift, yShift);
+};
+
+mxGuide.prototype.setVisible_orig = mxGuide.prototype.setVisible;
+mxGuide.prototype.setVisible = function (visible)
+{
+	var guide = this;
+	mxGuide.prototype.setVisible_orig.call(guide, visible);
+    
+    var guidesArrVer = guide.guidesArrVer;
+    var guidesArrHor = guide.guidesArrHor;
+    
+    if (guidesArrVer != null) 
+    {
+      for (var i = 0; i < guidesArrVer.length; i++)
+	  {
+    	  guidesArrVer[i].node.style.visibility = visible? "visible" : "hidden";
+	  }
+    }
+    
+    if (guidesArrHor != null) 
+    {
+      for (var i = 0; i < guidesArrHor.length; i++)
+  	  {
+    	  guidesArrHor[i].node.style.visibility = visible? "visible" : "hidden";
+  	  }
+    }
+};
+
+mxGuide.prototype.destroy_orig = mxGuide.prototype.destroy;
+mxGuide.prototype.destroy = function()
+{
+	mxGuide.prototype.destroy_orig.call(this);
+    var guidesArrVer = this.guidesArrVer;
+    var guidesArrHor = this.guidesArrHor;
+    
+    if (guidesArrVer != null)
+    {
+    	for (var i = 0; i < guidesArrVer.length; i++)
+    	{
+    		guidesArrVer[i].destroy();
+    	}
+    	this.guidesArrVer = null;
+    }
+    
+    if (guidesArrHor != null)
+    {
+    	for (var i = 0; i < guidesArrHor.length; i++)
+    	{
+    		guidesArrHor[i].destroy();
+    	}
+    	this.guidesArrHor = null;
+    }
+};
+
+mxGuide.prototype.isEnabledForEvent_orig =  mxGuide.prototype.isEnabledForEvent;
+mxGuide.prototype.isEnabledForEvent = function (evt)
+{
+    this.isShiftDown = mxEvent.isShiftDown(evt);
+    return mxGuide.prototype.isEnabledForEvent_orig.call(this, evt);
+};

+ 12 - 147
war/js/diagramly/sidebar/Sidebar-Advanced.js

@@ -55,154 +55,19 @@
 
 		return fns.concat(
 		[
-		 	this.addEntry('container swimlane pool horizontal', function()
-		 	{
-				var cell = new mxCell('Pool', new mxGeometry(0, 0, 480, 380),
-			    	'swimlane;html=1;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;horizontal=1;startSize=20;horizontalStack=0;');
-				cell.vertex = true;
+			this.addDataEntry('container swimlane pool horizontal', 480, 380, 'Horizontal Pool 1',
+				'zZRLbsIwEIZP4709TlHXhJYNSEicwCIjbNWJkWNKwumZxA6IlrRUaisWlmb+eX8LM5mXzdyrnV66Ai2TL0zm3rkQrbLJ0VoG3BRMzhgAp8fgdSQq+ijfKY9VuKcAYsG7snuMyso5G8U6tDaJ9cGUVlXkTXUoacuZIHOjjS0WqnX7blYd1OZt8KYea3PE1bCI+CAtVUMq7/o5b46uCmroSn18WFMm+XCdse5GpLq0OPqAzejxvZQun6MrMfiWUg6mCDpmZM8RENdotjqVyUFUdRS259oLSzISztto5Se0i44gcHEn3i9A/IQB3GbQpmi69DskAn4BSTaGBB4Jicj+k8nTGBP5SExg8odMyL38eH3s6kM8AQ=='),
+			this.addDataEntry('container swimlane pool horizontal', 480, 360, 'Horizontal Pool 2',
+				'zZTBbsIwDIafJvfU6dDOlI0LSEg8QUQtEi1tUBJGy9PPbcJQWTsxaZs4VLJ//07sT1WYKKpm6eRBrW2JhokXJgpnbYhR1RRoDAOuSyYWDIDTx+B1opr1VX6QDutwTwPEhndpjhiVjbUmij60Jon+pCsja8rmKlQ05SKjcKe0KVeytcfuLh/k7u2SzR16fcbNZZDsRlrLhlTenWedPts6SJMEOseFLTkph6Fj212RbGlwdAGbyeV7KW2+RFthcC1ZTroMKjry5wiIK9R7ldrELInSR2H/2XtlSUHCOY5WfEG76ggCz+7E+w2InzCAcQapIf0fAySzESQZ/AKSfAoJPCKS9mbzf0H0NIVIPDAiyP8QEaXX97CvDZ7LDw=='),
+			this.addDataEntry('container swimlane pool horizontal', 360, 480, 'Vertical Pool 1',
+				'xZRBbsIwEEVP4709ThFrQssGJKSewCIjbNXGyDEl4fSdxKa0NJFQVTULSzP/e+T5b2EmS9esgjrqja/QMvnMZBm8j6lyTYnWMuCmYnLJADgdBi8jruhdflQBD/GRAUgD78qeMClb720S69jaLNZn46w6ULfQ0dGWS0HlThtbrVXrT91bdVS7t2u3CFibC26vi4g7aaMaUjmpNBbiKxnUQyfkjTBEbEZT9VKOtELvMIaWrpxNFXW6IWcpOddo9jqPFfMsqjoJ+8/ZGyQqMqdhZvIHs3WHBrh4kNvvIsNw5Da7OdgXAgKGCMz+gEAxRgCmINDcxZ2CyNMYETkhESj+jwi1t1+r9759ah8='),
+			this.addDataEntry('container swimlane pool vertical', 380, 480, 'Vertical Pool 2',
+				'xZTPbsIwDMafJvf86dDOlI0LSEg8QUQtEi1pUBJGy9PPbdJ1G1TqhXGoZH/219g/RSGitM3ay5PaugoMEW9ElN65mCLblGAM4VRXRKwI5xQ/wt8nqqyv0pP0UMc5Bp4Mn9KcISk750wSQ2xNFsNFWyNrzJYqWpxyxTA8KG2qjWzduTsrRHn4GLKlh6CvsBsGYX+krWxQpaiizcc9FjDnnaCc11dXR2lyxyjsuyPy3/Lg4CM0k8v3Ut58Dc5C9C22XHQVVeoQrwkQVaCPKtuKQZQhCcdv78gSg4zzPlpxg3bTEeSUzcR7Q2bWyvz+ytmQr8NPAow/ikAxRYA/kQAr/hPByxQC8cxLsHggAkzH56uv/XrdvgA='),
+			this.addDataEntry('vertical tree layout', 280, 190, 'Vertical Tree Layout',
+				'5ZXNUoMwEICfJncgteq1UHvRi3W8p2QHMhNIJyyl9OndQLBFWqcz6kE9MGT/s182E8bjYr+yYps/GQma8SXjsTUG+1Wxj0FrFgVKMp6wKAroY9HDBWvYWYOtsFDiNQFRH7ATuoZe8woWVSqc04sFoN+jaE2NvWOFrfaOVaMKLUqSFjkWtPMkpGWFwuJaHZwT1SabsepgShSDR5orLX1OniDVGIQT3640T1wCC5U6iI0eZL9j2ibsL3bdqXzLKzAFoG3JpVESc9/5XU8myEFl+RB275Wi6hXZe+wRIi08x/NM+YTpszvPj/yaXCGstyJ1ckMTMAZ5VZvR+TZ9gD/7oB2LJxDC4AyE2TcwmE0YxO7YSRX+LxA3ExCT/kFmsPYi6I1plkfFolOQYTdcyxEba+pSghzdDJfuc05U3dQ2hdG40r3NAE9Ob0rTghaoduPsX4EzvzglU0p/ekpuf+OUzH9mSkg8vn+dbfQ8vgE='),
+			this.addDataEntry('horizontal tree layout', 310, 160, 'Horizontal Tree Layout',
+				'5ZXNUoMwEICfhjuQWu+FWg96sb5A2uxAZgJhwlJKn94NSQWkdTqjHtQDQ/Y/+2UzCVhSHDeGV/mzFqACtg5YYrRGtyqOCSgVxKEUAUuDOA7pC+KHK9aot4YVN1DiLQGxCzhw1YDTPGojT7pEbt1eDQD9nninG3SuNXbKu9atLBQvSVrlWNDe04iWNXKDW3myTlSdbENGllrFPpdK+JwsRapxFka+fWmX0UAtT3zXl7Xxfs9gEI5X++5VvukN6ALQdOTSSoG582CRYxPmILP8HLb0Sl47RfYeO2CkhSd5mSqbUX2xJ/qRX5tLhG3F91ZuaQamIG9qM77cpg/wpx92U3EEIQovQFh8A4PFjEFij51U0f8CcTcDMesfRAZbL4La6XY9KFa9ggzjazSmY3RTChCTu2ETfk6K6uvG7GEysHRzM8DR+c15GlAc5WGa/St4llfnZM7pT8/J/e+ck+XPzAmJwyvY2yaP5Bs='),
 				
-				var cell1 = new mxCell('Lane 1', new mxGeometry(0, 20, 480, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Lane 2', new mxGeometry(0, 140, 480, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-				var cell3 = new mxCell('Lane 3', new mxGeometry(0, 260, 480, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Horizontal Pool 1', true);
-		 	}),
-		 	this.addEntry('container swimlane pool horizontal', function()
-			{
-				var cell = new mxCell('Pool', new mxGeometry(0, 0, 480, 360),
-			    	'swimlane;html=1;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;horizontal=0;startSize=20;horizontalStack=0;');
-				cell.vertex = true;
-				
-				var cell1 = new mxCell('Lane 1', new mxGeometry(20, 0, 460, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Lane 2', new mxGeometry(20, 120, 460, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-				var cell3 = new mxCell('Lane 3', new mxGeometry(20, 240, 460, 120), 'swimlane;html=1;startSize=20;horizontal=0;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Horizontal Pool 2', true);
-		 	}),
-		 	this.addEntry('container swimlane pool vertical', function()
-			{
-				var cell = new mxCell('Pool', new mxGeometry(0, 0, 360, 480),
-			    	'swimlane;html=1;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;startSize=20;');
-				cell.vertex = true;
-				
-				var cell1 = new mxCell('Lane 1', new mxGeometry(0, 20, 120, 460), 'swimlane;html=1;startSize=20;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Lane 2', new mxGeometry(120, 20, 120, 460), 'swimlane;html=1;startSize=20;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-				var cell3 = new mxCell('Lane 3', new mxGeometry(240, 20, 120, 460), 'swimlane;html=1;startSize=20;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Vertical Pool 1', true);
-		 	}),
-		 	this.addEntry('container swimlane pool vertical', function()
-			{
-				var cell = new mxCell('Pool', new mxGeometry(0, 0, 380, 480),
-			    	'swimlane;html=1;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;startSize=20;horizontal=0;horizontalStack=1;');
-				cell.vertex = true;
-				
-				var cell1 = new mxCell('Lane 1', new mxGeometry(20, 0, 120, 480), 'swimlane;html=1;startSize=20;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Lane 2', new mxGeometry(140, 0, 120, 480), 'swimlane;html=1;startSize=20;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-				var cell3 = new mxCell('Lane 3', new mxGeometry(260, 0, 120, 480), 'swimlane;html=1;startSize=20;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Vertical Pool 2', true);
-		 	}),
-		 	this.addEntry('vertical tree layout', function()
-			{
-				var cell = new mxCell('Vertical Tree Layout', new mxGeometry(0, 0, 280, 190),
-						'swimlane;html=1;startSize=20;horizontal=1;childLayout=treeLayout;horizontalTree=0;resizable=0;');
-				cell.vertex = true;
-				
-				var cell1 = new mxCell('Root', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Child 1', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-		    	var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=elbowEdgeStyle;elbow=vertical;html=1;rounded=0;');
-		    	edge1.geometry.relative = true;
-		    	edge1.edge = true;
-		    	cell1.insertEdge(edge1, true);
-		    	cell2.insertEdge(edge1, false);
-		    	cell.insert(edge1);
-		    	
-				var cell3 = new mxCell('Child 2', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-		    	var edge2 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=elbowEdgeStyle;elbow=vertical;html=1;rounded=0;');
-		    	edge2.geometry.relative = true;
-		    	edge2.edge = true;
-		    	cell1.insertEdge(edge2, true);
-		    	cell3.insertEdge(edge2, false);
-		    	cell.insert(edge2);
-				
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Vertical Tree Layout', true);
-		 	}),
-		 	this.addEntry('horizontal tree layout', function()
-			{
-				var cell = new mxCell('Horizontal Tree Layout', new mxGeometry(0, 0, 310, 160),
-						'swimlane;html=1;startSize=20;horizontal=0;childLayout=treeLayout;horizontalTree=1;resizable=0;');
-				cell.vertex = true;
-				
-				var cell1 = new mxCell('Root', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell1.vertex = true;
-				cell.insert(cell1);
-				
-				var cell2 = new mxCell('Child 1', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell2.vertex = true;
-				cell.insert(cell2);
-				
-				var edge1 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=elbowEdgeStyle;elbow=horizontal;html=1;rounded=0;');
-				edge1.geometry.relative = true;
-				edge1.edge = true;
-				cell1.insertEdge(edge1, true);
-				cell2.insertEdge(edge1, false);
-				cell.insert(edge1);
-				
-				var cell3 = new mxCell('Child 2', new mxGeometry(20, 20, 100, 40), 'whiteSpace=wrap;html=1;');
-				cell3.vertex = true;
-				cell.insert(cell3);
-				
-				var edge2 = new mxCell('', new mxGeometry(0, 0, 0, 0), 'edgeStyle=elbowEdgeStyle;elbow=horizontal;html=1;rounded=0;');
-				edge2.geometry.relative = true;
-				edge2.edge = true;
-				cell1.insertEdge(edge2, true);
-				cell3.insertEdge(edge2, false);
-				cell.insert(edge2);
-
-				return sb.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'Horizontal Tree Layout', true);
-		 	}),
 		 	this.addEntry('vertical flow layout', function()
 			{
 		 		return sb.createVertexTemplateFromCells([flow], flow.geometry.width, flow.geometry.height, 'Vertical Flow Layout', true);

文件差異過大導致無法顯示
+ 16 - 232
war/js/diagramly/sidebar/Sidebar-Android.js


+ 8 - 84
war/js/diagramly/sidebar/Sidebar-Cabinet.js

@@ -43,96 +43,20 @@
 					w * 7, h, '100x40', 'Panel Wiring System 100x40mm (Vertical)', null, null, this.getTagsForStencil(gn, '', dt + 'panel wiring system').join(' ')),
 			this.createVertexTemplateEntry(s + 'cb_1p;', 
 					w * 0.18, h, '', 'Circuit Breaker (1P)', null, null, this.getTagsForStencil(gn, 'cb_1p', dt).join(' ')),
-
-		   	this.addEntry(dt + 'circuit breaker row', function()
-	   		{
-			   	var bg1 = new mxCell('', new mxGeometry(0, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg1.vertex = true;
-			   	var bg2 = new mxCell('', new mxGeometry(w * 0.18, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg2.vertex = true;
-			   	var bg3 = new mxCell('', new mxGeometry(w * 0.36, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg3.vertex = true;
-			   	var bg4 = new mxCell('', new mxGeometry(w * 0.54, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg4.vertex = true;
-			   	var bg5 = new mxCell('', new mxGeometry(w * 0.72, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg5.vertex = true;
-			   	var bg6 = new mxCell('', new mxGeometry(w * 0.9, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg6.vertex = true;
-			   	var bg7 = new mxCell('', new mxGeometry(w * 1.08, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg7.vertex = true;
-			   	var bg8 = new mxCell('', new mxGeometry(w * 1.26, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg8.vertex = true;
-			   	var bg9 = new mxCell('', new mxGeometry(w * 1.44, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg9.vertex = true;
-			   	var bg10 = new mxCell('', new mxGeometry(w * 1.62, 0, w * 0.18, h), s + 'cb_1p;');
-			   	bg10.vertex = true;
-			    
-			   	return sb.createVertexTemplateFromCells([bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8, bg9, bg10], w * 1.8, h, 'Circuit Breaker (1P x 10)');
-			}),
+			this.addDataEntry(dt + 'circuit breaker row', w * 1.8, h, 'Circuit Breaker (1P x 10)',
+				'7dhPb8IgFADwT8PVFLD+Oc66edmS3XZcaIuFSKVpmdZvv9eCOpOZbCRygqQJvNcH9P1uRTSr+03LGvGmS64QfUY0a7U2dlb3GVcKkUSWiK4RIQk8iLzcyeIxmzSs5XvzlwJiCw5MfXEbsYHOnJQLHHhrZMHUK8u5etedNFLvIZVrY3SN6KpkneDDfgksOsFKfTwvTKt3PNNKt+NeNBkHZLZSqR/x7TggLkwNPVhjmDIlq+GcAj6Fw3ur80WeXMLo5nLGhyyNcIVwhWa4e91XQ18nBcvlnptuUuSfeChx3wzb8f5u38aQa9qG65qb9gSvHN1BkF3aIsFlJVxRarudsM6uq0vh1QAmjuF3EhpJ/kfS33A8HmgagbyA8CKUUBqFvITIPJTQLAp5CdFZKKF5FPISmqahhBZRyEsonYYSWkYhL6EZDSWEk0jkRTQnwYhwJPIiWuAHEcHy+odizN38wPgG'),
 
 			this.createVertexTemplateEntry(s + 'cb_2p;', w * 0.36, h, '', 'Circuit Breaker (2P)', null, null, this.getTagsForStencil(gn, 'cb_2p', dt).join(' ')),
-
-		   	this.addEntry(dt + 'circuit breaker row', function()
-	   		{
-			   	var bg1 = new mxCell('', new mxGeometry(0, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg1.vertex = true;
-			   	var bg2 = new mxCell('', new mxGeometry(w * 0.36, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg2.vertex = true;
-			   	var bg3 = new mxCell('', new mxGeometry(w * 0.72, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg3.vertex = true;
-			   	var bg4 = new mxCell('', new mxGeometry(w * 1.08, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg4.vertex = true;
-			   	var bg5 = new mxCell('', new mxGeometry(w * 1.44, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg5.vertex = true;
-			   	var bg6 = new mxCell('', new mxGeometry(w * 1.8, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg6.vertex = true;
-			   	var bg7 = new mxCell('', new mxGeometry(w * 2.16, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg7.vertex = true;
-			   	var bg8 = new mxCell('', new mxGeometry(w * 2.52, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg8.vertex = true;
-			   	var bg9 = new mxCell('', new mxGeometry(w * 2.88, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg9.vertex = true;
-			   	var bg10 = new mxCell('', new mxGeometry(w * 3.24, 0, w * 0.36, h), s + 'cb_2p;');
-			   	bg10.vertex = true;
-			    
-			   	return sb.createVertexTemplateFromCells([bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8, bg9, bg10], w * 3.6, h, 'Circuit Breaker (2P x 10)');
-			}),
+			this.addDataEntry(dt + 'circuit breaker row', w * 3.6, h, 'Circuit Breaker (2P x 10)',
+				'7ZhNb8MgDIZ/DdeKQD+Pa7r1skm77TiRxA1opESEtem/Hwm0XaVV2pDGCSQkbPMa8HOxQDRv+q1mLX9RFUhEHxHNtVLGrZo+BykRwaJCdIMIwXYi8nQnmo1R3DINe/MbAXGCA5Of4DzO0ZmT9I4DaCNKJp9ZAfJVdcIItbehQhmjGkTXFes4DPmwNTrOKnU8G0arD8iVVHrMRfE4bGQnpPzm343D+rlpbA02mV0yKerhnNI+Bey+9fkiDz5gVHs5401UhnuhvUI73L3p66Guk5IVYg+mm5TFOxkk/s02HfR36za6fNG2oBow+mS3HP1Bw46lU3EQNfeqmSs3Zp2z64vyCsEuPIefmdDE5G9M+lseERBNE6IgRHQeDdEsIQpCNJtGQzRPiIIQLUg0RIuEKAjRCkdDtEyIwtoFHK9fWCVGYYxIvIYhwwlSGKRpvJYhyxKkMEjzf2sarHn9sBhjN/8ZXw=='),
 
 			this.createVertexTemplateEntry(s + 'cb_3p;', w * 0.54, h, '', 'Circuit Breaker (3P)', null, null, this.getTagsForStencil(gn, 'cb_3p', dt).join(' ')),
-
-		   	this.addEntry(dt + 'circuit breaker row', function()
-	   		{
-			   	var bg1 = new mxCell('', new mxGeometry(0, 0, w * 0.54, h), s + 'cb_3p;');
-			   	bg1.vertex = true;
-			   	var bg2 = new mxCell('', new mxGeometry(w * 0.54, 0, w * 0.54, h), s + 'cb_3p;');
-			   	bg2.vertex = true;
-			   	var bg3 = new mxCell('', new mxGeometry(w * 1.08, 0, w * 0.54, h), s + 'cb_3p;');
-			   	bg3.vertex = true;
-			   	var bg4 = new mxCell('', new mxGeometry(w * 1.62, 0, w * 0.54, h), s + 'cb_3p;');
-			   	bg4.vertex = true;
-			   	var bg5 = new mxCell('', new mxGeometry(w * 2.16, 0, w * 0.54, h), s + 'cb_3p;');
-			   	bg5.vertex = true;
-			    
-			   	return sb.createVertexTemplateFromCells([bg1, bg2, bg3, bg4, bg5], w * 2.7, h, 'Circuit Breaker (3P x 5)');
-			}),
+			this.addDataEntry(dt + 'circuit breaker row', w * 2.7, h, 'Circuit Breaker (3P x 5)',
+				'7ZbBbsIwDIafJleUNrBxHWXjskm77TilrWmipbhKPShvP7cJMKQhbUjj1EiRYju/7fi7RKis7lZeN+YFS3BCPQqVeUQKp7rLwDmRSlsKtRRpKnmL9OlCNBmistEeNvQbQRoEW+0+IXiCo6W9i44teLKFds86B/eKrSWLGw7lSIS1UItStwb6fJKN1ugSdweDPH5Ahg79kEvJYXFkbZ375l8Pi/2Gap7BMuGjdrbq6xT8FOB7i0MjDzFA2BxrvNmSTBRyC03fe91V/Vwnhc7tBqidFPm76iXxzZwOuotzG1xxaCvAGsjv+couFupndx9UBmxlomoWxi11G+zqqDxB4EPk8DMTNTL5G5PunMcNEE1HRFchmk1vhmg2IroK0Ty5GaK7EdFViBI5/y9GbJ4+H0Ps7G/yBQ=='),
 	
 			this.createVertexTemplateEntry(s + 'cb_4p;', w * 0.72, h, '', 'Circuit Breaker (4P)', null, null, this.getTagsForStencil(gn, 'cb_4p', dt).join(' ')),
-
-		   	this.addEntry(dt + 'circuit breaker row', function()
-	   		{
-				var bg1 = new mxCell('', new mxGeometry(0, 0, w * 0.72, h), s + 'cb_4p;');
-			   	bg1.vertex = true;
-			   	var bg2 = new mxCell('', new mxGeometry(w * 0.72, 0, w * 0.72, h), s + 'cb_4p;');
-			   	bg2.vertex = true;
-			   	var bg3 = new mxCell('', new mxGeometry(w * 1.44, 0, w * 0.72, h), s + 'cb_4p;');
-			   	bg3.vertex = true;
-			   	var bg4 = new mxCell('', new mxGeometry(w * 2.16, 0, w * 0.72, h), s + 'cb_4p;');
-			   	bg4.vertex = true;
-			   	var bg5 = new mxCell('', new mxGeometry(w * 2.88, 0, w * 0.72, h), s + 'cb_4p;');
-			   	bg5.vertex = true;
-			    
-			   	return sb.createVertexTemplateFromCells([bg1, bg2, bg3, bg4, bg5], w * 3.6, h, 'Circuit Breaker (4P x 5)');
-			}),
+			this.addDataEntry(dt + 'circuit breaker row', w * 3.6, h, 'Circuit Breaker (4P x 5)',
+				'7ZbBbsIwDIafJlcUmsJ2HWXjskm77TilrWmipbhKPShvP7cJMKQhbUjj1EiRYv/5ncTfJUJldbfyujEvWIIT6lGozCNSWNVdBs6JRNpSqKVIEslTJE8X1OmgykZ72NBvDEkwbLX7hJAJiZb2Lia24MkW2j3rHNwrtpYsbljKkQhroRalbg309SQHrdEl7g4BefyADB36oZaSw2BlbZ37ll8Pg/OGau7BcspL7WzVn1PwU4D3LQ4XeYgCYXM8482WZKKRr9D0d6+7qu/rpNC53QC1kyJ/T3tLfDOXg+5i34ZUbNoKsAbye96yiwexqubBZcBWJrpmod1StyGujs4TBF5EDj8zUSOTvzHpznncAFE6IroK0V1yM0SzEdFViKby/maM5iOj6xil6X8x4vD0+xi0s8/JFw=='),
 				
 			this.createVertexTemplateEntry(s + 'cb_auxiliary_contact;', 
 					w * 0.09, h, '', 'Auxiliary Contact (Circuit Breaker)', null, null, this.getTagsForStencil(gn, 'cb_auxiliary_contact', dt).join(' ')),

文件差異過大導致無法顯示
+ 25 - 247
war/js/diagramly/sidebar/Sidebar-EIP.js


文件差異過大導致無法顯示
+ 4 - 82
war/js/diagramly/sidebar/Sidebar-ER.js


文件差異過大導致無法顯示
+ 18 - 200
war/js/diagramly/sidebar/Sidebar-Floorplan.js


文件差異過大導致無法顯示
+ 12 - 192
war/js/diagramly/sidebar/Sidebar-GCP.js


文件差異過大導致無法顯示
+ 10 - 126
war/js/diagramly/sidebar/Sidebar-Ios.js


文件差異過大導致無法顯示
+ 32 - 510
war/js/diagramly/sidebar/Sidebar-Ios7.js


+ 2 - 22
war/js/diagramly/sidebar/Sidebar-LeanMapping.js

@@ -16,28 +16,8 @@
 		var fns =
 		[
 			this.createVertexTemplateEntry(s2 + 'boat_shipment;align=center;', w, h, '', 'Boat Shipment', null, null, this.getTagsForStencil(gn, 'boat_shipment', dt).join(' ')),
-			this.addEntry(dt + 'data box', function()
-			{
-			   	var bg = new mxCell('', new mxGeometry(0, 0, 60, 100), s + 'data_box;html=1;');
-			   	bg.vertex = true;
-			   	var text1 = new mxCell('C/T=', new mxGeometry(0, 0, 60, 20), 'text;fontSize=8;spacingLeft=2;verticalAlign=middle;html=1;');
-			   	text1.vertex = true;
-			   	bg.insert(text1);
-			   	var text2 = new mxCell('C/O=', new mxGeometry(0, 20, 60, 20), 'text;fontSize=8;spacingLeft=2;verticalAlign=middle;html=1;');
-			   	text2.vertex = true;
-			   	bg.insert(text2);
-			   	var text3 = new mxCell('Batch=', new mxGeometry(0, 40, 60, 20), 'text;fontSize=8;spacingLeft=2;verticalAlign=middle;html=1;');
-			   	text3.vertex = true;
-			   	bg.insert(text3);
-			   	var text4 = new mxCell('Avail=', new mxGeometry(0, 60, 60, 20), 'text;fontSize=8;spacingLeft=2;verticalAlign=middle;html=1;');
-			   	text4.vertex = true;
-			   	bg.insert(text4);
-			   	var text5 = new mxCell('', new mxGeometry(0, 80, 60, 20), 'text;fontSize=8;spacingLeft=2;verticalAlign=middle;html=1;');
-			   	text5.vertex = true;
-			   	bg.insert(text5);
-
-	   			return sb.createVertexTemplateFromCells([bg], bg.geometry.width, bg.geometry.height, 'Data Box');
-			}),
+			this.addDataEntry(dt + 'data box', 60, 100, 'Data Box',
+				'1ZVfT8MgFMU/Da9LB7Pude10LxofNPFxuRZWiLQQirP10wstczbd4p9osz00uT2XA/f8HgCRtKhXBjS/VZRJRK4QSY1StquKOmVSIhwJisgSYRy5D+HrI91p2400GFba7xhwZ9iCfGGd0gmVbWQQKmvUM3sU1HInYEQSbgs36HLqyoqD9uuKOvcZJpJBuS5Aa1HmEwoW1k+q7lvCicxYVh+dupXCyCumCmZN45a8hilcN+6CRZyJnO9cURCh6oT8w7pn4IqA4TASMkDiLQ87Op/RuATu5GSjSnsv3rw490w0ZC7+DdvYAMyHFRnIhRR56WkJSv0eP8aCf4UF/wGV2UEqd6dMpemnHwHSxQBSAjbjZwBpNh6keABpsQUhzwBSPB6ky6/v5RODM/83OO53/yC2vd57+Q4='),
 		   	
 			this.createVertexTemplateEntry(s + 'outside_sources;whiteSpace=wrap;align=center;', w, h * 0.7, 
 					'<table cellpadding="5" cellspacing="0" style="font-size:1em;width:100%;height:100%;">' +

文件差異過大導致無法顯示
+ 4 - 59
war/js/diagramly/sidebar/Sidebar-Network.js


文件差異過大導致無法顯示
+ 1 - 1
war/js/embed-static.min.js


文件差異過大導致無法顯示
+ 1 - 1
war/js/reader.min.js


文件差異過大導致無法顯示
+ 1 - 1
war/js/viewer.min.js


+ 1 - 1
war/styles/grapheditor.css

@@ -413,7 +413,7 @@ div.mxWindow .geButton {
 	box-sizing:border-box;
 	width:100%;
 	height:100%;
-	padding:11px 42px 11px 42px;
+	padding:11px 38px 11px 38px;
 	white-space:nowrap;
 }
 .geHsplit {

文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/accd.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/archimate.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/bpmn.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/business_model_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/business_model_2.xml


二進制
war/templates/business/ishikawa_1.png


文件差異過大導致無法顯示
+ 2 - 0
war/templates/business/ishikawa_1.xml


二進制
war/templates/business/ishikawa_2.png


文件差異過大導致無法顯示
+ 2 - 0
war/templates/business/ishikawa_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/pert_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/pert_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/timeline_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/business/timeline_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/charts/coc.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/charts/org_chart_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/charts/org_chart_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/engineering/cabinet.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/engineering/electrical_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/engineering/electrical_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/flowcharts/cross_functional_flowchart.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/flowcharts/data_flow_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/flowcharts/data_flow_2.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/flowcharts/data_flow_3.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/flowcharts/epc.xml


+ 2 - 0
war/templates/index.xml

@@ -4,6 +4,8 @@
 <template url="business/bpmn.xml" libs="general;bpmn"/>
 <template url="business/business_model_1.xml" libs="general;signs"/>
 <template url="business/business_model_2.xml" libs="general"/>
+<template url="business/ishikawa_1.xml" libs="general"/>
+<template url="business/ishikawa_2.xml" libs="general"/>
 <template url="business/pert_1.xml" libs="general"/>
 <template url="business/pert_2.xml" libs="general"/>
 <template url="business/timeline_1.xml" libs="general"/>

文件差異過大導致無法顯示
+ 2 - 1
war/templates/layout/blog_wireframe.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/layout/bootstrap.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/layout/wireframe.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/maps/concept_map.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/maps/site_map.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/Internet.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/active_directory.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/aws.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/aws_3d.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/azure.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/cisco.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/citrix.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/lan.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/telecomm.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/veeam.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/network/wireless_home_network.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/block.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/decision_tree.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/educational.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/floor_plan.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/infographic_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/infographic_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/other/lan_plan.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/class_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/class_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/component.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/software/database_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/database_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/database_3.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/eip.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/software/entity_relationship.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/tables/authority_matrix.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/tables/gantt_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/tables/gantt_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/tables/gantt_3.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/uml/activity_diagram_1.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/uml/activity_diagram_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/uml/sequence_1.xml


文件差異過大導致無法顯示
+ 2 - 1
war/templates/uml/sequence_2.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/uml/state_machine.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/uml/sysml.xml


文件差異過大導致無法顯示
+ 2 - 12
war/templates/uml/uml_1.xml


+ 0 - 0
war/templates/uml/uml_2.xml


部分文件因文件數量過多而無法顯示