From 32af48e442a960b8c3f199f5ffad28a34590fcda Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 28 Apr 2011 13:28:55 +0200 Subject: Reformatting to MoFo coding style --- data/lib/fixingAttMIME.js | 51 +++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 24 deletions(-) (limited to 'data/lib/fixingAttMIME.js') diff --git a/data/lib/fixingAttMIME.js b/data/lib/fixingAttMIME.js index a016fe6..365cfae 100644 --- a/data/lib/fixingAttMIME.js +++ b/data/lib/fixingAttMIME.js @@ -5,17 +5,15 @@ var reqCounter = 0; // TODO should be probably a dict indexed by called method /** * Callback function for the XMLRPC request - * - * @param ret Object with xmlhttprequest response with attributes: - * + status -- int return code - * + statusText - * + responseHeaders - * + responseText + * + * @param ret + * Object with xmlhttprequest response with attributes: + status -- int + * return code + statusText + responseHeaders + responseText */ function XMLRPCcallback() { reqCounter--; if (reqCounter <= 0) { - setTimeout(function () { + setTimeout(function() { window.location.reload(true); }, 1000); } @@ -24,24 +22,27 @@ function XMLRPCcallback() { /** * The worker function -- call XMLRPC to fix MIME type of the particular * attachment - * - * @param id Integer with the attachment id to be fixed - * @param type String with the new MIME type, optional defaults to "text/plain" - * @param email Boolean whether email should be sent to appropriate person; - * option, defaults to false - * + * + * @param id + * Integer with the attachment id to be fixed + * @param type + * String with the new MIME type, optional defaults to "text/plain" + * @param email + * Boolean whether email should be sent to appropriate person; option, + * defaults to false + * * updateAttachMimeType($data_ref, $username, $password) - * + * * Update the attachment mime type of an attachment. The first argument is a * data hash containing information on the new MIME type and the attachment id * that you want to act on. - * + * * $data_ref = { "attach_id" => "", # Attachment ID to perform * MIME type change on. "mime_type" => "", # Legal MIME * type value that you want to change the attachment to. "nomail" => 0, # * OPTIONAL Flag that is either 1 or 0 if you want email to be sent or not for * this change }; - * + * */ function fixAttachById(id, XMLRPCURL, type, email) { var params = []; @@ -63,18 +64,18 @@ function fixAttachById(id, XMLRPCURL, type, email) { }); self.postMessage(new Message("MakeXMLRPCall", { - url: XMLRPCURL, - login: getLogin(), - method: "bugzilla.updateAttachMimeType", - params: params, - callRPC: "FixAttachmentMIMECallback" + url : XMLRPCURL, + login : getLogin(), + method : "bugzilla.updateAttachMimeType", + params : params, + callRPC : "FixAttachmentMIMECallback" })); reqCounter++; } /** * Add a link to the bad attachment for fixing it. - * + * * @param * DOM jQuery element with a bad attachment * @return none @@ -82,6 +83,8 @@ function fixAttachById(id, XMLRPCURL, type, email) { function addTextLink(row, xmlRpcUrl) { var elemS = row[4].getElementsByTagName("td"); var elem = elemS[elemS.length - 1]; - createDeadLink("addFix2TextLink", "text", elem, - fixAttachById, [row[1], xmlRpcUrl], "br"); + createDeadLink("addFix2TextLink", "text", elem, fixAttachById, + [ + row[1], xmlRpcUrl + ], "br"); } -- cgit