Current Path : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/ |
Current File : C:/Users/Mahmood/Desktop/moodle/lib/amd/build/icon_system_fontawesome.min.js.map |
{"version":3,"sources":["../src/icon_system_fontawesome.js"],"names":["define","IconSystem","$","Ajax","Mustache","LocalStorage","Url","staticMap","fetchMap","IconSystemFontawesome","apply","arguments","prototype","Object","create","init","when","map","get","JSON","parse","call","methodname","args","M","cfg","themerev","then","each","index","value","component","pix","to","set","stringify","bind","renderIcon","key","title","template","mappedIcon","unmappedIcon","url","imageUrl","attributes","name","context","alt","result","render","trim","getTemplateName"],"mappings":"AAuBAA,OAAM,gCAAC,CAAC,kBAAD,CAAqB,QAArB,CAA+B,WAA/B,CAA4C,eAA5C,CAA6D,mBAA7D,CAAkF,UAAlF,CAAD,CACE,SAASC,CAAT,CAAqBC,CAArB,CAAwBC,CAAxB,CAA8BC,CAA9B,CAAwCC,CAAxC,CAAsDC,CAAtD,CAA2D,IAE3DC,CAAAA,CAAS,CAAG,IAF+C,CAG3DC,CAAQ,CAAG,IAHgD,CAQ3DC,CAAqB,CAAG,UAAW,CACnCR,CAAU,CAACS,KAAX,CAAiB,IAAjB,CAAuBC,SAAvB,CACH,CAV8D,CAW/DF,CAAqB,CAACG,SAAtB,CAAkCC,MAAM,CAACC,MAAP,CAAcb,CAAU,CAACW,SAAzB,CAAlC,CAQAH,CAAqB,CAACG,SAAtB,CAAgCG,IAAhC,CAAuC,UAAW,CAC9C,GAAIR,CAAJ,CAAe,CACX,MAAOL,CAAAA,CAAC,CAACc,IAAF,CAAO,IAAP,CACV,CAED,GAAIC,CAAAA,CAAG,CAAGZ,CAAY,CAACa,GAAb,CAAiB,0BAAjB,CAAV,CACA,GAAID,CAAJ,CAAS,CACLA,CAAG,CAAGE,IAAI,CAACC,KAAL,CAAWH,CAAX,CACT,CAED,GAAIA,CAAJ,CAAS,CACLV,CAAS,CAAGU,CAAZ,CACA,MAAOf,CAAAA,CAAC,CAACc,IAAF,CAAO,IAAP,C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I,CAAE,OAAP,CAAgBhB,KAAK,CAAES,CAAvB,CAHQ,CADD,CAOlB,CAED,GAAIQ,CAAAA,CAAO,CAAG,CACVT,GAAG,CAAEG,CADK,CAEVF,KAAK,CAAEA,CAFG,CAGVS,GAAG,CAAET,CAHK,CAIVG,YAAY,CAAEA,CAJJ,CAAd,CAOA,GAAqB,WAAjB,QAAOH,CAAAA,CAAP,EAA0C,EAAV,GAAAA,CAApC,CAAkD,CAC9CQ,CAAO,CAAC,aAAD,CAAP,GACH,CAED,GAAIE,CAAAA,CAAM,CAAG7C,CAAQ,CAAC8C,MAAT,CAAgBV,CAAhB,CAA0BO,CAA1B,CAAb,CACA,MAAOE,CAAAA,CAAM,CAACE,IAAP,EACV,CA5BD,CAoCA1C,CAAqB,CAACG,SAAtB,CAAgCwC,eAAhC,CAAkD,UAAW,CACzD,MAAO,2BACV,CAFD,CAIA,MAAyD3C,CAAAA,CAE5D,CAxGK,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 * Competency rule points module.\n *\n * @package core\n * @copyright 2017 Damyon Wiese\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/localstorage', 'core/url'],\n function(IconSystem, $, Ajax, Mustache, LocalStorage, Url) {\n\n var staticMap = null;\n var fetchMap = null;\n\n /**\n * IconSystemFontawesome\n */\n var IconSystemFontawesome = function() {\n IconSystem.apply(this, arguments);\n };\n IconSystemFontawesome.prototype = Object.create(IconSystem.prototype);\n\n /**\n * Prefetch resources so later calls to renderIcon can be resolved synchronously.\n *\n * @method init\n * @return {Promise}\n */\n IconSystemFontawesome.prototype.init = function() {\n if (staticMap) {\n return $.when(this);\n }\n\n var map = LocalStorage.get('core/iconmap-fontawesome');\n if (map) {\n map = JSON.parse(map);\n }\n\n if (map) {\n staticMap = map;\n return $.when(this);\n }\n\n if (fetchMap === null) {\n fetchMap = Ajax.call([{\n methodname: 'core_output_load_fontawesome_icon_map',\n args: []\n }], true, false, false, 0, M.cfg.themerev)[0];\n }\n\n return fetchMap.then(function(map) {\n staticMap = {};\n $.each(map, function(index, value) {\n staticMap[value.component + '/' + value.pix] = value.to;\n });\n LocalStorage.set('core/iconmap-fontawesome', JSON.stringify(staticMap));\n return this;\n }.bind(this));\n };\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 * @method renderIcon\n */\n IconSystemFontawesome.prototype.renderIcon = function(key, component, title, template) {\n var mappedIcon = staticMap[component + '/' + key];\n var unmappedIcon = false;\n if (typeof mappedIcon === \"undefined\") {\n var url = Url.imageUrl(key, component);\n\n unmappedIcon = {\n attributes: [\n {name: 'src', value: url},\n {name: 'alt', value: title},\n {name: 'title', value: title}\n ]\n };\n }\n\n var context = {\n key: mappedIcon,\n title: title,\n alt: title,\n unmappedIcon: unmappedIcon\n };\n\n if (typeof title === \"undefined\" || title === '') {\n context['aria-hidden'] = true;\n }\n\n var result = Mustache.render(template, context);\n return result.trim();\n };\n\n /**\n * Get the name of the template to pre-cache for this icon system.\n *\n * @return {String}\n * @method getTemplateName\n */\n IconSystemFontawesome.prototype.getTemplateName = function() {\n return 'core/pix_icon_fontawesome';\n };\n\n return /** @alias module:core/icon_system_fontawesome */ IconSystemFontawesome;\n\n});\n"],"file":"icon_system_fontawesome.min.js"}