Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{"version":3,"file":"icon_system_standard.min.js","sources":["../src/icon_system_standard.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 * The Standard icon system.\n *\n * @module core/icon_system_standard\n * @copyright  2017 Damyon Wiese\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\nimport IconSystem from './icon_system';\nimport * as CoreUrl from './url';\nimport * as Mustache from './mustache';\n\n/**\n * The Standard icon system.\n */\nexport default class IconSystemStandard extends IconSystem {\n\n    /**\n     * Render an icon.\n     *\n     * @param {string} key\n     * @param {string} component\n     * @param {string} title\n     * @param {string} template\n     * @return {string}\n     */\n    renderIcon(key, component, title, template) {\n        const url = CoreUrl.imageUrl(key, component);\n\n        const templatecontext = {\n            attributes: [\n                {name: 'src', value: url},\n                {name: 'alt', value: title},\n                {name: 'title', value: title},\n            ]\n        };\n        if (typeof title === \"undefined\" || title == \"\") {\n            templatecontext.attributes.push({name: 'aria-hidden', value: 'true'});\n        }\n\n        return Mustache.render(template, templatecontext).trim();\n    }\n\n    /**\n     * Get the name of the template to pre-cache for this icon system.\n     *\n     * @return {string}\n     */\n    getTemplateName() {\n        return 'core/pix_icon';\n    }\n}\n"],"names":["IconSystemStandard","IconSystem","renderIcon","key","component","title","template","templatecontext","attributes","name","value","CoreUrl","imageUrl","push","Mustache","render","trim","getTemplateName"],"mappings":";;;;;;;wqCA8BqBA,2BAA2BC,qBAW5CC,WAAWC,IAAKC,UAAWC,MAAOC,gBAGxBC,gBAAkB,CACpBC,WAAY,CACR,CAACC,KAAM,MAAOC,MAJVC,QAAQC,SAAST,IAAKC,YAK1B,CAACK,KAAM,MAAOC,MAAOL,OACrB,CAACI,KAAM,QAASC,MAAOL,qBAGV,IAAVA,OAAkC,IAATA,OAChCE,gBAAgBC,WAAWK,KAAK,CAACJ,KAAM,cAAeC,MAAO,SAG1DI,SAASC,OAAOT,SAAUC,iBAAiBS,OAQtDC,wBACW"}