Sindbad~EG File Manager
{"version":3,"file":"footer_alert.min.js","sources":["../src/footer_alert.js"],"sourcesContent":["/**\n * This file is part of Moodle - http://moodle.org/\n *\n * Moodle is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Moodle is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n *\n * @package\n * @author Guy Thomas\n * @copyright Copyright (c) 2016 Open LMS\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/templates'],\n function($, templates) {\n var FooterAlert = function() {\n\n // Container.\n var containerEl;\n\n /**\n * Detach the container for footer alert, so it will not appear at the first load of the page,\n * this to fix AX problems with unnecessary empty tags.\n */\n $(document).ready(function() {\n containerEl.detach();\n });\n\n /**\n * Initialising function.\n */\n (function() {\n containerEl = $('#snap-footer-alert');\n\n // If the move notice html was not output to the dom via php, then we need to add it here via js.\n // This is necessary for the front page which does not have a renderer that we can override.\n if (containerEl.length === 0) {\n templates.render('theme_snap/footer_alert', {})\n .done(function(result) {\n $('#region-main').append(result);\n containerEl = $('#snap-footer-alert');\n });\n }\n })();\n\n /**\n * Set title element html.\n * @param {string} titleHTML\n */\n this.setTitle = function(titleHTML) {\n $('.snap-footer-alert-title').html(titleHTML);\n this.setSrNotice('');\n // Focus on container so that it get's red out for accessibility reasons.\n containerEl.focus();\n };\n\n /**\n * Set screen reader notice.\n * @param {string} srText\n */\n this.setSrNotice = function(srText) {\n containerEl.find('p.sr-only').html(srText);\n };\n\n /**\n * Add AJAX loading spinner.\n * @param {string} str\n */\n this.addAjaxLoading = function(str) {\n str = !str ? M.util.get_string('loading', 'theme_snap') : str;\n var titleEl = $('.snap-footer-alert-title');\n if (titleEl.find('.loadingstat').length === 0) {\n titleEl.append('<span class=\"loadingstat spinner-three-quarters' +\n '\">' + str + '</span>');\n }\n };\n\n /**\n * Remove AJAX loading spinner.\n */\n this.removeAjaxLoading = function() {\n containerEl.find('.loadingstat').remove();\n };\n\n /**\n * Show footer alert.\n * @param {function} onCancel\n */\n this.show = function(onCancel) {\n // Re-attach Snap footer alert, so it appears when moving an activity or a section.\n containerEl.prependTo('section#region-main');\n containerEl.addClass('snap-footer-alert-visible');\n if (typeof (onCancel) === 'function') {\n $('.snap-footer-alert-cancel').click(onCancel);\n $('.snap-footer-alert-cancel').addClass('state-visible');\n } else {\n $('.snap-footer-alert-cancel').removeClass('state-visible');\n }\n };\n\n /**\n * Hide footer alert.\n */\n this.hide = function() {\n containerEl.removeClass('snap-footer-alert-visible');\n $('.snap-footer-alert-cancel').removeClass('state-visible');\n // Detach Snap footer alert after cancel button (When hiding the alert).\n containerEl.detach();\n };\n\n /**\n * Hide footer alert and reset content.\n */\n this.hideAndReset = function() {\n this.removeAjaxLoading();\n this.setTitle('');\n this.setSrNotice('');\n this.hide();\n };\n };\n return new FooterAlert();\n }\n);\n"],"names":["define","$","templates","containerEl","document","ready","detach","length","render","done","result","append","setTitle","titleHTML","html","setSrNotice","focus","srText","find","addAjaxLoading","str","M","util","get_string","titleEl","removeAjaxLoading","remove","show","onCancel","prependTo","addClass","click","removeClass","hide","hideAndReset"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBAA,iCAAO,CAAC,SAAU,mBACd,SAASC,EAAGC,kBA0GD,IAzGW,eAGVC,YAMJF,EAAEG,UAAUC,OAAM,WACdF,YAAYG,YAWe,KAJ3BH,YAAcF,EAAE,uBAIAM,QACZL,UAAUM,OAAO,0BAA2B,IACvCC,MAAK,SAASC,QACXT,EAAE,gBAAgBU,OAAOD,QACzBP,YAAcF,EAAE,8BAS3BW,SAAW,SAASC,WACrBZ,EAAE,4BAA4Ba,KAAKD,gBAC9BE,YAAY,IAEjBZ,YAAYa,cAOXD,YAAc,SAASE,QACxBd,YAAYe,KAAK,aAAaJ,KAAKG,cAOlCE,eAAiB,SAASC,KAC3BA,IAAOA,KAAMC,EAAEC,KAAKC,WAAW,UAAW,kBACtCC,QAAUvB,EAAE,4BAC4B,IAAxCuB,QAAQN,KAAK,gBAAgBX,QAC7BiB,QAAQb,OAAO,oDACJS,IAAM,iBAOpBK,kBAAoB,WACrBtB,YAAYe,KAAK,gBAAgBQ,eAOhCC,KAAO,SAASC,UAEjBzB,YAAY0B,UAAU,uBACtB1B,YAAY2B,SAAS,6BACK,mBAAdF,UACR3B,EAAE,6BAA6B8B,MAAMH,UACrC3B,EAAE,6BAA6B6B,SAAS,kBAExC7B,EAAE,6BAA6B+B,YAAY,uBAO9CC,KAAO,WACR9B,YAAY6B,YAAY,6BACxB/B,EAAE,6BAA6B+B,YAAY,iBAE3C7B,YAAYG,eAMX4B,aAAe,gBACXT,yBACAb,SAAS,SACTG,YAAY,SACZkB"}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists