[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/com_joomlaupdate/js/ -> default-es5.min.js (source)

   1  !function(){"use strict";Joomla=window.Joomla||{},function(e,t){e.submitbuttonUpload=function(){var a=t.getElementById("uploadForm"),n=t.getElementById("joomlaupdate-confirm-backup");""===a.install_package.value?alert(e.Text._("COM_INSTALLER_MSG_INSTALL_PLEASE_SELECT_A_PACKAGE"),!0):a.install_package.files[0].size>a.max_upload_size.value?alert(e.Text._("COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG"),!0):n&&n.checked&&a.submit()},e.installpackageChange=function(){var a=t.getElementById("uploadForm"),n=a.install_package.files[0].size,i=1*n/1024/1024,o=t.getElementById("file_size"),l=t.getElementById("max_upload_size_warn");""===a.install_package.value?(o.classList.add("hidden"),l.classList.add("hidden")):n&&(o.classList.remove("hidden"),o.innerHTML=e.sanitizeHtml(e.Text._("JGLOBAL_SELECTED_UPLOAD_FILE_SIZE").replace("%s",i.toFixed(2)+" MB")),n>a.max_upload_size.value?l.classList.remove("hidden"):l.classList.add("hidden"))},t.addEventListener("DOMContentLoaded",(function(){var a=t.getElementById("confirmButton"),n=t.getElementById("uploadForm"),i=t.getElementById("uploadButton"),o=t.getElementById("install_package"),l=t.querySelector(".emptystate-btnadd",t.getElementById("joomlaupdate-wrapper")),r=t.getElementById("joomlaupdate-confirm-backup"),s=l?l.closest("form"):null,c=s?s.querySelector("[name=task]",s):null;i&&(i.addEventListener("click",e.submitbuttonUpload),i.disabled=r&&!r.checked,r&&r.addEventListener("change",(function(){i.disabled=!r.checked}))),a&&r&&!r.checked&&a.classList.add("disabled"),a&&r&&r.addEventListener("change",(function(){r.checked?a.classList.remove("disabled"):a.classList.add("disabled")})),o&&(o.addEventListener("change",e.installpackageChange),r&&o.addEventListener("change",(function(){var e=n.install_package.files[0].size,t=n.max_upload_size.value;e<=t&&r.disabled?r.disabled=!r.disabled:e<=t&&!r.disabled&&!r.checked?r.disabled=!1:e<=t&&r.checked?(r.checked=r.classList.contains("d-none"),i.disabled=!0):e>t&&!r.disabled&&(r.disabled=!r.disabled,r.checked=r.classList.contains("d-none"),i.disabled=!0)}))),l&&"#"===l.getAttribute("href")&&c&&l.addEventListener("click",(function(e){e.preventDefault(),r&&!r.checked||(c.value="update.download",s.submit())}))}))}(Joomla,document),function(e,t){var a={config:{serverUrl:"index.php?option=com_joomlaupdate&task=update.fetchextensioncompatibility",batchUrl:"index.php?option=com_joomlaupdate&task=update.batchextensioncompatibility",selector:".extension-check"},STATE:{INCOMPATIBLE:0,COMPATIBLE:1,MISSING_COMPATIBILITY_TAG:2,SERVER_ERROR:3},cleanup:function(e){var a=t.querySelector("#joomlaupdate-precheck-extensions-tab .fa-spinner"),n="success",i="check";switch(e){case"danger":n="danger",i="times";break;case"warning":n="warning",i="exclamation-triangle"}a&&(a.classList.remove("fa-spinner","fa-spin"),a.classList.add("fa-"+i,"text-"+n,"bg-white"));var o=t.querySelector("#compatibilityTable0"),l=t.querySelector("#preupdateCheckWarning");o&&o.classList.add("hidden"),l&&l.classList.add("hidden")},run:function(){a.nonCoreCriticalPlugins=e.getOptions("nonCoreCriticalPlugins",[]);var n=t.querySelectorAll(a.config.selector);if(0===n.length)return null!==t.getElementById("preupdatecheckbox")&&(t.getElementById("preupdatecheckbox").style.display="none"),null!==t.getElementById("noncoreplugins")&&(t.getElementById("noncoreplugins").checked=!0),[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((function(e){e.classList.remove("disabled"),e.removeAttribute("disabled")})),void a.cleanup();null!==t.getElementById("noncoreplugins")&&t.getElementById("noncoreplugins").addEventListener("change",(function(){var a=t.getElementById("noncoreplugins");a.checked?window.confirm(e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE"))?[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((function(e){e.classList.remove("disabled"),e.removeAttribute("disabled")})):a.checked=!1:[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((function(e){e.classList.add("disabled"),e.setAttribute("disabled","")}))}));var i=t.getElementById("joomlaupdate-wrapper");a.joomlaTargetVersion=i.getAttribute("data-joomla-target-version"),a.joomlaCurrentVersion=i.getAttribute("data-joomla-current-version"),[].slice.call(t.querySelectorAll(".compatibilitytoggle")).forEach((function(t){t.addEventListener("click",(function(){var a=t.closest(".compatibilityTable");"closed"===t.dataset.state?(t.dataset.state="open",t.innerHTML=e.sanitizeHtml(e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_SHOW_LESS_COMPATIBILITY_INFORMATION")),[].slice.call(a.querySelectorAll("table .hidden")).forEach((function(e){e.classList.remove("hidden")}))):(t.dataset.state="closed",t.innerHTML=e.sanitizeHtml(e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_SHOW_MORE_COMPATIBILITY_INFORMATION")),[].slice.call(a.querySelectorAll("table .instver, table .upcomp, table .currcomp")).forEach((function(e){e.classList.add("hidden")})))}))}));var o=[];[].slice.call(n).forEach((function(e){var t={eid:e.getAttribute("data-extension-id"),version:e.getAttribute("data-extension-current-version")};o.push(t)})),a.checkNextChunk(o)},interpolateParameters:function(e,t){var n="";return"object"==typeof e&&null!==e&&e?(Object.keys(e).forEach((function(i){var o=e[i];if(n.length>0&&(n+="&"),"object"!=typeof o)n+=""!==t?encodeURIComponent(t)+"["+encodeURIComponent(i)+"]="+encodeURIComponent(o):encodeURIComponent(i)+"="+encodeURIComponent(o);else{var l=t.length?t+"["+i+"]":i;n+=a.interpolateParameters(o,l)}})),n):""},checkNextChunk:function(n){0!==n.length&&e.request({url:a.config.batchUrl,method:"POST",data:a.interpolateParameters({"joomla-target-version":a.joomlaTargetVersion,"joomla-current-version":a.joomlaCurrentVersion,extensions:n},""),onSuccess:function(n){var i=JSON.parse(n);i.messages&&e.renderMessages(i.messages);var o=i.data.extensions||[];i.data.compatibility.forEach((function(e){var n=t.getElementById("preUpdateCheck_"+e.id);n&&a.setResultView({element:n,compatibleVersion:0,serverError:0,compatibilityData:e})})),a.checkNextChunk(o)},onError:function(i){e.renderMessages(e.ajaxErrorsMessages(i)),n.forEach((function(e){var n=t.getElementById("preUpdateCheck_"+e.eid);n&&a.setResultView({element:n,compatibleVersion:0,serverError:1})}))}})},checkCompatibility:function(t){var n={element:t,compatibleVersion:0,serverError:1};e.request({url:a.config.serverUrl+"&joomla-target-version="+encodeURIComponent(a.joomlaTargetVersion)+"&joomla-current-version="+a.joomlaCurrentVersion+"&extension-version="+t.getAttribute("data-extension-current-version")+"&extension-id="+encodeURIComponent(t.getAttribute("data-extension-id")),onSuccess:function(e){var t=JSON.parse(e);n.serverError=0,n.compatibilityData=t.data,a.setResultView(n)},onError:function(){n.serverError=1,a.setResultView(n)}})},setResultView:function(n){var i="";if(n.serverError)i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR"),n.compatibilityData={resultGroup:4};else switch(n.compatibilityData.upgradeCompatibilityStatus.state){case a.STATE.COMPATIBLE:if(n.compatibilityData.upgradeWarning)i='<span class="label label-warning">'+e.sanitizeHtml(n.compatibilityData.upgradeCompatibilityStatus.compatibleVersion)+"</span>";else i=!1===n.compatibilityData.upgradeCompatibilityStatus.compatibleVersion?e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION"):e.sanitizeHtml(n.compatibilityData.upgradeCompatibilityStatus.compatibleVersion);break;case a.STATE.INCOMPATIBLE:case a.STATE.MISSING_COMPATIBILITY_TAG:i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION");break;default:i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN")}if(n.element.innerHTML=i,i="",n.serverError)i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR");else switch(n.compatibilityData.currentCompatibilityStatus.state){case a.STATE.COMPATIBLE:i=!1===n.compatibilityData.currentCompatibilityStatus.compatibleVersion?e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION"):n.compatibilityData.currentCompatibilityStatus.compatibleVersion;break;case a.STATE.INCOMPATIBLE:case a.STATE.MISSING_COMPATIBILITY_TAG:i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION");break;default:i=e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN")}var o=n.element.getAttribute("data-extension-id");t.getElementById("available-version-"+o).innerText=i;var l=t.querySelector("#compatibilityTable"+n.compatibilityData.resultGroup+" tbody");if(l&&l.appendChild(n.element.closest("tr")),t.getElementById("compatibilityTable"+n.compatibilityData.resultGroup).classList.remove("hidden"),3===n.compatibilityData.resultGroup&&(a.nonCoreCriticalPlugins=a.nonCoreCriticalPlugins.filter((function(e){return!(e.package_id.toString()===o||e.extension_id.toString()===o)}))),!t.querySelector("#compatibilityTable0 tbody td")){t.getElementById("compatibilityTable0").classList.add("hidden");var r="success";a.nonCoreCriticalPlugins.forEach((function(a){var n=t.querySelector('td[data-extension-id="'+a.extension_id+'"]');if(n||(n=t.querySelector('td[data-extension-id="'+a.package_id+'"]')),n){var i=n.closest("tr");i.classList.add("error");var o=i.querySelector(".exname");o.innerHTML=e.sanitizeHtml(o.innerHTML)+'\n              <div class="small">\n              <span class="badge bg-warning">\n              <span class="icon-warning"></span>\n              '+e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN")+'\n              </span>\n\n              <button type="button" class="btn btn-sm btn-link hasPopover"\n              title="'+e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN")+' "\n              data-bs-content="'+e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_DESC")+' "\n              >\n              '+e.Text._("COM_JOOMLAUPDATE_VIEW_DEFAULT_HELP")+"\n              </button>\n              </div>";var l=o.querySelector(".hasPopover");l&&(l.style.cursor="pointer",new bootstrap.Popover(l,{placement:"top",html:!0,trigger:"focus"})),r="danger"}})),t.querySelector("#compatibilityTable2 tbody td")?r="danger":"danger"!==r&&t.querySelector("#compatibilityTable1 tbody td")&&(r="warning"),0===a.nonCoreCriticalPlugins.length&&"success"===r?(t.getElementById("preupdatecheckbox").style.display="none",t.getElementById("noncoreplugins").checked=!0,[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((function(e){e.classList.remove("disabled"),e.removeAttribute("disabled")}))):a.nonCoreCriticalPlugins.length>0&&t.getElementById("preupdateCheckCompleteProblems").classList.remove("hidden"),a.cleanup(r)}}};null!==t.getElementById("preupdatecheck")&&t.addEventListener("DOMContentLoaded",a.run,!1)}(Joomla,document)}();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer