CoreFiles by mySites.guru
installer.min.js1 lines, 4,386 bytes, from Joomla_4.0.0-alpha9-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha8
md5
8d5fa980f130f75f1cba9c98e7b09297
sha1
d9c4416cb87568c5b9ebdbcdeacdc24a34395f28
sha256
fbb2b957abda1aa19adc3420ee860d1c87708222404017ebfe3030cf35682fcc
Joomla=window.Joomla||{},function(a){'use strict';document.addEventListener("DOMContentLoaded",function(){a.submitbuttonpackage=function(){var b=document.getElementById("adminForm");""===b.install_package.value?alert(a.JText._("PLG_INSTALLER_PACKAGEINSTALLER_NO_PACKAGE"),!0):(a.displayLoader(),b.installtype.value="upload",b.submit())},a.submitbuttonfolder=function(){var b=document.getElementById("adminForm");""===b.install_directory.value?alert(a.JText._("PLG_INSTALLER_FOLDERINSTALLER_NO_INSTALL_PATH"),!0):(a.displayLoader(),b.installtype.value="folder",b.submit())},a.submitbuttonurl=function(){var b=document.getElementById("adminForm");""===b.install_url.value||"http://"===b.install_url.value||"https://"===b.install_url.value?alert(a.JText._("PLG_INSTALLER_URLINSTALLER_NO_URL"),!0):(a.displayLoader(),b.installtype.value="url",b.submit())},a.submitbutton4=function(){var b=document.getElementById("adminForm");""===b.install_url.value||"http://"===b.install_url.value||"https://"===b.install_url.value?alert(a.JText._("COM_INSTALLER_MSG_INSTALL_ENTER_A_URL"),!0):(a.displayLoader(),b.installtype.value="url",b.submit())},a.submitbuttonUpload=function(){var b=document.getElementById("uploadForm");""===b.install_package.value?alert(a.JText._("COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE"),!0):(a.displayLoader(),b.submit())},a.displayLoader=function(){var a=document.getElementById("loading");a&&(a.style.display="block")};var b=document.getElementById("loading"),c=document.getElementById("installer-install");b&&c&&(b.style.top=parseInt(c.offsetTop-window.pageYOffset,10),b.style.left=0,b.style.width="100%",b.style.height="100%",b.style.display="none",b.style.marginTop="-10px"),document.getElementById("installbutton_package").addEventListener("click",function(b){b.preventDefault(),a.submitbuttonpackage()})})}(Joomla),document.addEventListener("DOMContentLoaded",function(){function a(a){c.setAttribute("data-state","pending");var b=Joomla.JText._("PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_UNKNOWN");null==a?b=Joomla.JText._("PLG_INSTALLER_PACKAGEINSTALLER_UPLOAD_ERROR_EMPTY"):"string"==typeof a?b=a.replace(/(<([^>]+)>|\s+)/g," "):a.message&&(b=a.message),Joomla.renderMessages({error:[b]})}if("undefined"==typeof FormData)return document.querySelector("#legacy-uploader").style.display="block",void(document.querySelector("#uploader-wrapper").style.display="none");var b=!1,c=document.querySelector("#dragarea"),d=document.querySelector("#install_package"),e=document.querySelector("#select-file-button"),f=document.querySelector("#installer-return").value,g=document.getElementById("upload-progress"),h=g.querySelectorAll(".bar")[0],i=g.querySelectorAll(".uploading-number")[0],j="index.php?option=com_installer&task=install.ajax_upload";f&&(j+="&return=".concat(f)),e.addEventListener("click",function(){d.click()}),d.addEventListener("change",function(){b||Joomla.submitbuttonpackage()}),c.addEventListener("dragenter",function(a){return a.preventDefault(),a.stopPropagation(),c.classList.add("hover"),!1}),c.addEventListener("dragover",function(a){return a.preventDefault(),a.stopPropagation(),c.classList.add("hover"),!1}),c.addEventListener("dragleave",function(a){return a.preventDefault(),a.stopPropagation(),c.classList.remove("hover"),!1}),c.addEventListener("drop",function(d){if(d.preventDefault(),d.stopPropagation(),!b){c.classList.remove("hover");var e=d.target.files||d.dataTransfer.files;if(e.length){var f=e[0],g=new FormData;g.append("install_package",f),g.append("installtype","upload"),c.setAttribute("data-state","uploading"),h.setAttribute("aria-valuenow",0),b=!0,h.style.width=0,i.textContent="0";var k=function(a){if(a.lengthComputable){var b=a.loaded/a.total,d=Math.round(100*b);h.css("width","".concat(d,"%")),h.setAttribute("aria-valuenow",d),i.textContent="".concat(d),100===d&&c.setAttribute("data-state","installing")}};Joomla.request({url:j,method:"POST",perform:!0,data:g,headers:{"Content-Type":"false"},uploadProgressCallback:k,onSuccess:function onSuccess(b){if(!b)return void a(b);var c;try{c=JSON.parse(b)}catch(b){return void a(b)}return c.success||c.data?void(c.data.redirect?window.location.href=c.data.redirect:window.location.href="index.php?option=com_installer&view=install"):void a(c)},onError:function onError(c){if(b=!1,200===c.status){var d=c.responseText||c.responseJSON;a(d)}else a(c.statusText)}})}}})});

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