瀏覽代碼

8.6.5 release

Former-commit-id: afa5ef2f68c2028337d3f32f8c0ea378cb205651
Gaudenz Alder 7 年之前
父節點
當前提交
d16eca52be

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+17-MAY-2018: 8.6.5
+
+- Fixes timing error for export in Safari
+- Fixes change UI font size bug
+- Uses mxGraph 3.9.4
+- Fixes minor bugs
+
 14-MAY-2018: 8.6.4
 
 - Improvements to electron build

+ 1 - 1
VERSION

@@ -1 +1 @@
-8.6.4
+8.6.5

文件差異過大導致無法顯示
+ 70 - 70
etc/mxgraph/mxClient.js


+ 1 - 1
src/main/webapp/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 05/14/2018 04:58 PM
+# 05/17/2018 11:10 AM
 
 app.html
 index.html?offline=1

文件差異過大導致無法顯示
+ 270 - 0
src/main/webapp/connect/confluence/connect-dev.json


+ 93 - 0
src/main/webapp/connect/jira/connect-dev.json

@@ -0,0 +1,93 @@
+{
+     "name": "Draw.io gaudenz",
+     "description": "Draw.io add-on for JIRA",
+     "key": "com.mxgraph.jira.plugins.drawio.gaudenz",
+     "baseUrl": "https://0d961297.ngrok.io/",
+     "vendor": {
+         "name": "JGraph Ltd.",
+         "url": "https://www.jgraph.com"
+     },
+     "authentication": 
+     {
+         "type": "none"
+     },
+     "version": "1.0.4",
+     "scopes": 
+     [
+     	"READ",
+     	"WRITE",
+     	"DELETE"
+	 ],
+     "modules": 
+     {
+      "generalPages": 
+      [
+      	{
+			"url":"/connect/jira/editor2.html?issueId=${issue.id}",
+			"key":"drawioEditor",
+			"name":
+			{
+				"value":"Draw.io Editor"
+			},
+			"location":"hidden"
+		},
+		{
+			"url":"/connect/jira/fullScreenViewer2.html?issueId=${issue.id}",
+			"key":"drawioFullScreenViewer",
+			"name":
+			{
+				"value":"Draw.io Full Screen Viewer"
+			},
+			"location":"hidden"
+		}
+      ],
+	  "webItems": [
+	    {
+	      "location": "operations-attachments",
+	      "weight": 50,
+	      "key": "drawioEditorBlank",
+	      "url": "/connect/jira/editor2.html?issueId=${issue.id}",
+	      "name": {
+	        "value": "Add Draw.io Diagram"
+	      },
+	      "target": 
+	      {
+			"type":"dialog",
+			"options": 
+			{
+				"width":"100%",
+				"height":"100%",
+				"chrome":false
+			}
+		  }
+	    }, 
+	    {
+       	   "key": "drawioEditorDialog",
+	        "name": 
+	        {
+	            "value": "Draw.io Editor"
+	        },
+	        "url": "/connect/jira/editor2.html?issueId=${issue.id}",
+	        "location": "none",
+	        "context": "addon"
+	    }
+	  ],
+	  "webPanels": 
+	  [
+      {
+        "url": "/connect/jira/viewerPanel2.html?issueId=${issue.id}",
+        "location": "atl.jira.view.issue.right.context",
+        "layout": 
+        {
+          "width": "300px"
+        },
+        "weight": 50,
+        "key": "drawioViewerPanel",
+        "name": 
+        {
+          "value": "Draw.io Diagrams"
+        }
+      }
+    ] 
+	}
+ }

文件差異過大導致無法顯示
+ 834 - 833
src/main/webapp/js/app.min.js


文件差異過大導致無法顯示
+ 230 - 230
src/main/webapp/js/atlas-viewer.min.js


文件差異過大導致無法顯示
+ 615 - 614
src/main/webapp/js/atlas.min.js


+ 5 - 1
src/main/webapp/js/diagramly/Dialogs.js

@@ -1089,8 +1089,10 @@ var EmbedDialog = function(editorUi, result, timeout, ignoreSize, previewFn)
 	{
 		var downloadBtn = mxUtils.button(mxResources.get('download'), function()
 		{
+			editorUi.hideDialog();
 			editorUi.saveData('embed.txt', 'txt', result, 'text/plain');
 		});
+		
 		downloadBtn.className = 'geBtn';
 		buttons.appendChild(downloadBtn);
 	}
