UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

131 lines (114 loc) 4.59 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Ext.define(&#39;Siesta.Project.Browser.UI.VersionUpdateButton&#39;, { extend : &#39;Ext.Button&#39;, xtype : &#39;versionupdatebutton&#39;, text : Siesta.Resource(&#39;Siesta.Project.Browser.UI.VersionUpdateButton&#39;, &#39;newUpdateText&#39;), action : &#39;upgrade-siesta&#39;, hidden : true, latestVersion : null, scale : &#39;medium&#39;, constructor : function () { this.callParent(arguments); this.scope = this; if (Siesta.meta.VERSION) { this.fetchVersionInfo(); } }, fetchVersionInfo : function () { Ext.data.JsonP.request({ url : &#39;https://bryntum.com/siesta_version&#39;, params : { v : Siesta.meta.VERSION }, scope : this, callback : this.onRequestCompleted }); }, onRequestCompleted : function (success, data) { if (success &amp;&amp; data &amp;&amp; data.name &amp;&amp; new Ext.Version(data.name).isGreaterThan(Siesta.meta.VERSION || &#39;1.0.0&#39;)) { this.latestVersion = data.name; this.show(); } }, handler : function () { var me = this; var R = Siesta.Resource(&#39;Siesta.Project.Browser.UI.VersionUpdateButton&#39;); var win = new Ext.Window({ cls : &#39;changelog-window&#39;, title : R.get(&#39;updateWindowTitleText&#39;) + (Siesta.meta.VERSION || &#39;1.0.0&#39;), modal : true, width : 500, height : 380, closeAction : &#39;destroy&#39;, plain : true, autoScroll : true, buttons : { padding : &#39;10 13&#39;, style : &#39;background: transparent&#39;, items : [ { cls : &#39;light-button&#39;, href : &#39;https://www.npmjs.com/package/siesta-lite&#39;, hrefTarget : &#39;_blank&#39;, scale : &#39;medium&#39;, text : R.get(&#39;downloadText&#39;) + this.latestVersion + R.get(&#39;liteText&#39;) }, { cls : &#39;light-button&#39;, href : &#39;https://customerzone.bryntum.com&#39;, hrefTarget : &#39;_blank&#39;, scale : &#39;medium&#39;, text : R.get(&#39;downloadText&#39;) + this.latestVersion + R.get(&#39;standardText&#39;) }, { text : R.get(&#39;cancelText&#39;), scale : &#39;medium&#39;, handler : function () { win.close(); } } ] } }) win.show(); win.body.mask(R.get(&#39;loadingChangelogText&#39;)); Ext.Ajax.request({ useDefaultXhrHeader : false, url : &#39;https://bryntum.com/changelogs/_siesta.php&#39;, callback : function (o, success, response) { win.body.unmask(); if (success &amp;&amp; response &amp;&amp; response.responseText) { win.update(response.responseText); } else { win.update(Siesta.Resource(&#39;Siesta.Project.Browser.UI.VersionUpdateButton&#39;, &#39;changelogLoadFailedText&#39;)); } } }) } }); </pre> </body> </html>