%PDF- %PDF-
Direktori : /home/vacivi36/ava/lib/amd/build/ |
Current File : /home/vacivi36/ava/lib/amd/build/icon_system_fontawesome.min.js |
/** * Competency rule points module. * * @module core/icon_system_fontawesome * @copyright 2017 Damyon Wiese * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ define("core/icon_system_fontawesome",["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage","core/url"],(function(IconSystem,$,Ajax,Mustache,LocalStorage,Url){var staticMap=null,fetchMap=null,IconSystemFontawesome=function(){IconSystem.apply(this,arguments)};return(IconSystemFontawesome.prototype=Object.create(IconSystem.prototype)).init=function(){var currTheme=M.cfg.theme;if(staticMap)return $.when(this);var map=LocalStorage.get("core_iconsystem/theme/"+currTheme+"/core/iconmap-fontawesome");return map&&(map=JSON.parse(map)),map?(staticMap=map,$.when(this)):(null===fetchMap&&(fetchMap=Ajax.call([{methodname:"core_output_load_fontawesome_icon_system_map",args:{themename:M.cfg.theme}}],!0,!1,!1,0,M.cfg.themerev)[0]),fetchMap.then(function(map){return staticMap={},$.each(map,(function(index,value){staticMap[value.component+"/"+value.pix]=value.to})),LocalStorage.set("core_iconsystem/theme/"+currTheme+"/core/iconmap-fontawesome",JSON.stringify(staticMap)),this}.bind(this)))},IconSystemFontawesome.prototype.renderIcon=function(key,component,title,template){var mappedIcon=staticMap[component+"/"+key],unmappedIcon=!1;void 0===mappedIcon&&(unmappedIcon={attributes:[{name:"src",value:Url.imageUrl(key,component)},{name:"alt",value:title},{name:"title",value:title}]});var context={key:mappedIcon,title:title,alt:title,unmappedIcon:unmappedIcon};return void 0!==title&&""!==title||(context["aria-hidden"]=!0),Mustache.render(template,context).trim()},IconSystemFontawesome.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"},IconSystemFontawesome})); //# sourceMappingURL=icon_system_fontawesome.min.js.map