CoreFiles by mySites.guru
client.min.js1 lines, 8,995 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
c6bb4d210af32bc213c17e4a416f25ea
sha1
208cf01613c5238cd1eff6c3edd3066a7f609d2c
sha256
4da52c50d8775cbb8f8253d16e8648ea42d7efe60591b60867555c2213dc641a
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:"",version:"current",list:0,options:c.getOptions("plg_installer_webinstaller",{})},f=function(){function d(){_classCallCheck(this,d)}return _createClass(d,[{key:"initialise",value:function initialise(){var a=this;e.loaded=1;var c=b.getElementById("uploadform-web-cancel");c.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?a.submitButtonUrl():a.submitButtonWeb()}),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),j=b.getElementById("com-apps-ordering"),k=b.getElementById("com-apps-filter-joomla-version");return""!==e.ordering&&j&&j.value&&(e.ordering=j.value,i+="&ordering=".concat(e.ordering)),""!==e.version&&k&&k.value&&(e.version=k.value,i+="&filter_version=".concat(e.version)),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"),j=b.getElementById("com-apps-filter-joomla-version");i&&i.addEventListener("change",function(){var a=i.selectedIndex;e.ordering=i.options[a].value,g.installfromwebajaxsubmit()}),j&&j.addEventListener("change",function(){var a=j.selectedIndex;e.version=j.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.Text._("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 f=encodeURI(b.getElementById("com-apps-searchbox").value.toLowerCase().replace(/ +/g,"_").replace(/[^a-z0-9-_]/g,"").trim());a+="&filter_search=".concat(f)}var c=b.getElementById("com-apps-ordering"),d=b.getElementById("com-apps-filter-joomla-version");""!==e.ordering&&c&&c.value&&(e.ordering=c.value),e.ordering&&(a+="&ordering=".concat(e.ordering)),""!==e.version&&d&&d.value&&(e.version=d.value),e.version&&(a+="&filter_version=".concat(e.version)),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:"submitButtonUrl",value:function submitButtonUrl(){var a=b.getElementById("adminForm");if(""===a.install_url.value||"http://"===a.install_url.value||"https://"===a.install_url.value)c.renderMessages({warning:[c.Text._("COM_INSTALLER_MSG_INSTALL_ENTER_A_URL")]});else{var d=b.getElementById("loading");d&&d.classList.remove("hidden"),a.installtype.value="url",a.submit()}}},{key:"submitButtonWeb",value:function submitButtonWeb(){var a=b.getElementById("adminForm");""!==a.install_url.value||"http://"!==a.install_url.value||"https://"!==a.install_url.value?this.submitButtonUrl():""===a.install_url.value?c.renderMessages({warning:[c.apps.options.btntxt]}):(b.querySelector("#appsloading").classList.remove("hidden"),a.installtype.value="web",a.submit())}}],[{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.Text._("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 4 releases, Joomla 4.0.0-beta4 to 4.0.0-beta7. See them all, or every version of this file.