Commit 33df1bc6 authored by Marco Mariani's avatar Marco Mariani

trivial jslint compliance changes

parent f4aa93ab
...@@ -80,7 +80,7 @@ jIO.addStorageType('crypt', function (spec, my) { ...@@ -80,7 +80,7 @@ jIO.addStorageType('crypt', function (spec, my) {
obj._wait = obj._wait || {}; obj._wait = obj._wait || {};
if (obj._wait[function_name]) { if (obj._wait[function_name]) {
obj._wait[function_name] -= 1; obj._wait[function_name] -= 1;
return function () {}; return function () { return undefined; };
} }
// ok if undef or 0 // ok if undef or 0
arglist = arglist || []; arglist = arglist || [];
...@@ -97,7 +97,7 @@ jIO.addStorageType('crypt', function (spec, my) { ...@@ -97,7 +97,7 @@ jIO.addStorageType('crypt', function (spec, my) {
obj._wait[function_name] = times; obj._wait[function_name] = times;
}; };
async.end = function () { async.end = function () {
async.call = function () {}; async.call = function () { return undefined; };
}; };
return async; return async;
}; };
......
...@@ -961,7 +961,7 @@ ...@@ -961,7 +961,7 @@
}; };
priv.send("allDocs", null, command.cloneOption( priv.send("allDocs", null, command.cloneOption(
), function (err, response) { ), function (err, response) {
var i, j, row, selector, selected; var i, row, selector, selected;
if (err) { if (err) {
return that.error(err); return that.error(err);
} }
......
...@@ -772,6 +772,7 @@ ...@@ -772,6 +772,7 @@
} }
function myCallback(response) { function myCallback(response) {
return undefined;
} }
that.XHRwrapper(command, docId, '', 'GET', mime, '', false, false, that.XHRwrapper(command, docId, '', 'GET', mime, '', false, false,
...@@ -823,6 +824,7 @@ ...@@ -823,6 +824,7 @@
function removeAttachment() { function removeAttachment() {
that.XHRwrapper(command, docId, attachId, 'DELETE', mime, '', true, that.XHRwrapper(command, docId, attachId, 'DELETE', mime, '', true,
true, function (reponse) { true, function (reponse) {
return undefined;
} }
); );
} }
......
...@@ -488,7 +488,7 @@ ...@@ -488,7 +488,7 @@
doc = command.cloneDoc(); doc = command.cloneDoc();
option = command.cloneOption(); option = command.cloneOption();
priv.send('getAttachment', doc, option, function (err, response) { priv.send('getAttachment', doc, option, function (err, response) {
var i, k; var i;
if (err) { if (err) {
err.message = "Unable to get attachment"; err.message = "Unable to get attachment";
delete err.index; delete err.index;
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
XMLHttpRequest: true, XMLHttpRequest: true,
Blob: true, Blob: true,
FormData: true, FormData: true,
window: true window: true,
setTimeout: true
*/ */
/** /**
* JIO XWiki Storage. Type = 'xwiki'. * JIO XWiki Storage. Type = 'xwiki'.
...@@ -86,7 +87,7 @@ ...@@ -86,7 +87,7 @@
priv.xwikiurl + "]", priv.xwikiurl + "]",
"reason": cause "reason": cause
}); });
}, }
}); });
}; };
...@@ -125,7 +126,7 @@ ...@@ -125,7 +126,7 @@
}; };
priv.isBlob = function (potentialBlob) { priv.isBlob = function (potentialBlob) {
return typeof (potentialBlob) !== 'undefined' && return potentialBlob !== undefined &&
potentialBlob.toString() === "[object Blob]"; potentialBlob.toString() === "[object Blob]";
}; };
...@@ -490,7 +491,7 @@ ...@@ -490,7 +491,7 @@
return { return {
"username": priv.username, "username": priv.username,
"language": priv.language, "language": priv.language,
"xwikiurl": priv.xwikiurl, "xwikiurl": priv.xwikiurl
}; };
}; };
...@@ -718,7 +719,7 @@ ...@@ -718,7 +719,7 @@
return that; return that;
}; };
if (typeof (define) === 'function' && define.amd) { if ((typeof define) === 'function' && define.amd) {
define(['jquery', 'jio'], function (jquery, jIO) { define(['jquery', 'jio'], function (jquery, jIO) {
$ = jquery; $ = jquery;
jIO.addStorageType('xwiki', store); jIO.addStorageType('xwiki', store);
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, test, ok, deepEqual, sinon */ /*global define, jIO, jio_tests, test, ok, deepEqual, sinon, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
...@@ -679,7 +679,7 @@ ...@@ -679,7 +679,7 @@
}, "Get html metadata"); }, "Get html metadata");
o.jio.get({ o.jio.get({
"_id": "{\"date\":\"2012-12-12\",\"language\":\"fr\"," + "_id": "{\"date\":\"2012-12-12\",\"language\":\"fr\"," +
"\"title\":\"Texte pour ce test\",\"type\":\"Text\"}", "\"title\":\"Texte pour ce test\",\"type\":\"Text\"}"
}, o.f); }, o.f);
o.tick(o); o.tick(o);
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, hex_sha256, test, ok, deepEqual, sinon, /*global define, jIO, jio_tests, hex_sha256, test, ok, deepEqual, sinon,
expect */ expect, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
...@@ -792,7 +792,7 @@ ...@@ -792,7 +792,7 @@
"children": [{ "children": [{
"rev": "1-111", "rev": "1-111",
"status": "available", "status": "available",
"children": [], "children": []
}] }]
}; };
o.doc1_1 = {"_id": "doc1.1-111", "title": "A"}; o.doc1_1 = {"_id": "doc1.1-111", "title": "A"};
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, hex_sha256, window, test, ok, deepEqual, sinon, /*global define, jIO, jio_tests, hex_sha256, window,
expect */ test, ok, deepEqual, sinon, expect, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
...@@ -640,7 +640,7 @@ ...@@ -640,7 +640,7 @@
o.rev_hash = generateRevisionHash({ o.rev_hash = generateRevisionHash({
"_id": "doc1", "_id": "doc1",
"_data": "abc", "_data": "abc",
"_attachment": "attmt1", "_attachment": "attmt1"
}, o.revisions); }, o.revisions);
o.rev = "2-" + o.rev_hash; o.rev = "2-" + o.rev_hash;
o.spy(o, "value", o.spy(o, "value",
...@@ -685,7 +685,7 @@ ...@@ -685,7 +685,7 @@
o.rev_hash = generateRevisionHash({ o.rev_hash = generateRevisionHash({
"_id": "doc1", "_id": "doc1",
"_data": "def", "_data": "def",
"_attachment": "attmt2", "_attachment": "attmt2"
}, o.revisions); }, o.revisions);
o.rev = "3-" + o.rev_hash; o.rev = "3-" + o.rev_hash;
o.spy(o, "value", o.spy(o, "value",
...@@ -837,7 +837,7 @@ ...@@ -837,7 +837,7 @@
o.jio.get({"_id": "get1", "_rev": "1-rev0"}, { o.jio.get({"_id": "get1", "_rev": "1-rev0"}, {
"revs_info": true, "revs_info": true,
"revs": true, "revs": true,
"conflicts": true, "conflicts": true
}, o.f); }, o.f);
o.tick(o); o.tick(o);
...@@ -855,7 +855,7 @@ ...@@ -855,7 +855,7 @@
o.jio.get({"_id": "get1", "_rev": "1-rev2"}, { o.jio.get({"_id": "get1", "_rev": "1-rev2"}, {
"revs_info": true, "revs_info": true,
"revs": true, "revs": true,
"conflicts": true, "conflicts": true
}, o.f); }, o.f);
o.tick(o); o.tick(o);
...@@ -886,7 +886,7 @@ ...@@ -886,7 +886,7 @@
}, { }, {
"revs_info": true, "revs_info": true,
"revs": true, "revs": true,
"conflicts": true, "conflicts": true
}, o.f); }, o.f);
o.tick(o); o.tick(o);
...@@ -899,7 +899,7 @@ ...@@ -899,7 +899,7 @@
}, { }, {
"revs_info": true, "revs_info": true,
"revs": true, "revs": true,
"conflicts": true, "conflicts": true
}, o.f); }, o.f);
o.tick(o); o.tick(o);
...@@ -1016,7 +1016,7 @@ ...@@ -1016,7 +1016,7 @@
// 4. remove existing attachment // 4. remove existing attachment
o.rev_hash = generateRevisionHash({ o.rev_hash = generateRevisionHash({
"_id": "remove1", "_id": "remove1",
"_attachment": "remove2", "_attachment": "remove2"
}, {"start": 2, "ids": ["oldrev", "veryoldrev"]}); }, {"start": 2, "ids": ["oldrev", "veryoldrev"]});
o.spy(o, "value", { o.spy(o, "value", {
"ok": true, "ok": true,
...@@ -1204,7 +1204,7 @@ ...@@ -1204,7 +1204,7 @@
"digest": "md5-2686969b0bc0fd9bc186146a1ecb09a7", "digest": "md5-2686969b0bc0fd9bc186146a1ecb09a7",
"length": 7 "length": 7
} }
}, }
}; };
o.rows.rows[2].doc = { o.rows.rows[2].doc = {
"_id": "yes", "_id": "yes",
...@@ -1215,7 +1215,7 @@ ...@@ -1215,7 +1215,7 @@
"digest": "md5-900bc885d7553375aec470198a9514f3", "digest": "md5-900bc885d7553375aec470198a9514f3",
"length": 3 "length": 3
} }
}, }
}; };
o.spy(o, "value", o.rows, "allDocs + include docs"); o.spy(o, "value", o.rows, "allDocs + include docs");
o.jio.allDocs({"include_docs": true}, function (err, response) { o.jio.allDocs({"include_docs": true}, function (err, response) {
...@@ -1284,7 +1284,7 @@ ...@@ -1284,7 +1284,7 @@
o.jio2.get({"_id": "sample1", "_rev": o.rev}, { o.jio2.get({"_id": "sample1", "_rev": o.rev}, {
"revs_info": true, "revs_info": true,
"revs": true, "revs": true,
"conflicts": true, "conflicts": true
}, o.f); }, o.f);
o.tick(o); o.tick(o);
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, window, test, ok, deepEqual, sinon, expect */ /*global define, jIO, jio_tests, window, test,
ok, deepEqual, sinon, expect, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, test, ok, deepEqual, sinon */ /*global define, jIO, jio_tests, test, ok, deepEqual, sinon, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
......
/*jslint indent: 2, maxlen: 80, nomen: true */ /*jslint indent: 2, maxlen: 80, nomen: true */
/*global define, jIO, jio_tests, test, ok, sinon */ /*global define, jIO, jio_tests, test, ok, sinon, module */
// define([module_name], [dependencies], module); // define([module_name], [dependencies], module);
(function (dependencies, module) { (function (dependencies, module) {
......
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