mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Merge "Use localStorage for auto-save"
This commit is contained in:
commit
87d67d4a1c
|
@ -6,7 +6,7 @@ var
|
||||||
lastControllerScrollOffset,
|
lastControllerScrollOffset,
|
||||||
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},
|
featuresEnabled = mw.config.get( 'wgDiscussionToolsFeaturesEnabled' ) || {},
|
||||||
createMemoryStorage = require( './createMemoryStorage.js' ),
|
createMemoryStorage = require( './createMemoryStorage.js' ),
|
||||||
storage = createMemoryStorage( mw.storage.session ),
|
storage = createMemoryStorage( mw.storage ),
|
||||||
Parser = require( './Parser.js' ),
|
Parser = require( './Parser.js' ),
|
||||||
ThreadItemSet = require( './ThreadItemSet.js' ),
|
ThreadItemSet = require( './ThreadItemSet.js' ),
|
||||||
CommentDetails = require( './CommentDetails.js' ),
|
CommentDetails = require( './CommentDetails.js' ),
|
||||||
|
|
|
@ -115,7 +115,7 @@ ReplyWidgetVisual.prototype.setup = function ( data, suppressNotifications ) {
|
||||||
focus: [ 'emit', 'bodyFocus' ]
|
focus: [ 'emit', 'bodyFocus' ]
|
||||||
} );
|
} );
|
||||||
|
|
||||||
var listStorage = ve.init.platform.createListStorage( widget.storage );
|
var listStorage = ve.init.platform.createConflictableStorage( widget.storage );
|
||||||
// widget.storage is a MemoryStorage object. Copy over the .data cache so
|
// widget.storage is a MemoryStorage object. Copy over the .data cache so
|
||||||
// that listStorage reads from/writes to the same in-memory cache.
|
// that listStorage reads from/writes to the same in-memory cache.
|
||||||
listStorage.data = widget.storage.data;
|
listStorage.data = widget.storage.data;
|
||||||
|
@ -123,7 +123,8 @@ ReplyWidgetVisual.prototype.setup = function ( data, suppressNotifications ) {
|
||||||
target.initAutosave( {
|
target.initAutosave( {
|
||||||
suppressNotifications: suppressNotifications,
|
suppressNotifications: suppressNotifications,
|
||||||
docId: widget.storagePrefix,
|
docId: widget.storagePrefix,
|
||||||
storage: listStorage
|
storage: listStorage,
|
||||||
|
storageExpiry: 60 * 60 * 24 * 30
|
||||||
} );
|
} );
|
||||||
widget.afterSetup();
|
widget.afterSetup();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue