Sindbad~EG File Manager
{"version":3,"file":"savebutton.min.js","sources":["../src/savebutton.js"],"sourcesContent":["//\n// This file is part of Adaptable theme for moodle\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//\n// Adaptable save button JS file\n//\n// @package theme_adaptable\n// @copyright 2015-2019 Jeremy Hopkins (Coventry University)\n// @copyright 2015-2019 Fernando Acedo (3-bits.com)\n// @copyright 2018-2019 Manoj Solanki (Coventry University)\n// @copyright 2019 G J Barnard\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport $ from 'jquery';\nimport log from 'core/log';\n\n/**\n * Save button.\n */\nconst saveButton = () => {\n $(\"#savediscardsection\").hide();\n\n $('#adminsettings :input').on('change input', function () {\n $(\"#savediscardsection\").fadeIn('slow');\n });\n\n $(\"#adminsubmitbutton\").click(function () {\n window.onbeforeunload = null;\n $(\"#adminsettings\").submit();\n });\n $(\"#adminresetbutton\").click(function () {\n var confirmString = $(this).data('confirm'); // Saves an AJAX call for such a rare thing.\n var result = confirm(confirmString);\n if (result == true) {\n $('#adminsettings')[0].reset();\n $(\"#savediscardsection\").hide();\n }\n });\n\n $(\".colourdialogue\").click(function () {\n $(\"#savediscardsection\").fadeIn('slow');\n });\n};\n\n/**\n * Init.\n */\nexport const saveButtonInit = () => {\n log.debug('Adaptable ES6 Save button Init');\n\n if (document.readyState !== 'loading') {\n log.debug(\"Adaptable ES6 Save button Init DOM content already loaded\");\n saveButton();\n } else {\n log.debug(\"Adaptable ES6 Save button Init JS DOM content not loaded\");\n document.addEventListener('DOMContentLoaded', function () {\n log.debug(\"Adaptable ES6 Save button Init JS DOM content loaded\");\n saveButton();\n });\n }\n};\n"],"names":["saveButton","hide","on","fadeIn","click","window","onbeforeunload","submit","confirmString","this","data","confirm","reset","debug","document","readyState","addEventListener"],"mappings":";;uKAmCMA,WAAa,yBACb,uBAAuBC,2BAEvB,yBAAyBC,GAAG,gBAAgB,+BACxC,uBAAuBC,OAAO,+BAGlC,sBAAsBC,OAAM,WAC1BC,OAAOC,eAAiB,yBACtB,kBAAkBC,gCAEtB,qBAAqBH,OAAM,eACrBI,eAAgB,mBAAEC,MAAMC,KAAK,WAEnB,GADDC,QAAQH,qCAEf,kBAAkB,GAAGI,4BACrB,uBAAuBX,+BAI/B,mBAAmBG,OAAM,+BACrB,uBAAuBD,OAAO,oCAOV,kBACtBU,MAAM,kCAEkB,YAAxBC,SAASC,yBACLF,MAAM,6DACVb,4BAEIa,MAAM,4DACVC,SAASE,iBAAiB,oBAAoB,wBACtCH,MAAM,wDACVb"}
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists