Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/blocks/myoverview/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/blocks/myoverview/amd/build/view_nav.min.js.map

{"version":3,"sources":["../src/view_nav.js"],"names":["define","$","CustomEvents","Repository","View","Selectors","SELECTORS","FILTERS","FILTER_OPTION","DISPLAY_OPTION","updatePreferences","filter","value","type","updateUserPreferences","preferences","registerSelector","root","Selector","find","events","activate","on","e","data","option","target","hasClass","attr","pref","customfieldvalue","courseView","region","init","originalEvent","preventDefault","reset"],"mappings":"AAuBAA,OAAM,6BACN,CACI,QADJ,CAEI,gCAFJ,CAGI,6BAHJ,CAII,uBAJJ,CAKI,4BALJ,CADM,CAQN,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKIC,CALJ,CAME,IAEMC,CAAAA,CAAS,CAAG,CACZC,OAAO,CAAE,0BADG,CAEZC,aAAa,CAAE,eAFH,CAGZC,cAAc,CAAE,uBAHJ,CAFlB,CAcMC,CAAiB,CAAG,SAASC,CAAT,CAAiBC,CAAjB,CAAwB,CAC5C,GAAIC,CAAAA,CAAI,CAAG,IAAX,CACA,GAAc,SAAV,EAAAF,CAAJ,CAAyB,CACrBE,CAAI,CAAG,uCACV,CAFD,IAEO,IAAc,MAAV,EAAAF,CAAJ,CAAsB,CACzBE,CAAI,CAAG,uCACV,CAFM,IAEA,IAAc,kBAAV,EAAAF,CAAJ,CAAkC,CACrCE,CAAI,CAAG,4DACV,CAFM,IAEA,CACHA,CAAI,CAAG,2CACV,CAEDV,CAAU,CAACW,qBAAX,CAAiC,CAC7BC,WAAW,CAAE,CACT,CACIF,IAAI,CAAEA,CADV,CAEID,KAAK,CAAEA,CAFX,CADS,CADgB,CAAjC,CAQH,CAlCH,CAyCMI,CAAgB,CAAG,SAASC,CAAT,CAAe,CAElC,GAAIC,CAAAA,CAAQ,CAAGD,CAAI,CAACE,IAAL,CAAUb,CAAS,CAACC,OAApB,CAAf,C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Fd,CAGI,SAASc,CAAT,CAAYC,CAAZ,CAAkB,CACd,GAAIC,CAAAA,CAAM,CAAGxB,CAAC,CAACsB,CAAC,CAACG,MAAH,CAAd,CAEA,GAAID,CAAM,CAACE,QAAP,CAAgB,QAAhB,CAAJ,CAA+B,CAC3B,MACH,CALa,GAOVhB,CAAAA,CAAM,CAAGc,CAAM,CAACG,IAAP,CAAY,qBAAZ,CAPC,CAQVC,CAAI,CAAGJ,CAAM,CAACG,IAAP,CAAY,WAAZ,CARG,CAUdX,CAAI,CAACE,IAAL,CAAUd,CAAS,CAAC0B,UAAV,CAAqBC,MAA/B,EAAuCJ,IAAvC,CAA4C,cAA5C,CAA4DH,CAAM,CAACG,IAAP,CAAY,YAAZ,CAA5D,EACAlB,CAAiB,CAACC,CAAD,CAASkB,CAAT,CAAjB,CACAzB,CAAI,CAACgC,KAAL,CAAWnB,CAAX,EACAO,CAAI,CAACU,aAAL,CAAmBC,cAAnB,EACH,CAjBL,CAmBH,CAhGH,CA6GE,MAAO,CACHF,IAAI,CANG,QAAPA,CAAAA,IAAO,CAAShB,CAAT,CAAe,CACtBA,CAAI,CAAGhB,CAAC,CAACgB,CAAD,CAAR,CACAD,CAAgB,CAACC,CAAD,CACnB,CAEM,CAGV,CA9HK,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 * Manage the timeline view navigation for the overview block.\n *\n * @package    block_myoverview\n * @copyright  2018 Bas Brands <bas@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(\n[\n    'jquery',\n    'core/custom_interaction_events',\n    'block_myoverview/repository',\n    'block_myoverview/view',\n    'block_myoverview/selectors'\n],\nfunction(\n    $,\n    CustomEvents,\n    Repository,\n    View,\n    Selectors\n) {\n\n    var SELECTORS = {\n        FILTERS: '[data-region=\"filter\"]',\n        FILTER_OPTION: '[data-filter]',\n        DISPLAY_OPTION: '[data-display-option]'\n    };\n\n    /**\n     * Update the user preference for the block.\n     *\n     * @param {String} filter The type of filter: display/sort/grouping.\n     * @param {String} value The current preferred value.\n     */\n    var updatePreferences = function(filter, value) {\n        var type = null;\n        if (filter == 'display') {\n            type = 'block_myoverview_user_view_preference';\n        } else if (filter == 'sort') {\n            type = 'block_myoverview_user_sort_preference';\n        } else if (filter == 'customfieldvalue') {\n            type = 'block_myoverview_user_grouping_customfieldvalue_preference';\n        } else {\n            type = 'block_myoverview_user_grouping_preference';\n        }\n\n        Repository.updateUserPreferences({\n            preferences: [\n                {\n                    type: type,\n                    value: value\n                }\n            ]\n        });\n    };\n\n    /**\n     * Event listener for the Display filter (cards, list).\n     *\n     * @param {object} root The root element for the overview block\n     */\n    var registerSelector = function(root) {\n\n        var Selector = root.find(SELECTORS.FILTERS);\n\n        CustomEvents.define(Selector, [CustomEvents.events.activate]);\n        Selector.on(\n            CustomEvents.events.activate,\n            SELECTORS.FILTER_OPTION,\n            function(e, data) {\n                var option = $(e.target);\n\n                if (option.hasClass('active')) {\n                    // If it's already active then we don't need to do anything.\n                    return;\n                }\n\n                var filter = option.attr('data-filter');\n                var pref = option.attr('data-pref');\n                var customfieldvalue = option.attr('data-customfieldvalue');\n\n                root.find(Selectors.courseView.region).attr('data-' + filter, option.attr('data-value'));\n                updatePreferences(filter, pref);\n\n                if (customfieldvalue) {\n                    root.find(Selectors.courseView.region).attr('data-customfieldvalue', customfieldvalue);\n                    updatePreferences('customfieldvalue', customfieldvalue);\n                }\n\n                // Reset the views.\n                View.init(root);\n\n                data.originalEvent.preventDefault();\n            }\n        );\n\n        CustomEvents.define(Selector, [CustomEvents.events.activate]);\n        Selector.on(\n            CustomEvents.events.activate,\n            SELECTORS.DISPLAY_OPTION,\n            function(e, data) {\n                var option = $(e.target);\n\n                if (option.hasClass('active')) {\n                    return;\n                }\n\n                var filter = option.attr('data-display-option');\n                var pref = option.attr('data-pref');\n\n                root.find(Selectors.courseView.region).attr('data-display', option.attr('data-value'));\n                updatePreferences(filter, pref);\n                View.reset(root);\n                data.originalEvent.preventDefault();\n            }\n        );\n    };\n\n    /**\n     * Initialise the timeline view navigation by adding event listeners to\n     * the navigation elements.\n     *\n     * @param {object} root The root element for the myoverview block\n     */\n    var init = function(root) {\n        root = $(root);\n        registerSelector(root);\n    };\n\n    return {\n        init: init\n    };\n});\n"],"file":"view_nav.min.js"}