User:Cacycle/myskinforward.js

var slash = mw.config.get('wgPageName').indexOf('/'); var norm = mw.config.get('wgPageName').substr(0, slash) + mw.config.get('wgPageName').substr(slash).toLowerCase; var test = 'User:' + mw.config.get('wgUserName') + '/myskin.'; var ext; if (norm == test + 'js') ext = 'js'; else if (norm == test + 'css') ext = 'css'; if (ext != null) window.location.href = window.location.href.replace(/\/myskin.(css|js)/i, '/' + skin + '.' + ext);