From 89fcf8b8bf424b9ceaba42350b691f9c43fc2bde Mon Sep 17 00:00:00 2001 From: Gaudenz Alder Date: Tue, 3 Oct 2017 17:26:30 +0200 Subject: [PATCH] 7.5.0 release Former-commit-id: 7d11f5c1aebd2a224d82ac6edfc6358de5c3840d --- ChangeLog | 6 + VERSION | 2 +- war/cache.manifest | 2 +- war/images/logo-confluence.png | Bin 871 -> 1733 bytes war/img/lib/atlassian/Atlassian.svg | 1 + war/img/lib/atlassian/Atlassian_Logo.svg | 19 + war/img/lib/atlassian/Bitbucket.svg | 1 + war/img/lib/atlassian/Bitbucket_Logo.svg | 17 + war/img/lib/atlassian/Hipchat.svg | 1 + war/img/lib/atlassian/Hipchat_Logo.svg | 15 + war/img/lib/atlassian/Jira_Core.svg | 1 + war/img/lib/atlassian/Jira_Core_Logo.svg | 15 + war/img/lib/atlassian/Jira_Service_Desk.svg | 1 + .../lib/atlassian/Jira_Service_Desk_Logo.svg | 16 + war/img/lib/atlassian/Jira_Software.svg | 1 + war/img/lib/atlassian/Jira_Software_Logo.svg | 19 + war/img/lib/atlassian/Stride.svg | 1 + war/img/lib/atlassian/Stride_Logo.svg | 16 + war/js/app.min.js | 831 ++++----- war/js/atlas-viewer.min.js | 1218 ++++++------- war/js/atlas.min.js | 1607 +++++++++-------- war/js/diagramly/Dialogs.js | 12 +- war/js/diagramly/EditorUi.js | 21 +- war/js/diagramly/Extensions.js | 1074 +++++++---- war/js/diagramly/Menus.js | 25 +- war/js/diagramly/TrelloClient.js | 8 +- war/js/diagramly/sidebar/Sidebar-WebIcons.js | 28 + war/js/embed-static.min.js | 84 +- war/js/extensions.min.js | 586 +++--- war/js/mxgraph/Editor.js | 3 +- war/js/mxgraph/EditorUi.js | 698 +++---- war/js/mxgraph/Graph.js | 5 + war/js/reader.min.js | 84 +- war/js/viewer.min.js | 1218 ++++++------- war/trello/attSection.html | 3 +- war/trello/editor.html | 1 + war/trello/index.html | 3 +- war/trello/js/attSection.js | 88 +- war/trello/js/client.js | 45 +- war/trello/js/common.js | 11 + war/trello/js/editor.js | 26 +- war/trello/js/new.js | 67 +- war/trello/new.html | 15 + 43 files changed, 4368 insertions(+), 3527 deletions(-) create mode 100644 war/img/lib/atlassian/Atlassian.svg create mode 100644 war/img/lib/atlassian/Atlassian_Logo.svg create mode 100644 war/img/lib/atlassian/Bitbucket.svg create mode 100644 war/img/lib/atlassian/Bitbucket_Logo.svg create mode 100644 war/img/lib/atlassian/Hipchat.svg create mode 100644 war/img/lib/atlassian/Hipchat_Logo.svg create mode 100644 war/img/lib/atlassian/Jira_Core.svg create mode 100644 war/img/lib/atlassian/Jira_Core_Logo.svg create mode 100644 war/img/lib/atlassian/Jira_Service_Desk.svg create mode 100644 war/img/lib/atlassian/Jira_Service_Desk_Logo.svg create mode 100644 war/img/lib/atlassian/Jira_Software.svg create mode 100644 war/img/lib/atlassian/Jira_Software_Logo.svg create mode 100644 war/img/lib/atlassian/Stride.svg create mode 100644 war/img/lib/atlassian/Stride_Logo.svg create mode 100644 war/trello/js/common.js diff --git a/ChangeLog b/ChangeLog index 91997cc01..48a774741 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +03-OCT-2017: 7.5.0 + +- Updates Atlassian icons +- Improvements for Lucidchart import +- Adds toolbar and border URL parameter for chromeless mode + 29-SEP-2017: 7.4.9 - Fixes ignored current page in window lightbox diff --git a/VERSION b/VERSION index d4580fb23..a2931d315 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.4.9 \ No newline at end of file +7.5.0 \ No newline at end of file diff --git a/war/cache.manifest b/war/cache.manifest index 85ad09b14..e1aa8efb9 100644 --- a/war/cache.manifest +++ b/war/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 09/29/2017 01:08 PM +# 10/03/2017 05:18 PM app.html index.html?offline=1 diff --git a/war/images/logo-confluence.png b/war/images/logo-confluence.png index 4038b55dc7db67cc4e7b4ec24d94f16b35abb586..fdf0a689e2ff27ee75fb7f6e4eb01b2b3588f29f 100644 GIT binary patch delta 1730 zcmV;z20i)b2E`4K7k@4Y0{{R3SpaHY0005nP)t-s00000oBt(*|0IL{GiLt-R?;GX z`w(g68+P*{e)=7E_aJ=u7I5neV%-B)&>njBCWHSVbo2&W)+L4iB7plGdhsBD-xO`= zC4>JZga0Ok{~><(2VU0zS=k_k_W@MT1X$80g#RXl|09F`1%Fx7BZ2=TfcgVi(hzIr zA%*`Mbng*q<0pjw6>jMPRL&cB@Fao$0#nWrYUC4a$#Abt4(RL>4%-yV7N3SZj+Q_dfK_y=6p8FK9iT-G3a z_yJVTCWQYMZ-43vVA>pb^bKU-BY*rMe)kb(;Ut9rC4~PUdiMZR%m7o)BY^x0UfL3B z;}B=!CWHSQb?+d2_!e;L0aVTcQ_dQ6?izLP9eD8$WZnv4+yGO|7;)<+h5s9M?-_CJ zCWQY8UDzan{S0E>23pn_a_$jnwg<|@)~sT6mIDRSkoPN^9^O- z31HhJfcqwh{~~|-4`$&hjsG8e_8oflB!&MWe)jq!o9DV;8clilp;{#jX2439)Sk@bQ`xtfe5NYQslm7%?<(utIS^xk5Zgf&k zQvd?{{(lAi{QUg=8vOkH{QJQS`>jbV2>tTn)x#zf6ZO!{osw>4URpO7`}g(g%*eB$ zo|S`nYhqbLLp(b;E+rrD?&;#;;M>;J!@j+`x3#mYsica9e0yk9P)zaf>D|r3wyKtl zgnfK?b#rlXJxCgF000CmNklU|{|)r2A4 zF(sW5!C87E+&yL{+vG^|R@4equLC`k-BYP9dSmlypB+im6@n2_r={3L+WW9_1Wu>Xm@K>+9+GN?s&GH8(*lncB_!ILC4)XNzsz z7EKHmeZD};f#A;e>S{LQHy{JTbL|e4#m&?n9|Jz=3k3LJ(0jPPzP{1mj}rsPTNsCW zK-0oX11#`*L-Ud4CI1TIiGf9GTE2!40uKUzrGd~oi_3ca58VWOS-|ta*BU@0`hS6k z-(+{HUIQrY=1ygO2J||uKhV2SM%~fo0~sgtIuZAX;EZZLEsYX z!BO-6_d|L2Q1g=q9aq{~DfVca>CuEu^)DW?kMG|ynNC_B^gbDwu<9MK`JdNM^|V0@ z36A3gG1GYQ?oTWFS~dTA{fvd>1eQWetJV4a*-SQc;upRY)cf&2j&eY=uz%`Y3vvHa zBYY5{wY6izR$Pv1-fZCnz{|XUIWj*V@-<$m{I zo&;1j;CbMai*9$!>0ICJ9)D9ypIkqOR}RcB4jFkUze6FR4dgCs=CFK`<%8yf5LcZ`C-zHkQE2RaS4*WZ-G!S* z_HB<_IajNA13Okp%sXS(BJu0WbaIh<8FoJA=NNP>_O zkPT*l1%a|aDX0iY3akvM0Hy}23!)c^gc|}k7GgM*1ZfXLHstxgzj{E|=#~We1v7B` zVfpbnS>)|rHeMs0wx5w1>aL-<;@5kwg$xW# z@t!V@As)xihTh(`%78~lSHwl&$-1V7N44Mo*S}w~v^7sKcHf+>&pSCKjW{(I?C)Cl zYFfUqhex#T;kA8jHHlV&3$nDq_>^gHC2S3*U&A^i56(*Sx>;!L}qJ_a({!4~6C>uQ{^xr1dT9 zPi?}=vh!3QKWnoVdDHIjQgpIL%#y>pGmM@x<{rFa*770X=B>r|Kgg(UeAKDxtfFglA7ubwrzD2)z%FVd7;G6&X=x~vaYYE33o-lOvbgf#a*dWqz z?C+(fwB&_n7M#z0z5k}s?^)IcR~4pAc_(op)MR>{UqYSV%ZY^_zcK0@uXKA5xk19D orYPY^poMaQzxwP2|J&*}9BezSc71InFpV;Jy85}Sb4q9e0HUvG%K!iX diff --git a/war/img/lib/atlassian/Atlassian.svg b/war/img/lib/atlassian/Atlassian.svg new file mode 100644 index 000000000..02c91baa2 --- /dev/null +++ b/war/img/lib/atlassian/Atlassian.svg @@ -0,0 +1 @@ +Atlassian-horizontal-blue-rgb \ No newline at end of file diff --git a/war/img/lib/atlassian/Atlassian_Logo.svg b/war/img/lib/atlassian/Atlassian_Logo.svg new file mode 100644 index 000000000..59c70ec88 --- /dev/null +++ b/war/img/lib/atlassian/Atlassian_Logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + Atlassian-horizontal-blue-rgb + + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Bitbucket.svg b/war/img/lib/atlassian/Bitbucket.svg new file mode 100644 index 000000000..380939e9c --- /dev/null +++ b/war/img/lib/atlassian/Bitbucket.svg @@ -0,0 +1 @@ +Bitbucket-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Bitbucket_Logo.svg b/war/img/lib/atlassian/Bitbucket_Logo.svg new file mode 100644 index 000000000..ffbd05b04 --- /dev/null +++ b/war/img/lib/atlassian/Bitbucket_Logo.svg @@ -0,0 +1,17 @@ + + + + + + + + + + Bitbucket-blue + + + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Hipchat.svg b/war/img/lib/atlassian/Hipchat.svg new file mode 100644 index 000000000..3deaf9298 --- /dev/null +++ b/war/img/lib/atlassian/Hipchat.svg @@ -0,0 +1 @@ +Hipchat-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Hipchat_Logo.svg b/war/img/lib/atlassian/Hipchat_Logo.svg new file mode 100644 index 000000000..b864fb245 --- /dev/null +++ b/war/img/lib/atlassian/Hipchat_Logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + Hipchat-blue + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Core.svg b/war/img/lib/atlassian/Jira_Core.svg new file mode 100644 index 000000000..fe8303b01 --- /dev/null +++ b/war/img/lib/atlassian/Jira_Core.svg @@ -0,0 +1 @@ +Jira Core-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Core_Logo.svg b/war/img/lib/atlassian/Jira_Core_Logo.svg new file mode 100644 index 000000000..a3c2dcf3b --- /dev/null +++ b/war/img/lib/atlassian/Jira_Core_Logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + Jira Core-blue + + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Service_Desk.svg b/war/img/lib/atlassian/Jira_Service_Desk.svg new file mode 100644 index 000000000..a532ca26c --- /dev/null +++ b/war/img/lib/atlassian/Jira_Service_Desk.svg @@ -0,0 +1 @@ +Jira Service Desk-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Service_Desk_Logo.svg b/war/img/lib/atlassian/Jira_Service_Desk_Logo.svg new file mode 100644 index 000000000..2a26f025d --- /dev/null +++ b/war/img/lib/atlassian/Jira_Service_Desk_Logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + Jira Service Desk-blue + + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Software.svg b/war/img/lib/atlassian/Jira_Software.svg new file mode 100644 index 000000000..f97d510bb --- /dev/null +++ b/war/img/lib/atlassian/Jira_Software.svg @@ -0,0 +1 @@ +Jira Software-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Jira_Software_Logo.svg b/war/img/lib/atlassian/Jira_Software_Logo.svg new file mode 100644 index 000000000..383e03862 --- /dev/null +++ b/war/img/lib/atlassian/Jira_Software_Logo.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + Jira Software-blue + + + + \ No newline at end of file diff --git a/war/img/lib/atlassian/Stride.svg b/war/img/lib/atlassian/Stride.svg new file mode 100644 index 000000000..6b4cadea9 --- /dev/null +++ b/war/img/lib/atlassian/Stride.svg @@ -0,0 +1 @@ +Stride-blue \ No newline at end of file diff --git a/war/img/lib/atlassian/Stride_Logo.svg b/war/img/lib/atlassian/Stride_Logo.svg new file mode 100644 index 000000000..ea6c97886 --- /dev/null +++ b/war/img/lib/atlassian/Stride_Logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + Stride-blue + + + \ No newline at end of file diff --git a/war/js/app.min.js b/war/js/app.min.js index a7092defb..f55bbdfa1 100644 --- a/war/js/app.min.js +++ b/war/js/app.min.js @@ -1902,8 +1902,8 @@ mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxEditor,"modifi c,d);return}}else if("ui"==c.nodeName){this.decodeUi(a,c,d);return}mxObjectCodec.prototype.decodeChild.apply(this,arguments)};a.decodeUi=function(a,c,d){for(a=c.firstChild;null!=a;){if("add"==a.nodeName){c=a.getAttribute("as");var b=a.getAttribute("element"),f=a.getAttribute("style");if(null!=b)b=document.getElementById(b),null!=b&&null!=f&&(b.style.cssText+=";"+f);else{var g=parseInt(a.getAttribute("x")),k=parseInt(a.getAttribute("y")),l=a.getAttribute("width"),m=a.getAttribute("height"),b=document.createElement("div"); b.style.cssText=f;(new mxWindow(mxResources.get(c)||c,b,g,k,l,m,!1,!0)).setVisible(!0)}"graph"==c?d.setGraphContainer(b):"toolbar"==c?d.setToolbarContainer(b):"title"==c?d.setTitleContainer(b):"status"==c?d.setStatusContainer(b):"map"==c&&d.setMapContainer(b)}else"resource"==a.nodeName?mxResources.add(a.getAttribute("basename")):"stylesheet"==a.nodeName&&mxClient.link("stylesheet",a.getAttribute("name"));a=a.nextSibling}};a.decodeTemplates=function(a,c,d){null==d.templates&&(d.templates=[]);c=mxUtils.getChildNodes(c); for(var b=0;bdocument.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",c):this.diagramContainer.oncontextmenu=c;b.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var b=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),c.push(a));a=d}a=this.toolbar.fontMenu;d=this.toolbar.sizeMenu; -if(null==n)this.toolbar.createTextToolbar();else{for(var f=0;fmxUtils.indexOf(w,v[a])&&w.push(v[a]);var B=function(a,c){b.getModel().beginUpdate();try{if(c)for(var d=b.getModel().isEdge(h),f=d?b.currentEdgeStyle:b.currentVertexStyle,d=["fontSize","fontFamily","fontColor"],e=0;emxUtils.indexOf(v,p))&&b.setCellStyles(p,u,[h])}}}finally{b.getModel().endUpdate()}};b.addListener("cellsInserted",function(a,b){B(b.getProperty("cells"))});b.addListener("textInserted",function(a, -b){B(b.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT,function(a,b){var c=[b.getProperty("cell")];b.getProperty("terminalInserted")&&c.push(b.getProperty("terminal"));B(c)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,e=!1;if(0=screen.width?118:208;EditorUi.prototype.allowAnimation=!0; +this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,b.isEnabled=function(){return!1},b.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();c=mxUtils.bind(this,function(a){null==a&&(a=window.event);return this.isSelectionAllowed(a)||b.isEditing()});this.container==document.body&&(this.menubarContainer.onselectstart=c,this.menubarContainer.onmousedown= +c,this.toolbarContainer.onselectstart=c,this.toolbarContainer.onmousedown=c,this.diagramContainer.onselectstart=c,this.diagramContainer.onmousedown=c,this.sidebarContainer.onselectstart=c,this.sidebarContainer.onmousedown=c,this.formatContainer.onselectstart=c,this.formatContainer.onmousedown=c,this.footerContainer.onselectstart=c,this.footerContainer.onmousedown=c,null!=this.tabContainer&&(this.tabContainer.onselectstart=c));!this.editor.chromeless||this.editor.editable?mxClient.IS_IE&&("undefined"=== +typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",c):this.diagramContainer.oncontextmenu=c:b.panningHandler.usePopupTrigger=!1;b.init(this.diagramContainer);this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var b=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,a)&& +(a.parentNode.removeChild(a),c.push(a));a=d}a=this.toolbar.fontMenu;d=this.toolbar.sizeMenu;if(null==n)this.toolbar.createTextToolbar();else{for(var f=0;fmxUtils.indexOf(w,v[a])&&w.push(v[a]);var B=function(a,c){b.getModel().beginUpdate();try{if(c)for(var d=b.getModel().isEdge(h),f=d?b.currentEdgeStyle:b.currentVertexStyle,d=["fontSize","fontFamily","fontColor"],e=0;emxUtils.indexOf(v,p))&&b.setCellStyles(p,u,[h])}}}finally{b.getModel().endUpdate()}}; +b.addListener("cellsInserted",function(a,b){B(b.getProperty("cells"))});b.addListener("textInserted",function(a,b){B(b.getProperty("cells"),!0)});b.connectionHandler.addListener(mxEvent.CONNECT,function(a,b){var c=[b.getProperty("cell")];b.getProperty("terminalInserted")&&c.push(b.getProperty("terminal"));B(c)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var d=c.getProperty("cells"),f=!1,e=!1;if(0=screen.width?118:208;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2; EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()})); var c=a.setDefaultParent,d=this;this.editor.graph.setDefaultParent=function(){c.apply(this,arguments);d.updateActionStates()};a.editLink=d.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var c=this.editor.graph;9==a.which&&c.isEnabled()&&!mxEvent.isAltDown(a)&&(c.isEditing()?c.stopEditing(!1):c.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))}; EditorUi.prototype.onKeyPress=function(a){var c=this.editor.graph;!this.isImmediateEditingEvent(a)||c.isEditing()||c.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(c.escape(),c.startEditing(),mxClient.IS_FF&&(c=c.cellEditor,c.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(c.textarea),a.collapse(!1),c=window.getSelection(),c.removeAllRanges(),c.addRange(a)))}; @@ -2031,7 +2031,7 @@ EditorUi.prototype.initClipboard=function(){var a=this,c=mxClipboard.cut;mxClipb EditorUi.prototype.initCanvas=function(){var a=this.editor.graph,a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),b=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+a.y*b.height),this.scale* a.width*b.width,this.scale*a.height*b.height)};a.getPreferredPageSize=function(a,b,c){a=this.getPageLayout();b=this.getPageSize();return new mxRectangle(0,0,a.width*b.width,a.height*b.height)};var c=null;if(this.editor.chromeless){this.chromelessResize=c=mxUtils.bind(this,function(b,c){if(null!=a.container){var d=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),f=a.view.translate,e=a.view.scale,d=mxRectangle.fromRectangle(d);d.x=d.x/e-f.x;d.y=d.y/e-f.y;d.width/=e;d.height/=e;var f= a.container.scrollTop,g=a.container.scrollLeft,h=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)h+=3;var k=a.container.offsetWidth-h,l=b?Math.max(.3,Math.min(c||1,k/d.width)):e;a.view.scaleAndTranslate(l,Math.max((k-l*d.width)/2,0)/l-d.x,Math.max((a.container.offsetHeight-h-l*d.height)/4,0)/l-d.y);a.container.scrollTop=f*l/e;a.container.scrollLeft=g*l/e}});var d=mxUtils.bind(this,function(){c(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window, -"resize",d)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){c(!0)}));this.actions.get("zoomIn").funct=function(b){a.zoomIn();c(!1)};this.actions.get("zoomOut").funct=function(b){a.zoomOut();c(!1)};this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor= +"resize",d)});this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){c(!0)}));this.actions.get("zoomIn").funct=function(b){a.zoomIn();c(!1)};this.actions.get("zoomOut").funct=function(b){a.zoomOut();c(!1)};if("0"!=urlParams.toolbar){this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor= "#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var b=mxUtils.bind(this,function(){var b=mxUtils.getCurrentStyle(a.container);this.chromelessToolbar.style.bottom=(null!=b?parseInt(b["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height): 20)+"px"});this.editor.addListener("resetGraphView",b);b();var e=0,b=mxUtils.bind(this,function(a,b,c){e++;var d=document.createElement("span");d.style.paddingLeft="8px";d.style.paddingRight="8px";d.style.cursor="pointer";mxEvent.addListener(d,"click",a);null!=c&&d.setAttribute("title",c);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);d.appendChild(a);this.chromelessToolbar.appendChild(d);return d}),f=b(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct(); mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),h=document.createElement("div");h.style.display="inline-block";h.style.verticalAlign="top";h.style.fontFamily="Helvetica,Arial";h.style.marginTop="8px";h.style.color="#ffffff";this.chromelessToolbar.appendChild(h);var g=b(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),k=mxUtils.bind(this,function(){null!=this.pages&&1this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale); -this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){this.zoom(this.cumulativeZoomFactor);null!=c&&c(!1);if(null!=x&&mxUtils.hasScrollbars(a.container)){var b=mxUtils.getOffset(a.container),d=a.container.offsetHeight/2-x.y+b.y;a.container.scrollLeft-=(a.container.offsetWidth/2-x.x+b.x)*(this.cumulativeZoomFactor-1);a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)}this.cumulativeZoomFactor= -1;this.updateZoomTimeout=null}),20)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c){if((mxEvent.isAltDown(b)||mxEvent.isControlDown(b)&&!mxClient.IS_MAC||a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(b);null!=d;){if(d==a.container){x=new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b));a.lazyZoom(c);mxEvent.consume(b);break}d=d.parentNode}}))}; +"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||q(30),p())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?p():q(100)}));mxEvent.addListener(this.chromelessToolbar, +"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?p():q(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||q(30)}));var u=a.getTolerance(),w=this;a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(b,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(b, +c){mxEvent.isTouchEvent(c.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale* +this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale*this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){this.zoom(this.cumulativeZoomFactor);null!=c&&c(!1);if(null!=x&&mxUtils.hasScrollbars(a.container)){var b=mxUtils.getOffset(a.container),d=a.container.offsetHeight/2-x.y+b.y;a.container.scrollLeft-=(a.container.offsetWidth/2-x.x+b.x)*(this.cumulativeZoomFactor-1);a.container.scrollTop-= +d*(this.cumulativeZoomFactor-1)}this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),20)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c){if((mxEvent.isAltDown(b)||mxEvent.isControlDown(b)&&!mxClient.IS_MAC||a.panningHandler.isActive())&&(null==this.dialogs||0==this.dialogs.length))for(var d=mxEvent.getSource(b);null!=d;){if(d==a.container){x=new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b));a.lazyZoom(c);mxEvent.consume(b);break}d=d.parentNode}}))}; EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))}; EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a}; EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0G&&null!=k&&!mxEvent.isShiftDown(f)&&(mxUtils.getValue(k.style,mxConstants.STYLE_SHAPE)!=mxUtils.getValue(H,mxConstants.STYLE_SHAPE)&&mxUtils.getValue(k.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE)!=mxConstants.NONE||"image"==mxUtils.getValue(H,mxConstants.STYLE_SHAPE)||1500this.dropTargetDelay&&(a.model.isVertex(k.cell)&&null!=m||a.model.isEdge(k.cell)&&a.model.isEdge(b[0]))){w=k;var l=a.model.isEdge(k.cell)?a.view.getPoint(k): new mxPoint(k.getCenterX(),k.getCenterY()),l=new mxRectangle(l.x-this.refreshTarget.width/2,l.y-this.refreshTarget.height/2,this.refreshTarget.width,this.refreshTarget.height);y.style.left=Math.floor(l.x)+"px";y.style.top=Math.floor(l.y)+"px";null==J&&(a.container.appendChild(y),J=y.parentNode);h(c,d,l,y)}else null==w||!mxUtils.contains(w,c,d)||1500G&&G>this.dropTargetDelay||a.model.isEdge(e)?k:null,null!=r&&l){g=[K,I,A,x,C,B];for(l=0;lG&&G>this.dropTargetDelay||a.model.isEdge(e)?k:null,null!=r&&l){g=[K,I,A,x,C,B];for(l=0;l"));return c=this.graph.sanitizeHtml(c,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var b=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return b="1"==mxUtils.getValue(a.style,"nl2Br","1")?b.replace(/\r\n/g, -"
").replace(/\n/g,"
"):b.replace(/\r\n/g,"").replace(/\n/g,"")};var l=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();l.apply(this,arguments);try{this.graph.container.focus()}catch(H){}};var m=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,b){this.graph.getModel().beginUpdate();try{if(m.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var c= -mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==b&&c==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var b=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))b=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR, -null),b==mxConstants.NONE&&(b=null);return b};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,30)};var n=mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){mxEvent.isAltDown(f)&&(e=null);n.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(b){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var c=this.graph.view.translate, -d=this.graph.view.scale;b=this.roundLength((this.bounds.x+this.currentDx)/d-c.x);c=this.roundLength((this.bounds.y+this.currentDy)/d-c.y);this.hint.innerHTML=b+", "+c;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize= -function(a,b){return!this.graph.isSwimlane(a.cell)&&0").replace(/\n/g,"
"):b.replace(/\r\n/g,"").replace(/\n/g,"")};var l=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();l.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(D){}};var m=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,b){this.graph.getModel().beginUpdate();try{if(m.apply(this,arguments),this.graph.isCellDeletable(a.cell)&& +0==this.graph.model.getChildCount(a.cell)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==b&&c==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var b=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))b= +mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),b==mxConstants.NONE&&(b=null);return b};mxCellEditor.prototype.getMinimumSize=function(a){var b=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*b+20,30)};var n=mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,b,c,d,e,f){mxEvent.isAltDown(f)&&(e=null);n.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(b){if(null!=this.shape){null==this.hint&&(this.hint= +a(),this.graph.container.appendChild(this.hint));var c=this.graph.view.translate,d=this.graph.view.scale;b=this.roundLength((this.bounds.x+this.currentDx)/d-c.x);c=this.roundLength((this.bounds.y+this.currentDy)/d-c.y);this.hint.innerHTML=b+", "+c;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint), +this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,b){return!this.graph.isSwimlane(a.cell)&&0=d&&(mxUtils.br(e),l=0)}d=null!=d?d:3;var f=document.createElement("div");f.style.textAlign="center";f.style.whiteSpace="nowrap";f.style.paddingTop="0px";f.style.paddingBottom="20px";var g=a.addLanguageMenu(f,!0);null!=g&&(g.style.bottom=parseInt("28px")-2+"px");if(!a.isOffline()&&1b.length?mxClient.IS_SF||null!=document.documentMode?h.className="geBtn gePrimaryBtn":(k.appendChild(l),l.className="geBtn gePrimaryBtn",h.className="geBtn"):(k.appendChild(e),h.className="geBtn",e.className="geBtn gePrimaryBtn");c.appendChild(k);this.container=c},GoogleSitesDialog=function(a,b){function d(){var a=null!=A.getTitle()?A.getTitle():this.defaultFilename;if(D.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value)); -null!=a&&(b+="&title="+encodeURIComponent(a));0");if(2==F.length){var z=k(F[0]),F=k(F[1]),E=new mxCell("",new mxGeometry);E.edge=!0;z.insertEdge(E,!0);F.insertEdge(E,!1);m.push(E)}}if(0");if(2==F.length){var y=k(F[0]),F=k(F[1]),E=new mxCell("",new mxGeometry);E.edge=!0;y.insertEdge(E,!0);F.insertEdge(E,!1);m.push(E)}}if(0 Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml": "plantUmlSvg"==m.value?"@startuml\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml":";Example:\na->b\nb->c\nc->a\n"}var f=a.editor.graph.getFreeInsertPoint(),g=document.createElement("div");g.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height="354px";k.style.marginBottom= "16px";var m=document.createElement("select"),e=document.createElement("option");e.setAttribute("value","list");e.setAttribute("selected","selected");mxUtils.write(e,mxResources.get("list"));m.appendChild(e);e=document.createElement("option");e.setAttribute("value","diagram");mxUtils.write(e,mxResources.get("diagram"));m.appendChild(e);e=document.createElement("option");e.setAttribute("value","plantUmlSvg");mxUtils.write(e,mxResources.get("plantUml")+" ("+mxResources.get("formatSvg")+")");var h=document.createElement("option"); h.setAttribute("value","plantUmlPng");mxUtils.write(h,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");/.*\.draw\.io$/.test(window.location.hostname)&&Graph.fileSupport&&!a.isOffline()&&(m.appendChild(e),m.appendChild(h));var l=c();k.value=l;g.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0=a.getStatus()&&(q.removeAttribute("disabled"),g(h,a.getText(),b),l&&f())}))});mxEvent.addListener(h,"dblclick",function(a){l=!0})}else h.innerHTML='
'+ -mxResources.get(c)+"
",e&&g(h),mxEvent.addListener(h,"click",function(a){g(h)}),mxEvent.addListener(h,"dblclick",function(a){f()});y.appendChild(h)}function m(){function a(){for(var a=!0;b=y.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in w){var e=document.createElement("div"),h=mxResources.get(d), -l=w[d];null==h&&(h=d.substring(0,1).toUpperCase()+d.substring(1));18b.lastIndexOf(".")&&0>h){var c=null!=c?c:A.value,l="";c==App.MODE_GOOGLE?l=a.drive.extension:c==App.MODE_GITHUB?l=a.gitHub.extension:c==App.MODE_TRELLO?l=a.trello.extension:c==App.MODE_DROPBOX?l=a.dropbox.extension:c==App.MODE_ONEDRIVE?l=a.oneDrive.extension:c==App.MODE_DEVICE&&(l=".xml");0<=h&&(d=d.substring(0,h));x.value=d+l}}y(e)})}var f=document.createElement("a");f.style.overflow="hidden";var v=document.createElement("img"); +d(k.value,m.value)});g.appendChild(h);h.className="geBtn gePrimaryBtn";a.editor.cancelFirst||g.appendChild(e);this.container=g},NewDialog=function(a,b,d,c,f){function g(){if(c)d||a.hideDialog(),c(t,p.value);else{var b=p.value;null!=b&&0=a.getStatus()&&(z.removeAttribute("disabled"),k(h,a.getText(),b),l&&g())}))});mxEvent.addListener(h,"dblclick",function(a){l=!0})}else h.innerHTML='
'+ +mxResources.get(c)+"
",e&&k(h),mxEvent.addListener(h,"click",function(a){k(h)}),mxEvent.addListener(h,"dblclick",function(a){g()});v.appendChild(h)}function e(){function a(){for(var a=!0;b=v.scrollHeight&&(a(),mxEvent.consume(b))});var c=null,d;for(d in w){var e=document.createElement("div"),h=mxResources.get(d), +l=w[d];null==h&&(h=d.substring(0,1).toUpperCase()+d.substring(1));18b.lastIndexOf(".")&&0>h){var c=null!=c?c:A.value,l="";c==App.MODE_GOOGLE?l=a.drive.extension:c==App.MODE_GITHUB?l=a.gitHub.extension:c==App.MODE_TRELLO?l=a.trello.extension:c==App.MODE_DROPBOX?l=a.dropbox.extension:c==App.MODE_ONEDRIVE?l=a.oneDrive.extension:c==App.MODE_DEVICE&&(l=".xml");0<=h&&(d=d.substring(0,h));w.value=d+l}}z(e)})}var f=document.createElement("a");f.style.overflow="hidden";var v=document.createElement("img"); v.src=c;v.setAttribute("border","0");v.setAttribute("align","absmiddle");v.style.width="60px";v.style.height="60px";v.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding="8px 8px 10px 8px";f.style.whiteSpace="nowrap";f.appendChild(v);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var g=document.createElement("div"); f.appendChild(g);mxUtils.write(g,d);if(null!=h&&null==a[h]){v.style.visibility="hidden";mxUtils.setOpacity(g,10);var q=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});q.spin(f);var t=window.setTimeout(function(){null==a[h]&&(q.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[h]&&(window.clearTimeout(t),mxUtils.setOpacity(g,100),v.style.visibility="",q.stop(), -l())}))}else l();D.appendChild(f);++C==n&&(mxUtils.br(D),C=0)}function y(b){var c=x.value;if(null==b||null!=c&&0JGraph Ltd.
All Rights Reserved.';b.appendChild(d);mxEvent.addListener(b,"click",function(b){"A"!=mxEvent.getSource(b).nodeName&&a.hideDialog()});this.container=b},FeedbackDialog=function(a){var b= document.createElement("div"),d=document.createElement("div");mxUtils.write(d,mxResources.get("sendYourFeedbackToDrawIo"));d.style.fontSize="18px";d.style.marginBottom="18px";b.appendChild(d);d=document.createElement("div");mxUtils.write(d,mxResources.get("yourEmailAddress")+" ("+mxResources.get("required")+")");b.appendChild(d);var c=document.createElement("input");c.setAttribute("type","text");c.style.marginTop="6px";c.style.width="600px";var f=mxUtils.button(mxResources.get("sendMessage"),function(){var b= (k.checked?"\nDiagram:\n"+a.getFileData():"")+"\nBrowser:\n"+navigator.userAgent;b.length>FeedbackDialog.maxAttachmentSize?a.alert(mxResources.get("drawingTooLarge")):(a.hideDialog(),a.spinner.spin(document.body)&&mxUtils.post(null!=FeedbackDialog.feedbackUrl?FeedbackDialog.feedbackUrl:"/email","email="+encodeURIComponent(c.value)+"&version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&body="+encodeURIComponent("Feedback:\n"+e.value+b),function(b){a.spinner.stop(); @@ -6058,36 +6063,36 @@ mxUtils.write(m," "+mxResources.get("includeCopyOfMyDiagram"));d.appendChild(m); d.style.marginTop="26px";d.style.textAlign="right";m=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});m.className="geBtn";a.editor.cancelFirst?(d.appendChild(m),d.appendChild(f)):(d.appendChild(f),d.appendChild(m));b.appendChild(d);this.container=b};FeedbackDialog.maxAttachmentSize=1E6; var RevisionDialog=function(a,b){var d=document.createElement("div"),c=document.createElement("h3");c.style.marginTop="0px";mxUtils.write(c,mxResources.get("revisionHistory"));d.appendChild(c);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";d.appendChild(f);var g=document.createElement("div");g.style.position="absolute";g.style.border="1px solid lightGray";g.style.left="199px";g.style.width="470px";g.style.height= "376px";g.style.overflow="hidden";mxEvent.disableContextMenu(g);d.appendChild(g);var k=new Graph(g);k.setEnabled(!1);k.setPanning(!0);k.panningHandler.ignoreCell=!0;k.panningHandler.useLeftButtonForPanning=!0;k.minFitScale=null;k.maxFitScale=null;k.centerZoom=!0;var m=0,e=null,h=0,l=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a&&null!=e&&null!=e[h]?e[h].getAttribute("name"):"pagenumber"==a?h+1:l.apply(this,arguments)};k.getLinkForCell=function(){return null};Editor.MathJaxRender&& -k.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(k.container)}));var n=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),p=a.getCurrentFile(),u=null,t=null,q=null,y=null,v=mxUtils.button("",function(){null!=q&&k.zoomIn()});v.className="geSprite geSprite-zoomin";v.setAttribute("title",mxResources.get("zoomIn")); -v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var w=mxUtils.button("",function(){null!=q&&k.zoomOut()});w.className="geSprite geSprite-zoomout";w.setAttribute("title",mxResources.get("zoomOut"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var x=mxUtils.button("",function(){null!=q&&(k.maxFitScale=8,k.fit(8),k.center())});x.className= -"geSprite geSprite-fit";x.setAttribute("title",mxResources.get("fit"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var D=mxUtils.button("",function(){null!=q&&(k.zoomActual(),k.center())});D.className="geSprite geSprite-actualsize";D.setAttribute("title",mxResources.get("actualSize"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var C= +k.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(k.container)}));var n=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),p=a.getCurrentFile(),u=null,t=null,q=null,z=null,v=mxUtils.button("",function(){null!=q&&k.zoomIn()});v.className="geSprite geSprite-zoomin";v.setAttribute("title",mxResources.get("zoomIn")); +v.style.outline="none";v.style.border="none";v.style.margin="2px";v.setAttribute("disabled","disabled");mxUtils.setOpacity(v,20);var x=mxUtils.button("",function(){null!=q&&k.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var w=mxUtils.button("",function(){null!=q&&(k.maxFitScale=8,k.fit(8),k.center())});w.className= +"geSprite geSprite-fit";w.setAttribute("title",mxResources.get("fit"));w.style.outline="none";w.style.border="none";w.style.margin="2px";w.setAttribute("disabled","disabled");mxUtils.setOpacity(w,20);var D=mxUtils.button("",function(){null!=q&&(k.zoomActual(),k.center())});D.className="geSprite geSprite-actualsize";D.setAttribute("title",mxResources.get("actualSize"));D.style.outline="none";D.style.border="none";D.style.margin="2px";D.setAttribute("disabled","disabled");mxUtils.setOpacity(D,20);var C= document.createElement("div");C.style.position="absolute";C.style.textAlign="right";C.style.color="gray";C.style.marginTop="10px";C.style.backgroundColor="transparent";C.style.top="440px";C.style.right="32px";C.style.maxWidth="380px";C.style.cursor="default";var A=mxUtils.button(mxResources.get("download"),function(){if(null!=q){var b=a.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():a.defaultFilename,c=mxUtils.getXml(q.documentElement);a.isLocalFileSave()?a.saveLocalFile(c,b,"text/xml"): -(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});A.className="geBtn";A.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("restore"),function(){null!=q&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&p.save(!0,function(b){a.spinner.stop(); -a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});F.className="geBtn";F.setAttribute("disabled","disabled");var z=document.createElement("select");z.setAttribute("disabled","disabled");z.style.maxWidth="80px";z.style.position="relative";z.style.top="-2px";z.style.verticalAlign="bottom";z.style.marginRight="6px";z.style.display="none";var E=null;mxEvent.addListener(z,"change",function(a){null!= +(c="undefined"===typeof pako?"&xml="+encodeURIComponent(c):"&data="+encodeURIComponent(a.editor.graph.compress(c)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+c)).simulate(document,"_blank"))}});A.className="geBtn";A.setAttribute("disabled","disabled");var F=mxUtils.button(mxResources.get("restore"),function(){null!=q&&null!=z&&a.confirm(mxResources.get("areYouSure"),function(){a.spinner.spin(document.body,mxResources.get("restoring"))&&p.save(!0,function(b){a.spinner.stop(); +a.replaceFileData(z);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});F.className="geBtn";F.setAttribute("disabled","disabled");var y=document.createElement("select");y.setAttribute("disabled","disabled");y.style.maxWidth="80px";y.style.position="relative";y.style.top="-2px";y.style.verticalAlign="bottom";y.style.marginRight="6px";y.style.display="none";var E=null;mxEvent.addListener(y,"change",function(a){null!= E&&(E(a),mxEvent.consume(a))});var B=mxUtils.button(mxResources.get("openInNewWindow"),function(){null!=q&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(q.documentElement)),window.openWindow(a.getUrl()))});B.className="geBtn";B.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("show"),function(){null!=t&&window.open(t.getUrl())});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled","disabled");c=document.createElement("div"); c.style.position="absolute";c.style.top="482px";c.style.width="640px";c.style.textAlign="right";var H=document.createElement("div");H.className="geToolbarContainer";H.style.backgroundColor="transparent";H.style.padding="2px";H.style.border="none";H.style.left="199px";H.style.top="442px";var I=null;if(null==p||null==a.drive&&p.constructor==window.DriveFile||null==a.dropbox&&p.constructor==window.DropboxFile)g.style.display="none",H.style.display="none",mxUtils.write(f,mxResources.get("notAvailable")); else if(null!=b&&0a.maxImageSize||f>a.maxImageSize){var F=Math.min(1,Math.min(a.maxImageSize/Math.max(1, -h)),a.maxImageSize/Math.max(1,f));h*=F;f*=F}B>G?(G=Math.round(100*G/B),B=100):(B=Math.round(100*B/G),G=100);var E=document.createElement("div");E.setAttribute("draggable","true");E.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";E.style.position="relative";E.style.cursor="move";mxUtils.setPrefixedStyle(E.style,"transition","transform .1s ease-in-out");if(null!=b){var C=document.createElement("img");C.setAttribute("src",x.convert(b));C.style.width=B+"px";C.style.height=G+"px";C.style.margin= +d,e,h,f,g,n,v){try{if(null==c||"image/"==c.substring(0,6))if(null==b&&null!=g||null==q[b]){var p=function(){y.innerHTML="";y.style.cursor="pointer";y.style.whiteSpace="nowrap";y.style.textOverflow="ellipsis";mxUtils.write(y,null!=A.title&&0a.maxImageSize||f>a.maxImageSize){var F=Math.min(1,Math.min(a.maxImageSize/Math.max(1, +h)),a.maxImageSize/Math.max(1,f));h*=F;f*=F}B>G?(G=Math.round(100*G/B),B=100):(B=Math.round(100*B/G),G=100);var E=document.createElement("div");E.setAttribute("draggable","true");E.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";E.style.position="relative";E.style.cursor="move";mxUtils.setPrefixedStyle(E.style,"transition","transform .1s ease-in-out");if(null!=b){var C=document.createElement("img");C.setAttribute("src",w.convert(b));C.style.width=B+"px";C.style.height=G+"px";C.style.margin= "10px";C.style.paddingBottom=Math.floor((100-G)/2)+"px";C.style.paddingLeft=Math.floor((100-B)/2)+"px";E.appendChild(C)}else if(null!=g){var H=a.stringToCells(a.editor.graph.decompress(g.xml));0y?v-1:v,0,l.splice(y,1)[0]),u.insertBefore(u.children[y],u.children[v])):(l.push(l.splice(y,1)[0]),u.appendChild(u.children[y]));else if(0z?v-1:v,0,l.splice(z,1)[0]),u.insertBefore(u.children[z],u.children[v])):(l.push(l.splice(z,1)[0]),u.appendChild(u.children[z]));else if(0=c.status&&(m(c.responseText,d,e,h,l,f,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(c,d,e,h,l,f,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g, " ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",e);mxEvent.addListener(u,"drop",h);mxEvent.addListener(t,"dragover",e);mxEvent.addListener(t,"drop",h);d.appendChild(u);c=document.createElement("div");c.style.textAlign="right";c.style.marginTop="20px";b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});b.setAttribute("id","btnCancel");b.className="geBtn";a.editor.cancelFirst&&c.appendChild(b);n=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(l), c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});n.setAttribute("id","btnDownload");n.className="geBtn";c.appendChild(n);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A,"change",function(b){D=!1;a.importFiles(A.files, -0,0,a.maxImageSize,function(a,c,d,e,h,l,f,g,n){C(b)(a,c,d,e,h,l,f,g,n);A.value=""});u.scrollTop=u.scrollHeight}),n=mxUtils.button(mxResources.get("import"),function(){null!=w&&(w(),w=null);A.click()}),n.setAttribute("id","btnAddImage"),n.className="geBtn",c.appendChild(n));n=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=w&&(w(),w=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){D=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var d=a.indexOf(",");0'),b.writeln(a.editor.fontCss),b.writeln(""))};if("undefined"!==typeof MathJax){var m=c.renderPage;c.renderPage=function(a,b,c,d,e,h){var l=m.apply(this,arguments);this.graph.mathEnabled?this.mathEnabled=!0:l.className="geDisableMathJax";return l}}c.open(null,null,e,!0)}else{g=b.background;if(null== -g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=k;c.appendGraph(b,n,l,f,e,!0)}return c}var d=parseInt(R.value)/100;isNaN(d)&&(d=1,R.value="100 %");var d=.75*d,h=m.value,l=q.value,f=!k.checked,n=null;f&&(f=h==g&&l==g);if(!f&&null!=a.pages&&a.pages.length){var v=0,f=a.pages.length-1;k.checked||(v=parseInt(h)-1,f=parseInt(l)-1);for(var p=v;p<=f;p++){var w=a.pages[p],h=w==a.currentPage?e:null;if(null==h){var h=a.createTemporaryGraph(e.getStylesheet()),l=!0,v=!1,t=null,u=null; -null==w.viewState&&null==w.mapping&&null==w.root&&a.updatePageRoot(w);null!=w.viewState?(l=w.viewState.pageVisible,v=w.viewState.mathEnabled,t=w.viewState.background,u=w.viewState.backgroundImage):null!=w.mapping&&null!=w.mapping.diagramMap&&(v="0"!=w.mapping.diagramMap.get("mathEnabled"),t=w.mapping.diagramMap.get("background"),u=w.mapping.diagramMap.get("backgroundImage"),u=null!=u&&0'),f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'), +g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=k;c.appendGraph(b,n,l,f,e,!0)}return c}var d=parseInt(R.value)/100;isNaN(d)&&(d=1,R.value="100 %");var d=.75*d,h=m.value,l=q.value,f=!k.checked,n=null;f&&(f=h==g&&l==g);if(!f&&null!=a.pages&&a.pages.length){var v=0,f=a.pages.length-1;k.checked||(v=parseInt(h)-1,f=parseInt(l)-1);for(var p=v;p<=f;p++){var x=a.pages[p],h=x==a.currentPage?e:null;if(null==h){var h=a.createTemporaryGraph(e.getStylesheet()),l=!0,v=!1,t=null,u=null; +null==x.viewState&&null==x.mapping&&null==x.root&&a.updatePageRoot(x);null!=x.viewState?(l=x.viewState.pageVisible,v=x.viewState.mathEnabled,t=x.viewState.background,u=x.viewState.backgroundImage):null!=x.mapping&&null!=x.mapping.diagramMap&&(v="0"!=x.mapping.diagramMap.get("mathEnabled"),t=x.mapping.diagramMap.get("background"),u=x.mapping.diagramMap.get("backgroundImage"),u=null!=u&&0'),f.writeln("MathJax.Hub.Config({"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'), f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),f.writeln("TeX: {"),f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),f.writeln("},"),f.writeln("tex2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("},"),f.writeln("asciimath2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("}"),f.writeln("});"),b&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"), f.writeln(' +
- + \ No newline at end of file diff --git a/war/trello/editor.html b/war/trello/editor.html index 8956425ed..b7034c525 100644 --- a/war/trello/editor.html +++ b/war/trello/editor.html @@ -2,6 +2,7 @@ +
diff --git a/war/trello/index.html b/war/trello/index.html index cbdaf3293..17def4865 100644 --- a/war/trello/index.html +++ b/war/trello/index.html @@ -5,9 +5,10 @@ +

- draw.io Trello PowerUp! + draw.io Trello Power-Up!

\ No newline at end of file diff --git a/war/trello/js/attSection.js b/war/trello/js/attSection.js index 0510ba340..bfa529a5c 100644 --- a/war/trello/js/attSection.js +++ b/war/trello/js/attSection.js @@ -6,25 +6,37 @@ t.render(function() { return function() { - t.card('id') - .then(function (card) - { t.modal({ url: './editor.html', fullscreen: true, - args: {cardId: card.id, att: att, name: name} + args: {attId: att.id, name: name}, + title: 'draw.io: ' + name, + callback: function() + { + //TODO find a way to catch close event before destroying the editor such that we can save + console.log("Closed!!!!!"); + } + }); + } + }; + + var getPrevFunction = function(prevURL, name) + { + return function() + { + t.modal({ + url: prevURL, + fullscreen: true, + title: 'draw.io: ' + name }); - }); } }; + var idSep = encodeURIComponent('|$|'); + t.card('attachments') .get('attachments') - .filter(function(attachment) - { - var drawioSuffix = '.drawio.png'; - return attachment.name.lastIndexOf(drawioSuffix) === attachment.name.length - drawioSuffix.length; - }) + .filter(mxTrelloCommon.attFilterFn) .then(function(drawioAtts) { var content = document.getElementById('content'); @@ -35,14 +47,49 @@ t.render(function() var div = document.createElement('div'); div.className = "attachment-thumbnail"; - var attName = drawioAtts[i].name.replace(".drawio.png", ""); + var attName = drawioAtts[i].name; - var imgLink = document.createElement('a'); - imgLink.className = "attachment-thumbnail-preview"; - imgLink.setAttribute('href', 'javascript:void(0);'); - imgLink.setAttribute('title', attName); - imgLink.style.cssText = "background-image: url('"+ drawioAtts[i].url +"');background-color: #fcfcfc;"; //trello is using the original file instead of previews! - div.appendChild(imgLink); + //TODO add preview modal on click + //For PNG and SVG (on supported browsers) show them as images, otherwise, load them inside a lightbox editor [size 300px max for images] + //Click shows a preview + var previews = drawioAtts[i].previews; + + var prevURL = mxTrelloCommon.editorURL + '?lightbox=1'; + var fileId = '#T' + t.getContext().card + idSep + drawioAtts[i].id; + var prevFn = getPrevFunction(prevURL + fileId, attName); + + if (previews.length > 0) + { + //find the best size (max dim is 300px) + var maxPrev = previews[0]; + for (var j = 1; j < previews.length; j++) + { + if (previews[j].width <= 350 && previews[j].height <= 260 && maxPrev.width < previews[j].width) + { + maxPrev = previews[j]; + } + } + var imgLink = document.createElement('a'); + imgLink.className = "attachment-thumbnail-preview"; + imgLink.setAttribute('href', 'javascript:void(0);'); + imgLink.setAttribute('title', attName); + + imgLink.style.cssText = "background-image: url('"+ maxPrev.url +"');background-color: #fcfcfc;"; + imgLink.addEventListener("click", prevFn); + div.appendChild(imgLink); + } + else + { + var prevFrm = document.createElement('iframe'); + prevFrm.className = "attachment-thumbnail-preview"; + prevFrm.setAttribute('src', prevURL + '&toolbar=0&border=0' + fileId); + + //prevFrm.style.cssText = "width:110px;height:80px"; + prevFrm.width = 110; + prevFrm.height = 80; + prevFrm.addEventListener("click", prevFn); + div.appendChild(prevFrm); + } var detailsP = document.createElement('p'); detailsP.className = "attachment-thumbnail-details"; @@ -85,6 +132,13 @@ t.render(function() editLink.addEventListener("click", getEditFunction(drawioAtts[i], attName)); actionsSpan.appendChild(editLink); + var prevLink = document.createElement('a'); + prevLink.className = "attachment-thumbnail-details-options-item dark-hover"; + prevLink.setAttribute('href', 'javascript:void(0);'); + prevLink.innerHTML = ' Preview'; + prevLink.addEventListener("click", prevFn); + actionsSpan.appendChild(prevLink); + detailsP.appendChild(actionsSpan); div.appendChild(detailsP); diff --git a/war/trello/js/client.js b/war/trello/js/client.js index 2fe514b09..80ea47203 100644 --- a/war/trello/js/client.js +++ b/war/trello/js/client.js @@ -14,7 +14,7 @@ TrelloPowerUp return t.popup({ title : 'Create a New Diagram...', url : './new.html', - height : 125 + height : 190 }); } } ]; @@ -22,13 +22,7 @@ TrelloPowerUp 'attachment-sections' : function(t, options) { // Claim all png attachment that is created by draw.io - var claimed = options.entries - .filter(function(attachment) - { - var drawioSuffix = '.drawio.png'; - return attachment.name.lastIndexOf(drawioSuffix) === attachment.name.length - - drawioSuffix.length; - }); + var claimed = options.entries.filter(mxTrelloCommon.attFilterFn); if (claimed && claimed.length > 0) { @@ -40,7 +34,7 @@ TrelloPowerUp { type : 'iframe', url : t.signUrl('./attSection.html', { - arg : "" + arg: "" }), height : 230 } @@ -53,22 +47,23 @@ TrelloPowerUp }, 'card-badges' : function(t, options) { - // Claim all png attachment that is created by draw.io - var claimed = options.entries - .filter(function(attachment) + return t.card('attachments') + .get('attachments') + .filter(mxTrelloCommon.attFilterFn) + .then(function(claimed) + { + if (claimed && claimed.length > 0) { - var drawioSuffix = '.drawio.png'; - return attachment.name.lastIndexOf(drawioSuffix) === attachment.name.length - - drawioSuffix.length; - }); - - if (claimed && claimed.length > 0) - { - return [{ - text: 'draw.io (' + claimed.length + ')', - icon: 'https://www.draw.io/images/favicon-32x32.png', - color: 'white' - }]; - } + return [{ + text: 'draw.io (' + claimed.length + ')', + icon: 'https://www.draw.io/images/favicon-32x32.png', + color: 'white' + }]; + } + else + { + return []; + } + }); } }); diff --git a/war/trello/js/common.js b/war/trello/js/common.js new file mode 100644 index 000000000..88a34e628 --- /dev/null +++ b/war/trello/js/common.js @@ -0,0 +1,11 @@ +mxTrelloCommon = { + editorURL: "https://test-dot-praxis-deck-767.appspot.com/", + attFilterFn: function(attachment) + { + var name = attachment.name; + var drawioSuffix = '.drawio'; + var extPos = name.lastIndexOf('.'); + var drawioPos = name.lastIndexOf(drawioSuffix); + return drawioPos > -1 && (drawioPos == extPos || extPos - drawioPos == drawioSuffix.length); + } +}; \ No newline at end of file diff --git a/war/trello/js/editor.js b/war/trello/js/editor.js index 417de057e..e0e0904c0 100644 --- a/war/trello/js/editor.js +++ b/war/trello/js/editor.js @@ -2,13 +2,13 @@ { var t = window.TrelloPowerUp.iframe(); - var fileName = t.arg('name'); - var att = t.arg('att'); - var cardId = t.arg('cardId'); + var fileName = t.arg('name'); + var type = t.arg('type'); + var attId = t.arg('attId'); + var cardId = t.getContext().card; var iframe = document.getElementById("editorFrame"); - var temp = null; - iframe.setAttribute('src', "https://test-dot-praxis-deck-767.appspot.com/?embed=1&tr=1&spin=1&ui=atlas&proto=json&libraries=1"); + iframe.setAttribute('src', mxTrelloCommon.editorURL + "?embed=1&tr=1&spin=1&ui=atlas&proto=json&libraries=1"); window.addEventListener('message', function(evt) { @@ -32,27 +32,27 @@ } else if (msg.event == 'init') { - iframe.contentWindow.postMessage(JSON.stringify({action: 'load', autosave: 0, - saveAndExit: '1', modified: 'unsavedChanges', xml: "", title: fileName}), '*'); + iframe.contentWindow.postMessage(JSON.stringify({action: 'load', autosave: 1, + saveAndExit: '1', modified: false, xml: "", title: fileName}), '*'); - if (!att) + if (!attId) { + fileName = fileName + '.drawio' + (type == 'xml'? '' : '.' + type); iframe.contentWindow.postMessage(JSON.stringify({action: 'newFile', type: 'T', folderId: cardId, name: fileName}), '*'); } else { - iframe.contentWindow.postMessage(JSON.stringify({action: 'loadFile', type: 'T', autosave: 0, - file: cardId + '|$|' + att.id}), '*'); + iframe.contentWindow.postMessage(JSON.stringify({action: 'loadFile', type: 'T', autosave: 1, + file: cardId + '|$|' + attId}), '*'); } } else if (msg.event == 'autosave') { - temp = msg.xml; + iframe.contentWindow.postMessage(JSON.stringify({action: 'status', + messageKey: 'allChangesSaved', modified: false}), '*'); } else if (msg.event == 'save') { - temp = msg.xml; - if (msg.exit) { msg.event = 'exit'; diff --git a/war/trello/js/new.js b/war/trello/js/new.js index b86d5f6d9..36c13bc93 100644 --- a/war/trello/js/new.js +++ b/war/trello/js/new.js @@ -3,27 +3,74 @@ var t = window.TrelloPowerUp.iframe(); var diagName = document.getElementById("diagName"); + var errorMsg = document.getElementById("errorMsg"); diagName.focus(); var newDiagFn = function() { var name = diagName.value; - t.card('id') - .then(function (card) - { - t.modal({ - url: './editor.html', - fullscreen: true, - args: {cardId: card.id, name: name} - }); - }); - } + if (name == null || name.length == 0) { + errorMsg.style.display = ""; + return; + } + var type = document.getElementById("format").value; + t.modal({ + url: './editor.html', + fullscreen: true, + args: {name: name, type: type} + }); + }; diagName.addEventListener("keypress", function(e) { if (e.keyCode == 13) newDiagFn(); + else + errorMsg.style.display = "none"; }); document.getElementById("createBtn").addEventListener("click", newDiagFn); + + //Fill the dialog with other attachments + var select = document.getElementById("otherAtt"); + var importBtn = document.getElementById("importBtn"); + + t.card('attachments') + .get('attachments') + .then(function(atts) + { + var count = 0; + for (var i = 0; i < atts.length; i++) + { + if (!mxTrelloCommon.attFilterFn(atts[i])) + { + var opt = document.createElement("option"); + opt.setAttribute('value', atts[i].id); + opt.innerHTML = atts[i].name; + select.appendChild(opt); + count++; + } + } + + if (count == 0) + { + document.getElementById("importLbl").style.display = "none"; + select.style.display = "none"; + importBtn.style.display = "none"; + } + }) + .then(function() + { + return t.sizeTo('#content'); + }); + + importBtn.addEventListener("click", function() + { + t.modal({ + url: './editor.html', + fullscreen: true, + args: {attId: select.value, name: select.options[select.selectedIndex].text} + }); + }); + })(); \ No newline at end of file diff --git a/war/trello/new.html b/war/trello/new.html index c83d6ec5f..e2d1fbef3 100644 --- a/war/trello/new.html +++ b/war/trello/new.html @@ -2,14 +2,29 @@ +
+ + + +
+ + +