Procházet zdrojové kódy

9.3.0 release

Former-commit-id: c1bc3fc000e7de833d090c5ebc688a4aa42d0b6a
Gaudenz Alder před 6 roky
rodič
revize
85d73139e1

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+22-OCT-2018: 9.3.0
+
+- Adds write permission in OneDrive client
+- Adds link option in SVG export dialog
+- Adds link to save status message
+
 19-OCT-2018: 9.2.9
 
 - Adds OneDrive for Business and Sharepoint integration

+ 1 - 1
VERSION

@@ -1 +1 @@
-9.2.9
+9.3.0

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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 10/19/2018 05:06 PM
+# 10/22/2018 01:42 PM
 
 app.html
 index.html?offline=1

+ 1 - 0
src/main/webapp/github.html

@@ -4,6 +4,7 @@
 		<title></title>
 	</head>
 	<body>
+		This window will be closed automatically.
 		<script>
 			if (window.opener != null && window.opener.onGitHubCallback != null)
 			{

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 393 - 389
src/main/webapp/js/app.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 133 - 129
src/main/webapp/js/atlas-viewer.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1005 - 1001
src/main/webapp/js/atlas.min.js


+ 3 - 3
src/main/webapp/js/diagramly/Dialogs.js

@@ -6416,11 +6416,11 @@ var MoreShapesDialog = function(editorUi, expanded, entries)
 	var newEntries = [];
 	
 	// Adds custom sections first
-	if (editorUi.sidebar.customLibraries != null)
+	if (editorUi.sidebar.customEntries != null)
 	{
-		for (var i = 0; i < editorUi.sidebar.customLibraries.length; i++)
+		for (var i = 0; i < editorUi.sidebar.customEntries.length; i++)
 		{
-			var section = editorUi.sidebar.customLibraries[i];
+			var section = editorUi.sidebar.customEntries[i];
 			var tmp = {title: editorUi.getResource(section.title), entries: []};
 			
 			for (var j = 0; j < section.entries.length; j++)

+ 35 - 1
src/main/webapp/js/diagramly/DrawioFile.js

@@ -317,7 +317,7 @@ DrawioFile.prototype.open = function()
 					// Does not update status if another autosave was scheduled
 					if (this.autosaveThread == null && this.ui.getCurrentFile() == this && !this.isModified())
 					{
-						this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+						this.addAllSavedStatus();
 					}
 				}), mxUtils.bind(this, function(resp)
 				{
@@ -350,6 +350,40 @@ DrawioFile.prototype.open = function()
 	this.ui.addListener('pageViewChanged', this.changeListener);
 };
 
+/**
+ * Returns the location as a new object.
+ * @type mx.Point
+ */
+DrawioFile.prototype.addAllSavedStatus = function()
+{
+	var file = this.ui.getCurrentFile();
+	
+	if (file != null && (file.constructor == DriveFile || file.constructor == DropboxFile))
+	{
+		
+		this.ui.editor.setStatus('<span title="'+ mxUtils.htmlEntities(mxResources.get('revisionHistory')) +
+			'" style="text-decoration:underline;cursor:pointer;">' +
+			mxUtils.htmlEntities(mxResources.get('allChangesSaved')) + '</span>');
+		
+		if (this.ui.statusContainer != null)
+		{
+			var links = this.ui.statusContainer.getElementsByTagName('span');
+			
+			if (links.length > 0)
+			{
+				mxEvent.addListener(links[0], 'click', mxUtils.bind(this, function()
+				{
+					this.ui.actions.get('revisionHistory').funct();
+				}));
+			}
+		}
+	}
+	else
+	{
+		this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+	}
+};
+
 /**
  * Adds the listener for automatically saving the diagram for local changes.
  */

+ 19 - 4
src/main/webapp/js/diagramly/DriveRealtime.js

@@ -49,7 +49,7 @@ function DriveRealtime(file, doc)
 		{
 			if (this.connected && this.ui.editor.autosave)
 			{
-				this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+				this.file.addAllSavedStatus();
 			}
 			else
 			{
@@ -459,7 +459,7 @@ DriveRealtime.prototype.documentSaveStateChanged = function(evt, forceSave)
 		}
 		else
 		{
-			this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+			this.file.addAllSavedStatus();
 		}
 		
 		this.saving = false;
@@ -512,7 +512,7 @@ DriveRealtime.prototype.triggerAutosave = function()
 		// Does not update status if another autosave was scheduled
 		if (this.ui.getCurrentFile() == this.file && !this.saving)
 		{
-			this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
+			this.file.addAllSavedStatus();
 		}
 	}),
 	mxUtils.bind(this, function(resp)
@@ -815,9 +815,24 @@ DriveRealtime.prototype.updateStatus = function()
 				str = mxResources.get('lessThanAMinute');
 			}
 			
-			this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get('lastChange', [str])) +
+			this.ui.editor.setStatus('<span title="'+ mxUtils.htmlEntities(
+				mxResources.get('revisionHistory')) + '" style="text-decoration:underline;cursor:pointer;">' +
+				mxUtils.htmlEntities(mxResources.get('lastChange', [str]))  + '</span>' +
 				(this.file.isEditable() ? '' : '<span class="geStatusAlert" style="margin-left:8px;">' +
 				mxUtils.htmlEntities(mxResources.get('readOnly')) + '</span>'));
