CoreFiles by mySites.guru
client.min.js1 lines, 7,784 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
014243d3314e683c4850ebf6438af4ef
sha1
64b128f49cdf1100c447ef37c93d52de9893b662
sha256
e3df1a7852eb6a579e2a6f7bac0198e1a6f7c1504ebd5f4b225db30b1db22c38
function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}if(!Joomla)throw new Error("Joomla API is not properly initialised");(function(a,b,c){'use strict';var d,e={view:"dashboard",id:0,ordering:"",list:0,options:c.getOptions("plg_installer_webinstaller",{})},f=function(){function d(){_classCallCheck(this,d)}return _createClass(d,[{key:"initialise",value:function initialise(){e.loaded=1;var a=b.getElementById("uploadform-web-cancel");a.addEventListener("click",function(){b.getElementById("uploadform-web").classList.add("hidden"),e.list&&b.querySelector(".list-view")&&b.querySelector(".list-view").click()});var d=b.getElementById("uploadform-web-install");d.addEventListener("click",function(){4===e.options.installFrom?c.submitbutton4():c.submitbutton5()}),this.loadweb("".concat(e.options.base_url,"index.php?format=json&option=com_apps&view=dashboard")),this.clickforlinks()}},{key:"loadweb",value:function loadweb(f){var g=this;if(!f)return!1;var h=new RegExp(e.options.base_url);if(!(h.test(f)||/^index.php/.test(f)))return a.open(f,"_blank"),!1;var i="".concat(f,"&product=").concat(e.options.product,"&release=").concat(e.options.release,"&dev_level=").concat(e.options.dev_level,"&list=").concat(e.list?"list":"grid","&lang=").concat(e.options.language);return""!==e.ordering&&b.getElementById("com-apps-ordering").value&&(e.ordering=b.getElementById("com-apps-ordering").value,i+="&ordering=".concat(e.ordering)),d.showLoadingLayer(),new Promise(function(a,f){c.request({url:i,onSuccess:function onSuccess(c){var f;try{f=JSON.parse(c)}catch(a){throw new Error("Failed to parse JSON")}b.getElementById("web-loader")&&b.getElementById("web-loader").classList.add("hidden");var h=b.getElementById("jed-container");h.innerHTML=f.data.html,b.getElementById("com-apps-searchbox").addEventListener("keypress",function(a){var b=a.which;13===b&&g.initiateSearch()}),b.getElementById("search-extensions").addEventListener("click",function(){g.initiateSearch()}),b.getElementById("search-reset").addEventListener("click",function(){var a=b.getElementById("com-apps-searchbox");a.value="",g.initiateSearch()});var i=b.getElementById("com-apps-ordering");i&&i.addEventListener("change",function(){var a=i.selectedIndex;e.ordering=i.options[a].value,g.installfromwebajaxsubmit()}),""!==e.options.installfrom_url&&d.installfromweb(e.options.installfrom_url),a()},onError:function onError(a){var c=b.getElementById("web-loader-error"),d=b.getElementById("web-loader");a.responseText&&c&&(c.innerHTML=a.responseText),d&&(d.classList.add("hidden"),c.classList.remove("hidden")),f()}})}).finally(function(){var f=b.getElementById("joomlaapsinstallatinput");if(f&&(f.value=e.options.installat_url),g.clickforlinks(),d.clicker(),"extension"!==e.view&&[].slice.call(b.querySelectorAll("div.load-extension")).forEach(function(a){a.addEventListener("click",function(b){b.preventDefault(),g.processLinkClick(a.getAttribute("data-url"))}),a.setAttribute("href","#")}),"extension"===e.view){var h=b.getElementById("install-extension"),i=b.getElementById("install-extension-from-external");h&&h.addEventListener("click",function(){d.installfromweb(h.getAttribute("data-downloadurl"),h.getAttribute("data-name")),b.getElementById("uploadform-web-install").scrollIntoView({behavior:"smooth",block:"start"})}),i&&i.addEventListener("click",function(){var d=i.getAttribute("data-downloadurl"),e=a.confirm(c.JText._("PLG_INSTALLER_WEBINSTALLER_REDIRECT_TO_EXTERNAL_SITE_TO_INSTALL").replace("[SITEURL]",d));!0!==e||(b.getElementById("adminForm").setAttribute("action",d),b.querySelector("input[name=task]").setAttribute("disabled",!0),b.querySelector("input[name=install_directory]").setAttribute("disabled",!0),b.querySelector("input[name=install_url]").setAttribute("disabled",!0),b.querySelector("input[name=installtype]").setAttribute("disabled",!0),b.querySelector("input[name=filter_search]").setAttribute("disabled",!0),b.getElementById("adminForm").submit())})}e.list&&b.querySelector(".list-view")&&b.querySelector(".list-view").click(),d.hideLoadingLayer()}),!0}},{key:"clickforlinks",value:function clickforlinks(){var a=this;[].slice.call(b.querySelectorAll("a.transcode")).forEach(function(b){var c=b.getAttribute("href");b.addEventListener("click",function(b){b.preventDefault(),a.processLinkClick(c)}),b.setAttribute("href","#")})}},{key:"initiateSearch",value:function initiateSearch(){e.view="dashboard",this.installfromwebajaxsubmit()}},{key:"installfromwebajaxsubmit",value:function installfromwebajaxsubmit(){var a="&view=".concat(e.view);if(e.id&&(a+="&id=".concat(e.id)),b.getElementById("com-apps-searchbox").value){var c=encodeURI(b.getElementById("com-apps-searchbox").value.toLowerCase().replace(/ +/g,"_").replace(/[^a-z0-9-_]/g,"").trim());a+="&filter_search=".concat(c)}""!==e.ordering&&b.getElementById("com-apps-ordering").value&&(e.ordering=b.getElementById("com-apps-ordering").value),e.ordering&&(a+="&ordering=".concat(e.ordering)),this.loadweb("".concat(e.options.base_url,"index.php?format=json&option=com_apps").concat(a))}},{key:"processLinkClick",value:function processLinkClick(a){var b=new RegExp(e.options.base_url);b.test(a)||/^index.php/.test(a)?(e.view=a.replace(/^.+[&?]view=(\w+).*$/,"$1"),"dashboard"===e.view?e.id=0:"category"===e.view&&(e.id=a.replace(/^.+[&?]id=(\d+).*$/,"$1")),this.loadweb(e.options.base_url+a)):this.loadweb(a)}}],[{key:"showLoadingLayer",value:function showLoadingLayer(){b.getElementById("web").appendChild(b.createElement("joomla-core-loader"))}},{key:"hideLoadingLayer",value:function hideLoadingLayer(){var a=b.querySelector("#web joomla-core-loader");a.parentNode.removeChild(a)}},{key:"clicker",value:function clicker(){b.querySelector(".grid-view")&&b.querySelector(".grid-view").addEventListener("click",function(){e.list=0,b.querySelector(".list-container").classList.add("hidden"),b.querySelector(".grid-container").classList.remove("hidden"),b.getElementById("btn-list-view").classList.remove("active"),b.getElementById("btn-grid-view").classList.remove("active")}),b.querySelector(".list-view")&&b.querySelector(".list-view").addEventListener("click",function(){e.list=1,b.querySelector(".grid-container").classList.add("hidden"),b.querySelector(".list-container").classList.remove("hidden"),b.getElementById("btn-grid-view").classList.remove("active"),b.getElementById("btn-list-view").classList.add("active")})}},{key:"installfromweb",value:function installfromweb(a){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return a?(b.getElementById("install_url").value=a,b.getElementById("uploadform-web-url").innerText=a,d?(b.getElementById("uploadform-web-name").innerText=d,b.getElementById("uploadform-web-name-label").classList.remove("hidden")):b.getElementById("uploadform-web-name-label").classList.add("hidden"),b.getElementById("uploadform-web").classList.remove("hidden"),!0):(c.renderMessages({warning:[c.JText._("PLG_INSTALLER_WEBINSTALLER_CANNOT_INSTALL_EXTENSION_IN_PLUGIN")]}),!1)}}]),d}();b.addEventListener("DOMContentLoaded",function(){var c=function(){var g=b.getElementById("myTab");if("UL"!==g.firstElementChild.tagName)return void a.setTimeout(c,50);var h=g.querySelector("#tab-web");h&&(e.options.installfromon&&h.click(),h.hasAttribute("active")&&!d&&(d=new f,d.initialise()),""!==e.options.installfrom_url&&h.click(),h.addEventListener("joomla.tab.shown",function(){d||(d=new f,d.initialise())}))};a.setTimeout(c,50)})})(window,document,Joomla);

The same content is in 2 releases, Joomla 4.0.0-beta to 4.0.0-beta2. See them all, or every version of this file.