diff --git a/ChangeLog b/ChangeLog index 7cd4df2c..805ed721 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +24-MAY-2017: 6.6.4 + +- Fixes possible data loss for back button +- Enables OneDrive support on iOS + +22-MAY-2017: 6.6.3 + +- vsdx export improvements + 19-MAY-2017: 6.6.2 - Adds trees plugin diff --git a/VERSION b/VERSION index 3eae4431..a08b5f1e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.6.2 \ No newline at end of file +6.6.4 \ No newline at end of file diff --git a/src/com/mxgraph/online/OpenServlet.java b/src/com/mxgraph/online/OpenServlet.java index b958bdc0..94dbb0ef 100644 --- a/src/com/mxgraph/online/OpenServlet.java +++ b/src/com/mxgraph/online/OpenServlet.java @@ -24,6 +24,7 @@ import org.apache.commons.fileupload.FileItemIterator; import org.apache.commons.fileupload.FileItemStream; import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.fileupload.util.Streams; +import org.apache.commons.lang3.StringEscapeUtils; import com.mxgraph.io.mxCodec; import com.mxgraph.io.mxGraphMlCodec; @@ -128,10 +129,10 @@ public class OpenServlet extends HttpServlet filename = item.getName(); vsdx = filename.toLowerCase().endsWith(".vsdx"); vssx = filename.toLowerCase().endsWith(".vssx"); - + if (vsdx || vssx) { - upfile = Streams.asString(stream, "ISO-8859-1"); + upfile = Streams.asString(stream, "ISO-8859-1"); } else { @@ -152,11 +153,11 @@ public class OpenServlet extends HttpServlet } String xml = null; - + if (filename.toLowerCase().endsWith(".png")) { - xml = extractXmlFromPng(upfile - .getBytes(Utils.CHARSET_FOR_URL_ENCODING)); + xml = extractXmlFromPng( + upfile.getBytes(Utils.CHARSET_FOR_URL_ENCODING)); } else if (ENABLE_GRAPHML_SUPPORT && upfile.matches(graphMlRegex)) { @@ -165,12 +166,14 @@ public class OpenServlet extends HttpServlet mxGraph graph = new mxGraphHeadless(); mxGraphMlCodec.decode(mxXmlUtils.parseXml(upfile), graph); - xml = mxXmlUtils.getXml(new mxCodec().encode(graph.getModel())); + xml = mxXmlUtils + .getXml(new mxCodec().encode(graph.getModel())); } else if (ENABLE_VSDX_SUPPORT && vsdx) { mxVsdxCodec vdxCodec = new mxVsdxCodec(); - xml = vdxCodec.decodeVsdx(upfile.getBytes("ISO-8859-1"), Utils.CHARSET_FOR_URL_ENCODING); + xml = vdxCodec.decodeVsdx(upfile.getBytes("ISO-8859-1"), + Utils.CHARSET_FOR_URL_ENCODING); // Replaces VSDX extension int dot = filename.lastIndexOf('.'); @@ -179,7 +182,8 @@ public class OpenServlet extends HttpServlet else if (ENABLE_VSSX_SUPPORT && vssx) { mxVssxCodec vssxCodec = new mxVssxCodec(); - xml = vssxCodec.decodeVssx(upfile.getBytes("ISO-8859-1"), Utils.CHARSET_FOR_URL_ENCODING); + xml = vssxCodec.decodeVssx(upfile.getBytes("ISO-8859-1"), + Utils.CHARSET_FOR_URL_ENCODING); // Replaces VSDX extension int dot = filename.lastIndexOf('.'); @@ -210,10 +214,12 @@ public class OpenServlet extends HttpServlet { // Workaround for replacement char and null byte in IE9 request xml = xml.replaceAll("[\\uFFFD\\u0000]*", ""); - writeScript(writer, "try{window.parent.setCurrentXml(decodeURIComponent('" - + Utils.encodeURIComponent(xml, Utils.CHARSET_FOR_URL_ENCODING) - + "'), decodeURIComponent('" + Utils.encodeURIComponent(filename, Utils.CHARSET_FOR_URL_ENCODING) - + "'));}catch(e){window.parent.showOpenAlert({message:window.parent.mxResources.get('notAUtf8File')});}"); + writeScript(writer, + "try{window.parent.setCurrentXml(decodeURIComponent('" + + encodeString(xml) + + "'), decodeURIComponent('" + + encodeString(filename) + + "'));}catch(e){window.parent.showOpenAlert({message:window.parent.mxResources.get('notAUtf8File')});}"); } } else @@ -223,9 +229,9 @@ public class OpenServlet extends HttpServlet } else { - response.setStatus(HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE); - writeScript( - writer, + response.setStatus( + HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE); + writeScript(writer, "window.parent.showOpenAlert(window.parent.mxResources.get('drawingTooLarge'));"); } } @@ -233,8 +239,7 @@ public class OpenServlet extends HttpServlet { e.printStackTrace(); response.setStatus(HttpServletResponse.SC_NOT_FOUND); - writeScript( - writer, + writeScript(writer, "window.parent.showOpenAlert(window.parent.mxResources.get('invalidOrMissingFile'));"); } @@ -242,6 +247,15 @@ public class OpenServlet extends HttpServlet writer.close(); } + /** + * URI encodes the given string for JavaScript. + */ + protected String encodeString(String s) + { + return StringEscapeUtils.escapeEcmaScript( + Utils.encodeURIComponent(s, Utils.CHARSET_FOR_URL_ENCODING)); + }; + /** * Writes the given string as a script in a HTML page to the given print writer. */ @@ -259,8 +273,8 @@ public class OpenServlet extends HttpServlet // NOTE: Key length must not be longer than 79 bytes (not checked) protected String extractXmlFromPng(byte[] data) { - Map textChunks = decodeCompressedText(new ByteArrayInputStream( - data)); + Map textChunks = decodeCompressedText( + new ByteArrayInputStream(data)); return (textChunks != null) ? textChunks.get("mxGraphModel") : null; } diff --git a/war/cache.manifest b/war/cache.manifest index 44b6b6e1..9f2d5818 100644 --- a/war/cache.manifest +++ b/war/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 05/19/2017 03:49 PM +# 05/24/2017 04:23 PM app.html index.html?offline=1 diff --git a/war/js/app.min.js b/war/js/app.min.js index e2d8ef8a..bd9bf10d 100644 --- a/war/js/app.min.js +++ b/war/js/app.min.js @@ -3037,7 +3037,7 @@ Toolbar.prototype.addClickHandler=function(a,c){null!=c&&(mxEvent.addListener(a, Toolbar.prototype.createLabel=function(a,c){var f=document.createElement("a");f.setAttribute("href","javascript:void(0);");f.className="geLabel";mxUtils.write(f,a);return f}; Toolbar.prototype.addMenuHandler=function(a,c,f,d){if(null!=f){var b=this.editorUi.editor.graph,e=null,g=!0;mxEvent.addListener(a,"click",mxUtils.bind(this,function(k){if(g&&(null==a.enabled||a.enabled)){b.popupMenuHandler.hideMenu();e=new mxPopupMenu(f);e.div.className+=" geToolbarMenu";e.showDisabled=d;e.labels=c;e.autoExpand=!0;var l=mxUtils.getOffset(a);e.popup(l.x,l.y+a.offsetHeight,null,k);this.editorUi.setCurrentMenu(e,a);!c&&e.div.scrollHeight>e.div.clientHeight&&(e.div.style.width="40px"); e.addListener(mxEvent.EVENT_HIDE,mxUtils.bind(this,function(){this.currentElt=null}))}g=!0;mxEvent.consume(k)}));mxEvent.addListener(a,"mousedown",mxUtils.bind(this,function(b){g=this.currentElt!=a;null!=document.documentMode&&9<=document.documentMode&&b.preventDefault()}))}};Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null)}; -function Dialog(a,c,f,d,b,e,g){var k=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(k=80);f+=k;d+=k;var l=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),m=Math.max(0,Math.round((document.body.scrollWidth-f)/2)),n=Math.max(0,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(c.style.maxHeight="100%");f=Math.min(f,document.body.scrollWidth-64);d=Math.min(d,l-64);0document.documentMode)&&(k=80);f+=k;d+=k;var l=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),m=Math.max(1,Math.round((document.body.scrollWidth-f-64)/2)),n=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(c.style.maxHeight="100%");f=Math.min(f,document.body.scrollWidth-64);d=Math.min(d,l-64);0%position%
Email\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node width. Possible value are px or auto. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value are px or auto. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -26\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between parallel edges. Default is 40.\n#\n# edgespacing: 40\n#\n## Name of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n'; -Editor.configure=function(a){ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& +Editor.configure=function(a){Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& (Editor.prototype.editBlankUrl+="&dev=1",Editor.prototype.editBlankFallbackUrl+="&dev=1");var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle= +[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle= "shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6; EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= null!=c&&6
')))}catch(n){}try{a=document.createElement("canvas");a.width=a.height=1;var c=a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(n){}})(); @@ -8078,18 +8078,18 @@ App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugin App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),f=0;fnavigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient= -null):window.OneDriveClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")),"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient= +null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")),"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0a.indexOf("DocumentClosedError")){c=a;var d=new Image,g=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";d.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+g+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+ encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(e)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=k&&null!=k.stack?"&stack="+encodeURIComponent(k.stack):"")}}catch(n){}};"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var f=document.createElement("iframe");f.setAttribute("width","0");f.setAttribute("height", "0");f.setAttribute("src","offline.html");document.body.appendChild(f);mxStencilRegistry.stencilSet={};mxStencilRegistry.getStencil=function(a){return mxStencilRegistry.stencils[a]};mxStencilRegistry.loadStencilSet=function(a,b,c){a=a.substring(a.indexOf("/")+1);a="mxgraph."+a.substring(0,a.length-4).replace(/\//g,".");a=mxStencilRegistry.stencilSet[a];null!=a&&mxStencilRegistry.parseStencilSet(a,b,!1)};for(f=mxUtils.load("stencils.xml").getXml().documentElement.firstChild;null!=f;)"shapes"==f.nodeName&& null!=f.getAttribute("name")&&(mxStencilRegistry.stencilSet[f.getAttribute("name").toLowerCase()]=f,mxStencilRegistry.parseStencilSet(f)),f=f.nextSibling}"0"==urlParams.picker||mxClient.IS_QUIRKS||8==document.documentMode||mxscript(document.location.protocol+"//www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22picker%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22"+mxClient.language+"%22%7D%5D%7D");"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&& "0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback"):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;f=mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage);mxUtils.getAll("1"!=urlParams.dev? [f]:[f,STYLE_PATH+"/default.xml"],function(c){mxResources.parse(c[0].getText());1navigator.userAgent.indexOf("MSIE")|| -10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML= -'Error loading page. Please try refreshing.'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh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GMDBEQkQ0RTgwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrM/fs0AAADgSURBVHjaYmDAA/7//88MwgzkAKDGFiD+BsQ/QWxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg=="; +function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL, +window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML='Error loading page. Please try refreshing.'})}; +mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAA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GVuZD0iciI/PsCtve8AAAAMUExURQAAANnZ2b+/v////5bgre4AAAAEdFJOU////wBAKqn0AAAALUlEQVR42mJgRgMMRAkwQEXBNAOcBSPhclB1cNVwfcxI+vEZykSpoSR6DiDAAF23ApT99bZ+AAAAAElFTkSuQmCC":IMAGE_PATH+ @@ -8149,7 +8149,7 @@ this.getServiceCount(!0);var c=4>=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(t this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),f)}))}else(null==window.location.hash||1>=window.location.hash.length)&& null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash="G"+this.stateArg.ids[0]),(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(b){this.handleError(b)}}; App.prototype.showSplash=function(a){var c=this.getServiceCount(!1),f=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>c?180:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=a)}))});if(this.editor.chromeless)this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this, -function(){this.showSplash()}));else if(null==this.mode||a){a=4>=c?4:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(d.container,100*a,c>a?420:300,!0,!1);d.init()}else null==urlParams.create&&f()}; +function(){this.showSplash()}));else if(null==this.mode||a){a=4>=c?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(d.container,100*a,c>a?420:300,!0,!1);d.init()}else null==urlParams.create&&f()}; App.prototype.addLanguageMenu=function(a){var c=null;this.isOfflineApp()&&!mxClient.IS_CHROMEAPP||null==this.menus.get("language")||(c=document.createElement("div"),c.setAttribute("title",mxResources.get("language")),c.className="geIcon geSprite geSprite-globe",c.style.position="absolute",c.style.cursor="pointer",c.style.bottom="20px",c.style.right="20px",mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(this.menus.get("language").funct); d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxUtils.getOffset(c);d.popup(b.x,b.y+c.offsetHeight,null,a);this.setCurrentMenu(d)})),a.appendChild(c));return c}; App.prototype.defineCustomObjects=function(){null!=gapi.drive.realtime&&null!=gapi.drive.realtime.custom&&(gapi.drive.realtime.custom.registerType(mxRtCell,"Cell"),mxRtCell.prototype.cellId=gapi.drive.realtime.custom.collaborativeField("cellId"),mxRtCell.prototype.type=gapi.drive.realtime.custom.collaborativeField("type"),mxRtCell.prototype.value=gapi.drive.realtime.custom.collaborativeField("value"),mxRtCell.prototype.xmlValue=gapi.drive.realtime.custom.collaborativeField("xmlValue"),mxRtCell.prototype.style= @@ -8167,9 +8167,9 @@ k,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.l function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),l,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,k,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),l,b):d==App.MODE_BROWSER?(b=mxUtils.bind(this,function(){var b=new StorageLibrary(this,k,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),l)}), null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(b||this.spinner.spin(document.body,mxResources.get("saving"))){f.setData(k);var m=mxUtils.bind(this,function(){f.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(f,c);null!=g&&g()}),l)});if(a!=f.getTitle()){var n=f.getHash();f.rename(a,mxUtils.bind(this,function(a){f.constructor!= LocalLibrary&&n!=f.getHash()&&(mxSettings.removeCustomLibrary(n),mxSettings.addCustomLibrary(f.getHash()));this.removeLibrarySidebar(n);m()}),l)}else m()}}; -App.prototype.saveFile=function(a){var c=this.getCurrentFile();if(null!=c){var f=mxUtils.bind(this,function(){this.removeDraft();c.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==c.getTitle()||null==this.mode){var d=null!=c.getTitle()?c.getTitle():this.defaultFilename,b=!mxClient.IS_IOS||!navigator.standalone,e=this.mode;a=this.getServiceCount(!0);var g=4>=a?4:3,d=new CreateDialog(this,d,mxUtils.bind(this, -function(a,b){null!=a&&0a.indexOf("."),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)), -null,b,f,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,f))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,b,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,g);this.showDialog(d.container,460,a>g?390:270,!0,!0);d.init()}else this.save(c.getTitle(),f)}}; +App.prototype.saveFile=function(a){var c=this.getCurrentFile();if(null!=c){var f=mxUtils.bind(this,function(){this.removeDraft();c.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==c.getTitle()||null==this.mode){var d=null!=c.getTitle()?c.getTitle():this.defaultFilename,b=!mxClient.IS_IOS||!navigator.standalone,e=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var g=4>=a?2:3,d=new CreateDialog(this, +d,mxUtils.bind(this,function(a,b){null!=a&&0a.indexOf("."),/(\.svg)$/i.test(a), +/(\.html)$/i.test(a)),null,b,f,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,f))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,b,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,g);this.showDialog(d.container,460,a>g?390:270,!0,!0);d.init()}else this.save(c.getTitle(),f)}}; EditorUi.prototype.loadTemplate=function(a,c,f){var d=a;this.isCorsEnabledForUrl(d)||(d=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(d,mxUtils.bind(this,function(b){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"k&&0k&&0%position%
Email\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node width. Possible value are px or auto. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value are px or auto. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -26\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between parallel edges. Default is 40.\n#\n# edgespacing: 40\n#\n## Name of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n'; -Editor.configure=function(a){ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& +Editor.configure=function(a){Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& (Editor.prototype.editBlankUrl+="&dev=1",Editor.prototype.editBlankFallbackUrl+="&dev=1");var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0=b&&q.y+q.height<=l&&q.y>=a&&q.x+q.width<=k&&f.push(p);this.getAllCells(b,a,d,e,p,f)}}}return f};var C=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(b,a,d){return this.graph.isCellSelected(b)? !1:C.apply(this,arguments)};this.isCellLocked=function(b){for(b=this.view.getState(b);null!=b;){if("1"==mxUtils.getValue(b.style,"locked","0"))return!0;b=this.view.getState(this.model.getParent(b.cell))}return!1};var E=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(b,a){if("mouseDown"==a.getProperty("eventName")){var d=a.getProperty("event").getState();E=null==d||this.isSelectionEmpty()||this.isCellSelected(d.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD, -mxUtils.bind(this,function(b,a){if(!mxEvent.isMultiTouchEvent(a)){var d=a.getProperty("event"),c=a.getProperty("cell");null==c?(d=mxUtils.convertPoint(this.container,mxEvent.getClientX(d),mxEvent.getClientY(d)),p.start(d.x,d.y)):null!=E?this.addSelectionCells(E):1e.div.clientHeight&&(e.div.style.width="40px"); e.addListener(mxEvent.EVENT_HIDE,mxUtils.bind(this,function(){this.currentElt=null}))}g=!0;mxEvent.consume(k)}));mxEvent.addListener(a,"mousedown",mxUtils.bind(this,function(b){g=this.currentElt!=a;null!=document.documentMode&&9<=document.documentMode&&b.preventDefault()}))}};Toolbar.prototype.destroy=function(){null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null)}; -function Dialog(a,c,f,d,b,e,g){var k=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(k=80);f+=k;d+=k;var l=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),m=Math.max(0,Math.round((document.body.scrollWidth-f)/2)),n=Math.max(0,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(c.style.maxHeight="100%");f=Math.min(f,document.body.scrollWidth-64);d=Math.min(d,l-64);0document.documentMode)&&(k=80);f+=k;d+=k;var l=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),m=Math.max(1,Math.round((document.body.scrollWidth-f-64)/2)),n=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(c.style.maxHeight="100%");f=Math.min(f,document.body.scrollWidth-64);d=Math.min(d,l-64);0%position%
Email\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node width. Possible value are px or auto. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value are px or auto. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -26\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between parallel edges. Default is 40.\n#\n# edgespacing: 40\n#\n## Name of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n'; -Editor.configure=function(a){ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& +Editor.configure=function(a){Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||StyleFormatPanel.prototype.defaultColorSchemes};Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;"1"==urlParams.dev&& (Editor.prototype.editBlankUrl+="&dev=1",Editor.prototype.editBlankFallbackUrl+="&dev=1");var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(b){b=null!=b&&"mxlibrary"!=b.nodeName?this.extractGraphModel(b):null;if(null!=b){var c=b.getElementsByTagName("parsererror");if(null!=c&&0';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle= +(function(){EditorUi.VERSION="6.6.4";EditorUi.compactUi="atlas"!=uiTheme;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.prototype.emptyDiagramXml='';EditorUi.prototype.emptyLibraryXml="[]";EditorUi.prototype.mode=null;EditorUi.prototype.sidebarFooterHeight=36;EditorUi.prototype.defaultCustomShapeStyle= "shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6; EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.enableLogging=/.*\.draw\.io$/.test(window.location.hostname);EditorUi.prototype.printPdfExport=!1;EditorUi.prototype.pdfPageExport=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas"),b=new Image;b.onload=function(){try{a.getContext("2d").drawImage(b,0,0);var c=a.toDataURL("image/png");EditorUi.prototype.useCanvasForExport= null!=c&&6
')))}catch(n){}try{a=document.createElement("canvas");a.width=a.height=1;var c=a.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==c.match("image/jpeg")}catch(n){}})(); @@ -7806,18 +7806,18 @@ App.pluginRegistry={"4xAKTrabTpTzahoLthkwPNUn":"/plugins/explore.js",ex:"/plugin App.getStoredMode=function(){var a=null;null==a&&isLocalStorage&&(a=localStorage.getItem(".mode"));if(null==a&&"undefined"!=typeof Storage){for(var c=document.cookie.split(";"),f=0;fnavigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient= -null):window.OneDriveClient=null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")),"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?App.mode==App.MODE_ONEDRIVE||null!=window.location.hash&&"#W"==window.location.hash.substring(0,2)?mxscript(App.ONEDRIVE_URL):"0"==urlParams.chrome&&(window.OneDriveClient=null):window.OneDriveClient= +null)),"undefined"==typeof JSON&&mxscript("js/json/json2.min.js")),"0"!=urlParams.plugins&&"1"!=urlParams.offline)){var a=mxSettings.getPlugins(),c=urlParams.p;if(null!=c||null!=a&&0a.indexOf("DocumentClosedError")){c=a;var d=new Image,g=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";d.src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?severity="+g+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+ encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(e)+(null!=f?":colno:"+encodeURIComponent(f):"")+(null!=k&&null!=k.stack?"&stack="+encodeURIComponent(k.stack):"")}}catch(n){}};"atlas"==uiTheme&&mxClient.link("stylesheet","styles/atlas.css");if(null!=window.mxscript){"0"!=urlParams.chrome&&mxscript("js/jscolor/jscolor.js");if("1"==urlParams.offline){mxscript("js/shapes.min.js");var f=document.createElement("iframe");f.setAttribute("width","0");f.setAttribute("height", "0");f.setAttribute("src","offline.html");document.body.appendChild(f);mxStencilRegistry.stencilSet={};mxStencilRegistry.getStencil=function(a){return mxStencilRegistry.stencils[a]};mxStencilRegistry.loadStencilSet=function(a,b,c){a=a.substring(a.indexOf("/")+1);a="mxgraph."+a.substring(0,a.length-4).replace(/\//g,".");a=mxStencilRegistry.stencilSet[a];null!=a&&mxStencilRegistry.parseStencilSet(a,b,!1)};for(f=mxUtils.load("stencils.xml").getXml().documentElement.firstChild;null!=f;)"shapes"==f.nodeName&& null!=f.getAttribute("name")&&(mxStencilRegistry.stencilSet[f.getAttribute("name").toLowerCase()]=f,mxStencilRegistry.parseStencilSet(f)),f=f.nextSibling}"0"==urlParams.picker||mxClient.IS_QUIRKS||8==document.documentMode||mxscript(document.location.protocol+"//www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22picker%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22"+mxClient.language+"%22%7D%5D%7D");"function"===typeof window.DriveClient&&"undefined"===typeof gapi&&("1"!=urlParams.embed&& "0"!=urlParams.gapi||"1"==urlParams.embed&&"1"==urlParams.gapi)&&isSvgBrowser&&isLocalStorage&&(null==document.documentMode||10<=document.documentMode)?mxscript("https://apis.google.com/js/api.js?onload=DrawGapiClientCallback"):"undefined"===typeof window.gapi&&(window.DriveClient=null)}"0"!=urlParams.math&&Editor.initMath();mxResources.loadDefaultBundle=!1;f=mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage);mxUtils.getAll("1"!=urlParams.dev? [f]:[f,STYLE_PATH+"/default.xml"],function(c){mxResources.parse(c[0].getText());1navigator.userAgent.indexOf("MSIE")|| -10<=document.documentMode)?mxscript(App.ONEDRIVE_URL,window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML= -'Error loading page. Please try refreshing.'})};mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIH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WxSNaf9RwN37twpI8WAS+gGfP78+RpQSoRYA36iG/D379+vQClNdLVMOMz4gi7w79+/n0CKg1gD9qELvH379hzIHGK9oA508ieY8//8+fO5rq4uFCilRKwL1JmYmNhhHEZGRiZ+fn6Q2meEbDYG4u3/cYCfP38uA7kOm0ZOIJ7zn0jw48ePPiDFhmzArv8kgi9fvuwB+w5qwH9ykjswbFSZyM4sEMDPBDTlL5BxkFSd7969OwZ2BZKYGhDzkmjOJ4AAAwBhpRqGnEFb8QAAAABJRU5ErkJggg=="; +function(){mxscript(App.DROPINS_URL,function(){DrawDropboxClientCallback()},"dropboxjs",App.DROPBOX_APPKEY)});else if("undefined"===typeof window.Dropbox||"undefined"===typeof window.Dropbox.choose)window.DropboxClient=null;"function"===typeof window.OneDriveClient&&"undefined"===typeof OneDrive&&null!=window.DrawOneDriveClientCallback&&("1"!=urlParams.embed&&"0"!=urlParams.od||"1"==urlParams.embed&&"1"==urlParams.od)&&(0>navigator.userAgent.indexOf("MSIE")||10<=document.documentMode)?mxscript(App.ONEDRIVE_URL, +window.DrawOneDriveClientCallback):"undefined"===typeof window.OneDrive&&(window.OneDriveClient=null)}null!=a&&a(c);"0"!=urlParams.chrome&&"1"==urlParams.test&&(mxLog.show(),mxLog.debug("Started in "+((new Date).getTime()-t0.getTime())+"ms"),mxLog.debug("Export:",EXPORT_URL),mxLog.debug("Development mode:","1"==urlParams.dev?"active":"inactive"),mxLog.debug("Test mode:","1"==urlParams.test?"active":"inactive"))},function(){document.getElementById("geStatus").innerHTML='Error loading page. Please try refreshing.'})}; +mxUtils.extend(App,EditorUi);App.prototype.defaultUserPicture="https://lh3.googleusercontent.com/-HIzvXUy6QUY/AAAAAAAAAAI/AAAAAAAAAAA/giuR7PQyjEk/photo.jpg?sz=30";App.prototype.shareImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAA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C":IMAGE_PATH+ @@ -7877,7 +7877,7 @@ this.getServiceCount(!0);var c=4>=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(t this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(b){this.handleError(b,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),f)}))}else(null==window.location.hash||1>=window.location.hash.length)&& null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash="G"+this.stateArg.ids[0]),(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(b){this.handleError(b)}}; App.prototype.showSplash=function(a){var c=this.getServiceCount(!1),f=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>c?180:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=a)}))});if(this.editor.chromeless)this.handleError({message:mxResources.get("noFileSelected")},mxResources.get("errorLoadingFile"),mxUtils.bind(this, -function(){this.showSplash()}));else if(null==this.mode||a){a=4>=c?4:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(d.container,100*a,c>a?420:300,!0,!1);d.init()}else null==urlParams.create&&f()}; +function(){this.showSplash()}));else if(null==this.mode||a){a=4>=c?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();f()}),a);this.showDialog(d.container,100*a,c>a?420:300,!0,!1);d.init()}else null==urlParams.create&&f()}; App.prototype.addLanguageMenu=function(a){var c=null;this.isOfflineApp()&&!mxClient.IS_CHROMEAPP||null==this.menus.get("language")||(c=document.createElement("div"),c.setAttribute("title",mxResources.get("language")),c.className="geIcon geSprite geSprite-globe",c.style.position="absolute",c.style.cursor="pointer",c.style.bottom="20px",c.style.right="20px",mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var d=new mxPopupMenu(this.menus.get("language").funct); d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);d.destroy()});var b=mxUtils.getOffset(c);d.popup(b.x,b.y+c.offsetHeight,null,a);this.setCurrentMenu(d)})),a.appendChild(c));return c}; App.prototype.defineCustomObjects=function(){null!=gapi.drive.realtime&&null!=gapi.drive.realtime.custom&&(gapi.drive.realtime.custom.registerType(mxRtCell,"Cell"),mxRtCell.prototype.cellId=gapi.drive.realtime.custom.collaborativeField("cellId"),mxRtCell.prototype.type=gapi.drive.realtime.custom.collaborativeField("type"),mxRtCell.prototype.value=gapi.drive.realtime.custom.collaborativeField("value"),mxRtCell.prototype.xmlValue=gapi.drive.realtime.custom.collaborativeField("xmlValue"),mxRtCell.prototype.style= @@ -7895,9 +7895,9 @@ k,b,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.l function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),l,b):d==App.MODE_ONEDRIVE&&null!=this.oneDrive&&this.spinner.spin(document.body,mxResources.get("inserting"))?this.oneDrive.insertLibrary(a,k,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);this.libraryLoaded(a,c)}),l,b):d==App.MODE_BROWSER?(b=mxUtils.bind(this,function(){var b=new StorageLibrary(this,k,a);b.saveFile(a,!1,mxUtils.bind(this,function(){this.hideDialog(!0);this.libraryLoaded(b,c)}),l)}), null==localStorage.getItem(a)?b():this.confirm(mxResources.get("replaceIt",[a]),b)):this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}));else if(b||this.spinner.spin(document.body,mxResources.get("saving"))){f.setData(k);var m=mxUtils.bind(this,function(){f.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hideDialog(!0);e||this.libraryLoaded(f,c);null!=g&&g()}),l)});if(a!=f.getTitle()){var n=f.getHash();f.rename(a,mxUtils.bind(this,function(a){f.constructor!= LocalLibrary&&n!=f.getHash()&&(mxSettings.removeCustomLibrary(n),mxSettings.addCustomLibrary(f.getHash()));this.removeLibrarySidebar(n);m()}),l)}else m()}}; -App.prototype.saveFile=function(a){var c=this.getCurrentFile();if(null!=c){var f=mxUtils.bind(this,function(){this.removeDraft();c.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==c.getTitle()||null==this.mode){var d=null!=c.getTitle()?c.getTitle():this.defaultFilename,b=!mxClient.IS_IOS||!navigator.standalone,e=this.mode;a=this.getServiceCount(!0);var g=4>=a?4:3,d=new CreateDialog(this,d,mxUtils.bind(this, -function(a,b){null!=a&&0a.indexOf("."),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)), -null,b,f,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,f))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,b,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,g);this.showDialog(d.container,460,a>g?390:270,!0,!0);d.init()}else this.save(c.getTitle(),f)}}; +App.prototype.saveFile=function(a){var c=this.getCurrentFile();if(null!=c){var f=mxUtils.bind(this,function(){this.removeDraft();c.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus("")});if(a||null==c.getTitle()||null==this.mode){var d=null!=c.getTitle()?c.getTitle():this.defaultFilename,b=!mxClient.IS_IOS||!navigator.standalone,e=this.mode;a=this.getServiceCount(!0);isLocalStorage&&a++;var g=4>=a?2:3,d=new CreateDialog(this, +d,mxUtils.bind(this,function(a,b){null!=a&&0a.indexOf("."),/(\.svg)$/i.test(a), +/(\.html)$/i.test(a)),null,b,f,null==this.mode,c)}),b!==App.MODE_GITHUB):null!=b&&this.save(a,f))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,b,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,g);this.showDialog(d.container,460,a>g?390:270,!0,!0);d.init()}else this.save(c.getTitle(),f)}}; EditorUi.prototype.loadTemplate=function(a,c,f){var d=a;this.isCorsEnabledForUrl(d)||(d=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(d,mxUtils.bind(this,function(b){!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(b,a)?this.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"k&&0k&&0= 10)) + if (urlParams['od'] != '0' && (navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 10)) { // Immediately loads client if (App.mode == App.MODE_ONEDRIVE || (window.location.hash != null && @@ -627,8 +626,7 @@ App.main = function(callback) if (typeof window.OneDriveClient === 'function' && (typeof OneDrive === 'undefined' && window.DrawOneDriveClientCallback != null && (((urlParams['embed'] != '1' && urlParams['od'] != '0') || (urlParams['embed'] == '1' && - urlParams['od'] == '1')) && !/(iPad|iPhone|iPod)/.test(navigator.userAgent) && - (navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 10)))) + urlParams['od'] == '1')) && (navigator.userAgent.indexOf('MSIE') < 0 || document.documentMode >= 10)))) { mxscript(App.ONEDRIVE_URL, window.DrawOneDriveClientCallback); } @@ -2413,7 +2411,7 @@ App.prototype.showSplash = function(force) } else if (this.mode == null || force) { - var rowLimit = (serviceCount <= 4) ? 4 : 3; + var rowLimit = (serviceCount <= 4) ? 2 : 3; var dlg = new StorageDialog(this, mxUtils.bind(this, function() { @@ -2921,9 +2919,14 @@ App.prototype.saveFile = function(forceDialog) var filename = (file.getTitle() != null) ? file.getTitle() : this.defaultFilename; var allowTab = !mxClient.IS_IOS || !navigator.standalone; var prev = this.mode; - var serviceCount = this.getServiceCount(true); - var rowLimit = (serviceCount <= 4) ? 4 : 3; + + if (isLocalStorage) + { + serviceCount++; + } + + var rowLimit = (serviceCount <= 4) ? 2 : 3; var dlg = new CreateDialog(this, filename, mxUtils.bind(this, function(name, mode) { @@ -3376,7 +3379,12 @@ App.prototype.loadFile = function(id, sameWindow, file) var fn2 = mxUtils.bind(this, function() { - if (this.spinner.spin(document.body, mxResources.get('loading'))) + if (id == null || id.length == 0) + { + this.editor.setStatus(''); + this.fileLoaded(null); + } + else if (this.spinner.spin(document.body, mxResources.get('loading'))) { // Handles files from localStorage if (id.charAt(0) == 'L') @@ -3597,15 +3605,19 @@ App.prototype.loadFile = function(id, sameWindow, file) } else { - this.confirm(mxResources.get('allChangesLost'), null, fn2, - mxResources.get('cancel'), mxResources.get('discardChanges')); + this.confirm(mxResources.get('allChangesLost'), mxUtils.bind(this, function() + { + if (currentFile != null) + { + window.location.hash = currentFile.getHash(); + } + }), fn2, mxResources.get('cancel'), mxResources.get('discardChanges')); } }); if (id == null || id.length == 0) { - this.editor.setStatus(''); - this.fileLoaded(null); + fn(); } else if (currentFile != null && currentFile.isModified() && !sameWindow) { diff --git a/war/js/diagramly/Editor.js b/war/js/diagramly/Editor.js index 1fb4d7e5..b4d3627d 100644 --- a/war/js/diagramly/Editor.js +++ b/war/js/diagramly/Editor.js @@ -114,44 +114,16 @@ 'Tessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n'; /** - * Global configuration of the Editor. Possible configuration values are: - * - * - presetColors: array of color codes for upper palette, default is ColorDialog.prototype.presetColors (no leading #) - * - defaultColors: array of color codes for the lower palette, default is ColorDialog.prototype.defaultColors (no leading #) - * - defaultFonts: array of available font family names, default is Menus.prototype.defaultFonts - * - defaultColorSchemes: array of array of available color schemes, default is StyleFormatPanel.prototype.defaultColorSchemes - * - * (code) - * Editor.configure({defaultFonts: ['Helvetica', 'Verdana', 'Times New Roman', 'Garamond', - * 'Comic Sans MS', 'Courier New', 'Georgia', 'Lucida Console', 'Tahoma'], - * presetColors: ['E6D0DE', 'CDA2BE', 'B5739D', 'E1D5E7', 'C3ABD0', 'A680B8', 'D4E1F5', - * 'A9C4EB', '7EA6E0', 'D5E8D4', '9AC7BF', '67AB9F', 'D5E8D4', 'B9E0A5', '97D077', 'FFF2CC', - * 'FFE599', 'FFD966', 'FFF4C3', 'FFCE9F', 'FFB570', 'F8CECC', 'F19C99', 'EA6B66'], - * defaultColorSchemes: [[null, {fill: '#f5f5f5', stroke: '#666666'}, - * {fill: '#dae8fc', stroke: '#6c8ebf'}, {fill: '#d5e8d4', stroke: '#82b366'}, - * {fill: '#ffe6cc', stroke: '#d79b00'}, {fill: '#fff2cc', stroke: '#d6b656'}, - * {fill: '#f8cecc', stroke: '#b85450'}, {fill: '#e1d5e7', stroke: '#9673a6'}], - * [null, - * {fill: '#f5f5f5', stroke: '#666666', gradient: '#b3b3b3'}, - * {fill: '#dae8fc', stroke: '#6c8ebf', gradient: '#7ea6e0'}, - * {fill: '#d5e8d4', stroke: '#82b366', gradient: '#97d077'}, - * {fill: '#ffcd28', stroke: '#d79b00', gradient: '#ffa500'}, - * {fill: '#fff2cc', stroke: '#d6b656', gradient: '#ffd966'}, - * {fill: '#f8cecc', stroke: '#b85450', gradient: '#ea6b66'}, - * {fill: '#e6d0de', stroke: '#996185', gradient: '#d5739d'}], - * [null, {fill: '#eeeeee', stroke: '#36393d'}, - * {fill: '#f9f7ed', stroke: '#36393d'}, {fill: '#ffcc99', stroke: '#36393d'}, - * {fill: '#cce5ff', stroke: '#36393d'}, {fill: '#ffff88', stroke: '#36393d'}, - * {fill: '#cdeb8b', stroke: '#36393d'}, {fill: '#ffcccc', stroke: '#36393d'}]]}); - * (end) + * Global configuration of the Editor + * see https://desk.draw.io/solution/articles/16000058316 */ Editor.configure = function(config) { // LATER: DefaultFont and DefaultFontSize should override Graph's stylesheet, // default edge and vertex styles would have to be set before loading mxSettings + Menus.prototype.defaultFonts = config.defaultFonts || Menus.prototype.defaultFonts; ColorDialog.prototype.presetColors = config.presetColors || ColorDialog.prototype.presetColors; ColorDialog.prototype.defaultColors = config.defaultColors || ColorDialog.prototype.defaultColors; - Menus.prototype.defaultFonts = config.defaultFonts || Menus.prototype.defaultFonts; StyleFormatPanel.prototype.defaultColorSchemes = config.defaultColorSchemes || StyleFormatPanel.prototype.defaultColorSchemes; }; diff --git a/war/js/diagramly/vsdx/VsdxExport.js b/war/js/diagramly/vsdx/VsdxExport.js index c55bf0db..00604a97 100644 --- a/war/js/diagramly/vsdx/VsdxExport.js +++ b/war/js/diagramly/vsdx/VsdxExport.js @@ -7,6 +7,7 @@ function VsdxExport(editorUi, resDir) resDir = resDir || "js/diagramly/vsdx/resources" + var vsdxCanvas = new mxVsdxCanvas2D(); /** * Fill the required files in vsdx format which are constants in our exporter * @param zip JSZip of vsdx file @@ -39,11 +40,11 @@ function VsdxExport(editorUi, resDir) } } - var p1Id = that.VISIO_PAGES_RELS + "page1.xml.rels"; + //var p1Id = that.VISIO_PAGES_RELS + "page1.xml.rels"; for (var i = 2; i <= pageCount; i++) { - var fId = that.VISIO_PAGES_RELS + "page" + i + ".xml.rels"; - zip.file(fId, files[p1Id]); + //var fId = that.VISIO_PAGES_RELS + "page" + i + ".xml.rels"; + //zip.file(fId, files[p1Id]); var newPage = page1.cloneNode(); newPage.setAttribute(that.PART_NAME, "/visio/pages/page" + i + ".xml"); @@ -62,63 +63,6 @@ function VsdxExport(editorUi, resDir) }); }; - function getModelExtAttributes(modelNode) - { - var attr = {}; - - try - { - var grid = modelNode.getAttribute("grid"); - attr['gridEnabled'] = grid? "1" == grid : true; - - var gridSize = modelNode.getAttribute("gridSize"); - attr['gridSize'] = gridSize? parseFloat(gridSize) : 10; - - var guides = modelNode.getAttribute("guides"); - attr['guidesEnabled'] = guides? "1" == guides : true; - - var page = modelNode.getAttribute("page"); - attr['pageVisible'] = page? "1" == page : true; - - var pageScale = modelNode.getAttribute("pageScale"); - attr['pageScale'] = pageScale? parseFloat(pageScale): 1; - - var pageWidth = modelNode.getAttribute("pageWidth"); - attr['pageWidth'] = pageWidth? parseFloat(pageWidth) : 839; - - var pageHeight = modelNode.getAttribute("pageHeight"); - attr['pageHeight'] = pageHeight? parseFloat(pageHeight) : 1188; - - var background = modelNode.getAttribute("background"); - attr['backgroundClr'] = background? background : '#FFFFFF'; - - var math = modelNode.getAttribute("math"); - attr['mathEnabled'] = math? "1" == math : true; - - var shadow = modelNode.getAttribute("shadow"); - attr['shadowVisible'] = shadow? "1" == shadow : false; - - //these most probably not needed in vsdx - var tooltips = modelNode.getAttribute("tooltips"); - attr['tooltips'] = tooltips? "1" == tooltips : true; - - var connect = modelNode.getAttribute("connect"); - attr['connect'] = connect? "1" == connect : true; - - var arrows = modelNode.getAttribute("arrows"); - attr['arrows'] = arrows? "1" == arrows : true; - - var fold = modelNode.getAttribute("fold"); - attr['foldingEnabled'] = fold? "1" == fold : true; - } - catch(e) - { - //nothing - } - return attr; - }; - - function getGraphAttributes(graph) { var attr = {}; @@ -166,50 +110,242 @@ function VsdxExport(editorUi, resDir) return row; }; - function createGeoElem(cell, xmlDoc) + function applyMxCellStyle(state, shape, xmlDoc) { - var geoSec = xmlDoc.createElement("Section"); + var fillClr = state.style[mxConstants.STYLE_FILLCOLOR]; - geoSec.setAttribute("N", "Geometry"); - geoSec.setAttribute("IX", "0"); + if (!fillClr || fillClr == "none") + { + shape.appendChild(createCellElem("FillPattern", 0, xmlDoc)); + } + else + { + shape.appendChild(createCellElem("FillForegnd", fillClr, xmlDoc)); + var gradClr = state.style[mxConstants.STYLE_GRADIENTCOLOR]; + + if (gradClr && gradClr != "none") + { + shape.appendChild(createCellElem("FillBkgnd", gradClr, xmlDoc)); + + var gradDir = state.style[mxConstants.STYLE_GRADIENT_DIRECTION]; + var dir = 28; + + if (gradDir) + { + switch(gradDir) + { + case mxConstants.DIRECTION_EAST: + dir = 25; + break + case mxConstants.DIRECTION_WEST: + dir = 27; + break + case mxConstants.DIRECTION_NORTH: + dir = 30; + break + } + } + shape.appendChild(createCellElem("FillPattern", dir, xmlDoc)); + } + } + + var strokeClr = state.style[mxConstants.STYLE_STROKECOLOR]; - //now just create a rectangle - geoSec.appendChild(createRow("MoveTo", "1", 0, 0, xmlDoc)); - geoSec.appendChild(createRow("RelLineTo", "2", 1, 0, xmlDoc)); - geoSec.appendChild(createRow("RelLineTo", "3", 1, 1, xmlDoc)); - geoSec.appendChild(createRow("RelLineTo", "4", 0, 1, xmlDoc)); - geoSec.appendChild(createRow("RelLineTo", "5", 0, 0, xmlDoc)); + if (!strokeClr || strokeClr == "none") + shape.appendChild(createCellElem("LinePattern", 0, xmlDoc)); + else + shape.appendChild(createCellElem("LineColor", strokeClr, xmlDoc)); + + var strokeW = state.style[mxConstants.STYLE_STROKEWIDTH]; + if (strokeW) shape.appendChild(createCellElemScaled("LineWeight", strokeW, xmlDoc)); - return geoSec; + + var opacity = state.style[mxConstants.STYLE_OPACITY]; + var fillOpaq; + var strkOpaq; + + if (opacity) + { + fillOpaq = opacity; + strkOpaq = opacity; + } + else + { + fillOpaq = state.style[mxConstants.STYLE_FILL_OPACITY]; + strkOpaq = state.style[mxConstants.STYLE_STROKE_OPACITY]; + } + + if (fillOpaq) shape.appendChild(createCellElem("FillForegndTrans", 1 - parseInt(fillOpaq)/100.0, xmlDoc)); + if (strkOpaq) shape.appendChild(createCellElem("LineColorTrans", 1 - parseInt(strkOpaq)/100.0, xmlDoc)); + + var isDashed = state.style[mxConstants.STYLE_DASHED]; + + if (isDashed == 1) + { + var dashPatrn = state.style[mxConstants.STYLE_DASH_PATTERN]; + var pattern = 9 + + if (dashPatrn) + { + //We only support the patterns of draw.io UI + switch(dashPatrn) + { + case "1 1": + pattern = 10; + break; + case "1 2": + pattern = 3; + break; + case "1 4": + pattern = 17; + break; + } + } + + shape.appendChild(createCellElem("LinePattern", pattern, xmlDoc)); + } + + var hasShadow = state.style[mxConstants.STYLE_SHADOW]; + + if (hasShadow == 1) + { + shape.appendChild(createCellElem("ShdwPattern", 1, xmlDoc)); + shape.appendChild(createCellElem("ShdwForegnd", '#000000', xmlDoc)); + shape.appendChild(createCellElem("ShdwForegndTrans", 0.6, xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwType", 1, xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwOffsetX", '0.02946278254943948', xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwOffsetY", '-0.02946278254943948', xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwScaleFactor", '1', xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwBlur", '0.05555555555555555', xmlDoc)); + shape.appendChild(createCellElem("ShapeShdwShow", 2, xmlDoc)); + } + + //Probably we don't need margins as the canvas get the modified position? + /* + var topMargin = state.style[mxConstants.STYLE_SPACING_TOP]; + if (topMargin) shape.appendChild(createCellElemScaled("TopMargin", parseFloat(topMargin) * 2 + 2.8 , xmlDoc)); + +/* //Defines label bottom spacing + double bottomMargin = getBottomSpacing() * 100/100; + + if (bottomMargin != 0) + { + styleMap.put(mxConstants.STYLE_SPACING_BOTTOM, Double.toString(bottomMargin)); + } + + //Defines label left spacing + double leftMargin = getLeftSpacing() * 100/100; + + if (leftMargin != 0) + { + styleMap.put(mxConstants.STYLE_SPACING_LEFT, Double.toString(leftMargin)); + } + + //Defines label right spacing + double rightMargin = getRightSpacing() * 100/100; + + if(rightMargin !=0) + { + styleMap.put(mxConstants.STYLE_SPACING_RIGHT, Double.toString(rightMargin)); + }*/ + + //Direction is not clear that we need it + /* + var direction = state.style[mxConstants.STYLE_DIRECTION]; + + if (direction != mxConstants.DIRECTION_EAST) + { + styleMap.put(mxConstants.STYLE_DIRECTION, direction); + } + */ + + var flibX = state.style[mxConstants.STYLE_FLIPH]; + if (flibX == 1) shape.appendChild(createCellElem("FlipX", 1, xmlDoc)); + + var flibY = state.style[mxConstants.STYLE_FLIPV]; + if (flibY == 1) shape.appendChild(createCellElem("FlipY", 1, xmlDoc)); + + var rounded = state.style[mxConstants.STYLE_ROUNDED]; + if (rounded == 1) shape.appendChild(createCellElemScaled("Rounding", state.cell.geometry.width*0.1, xmlDoc)); + + //TODO for some reason, visio doesn't show the label (text) background color! + var lbkgnd = state.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]; + if (lbkgnd) shape.appendChild(createCellElem("TextBkgnd", lbkgnd, xmlDoc)); }; - function convertMxCell2Shape(cell, graph, xmlDoc, parentHeight) + function createShape(id, geo, xmlDoc, parentHeight) + { + var shape = xmlDoc.createElement("Shape"); + + shape.setAttribute("ID", id); + shape.setAttribute("NameU", "Shape" + id); + shape.setAttribute("LineStyle", "0"); + shape.setAttribute("FillStyle", "0"); + shape.setAttribute("TextStyle", "0"); + + var hw = geo.width/2, hh = geo.height/2; + + shape.appendChild(createCellElemScaled("PinX", geo.x + hw, xmlDoc)); + shape.appendChild(createCellElemScaled("PinY", parentHeight - geo.y - hh, xmlDoc)); + shape.appendChild(createCellElemScaled("Width", geo.width, xmlDoc)); + shape.appendChild(createCellElemScaled("Height", geo.height, xmlDoc)); + shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc)); + shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc)); + + return shape; + }; + + function convertMxCell2Shape(cell, graph, xmlDoc, parentHeight, parentGeo) { - /*var state = graph.view.getState(cell); - var shape = graph.cellRenderer.createShape(state); - if (shape.checkBounds()) - shape.paint(new mxVsdxCanvas2D(xmlDoc)); - */ var geo = cell.geometry; if (geo != null) { - var shape = xmlDoc.createElement("Shape"); + if (geo.relative && parentGeo) + { + geo = geo.clone(); + geo.x *= parentGeo.width; + geo.y *= parentGeo.height; + geo.relative = 0; + } + + var shape = createShape(cell.id, geo, xmlDoc, parentHeight); - shape.setAttribute("ID", cell.id); - shape.setAttribute("NameU", "NotYet"); - shape.setAttribute("Type", "Shape"); + var state = graph.view.getState(cell); + + applyMxCellStyle(state, shape, xmlDoc); - var hw = geo.width/2, hh = geo.height/2; - - shape.appendChild(createCellElemScaled("PinX", geo.x + hw, xmlDoc)); - shape.appendChild(createCellElemScaled("PinY", parentHeight - geo.y - hh, xmlDoc)); - shape.appendChild(createCellElemScaled("Width", geo.width, xmlDoc)); - shape.appendChild(createCellElemScaled("Height", geo.height, xmlDoc)); - shape.appendChild(createCellElemScaled("LocPinX", hw, xmlDoc)); - shape.appendChild(createCellElemScaled("LocPinY", hh, xmlDoc)); - - shape.appendChild(createGeoElem(cell, xmlDoc)); + vsdxCanvas.newShape(shape, geo, xmlDoc); + + if (state.text != null && state.text.checkBounds()) + { + vsdxCanvas.save(); + + if (parentGeo) + { + vsdxCanvas.translate(-parentGeo.x, -parentGeo.y); + } + + state.text.paint(vsdxCanvas); + vsdxCanvas.restore(); + } + if (state.shape != null && state.shape.checkBounds()) + { + vsdxCanvas.save(); + + if (parentGeo) + { + vsdxCanvas.translate(-parentGeo.x, -parentGeo.y); + } + + state.shape.paint(vsdxCanvas); + vsdxCanvas.restore(); + } + + shape.appendChild(vsdxCanvas.getShapeGeo()); + + vsdxCanvas.endShape(); + shape.setAttribute("Type", vsdxCanvas.getShapeType()); return shape; } @@ -218,7 +354,7 @@ function VsdxExport(editorUi, resDir) }; - function convertMxModel2Page(graph, name, modelAttrib) + function convertMxModel2Page(graph, modelAttrib) { var xmlDoc = mxUtils.createXmlDocument(); @@ -231,12 +367,14 @@ function VsdxExport(editorUi, resDir) root.appendChild(shapes); var model = graph.model; -// var graph = new Graph(null, model); - -// var vsdxCanvas = new mxVsdxCanvas2D(); -// var imgExport = new mxImageExport(); -// imgExport.drawState(graph.getView().getState(graph.model.root), vsdxCanvas); + var t = graph.view.translate; + var s = graph.view.scale; + + vsdxCanvas.translate(-t.x, -t.y); + vsdxCanvas.scale(1 / s); + vsdxCanvas.newPage(); + var defParent = graph.getDefaultParent(); for (var id in model.cells) @@ -245,7 +383,35 @@ function VsdxExport(editorUi, resDir) //top-most cells if (c.parent == defParent) { - var shape = convertMxCell2Shape(c, graph, xmlDoc, modelAttrib.pageHeight); + var shape; + if (c.getChildCount() > 0) //Group + { + var geo = c.geometry; + shape = createShape(c.id+"10000", geo, xmlDoc, modelAttrib.pageHeight); + shape.setAttribute("Type", "Group"); + + var gShapes = xmlDoc.createElement("Shapes"); + + var newGeo = geo.clone(); + newGeo.x = 0; + newGeo.y = 0; + c.setGeometry(newGeo); + var subShape = convertMxCell2Shape(c, graph, xmlDoc, geo.height, geo); + c.setGeometry(geo); + gShapes.appendChild(subShape); + + for (var i = 0; i < c.children.length; i++) + { + var subShape = convertMxCell2Shape(c.children[i], graph, xmlDoc, geo.height, geo); + gShapes.appendChild(subShape); + } + + shape.appendChild(gShapes); + } + else + { + shape = convertMxCell2Shape(c, graph, xmlDoc, modelAttrib.pageHeight); + } if (shape != null) shapes.appendChild(shape); @@ -253,6 +419,7 @@ function VsdxExport(editorUi, resDir) } xmlDoc.appendChild(root); + return xmlDoc; }; @@ -320,6 +487,33 @@ function VsdxExport(editorUi, resDir) writeXmlDoc2Zip(zip, that.VISIO_PAGES + "_rels/pages.xml.rels", pagesRelsXmlDoc); } + function addImagesRels(zip, pIndex) + { + //create a new page rels file + var fId = that.VISIO_PAGES_RELS + "page" + pIndex + ".xml.rels"; + var pageRelDoc = mxUtils.createXmlDocument(); + + var relationships = pageRelDoc.createElement("Relationships"); + relationships.setAttribute("xmlns", that.RELS_XMLNS); + + var imgs = vsdxCanvas.images; + + //create rels of image files + if (imgs.length > 0) + { + for (var i = 0; i < imgs.length; i++) + { + var relationship = pageRelDoc.createElement("Relationship"); + relationship.setAttribute("Type", that.XMLNS_R + "/image"); + relationship.setAttribute("Id", "rId" + (i+1)); + relationship.setAttribute("Target", "../media/" + imgs[i]); + + relationships.appendChild(relationship); + } + } + pageRelDoc.appendChild(relationships); + writeXmlDoc2Zip(zip, fId, pageRelDoc); + }; /** * * Convert current Editor UI pages into a vdsx file @@ -331,6 +525,8 @@ function VsdxExport(editorUi, resDir) { var zip = new JSZip(); + vsdxCanvas.init(zip); + pages = {}; modelsAttr = {}; @@ -347,7 +543,8 @@ function VsdxExport(editorUi, resDir) var diagramName = page.getName(); var graph = editorUi.editor.graph; var modelAttrib = getGraphAttributes(graph); - pages[diagramName] = convertMxModel2Page(graph, diagramName, modelAttrib); + pages[diagramName] = convertMxModel2Page(graph, modelAttrib); + addImagesRels(zip, i+1); modelsAttr[diagramName] = modelAttrib; } editorUi.selectPage(currentPage); @@ -356,87 +553,37 @@ function VsdxExport(editorUi, resDir) { var graph = editorUi.editor.graph; var modelAttrib = getGraphAttributes(graph); - pages[diagramName] = convertMxModel2Page(graph, "Page1", modelAttrib); + var diagramName = "Page1"; + pages[diagramName] = convertMxModel2Page(graph, modelAttrib); + addImagesRels(zip, 1); modelsAttr[diagramName] = modelAttrib; } createVsdxSkeleton(zip, pagesCount, function() { addPagesXML(zip, pages, modelsAttr); - zip.generateAsync({type:"blob"}) - .then(function(content) { - var file = editorUi.getCurrentFile(); - - var filename = (file != null && file.getTitle() != null) ? file.getTitle() : editorUi.defaultFilename; - editorUi.saveData(filename+".vsdx", 'vsdx', content, 'application/vnd.visio2013'); - }); - }); - return true; - } - catch(e) - { - console.log(e); - return false; - } - - }; - - /** - * - * Convert mxFile into a vdsx file - * @param mxFileXML mxFile xml string - * @return true if successful, false otherwise (stream should be discarded and closed) - */ - function exportMxFile(mxFileXML) - { - try - { - var zip = new JSZip(); - - pages = {}; - modelsAttr = {}; - - var doc = mxUtils.parseXml(mxFileXML); - var diagrams = doc.documentElement.children; - var codec = new mxCodec(); - var pagesCount = 0; - - for (var i=0; i < diagrams.length; i++) - { - var diagram = diagrams[i]; - - if (diagram.nodeName == "diagram") + //wait until all media files are loaded + var createZipFile = function() { - var diagramName = diagram.getAttribute("name"); - var diagramB64 = diagram.firstChild.textContent; - var deflated = (window.atob) ? atob(diagramB64) : Base64.decode(diagramB64, true); - var uriEncoded = Graph.prototype.bytesToString(pako.inflateRaw(deflated)); - var xml = decodeURIComponent(uriEncoded); - - var modelNode = mxUtils.parseXml(xml).documentElement; - var modelAttrib = getModelExtAttributes(modelNode); - - var dec = new mxCodec(modelNode.ownerDocument); - - var graph = new Graph(); - var model = graph.getModel(); - dec.decode(modelNode, model); - -// var model = codec.decode(modelNode); - pages[diagramName] = convertMxModel2Page(graph, diagramName, modelAttrib); - modelsAttr[diagramName] = modelAttrib; - pagesCount++; - } - } - - createVsdxSkeleton(zip, pagesCount, function() { - addPagesXML(zip, pages, modelsAttr); + if (vsdxCanvas.filesLoading > 0) + { + setTimeout(createZipFile, vsdxCanvas.filesLoading * 200); + } + else + { + zip.generateAsync({type:"blob"}).then( + function(content) + { + var file = editorUi.getCurrentFile(); + + var filename = (file != null && file.getTitle() != null) ? file.getTitle() : editorUi.defaultFilename; + editorUi.saveData(filename+".vsdx", 'vsdx', content, 'application/vnd.visio2013'); + } + ); + } + }; - //just for testing -// zip.generateAsync({type:"base64"}).then(function (base64) -// { -// location.href="data:application/zip;base64," + base64; -// }); + createZipFile(); }); return true; } @@ -445,13 +592,8 @@ function VsdxExport(editorUi, resDir) console.log(e); return false; } - } - - //test - //var mxFileXml = "7VnJcqMwEP0a7ixeyNF44swhU5UaH+YsgwyqCEQJEdv5+mlhsQhMDEk8SU3hC+ap1UL9npqWMJx1fHzgKI1+sQBTwzaDo+H8MGzbsswFXCRyOiNz9+4MhJwEyqgGtuQVK9BUaE4CnGmGgjEqSKqDPksS7AsNQ5yzg262Z1QfNUUh7gBbH9Eu+ocEIqrmZdYNPzEJIzW0O1cNO+Q/h5zliRrPsJ198Ts3x6j0peyzCAXs0ICce8NcGfK/aThrzpjQoLIhPq4xlTEvw3n2txlmXE2P40S8o7997v+CaI7Le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1hePkyQB7GHg/A6yt2QQszTlrFB4CbF06SJkRe7VsBckMCb5BtF/4K+xfRVYAt/615QTU5brW6mxegDm4JUTwgvjUwHokVu6yE9mqGPNCDtguNMlllcI/mygML1cHyeojQp6xnKFmcLZSr58pqCGNE+gDGpRHSlXF+o1Asn6vLqsqjdt7hfWzBCqNJnlyYVHhQ5ODzLR/DwEzQofp1563GfmTvYpU0jJnf6EYYhcnufc3rroaFxk+MmLcY9yEPr3l+st/8Wpun2cF+yOZpSpzT+J7g1W3phvQUuLlZChTN0tVaYsfZkY758UbKQfXSHx8fZSf85qPcxdL1K+gJ/xc="; - //exportMxFile(mxFileXml); + }; } VsdxExport.prototype.CONVERSION_FACTOR = 40 * 2.54; //screenCoordinatesPerCm (40) x CENTIMETERS_PER_INCHES (2.54) diff --git a/war/js/diagramly/vsdx/mxVsdxCanvas2D.js b/war/js/diagramly/vsdx/mxVsdxCanvas2D.js index 4316ca04..6e97552a 100644 --- a/war/js/diagramly/vsdx/mxVsdxCanvas2D.js +++ b/war/js/diagramly/vsdx/mxVsdxCanvas2D.js @@ -8,16 +8,9 @@ * * Constructs a new abstract canvas. */ -function mxVsdxCanvas2D(root) +function mxVsdxCanvas2D(zip) { mxAbstractCanvas2D.call(this); - - /** - * Variable: root - * - * Reference to the container for the SVG content. - */ - this.root = root; }; /** @@ -26,15 +19,228 @@ function mxVsdxCanvas2D(root) mxUtils.extend(mxVsdxCanvas2D, mxAbstractCanvas2D); +/** + * Variable: textEnabled + * + * Specifies if text output should be enabled. Default is true. + */ +mxVsdxCanvas2D.prototype.textEnabled = true; /** - * Function: createElement - * - * Creates the given element using the owner document of . + * Function: init + * + * Initialize the canvas for a new vsdx file. */ -mxXmlCanvas2D.prototype.createElement = function(name) +mxVsdxCanvas2D.prototype.init = function (zip) { - return this.root.ownerDocument.createElement(name); + this.filesLoading = 0; + this.zip = zip; +}; + +/** + * Function: createGeoSec + * + * Create a new geo section. + */ +mxVsdxCanvas2D.prototype.createGeoSec = function () +{ + if (this.geoSec != null) + { + this.shape.appendChild(this.geoSec); + } + + var geoSec = this.xmlDoc.createElement("Section"); + + geoSec.setAttribute("N", "Geometry"); + geoSec.setAttribute("IX", this.geoIndex++); + + this.geoSec = geoSec; + this.geoStepIndex = 1; + this.lastX = 0; + this.lastY = 0; + this.lastMoveToX = 0; + this.lastMoveToY = 0; +}; + + +/** + * Function: newShape + * + * Create a new shape. + */ +mxVsdxCanvas2D.prototype.newShape = function (shape, xmGeo, xmlDoc) +{ + this.geoIndex = 0; + this.shape = shape; + this.xmGeo = xmGeo; + this.xmlDoc = xmlDoc; + this.geoSec = null; + this.shapeImg = null; + this.shapeType = "Shape"; + + this.createGeoSec(); +}; + +/** + * Function: endShape + * + * End current shape. + */ +mxVsdxCanvas2D.prototype.endShape = function () +{ + if (this.shapeImg != null) + { + this.addForeignData(this.shapeImg.type, this.shapeImg.id); + } +}; + + +/** + * Function: newPage + * + * Start a new page. + */ +mxVsdxCanvas2D.prototype.newPage = function () +{ + this.images = []; +}; + +/** + * Function: newPage + * + * Start a new page. + */ +mxVsdxCanvas2D.prototype.getShapeType = function () +{ + return this.shapeType; +}; + +/** + * Function: getShapeGeo + * + * return the current geo section. + */ +mxVsdxCanvas2D.prototype.getShapeGeo = function () +{ + return this.geoSec; +}; + +/** + * Function: createCellElemScaled + * + * Creates a cell element and scale the value. + */ +mxVsdxCanvas2D.prototype.createCellElemScaled = function (name, val, formula) +{ + return this.createCellElem(name, val / VsdxExport.prototype.CONVERSION_FACTOR, formula); +}; + +/** + * Function: createCellElem + * + * Creates a cell element. + */ +mxVsdxCanvas2D.prototype.createCellElem = function (name, val, formula) +{ + var cell = this.xmlDoc.createElement("Cell"); + cell.setAttribute("N", name); + cell.setAttribute("V", val); + + if (formula) cell.setAttribute("F", formula); + + return cell; +}; + +mxVsdxCanvas2D.prototype.createRowRel = function(type, index, x, y, a, b, c , d) +{ + var row = this.xmlDoc.createElement("Row"); + row.setAttribute("T", type); + row.setAttribute("IX", index); + row.appendChild(this.createCellElem("X", x)); + row.appendChild(this.createCellElem("Y", y)); + + if (a != null) row.appendChild(this.createCellElem("A", a)); + if (b != null) row.appendChild(this.createCellElem("B", b)); + if (c != null) row.appendChild(this.createCellElem("C", c)); + if (d != null) row.appendChild(this.createCellElem("D", d)); + + return row; +}; + + +/** + * Function: begin + * + * Extends superclass to create path. + */ +mxVsdxCanvas2D.prototype.begin = function() +{ + if (this.geoStepIndex > 1) this.createGeoSec(); +}; + +/** + * Function: rect + * + * Private helper function to create SVG elements + */ +mxVsdxCanvas2D.prototype.rect = function(x, y, w, h) +{ + if (this.geoStepIndex > 1) this.createGeoSec(); + + var s = this.state; + w = w * s.scale; + h = h * s.scale; + + var geo = this.xmGeo; + x = ((x - geo.x + s.dx) * s.scale) /w; + y = ((geo.height - y + geo.y - s.dy) * s.scale) /h; + + this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x, y)); + this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y)); + this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x + 1, y - 1)); + this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y - 1)); + this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x, y)); +}; + +/** + * Function: roundrect + * + * Private helper function to create SVG elements + */ +mxVsdxCanvas2D.prototype.roundrect = function(x, y, w, h, dx, dy) +{ + this.rect(x, y, w, h); + //TODO this assume dx and dy are equal and only one rounding is needed + this.shape.appendChild(this.createCellElemScaled("Rounding", dx)); +}; + +/** + * Function: ellipse + * + * Private helper function to create SVG elements + */ +mxVsdxCanvas2D.prototype.ellipse = function(x, y, w, h) +{ + if (this.geoStepIndex > 1) this.createGeoSec(); + + var s = this.state; + w = w * s.scale; + h = h * s.scale; + + var geo = this.xmGeo; + var gh = geo.height * s.scale; + var gw = geo.width * s.scale; + x = (x - geo.x + s.dx) * s.scale; + y = gh + (-y + geo.y - s.dy) * s.scale; + + var hr = h/gh; + var wr = w/gw; + + this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x/gw, y/gh - hr * 0.5)); + + var row = this.createRowRel("RelEllipticalArcTo", this.geoStepIndex++, x/gw, y/gh - hr * 0.5001, wr * 0.5 + x/gw, y/gh - hr, 0); + row.appendChild(this.createCellElem("D", w/h, "Width/Height*"+(wr/hr))); + this.geoSec.appendChild(row); }; /** @@ -49,12 +255,19 @@ mxXmlCanvas2D.prototype.createElement = function(name) */ mxVsdxCanvas2D.prototype.moveTo = function(x, y) { - var elem = this.createElement('move'); - elem.setAttribute('x', this.format(x)); - elem.setAttribute('y', this.format(y)); - this.root.appendChild(elem); + this.lastMoveToX = x; + this.lastMoveToY = y; this.lastX = x; - this.lastY = y; + this.lastY = y; + + var geo = this.xmGeo; + var s = this.state; + x = (x - geo.x + s.dx) * s.scale; + y = (geo.height - y + geo.y - s.dy) * s.scale; + var h = geo.height * s.scale; + var w = geo.width * s.scale; + + this.geoSec.appendChild(this.createRowRel("RelMoveTo", this.geoStepIndex++, x/w, y/h)); }; /** @@ -69,12 +282,17 @@ mxVsdxCanvas2D.prototype.moveTo = function(x, y) */ mxVsdxCanvas2D.prototype.lineTo = function(x, y) { - var elem = this.createElement('line'); - elem.setAttribute('x', this.format(x)); - elem.setAttribute('y', this.format(y)); - this.root.appendChild(elem); this.lastX = x; - this.lastY = y; + this.lastY = y; + + var geo = this.xmGeo; + var s = this.state; + x = (x - geo.x + s.dx) * s.scale; + y = (geo.height - y + geo.y - s.dy) * s.scale; + var h = geo.height * s.scale; + var w = geo.width * s.scale; + + this.geoSec.appendChild(this.createRowRel("RelLineTo", this.geoStepIndex++, x/w, y/h)); }; /** @@ -91,14 +309,27 @@ mxVsdxCanvas2D.prototype.lineTo = function(x, y) */ mxVsdxCanvas2D.prototype.quadTo = function(x1, y1, x2, y2) { - var elem = this.createElement('quad'); - elem.setAttribute('x1', this.format(x1)); - elem.setAttribute('y1', this.format(y1)); - elem.setAttribute('x2', this.format(x2)); - elem.setAttribute('y2', this.format(y2)); - this.root.appendChild(elem); this.lastX = x2; - this.lastY = y2; + this.lastY = y2; + + var s = this.state; + var geo = this.xmGeo; + + var h = geo.height * s.scale; + var w = geo.width * s.scale; + + x1 = (x1 - geo.x + s.dx) * s.scale; + y1 = (geo.height - y1 + geo.y - s.dy) * s.scale; + + x2 = (x2 - geo.x + s.dx) * s.scale; + y2 = (geo.height - y2 + geo.y - s.dy) * s.scale; + + x1 = x1 / w; + y1 = y1 / h; + x2 = x2 / w; + y2 = y2 / h; + + this.geoSec.appendChild(this.createRowRel("RelQuadBezTo", this.geoStepIndex++, x2, y2, x1, y1)); }; /** @@ -117,16 +348,32 @@ mxVsdxCanvas2D.prototype.quadTo = function(x1, y1, x2, y2) */ mxVsdxCanvas2D.prototype.curveTo = function(x1, y1, x2, y2, x3, y3) { - var elem = this.createElement('curve'); - elem.setAttribute('x1', this.format(x1)); - elem.setAttribute('y1', this.format(y1)); - elem.setAttribute('x2', this.format(x2)); - elem.setAttribute('y2', this.format(y2)); - elem.setAttribute('x3', this.format(x3)); - elem.setAttribute('y3', this.format(y3)); - this.root.appendChild(elem); this.lastX = x3; - this.lastY = y3; + this.lastY = y3; + + var s = this.state; + var geo = this.xmGeo; + + var h = geo.height * s.scale; + var w = geo.width * s.scale; + + x1 = (x1 - geo.x + s.dx) * s.scale; + y1 = (geo.height - y1 + geo.y - s.dy) * s.scale; + + x2 = (x2 - geo.x + s.dx) * s.scale; + y2 = (geo.height - y2 + geo.y - s.dy) * s.scale; + + x3 = (x3 - geo.x + s.dx) * s.scale; + y3 = (geo.height - y3 + geo.y - s.dy) * s.scale; + + x1 = x1 / w; + y1 = y1 / h; + x2 = x2 / w; + y2 = y2 / h; + x3 = x3 / w; + y3 = y3 / h; + + this.geoSec.appendChild(this.createRowRel("RelCubBezTo", this.geoStepIndex++, x3, y3, x1, y1, x2, y2)); }; /** @@ -136,7 +383,143 @@ mxVsdxCanvas2D.prototype.curveTo = function(x1, y1, x2, y2, x3, y3) */ mxVsdxCanvas2D.prototype.close = function() { - this.root.appendChild(this.createElement('close')); + //Closing with a line if last point != last MoveTo point + if (this.lastMoveToX != this.lastX || this.lastMoveToY != this.lastY) + this.lineTo(this.lastMoveToX, this.lastMoveToY); +}; + +/** + * Function: addForeignData + * + * Add ForeignData to current shape using last image in the images array + */ +mxVsdxCanvas2D.prototype.addForeignData = function(type, index) +{ + var foreignData = this.xmlDoc.createElement("ForeignData"); + foreignData.setAttribute("ForeignType", "Bitmap"); + + type = type.toUpperCase(); + + if (type != "BMP") + foreignData.setAttribute("CompressionType", type); + + var rel = this.xmlDoc.createElement("Rel"); + rel.setAttribute("r:id", "rId" + index); + + + foreignData.appendChild(rel); + this.shape.appendChild(foreignData); + this.shapeType = "Foreign"; +}; + +/** + * Function: image + * + * Add image to vsdx file as a media (Foreign Object) + */ +mxVsdxCanvas2D.prototype.image = function(x, y, w, h, src, aspect, flipH, flipV) +{ + //TODO image reusing, if the same image is used more than once, reuse it. Applicable for URLs specifically (but can also be applied to embedded ones) + var imgName = "image" + (this.images.length + 1) + "."; + var type; + if (src.indexOf("data:") == 0) + { + var p = src.indexOf("base64,"); + var base64 = src.substring(p + 7); //7 is the length of "base64," + type = src.substring(11, p-1); //5 is the length of "data:image/" + imgName += type; + this.zip.file("visio/media/" + imgName, base64, {base64: true}); + } + else if (window.XMLHttpRequest) //URL src, fetch it + { + src = this.converter.convert(src); + this.filesLoading++; + var that = this; + + var p = src.lastIndexOf("."); + type = src.substring(p+1); + imgName += type; + + //The old browsers binary workaround doesn't work with jszip and converting to base64 encoding doesn't work also + var xhr = new XMLHttpRequest(); + xhr.open('GET', src, true); + xhr.responseType = 'arraybuffer'; + xhr.onreadystatechange = function(e) + { + if (this.readyState == 4 && this.status == 200) { + that.zip.file("visio/media/" + imgName, this.response); + that.filesLoading--; + } + }; + xhr.send(); + } + + this.images.push(imgName); + + //TODO can a shape has more than one image? + this.shapeImg = {type: type, id: this.images.length}; + + //TODO support these! + aspect = (aspect != null) ? aspect : true; + flipH = (flipH != null) ? flipH : false; + flipV = (flipV != null) ? flipV : false; + + var s = this.state; + w = w * s.scale; + h = h * s.scale; + + var geo = this.xmGeo; + x = (x - geo.x + s.dx) * s.scale; + y = (geo.height - y + geo.y - s.dy) * s.scale; + + this.shape.appendChild(this.createCellElemScaled("ImgOffsetX", x)); + this.shape.appendChild(this.createCellElemScaled("ImgOffsetY", y - h)); + this.shape.appendChild(this.createCellElemScaled("ImgWidth", w)); + this.shape.appendChild(this.createCellElemScaled("ImgHeight", h)); + +// var s = this.state; +// x += s.dx; +// y += s.dy; +// +// if (s.alpha < 1 || s.fillAlpha < 1) +// { +// node.setAttribute('opacity', s.alpha * s.fillAlpha); +// } +// +// var tr = this.state.transform || ''; +// +// if (flipH || flipV) +// { +// var sx = 1; +// var sy = 1; +// var dx = 0; +// var dy = 0; +// +// if (flipH) +// { +// sx = -1; +// dx = -w - 2 * x; +// } +// +// if (flipV) +// { +// sy = -1; +// dy = -h - 2 * y; +// } +// +// // Adds image tansformation to existing transform +// tr += 'scale(' + sx + ',' + sy + ')translate(' + (dx * s.scale) + ',' + (dy * s.scale) + ')'; +// } +// +// if (tr.length > 0) +// { +// node.setAttribute('transform', tr); +// } +// +// if (!this.pointerEvents) +// { +// node.setAttribute('pointer-events', 'none'); +// } }; /** @@ -172,54 +555,88 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f { str = mxUtils.getOuterHtml(str); } + + //TODO support HTML text formatting and remaining attributes + var s = this.state; + var geo = this.xmGeo; + + var strRect; +// if (h == 0 || w == 0) +// { +// strRect = mxUtils.getSizeForString(str); +// } - var elem = this.createElement('text'); - elem.setAttribute('x', this.format(x)); - elem.setAttribute('y', this.format(y)); - elem.setAttribute('w', this.format(w)); - elem.setAttribute('h', this.format(h)); - elem.setAttribute('str', str); +// h = h > 0 ? h : strRect.height; +// w = w > 0 ? w : strRect.width; + h = h > 0 ? h : geo.height; + w = w > 0 ? w : geo.width; + w = w * s.scale; + h = h * s.scale; - if (align != null) - { - elem.setAttribute('align', align); - } + x = (x - geo.x + s.dx) * s.scale; + y = (geo.height - y + geo.y - s.dy) * s.scale; + + var hw = w/2, hh = h/2; + this.shape.appendChild(this.createCellElemScaled("TxtPinX", x)); + this.shape.appendChild(this.createCellElemScaled("TxtPinY", y)); + this.shape.appendChild(this.createCellElemScaled("TxtWidth", w)); + this.shape.appendChild(this.createCellElemScaled("TxtHeight", h)); + this.shape.appendChild(this.createCellElemScaled("TxtLocPinX", hw)); + this.shape.appendChild(this.createCellElemScaled("TxtLocPinY", hh)); + + this.shape.appendChild(this.createCellElemScaled("TxtAngle", rotation * Math.PI / 180)); - if (valign != null) - { - elem.setAttribute('valign', valign); - } - - elem.setAttribute('wrap', (wrap) ? '1' : '0'); - - if (format == null) - { - format = ''; - } - - elem.setAttribute('format', format); - - if (overflow != null) - { - elem.setAttribute('overflow', overflow); - } - - if (clip != null) - { - elem.setAttribute('clip', (clip) ? '1' : '0'); - } - - if (rotation != null) - { - elem.setAttribute('rotation', rotation); - } - - if (dir != null) - { - elem.setAttribute('dir', dir); - } - - this.root.appendChild(elem); + var text = this.xmlDoc.createElement("Text"); + text.textContent = str + "\n"; + this.shape.appendChild(text); +// +// var elem = this.createElement('text'); +// elem.setAttribute('x', this.format(x)); +// elem.setAttribute('y', this.format(y)); +// elem.setAttribute('w', this.format(w)); +// elem.setAttribute('h', this.format(h)); +// elem.setAttribute('str', str); +// +// if (align != null) +// { +// elem.setAttribute('align', align); +// } +// +// if (valign != null) +// { +// elem.setAttribute('valign', valign); +// } +// +// elem.setAttribute('wrap', (wrap) ? '1' : '0'); +// +// if (format == null) +// { +// format = ''; +// } +// +// elem.setAttribute('format', format); +// +// if (overflow != null) +// { +// elem.setAttribute('overflow', overflow); +// } +// +// if (clip != null) +// { +// elem.setAttribute('clip', (clip) ? '1' : '0'); +// } +// +// if (rotation != null) +// { +// elem.setAttribute('rotation', rotation); +// } +// +// if (dir != null) +// { +// elem.setAttribute('dir', dir); +// } +// +// this.root.appendChild(elem); } }; @@ -230,7 +647,8 @@ mxVsdxCanvas2D.prototype.text = function(x, y, w, h, str, align, valign, wrap, f */ mxVsdxCanvas2D.prototype.stroke = function() { - this.root.appendChild(this.createElement('stroke')); + this.geoSec.appendChild(this.createCellElem("NoFill", "1")); + this.geoSec.appendChild(this.createCellElem("NoLine", "0")); }; /** @@ -240,7 +658,8 @@ mxVsdxCanvas2D.prototype.stroke = function() */ mxVsdxCanvas2D.prototype.fill = function() { - this.root.appendChild(this.createElement('fill')); + this.geoSec.appendChild(this.createCellElem("NoFill", "0")); + this.geoSec.appendChild(this.createCellElem("NoLine", "1")); }; /** @@ -250,5 +669,6 @@ mxVsdxCanvas2D.prototype.fill = function() */ mxVsdxCanvas2D.prototype.fillAndStroke = function() { - this.root.appendChild(this.createElement('fillstroke')); + this.geoSec.appendChild(this.createCellElem("NoFill", "0")); + this.geoSec.appendChild(this.createCellElem("NoLine", "0")); }; diff --git a/war/js/diagramly/vsdx/resources/[Content_Types].xml b/war/js/diagramly/vsdx/resources/[Content_Types].xml index 20329e0d..ffd72681 100644 --- a/war/js/diagramly/vsdx/resources/[Content_Types].xml +++ b/war/js/diagramly/vsdx/resources/[Content_Types].xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/war/js/diagramly/vsdx/resources/allConstants.json b/war/js/diagramly/vsdx/resources/allConstants.json index 2c54da99..2251f87a 100644 --- a/war/js/diagramly/vsdx/resources/allConstants.json +++ b/war/js/diagramly/vsdx/resources/allConstants.json @@ -1,13 +1,12 @@ { - "[Content_Types].xml": "", + "[Content_Types].xml": "", "_rels/.rels" : "", "docProps/app.xml" : "Microsoft Visio15.0000