+			
+			if (this.ui.statusContainer != null)
+			{
+				var links = this.ui.statusContainer.getElementsByTagName('span');
+				
+				if (links.length > 0)
+				{
+					mxEvent.addListener(links[0], 'click', mxUtils.bind(this, function()
+					{
+						this.ui.actions.get('revisionHistory').funct();
+					}));
+				}
+			}
 		}
 	}
 };

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

@@ -312,7 +312,7 @@
 			// Configures the custom libraries
 			if (config.libraries != null)
 			{
-				Sidebar.prototype.customLibraries = config.libraries;
+				Sidebar.prototype.customEntries = config.libraries;
 			}
 			
 			// Defines the enabled built-in libraries.

+ 52 - 4
src/main/webapp/js/diagramly/EditorUi.js

@@ -3635,7 +3635,8 @@
 	/**
 	 *
 	 */
-	EditorUi.prototype.exportSvg = function(scale, transparentBackground, ignoreSelection, addShadow, editable, embedImages, border, noCrop, currentPage)
+	EditorUi.prototype.exportSvg = function(scale, transparentBackground, ignoreSelection, addShadow,
+		editable, embedImages, border, noCrop, currentPage, linkTarget)
 	{
 		if (this.spinner.spin(document.body, mxResources.get('export')))
 		{
@@ -3663,6 +3664,27 @@
 				this.editor.graph.addSvgShadow(svgRoot);
 			}
 			
+			// Opens links in new window
+			if (linkTarget == 'blank')
+			{
+				var links = svgRoot.getElementsByTagName('a');
+				
+				for (var i = 0; i < links.length; i++)
+				{
+					var href = links[i].getAttribute('href');
+					
+					if (href == null)
+					{
+						href = links[i].getAttribute('xlink:href');
+					}
+					
+					if (href != null && /^https?:\/\//.test(href))
+					{
+						links[i].setAttribute('target', '_blank');
+					}
+				}
+			}
+			
 			var filename = this.getBaseFilename() + '.svg';
 
 			var doSave = mxUtils.bind(this, function(svgRoot)
@@ -4470,7 +4492,7 @@
 		mxUtils.write(hd, title);
 		hd.style.cssText = 'width:100%;text-align:center;margin-top:0px;margin-bottom:10px';
 		div.appendChild(hd);
-		
+
 		mxUtils.write(div, mxResources.get('zoom') + ':');
 		var zoomInput = document.createElement('input');
 		zoomInput.setAttribute('type', 'text');
@@ -4559,7 +4581,7 @@
 		
 		if (!hasPages)
 		{
-			allPages.style.visibility = 'hidden';
+			allPages.style.display = 'none';
 		}
 	
 		mxEvent.addListener(include, 'change', function()
@@ -4579,13 +4601,39 @@
 			allPages.setAttribute('disabled', 'disabled');
 		}
 		
+		var linkSelect = document.createElement('select');
+		linkSelect.style.maxWidth = '260px';
+		linkSelect.style.marginLeft = '8px';
+		linkSelect.style.marginRight = '10px';
+		linkSelect.className = 'geBtn';
+
+		var selfOption = document.createElement('option');
+		selfOption.setAttribute('value', 'self');
+		mxUtils.write(selfOption, mxResources.get('automatic'));
+		linkSelect.appendChild(selfOption);
+		
+		var blankOption = document.createElement('option');
+		blankOption.setAttribute('value', 'blank');
+		mxUtils.write(blankOption, mxResources.get('openInNewWindow'));
+		linkSelect.appendChild(blankOption);
+		
+		if (format == 'svg')
+		{
+			mxUtils.write(div, mxResources.get('links') + ':');
+			div.appendChild(linkSelect);
+			mxUtils.br(div);
+			mxUtils.br(div);
+			height += 26;
+		}
+		
 		var dlg = new CustomDialog(this, div, mxUtils.bind(this, function()
 		{
 			this.lastExportBorder = borderInput.value;
 			this.lastExportZoom = zoomInput.value;
 			
 			callback(zoomInput.value, transparent.checked, !selection.checked, shadow.checked,
-				include.checked, cb5.checked, borderInput.value, cb6.checked, !allPages.checked);
+				include.checked, cb5.checked, borderInput.value, cb6.checked, !allPages.checked,
+				linkSelect.value);
 		}), null, btnLabel, helpLink);
 		this.showDialog(dlg.container, 340, height, true, true);
 		zoomInput.focus();

+ 4 - 4
src/main/webapp/js/diagramly/Menus.js

@@ -96,15 +96,15 @@
 		{
 			editorUi.showExportDialog(mxResources.get('formatSvg'), true, mxResources.get('export'),
 				'https://support.draw.io/display/DO/Exporting+Files',
-				mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection,
-					addShadow, editable, embedImages, border, cropImage, currentPage)
+				mxUtils.bind(this, function(scale, transparentBackground, ignoreSelection, addShadow,
+					editable, embedImages, border, cropImage, currentPage, linkTarget)
 				{
 					var val = parseInt(scale);
 					
 					if (!isNaN(val) && val > 0)
 					{
-					   	editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection,
-					   		addShadow, editable, embedImages, border, !cropImage, currentPage);
+					   	editorUi.exportSvg(val / 100, transparentBackground, ignoreSelection, addShadow,
+					   		editable, embedImages, border, !cropImage, currentPage, linkTarget);
 					}
 				}), true, null, 'svg');
 		}));

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

