Commit 27892c94 authored by Sven Franck's avatar Sven Franck

jslint pass getCommand (2indent-correction)

parent 2ad51a9b
/*jslint indent: 2, maxlen: 80, sloppy: true */ /*jslint indent: 2, maxlen: 80, sloppy: true */
/*global command: true */ /*global command: true */
var getCommand = function (spec, my) { var getCommand = function (spec, my) {
var that = command(spec, my); var that = command(spec, my);
spec = spec || {}; spec = spec || {};
my = my || {}; my = my || {};
// Attributes // // Attributes //
// Methods // // Methods //
that.getLabel = function () { that.getLabel = function () {
return 'get'; return 'get';
}; };
that.validateState = function () { that.validateState = function () {
if (!(typeof that.getDocId() === "string" && if (!(typeof that.getDocId() === "string" &&
that.getDocId() !== "")) { that.getDocId() !== "")) {
that.error({
"status": 20,
"statusText": "Document Id Required",
"error": "document_id_required",
"message": "The document id is not provided",
"reason": "Document id is undefined"
});
return false;
}
if (typeof that.getAttachmentId() === "string") {
if (that.getAttachmentId() === "") {
that.error({ that.error({
"status": 20, "status": 23,
"statusText": "Document Id Required", "statusText": "Invalid Attachment Id",
"error": "document_id_required", "error": "invalid_attachment_id",
"message": "The document id is not provided", "message": "The attachment id must not be an empty string",
"reason": "Document id is undefined" "reason": "Attachment id is empty"
}); });
return false; return false;
} }
if (typeof that.getAttachmentId() === "string") { }
if (that.getAttachmentId() === "") { return true;
that.error({ };
"status": 23,
"statusText": "Invalid Attachment Id",
"error": "invalid_attachment_id",
"message": "The attachment id must not be an empty string",
"reason": "Attachment id is empty"
});
return false;
}
}
return true;
};
that.executeOn = function (storage) { that.executeOn = function (storage) {
storage.get(that); storage.get(that);
}; };
that.canBeRestored = function () { that.canBeRestored = function () {
return false; return false;
}; };
return that; return that;
}; };
\ No newline at end of file \ 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