Browse Source

9.0.0 release

Gaudenz Alder 7 years ago
parent
commit
e3b1e08237

+ 6 - 0
ChangeLog

@@ -1,6 +1,12 @@
+28-JUL-2018: 9.0.0
+
+- Disables persisted default styles
+- Fixes inserting files to GitHub
+
 26-JUL-2018: 8.9.9
 
 - Adds support for hierarchies in CSV import
+- Updates colors for Atlas theme
 - Uses mxGraph 3.9.9 beta 6
 
 23-JUL-2018: 8.9.8

+ 1 - 1
VERSION

@@ -1 +1 @@
-8.9.9
+9.0.0

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

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 07/26/2018 10:35 AM
+# 07/28/2018 12:14 PM
 
 app.html
 index.html?offline=1

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


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


File diff suppressed because it is too large
+ 969 - 964
src/main/webapp/js/atlas.min.js


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

@@ -2986,7 +2986,7 @@ App.prototype.saveFile = function(forceDialog)
 								name.indexOf('.') < 0, /(\.svg)$/i.test(name),
 								/(\.html)$/i.test(name)), null, mode, done,
 								this.mode == null, folderId);
-						}), mode !== App.MODE_GITHUB);
+						}));
 					}
 					else if (mode != null)
 					{

+ 54 - 10
src/main/webapp/js/diagramly/EditorUi.js

@@ -122,6 +122,16 @@
 	 * Restores app defaults for UI
 	 */
 	EditorUi.prototype.closableScratchpad = true;
+
+	/**
+	 * Specifies if current edge style should be persisted. Default is false.
+	 */
+	EditorUi.prototype.persistCurrentEdgeStyle = false;
+
+	/**
+	 * Specifies if current vertex style should be persisted. Default is false.
+	 */
+	EditorUi.prototype.persistCurrentVertexStyle = false;
 	
 	/**
 	 * Capability check for canvas export
@@ -5797,7 +5807,15 @@
 		
 		return cells;
 	};
-
+	
+	/**
+	 * Returns true for VSD and VSS files.
+	 */
+	EditorUi.prototype.isRemoteVisioFormat = function(filename)
+	{
+		return /(\.vsd)($|\?)/i.test(filename) || /(\.vss)($|\?)/i.test(filename);
+	};
+	
 	/**
 	 * Imports the given Visio file
 	 */
@@ -5816,7 +5834,7 @@
 			
 			if (this.doImportVisio)
 			{
-				if ((/(\.vsd)($|\?)/i.test(filename) || /(\.vss)($|\?)/i.test(filename)) && VSD_CONVERT_URL != null) 
+				if (this.isRemoteVisioFormat(filename) && VSD_CONVERT_URL != null) 
 				{
 					var formData = new FormData();
 					formData.append('file1', file, filename);
@@ -6185,7 +6203,7 @@
 	};
 	
 	/**
-	 * Returns true for Gliffy or GraphML data or .vsdx filenames.
+	 * Returns true for Gliffy data.
 	 */
 	EditorUi.prototype.isRemoteFileFormat = function(data, filename)
 	{
@@ -6635,10 +6653,8 @@
 	
 										    						data = this.createSvgDataUri(mxUtils.getXml(svgRoot));
 										    						var s = Math.min(1, Math.min(maxSize / Math.max(1, w)), maxSize / Math.max(1, h));
-	
-										    						var cells = fn(data, file.type, x + index * gs, y + index * gs,
-												    					Math.max(1, Math.round(w * s)), Math.max(1, Math.round(h * s)),
-												    					file.name, resizeImages);
+										    						var cells = fn(data, file.type, x + index * gs, y + index * gs, Math.max(
+										    							1, Math.round(w * s)), Math.max(1, Math.round(h * s)), file.name);
 										    						
 										    						// Hack to fix width and height asynchronously
 										    						if (isNaN(w) || isNaN(h))
@@ -7213,6 +7229,26 @@
 			return done;
 		};
 		
+		// Extends clear default style to clear persisted settings
+		var clearDefaultStyle = this.clearDefaultStyle;
+		
+		this.clearDefaultStyle = function()
+		{
+			clearDefaultStyle.apply(this, arguments);
+			
+			if (!this.persistCurrentEdgeStyle)
+			{
+				mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);
+				mxSettings.save();
+			}
+			
+			if (!this.persistCurrentVertexStyle)
+			{
+				mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
+				mxSettings.save();
+			}
+		};
+		
 		// Sets help link for placeholders
 		if (!this.isOffline() && typeof window.EditDataDialog !== 'undefined')
 		{
@@ -8085,9 +8121,17 @@
 			
 			this.addListener('styleChanged', mxUtils.bind(this, function(sender, evt)
 			{
-				mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);
-				mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
-				mxSettings.save();
+				if (this.persistCurrentEdgeStyle)
+				{
+					mxSettings.setCurrentEdgeStyle(this.editor.graph.currentEdgeStyle);
+					mxSettings.save();
+				}
+				
+				if (this.persistCurrentVertexStyle)
+				{
+					mxSettings.setCurrentVertexStyle(this.editor.graph.currentVertexStyle);
+					mxSettings.save();
+				}
 			}));
 
 			/**

+ 141 - 92
src/main/webapp/js/diagramly/Pages.js

@@ -21,21 +21,7 @@ function DiagramPage(node)
 	if ((this.node.hasAttribute == null && this.node.getAttribute('id') == null) ||
 		(this.node.hasAttribute != null && !this.node.hasAttribute('id')))
 	{
-		// Make global if used anywhere else
-		function guid()
-		{
-		  function s4()
-		  {
-		    return Math.floor((1 + Math.random()) * 0x10000)
-		      .toString(16)
-		      .substring(1);
-		  }
-		  
-		  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
-		    s4() + '-' + s4() + s4() + s4();
-		};
-		
-		this.node.setAttribute('id', guid());
+		this.node.setAttribute('id', Editor.guid());
 	}
 };
 
@@ -103,8 +89,9 @@ RenamePage.prototype.execute = function()
 {
 	var tmp = this.page.getName();
 	this.page.setName(this.previous);
+	this.name = this.previous;
 	this.previous = tmp;
-
+	
 	// Required to update page name in placeholders
 	this.ui.editor.graph.updatePlaceholders();
 	this.ui.editor.fireEvent(new mxEventObject('pageRenamed'));
@@ -463,6 +450,42 @@ Graph.prototype.createViewState = function(node)
 	};
 };
 
+/**
+ * Writes the graph properties from the realtime model to the given mxGraphModel node.
+ */
+Graph.prototype.saveViewState = function(vs, node)
+{
+	node.setAttribute('grid', (vs == null || vs.gridEnabled) ? '1' : '0');
+	node.setAttribute('gridSize', (vs != null) ? vs.gridSize : mxGraph.prototype.gridSize);
+	node.setAttribute('guides', (vs == null || vs.guidesEnabled) ? '1' : '0');
+	node.setAttribute('tooltips', (vs == null || vs.tooltips) ? '1' : '0');
+	node.setAttribute('connect', (vs == null || vs.connect) ? '1' : '0');
+	node.setAttribute('arrows', (vs == null || vs.arrows) ? '1' : '0');
+	node.setAttribute('fold', (vs == null || vs.foldingEnabled) ? '1' : '0');
+	node.setAttribute('page', ((vs == null && this.defaultPageVisible ) ||
+		(vs != null && vs.pageVisible)) ? '1' : '0');
+	node.setAttribute('pageScale', (vs != null) ? vs.pageScale : mxGraph.prototype.pageScale);
+	
+	var pf = (vs != null) ? vs.pageFormat : mxSettings.getPageFormat();
+	
+	if (pf != null)
+	{
+		node.setAttribute('pageWidth', pf.width);
+		node.setAttribute('pageHeight', pf.height);
+	}
+	
+	node.setAttribute('background', (vs != null && vs.background != null) ?
+		vs.background : this.defaultGraphBackground);
+
+	if (vs != null && vs.backgroundImage != null)
+	{
+		node.setAttribute('backgroundImage', JSON.stringify(vs.backgroundImage));
+	}
+
+	node.setAttribute('math', (vs != null && vs.mathEnabled) ? '1' : '0');
+	node.setAttribute('shadow', (vs != null && vs.shadowVisible) ? '1' : '0');
+};
+
 /**
  * Overrides setDefaultParent
  */
@@ -518,20 +541,30 @@ Graph.prototype.setViewState = function(state)
 		this.backgroundImage = state.backgroundImage;
 		this.pageScale = state.pageScale;
 		this.pageFormat = state.pageFormat;
-		this.view.scale = state.scale;
 		this.view.currentRoot = state.currentRoot;
 		this.defaultParent = state.defaultParent;
 		this.connectionArrowsEnabled = state.arrows;
 		this.setTooltips(state.tooltips);
 		this.setConnectable(state.connect);
+
+		if (state.scale != null)
+		{
+			this.view.scale = state.scale;
+		}
+		else
+		{
+			this.view.scale = 1;
+		}
 		
 		// Checks if current root or default parent have been removed
-		if (!this.model.contains(this.view.currentRoot))
+		if (this.view.currentRoot != null &&
+			!this.model.contains(this.view.currentRoot))
 		{
 			this.view.currentRoot = null;
 		}
 		
-		if (!this.model.contains(this.defaultParent))
+		if (this.defaultParent != null &&
+			!this.model.contains(this.defaultParent))
 		{
 			this.setDefaultParent(null);
 			this.selectUnlockedLayer();
@@ -791,7 +824,9 @@ EditorUi.prototype.duplicatePage = function(page, name)
 		// Resets zoom and scrollbar positions
 		newPage.viewState.scale = 1;
 		newPage.viewState.scrollLeft = null;
-		newPage.viewState.scrollRight = null;
+		newPage.viewState.scrollTop = null;
+		newPage.viewState.currentRoot = null;
+		newPage.viewState.defaultParent = null;
 		newPage.setName(name);
 		
 		newPage = this.insertPage(newPage, mxUtils.indexOf(this.pages, page) + 1);
@@ -1341,9 +1376,9 @@ EditorUi.prototype.createPageMenu = function(page, label)
 	
 	codec.beforeDecode = function(dec, node, obj)
 	{
-		  obj.ui = dec.ui;
+		obj.ui = dec.ui;
 		  
-		  return node;
+		return node;
 	};
 	
 	mxCodecRegistry.register(codec);
@@ -1352,26 +1387,20 @@ EditorUi.prototype.createPageMenu = function(page, label)
 //Registers codec for RenamePage
 (function()
 {
-	var codec = new mxObjectCodec(new RenamePage(), ['ui', 'page', 'previous']);
-	
-	codec.afterEncode = function(enc, obj, node)
-	{
-	    node.setAttribute('page', obj.page.getId())
-	    
-	    return node;
-	};
+	var codec = new mxObjectCodec(new RenamePage(), ['ui', 'page']);
 	
 	codec.beforeDecode = function(dec, node, obj)
 	{
-		  obj.ui = dec.ui;
-		  
-		  return node;
+		obj.ui = dec.ui;
+	  
+		return node;
 	};
 	
 	codec.afterDecode = function(dec, node, obj)
 	{
-	    obj.page = dec.ui.getPageById(node.getAttribute('page'));
+	    var tmp = obj.previous;
 	    obj.previous = obj.name;
+	    obj.name = tmp;
 	    
 	    return obj;
 	};
@@ -1385,80 +1414,100 @@ EditorUi.prototype.createPageMenu = function(page, label)
 	var codec = new mxObjectCodec(new ChangePage(), ['ui', 'relatedPage',
 		'index', 'neverShown', 'page', 'previousPage']);
 	
+	var viewStateIgnored = ['defaultParent', 'currentRoot', 'scrollLeft',
+		'scrollTop', 'scale', 'translate', 'lastPasteXml', 'pasteCounter'];
+	
 	codec.afterEncode = function(enc, obj, node)
 	{
-	    node.setAttribute('relatedPage', obj.relatedPage.getId())
+		node.setAttribute('relatedPage', obj.relatedPage.getId())
 	    
-	    if (obj.index == null)
-	    {
-	        node.setAttribute('name', obj.relatedPage.getName());
+		if (obj.index == null)
+		{
+			node.setAttribute('name', obj.relatedPage.getName());
+
+			if (obj.relatedPage.viewState != null)
+			{
+	        	node.setAttribute('viewState', JSON.stringify(
+	        		obj.relatedPage.viewState, function(key, value)
+	        	{
+	        		return (mxUtils.indexOf(viewStateIgnored, key) < 0) ? value : undefined;
+	        	}));
+			}
 	        
-	        if (obj.relatedPage.root != null)
-	        {
-	            enc.encodeCell(obj.relatedPage.root, node);
-	        }
+			if (obj.relatedPage.root != null)
+			{
+				enc.encodeCell(obj.relatedPage.root, node);
+			}
 	    }
 	    
 	    return node;
 	};
-	
+
 	codec.beforeDecode = function(dec, node, obj)
 	{
 		obj.ui = dec.ui;
-	    obj.relatedPage = obj.ui.getPageById(node.getAttribute('relatedPage'));
+		obj.relatedPage = obj.ui.getPageById(node.getAttribute('relatedPage'));
 	    
-	    if (obj.relatedPage == null)
-	    {
-	        var temp = document.createElement('diagram');
-	        temp.setAttribute('id', node.getAttribute('relatedPage'));
-	        temp.setAttribute('name', node.getAttribute('name'));
-	        obj.relatedPage = new DiagramPage(temp);
-	        
+		if (obj.relatedPage == null)
+		{
+			var temp = node.ownerDocument.createElement('diagram');
+			temp.setAttribute('id', node.getAttribute('relatedPage'));
+			temp.setAttribute('name', node.getAttribute('name'));
+			obj.relatedPage = new DiagramPage(temp);
+
+			var vs = node.getAttribute('viewState');
+
+			if (vs != null)
+			{
+				obj.relatedPage.viewState = JSON.parse(vs);
+				node.removeAttribute('viewState');
+			}
+
 	        // Makes sure the original node isn't modified
-	        node = node.cloneNode(true);
-	        var tmp = node.firstChild;
-	        
-	        if (tmp != null)
-	        {
-	            obj.relatedPage.root = dec.decodeCell(tmp, false);
-	
-	            var tmp2 = tmp.nextSibling;
-	            tmp.parentNode.removeChild(tmp);
-	            tmp = tmp2;
-	            
-	            while (tmp != null)
-	            {
-	                tmp2 = tmp.nextSibling;
-	                
-	                if (tmp.nodeType == mxConstants.NODETYPE_ELEMENT)
-	                {
-	                    // Ignores all existing cells because those do not need to
-	                    // be re-inserted into the model. Since the encoded version
-	                    // of these cells contains the new parent, this would leave
-	                    // to an inconsistent state on the model (ie. a parent
-	                    // change without a call to parentForCellChanged).
-	                    var id = tmp.getAttribute('id');
-	                    
-	                    if (dec.lookup(id) == null)
-	                    {
-	                        dec.decodeCell(tmp);
-	                    }
-	                }
-	                
-	                tmp.parentNode.removeChild(tmp);
-	                tmp = tmp2;
-	            }
-	        }
-	    }
-	    
-	    return node;
+			node = node.cloneNode(true);
+			var tmp = node.firstChild;
+
+			if (tmp != null)
+			{
+				obj.relatedPage.root = dec.decodeCell(tmp, false);
+
+				var tmp2 = tmp.nextSibling;
+				tmp.parentNode.removeChild(tmp);
+				tmp = tmp2;
+
+				while (tmp != null)
+				{
+					tmp2 = tmp.nextSibling;
+
+					if (tmp.nodeType == mxConstants.NODETYPE_ELEMENT)
+					{
+						// Ignores all existing cells because those do not need to
+						// be re-inserted into the model. Since the encoded version
+						// of these cells contains the new parent, this would leave
+						// to an inconsistent state on the model (ie. a parent
+						// change without a call to parentForCellChanged).
+						var id = tmp.getAttribute('id');
+
+						if (dec.lookup(id) == null)
+						{
+							dec.decodeCell(tmp);
+						}
+					}
+
+					tmp.parentNode.removeChild(tmp);
+					tmp = tmp2;
+				}
+			}
+		}
+
+		return node;
 	};
-	
+
 	codec.afterDecode = function(dec, node, obj)
 	{
-	    obj.index = obj.previousIndex;
-	    
-	    return obj;
+		obj.index = obj.previousIndex;
+
+		return obj;
 	};
 	
 	mxCodecRegistry.register(codec);

+ 1 - 1
src/main/webapp/js/diagramly/sidebar/Sidebar-Basic.js

@@ -27,7 +27,7 @@
 			this.createVertexTemplateEntry(s2 + 'donut;dx=25;', w, h, '', 'Donut', null, null, this.getTagsForStencil(gn, 'donut', dt).join(' ')),
 			this.createVertexTemplateEntry(s2 + 'drop', w * 0.7, h, '', 'Drop', null, null, this.getTagsForStencil(gn, 'drop', dt).join(' ')),
 			this.createVertexTemplateEntry(s2 + 'flash', w * 0.6, h, '', 'Flash', null, null, this.getTagsForStencil(gn, 'flash', dt).join(' ')),
-			this.createVertexTemplateEntry(s2 + 'half_circle', w, h * 0.5, '', 'Half Circle', null, null, this.getTagsForStencil(gn, 'half_circle', dt).join(' ')),
+			this.createVertexTemplateEntry(s2 + 'half_circle', w, h * 0.5, '', 'Half Circle', null, null, this.getTagsForStencil(gn, 'half_circle', dt + ' semicircle').join(' ')),
 			this.createVertexTemplateEntry(s2 + 'heart', w, h, '', 'Heart', null, null, this.getTagsForStencil(gn, 'heart', dt).join(' ')),
 			this.createVertexTemplateEntry(s + 'isocube;isoAngle=15;', w, h, '', 'Isometric Cube', null, null, this.getTagsForStencil(gn, 'isometric cube', dt).join(' ')),
 			this.createVertexTemplateEntry(s + 'loud_callout', w, h * 0.6, '', 'Loud Callout', null, null, this.getTagsForStencil(gn, 'loud_callout', dt).join(' ')),

File diff suppressed because it is too large
+ 1 - 1
src/main/webapp/js/embed-static.min.js


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


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


+ 15 - 15
src/main/webapp/resources/dia_ru.txt

@@ -2,7 +2,7 @@
 # https://docs.google.com/spreadsheet/ccc?key=0AmQEO36liL4FdDJLWVNMaVV2UmRKSnpXU09MYkdGbEE
 aboutDrawio=О сервисе draw.io
 accessDenied=Доступ запрещён
-action=Action
+action=Действие
 actualSize=Фактический размер
 add=Добавить
 addedFile=Добавлено {1}
@@ -63,7 +63,7 @@ blockquote=Цитата
 blog=Блог
 bold=Полужирный
 bootstrap=Bootstrap
-border=Border
+border=Граница
 borderColor=Цвет границы
 borderWidth=Толщина границы
 bottom=Низ
@@ -93,7 +93,7 @@ chromeApp=Приложение Chrome
 compressed=Сжато
 commitMessage=Сообщение при коммите
 csv=CSV
-dark=Dark
+dark=Темный
 draftFound=Был обнаружен черновик '{1}'. Загрузите его в редактор или откажитесь, чтобы продолжить.
 dragAndDropNotSupported=Перетаскивание изображений не поддерживается. Импортировать изображение?
 dropboxCharsNotAllowed=Следующие символы не допускаются: \ / : ? * " |
@@ -128,7 +128,7 @@ copy=Копировать
 copyConnect=Копировать при соединении
 copyOf=Копия {1}
 copyOfDrawing=Копия документа
-copySize=Copy Size
+copySize=Копировать размер
 copyStyle=Копировать стиль
 create=Создать
 createNewDiagram=Создать новую диаграмму
@@ -231,7 +231,7 @@ errorSavingFileUnknown=Ошибка авторизации на сервере G
 errorSavingFileForbidden=Ошибка сохранения файла. Не хватает прав доступа.
 errorSavingFileNameConflict=Невозможно сохранить диаграмму. Страница уже содержит файл с названием '{1}'.
 errorSavingFileNotFound=Ошибка при сохранении файла. Файл не найден.
-errorSavingFileReadOnlyMode=Could not save diagram while read-only mode is active.
+errorSavingFileReadOnlyMode=Невозможно сохранить диаграмму до выхода из режима только для чтения
 errorSavingFileSessionTimeout=Ваша сессия истекла. Для сохранения, пожалуйста, <a target='_blank' href='{1}'>{2}</a> и вернитесь на эту закладку.
 errorSendingFeedback=Ошибка при отправке сообщения обратной связи.
 errorUpdatingPreview=Ошибка при обновлении предпросмотра.
@@ -265,7 +265,7 @@ fileOpenLocation=Как вы хотите открыть эти файл(ы)?
 fileWillBeSavedInAppFolder={1} будет сохранен в папке программы.
 fill=Заливка
 fillColor=Цвет заливки
-filterCards=Filter Cards
+filterCards=Фильтровать карточки
 find=Найти
 fit=Вписать
 fitContainer=Изменить размер контейнера
@@ -422,12 +422,12 @@ loggedOut=Вышел
 logIn=войти
 loveIt=Обожаю {1}
 lucidchart=Lucidchart
-maps=Maps
+maps=Карты
 mathematicalTypesetting=Математический набор
 makeCopy=Создать копию
 manual=Вручную
 middle=Середина
-minimal=Minimal
+minimal=Минимальный
 misc=Прочее
 mockups=Макеты
 modificationDate=Дата изменения
@@ -510,7 +510,7 @@ paperSize=Размер бумаги
 pattern=Шаблон
 paste=Вставить
 pasteHere=Вставить сюда
-pasteSize=Paste Size
+pasteSize=Вставить размер
 pasteStyle=Вставить стиль
 perimeter=По периметру
 permissionAnyone=Редактирование разрешено всем
@@ -544,13 +544,13 @@ readOnly=Только для чтения
 reconnecting=Восстановление соединения
 recentlyUpdated=Недавно обновлено
 recentlyViewed=Недавно просмотрено
-rectangle=Rectangle
+rectangle=Прямоугольник
 redirectToNewApp=Файл был создан или изменен в более новой версии приложения. Сейчас вы будете перенаправлены.
 realtimeTimeout=Похоже, вы внесли некоторые правки, пока не было соединения с сетью. Приносим свои извинения, но эти изменения не могут быть сохранены.
 redo=Вернуть
 refresh=Обновить
 regularExpression=Регулярное выражение
-relative=Relative
+relative=Относительный
 relativeUrlNotAllowed=Использование относительных адресов запрещено
 rememberMe=Запомнить меня
 rememberThisSetting=Запомнить эту настройку
@@ -580,7 +580,7 @@ retryingLogin=Время входа истекло. Пробуем еще раз
 reverse=Обратить
 revision=Ревизия
 revisionHistory=История изменений
-rhombus=Rhombus
+rhombus=Ромб
 right=Справа
 rightAlign=По правому краю
 rightToLeft=Справа налево
@@ -603,13 +603,13 @@ search=Поиск
 searchShapes=Поиск фигур
 selectAll=Выбрать все
 selectionOnly=Только выделение
-selectCard=Select Card
+selectCard=Выбрать карточку
 selectEdges=Выбрать края
 selectFile=Выберите файл
 selectFolder=Выберите папку
 selectFont=Выберите шрифт
 selectNone=Сбросить выделение
-selectTemplate=Select Template
+selectTemplate=Выбрать шаблон
 selectVertices=Выбрать вершины
 sendMessage=Отправить
 sendYourFeedbackToDrawIo=Отправьте ваш отзыв на draw.io
@@ -650,7 +650,7 @@ support=Поддержка
 sysml=SysML
 tags=Метки
 table=Таблица
-tables=Tables
+tables=Таблицы
 takeOver=Take Over
 targetSpacing=Отступ от конечного узла
 template=Шаблон