@@ -3830,12 +3832,13 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
 		btns.appendChild(laterBtn);
 	}
 
-	if (allowTab)
+	if (allowTab && Editor.popupsAllowed)
 	{
 		var openBtn = mxUtils.button(mxResources.get('openInNewWindow'), function()
 		{
 			create('_blank');
 		});
+		
 		openBtn.className = 'geBtn';
 		btns.appendChild(openBtn);
 	}
@@ -3846,6 +3849,7 @@ var CreateDialog = function(editorUi, title, createFn, cancelFn, dlgTitle, btnLa
 		{
 			create((showDeviceButton) ? 'download' : ((showButtons) ? App.MODE_DEVICE : serviceSelect.value));
 		});
+		
 		createBtn.className = 'geBtn gePrimaryBtn';
 		btns.appendChild(createBtn);
 	}

+ 8 - 2
src/main/webapp/js/diagramly/Editor.js

@@ -570,7 +570,13 @@
 		
 		Editor.doMathJaxRender = function(container)
 		{
-			MathJax.Hub.Queue(['Typeset', MathJax.Hub, container]);
+			window.setTimeout(function()
+			{
+				if (container.style.visibility != 'hidden')
+				{
+					MathJax.Hub.Queue(['Typeset', MathJax.Hub, container]);
+				}
+			}, 0);
 		};
 
 		// Disables global typesetting and messages on startup, adds queue for
@@ -637,7 +643,7 @@
 			
 			this.graph.addListener(mxEvent.SIZE, mxUtils.bind(this, function(sender, evt)
 			{
-				if (this.graph.mathEnabled && this.graph.container.style.visibility != 'hidden')
+				if (this.graph.container != null && this.graph.mathEnabled)
 				{
 					Editor.MathJaxRender(this.graph.container);
 				}

+ 79 - 64
src/main/webapp/js/diagramly/EditorUi.js

@@ -2916,7 +2916,7 @@
 		{
 			this.hideDialog();
 		}), mxResources.get('saveAs'), mxResources.get('download'), false, allowBrowser, allowTab,
-			null, count > 1, (count > 4) ? 3 : 4, data, mimeType, base64Encoded);
+			null, count > 1, (count > 4 && (!allowBrowser || count < 6)) ? 3 : 4, data, mimeType, base64Encoded);
 		var noServices = (mxClient.IS_IOS) ? 0 : 1;
 		var height = (count == noServices) ? 160 : ((count > 4) ? 390 : 270);
 		this.showDialog(dlg.container, 420, height, true, true);
@@ -5002,8 +5002,21 @@
 			   		}
 
 			   		ctx.scale(scale, scale);
-					ctx.drawImage(img, border / scale, border / scale);
-					callback(canvas);
+			   		
+			   		// Workaround for broken data URI images in Safari on first export
+			   		if (mxClient.IS_SF)
+			   		{			   		
+						window.setTimeout(function()
+						{
+							ctx.drawImage(img, border / scale, border / scale);
+							callback(canvas);
+						}, 0);
+			   		}
+			   		else
+			   		{
+			   			ctx.drawImage(img, border / scale, border / scale);
+			   			callback(canvas);
+			   		}
 		   		}
 		   		catch (e)
 		   		{
@@ -5311,7 +5324,7 @@
 		    var self = this;
 		    
 		    if (this.crossOriginImages)
-		    	{
+	    	{
 			    img.crossOrigin = 'anonymous';
 		    }	
 		    
@@ -5325,17 +5338,17 @@
 		        
 		        try
 		        {
-		        		callback(canvas.toDataURL());
+	        		callback(canvas.toDataURL());
 		        }
 		        catch (e)
 		        {
-		        		callback(self.svgBrokenImage.src);
+	        		callback(self.svgBrokenImage.src);
 		        }
 		    };
 		    
 		    img.onerror = function()
 		    {
-		    		callback(self.svgBrokenImage.src);
+	    		callback(self.svgBrokenImage.src);
 		    };
 		    
 		    img.src = url;
@@ -5470,7 +5483,9 @@
 			 		 });
 			 		
 			 		 xhr.send(formData);
