mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-10 11:36:01 +00:00
web: support using localStorage for state
This adds support for checking to see if the browser supports the HTML5 localStorage, if so use that instead of cookies for storing the UI state.
This commit is contained in:
parent
280377ad6f
commit
64bacbfbf4
@ -31,7 +31,14 @@
|
||||
*/
|
||||
|
||||
// Setup the state manager
|
||||
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
||||
var provider = Ext.state.CookieProvider;
|
||||
try {
|
||||
if ('localStorage' in window && window['localStorage'] !== null) {
|
||||
provider = Ext.state.LocalStorageProvider;
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
Ext.state.Manager.setProvider(new provider());
|
||||
|
||||
// Add some additional functions to ext and setup some of the
|
||||
// configurable parameters
|
||||
|
Loading…
x
Reference in New Issue
Block a user