From e51092dd40432d35c53ece84181c1d0041506a5d Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 17 Jun 2010 12:03:40 +0200 Subject: Following https://bugzilla.mozilla.org/show_bug.cgi?id=572566 example now works. --- lib/bzpage.js | 4 ++-- lib/rhbzpage.js | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/bzpage.js b/lib/bzpage.js index 9f504c0..dcaa43c 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -22,8 +22,8 @@ BZPage.prototype.getURL = function getURL () { return this.doc.location.href; }; -BZPage.prototype.toString = function toString () { - return "[Object BZPage]"; +BZPage.prototype.getBugId = function getBugId () { + return util.getBugNo(this.doc.location.href); }; //exports.BZPage = apiUtils.publicConstructor(BZPage); diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js index 6127c33..21d0546 100644 --- a/lib/rhbzpage.js +++ b/lib/rhbzpage.js @@ -20,12 +20,9 @@ var RHBugzillaPage = function RHBugzillaPage(doc, config) { this.bugId = util.getBugNo(this.doc.location.href); console.log("doc = " + this.doc.location); console.log("bug number = " + this.bugId); - console.log("this = " + this); - console.log("prototype = " + this.prototype); - console.log("constructor = " + this.constructor); - console.log("this.getURL = " + this.getURL); - //this.bugId = this.getBugId(); console.log("bug URL = " + this.getURL()); + this.bugId = this.getBugId(); + console.log("bug# = " + this.getBugId()); console.log("Now we are outside!"); }; // END OF RHBugzillaPage CONSTRUCTOR @@ -33,7 +30,7 @@ RHBugzillaPage.prototype.toString = function toString () { return ("[Object RHBugzillaPage]"); }; -RHBugzillaPage.prototype = util.heir(BZPage.prototype); +RHBugzillaPage.prototype = util.heir(BZPage); RHBugzillaPage.prototype.constructor = RHBugzillaPage; //exports.RHBugzillaPage = apiUtils.publicConstructor(RHBugzillaPage); -- cgit