-				} else {
+				}
+				else
+				{
 					try
 					{
 						this.doImportVisio(file, done, onerror);
@@ -5549,10 +5564,10 @@
 				}
 				finally 
 				{
-				    	if (done != null)
-				    	{
-				    		done();
-				    	}
+			    	if (done != null)
+			    	{
+			    		done();
+			    	}
 				}
 			}
 		});
@@ -5619,10 +5634,10 @@
 		
 		if (pages.length > 0)
 		{
-		    	this.editor.graph.getModel().beginUpdate();
-		    	
-		    	try
-		    	{
+	    	this.editor.graph.getModel().beginUpdate();
+	    	
+	    	try
+	    	{
 				this.pasteLucidChart(pages[0], dx, dy, crop);
 				
 				// If pages are enabled add more pages
@@ -5638,11 +5653,11 @@
 					
 					this.selectPage(current);
 				}
-		    	}
-		    	finally
-		    	{
-		    		this.editor.graph.getModel().endUpdate();
-		    	}
+	    	}
+	    	finally
+	    	{
+	    		this.editor.graph.getModel().endUpdate();
+	    	}
 		}
 	};
 	
@@ -5724,11 +5739,11 @@
 					if (text.substring(0, 5) == 'data:')
 					{
 						this.resizeImage(img, text, mxUtils.bind(this, function(data2, w2, h2)
-		    				{
-								graph.setSelectionCell(graph.insertVertex(null, null, '', graph.snap(dx), graph.snap(dy),
-										w2, h2, 'shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;' +
-										'verticalAlign=top;aspect=fixed;imageAspect=0;image=' + this.convertDataUri(data2) + ';'));
-		    				}), resizeImages, this.maxImageSize);
+	    				{
+							graph.setSelectionCell(graph.insertVertex(null, null, '', graph.snap(dx), graph.snap(dy),
+									w2, h2, 'shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;' +
+									'verticalAlign=top;aspect=fixed;imageAspect=0;image=' + this.convertDataUri(data2) + ';'));
+	    				}), resizeImages, this.maxImageSize);
 					}
 					else
 					{
@@ -5745,18 +5760,18 @@
 					var cell = null;
 					
 					// Inserts invalid data URIs as text
-				    	graph.getModel().beginUpdate();
-				    	try
-				    	{
+			    	graph.getModel().beginUpdate();
+			    	try
+			    	{
 						cell = graph.insertVertex(graph.getDefaultParent(), null, text,
 								graph.snap(dx), graph.snap(dy), 1, 1, 'text;' + ((html) ? 'html=1;' : ''));
 						graph.updateCellSize(cell);
 						graph.fireEvent(new mxEventObject('textInserted', 'cells', [cell]));
-				    	}
-				    	finally
-				    	{
-				    		graph.getModel().endUpdate();
-				    	}
+			    	}
+			    	finally
+			    	{
+			    		graph.getModel().endUpdate();
+			    	}
 	
 					graph.setSelectionCell(cell);
 				}));
@@ -5782,35 +5797,35 @@
 						var graph = this.editor.graph;
 						var cell = null;
 						
-					    	graph.getModel().beginUpdate();
-					    	try
-					    	{
-					    		// Fires cellsInserted to apply the current style to the inserted text.
-					    		// This requires the value to be empty when the event is fired.
-							cell = graph.insertVertex(graph.getDefaultParent(), null, '',
-									graph.snap(dx), graph.snap(dy), 1, 1, 'text;' + ((html) ? 'html=1;' : ''));
-							graph.fireEvent(new mxEventObject('textInserted', 'cells', [cell]));
-							
-							// Apply value and updates the cell size to fit the text block
-							cell.value = text;
-							graph.updateCellSize(cell);
-							
-							// See http://stackoverflow.com/questions/6927719/url-regex-does-not-work-in-javascript
-							var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
-							
-							if (regexp.test(cell.value))
-							{
-								graph.setLinkForCell(cell, cell.value);
-							}
-							
-							// Adds spacing
-							cell.geometry.width += graph.gridSize;
-							cell.geometry.height += graph.gridSize;
-					    	}
-					    	finally
-					    	{
-					    		graph.getModel().endUpdate();
-					    	}
+				    	graph.getModel().beginUpdate();
+				    	try
+				    	{
+				    		// Fires cellsInserted to apply the current style to the inserted text.
+				    		// This requires the value to be empty when the event is fired.
+						cell = graph.insertVertex(graph.getDefaultParent(), null, '',
+								graph.snap(dx), graph.snap(dy), 1, 1, 'text;' + ((html) ? 'html=1;' : ''));
+						graph.fireEvent(new mxEventObject('textInserted', 'cells', [cell]));
+						
+						// Apply value and updates the cell size to fit the text block
+						cell.value = text;
+						graph.updateCellSize(cell);
+						
+						// See http://stackoverflow.com/questions/6927719/url-regex-does-not-work-in-javascript
+						var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i;
+						
+						if (regexp.test(cell.value))
+						{
+							graph.setLinkForCell(cell, cell.value);
+						}
+						
+						// Adds spacing
+						cell.geometry.width += graph.gridSize;
+						cell.geometry.height += graph.gridSize;
+				    	}
+				    	finally
+				    	{
+				    		graph.getModel().endUpdate();
+				    	}
 						
 						return [cell];
 					}