@@ -23,7 +23,7 @@ OneDriveClient.prototype.clientId = (window.location.hostname == 'test.draw.io')
 /**
  * OAuth 2.0 scopes for installing Drive Apps.
  */
-OneDriveClient.prototype.scopes = 'user.read';
+OneDriveClient.prototype.scopes = 'user.read files.readwrite.all';
 
 /**
  * OAuth 2.0 scopes for installing Drive Apps.

+ 11 - 11
src/main/webapp/js/diagramly/sidebar/Sidebar.js

@@ -130,7 +130,7 @@
 	/**
 	 * Description of custom libraries, see https://desk.draw.io/a/solutions/articles/16000058316
 	 */
-	Sidebar.prototype.customLibraries = null;
+	Sidebar.prototype.customEntries = null;
 	
 	/**
 	 * Array of strings for the built-in libraries to be enabled in the more shapes dialog. Null means all,
@@ -320,11 +320,11 @@
 			}
 		}
 		
-		if (this.customLibraries != null)
+		if (this.customEntries != null)
 		{
-			for (var i = 0; i < this.customLibraries.length; i++)
+			for (var i = 0; i < this.customEntries.length; i++)
 			{
-				var section = this.customLibraries[i];
+				var section = this.customEntries[i];
 				
 				for (var j = 0; j < section.entries.length; j++)
 				{
@@ -377,11 +377,11 @@
 			}
 		}
 		
-		if (this.customLibraries != null)
+		if (this.customEntries != null)
 		{
-			for (var i = 0; i < this.customLibraries.length; i++)
+			for (var i = 0; i < this.customEntries.length; i++)
 			{
-				var section = this.customLibraries[i];
+				var section = this.customEntries[i];
 				
 				for (var j = 0; j < section.entries.length; j++)
 				{
@@ -756,11 +756,11 @@
 		this.addSearchPalette(true);
 		
 		// Adds custom sections first
-		if (this.customLibraries != null)
+		if (this.customEntries != null)
 		{
-			for (var i = 0; i < this.customLibraries.length; i++)
+			for (var i = 0; i < this.customEntries.length; i++)
 			{
-				var section = this.customLibraries[i];
+				var section = this.customEntries[i];
 				
 				for (var j = 0; j < section.entries.length; j++)
 				{
@@ -838,7 +838,7 @@
 			}
 		}
 		
-		this.addGeneralPalette(this.customLibraries == null);
+		this.addGeneralPalette(this.customEntries == null);
 		this.addMiscPalette(false);
 		this.addAdvancedPalette(false);
 		this.addUmlPalette(false);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
src/main/webapp/js/embed-static.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
src/main/webapp/js/reader.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 133 - 129
src/main/webapp/js/viewer.min.js