mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Follow-up Ica9e5a9284: Actually make visualeditor-hidebetawelcome work
Three 'minor' points: * You have to declare even hidden preferences. Whoops. * There's no such thing as an "optionsToken", use "editToken". * You need to POST action=options API calls. Ahem. Change-Id: I9c4358107af7bcfca157bd014de49882914e990c
This commit is contained in:
parent
20b5c4038b
commit
80fc16a57e
|
@ -279,6 +279,9 @@ class VisualEditorHooks {
|
|||
'label-message' => 'visualeditor-preference-betatempdisable',
|
||||
'section' => 'editing/editor'
|
||||
);
|
||||
$preferences['visualeditor-hidebetawelcome'] = array(
|
||||
'type' => 'api'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1580,9 +1580,9 @@ ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
|
|||
if ( prefSaysShow ) {
|
||||
ve.init.mw.Target.static.apiRequest( {
|
||||
'action': 'options',
|
||||
'token': mw.user.tokens.get( 'optionsToken' ),
|
||||
'token': mw.user.tokens.get( 'editToken' ),
|
||||
'change': 'visualeditor-hidebetawelcome=1'
|
||||
} );
|
||||
}, { 'type': 'POST' } );
|
||||
|
||||
// No need to set a cookie every time for logged-in users that have already
|
||||
// set the hidebetawelcome=1 preference, but only if this isn't a one-off
|
||||
|
|
Loading…
Reference in a new issue