@@ -5831,7 +5846,7 @@
 		
 	    do
 	    {
-	    		size = size / 1024;
+	    	size = size / 1024;
 	        i++;
 	    } while (size > 1024);
 

+ 6 - 1
src/main/webapp/js/diagramly/ElectronApp.js

@@ -145,11 +145,16 @@ FeedbackDialog.feedbackUrl = 'https://log.draw.io/email';
 		var editorUi = this;
 		var graph = this.editor.graph;
 		
-		global.__emt_isModified = e => {
+		global.__emt_isModified =
+		e => {
 			if (this.getCurrentFile())
+			{
 				return this.getCurrentFile().isModified()
+			}
+
 			return false
 		}
+		
 		// global.__emt_getCurrentFile = e => {
 		// 	return this.getCurrentFile()
 		// }

+ 35 - 14
src/main/webapp/js/diagramly/Menus.js

@@ -240,7 +240,22 @@
 		
 		editorUi.actions.addAction('close', function()
 		{
-			editorUi.fileLoaded(null);
+			var currentFile = editorUi.getCurrentFile();
+			
+			function fn()
+			{
+				editorUi.fileLoaded(null);
+			};
+			
+			if (currentFile != null && currentFile.isModified())
+			{
+				editorUi.confirm(mxResources.get('allChangesLost'), null, fn,
+					mxResources.get('cancel'), mxResources.get('discardChanges'));
+			}
+			else
+			{
+				fn();
+			}
 		});
 		
 		editorUi.actions.addAction('editShape...', mxUtils.bind(this, function()
@@ -814,7 +829,7 @@
 				input.setAttribute('size', '25');
 				input.style.marginLeft = '8px';
 
-				mxEvent.addListener(input, 'keypress', mxUtils.bind(this, function(e)
+				mxEvent.addListener(input, 'keydown', mxUtils.bind(this, function(e)
 				{
 					var term = mxUtils.trim(input.value);
 					
@@ -822,6 +837,7 @@
 					{
 						this.editorUi.openLink('https://desk.draw.io/support/search/solutions?term=' +
 							encodeURIComponent(term));
+						input.value = '';
 						this.editorUi.logEvent({category: 'Help', action: 'search', label: term});
 						
 						if (this.editorUi.menubar != null)
@@ -832,6 +848,10 @@
 							}), 0);
 						}
 					}
+	                else if (e.keyCode == 27)
+	                {
+	                    input.value = '';
+	                }
 				}));
 				
 				item.firstChild.nextSibling.appendChild(input);
@@ -864,7 +884,19 @@
 					this.addMenuItems(menu, ['feedback'], parent);
 				}
 
-				this.addMenuItems(menu, ['support', '-', 'about'], parent);
+				this.addMenuItems(menu, ['support', '-'], parent);
+				
+				if (!editorUi.isOffline() && !navigator.standalone && urlParams['embed'] != '1')
+				{
+					this.addMenuItems(menu, ['download'], parent);
+				}
+				
+				if (!editorUi.isOfflineApp() && urlParams['embed'] != '1')
+				{
+					this.addMenuItems(menu, ['offline'], parent);
+				}
+				
+				this.addMenuItems(menu, ['-', 'about'], parent);
 			}
 
 			if (urlParams['ruler'] == '1')
@@ -2553,17 +2585,6 @@
 				
 			menu.addSeparator(parent);
 			this.addMenuItem(menu, 'tags', parent);
-			menu.addSeparator(parent);
-
-			if (!editorUi.isOffline() && !navigator.standalone && urlParams['embed'] != '1')
-			{
-				this.addMenuItems(menu, ['download'], parent);
-			}
-			
-			if (!editorUi.isOfflineApp() && urlParams['embed'] != '1')
-			{
-				this.addMenuItems(menu, ['offline'], parent);
-			}
 		})));
 
 		this.put('file', new Menu(mxUtils.bind(this, function(menu, parent)

+ 10 - 14
src/main/webapp/js/diagramly/Minimal.js

@@ -283,10 +283,10 @@ EditorUi.initMinimalTheme = function()
     mxEdgeHandler.prototype.terminalHandleImage = Graph.createSvgImage(16, 16, '<circle cx="8" cy="8" r="5" stroke="' + stroke + '" fill="' + fill + '"/><circle cx="8" cy="8" r="3" stroke="' + stroke + '" fill="' + fill + '"/>');
     mxEdgeHandler.prototype.fixedHandleImage = Graph.createSvgImage(16, 16, '<circle cx="8" cy="8" r="5" stroke="' + stroke + '" fill="' + fill + '"/><path d="m 6 6 L 10 10 M 6 10 L 10 6" stroke="' + stroke + '"/>');
     mxConstraintHandler.prototype.pointImage = Graph.createSvgImage(5, 5, '<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="' + fill + '"/>');
-    HoverIcons.prototype.triangleUp = Graph.createSvgImage(18, 36, '<path d="m 6 36 L 12 36 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="' + fill + '"/>');
+    HoverIcons.prototype.triangleUp = Graph.createSvgImage(18, 38, '<path d="m 6 36 L 12 36 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="' + fill + '"/>');
     HoverIcons.prototype.triangleRight = Graph.createSvgImage(36, 18, '<path d="m 1 6 L 24 6 L 24 1 L 36 9 L 24 18 L 24 12 L 1 12 z" stroke="#fff" fill="' + fill + '"/>');
     HoverIcons.prototype.triangleDown = Graph.createSvgImage(18, 36, '<path d="m 6 1 L 6 24 L 1 24 L 9 36 L 18 24 L 12 24 L 12 1 z" stroke="#fff" fill="' + fill + '"/>');
-    HoverIcons.prototype.triangleLeft = Graph.createSvgImage(36, 18, '<path d="m 1 9 L 12 1 L 12 6 L 36 6 L 36 12 L 12 12 L 12 18 z" stroke="#fff" fill="' + fill + '"/>');
+    HoverIcons.prototype.triangleLeft = Graph.createSvgImage(38, 18, '<path d="m 1 9 L 12 1 L 12 6 L 36 6 L 36 12 L 12 12 L 12 18 z" stroke="#fff" fill="' + fill + '"/>');
     HoverIcons.prototype.roundDrop = Graph.createSvgImage(26, 26, '<circle cx="13" cy="13" r="12" stroke="#fff" fill="' + fill + '"/>');
     HoverIcons.prototype.arrowSpacing = 0;
     mxOutline.prototype.sizerImage = null;
@@ -324,6 +324,7 @@ EditorUi.initMinimalTheme = function()
     mxGraphHandler.prototype.previewColor = '#C0C0C0';
     mxRubberband.prototype.defaultOpacity = 50;
     HoverIcons.prototype.inactiveOpacity = 25;
+    Format.prototype.showCloseButton = false;
 	EditorUi.prototype.closableScratchpad = false;
 	EditorUi.prototype.showCsvImport = false;
     EditorUi.prototype.footerHeight = 0;
@@ -567,7 +568,7 @@ EditorUi.initMinimalTheme = function()
         var editor = ui.editor;
         var graph = editor.graph;
         
-        if (graph.isEnabled())
+        if (graph.isEnabled() && typeof(MathJax) !== 'undefined')
         {
             // Math
             var option = this.createOption(mxResources.get('mathematicalTypesetting'), function()
@@ -913,11 +914,6 @@ EditorUi.initMinimalTheme = function()
             	'copyConnect', 'collapseExpand', '-', 'mathematicalTypesetting'], parent);
         })));
 
