{"version":3,"sources":["https:\/\/udl.id\/course\/format\/remuiformat\/amd\/src\/format.js"],"names":["define","$","init","availableFormats","document","ready","layoutValue","val","window","localStorage","setItem","change","REMUI_CARD_FORMAT","format","hide","trigger","parent","show","oldcoursedisplay","getItem"],"mappings":"AAuBAA,OAAO,CAAC,UAAW,SAASC,GAwFxB,MAAO,CACHC,KAnFJ,SAAcC,GACVF,EAAEG,UAAUC,MAAM,WACd,IAEIC,EAAcL,EAAE,yBAAyBM,MAC7CC,OAAOC,aAAaC,QAAQ,gBAAiBT,EAAE,qBAAqBM,OAEpEN,EAAE,yBAAyBU,OAAO,WAG9B,GAFkBV,EAAE,yBAAyBM,OAE1BJ,EAAiBS,kBAAkBC,OAClDZ,EAAE,uCAAuCa,OACzCb,EAAE,qBAAqBM,IAAI,GAAGQ,QAAQ,UACtCd,EAAE,2BAA2Be,SAASA,SAASF,OAC\/Cb,EAAE,+BAA+Be,SAASA,SAASF,OACnDb,EAAE,oCAAoCe,SAASA,SAASC,OAE5B,GADLhB,EAAE,oCAAoCM,MAEzDN,EAAE,gCAAgCe,SAASA,SAASF,OAEpDb,EAAE,gCAAgCe,SAASA,SAASC,WAGrD,CACHhB,EAAE,uCAAuCgB,OACzC,IAAIC,EAAmBV,OAAOC,aAAaU,QAAQ,iBACnDlB,EAAE,qBAAqBM,IAAIW,GAAkBH,QAAQ,UACrDd,EAAE,2BAA2Be,SAASA,SAASC,OAC\/ChB,EAAE,oCAAoCe,SAASA,SAASF,OACxDb,EAAE,gCAAgCe,SAASA,SAASF,OAGhC,GADLb,EAAE,qBAAqBM,MAEtCN,EAAE,+BAA+Be,SAASA,SAASF,OAEnDb,EAAE,+BAA+Be,SAASA,SAASC,SAExDF,QAAQ,UAGPT,GAAeH,EAAiBS,kBAAkBC,QAClDZ,EAAE,uCAAuCa,OACzCb,EAAE,2BAA2Be,SAASA,SAASF,OAC\/Cb,EAAE,+BAA+Be,SAASA,SAASF,OAEvB,GADLb,EAAE,oCAAoCM,MAEzDN,EAAE,gCAAgCe,SAASA,SAASF,OAEpDb,EAAE,gCAAgCe,SAASA,SAASC,SAIxDhB,EAAE,2BAA2Be,SAASA,SAASC,OAEvB,GADLhB,EAAE,qBAAqBM,OAEtCN,EAAE,+BAA+Be,SAASA,SAASF,OAEvDb,EAAE,oCAAoCe,SAASA,SAASF,OACxDb,EAAE,gCAAgCe,SAASA,SAASF,QAExDb,EAAE,qBAAqBU,OAAO,WAEF,GADLV,EAAE,qBAAqBM,MAEtCN,EAAE,+BAA+Be,SAASA,SAASF,OAEnDb,EAAE,+BAA+Be,SAASA,SAASC,SAI3DhB,EAAE,oCAAoCU,OAAO,WAEb,GADLV,EAAE,oCAAoCM,MAEzDN,EAAE,gCAAgCe,SAASA,SAASF,OAEpDb,EAAE,gCAAgCe,SAASA,SAASC","sourcesContent":["\/\/ 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 .\n\n\/**\n * Enhancements to all components for easy course accessibility.\n *\n * @module format\/remuiformat\n * @copyright WisdmLabs\n * @license http:\/\/www.gnu.org\/copyleft\/gpl.html GNU GPL v3 or later\n *\/\n\ndefine(['jquery'], function($) {\n \/**\n * Init method\n *\n * @param {Object} availableFormats Available formates\n *\/\n function init(availableFormats) {\n $(document).ready(function() {\n var sectionLayoutVal;\n var sectionBackgroundVal;\n var layoutValue = $(\"#id_remuicourseformat\").val();\n window.localStorage.setItem('coursedisplay', $(\"#id_coursedisplay\").val());\n \/\/ Hide and show the course settings on course format selection.\n $(\"#id_remuicourseformat\").change(function() {\n var layoutValue = $(\"#id_remuicourseformat\").val();\n \/\/ CARD.\n if (layoutValue == availableFormats.REMUI_CARD_FORMAT.format) {\n $(\"#id_coursedisplay option[value='0']\").hide();\n $('#id_coursedisplay').val(1).trigger('change');\n $(\"#id_remuiteacherdisplay\").parent().parent().hide();\n $(\"#id_remuidefaultsectionview\").parent().parent().hide();\n $(\"#id_remuienablecardbackgroundimg\").parent().parent().show();\n sectionBackgroundVal = $(\"#id_remuienablecardbackgroundimg\").val();\n if (sectionBackgroundVal == 0) {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().hide();\n } else {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().show();\n }\n \/\/ LIST.\n } else {\n $(\"#id_coursedisplay option[value='0']\").show();\n var oldcoursedisplay = window.localStorage.getItem('coursedisplay');\n $('#id_coursedisplay').val(oldcoursedisplay).trigger('change');\n $(\"#id_remuiteacherdisplay\").parent().parent().show();\n $(\"#id_remuienablecardbackgroundimg\").parent().parent().hide();\n $(\"#id_remuidefaultsectiontheme\").parent().parent().hide();\n }\n sectionLayoutVal = $(\"#id_coursedisplay\").val();\n if (sectionLayoutVal == 1) {\n $(\"#id_remuidefaultsectionview\").parent().parent().hide();\n } else {\n $(\"#id_remuidefaultsectionview\").parent().parent().show();\n }\n }).trigger('change');\n\n \/\/ CARD.\n if (layoutValue == availableFormats.REMUI_CARD_FORMAT.format) {\n $(\"#id_coursedisplay option[value='0']\").hide();\n $(\"#id_remuiteacherdisplay\").parent().parent().hide();\n $(\"#id_remuidefaultsectionview\").parent().parent().hide();\n sectionBackgroundVal = $(\"#id_remuienablecardbackgroundimg\").val();\n if (sectionBackgroundVal == 0) {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().hide();\n } else {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().show();\n }\n \/\/ LIST.\n } else {\n $(\"#id_remuiteacherdisplay\").parent().parent().show();\n sectionLayoutVal = $(\"#id_coursedisplay\").val();\n if (sectionLayoutVal == 1) {\n $(\"#id_remuidefaultsectionview\").parent().parent().hide();\n }\n $(\"#id_remuienablecardbackgroundimg\").parent().parent().hide();\n $(\"#id_remuidefaultsectiontheme\").parent().parent().hide();\n }\n $(\"#id_coursedisplay\").change(function() {\n sectionLayoutVal = $(\"#id_coursedisplay\").val();\n if (sectionLayoutVal == 1) {\n $(\"#id_remuidefaultsectionview\").parent().parent().hide();\n } else {\n $(\"#id_remuidefaultsectionview\").parent().parent().show();\n }\n });\n\n $(\"#id_remuienablecardbackgroundimg\").change(function() {\n sectionBackgroundVal = $(\"#id_remuienablecardbackgroundimg\").val();\n if (sectionBackgroundVal == 0) {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().hide();\n } else {\n $(\"#id_remuidefaultsectiontheme\").parent().parent().show();\n }\n });\n\n });\n }\n\n \/\/ Must return the init function.\n return {\n init: init\n };\n});\n"],"file":"format.min.js"}