Prefer localStorage to store ve-beta-welcome-dialog

Bug: 62884
Change-Id: I3fe45e890c29aaa8d28edfb6986dc8c7541861c7
This commit is contained in:
Alex Monk 2014-11-20 20:41:41 +00:00
parent 8a1adef97c
commit 51b091b9cd

View file

@ -1657,7 +1657,11 @@ ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
!urlSaysHide &&
(
prefSaysShow ||
( !usePrefs && $.cookie( 've-beta-welcome-dialog' ) === null )
(
!usePrefs &&
localStorage.getItem( 've-beta-welcome-dialog' ) === null &&
$.cookie( 've-beta-welcome-dialog' ) === null
)
)
) {
this.surface.getDialogs().openWindow( 'betaWelcome' );
@ -1674,7 +1678,11 @@ ve.init.mw.ViewPageTarget.prototype.maybeShowDialogs = function () {
// set the hidebetawelcome=1 preference, but only if this isn't a one-off
// view of the page via the hiding GET parameter.
} else if ( !usePrefs && !urlSaysHide ) {
$.cookie( 've-beta-welcome-dialog', 1, { path: '/', expires: 30 } );
try {
localStorage.setItem( 've-beta-welcome-dialog', 1 );
} catch ( e ) {
$.cookie( 've-beta-welcome-dialog', 1, { path: '/', expires: 30 } );
}
}
}