User:Monster Domosed/common.js: Difference between revisionsGive feedback
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
(function () { | (function () { | ||
'use strict'; | 'use strict'; | ||
var PREFERENCE_KEY = 'userjs-selectedicon'; | |||
(function applyIconImmediately() { | |||
try { | |||
var cachedIcon = localStorage.getItem(PREFERENCE_KEY); | |||
if (cachedIcon) { | |||
document.body.className = | |||
document.body.className.replace(/usericon-\w+/g, ''); | |||
document.body.classList.add('usericon-' + cachedIcon); | |||
} | |||
} catch (e) {} | |||
})(); | |||
var availableIcons = [ | var availableIcons = [ | ||
| Line 46: | Line 59: | ||
{ id: 'yamato', name: 'Yamato' } | { id: 'yamato', name: 'Yamato' } | ||
]; | ]; | ||
var remClickCount = 0; | var remClickCount = 0; | ||
| Line 245: | Line 256: | ||
mw.loader.using(['mediawiki.util'], function () { | mw.loader.using(['mediawiki.util'], function () { | ||
var config = mw.config.get([ | var config = mw.config.get([ | ||
'wgNamespaceNumber', | 'wgNamespaceNumber', | ||