MDL-66792 tool_dataprivacy: correct fa classes in privacy registry.
[moodle.git] / admin / tool / dataprivacy / amd / build / expand_contract.min.js.map
CommitLineData
aa5e1501 1{"version":3,"sources":["../src/expand_contract.js"],"names":["define","$","url","str","expandedImage","imageUrl","collapsedImage","CLASSES","EXPAND","COLLAPSE","expandCollapse","targetnode","thisnode","hasClass","removeClass","addClass","attr","find","expandCollapseAll","nextstate","currentstate","ariaexpandedstate","iconclassnow","iconclassnext","imagenow","each","data","get_string","then","langString","html","catch","Notification","exception"],"mappings":"AAyBAA,OAAM,oCAAC,CAAC,QAAD,CAAW,UAAX,CAAuB,UAAvB,CAAD,CAAqC,SAASC,CAAT,CAAYC,CAAZ,CAAiBC,CAAjB,CAAsB,IAEzDC,CAAAA,CAAa,CAAGH,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,YAAb,CAAtB,CAAmD,MAApD,CAFwC,CAGzDC,CAAc,CAAGL,CAAC,CAAC,uBAAsBC,CAAG,CAACG,QAAJ,CAAa,aAAb,CAAtB,CAAoD,MAArD,CAHuC,CAQzDE,CAAO,CAAG,CACVC,MAAM,CAAE,gBADE,CAEVC,QAAQ,CAAE,eAFA,CAR+C,CAa7D,MAA6D,CAOzDC,cAAc,CAAE,wBAASC,CAAT,CAAqBC,CAArB,CAA+B,CAC3C,GAAID,CAAU,CAACE,QAAX,CAAoB,MAApB,CAAJ,CAAiC,CAC7BF,CAAU,CAACG,WAAX,CAAuB,MAAvB,EACAH,CAAU,CAACI,QAAX,CAAoB,SAApB,EACAJ,CAAU,CAACK,IAAX,CAAgB,eAAhB,KACAJ,CAAQ,CAACK,IAAT,CAAc,cAAd,EAA8BH,WAA9B,CAA0CP,CAAO,CAACC,MAAlD,EACAI,CAAQ,CAACK,IAAT,CAAc,cAAd,EAA8BF,QAA9B,CAAuCR,CAAO,CAACE,QAA/C,EACAG,CAAQ,CAACK,IAAT,CAAc,kBAAd,EAAkCD,IAAlC,CAAuC,KAAvC,CAA8CZ,CA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,CACH,CAJD,EAKApB,CAAC,CAAC,8BAAD,CAAD,CAAkCyB,IAAlC,CAAuC,iBAAvC,CAA0DN,CAA1D,EAEAjB,CAAG,CAACwB,UAAJ,CAAeP,CAAf,CAA6B,kBAA7B,EAAiDQ,IAAjD,CAAsD,SAASC,CAAT,CAAqB,CACvE5B,CAAC,CAAC,8BAAD,CAAD,CAAkC6B,IAAlC,CAAuCD,CAAvC,CAEH,CAHD,EAGGE,KAHH,CAGSC,YAAY,CAACC,SAHtB,EAKAhC,CAAC,CAAC,cAAD,CAAD,CAAkBwB,IAAlB,CAAuB,UAAW,CAC9BxB,CAAC,CAAC,IAAD,CAAD,CAAQa,WAAR,CAAoBQ,CAApB,EACArB,CAAC,CAAC,IAAD,CAAD,CAAQc,QAAR,CAAiBQ,CAAjB,CACH,CAHD,EAIAtB,CAAC,CAAC,kBAAD,CAAD,CAAsBwB,IAAtB,CAA2B,UAAW,CAClCxB,CAAC,CAAC,IAAD,CAAD,CAAQe,IAAR,CAAa,KAAb,CAAoBQ,CAApB,CACH,CAFD,CAGH,CAvDwD,CAyDhE,CAtEK,CAAN","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 <http://www.gnu.org/licenses/>.\n\n/**\n * Potential user selector module.\n *\n * @module tool_dataprivacy/expand_contract\n * @class page-expand-contract\n * @package tool_dataprivacy\n * @copyright 2018 Adrian Greeve\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/url', 'core/str'], function($, url, str) {\n\n var expandedImage = $('<img alt=\"\" src=\"' + url.imageUrl('t/expanded') + '\"/>');\n var collapsedImage = $('<img alt=\"\" src=\"' + url.imageUrl('t/collapsed') + '\"/>');\n\n /*\n * Class names to apply when expanding/collapsing nodes.\n */\n var CLASSES = {\n EXPAND: 'fa-caret-right',\n COLLAPSE: 'fa-caret-down'\n };\n\n return /** @alias module:tool_dataprivacy/expand-collapse */ {\n /**\n * Expand or collapse a selected node.\n *\n * @param {object} targetnode The node that we want to expand / collapse\n * @param {object} thisnode The node that was clicked.\n */\n expandCollapse: function(targetnode, thisnode) {\n if (targetnode.hasClass('hide')) {\n targetnode.removeClass('hide');\n targetnode.addClass('visible');\n targetnode.attr('aria-expanded', true);\n thisnode.find(':header i.fa').removeClass(CLASSES.EXPAND);\n thisnode.find(':header i.fa').addClass(CLASSES.COLLAPSE);\n thisnode.find(':header img.icon').attr('src', expandedImage.attr('src'));\n } else {\n targetnode.removeClass('visible');\n targetnode.addClass('hide');\n targetnode.attr('aria-expanded', false);\n thisnode.find(':header i.fa').removeClass(CLASSES.COLLAPSE);\n thisnode.find(':header i.fa').addClass(CLASSES.EXPAND);\n thisnode.find(':header img.icon').attr('src', collapsedImage.attr('src'));\n }\n },\n\n /**\n * Expand or collapse all nodes on this page.\n *\n * @param {string} nextstate The next state to change to.\n */\n expandCollapseAll: function(nextstate) {\n var currentstate = (nextstate == 'visible') ? 'hide' : 'visible';\n var ariaexpandedstate = (nextstate == 'visible') ? true : false;\n var iconclassnow = (nextstate == 'visible') ? CLASSES.EXPAND : CLASSES.COLLAPSE;\n var iconclassnext = (nextstate == 'visible') ? CLASSES.COLLAPSE : CLASSES.EXPAND;\n var imagenow = (nextstate == 'visible') ? expandedImage.attr('src') : collapsedImage.attr('src');\n $('.' + currentstate).each(function() {\n $(this).removeClass(currentstate);\n $(this).addClass(nextstate);\n $(this).attr('aria-expanded', ariaexpandedstate);\n });\n $('.tool_dataprivacy-expand-all').data('visibilityState', currentstate);\n\n str.get_string(currentstate, 'tool_dataprivacy').then(function(langString) {\n $('.tool_dataprivacy-expand-all').html(langString);\n return;\n }).catch(Notification.exception);\n\n $(':header i.fa').each(function() {\n $(this).removeClass(iconclassnow);\n $(this).addClass(iconclassnext);\n });\n $(':header img.icon').each(function() {\n $(this).attr('src', imagenow);\n });\n }\n };\n});\n"],"file":"expand_contract.min.js"}