CoreFiles by mySites.guru
client.min.js1 lines, 7,724 bytes, from Joomla_4.0.0-alpha10-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha9
md5
2c961cfcc0068a510433fb133c40aa9e
sha1
90bedffaefdf554bccce13d9428ddafcb4dc9000
sha256
828ad972f13076a6661297a370227954533e6f79c05c52bf3ff121dc7b34d6b6
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(!window.jQuery)throw new Error("WebInstaller plugin requires jQuery");if(!Joomla)throw new Error("Joomla API is not properly initialised");(function(a,b,c,d){'use strict';var e,f={view:"dashboard",id:0,ordering:"",list:0,options:c.getOptions("plg_installer_webinstaller",{})},g=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"initialise",value:function initialise(){f.loaded=1,c.loadingLayer("load",b.getElementById("web"));var a=b.getElementById("uploadform-web-cancel");a.addEventListener("click",function(){b.getElementById("uploadform-web").classList.add("hidden"),f.list&&b.querySelector(".list-view")&&b.querySelector(".list-view").click()}),this.loadweb("".concat(f.options.base_url,"index.php?format=json&option=com_apps&view=dashboard")),this.clickforlinks()}},{key:"loadweb",value:function loadweb(g){var h=this;if(!g)return!1;var i=new RegExp(f.options.base_url),j=/^index.php/;if(!(i.test(g)||j.test(g)))return a.open(g,"_blank"),!1;var k="".concat(g,"&product=").concat(f.options.product,"&release=").concat(f.options.release,"&dev_level=").concat(f.options.dev_level,"&list=").concat(f.list?"list":"grid","&lang=").concat(f.options.language);return""!==f.ordering&&b.getElementById("com-apps-ordering").value&&(f.ordering=b.getElementById("com-apps-ordering").value,k+="&ordering=".concat(f.ordering)),e.showLoadingLayer(),d.ajax({url:k,dataType:"json",cache:!0,timeout:2e4,success:function success(a){b.getElementById("web-loader")&&b.getElementById("web-loader").classList.add("hidden");var c=b.getElementById("jed-container");c.innerHTML=a.data.html,b.getElementById("com-apps-searchbox").addEventListener("keypress",function(a){13===a.which&&h.initiateSearch()}),b.getElementById("search-extensions").addEventListener("click",function(){h.initiateSearch()}),b.getElementById("search-reset").addEventListener("click",function(){var a=b.getElementById("com-apps-searchbox");a.value="",h.initiateSearch()});var d=b.getElementById("com-apps-ordering");d&&d.addEventListener("change",function(){var a=d.selectedIndex;f.ordering=d.options[a].value,h.installfromwebajaxsubmit()}),""!==f.options.installfrom_url&&e.installfromweb(f.options.installfrom_url)},fail:function fail(){b.getElementById("web-loader")&&(b.getElementById("web-loader").classList.add("hidden"),b.getElementById("web-loader-error").classList.remove("hidden"))},complete:function complete(){var d=b.getElementById("joomlaapsinstallatinput");if(d&&(d.value=f.options.installat_url),h.clickforlinks(),e.clicker(),"extension"!==f.view&&[].slice.call(b.querySelectorAll("div.load-extension")).forEach(function(a){a.addEventListener("click",function(b){b.preventDefault(),h.processLinkClick(a.getAttribute("data-url"))}),a.setAttribute("href","#")}),"extension"===f.view){var g=b.getElementById("install-extension"),i=b.getElementById("install-extension-from-external");g&&g.addEventListener("click",function(){e.installfromweb(g.getAttribute("data-downloadurl"),g.getAttribute("data-name"))}),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())})}f.list&&b.querySelector(".list-view")&&b.querySelector(".list-view").click(),e.hideLoadingLayer()},error:function error(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"))}}),!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(){f.view="dashboard",this.installfromwebajaxsubmit()}},{key:"installfromwebajaxsubmit",value:function installfromwebajaxsubmit(){var a="&view=".concat(f.view);if(f.id&&(a+="&id=".concat(f.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)}""!==f.ordering&&b.getElementById("com-apps-ordering").value&&(f.ordering=b.getElementById("com-apps-ordering").value),f.ordering&&(a+="&ordering=".concat(f.ordering)),this.loadweb("".concat(f.options.base_url,"index.php?format=json&option=com_apps").concat(a))}},{key:"processLinkClick",value:function processLinkClick(a){var b=new RegExp(f.options.base_url),c=/^index.php/;b.test(a)||c.test(a)?(f.view=a.replace(/^.+[&?]view=(\w+).*$/,"$1"),"dashboard"===f.view?f.id=0:"category"===f.view&&(f.id=a.replace(/^.+[&?]id=(\d+).*$/,"$1")),this.loadweb(f.options.base_url+a)):this.loadweb(a)}}],[{key:"showLoadingLayer",value:function showLoadingLayer(){c.loadingLayer("show",b.getElementById("web"))}},{key:"hideLoadingLayer",value:function hideLoadingLayer(){c.loadingLayer("hide",b.getElementById("web"))}},{key:"clicker",value:function clicker(){b.querySelector(".grid-view")&&b.querySelector(".grid-view").addEventListener("click",function(){f.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(){f.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;if(!a)return alert(c.JText._("PLG_INSTALLER_WEBINSTALLER_CANNOT_INSTALL_EXTENSION_IN_PLUGIN")),!1;var e=b.getElementById("install_url"),f=b.getElementById("uploadform-web-url");if(e.value=a,f.innerHTML=a,d){var g=b.getElementById("uploadform-web-name");g.innerHTML=d,b.getElementById("uploadform-web-name-label").classList.remove("hidden")}else b.getElementById("uploadform-web-name-label").classList.add("hidden");return b.getElementById("uploadform-web").classList.remove("hidden"),!0}}]),e}();b.addEventListener("DOMContentLoaded",function(){var a=function(){var c=b.getElementById("myTab");if("UL"!==c.firstElementChild.tagName)return void setTimeout(a,50);var d=c.querySelector("#tab-web");d&&(f.options.installfromon&&d.click(),d.hasAttribute("active")&&!e&&(e=new g,e.initialise()),""!==f.options.installfrom_url&&d.click(),d.addEventListener("joomla.tab.shown",function(){e||(e=new g,e.initialise())}))};setTimeout(a,50)})})(window,document,Joomla,window.jQuery);

The same content is in 4 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha11. See them all, or every version of this file.