Use mw.Api.plugin.options to set user options

This requires MediaWiki version 1.25+.

Change-Id: I3a76b0b4ec403b3acdc29e64b0c750a3b57e252a
This commit is contained in:
Fomafix
2016-02-15 14:13:13 +00:00
committed by [[mw:User:Fomafix]]
parent c329f1473d
commit cd58ac2f18
3 changed files with 8 additions and 12 deletions

View File

@@ -149,11 +149,10 @@
callback.call( this, true );
} else {
// Logged in user. Use MW APIs to change preferences
new mw.Api().postWithToken( 'options', {
action: 'options',
optionname: ulsPreferences.preferenceName,
optionvalue: JSON.stringify( ulsPreferences.preferences )
} ).done( function () {
new mw.Api().saveOption(
ulsPreferences.preferenceName,
JSON.stringify( ulsPreferences.preferences )
).done( function () {
callback.call( this, true );
} ).fail( function () {
callback.call( this, false );