Try to restore the old preferences, if any, if possible
Preferences were saved using jStorage. The browsers which ULS supports now have wide native support for local storage, so we removed jquery.jStorage in I09b2bd52972. The old local storage key was 'jStorage' as put by jquery.jStorage. We now check if that key is present. If so we migrate the preferences and remove the old key to save space. We are not aware of anything else using this module. Change-Id: I995a32c4cb7a3bc818fe255f92dbc972211cb112
This commit is contained in:
@@ -137,6 +137,16 @@
|
||||
// No value supplied, return value
|
||||
try {
|
||||
data = localStorage.getItem( key );
|
||||
if ( !data ) {
|
||||
// Try to restore the old preferences, if any, if possible.
|
||||
try {
|
||||
data = JSON.parse( localStorage.getItem( 'jStorage' ) )['uls-preferences'];
|
||||
// And try to remove it.
|
||||
localStorage.removeItem( 'jStorage' );
|
||||
} catch ( e ) {
|
||||
// Don't bother about it.
|
||||
}
|
||||
}
|
||||
} catch ( e ) { // Use cookie
|
||||
data = $.cookie( key );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user