Commit 2dd5aa9e authored by Sven Franck's avatar Sven Franck Committed by Sebastien Robin

jslint pass waitstorage.js

parent fa6ae79d
(function () { var jioWaitStorageLoader = function ( jIO ) { /*global window, define */
(function () {
'use strict';
var jioWaitStorageLoader = function (jIO) {
var newWaitStorage = function (spec, my) {
var that = my.basicStorage(spec, my),
priv = {},
validatestate_sub_storage = spec.storage || false;
var newWaitStorage = function ( spec, my ) { priv.sub_storage_spec = spec.storage || {
var that = my.basicStorage( spec, my ), priv = {}; type: 'base'
};
priv.delay = spec.delay || 5000;
priv.save = spec.save || true;
priv.load = spec.load || false;
priv.getlist = spec.getlist || false;
priv.remove = spec.remove || false;
var validatestate_sub_storage = spec.storage || false; that.validateState = function () {
priv.sub_storage_spec = spec.storage || {type:'base'}; if (!validatestate_sub_storage) {
priv.delay = spec.delay || 5000; return 'Need at least one parameter: "storage" ' +
priv.save = spec.save || true; 'containing storage specifications.';
priv.load = spec.load || false; }
priv.getlist = spec.getlist || false; return '';
priv.remove = spec.remove || false; };
that.validateState = function () { that.specToStore = function () {
if (!validatestate_sub_storage) { var o = {};
return 'Need at least one parameter: "storage" '+ o.delay = priv.delay;
'containing storage specifications.'; o.storage = priv.sub_storage_spec;
} o.save = priv.save;
return ''; o.load = priv.load;
}; o.getlist = priv.getlist;
o.remove = priv.remove;
return o;
};
that.specToStore = function () { priv.doJob = function (command, timeout_or_not_timeout) {
var o = {}; var delay = 0;
o.delay = priv.delay; if (timeout_or_not_timeout) {
o.storage = priv.sub_storage_spec; delay = priv.delay;
o.save = priv.save; }
o.load = priv.load; window.setTimeout(function () {
o.getlist = priv.getlist; that.addJob(that.newStorage(priv.sub_storage_spec),
o.remove = priv.remove; command);
return o; that.end();
}; }, delay);
};
priv.doJob = function (command,timeout_or_not_timeout) { that.saveDocument = function (command) {
var delay = 0; priv.doJob(command, priv.save);
if (timeout_or_not_timeout) { };
delay = priv.delay; // end saveDocument
} that.loadDocument = function (command) {
setTimeout (function () { priv.doJob(command, priv.load);
that.addJob ( that.newStorage(priv.sub_storage_spec), };
command ); // end loadDocument
that.end(); that.getDocumentList = function (command) {
}, delay); priv.doJob(command, priv.getlist);
};
// end getDocumentList
that.removeDocument = function (command) {
priv.doJob(command, priv.remove);
};
// end removeDocument
return that;
}; };
that.saveDocument = function (command) { jIO.addStorageType('wait', newWaitStorage);
priv.doJob (command,priv.save);
}; // end saveDocument
that.loadDocument = function (command) {
priv.doJob (command,priv.load);
}; // end loadDocument
that.getDocumentList = function (command) {
priv.doJob (command,priv.getlist);
}; // end getDocumentList
that.removeDocument = function (command) {
priv.doJob (command,priv.remove);
}; // end removeDocument
return that;
}; };
Jio.addStorageType('wait', newWaitStorage); if (window.requirejs) {
}; define('JIOWaitStorages', ['jIO'], jioWaitStorageLoader);
} else {
jioWaitStorageLoader(jIO);
}
if (window.requirejs) {
define ('JIOWaitStorages',['jIO'], jioWaitStorageLoader);
} else {
jioWaitStorageLoader ( jIO );
} }
());
}()); \ No newline at end of file
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