-        ui.menus.put('embed', new Menu(mxUtils.bind(this, function(menu, parent)
-        {
-            ui.menus.addMenuItems(menu, ['embedImage', 'embedSvg', '-', 'embedHtml', 'embedIframe'], parent);
-        })));
-
         // Needed for creating elements in Format panel
         ui.toolbar = ui.createToolbar(ui.createDiv('geToolbar'));
         ui.defaultLibraryName = mxResources.get('untitledLibrary');
@@ -1293,22 +1289,22 @@ EditorUi.initMinimalTheme = function()
 
             if (ui.actions.outlineWindow != null)
             {
-            	ui.outlineWindow.fit();
+            	ui.actions.outlineWindow.window.fit();
             }
 
             if (ui.actions.layersWindow != null)
             {
-            	ui.outlineWindow.fit();
+            	ui.actions.layersWindow.window.fit();
             }
 
-            if (ui.actions.tagsWindow != null)
+            if (ui.menus.tagsWindow != null)
             {
-            	ui.tagsWindow.window.fit();
+            	ui.menus.tagsWindow.window.fit();
             }
 
-            if (ui.actions.findWindow != null)
+            if (ui.menus.findWindow != null)
             {
-            	ui.findWindow.window.fit();
+            	ui.menus.findWindow.window.fit();
             }
 		});
 	};	

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

@@ -1038,7 +1038,7 @@ EditorUi.prototype.createTab = function(hoverEnabled)
 	tab.style.border = (uiTheme == 'dark') ? '1px solid #505759' : '1px solid #c0c0c0';
 	tab.style.borderBottomStyle = 'solid';
 	tab.style.backgroundColor = this.tabContainer.style.backgroundColor;
-	tab.style.cursor = 'default';
+	tab.style.cursor = 'move';
 	tab.style.color = 'gray';
 
 	if (hoverEnabled)

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

@@ -84,7 +84,7 @@
 	{
 		editorUiInit.apply(this, arguments);
 		
-		if (!this.editor.chromeless || this.editor.editable)
+		if (!this.editor.isChromelessView() || this.editor.editable)
 		{
 			this.addTrees();
 		}

文件差異過大導致無法顯示
+ 71 - 71
src/main/webapp/js/embed-static.min.js


+ 7 - 1
src/main/webapp/js/mxgraph/Editor.js

@@ -194,6 +194,12 @@ Editor.nextLargeImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgC
  */
 Editor.ctrlKey = (mxClient.IS_MAC) ? 'Cmd' : 'Ctrl';
 
+/**
+ * Specifies if the diagram should be saved automatically if possible. Default
+ * is true.
+ */
+Editor.popupsAllowed = true;
+
 /**
  * Editor inherits from mxEventSource
  */
@@ -390,7 +396,7 @@ Editor.prototype.readGraphState = function(node)
 	this.graph.connectionArrowsEnabled = node.getAttribute('arrows') != '0';
 	this.graph.foldingEnabled = node.getAttribute('fold') != '0';
 
-	if (this.chromeless && this.graph.foldingEnabled)
+	if (this.isChromelessView() && this.graph.foldingEnabled)
 	{
 		this.graph.foldingEnabled = urlParams['nav'] == '1';
 		this.graph.cellRenderer.forceControlClickHandler = this.graph.foldingEnabled;

+ 19 - 17
src/main/webapp/js/mxgraph/EditorUi.js

@@ -2748,25 +2748,25 @@ EditorUi.prototype.updateActionStates = function()
 	
 	if (cells != null)
 	{
-	    	for (var i = 0; i < cells.length; i++)
-	    	{
-	    		var cell = cells[i];
-	    		
-	    		if (graph.getModel().isEdge(cell))
-	    		{
-	    			edgeSelected = true;
-	    		}
-	    		
-	    		if (graph.getModel().isVertex(cell))
-	    		{
-	    			vertexSelected = true;
-	    		}
-	    		
-	    		if (edgeSelected && vertexSelected)
+    	for (var i = 0; i < cells.length; i++)
+    	{
+    		var cell = cells[i];
+    		
+    		if (graph.getModel().isEdge(cell))
+    		{
+    			edgeSelected = true;
+    		}
+    		
+    		if (graph.getModel().isVertex(cell))
+    		{
+    			vertexSelected = true;
+    		}
+    		
+    		if (edgeSelected && vertexSelected)
 			{
 				break;
 			}
-    		}
+		}
 	}
 	
 	// Updates action states
@@ -3292,6 +3292,7 @@ EditorUi.prototype.hideDialog = function(cancel)
 			this.editor.graph.container.focus();
 		}
 		
+		mxUtils.clearSelection();
 		this.editor.fireEvent(new mxEventObject('hideDialog'));
 	}
 };
