Sindbad~EG File Manager
define("core_form/submit",["exports","core_form/events"],(function(_exports,_events){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0;
/**
* Submit button JavaScript. All submit buttons will be automatically disabled once the form is
* submitted, unless that submission results in an error/cancelling the submit.
*
* @module core_form/submit
* @copyright 2019 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since 3.8
*/
var cookieListener=0,cookieListeningButtons=[],currentUploadCount=0,uploadListeningButtons=[],uploadListenersRegistered=!1,getCookieName=function(){return"moodledownload_"+M.cfg.sesskey},clearDownloadCookie=function(){document.cookie=encodeURIComponent(getCookieName())+"=deleted; expires="+new Date(0).toUTCString()},checkUploadCount=function(){currentUploadCount?uploadListeningButtons.forEach((function(button){button.disabled=!0})):uploadListeningButtons.forEach((function(button){button.disabled=!1}))};_exports.init=function(elementId){var button=document.getElementById(elementId);null!==button&&(button.disabled||uploadListeningButtons.push(button),uploadListenersRegistered||(document.addEventListener(_events.types.uploadStarted,(function(e){window.console.log(e.target),currentUploadCount++,checkUploadCount()})),document.addEventListener(_events.types.uploadCompleted,(function(e){window.console.log(e.target),currentUploadCount--,checkUploadCount()})),uploadListenersRegistered=!0),"off"!==button.form.dataset.doubleSubmitProtection&&button.form.addEventListener("submit",(function(event){var disableAction=function(){event.defaultPrevented||button.disabled||(button.disabled=!0,clearDownloadCookie(),function(button){cookieListeningButtons.push(button),cookieListener||(cookieListener=setInterval((function(){2==document.cookie.split(getCookieName()+"=").length&&(clearDownloadCookie(),clearInterval(cookieListener),cookieListener=0,cookieListeningButtons.forEach((function(button){button.disabled=!1})))}),500))}(button))};window.addEventListener("beforeunload",disableAction),setTimeout((function(){window.removeEventListener("beforeunload",disableAction)}),0)}),!1))}}));
//# sourceMappingURL=submit.min.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists