Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"paged_content.min.js","sources":["../src/paged_content.js"],"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 * Javascript to load and render a paged content section.\n *\n * @module     core/paged_content\n * @copyright  2018 Ryan Wyllie <ryan@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n    'jquery',\n    'core/paged_content_pages',\n    'core/paged_content_paging_bar',\n    'core/paged_content_paging_bar_limit_selector',\n    'core/paged_content_paging_dropdown'\n],\nfunction(\n    $,\n    Pages,\n    PagingBar,\n    PagingBarLimitSelector,\n    Dropdown\n) {\n\n    /**\n     * Initialise the paged content region by running the pages\n     * module and initialising any paging controls in the DOM.\n     *\n     * @param {object} root The paged content container element\n     * @param {function} renderPagesContentCallback (optional) A callback function to render a\n     *                                              content page. See core/paged_content_pages for\n     *                                              more defails.\n     * @param {string} namespaceOverride (optional) Provide a unique namespace override. If none provided defaults\n     *                                      to generate html's id\n     */\n    var init = function(root, renderPagesContentCallback, namespaceOverride) {\n        root = $(root);\n        var pagesContainer = root.find(Pages.rootSelector);\n        var pagingBarContainer = root.find(PagingBar.rootSelector);\n        var dropdownContainer = root.find(Dropdown.rootSelector);\n        var pagingBarLimitSelectorContainer = root.find(PagingBarLimitSelector.rootSelector);\n        var id = root.attr('id');\n\n        // Set the id to the custom namespace provided\n        if (namespaceOverride) {\n            id = namespaceOverride;\n        }\n\n        Pages.init(pagesContainer, id, renderPagesContentCallback);\n\n        if (pagingBarContainer.length) {\n            PagingBar.init(pagingBarContainer, id);\n        }\n\n        if (pagingBarLimitSelectorContainer.length) {\n            PagingBarLimitSelector.init(pagingBarLimitSelectorContainer, id);\n        }\n\n        if (dropdownContainer.length) {\n            Dropdown.init(dropdownContainer, id);\n        }\n    };\n\n    return {\n        init: init,\n        rootSelector: '[data-region=\"paged-content-container\"]'\n    };\n});\n"],"names":["define","$","Pages","PagingBar","PagingBarLimitSelector","Dropdown","init","root","renderPagesContentCallback","namespaceOverride","pagesContainer","find","rootSelector","pagingBarContainer","dropdownContainer","pagingBarLimitSelectorContainer","id","attr","length"],"mappings":";;;;;;;AAsBAA,4BACA,CACI,SACA,2BACA,gCACA,+CACA,uCAEJ,SACIC,EACAC,MACAC,UACAC,uBACAC,gBA0CO,CACHC,KA7BO,SAASC,KAAMC,2BAA4BC,uBAE9CC,gBADJH,KAAON,EAAEM,OACiBI,KAAKT,MAAMU,cACjCC,mBAAqBN,KAAKI,KAAKR,UAAUS,cACzCE,kBAAoBP,KAAKI,KAAKN,SAASO,cACvCG,gCAAkCR,KAAKI,KAAKP,uBAAuBQ,cACnEI,GAAKT,KAAKU,KAAK,MAGfR,oBACAO,GAAKP,mBAGTP,MAAMI,KAAKI,eAAgBM,GAAIR,4BAE3BK,mBAAmBK,QACnBf,UAAUG,KAAKO,mBAAoBG,IAGnCD,gCAAgCG,QAChCd,uBAAuBE,KAAKS,gCAAiCC,IAG7DF,kBAAkBI,QAClBb,SAASC,KAAKQ,kBAAmBE,KAMrCJ,aAAc"}