Commit 5779a7ff authored by Sven Franck's avatar Sven Franck

jslint pass putCommand.js

parent 5053f7cd
var putCommand = function(spec, my) { /*jslint indent: 2, maxlen: 80, sloppy: true */
var that = command(spec, my); /*global command: true */
spec = spec || {}; var putCommand = function (spec, my) {
my = my || {}; var that = command(spec, my);
// Attributes // spec = spec || {};
var priv = {}; my = my || {};
// Methods // // Methods //
that.getLabel = function() { that.getLabel = function () {
return 'put'; return 'put';
}; };
that.validateState = function () { that.validateState = function () {
if (!(typeof that.getDocId() === "string" && that.getDocId() !== "")) { if (!(typeof that.getDocId() === "string" && that.getDocId() !==
that.error({ "")) {
"status": 20, that.error({
"statusText": "Document Id Required", "status": 20,
"error": "document_id_required", "statusText": "Document Id Required",
"message": "The document id is not provided", "error": "document_id_required",
"reason": "Document id is undefined" "message": "The document id is not provided",
}); "reason": "Document id is undefined"
return false; });
} return false;
if (typeof that.getAttachmentId() !== "undefined") { }
that.error({ if (that.getAttachmentId() !== undefined) {
"status": 21, that.error({
"statusText": "Invalid Document Id", "status": 21,
"error": "invalid_document_id", "statusText": "Invalid Document Id",
"message": "The document id contains '/' characters "+ "error": "invalid_document_id",
"which are forbidden", "message": "The document id contains '/' characters " +
"reason": "Document id contains '/' character(s)" "which are forbidden",
}); "reason": "Document id contains '/' character(s)"
return false; });
} return false;
return true; }
}; return true;
};
that.executeOn = function(storage) { that.executeOn = function (storage) {
storage.put (that); storage.put(that);
}; };
return that;
return that; };
}; \ 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