Browse Source

7.0.7 release

Gaudenz Alder 8 years ago
parent
commit
4846ff84db

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+10-AUG-2017: 7.0.7
+
+- Adds anonymize plugin (p=anon)
+
+09-AUG-2017: 7.0.6
+
+- Conf Cloud license changes
+- Fixes for Perimeters
+
 09-AUG-2017: 7.0.5
 
 - Uses mxGraph 3.7.5 beta 7

+ 1 - 1
VERSION

@@ -1 +1 @@
-7.0.5
+7.0.7

+ 1 - 1
war/cache.manifest

@@ -1,7 +1,7 @@
 CACHE MANIFEST
 
 # THIS FILE WAS GENERATED. DO NOT MODIFY!
-# 08/09/2017 10:14 AM
+# 08/10/2017 11:05 AM
 
 app.html
 index.html?offline=1

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


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


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


+ 10 - 8
war/js/diagramly/App.js

@@ -184,7 +184,7 @@ App.pluginRegistry = {'4xAKTrabTpTzahoLthkwPNUn': '/plugins/explore.js',
 	'props': '/plugins/props.js', 'text': '/plugins/text.js',
 	'anim': '/plugins/animation.js', 'update': '/plugins/update.js',
 	'trees': '/plugins/trees/trees.js', 'import': '/plugins/import.js',
-	'replay': '/plugins/replay.js'};
+	'replay': '/plugins/replay.js', 'anon': '/plugins/anonymize.js'};
 
 /**
  * Function: authorize
@@ -996,13 +996,15 @@ App.prototype.init = function()
 	{
 		this.basicAds.push(td.innerHTML);
 		this.adsHtml = this.basicAds;
-		mxUtils.setPrefixedStyle(td.style, 'transition', 'all 1s ease');
 		var lastAd = this.adsHtml.length - 1;
 		var thread2 = null;
 		var thread = null;
 		
-		this.updateAd = function(index)
+		this.updateAd = function(index, delay)
 		{
+			delay = (delay != null) ? delay : 1000;
+			mxUtils.setPrefixedStyle(td.style, 'transition', 'all ' + (delay / 1000) + 's ease');
+
 			if (thread2 != null)
 			{
 				window.clearTimeout(thread2);
@@ -1016,13 +1018,13 @@ App.prototype.init = function()
 			
 			if (this.adsHtml.length == 0)
 			{
-				if (td.parentNode != null)
-				{
-					td.parentNode.removeChild(td);
-				}
+				td.style.visibility = 'hidden';
+				td.innerHTML = '';
 			}
 			else
 			{
+				td.style.visibility = 'visible';
+				
 				if (index == lastAd)
 				{
 					index++;
@@ -1037,7 +1039,7 @@ App.prototype.init = function()
 					mxUtils.setPrefixedStyle(td.style, 'transform', 'scale(1)');
 					td.style.opacity = '1';
 					lastAd = index;
-				}), 1000);
+				}), delay);
 			}
 		};
 		

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

@@ -4991,8 +4991,8 @@
 							'" 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 + '"/>Happy with the Import?</a>');
-						this.updateAd(this.adsHtml.length - 1);
+							Editor.tweetImage + '"/>Paste from Lucidchart?</a>');
+						this.updateAd(this.adsHtml.length - 1, 200);
 						this.lucidchartTweetShown = true;
 					}
 				}

+ 144 - 46
war/js/diagramly/Extensions.js

@@ -24,8 +24,10 @@
 	var styleMap = {
 //Standard
 			'DefaultTextBlockNew': 'text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;',
+			'DefaultTextBlock': 'text;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;',
 			'DefaultSquareBlock': 'rounded=1;arcSize=' + arcSize + ';',
 			'DefaultNoteBlock': 'shape=note;size=15;',
+			'DefaultNoteBlockV2': 'shape=note;size=15;',
 			'HotspotBlock': 'strokeColor=none;opacity=50;',
 			'ImageSearchBlock2': 'shape=image;',
 //Flowchart
@@ -37,6 +39,7 @@
 			'MultiDocumentBlock': s + 'flowchart.multi-document;',
 			'ManualInputBlock': 'shape=manualInput;size=15;rounded=1;arcSize=' + arcSize + ';',
 			'PreparationBlock': 'shape=hexagon;rounded=1;arcSize=' + arcSize + ';',
+			'DataBlock': 'shape=parallelogram;rounded=1;arcSize=' + arcSize + ';',
 			'DataBlockNew': 'shape=parallelogram;rounded=1;arcSize=' + arcSize + ';',
 			'DatabaseBlock': 'shape=cylinder;',
 			'DirectAccessStorageBlock': s + 'flowchart.direct_data;',
@@ -80,6 +83,8 @@
 			'ShapeCircleBlock': 'ellipse;',
 			'ShapePolyStarBlock': s + 'basic.star;',
 			'ShapeDiamondBlock': 'rhombus;rounded=1;arcSize=' + arcSize + ';',
+//Misc
+			'UI2HotspotBlock' : 'shape=rect;opacity=50;strokeColor=none;rounded=1;',
 //Android Devices
 //			'AndroidDevice' EXT
 //Android Dialogs
@@ -130,6 +135,47 @@
 //			'AndroidIconDownload' NA
 //			'AndroidIconError' NA
 //			'AndroidIconWarning' NA
+//iOS mockups
+			'iOSDeviceiPhoneSE': s + 'ios7.misc.iphone;',
+			'iOSDeviceiPhone6s': s + 'ios7.misc.iphone;',
+			'iOSDeviceiPhone6sPlus': s + 'ios7.misc.iphone;',
+			'iOSDeviceiPadPortrait': s + 'ios7.misc.ipad7inch;',
+			'iOSDeviceiPadLandscape': s + 'ios7.misc.ipad7inch;',
+			'iOSDeviceiPadProPortrait': s + 'ios7.misc.ipad7inch;',
+			'iOSDeviceiPadProLandscape': s + 'ios7.misc.ipad10inch;',
+//iOS UI components
+			'iOSButton': 'shape=rect;',
+//			'iOSSegmentedControl' EXT
+			'iOSStepper': s + 'ios7.misc.adjust;',
+			'iOSToggle': s + 'ios7ui.onOffButton;buttonState=on;strokeColor2=#aaaaaa;fillColor2=#ffffff;',
+			'iOSSlider': s + 'ios7ui.slider;barPos=20;strokeColor2=#a0a0a0;',
+			'iOSProgressBar': s + 'ios.iCloudProgressBar;barPos=20;',
+			'iOSPageControls': s + 'ios.iCloudProgressBar;barPos=20;',
+//			'iOSStatusBar' NA
+//			'iOSSearchBar' EXT
+//			'iOSNavBar' EXT
+//			'iOSTabs' EXT
+			'iOSUniversalKeyboard': s + 'ios.iKeybLett;',
+//			'iOSDatePicker' EXT
+//			'iOSTimePicker' EXT
+//			'iOSCountdownPicker' EXT
+//			'iOSBasicCell' EXT
+//			'iOSSubtitleCell' EXT
+//			'iOSRightDetailCell' EXT
+//			'iOSLeftDetailCell' EXT
+//			'iOSTableGroupedSectionBreak' EXT
+//			'iOSTablePlainHeaderFooter' EXT
+//Mind Map
+			'MindMapBlock' : 'shape=rect;rounded=1;',
+			'MindMapStadiumBlock' : 'shape=rect;rounded=1;arcSize=50;',
+			'MindMapCloud' : 'shape=cloud;',
+			'MindMapCircle' : 'shape=ellipse;',
+			'MindMapIsoscelesTriangleBlock' : 'shape=triangle;direction=north;',
+			'MindMapDiamondBlock' : 'shape=rhombus;',
+			'MindMapPentagonBlock' : s + 'basic.pentagon;',
+			'MindMapHexagonBlock' : 'shape=hexagon;',
+			'MindMapOctagonBlock' : s + 'basic.octagon;',
+			'MindMapCrossBlock' : s + 'basic.cross2;dx=20;',
 //Entity Relationship
 //			'ERDEntityBlock' EXT
 //			'ERDEntityBlock2' EXT
@@ -194,7 +240,7 @@
 			'UMLEndBlock' : s + 'bpmn.shape;outline=end;symbol=terminate;',
 			'UMLObjectBlock' : 'shape=rect;rounded=1;',
 			'UMLSendSignalBlock' : s + 'sysml.sendSigAct;',
-			'UMLReceiveSignalBlock' : s + 'sysml.accEvent;',
+			'UMLReceiveSignalBlock' : s + 'sysml.accEvent;flipH=1;',
 			'UMLAcceptTimeEventActionBlock' : s + 'sysml.timeEvent;',
 //			'UMLInterruptingEdgeBlock' NA
 			'UMLOffPageLinkBlock' : s + 'sysml.sendSigAct;direction=south;',
@@ -1074,62 +1120,62 @@
 			'Cisco_cisco_workstation' : s + 'cisco.computers_and_peripherals.workstation;' + c,
 			'Cisco_cisco_www_server' : s + 'cisco.servers.www_server;' + c,
 //Computers and Monitors
-//			'NET_PC' NA
-//			'NET_Virtual-PC' NA
-//			'NET_Terminal' NA
-//			'NET_DataPipe' NA
-//			'NET_SlateDevice' NA
-//			'NET_TabletDevice' NA
-//			'NET_Laptop' NA
-//			'NET_PDA' NA
-//			'NET_CRTMonitor' NA
-//			'NET_LCDMonitor' NA
+			'NET_PC' : s + 'networks.pc;fillColor=#29AAE1;',
+			'NET_Virtual-PC' : s + 'networks.virtual_pc;fillColor=#29AAE1;',
+			'NET_Terminal' : s + 'networks.terminal;fillColor=#29AAE1;',
+			'NET_DataPipe' : s + 'networks.bus;fillColor=#29AAE1;',
+			'NET_SlateDevice' : s + 'networks.tablet;fillColor=#29AAE1;', 
+			'NET_TabletDevice' : s + 'networks.tablet;fillColor=#29AAE1;',
+			'NET_Laptop' : s + 'networks.laptop;fillColor=#29AAE1;',
+			'NET_PDA' : s + 'networks.mobile;fillColor=#29AAE1;',
+			'NET_CRTMonitor' : s + 'networks.monitor;fillColor=#29AAE1;',
+			'NET_LCDMonitor' : s + 'networks.monitor;fillColor=#29AAE1;',
 //Detailed Network Diagrams
 //			'NET_ABSwitch' NA
 //			'NET_Repeater' NA
 //			'NET_DiagnosticDevice' NA
 //			'NET_CardReader' NA
 //			'NET_PatchPanel' NA
-//			'NET_RadioTower' NA
+			'NET_RadioTower' : s + 'networks.radio_tower;fillColor=#29AAE1;',
 //			'NET_BiometricReader' NA
-//			'NET_ExternalHardDrive' NA
+			'NET_ExternalHardDrive' : s + 'networks.external_storage;fillColor=#29AAE1;',
 //			'NET_WebService' NA
 //			'NET_FiberOptic' NA
-//			'NET_SatelliteDish' NA
-//			'NET_Satellite' NA
+			'NET_SatelliteDish' : s + 'networks.satellite_dish;fillColor=#29AAE1;',
+			'NET_Satellite' : s + 'networks.satellite;fillColor=#29AAE1;',
 //			'NET_VoIPPhone' NA
 //			'NET_PBX' NA
 //			'NET_MLPS' NA
 //Basic Network Shapes
-//			'NET_WirelessAccessPoint' NA
-//			'NET_RingNetwork' NA
-//			'NET_Ethernet' NA
-//			'NET_Server' NA
+			'NET_WirelessAccessPoint' : s + 'networks.radio_tower;fillColor=#29AAE1;',
+//			'NET_RingNetwork' EXT
+//			'NET_Ethernet' EXT
+			'NET_Server' : s + 'networks.server;fillColor=#29AAE1;',
 //			'NET_ExternalMediaDrive' NA
-//			'NET_Mainframe' NA
-//			'NET_Router' NA
-//			'NET_Switch' NA
-//			'NET_Firewall' NA
-//			'NET_User' NA
-//			'NET_CommLink' NA
-//			'NET_SuperComputer' NA
-//			'NET_VirtualServer' NA
-//			'NET_Printer' NA
+			'NET_Mainframe' : s + 'networks.mainframe;fillColor=#29AAE1;',
+			'NET_Router' : s + 'networks.wireless_hub;fillColor=#29AAE1;',
+			'NET_Switch' : s + 'networks.switch;fillColor=#29AAE1;',
+			'NET_Firewall' : s + 'networks.firewall;fillColor=#29AAE1;',
+			'NET_User' : s + 'networks.user_male;fillColor=#29AAE1;',
+			'NET_CommLink' : s + 'networks.comm_link_edge;fillColor=#29AAE1;',
+			'NET_SuperComputer' : s + 'networks.supercomputer;fillColor=#29AAE1;',
+			'NET_VirtualServer' : s + 'networks.virtual_server;fillColor=#29AAE1;',
+			'NET_Printer' : s + 'networks.printer;fillColor=#29AAE1;',
 //			'NET_Plotter' NA
-//			'NET_Scanner' NA
-//			'NET_Copier' NA
+			'NET_Scanner' : s + 'networks.scanner;fillColor=#29AAE1;',
+			'NET_Copier' : s + 'networks.copier;fillColor=#29AAE1;',
 //			'NET_FaxMachine' NA
-//			'NET_MultiFunctionMachine' NA
-//			'NET_Projector' NA
-//			'NET_ProjectorScreen' NA
-//			'NET_Bridge' NA
-//			'NET_Hub' NA
-//			'NET_Modem' NA
-//			'NET_Telephone' NA
-//			'NET_CellPhone' NA
-//			'NET_SmartPhone' NA
+			'NET_MultiFunctionMachine' : s + 'networks.copier;fillColor=#29AAE1;',
+			'NET_Projector' : s + 'networks.video_projector;fillColor=#29AAE1;',
+			'NET_ProjectorScreen' : s + 'networks.video_projector_screen;fillColor=#29AAE1;',
+			'NET_Bridge' : s + 'networks.router;fillColor=#29AAE1;',
+			'NET_Hub' : s + 'networks.hub;fillColor=#29AAE1;',
+			'NET_Modem' : s + 'networks.modem;fillColor=#29AAE1;',
+			'NET_Telephone' : s + 'signs.tech.telephone_5;fillColor=#29AAE1;',
+			'NET_CellPhone' : s + 'networks.mobile;fillColor=#29AAE1;',
+			'NET_SmartPhone' : s + 'networks.mobile;fillColor=#29AAE1;',
 //			'NET_VideoPhone' NA
-//			'NET_Camera' NA
+			'NET_Camera' : s + 'signs.tech.camera_2;fillColor=#29AAE1;',
 //			'NET_VideoCamera' NA
 //Server Racks
 			'RackServerRack' : s + 'rackGeneral.container;container=1;collapsible=0;childLayout=rack;marginLeft=9;marginRight=9;marginTop=21;marginBottom=22;textColor=#000000;numDisp=off;',
@@ -1487,7 +1533,7 @@
 //			'fpPianoBench' : 'shape=rect;rounded=1;',
 //Equipment
 			'PEAxialCompressor' : s + 'pid.compressors.centrifugal_compressor_-_turbine_driven;',
-			'PECentrifugalCompressor' : s + 'pid.compressors.centrifugal_compressor',
+			'PECentrifugalCompressor' : s + 'pid.compressors.centrifugal_compressor;',
 			'PECentrifugalCompressor2' : s + 'pid.compressors.centrifugal_compressor_-_turbine_driven;',
 //			'PECentrifugalCompressor3' NA
 			'PEReciprocationCompressor' : s + 'pid.compressors.reciprocating_compressor;',
@@ -1581,7 +1627,7 @@
 //Vessels
 			'PEVesselBlock' : 'shape=rect;', //EXT
 			'PEOpenTankBlock' : s + 'pid.vessels.container,_tank,_cistern;', //EXT
-//			'PEOpenTopTank' NA
+			'PEOpenTopTank' : s + 'pid.vessels.container,_tank,_cistern;',
 			'PEClosedTankBlock' : 'shape=rect;', //EXT
 			'PEStorageSphereBlock' : s + 'pid.vessels.storage_sphere;',
 			'PEColumnBlock' : s + 'pid.vessels.pressurized_vessel;', //EXT
@@ -2040,6 +2086,41 @@
 			if (p != null)
 			{
 				cell.value = convertText(p);
+
+				//adds labels and font size
+				var isV = 0;
+				
+				if (p.Text != null)
+				{
+					if (p.Text.m != null)
+					{
+						var m = p.Text.m;
+						var i = 0;
+						
+						while ((isV == 0) && (i < m.length))
+						{
+							var currM = m[i];
+							
+							if (currM.n == 's')
+							{
+								if (currM.v != null)
+								{
+									isV = 1;
+
+									var fontSize = currM.v;
+									fontSize = fontSize / 2;
+									cell.style += 'fontSize=' + fontSize + ';';
+								}
+							}
+							i++;
+						}
+					}
+				}
+				
+				if (isV == 0)
+				{
+					cell.style += 'fontSize=9;';
+				}
 				
 				// Converts images
 				if (a.Class == 'ImageSearchBlock2')
@@ -2049,10 +2130,26 @@
 				
 				// Adds styles
 				cell.style += createStyle(mxConstants.STYLE_STROKEWIDTH, p.LineWidth, '1');
-				cell.style += createStyle(mxConstants.STYLE_STROKECOLOR, p.LineColor.substring(0, 7), '#000000');
+				
+				//stencils with hardcoded stroke color
+				var hardStroke = ['DefaultTextBlock', 'UI2HotspotBlock'];
+				
+				if (!hardStroke.includes(a.Class))
+				{
+					cell.style += createStyle(mxConstants.STYLE_STROKECOLOR, p.LineColor.substring(0, 7), '#000000');
+				}
+				
 				cell.style += createStyle(mxConstants.STYLE_ALIGN, p.TextAlign, 'center');
 				cell.style += createStyle(mxConstants.STYLE_VERTICAL_ALIGN, p.TextVAlign, 'middle');
-				cell.style += createStyle(mxConstants.STYLE_OPACITY, p.Opacity, '100');
+				
+				//stencils with hardcoded opacity
+				var hardOpacity = ['UI2HotspotBlock'];
+
+				if (!hardOpacity.includes(a.Class))
+				{
+					cell.style += createStyle(mxConstants.STYLE_OPACITY, p.Opacity, '100');
+				}
+
 				
 				// Converts rotation
 				if (p.Rotation != null)
@@ -2064,7 +2161,7 @@
 					// and Lucid uses rotation
 					
 					//stencils to rotate counter clockwise 90 degrees
-					var rccw = ['AEUSBBlock', 'AGSCutandpasteBlock'];
+					var rccw = ['AEUSBBlock', 'AGSCutandpasteBlock', 'iOSDeviceiPadLandscape', 'iOSDeviceiPadProLandscape'];
 					
 					if (a.Class == 'AdvancedSwimLaneBlockRotated')
 					{
@@ -2110,7 +2207,8 @@
 				// Gradients and fill color
 				if (p.FillColor != null)
 				{
-					var exc = ['AWSAndroidBlock3', 'AWSiOSBlock3', 'AWSJavaBlock3', 'AWSJavaScript', 'AWSNetBlock3', 'AWSNodeJSBlock3', 'AWSPHPBlock3', 'AWSPythonBlock3', 'AWSRubyBlock3', 'AWSXamarin', 'AWSCLIBlock3', 'AWSEclipseToolkitBlock3', 'AWSVisualStudioToolkitBlock3', 'AWSWindowsPowershellToolkitBlock3'];
+					//stencils with hardCoded fill color
+					var exc = ['AWSAndroidBlock3', 'AWSiOSBlock3', 'AWSJavaBlock3', 'AWSJavaScript', 'AWSNetBlock3', 'AWSNodeJSBlock3', 'AWSPHPBlock3', 'AWSPythonBlock3', 'AWSRubyBlock3', 'AWSXamarin', 'AWSCLIBlock3', 'AWSEclipseToolkitBlock3', 'AWSVisualStudioToolkitBlock3', 'AWSWindowsPowershellToolkitBlock3', 'DefaultTextBlock'];
 				
 					if (!exc.includes(a.Class))
 					{

+ 7 - 3
war/js/diagramly/Menus.js

@@ -1104,8 +1104,7 @@
 			}
 		});
 
-		// Adds plugins menu item in file menu only if localStorage is available for
-		// storing the plugins.
+		// Adds plugins menu item only if localStorage is available for storing the plugins
 		if (isLocalStorage || mxClient.IS_CHROMEAPP)
 		{
 			var action = editorUi.actions.addAction('scratchpad', function()
@@ -2410,7 +2409,12 @@
 
 			if (!editorUi.isOfflineApp() && urlParams['embed'] != '1')
 			{
-				this.addMenuItems(menu, ['plugins'], parent);
+				var item = this.addMenuItem(menu, 'plugins', parent);
+				
+				if (!editorUi.isOffline() || mxClient.IS_CHROMEAPP)
+				{
+					this.addLinkToItem(item, 'https://desk.draw.io/support/solutions/articles/16000056430');
+				}
 			}
 				
 			menu.addSeparator(parent);

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


File diff suppressed because it is too large
+ 102 - 93
war/js/extensions.min.js


+ 106 - 60
war/js/mxgraph/Shapes.js

@@ -1321,6 +1321,62 @@
 	
 	mxStyleRegistry.putValue('backbonePerimeter', mxPerimeter.BackbonePerimeter);
 	
+	mxPerimeter.lineIntersection = function (line1Start, line1End, line2Start, line2End)
+	{
+	  // if the lines intersect, the result contains the the
+	  // intersection point if both line segment 1 and line segment 2 contain the point
+	  // null otherwise
+	  var denominator = ((line2End.y - line2Start.y) * (line1End.x - line1Start.x)) 
+	  						- ((line2End.x - line2Start.x) * (line1End.y - line1Start.y));
+	  
+	  if (denominator == 0) //parallel?
+	  {
+	    return null;
+	  }
+	  else
+	  {
+	    var a = line1Start.y - line2Start.y;
+	    var b = line1Start.x - line2Start.x;
+	    var numerator1 = ((line2End.x - line2Start.x) * a) - ((line2End.y - line2Start.y) * b);
+	    var numerator2 = ((line1End.x - line1Start.x) * a) - ((line1End.y - line1Start.y) * b);
+	    a = numerator1 / denominator;
+	    b = numerator2 / denominator;
+
+	    // if we cast these lines infinitely in both directions, they intersect here:
+	    var x = line1Start.x + (a * (line1End.x - line1Start.x));
+	    var y = line1Start.y + (a * (line1End.y - line1Start.y));
+
+	    if (a > 0 && a <= 1)// on line1?
+	    	{
+		  	  var dx = line2End.x - x;
+			  var dy = line2End.y - y;
+			  var d = Math.sqrt(dy * dy + dx * dx); //distance from end of line 2 (next) to intersection point
+		      return {dist: d, p: new mxPoint(x, y)};
+	    	}
+	    else
+	    {
+	      return null;
+	    }
+	  }
+	};
+
+	mxPerimeter.getPerimeterPoint = function (points, center, point)
+	{
+		var min = false;
+		
+		for (var i = 0; i < points.length - 1; i++)
+		{
+			var ip = mxPerimeter.lineIntersection(points[i], points[i + 1], center, point);
+			
+			if (ip != null && (!min || min.dist > ip.dist))
+			{
+				min = ip;
+			}
+		}
+		
+		return min.p;
+	};
+
 	//Parallelogram Perimeter
 	mxPerimeter.ParallelogramPerimeter = function (bounds, vertex, next, orthogonal)
 	{
@@ -1333,22 +1389,18 @@
 		
 		var dx = bounds.width * Math.max(0, Math.min(1, size));
 		
-		if (next.y == bounds.y)
-		{
-			return new mxPoint(bounds.x + dx + (next.x - bounds.x) / bounds.width * (bounds.width - dx), next.y);
-		}
-		else if (next.y == bounds.y + bounds.height)
-		{
-			return new mxPoint(bounds.x + (next.x - bounds.x) / bounds.width * (bounds.width - dx), next.y);
-		}
-		else if (next.x == bounds.x)
-		{
-			return new mxPoint(bounds.x + dx * (1 - (next.y - bounds.y) / bounds.height), next.y);
-		}
-		else
-		{
-			return new mxPoint(bounds.x + dx * (1 - (next.y - bounds.y) / bounds.height) + (bounds.width - dx), next.y);
-		}
+		var x = bounds.x;
+		var y = bounds.y;
+		var w = bounds.width;
+		var h = bounds.height;
+
+		var points = [new mxPoint(x + dx, y), new mxPoint(x + w, y),
+						new mxPoint(x + w - dx, y + h), new mxPoint(x, y + h), new mxPoint(x + dx, y)];
+
+		var cx = bounds.getCenterX();
+		var cy = bounds.getCenterY();
+		
+		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
 	};
 	
 	mxStyleRegistry.putValue('parallelogramPerimeter', mxPerimeter.ParallelogramPerimeter);
@@ -1366,22 +1418,18 @@
 		
 		var dx = bounds.width * Math.max(0, Math.min(1, size));
 		
-		if (next.y == bounds.y)
-		{
-			return new mxPoint(bounds.x + dx + (next.x - bounds.x) / bounds.width * (bounds.width - 2 * dx), next.y);
-		}
-		else if (next.x == bounds.x)
-		{
-			return new mxPoint(bounds.x + dx * (1 - (next.y - bounds.y) / bounds.height), next.y);
-		}
-		else if (next.x == bounds.x + bounds.width)
-		{
-			return new mxPoint(bounds.x + bounds.width - dx * (1 - (next.y - bounds.y) / bounds.height), next.y);
-		}
-		else
-		{
-			return next;
-		}
+		var x = bounds.x;
+		var y = bounds.y;
+		var w = bounds.width;
+		var h = bounds.height;
+
+		var points = [new mxPoint(x + dx, y), new mxPoint(x + w - dx, y),
+						new mxPoint(x + w, y + h), new mxPoint(x, y + h), new mxPoint(x + dx, y)];
+
+		var cx = bounds.getCenterX();
+		var cy = bounds.getCenterY();
+		
+		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
 	};
 	
 	mxStyleRegistry.putValue('trapezoidPerimeter', mxPerimeter.TrapezoidPerimeter);
@@ -1398,20 +1446,19 @@
 		
 		var dx = bounds.width * Math.max(0, Math.min(1, size));
 		
-		if (next.x == bounds.x)
-		{
-			return next.y < bounds.getCenterY() ? new mxPoint(bounds.x + 2 * dx * (next.y - bounds.y) / bounds.height, next.y)
-										: new mxPoint(bounds.x + 2 * dx * (1 - (next.y - bounds.y) / bounds.height), next.y);
-		}
-		else if (next.x == bounds.x + bounds.width)
-		{
-			return next.y < bounds.getCenterY() ? new mxPoint(bounds.x + 2 * dx * (next.y - bounds.y) / bounds.height + (bounds.width - dx), next.y)
-											: new mxPoint(bounds.x + 2 * dx * (1 - (next.y - bounds.y) / bounds.height) + (bounds.width - dx), next.y);
-		}
-		else
-		{
-			return new mxPoint(bounds.x + (next.x - bounds.x) / bounds.width * (bounds.width - dx), next.y);
-		}
+		var x = bounds.x;
+		var y = bounds.y;
+		var w = bounds.width;
+		var h = bounds.height;
+
+		var cx = bounds.getCenterX();
+		var cy = bounds.getCenterY();
+		
+		var points = [new mxPoint(x, y), new mxPoint(x + w - dx, y), new mxPoint(x + w, cy),
+						new mxPoint(x + w - dx, y + h), new mxPoint(x, y + h),
+						new mxPoint(x + dx, cy), new mxPoint(x, y)];
+		
+		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
 	};
 	
 	mxStyleRegistry.putValue('stepPerimeter', mxPerimeter.StepPerimeter);
@@ -1428,20 +1475,19 @@
 		
 		var dx = bounds.width * Math.max(0, Math.min(1, size));
 		
-		if (next.x == bounds.x)
-		{
-			return next.y < bounds.getCenterY() ? new mxPoint(bounds.x + dx * (1 - 2 * (next.y - bounds.y) / bounds.height), next.y)
-										: new mxPoint(bounds.x + dx * (2 * (next.y - bounds.y) / bounds.height - 1), next.y);
-		}
-		else if (next.x == bounds.x + bounds.width)
-		{
-			return next.y < bounds.getCenterY() ? new mxPoint(bounds.x + 2 * dx * (next.y - bounds.y) / bounds.height + (bounds.width - dx), next.y)
-											: new mxPoint(bounds.x + 2 * dx * (1 - (next.y - bounds.y) / bounds.height) + (bounds.width - dx), next.y);
-		}
-		else
-		{
-			return new mxPoint(bounds.x + dx + (next.x - bounds.x) / bounds.width * (bounds.width - 2 * dx), next.y);
-		}
+		var x = bounds.x;
+		var y = bounds.y;
+		var w = bounds.width;
+		var h = bounds.height;
+
+		var cx = bounds.getCenterX();
+		var cy = bounds.getCenterY();
+		
+		var points = [new mxPoint(x + dx, y), new mxPoint(x + w - dx, y), new mxPoint(x + w, cy),
+						new mxPoint(x + w - dx, y + h), new mxPoint(x + dx, y + h),
+						new mxPoint(x, cy), new mxPoint(x + dx, y)];
+		
+		return mxPerimeter.getPerimeterPoint(points, new mxPoint(cx, cy), next);
 	};
 	
 	mxStyleRegistry.putValue('hexagonPerimeter2', mxPerimeter.HexagonPerimeter2);

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

@@ -3093,7 +3093,7 @@ Sidebar.prototype.itemClicked = function(cells, ds, evt, elt)
 		var pt = graph.getFreeInsertPoint();
 		ds.drop(graph, evt, null, pt.x, pt.y);
 		
-		if (this.editorUi.hoverIcons != null && mxEvent.isTouchEvent(evt))
+		if (this.editorUi.hoverIcons != null && (mxEvent.isTouchEvent(evt) || mxEvent.isPenEvent(evt)))
 		{
 			this.editorUi.hoverIcons.update(graph.view.getState(graph.getSelectionCell()));
 		}

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


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


+ 121 - 0
war/plugins/anonymize.js

@@ -0,0 +1,121 @@
+/**
+ * Explore plugin.
+ */
+Draw.loadPlugin(function(editorUi)
+{
+	var div = document.createElement('div');
+	var keep = '\n\t`~!@#$%^&*()_+{}|:"<>?-=[]\;\'.\/,\n\t';
+	
+	// Adds resource for action
+	mxResources.parse('anonymizeCurrentPage=Anonymize Current Page');
+	
+	function anonymizeString(text)
+	{
+		var result = [];
+		
+		for (var i = 0; i < text.length; i++)
+		{
+			var c = text.charAt(i);
+			
+			if (keep.indexOf(c) >= 0)
+			{
+				result.push(c);
+			}
+			else if (!isNaN(parseInt(c)))
+			{
+				result.push(Math.round(Math.random() * 9));
+			}
+			else if (c.toLowerCase() != c)
+			{
+				result.push(String.fromCharCode(65 + Math.round(Math.random() * 25)));
+			}
+			else if (c.toUpperCase() != c)
+			{
+				result.push(String.fromCharCode(97 + Math.round(Math.random() * 25)));
+			}
+			else if (/\s/.test(c))
+			{
+				/* any whitespace */
+				result.push(' ');
+			}
+			else
+			{
+				result.push('�');
+			}
+		}
+		
+		return result.join('');
+	};
+	
+	function replaceTextContent(elt)
+	{
+		if (elt.nodeValue != null)
+		{
+			elt.nodeValue = anonymizeString(elt.nodeValue);
+		}
+		
+		if (elt.nodeType == mxConstants.NODETYPE_ELEMENT)
+		{
+			var tmp = elt.firstChild;
+			
+			while (tmp != null)
+			{
+				replaceTextContent(tmp);
+				tmp = tmp.nextSibling;
+			}
+		}
+	};
+
+	
+	function anonymizeHtml(html)
+	{
+		div.innerHTML = html;
+		
+		replaceTextContent(div);
+		
+		return div.innerHTML;
+	};
+
+	// Adds action
+	editorUi.actions.addAction('anonymizeCurrentPage', function()
+	{
+		var graph = editorUi.editor.graph;
+		var model = graph.model;
+		
+		model.beginUpdate();
+		try
+		{
+			for (var id in model.cells)
+			{
+				var cell = model.cells[id];
+				var label = graph.getLabel(cell);
+				
+				if (graph.isHtmlLabel(cell))
+				{
+					label = anonymizeHtml(label);
+				}
+				else
+				{
+					label = anonymizeString(label);
+				}
+				
+				model.setValue(cell, label);
+			}
+		}
+		finally
+		{
+			model.endUpdate();
+		}
+	});
+	
+	var menu = editorUi.menus.get('extras');
+	var oldFunct = menu.funct;
+	
+	menu.funct = function(menu, parent)
+	{
+		oldFunct.apply(this, arguments);
+		
+		editorUi.menus.addMenuItems(menu, ['-', 'anonymizeCurrentPage'], parent);
+	};
+
+});