Commit dec4d34f authored by Tristan Cavelier's avatar Tristan Cavelier

fix bug from serialized methods: nothing was serialized.

parent 9d7451b2
...@@ -72,7 +72,7 @@ var newLocalStorage = function (spec, my) { ...@@ -72,7 +72,7 @@ var newLocalStorage = function (spec, my) {
}; };
// ===================== overrides ====================== // ===================== overrides ======================
that.serialized = function () { that.specToStore = function () {
return { return {
"applicationname": priv.applicationname, "applicationname": priv.applicationname,
"username": priv.username "username": priv.username
......
...@@ -17,7 +17,7 @@ jIO.addStorageType('revision', function (spec, my) { ...@@ -17,7 +17,7 @@ jIO.addStorageType('revision', function (spec, my) {
priv.doctree_suffix = ".revision_tree.json"; priv.doctree_suffix = ".revision_tree.json";
priv.substorage = spec[priv.substorage_key]; priv.substorage = spec[priv.substorage_key];
that.serialized = function () { that.specToStore = function () {
var o = {}; var o = {};
o[priv.substorage_key] = priv.substorage; o[priv.substorage_key] = priv.substorage;
return o; return o;
......
...@@ -19,9 +19,8 @@ ...@@ -19,9 +19,8 @@
return ''; return '';
}; };
var super_serialized = that.serialized; that.specToStore = function () {
that.serialized = function () { var o = {};
var o = super_serialized();
o.delay = priv.delay; o.delay = priv.delay;
o.storage = priv.secondstorage_spec; o.storage = priv.secondstorage_spec;
o.save = priv.save; o.save = priv.save;
......
...@@ -38,11 +38,11 @@ var command = function(spec, my) { ...@@ -38,11 +38,11 @@ var command = function(spec, my) {
// Methods // // Methods //
/** /**
* Returns a serialized version of this command. * Returns a serialized version of this command.
* @method super_serialized * @method serialized
* @return {object} The serialized command. * @return {object} The serialized command.
*/ */
that.super_serialized = function () { that.serialized = function () {
var o = that.serialized() || {}; var o = {};
o["label"] = that.getLabel(); o["label"] = that.getLabel();
o["tried"] = priv.tried; o["tried"] = priv.tried;
o["doc"] = that.cloneDoc(); o["doc"] = that.cloneDoc();
...@@ -50,16 +50,6 @@ var command = function(spec, my) { ...@@ -50,16 +50,6 @@ var command = function(spec, my) {
return o; return o;
}; };
/**
* Returns a serialized version of this command.
* Override this function.
* @method serialized
* @return {object} The serialized command.
*/
that.serialized = function() {
return {};
};
/** /**
* Returns the label of the command. * Returns the label of the command.
* @method getLabel * @method getLabel
......
...@@ -56,19 +56,20 @@ var storage = function(spec, my) { ...@@ -56,19 +56,20 @@ var storage = function(spec, my) {
* @method serialized * @method serialized
* @return {object} The serialized storage. * @return {object} The serialized storage.
*/ */
that.super_serialized = function() { that.serialized = function() {
var o = that.serialized() || {}; var o = that.specToStore() || {};
o["type"] = that.getType(); o["type"] = that.getType();
return o; return o;
}; };
/** /**
* Returns a serialized version of this storage. * Returns an object containing spec to store on localStorage, in order to
* be restored later if something wrong happen.
* Override this method! * Override this method!
* @method serialized * @method specToStore
* @return {object} The serialized version of this storage * @return {object} The spec to store
*/ */
that.serialized = function () { that.specToStore = function () {
return {}; return {};
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment