diff --git a/ChangeLog b/ChangeLog index febef016..234040a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +28-OCT-2020: 13.8.6 + +- Performance improvements for Jira Cloud +- MS teams integration + 27-OCT-2020: 13.8.5 - Fixes possible NPE in Confluence Cloud diff --git a/VERSION b/VERSION index 16b3c156..fb2ae584 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -13.8.5 \ No newline at end of file +13.8.6 \ No newline at end of file diff --git a/src/main/java/com/mxgraph/online/AbsAuthServlet.java b/src/main/java/com/mxgraph/online/AbsAuthServlet.java index 08a79cd5..c02b39c1 100644 --- a/src/main/java/com/mxgraph/online/AbsAuthServlet.java +++ b/src/main/java/com/mxgraph/online/AbsAuthServlet.java @@ -13,6 +13,7 @@ import java.io.StringWriter; import java.math.BigInteger; import java.net.HttpURLConnection; import java.net.URL; +import java.net.URLEncoder; import java.security.SecureRandom; import java.util.HashMap; import java.util.logging.Logger; @@ -144,7 +145,7 @@ abstract public class AbsAuthServlet extends HttpServlet String refreshToken = request.getParameter("refresh_token"); String error = request.getParameter("error"); HashMap stateVars = new HashMap<>(); - String secret = null, client = null, redirectUri = null, domain = null, stateToken = null, cookieToken = null, version = null; + String secret = null, client = null, redirectUri = null, domain = null, stateToken = null, cookieToken = null, version = null, successRedirect = null; try { @@ -167,6 +168,13 @@ abstract public class AbsAuthServlet extends HttpServlet client = stateVars.get("cId"); stateToken = stateVars.get("token"); version = stateVars.get("ver"); + successRedirect = stateVars.get("redirect"); + + //Redirect to a page on the same domain only (relative path) TODO Is this enough? + if (successRedirect != null && successRedirect.toLowerCase().startsWith("http")) + { + successRedirect = null; + } Cookie[] cookies = request.getCookies(); @@ -222,16 +230,24 @@ abstract public class AbsAuthServlet extends HttpServlet } else { - Response authResp = contactOAuthServer(CONFIG.AUTH_SERVICE_URL, code, refreshToken, secret, client, redirectUri, 1); + Response authResp = contactOAuthServer(CONFIG.AUTH_SERVICE_URL, code, refreshToken, secret, client, redirectUri, successRedirect != null, 1); + response.setStatus(authResp.status); if (authResp.content != null) { - OutputStream out = response.getOutputStream(); - PrintWriter writer = new PrintWriter(out); - writer.println(authResp.content); - writer.flush(); - writer.close(); + if (successRedirect != null) + { + response.sendRedirect(successRedirect + "#" + Utils.encodeURIComponent(authResp.content, "UTF-8")); + } + else + { + OutputStream out = response.getOutputStream(); + PrintWriter writer = new PrintWriter(out); + writer.println(authResp.content); + writer.flush(); + writer.close(); + } } } } @@ -248,7 +264,7 @@ abstract public class AbsAuthServlet extends HttpServlet } private Response contactOAuthServer(String authSrvUrl, String code, String refreshToken, String secret, - String client, String redirectUri, int retryCount) + String client, String redirectUri,boolean directResp, int retryCount) { HttpURLConnection con = null; Response response = new Response(); @@ -334,8 +350,16 @@ abstract public class AbsAuthServlet extends HttpServlet in.close(); response.status = con.getResponseCode(); - // Writes JavaScript code - response.content = processAuthResponse(authRes.toString(), jsonResponse); + + if (directResp) + { + response.content = authRes.toString(); + } + else + { + // Writes JavaScript code + response.content = processAuthResponse(authRes.toString(), jsonResponse); + } } catch(IOException e) { @@ -371,7 +395,7 @@ abstract public class AbsAuthServlet extends HttpServlet else if (retryCount > 0 && e.getMessage() != null && e.getMessage().contains("Connection timed out")) { return contactOAuthServer(authSrvUrl, code, refreshToken, secret, - client, redirectUri, --retryCount); + client, redirectUri, directResp, --retryCount); } else { diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index 61b8ca79..f3794e30 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -2333,24 +2333,24 @@ n)}f(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.c mxResources.get("fit"));var m=null,q=null,v=mxUtils.bind(this,function(a){null!=m&&(window.clearTimeout(m),m=null);null!=q&&(window.clearTimeout(q),q=null);m=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);m=null;q=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";q=null}),600)}),a||200)}),u=mxUtils.bind(this,function(a){null!=m&&(window.clearTimeout(m),m=null);null!=q&&(window.clearTimeout(q),q=null);this.chromelessToolbar.style.display= "";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var t=f(mxUtils.bind(this,function(b){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var c=t.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style, "borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=c.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container); -this.layersDialog.style.zIndex=c.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(b)}),Editor.layersLargeImage,mxResources.get("layers")),w=a.getModel();w.addListener(mxEvent.CHANGE,function(){t.style.display=1=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/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-.05)/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(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(a.isFastZoomEnabled()){null==J&&""!=B.getAttribute("filter")&&(J=B.getAttribute("filter"),B.removeAttribute("filter")); -H=new mxPoint(a.container.scrollLeft,a.container.scrollTop);c=d?a.container.scrollLeft+a.container.clientWidth/2:E.x+a.container.scrollLeft-a.container.offsetLeft;var g=d?a.container.scrollTop+a.container.clientHeight/2:E.y+a.container.scrollTop-a.container.offsetTop;B.style.transformOrigin=c+"px "+g+"px";B.style.transform="scale("+this.cumulativeZoomFactor+")";D.style.transformOrigin=c+"px "+g+"px";D.style.transform="scale("+this.cumulativeZoomFactor+")";null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&& -(c=a.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(c.style,"transform-origin",(d?a.container.clientWidth/2+a.container.scrollLeft-c.offsetLeft+"px":E.x+a.container.scrollLeft-c.offsetLeft-a.container.offsetLeft+"px")+" "+(d?a.container.clientHeight/2+a.container.scrollTop-c.offsetTop+"px":E.y+a.container.scrollTop-c.offsetTop-a.container.offsetTop+"px")),mxUtils.setPrefixedStyle(c.style,"transform","scale("+this.cumulativeZoomFactor+")"));a.view.getDecoratorPane().style.opacity="0";a.view.getOverlayPane().style.opacity= -"0";null!=b.hoverIcons&&b.hoverIcons.reset()}G(f)};mxEvent.addGestureListeners(a.container,function(a){null!=z&&window.clearTimeout(z)},null,function(b){1!=a.cumulativeZoomFactor&&G(0)});mxEvent.addListener(a.container,"scroll",function(b){null==z||a.isMouseDown||1==a.cumulativeZoomFactor||G(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c,d,f,g){if(null==this.dialogs||0==this.dialogs.length)if(!a.scrollbars&&!d&&a.isScrollWheelEvent(b))d=a.view.getTranslate(),f=40/a.view.scale,mxEvent.isShiftDown(b)? -a.view.setTranslate(d.x+(c?-f:f),d.y):a.view.setTranslate(d.x,d.y+(c?f:-f));else if(d||a.isZoomWheelEvent(b))for(var e=mxEvent.getSource(b);null!=e;){if(e==a.container)return a.tooltipHandler.hideTooltip(),E=null!=f&&null!=g?new mxPoint(f,g):new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b)),I=d,a.lazyZoom(c),mxEvent.consume(b),!1;e=e.parentNode}}),a.container);a.panningHandler.zoomGraph=function(b){a.cumulativeZoomFactor=b.scale;a.lazyZoom(0=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/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-.05)/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(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;if(a.isFastZoomEnabled()){null== +J&&""!=B.getAttribute("filter")&&(J=B.getAttribute("filter"),B.removeAttribute("filter"));H=new mxPoint(a.container.scrollLeft,a.container.scrollTop);c=d?a.container.scrollLeft+a.container.clientWidth/2:E.x+a.container.scrollLeft-a.container.offsetLeft;var g=d?a.container.scrollTop+a.container.clientHeight/2:E.y+a.container.scrollTop-a.container.offsetTop;B.style.transformOrigin=c+"px "+g+"px";B.style.transform="scale("+this.cumulativeZoomFactor+")";D.style.transformOrigin=c+"px "+g+"px";D.style.transform= +"scale("+this.cumulativeZoomFactor+")";null!=a.view.backgroundPageShape&&null!=a.view.backgroundPageShape.node&&(c=a.view.backgroundPageShape.node,mxUtils.setPrefixedStyle(c.style,"transform-origin",(d?a.container.clientWidth/2+a.container.scrollLeft-c.offsetLeft+"px":E.x+a.container.scrollLeft-c.offsetLeft-a.container.offsetLeft+"px")+" "+(d?a.container.clientHeight/2+a.container.scrollTop-c.offsetTop+"px":E.y+a.container.scrollTop-c.offsetTop-a.container.offsetTop+"px")),mxUtils.setPrefixedStyle(c.style, +"transform","scale("+this.cumulativeZoomFactor+")"));a.view.getDecoratorPane().style.opacity="0";a.view.getOverlayPane().style.opacity="0";null!=b.hoverIcons&&b.hoverIcons.reset()}G(f)};mxEvent.addGestureListeners(a.container,function(a){null!=z&&window.clearTimeout(z)},null,function(b){1!=a.cumulativeZoomFactor&&G(0)});mxEvent.addListener(a.container,"scroll",function(b){null==z||a.isMouseDown||1==a.cumulativeZoomFactor||G(0)});mxEvent.addMouseWheelListener(mxUtils.bind(this,function(b,c,d,f,g){if(null== +this.dialogs||0==this.dialogs.length)if(!a.scrollbars&&!d&&a.isScrollWheelEvent(b))d=a.view.getTranslate(),f=40/a.view.scale,mxEvent.isShiftDown(b)?a.view.setTranslate(d.x+(c?-f:f),d.y):a.view.setTranslate(d.x,d.y+(c?f:-f));else if(d||a.isZoomWheelEvent(b))for(var e=mxEvent.getSource(b);null!=e;){if(e==a.container)return a.tooltipHandler.hideTooltip(),E=null!=f&&null!=g?new mxPoint(f,g):new mxPoint(mxEvent.getClientX(b),mxEvent.getClientY(b)),I=d,a.lazyZoom(c),mxEvent.consume(b),!1;e=e.parentNode}}), +a.container);a.panningHandler.zoomGraph=function(b){a.cumulativeZoomFactor=b.scale;a.lazyZoom(0
'+ -mxResources.get("newDiagram",null,"New Diagram")+'
'+mxResources.get("templates",null,"Templates")+'
'+mxResources.get("newDiagram",null,"New Diagram")+'
'+mxResources.get("showAll",null,"+ Show all")+ -'
'+mxResources.get("myDiagrams",null,"My diagrams")+'
'+ +function(){if(null!=c){var d=c();if("string"===typeof d){a.showError(mxResources.get("error"),d);return}}a.hideDialog()});e.appendChild(g);g.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(d);k.appendChild(e);this.cancelBtn=d;this.okButton=g;this.container=k},TemplatesDialog=function(){var a='
'+mxResources.get("newDiagram",null,"New Diagram")+'
'+mxResources.get("templates",null,"Templates")+'
'+mxResources.get("newDiagram",null,"New Diagram")+'
'+ +mxResources.get("showAll",null,"+ Show all")+'
'+mxResources.get("myDiagrams",null,"My diagrams")+'
'+ mxResources.get("allDiagrams",null,"All diagrams")+'

🛈 '+ mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'
'+mxResources.get("create",null,"Create")+'
'+mxResources.get("cancel",null,"Cancel")+"
",e=document.createElement("div");e.innerHTML=a;e.className="geTemplateDlg"; var a=window.innerWidth,c=window.innerHeight,b=987,g=712;.9*a
'+mxUtils.htmlEntities(e)+"
";this.pagesContainer.appendChild(g);var f=this.createViewer(g.childNodes[0],c);e=mxUtils.bind(this,function(){null!=this.selectedItem&&(this.selectedItem.className="geAspectDlgListItem");this.selectedItem= g;this.selectedPage=a;g.className+=" geAspectDlgListItemSelected";this.layersContainer.innerHTML="";this.selectedLayers={};this.okBtn.setAttribute("disabled","disabled");for(var b=f.model,b=b.getChildCells(b.getRoot()),e=0;e
'+mxUtils.htmlEntities(e)+"
";this.layersContainer.appendChild(g);this.createViewer(g.childNodes[0],b,a.id);b=mxUtils.bind(this,function(){0<=g.className.indexOf("geAspectDlgListItemSelected")? @@ -9950,9 +9950,9 @@ else if("sfnt"==f||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=a;/ mxUtils.bind(this,function(d){this.resolvedFontCss=d;a()})):a()};Editor.prototype.embedExtFonts=function(a){var d=this.graph.getCustomFonts();if(0g;g++)for(var f=g,m=0;8>m;m++)f=1==(f&1)?3988292384^f>>>1:f>>>1,Editor.crcTable[g]=f;Editor.updateCRC=function(a,d,b,c){for(var e=0;e>>8;return a};Editor.crc32=function(a){for(var d=-1,b=0;b>>8^Editor.crcTable[(d^a.charCodeAt(b))&255];return(d^ -1)>>>0};Editor.writeGraphModelToPng=function(a,d,b,c,e){function k(a,d){var b=p;p+=d;return a.substring(b,p)}function l(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(k(a,4),"IHDR"!=k(a,4))null!= @@ -9994,15 +9994,15 @@ d,t.getSelectionCells());e.push(a);k.push(d);if(null!=b.dependentProps)for(a=0;a function e(d,b,c){var e=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(d,!0);b.style.position="absolute";b.style.left=k.x-e.x+"px";b.style.top=k.y-e.y+"px";b.style.width=d.offsetWidth+"px";b.style.height=d.offsetHeight-(c?4:0)+"px";b.style.zIndex=5}function k(a,d,b){var e=document.createElement("div");e.style.width="32px";e.style.height="4px";e.style.margin="2px";e.style.border="1px solid black";e.style.background=d&&"none"!=d?d:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(u, function(k){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function l(a,d,b,e,k,l,f){null!=d&&(d=d.split(","),q.push({name:a,values:d,type:b,defVal:e,countProperty:k,parentRow:l,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(u,function(d){for(var p=l,u=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")== a)p=p.nextSibling,u++;else break;var t={type:b,parentRow:l,index:u,isDeletable:!0,defVal:e,countProperty:k},u=g(a,"",t,0==u%2,f);c(a,e,t);p.parentNode.insertBefore(u,p.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,k,l){if(0g.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==n?parseInt(a):a)+"");c(d,a,g)}var l=document.createElement("input");e(v,l,!0);l.value=b;l.className= -"gePropEditor";"int"!=n&&"float"!=n||g.allowAuto||(l.type="number",l.step="int"==n?"1":"any",null!=g.min&&(l.min=parseFloat(g.min)),null!=g.max&&(l.max=parseFloat(g.max)));a.appendChild(l);mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k()});l.focus();mxEvent.addListener(l,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(u,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn", -v.appendChild(q));z.appendChild(v);return z}var u=this,t=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.className="geProperties";m.style.whiteSpace="nowrap";m.style.width="100%";var n=document.createElement("tr");n.className="gePropHeader";var z=document.createElement("th");z.className="gePropHeaderCell";var v=document.createElement("img");v.src=Sidebar.prototype.expandedImage;z.appendChild(v);mxUtils.write(z,mxResources.get("property")); -n.style.cursor="pointer";var B=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){v.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(ka){}}else v.src=Sidebar.prototype.expandedImage,b="";for(c=0;cg.max&&(a=g.max);a=mxUtils.htmlEntities(("int"==v?parseInt(a):a)+"");c(d,a,g)}var l=document.createElement("input");e(n,l,!0);l.value=b;l.className= +"gePropEditor";"int"!=v&&"float"!=v||g.allowAuto||(l.type="number",l.step="int"==v?"1":"any",null!=g.min&&(l.min=parseFloat(g.min)),null!=g.max&&(l.max=parseFloat(g.max)));a.appendChild(l);mxEvent.addListener(l,"keypress",function(a){13==a.keyCode&&k()});l.focus();mxEvent.addListener(l,"blur",function(){k()})})));g.isDeletable&&(q=mxUtils.button("-",mxUtils.bind(u,function(a){c(d,"",g,g.index);mxEvent.consume(a)})),q.style.height="16px",q.style.width="25px",q.style["float"]="right",q.className="geColorBtn", +n.appendChild(q));z.appendChild(n);return z}var u=this,t=this.editorUi.editor.graph,q=[];a.style.position="relative";a.style.padding="0";var m=document.createElement("table");m.className="geProperties";m.style.whiteSpace="nowrap";m.style.width="100%";var v=document.createElement("tr");v.className="gePropHeader";var z=document.createElement("th");z.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;z.appendChild(n);mxUtils.write(z,mxResources.get("property")); +v.style.cursor="pointer";var B=function(){var d=m.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(e)}catch(ka){}}else n.src=Sidebar.prototype.expandedImage,b="";for(c=0;c'),b.writeln("div.MathJax_SVG_Display { position: static; }"),b.writeln("");mxClient.IS_GC&&(b.writeln('"));null!=a.editor.fontCss&&(b.writeln('")); for(var c=d.getCustomFonts(),e=0;e'):(b.writeln('"))}};if("undefined"!==typeof MathJax){var D=b.renderPage;b.renderPage=function(d,b,c,e,k,l){var f=mxClient.NO_FO;mxClient.NO_FO= -this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var p=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:p.className="geDisableMathJax";return p}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{n=d.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor= -n;b.autoOrigin=A;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q'):(b.wnd.document.writeln('"))}l&&(d.useCssTransforms= -l,d.currentTranslate=f,d.currentScale=p,d.view.translate=g,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,B.checked,F.value,K.value,parseInt(v.value)/100,parseInt(M.value)/100,J.get());else{g&&(g=l==p&&f==p);if(!g&&null!= -a.pages&&a.pages.length){var n=0,g=a.pages.length-1;u.checked||(n=parseInt(l)-1,g=parseInt(f)-1);for(var z=n;z<=g;z++){var A=a.pages[z],l=A==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,n=!1,x=null,y=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(f=A.viewState.pageVisible,n=A.viewState.mathEnabled,x=A.viewState.background,y=A.viewState.backgroundImage,l.extFonts=A.viewState.extFonts);l.background=x;l.backgroundImage=null!=y?new mxImage(y.src, -y.width,y.height):null;l.pageVisible=f;l.mathEnabled=n;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?A.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(A);l.model.setRoot(A.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document, +this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;var p=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:p.className="geDisableMathJax";return p}}q=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(q=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,k,!0);null!=q&&(e.stylesheet=q,e.refresh())}else{v=d.background;if(null==v||""==v||v==mxConstants.NONE)v="#ffffff";b.backgroundColor= +v;b.autoOrigin=A;b.appendGraph(d,z,q,m,k,!0);k=d.getCustomFonts();if(null!=b.wnd)for(q=0;q'):(b.wnd.document.writeln('"))}l&&(d.useCssTransforms= +l,d.currentTranslate=f,d.currentScale=p,d.view.translate=g,d.view.scale=u);return b}var c=parseInt(M.value)/100;isNaN(c)&&(c=1,M.value="100 %");var c=.75*c,k=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var l=q.value,f=m.value,g=!u.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(a,u.checked,l,f,B.checked,F.value,K.value,parseInt(n.value)/100,parseInt(M.value)/100,J.get());else{g&&(g=l==p&&f==p);if(!g&&null!= +a.pages&&a.pages.length){var v=0,g=a.pages.length-1;u.checked||(v=parseInt(l)-1,g=parseInt(f)-1);for(var z=v;z<=g;z++){var A=a.pages[z],l=A==a.currentPage?e:null;if(null==l){var l=a.createTemporaryGraph(e.stylesheet),f=!0,v=!1,x=null,y=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(f=A.viewState.pageVisible,v=A.viewState.mathEnabled,x=A.viewState.background,y=A.viewState.backgroundImage,l.extFonts=A.viewState.extFonts);l.background=x;l.backgroundImage=null!=y?new mxImage(y.src, +y.width,y.height):null;l.pageVisible=f;l.mathEnabled=v;var D=l.getGlobalVariable;l.getGlobalVariable=function(d){return"page"==d?A.getName():"pagenumber"==d?z+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(l.container);a.updatePageRoot(A);l.model.setRoot(A.root)}t=b(l,t,z!=g);l!=e&&l.container.parentNode.removeChild(l.container)}}else t=b(e);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(g=t.wnd.document, d&&(t.wnd.IMMEDIATE_PRINT=!0),g.writeln('