mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 09:56:38 +02:00
Merge branch 'MDL-70106-icon-cache-310' of https://github.com/Peterburnett/moodle into MOODLE_310_STABLE
This commit is contained in:
commit
05ef5c3c48
3 changed files with 6 additions and 4 deletions
2
lib/amd/build/icon_system_fontawesome.min.js
vendored
2
lib/amd/build/icon_system_fontawesome.min.js
vendored
|
@ -1,2 +1,2 @@
|
|||
define ("core/icon_system_fontawesome",["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage","core/url"],function(a,b,c,d,e,f){var g=null,h=null,i=function(){a.apply(this,arguments)};i.prototype=Object.create(a.prototype);i.prototype.init=function(){if(g){return b.when(this)}var a=e.get("core/iconmap-fontawesome");if(a){a=JSON.parse(a)}if(a){g=a;return b.when(this)}if(null===h){h=c.call([{methodname:"core_output_load_fontawesome_icon_system_map",args:{themename:M.cfg.theme}}],!0,!1,!1,0,M.cfg.themerev)[0]}return h.then(function(a){g={};b.each(a,function(a,b){g[b.component+"/"+b.pix]=b.to});e.set("core/iconmap-fontawesome",JSON.stringify(g));return this}.bind(this))};i.prototype.renderIcon=function(a,b,c,e){var h=g[b+"/"+a],i=!1;if("undefined"==typeof h){var j=f.imageUrl(a,b);i={attributes:[{name:"src",value:j},{name:"alt",value:c},{name:"title",value:c}]}}var k={key:h,title:c,alt:c,unmappedIcon:i};if("undefined"==typeof c||""===c){k["aria-hidden"]=!0}var l=d.render(e,k);return l.trim()};i.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"};return i});
|
||||
define ("core/icon_system_fontawesome",["core/icon_system","jquery","core/ajax","core/mustache","core/localstorage","core/url"],function(a,b,c,d,e,f){var g=null,h=null,i=function(){a.apply(this,arguments)};i.prototype=Object.create(a.prototype);i.prototype.init=function(){var a=M.cfg.theme;if(g){return b.when(this)}var d=e.get("core_iconsystem/theme/"+a+"/core/iconmap-fontawesome");if(d){d=JSON.parse(d)}if(d){g=d;return b.when(this)}if(null===h){h=c.call([{methodname:"core_output_load_fontawesome_icon_system_map",args:{themename:M.cfg.theme}}],!0,!1,!1,0,M.cfg.themerev)[0]}return h.then(function(c){g={};b.each(c,function(a,b){g[b.component+"/"+b.pix]=b.to});e.set("core_iconsystem/theme/"+a+"/core/iconmap-fontawesome",JSON.stringify(g));return this}.bind(this))};i.prototype.renderIcon=function(a,b,c,e){var h=g[b+"/"+a],i=!1;if("undefined"==typeof h){var j=f.imageUrl(a,b);i={attributes:[{name:"src",value:j},{name:"alt",value:c},{name:"title",value:c}]}}var k={key:h,title:c,alt:c,unmappedIcon:i};if("undefined"==typeof c||""===c){k["aria-hidden"]=!0}var l=d.render(e,k);return l.trim()};i.prototype.getTemplateName=function(){return"core/pix_icon_fontawesome"};return i});
|
||||
//# sourceMappingURL=icon_system_fontawesome.min.js.map
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -42,11 +42,13 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
|
|||
* @return {Promise}
|
||||
*/
|
||||
IconSystemFontawesome.prototype.init = function() {
|
||||
var currTheme = M.cfg.theme;
|
||||
|
||||
if (staticMap) {
|
||||
return $.when(this);
|
||||
}
|
||||
|
||||
var map = LocalStorage.get('core/iconmap-fontawesome');
|
||||
var map = LocalStorage.get('core_iconsystem/theme/' + currTheme + '/core/iconmap-fontawesome');
|
||||
if (map) {
|
||||
map = JSON.parse(map);
|
||||
}
|
||||
|
@ -70,7 +72,7 @@ define(['core/icon_system', 'jquery', 'core/ajax', 'core/mustache', 'core/locals
|
|||
$.each(map, function(index, value) {
|
||||
staticMap[value.component + '/' + value.pix] = value.to;
|
||||
});
|
||||
LocalStorage.set('core/iconmap-fontawesome', JSON.stringify(staticMap));
|
||||
LocalStorage.set('core_iconsystem/theme/' + currTheme + '/core/iconmap-fontawesome', JSON.stringify(staticMap));
|
||||
return this;
|
||||
}.bind(this));
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue