Commit b4d3ba8e authored by Sven Franck's avatar Sven Franck

jslint pass removeCommand.js

parent 5779a7ff
var removeCommand = function(spec, my) { /*jslint indent: 2, maxlen: 80, sloppy: true */
var that = command(spec, my); /*global command: true */
spec = spec || {}; var removeCommand = function (spec, my) {
my = my || {}; var that = command(spec, my);
// Attributes // spec = spec || {};
// Methods // my = my || {};
that.getLabel = function() { // Attributes //
return 'remove'; // Methods //
}; that.getLabel = function () {
return 'remove';
};
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() === "string") { }
if (that.getAttachmentId() === "") { if (typeof that.getAttachmentId() === "string") {
that.error({ if (that.getAttachmentId() === "") {
"status": 23, that.error({
"statusText": "Invalid Attachment Id", "status": 23,
"error": "invalid_attachment_id", "statusText": "Invalid Attachment Id",
"message": "The attachment id must not be an empty string", "error": "invalid_attachment_id",
"reason": "Attachment id is empty" "message": "The attachment id must not be an empty string",
}); "reason": "Attachment id is empty"
return false; });
} return false;
} }
return true; }
}; return true;
};
that.executeOn = function(storage) { that.executeOn = function (storage) {
storage.remove (that); storage.remove(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