Commit 2985d31d authored by Tristan Cavelier's avatar Tristan Cavelier

update some files to use the good amd hash library

parent 7c3c4818
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
return define(dependencies, module); return define(dependencies, module);
} }
module(jIO, hex_sha256); module(jIO, {hex_sha256: hex_sha256});
}(['jio', 'sha256'], function (jIO, hex_sha256) { }(['jio', 'sha256'], function (jIO, sha256) {
"use strict"; "use strict";
jIO.addStorageType("revision", function (spec, my) { jIO.addStorageType("revision", function (spec, my) {
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
* @return {string} The string hash code * @return {string} The string hash code
*/ */
priv.hashCode = function (string) { priv.hashCode = function (string) {
return hex_sha256(string); return sha256.hex_sha256(string);
}; };
/** /**
......
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
return define(dependencies, module); return define(dependencies, module);
} }
window.jIO = module(hex_md5); window.jIO = module({hex_md5: hex_md5});
}(['md5'], function (hex_md5) { }(['md5'], function (md5) {
"use strict"; "use strict";
var localstorage; var localstorage, hex_md5 = md5.hex_md5;
if (typeof localStorage !== "undefined") { if (typeof localStorage !== "undefined") {
localstorage = { localstorage = {
getItem: function (item) { getItem: function (item) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
return define(dependencies, module); return define(dependencies, module);
} }
module(jIO, jio_tests, hex_sha256); module(jIO, jio_tests, {hex_sha256: hex_sha256});
}([ }([
'jio', 'jio',
'jio_tests', 'jio_tests',
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
'localstorage', 'localstorage',
'revisionstorage', 'revisionstorage',
'replicaterevisionstorage' 'replicaterevisionstorage'
], function (jIO, util, hex_sha256) { ], function (jIO, util, sha256) {
"use strict"; "use strict";
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
delete doc._revs_info; delete doc._revs_info;
string = JSON.stringify(doc) + JSON.stringify(revisions) + string = JSON.stringify(doc) + JSON.stringify(revisions) +
JSON.stringify(deleted_flag ? true : false); JSON.stringify(deleted_flag ? true : false);
return hex_sha256(string); return sha256.hex_sha256(string);
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
return define(dependencies, module); return define(dependencies, module);
} }
module(jIO, jio_tests, hex_sha256); module(jIO, jio_tests, {hex_sha256: hex_sha256});
}(['jio', 'jio_tests', 'sha256', 'localstorage', 'revisionstorage'], function ( }(['jio', 'jio_tests', 'sha256', 'localstorage', 'revisionstorage'], function (
jIO, jIO,
util, util,
hex_sha256 sha256
) { ) {
"use strict"; "use strict";
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
delete doc._revs_info; delete doc._revs_info;
string = JSON.stringify(doc) + JSON.stringify(revisions) + string = JSON.stringify(doc) + JSON.stringify(revisions) +
JSON.stringify(deleted_flag ? true : false); JSON.stringify(deleted_flag ? true : false);
return hex_sha256(string); return sha256.hex_sha256(string);
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
require.config({ require.config({
"paths": { "paths": {
"md5": "../lib/md5/md5", "md5": "../lib/md5/md5.amd",
"sha256": "../lib/jsSha2/sha256", "sha1": "../lib/jsSha1/sha1.amd",
"sha256": "../lib/jsSha2/sha256.amd",
"jquery": "../lib/jquery/jquery.min", "jquery": "../lib/jquery/jquery.min",
"complex_queries": "../complex_queries", "complex_queries": "../complex_queries",
"complex_queries_tests": "queries/tests", "complex_queries_tests": "queries/tests",
...@@ -36,8 +37,6 @@ ...@@ -36,8 +37,6 @@
"sinon_qunit": "../lib/sinon/sinon-qunit" "sinon_qunit": "../lib/sinon/sinon-qunit"
}, },
"shim": { "shim": {
"md5": {"exports": "hex_md5"},
"sha256": {"exports": "hex_sha256"},
"jquery": {"exports": "jQuery"}, "jquery": {"exports": "jQuery"},
"sinon": ["qunit"], "sinon": ["qunit"],
......
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