Commit d4da072a authored by Tristan Cavelier's avatar Tristan Cavelier

Grunt conflictmanagerstorage.js (jio.storage.js concat, lint, min)

parent a2d7a860
This diff is collapsed.
This diff is collapsed.
...@@ -6,7 +6,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -6,7 +6,7 @@ var newConflictManagerStorage = function ( spec, my ) {
priv.username = spec.username || ''; priv.username = spec.username || '';
var storage_exists = (spec.storage?true:false); var storage_exists = (spec.storage?true:false);
priv.secondstorage_spec = spec.storage || {type:'base'}; priv.secondstorage_spec = spec.storage || {type:'base'};
priv.secondstorage_string = JSON.stringify (priv.secondstorage_spec) priv.secondstorage_string = JSON.stringify (priv.secondstorage_spec);
var local_namespace = 'jio/conflictmanager/'+priv.secondstorage_string+'/'; var local_namespace = 'jio/conflictmanager/'+priv.secondstorage_string+'/';
...@@ -462,7 +462,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -462,7 +462,7 @@ var newConflictManagerStorage = function ( spec, my ) {
} else { } else {
if (result.length === 0) { if (result.length === 0) {
return that.done([]); return that.done([]);
}; }
for (i = 0; i < command_file_metadata_list.length; i+= 1) { for (i = 0; i < command_file_metadata_list.length; i+= 1) {
LocalOrCookieStorage.setItem ( LocalOrCookieStorage.setItem (
command_file_metadata_list[i].name + '.metadata', command_file_metadata_list[i].name + '.metadata',
...@@ -516,6 +516,7 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -516,6 +516,7 @@ var newConflictManagerStorage = function ( spec, my ) {
that.removeDocument = function (command) { that.removeDocument = function (command) {
var metadata_file_name = command.getPath() + '.metadata', var metadata_file_name = command.getPath() + '.metadata',
local_metadata_file_name = local_namespace + metadata_file_name, local_metadata_file_name = local_namespace + metadata_file_name,
local_file_metadata = {},
command_file_metadata = {}, // distant file.metadata command_file_metadata = {}, // distant file.metadata
run_index = 0, previous_revision = 0, run_index = 0, previous_revision = 0,
end = false, is_a_new_file = false, end = false, is_a_new_file = false,
...@@ -705,4 +706,4 @@ var newConflictManagerStorage = function ( spec, my ) { ...@@ -705,4 +706,4 @@ var newConflictManagerStorage = function ( spec, my ) {
return that; return that;
}; };
Jio.addStorageType('replicate', newReplicateStorage); Jio.addStorageType('conflictmanager', newConflictManagerStorage);
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
* *
* @module JIOStorages * @module JIOStorages
*/ */
(function(LocalOrCookieStorage, $, Base64, sjcl, MD5, Jio) { (function(LocalOrCookieStorage, $, Base64, sjcl, hex_sha256, Jio) {
}( LocalOrCookieStorage, jQuery, Base64, sjcl, MD5, jio )); }( LocalOrCookieStorage, jQuery, Base64, sjcl, hex_sha256, jio ));
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