[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

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

   1  Joomla=window.Joomla||{},((e,t)=>{e.submitbuttonUpload=()=>{const 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=()=>{const a=t.getElementById("uploadForm"),n=a.install_package.files[0].size,i=1*n/1024/1024,l=t.getElementById("file_size"),s=t.getElementById("max_upload_size_warn");""===a.install_package.value?(l.classList.add("hidden"),s.classList.add("hidden")):n&&(l.classList.remove("hidden"),l.innerHTML=e.sanitizeHtml(e.Text._("JGLOBAL_SELECTED_UPLOAD_FILE_SIZE").replace("%s",`$i.toFixed(2)} MB`)),n>a.max_upload_size.value?s.classList.remove("hidden"):s.classList.add("hidden"))},t.addEventListener("DOMContentLoaded",(()=>{const a=t.getElementById("confirmButton"),n=t.getElementById("uploadForm"),i=t.getElementById("uploadButton"),l=t.getElementById("install_package"),s=t.querySelector(".emptystate-btnadd",t.getElementById("joomlaupdate-wrapper")),o=t.getElementById("joomlaupdate-confirm-backup"),r=s?s.closest("form"):null,c=r?r.querySelector("[name=task]",r):null;i&&(i.addEventListener("click",e.submitbuttonUpload),i.disabled=o&&!o.checked,o&&o.addEventListener("change",(()=>{i.disabled=!o.checked}))),a&&o&&!o.checked&&a.classList.add("disabled"),a&&o&&o.addEventListener("change",(()=>{o.checked?a.classList.remove("disabled"):a.classList.add("disabled")})),l&&(l.addEventListener("change",e.installpackageChange),o&&l.addEventListener("change",(()=>{const e=n.install_package.files[0].size,t=n.max_upload_size.value;e<=t&&o.disabled?o.disabled=!o.disabled:e<=t&&!o.disabled&&!o.checked?o.disabled=!1:e<=t&&o.checked?(o.checked=o.classList.contains("d-none"),i.disabled=!0):e>t&&!o.disabled&&(o.disabled=!o.disabled,o.checked=o.classList.contains("d-none"),i.disabled=!0)}))),s&&"#"===s.getAttribute("href")&&c&&s.addEventListener("click",(e=>{e.preventDefault(),o&&!o.checked||(c.value="update.download",r.submit())}))}))})(Joomla,document),((e,t)=>{const 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:e=>{const a=t.querySelector("#joomlaupdate-precheck-extensions-tab .fa-spinner");let 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"));const l=t.querySelector("#compatibilityTable0"),s=t.querySelector("#preupdateCheckWarning");l&&l.classList.add("hidden"),s&&s.classList.add("hidden")},run:()=>{a.nonCoreCriticalPlugins=e.getOptions("nonCoreCriticalPlugins",[]);const 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((e=>{e.classList.remove("disabled"),e.removeAttribute("disabled")})),void a.cleanup();const i=()=>{const 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((e=>{e.classList.remove("disabled"),e.removeAttribute("disabled")})):a.checked=!1:[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((e=>{e.classList.add("disabled"),e.setAttribute("disabled","")}))};null!==t.getElementById("noncoreplugins")&&t.getElementById("noncoreplugins").addEventListener("change",i);const l=t.getElementById("joomlaupdate-wrapper");a.joomlaTargetVersion=l.getAttribute("data-joomla-target-version"),a.joomlaCurrentVersion=l.getAttribute("data-joomla-current-version"),[].slice.call(t.querySelectorAll(".compatibilitytoggle")).forEach((t=>{t.addEventListener("click",(()=>{const 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((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((e=>{e.classList.add("hidden")})))}))}));const s=[];[].slice.call(n).forEach((e=>{const t={eid:e.getAttribute("data-extension-id"),version:e.getAttribute("data-extension-current-version")};s.push(t)})),a.checkNextChunk(s)},interpolateParameters:(e,t)=>{let n="";return"object"==typeof e&&null!==e&&e?(Object.keys(e).forEach((i=>{const l=e[i];if(n.length>0&&(n+="&"),"object"!=typeof l)n+=""!==t?`$encodeURIComponent(t)}[$encodeURIComponent(i)}]=$encodeURIComponent(l)}`:`$encodeURIComponent(i)}=$encodeURIComponent(l)}`;else{const e=t.length?`$t}[$i}]`:i;n+=a.interpolateParameters(l,e)}})),n):""},checkNextChunk: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(n){const i=JSON.parse(n);i.messages&&e.renderMessages(i.messages);const l=i.data.extensions||[];i.data.compatibility.forEach((e=>{const n=t.getElementById(`preUpdateCheck_$e.id}`);n&&a.setResultView({element:n,compatibleVersion:0,serverError:0,compatibilityData:e})})),a.checkNextChunk(l)},onError(i){e.renderMessages(e.ajaxErrorsMessages(i)),n.forEach((e=>{const n=t.getElementById(`preUpdateCheck_$e.eid}`);n&&a.setResultView({element:n,compatibleVersion:0,serverError:1})}))}})},checkCompatibility:t=>{const 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(e){const t=JSON.parse(e);n.serverError=0,n.compatibilityData=t.data,a.setResultView(n)},onError(){n.serverError=1,a.setResultView(n)}})},setResultView:n=>{let 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")}const l=n.element.getAttribute("data-extension-id");t.getElementById(`available-version-$l}`).innerText=i;const s=t.querySelector(`#compatibilityTable$n.compatibilityData.resultGroup} tbody`);if(s&&s.appendChild(n.element.closest("tr")),t.getElementById(`compatibilityTable$n.compatibilityData.resultGroup}`).classList.remove("hidden"),3===n.compatibilityData.resultGroup&&(a.nonCoreCriticalPlugins=a.nonCoreCriticalPlugins.filter((e=>!(e.package_id.toString()===l||e.extension_id.toString()===l)))),!t.querySelector("#compatibilityTable0 tbody td")){t.getElementById("compatibilityTable0").classList.add("hidden");let n="success";a.nonCoreCriticalPlugins.forEach((a=>{let i=t.querySelector(`td[data-extension-id="$a.extension_id}"]`);if(i||(i=t.querySelector(`td[data-extension-id="$a.package_id}"]`)),i){const t=i.closest("tr");t.classList.add("error");const a=t.querySelector(".exname");a.innerHTML=`$e.sanitizeHtml(a.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>`;const l=a.querySelector(".hasPopover");l&&(l.style.cursor="pointer",new bootstrap.Popover(l,{placement:"top",html:!0,trigger:"focus"})),n="danger"}})),t.querySelector("#compatibilityTable2 tbody td")?n="danger":"danger"!==n&&t.querySelector("#compatibilityTable1 tbody td")&&(n="warning"),0===a.nonCoreCriticalPlugins.length&&"success"===n?(t.getElementById("preupdatecheckbox").style.display="none",t.getElementById("noncoreplugins").checked=!0,[].slice.call(t.querySelectorAll("button.submitupdate")).forEach((e=>{e.classList.remove("disabled"),e.removeAttribute("disabled")}))):a.nonCoreCriticalPlugins.length>0&&t.getElementById("preupdateCheckCompleteProblems").classList.remove("hidden"),a.cleanup(n)}}};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