227
editsUndo revision 147274 by MetalManeMc (talk)
MetalManeMc (talk | contribs) No edit summary |
MetalManeMc (talk | contribs) (Undo revision 147274 by MetalManeMc (talk)) Tag: Undo |
||
(11 intermediate revisions by the same user not shown) | |||
Line 14: | Line 14: | ||
); | ); | ||
$(portletLink).find('a').click(function(e) { | |||
e.preventDefault(); | |||
if (mw.user.options.get('theme')==='dark-grey') { | |||
var params = { | |||
action: 'options', | |||
change: 'theme=light', | |||
format: 'json' | |||
}; | |||
$('body').addClass('theme-light') | |||
$('body').removeClass('theme-dark-grey') | |||
} | |||
else { | |||
var params = { | |||
action: 'options', | |||
change: 'theme=dark-grey', | |||
format: 'json' | |||
}; | |||
mw.loader.using(['ext.darkvector']).then(function() { | |||
$('body').addClass('theme-dark-grey'); | |||
$('body').removeClass('theme-light'); | |||
}); | |||
} | |||
new mw.Api().postWithToken( 'csrf', params ).done( function ( data ) {}); | |||
}); | |||