From 0b742126acad12af78fe379474d735f772baeae3 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 3 May 2010 14:53:08 +0200 Subject: - heir() is a creation of the Evil, don't use it - fix MIME messages --- bugzillaBugTriage.js | 53 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 1287132..97b9568 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -144,13 +144,11 @@ XMLRPCMessage.prototype.xml = function() { // do individual parameters for ( var i = 0; i < this.params.length; i++) { var data = this.params[i]; - xml += "\n"; - - xml += "" - + this.getParamXML(this.dataTypeOf(data), - data) + "\n"; - - xml += "\n"; + xml += "\n"; + xml += "" + + this.getParamXML(this.dataTypeOf(data), + data) + "\n"; + xml += "\n"; } xml += "\n"; @@ -267,20 +265,18 @@ XMLRPCMessage.prototype.getParamXML = function(type, data) { return xml; }; -/* - * Create and return an object that has p as its prototype - * - * @param p parent Object - * @return child Object - */ -if (typeof Object.create !== 'function') { - Object.prototype.create = function () { - function F() {}; - F.prototype = this; - delete F.prototype.create; - return new F(); - }; -} +///* +// * Create and return an object that has p as its prototype +// * +// * @param p parent Object +// * @return child Object +// */ +//heir = function (o) { +// function F() {}; +// F.prototype = o; +// delete F.prototype.create; +// return new F(); +//}; // ============================================================== var hlpr = function () { @@ -938,16 +934,16 @@ BZPage.prototype.getLogin = function () { // ==================================================================================== // MozillaBugzilla object -function MozillaBugzilla() { +MozillaBugzilla = function () { -} - -MozillaBugzilla.prototype = BZPage.prototype.create(); +}; +MozillaBugzilla.prototype = new BZPage(); +MozillaBugzilla.prototype.constructor = MozillaBugzilla; // ==================================================================================== // RHBugzillaPage object -function RHBugzillaPage(doc) { +RHBugzillaPage = function(doc) { // For identification of graphics card const manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ], [ "ATI Mobility Radeon", "ATI", "1002" ], @@ -1197,7 +1193,8 @@ function RHBugzillaPage(doc) { } } // END OF RHBugzillaPage CONSTRUCTOR -RHBugzillaPage.prototype = BZPage.prototype.create(); +RHBugzillaPage.prototype = new BZPage(); +RHBugzillaPage.prototype.constructor = RHBugzillaPage; /* Offline supporting functions */ /** @@ -1958,7 +1955,9 @@ RHBugzillaPage.prototype.fixAttachById = function(id, type, email) { 'mime_type' : type, 'nomail' : !email }); + console.log("XML-RPC message:\n"+msg.xml()); msg.addParameter(this.login); + console.log("XML-RPC message:\n"+msg.xml()); msg.addParameter(this.password); console.log("XML-RPC message:\n"+msg.xml()); -- cgit