@@ -3711,7 +3712,8 @@ EditorUi.prototype.createKeyHandler = function(editor)
 	// Ignores graph enabled state but not chromeless state
 	keyHandler.isEnabledForEvent = function(evt)
 	{
-		return (!mxEvent.isConsumed(evt) && this.isGraphEvent(evt) && this.isEnabled());
+		return (!mxEvent.isConsumed(evt) && this.isGraphEvent(evt) && this.isEnabled() &&
+			(editorUi.dialogs == null || editorUi.dialogs.length == 0));
 	};
 	
 	// Routes command-key to control-key on Mac

+ 56 - 19
src/main/webapp/js/mxgraph/Format.js

@@ -2739,7 +2739,8 @@ TextFormatPanel.prototype.addFont = function(container)
 
 			function updateSize(elt, ignoreContains)
 			{
-				if (elt != graph.cellEditor.textarea && (ignoreContains || selection.containsNode(elt, true)))
+				if (elt != graph.cellEditor.textarea && graph.cellEditor.textarea.contains(elt) &&
+					(ignoreContains || selection.containsNode(elt, true)))
 				{
 					if (elt.nodeName == 'FONT')
 					{
@@ -2790,30 +2791,66 @@ TextFormatPanel.prototype.addFont = function(container)
 
 			input.value = fontSize + ' pt';
 		}
-		else
+		else if (window.getSelection || document.selection)
 		{
-			pendingFontSize = fontSize;
+			// Checks selection
+			var par = null;
 			
-			// Workaround for can't set font size in px is to change font size afterwards
-			document.execCommand('fontSize', false, '4');
-			var elts = graph.cellEditor.textarea.getElementsByTagName('font');
+			if (document.selection)
+			{
+				par = document.selection.createRange().parentElement();
+			}
+			else
+			{
+				var selection = window.getSelection();
+				
+				if (selection.rangeCount > 0)
+				{
+					par = selection.getRangeAt(0).commonAncestorContainer;
+				}
+			}
 			
-			for (var i = 0; i < elts.length; i++)
+			// Node.contains does not work for text nodes in IE11
+			function isOrContains(container, node)
 			{
-				if (elts[i].getAttribute('size') == '4')
+			    while (node != null)
+			    {
+			        if (node === container)
+			        {
+			            return true;
+			        }
+			        
+			        node = node.parentNode;
+			    }
+			    
+			    return false;
+			};
+			
+			if (par != null && isOrContains(graph.cellEditor.textarea, par))
+			{
+				pendingFontSize = fontSize;
+				
+				// Workaround for can't set font size in px is to change font size afterwards
+				document.execCommand('fontSize', false, '4');
+				var elts = graph.cellEditor.textarea.getElementsByTagName('font');
+				
+				for (var i = 0; i < elts.length; i++)
 				{
-					elts[i].removeAttribute('size');
-					elts[i].style.fontSize = pendingFontSize + 'px';
-		
-					// Overrides fontSize in input with the one just assigned as a workaround
-					// for potential fontSize values of parent elements that don't match
-					window.setTimeout(function()
+					if (elts[i].getAttribute('size') == '4')
 					{
-						input.value = pendingFontSize + ' pt';
-						pendingFontSize = null;
-					}, 0);
-					
-					break;
+						elts[i].removeAttribute('size');
+						elts[i].style.fontSize = pendingFontSize + 'px';
+			
+						// Overrides fontSize in input with the one just assigned as a workaround
+						// for potential fontSize values of parent elements that don't match
+						window.setTimeout(function()
+						{
+							input.value = pendingFontSize + ' pt';
+							pendingFontSize = null;
+						}, 0);
+						
+						break;
+					}
 				}
 			}
 		}

文件差異過大導致無法顯示
+ 71 - 71
src/main/webapp/js/reader.min.js


文件差異過大導致無法顯示
+ 230 - 230
src/main/webapp/js/viewer.min.js