aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bzpage.js8
-rw-r--r--lib/main.js1
-rw-r--r--lib/rhbzpage.js12
-rw-r--r--lib/util.js5
4 files changed, 18 insertions, 8 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 8395ba9..fb242d2 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -10,14 +10,12 @@ var simpleStorage = require("simple-storage");
// BZPage's methods
var BZPage = exports.BZPage = function BZPage(doc, config) {
- console.log("doc = " + doc.title);
- console.log("config = " + config);
-
// initialize dynamic properties
this.doc = doc;
console.log("Now we are inside!");
};
-BZPage.prototype.getBugId = function getBugId () {
- return util.getBugNo(this.doc.location.href);
+BZPage.prototype.getURL = function getURL () {
+ console.log("url = " + this.doc.location.href);
+ return this.doc.location.href;
};
diff --git a/lib/main.js b/lib/main.js
index 986670f..b298829 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -16,6 +16,7 @@ var util = require("util");
var file = require("file");
var myStorage = require("simple-storage").storage;
var browser = require("tab-browser");
+var JSONURL = "http://matej.ceplovi.cz/progs/data/RH_Data-packages.json";
var config = {};
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index 407d383..70186c9 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -15,10 +15,18 @@ var RHBugzillaPage = exports.RHBugzillaPage = function RHBugzillaPage(doc, confi
console.log("location = " + this.doc.location);
- this.bugId = this.getBugId();
+ //this.bugId = this.getBugId();
+ 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());
console.log("Now we are outside!");
}; // END OF RHBugzillaPage CONSTRUCTOR
-RHBugzillaPage.prototype = util.heir(BZPage);
+RHBugzillaPage.prototype = util.heir(BZPage.prototype);
RHBugzillaPage.prototype.constructor = RHBugzillaPage;
diff --git a/lib/util.js b/lib/util.js
index b019022..e14fcb1 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -30,7 +30,7 @@ var urlMod = require("url");
*/
exports.heir = function heir(p) {
function f() {};
- f.prototype = p.prototype;
+ f.prototype = p.prototype;
return new f();
};
@@ -38,6 +38,9 @@ exports.heir = function heir(p) {
var getBugNo = exports.getBugNo = function getBugNo(url) {
var re = new RegExp(".*id=([0-9]+).*$");
var bugNo = null;
+ if (!url) {
+ throw new Error("Missing URL value!");
+ }
var reResult = re.exec(url);
if (reResult[1]) {
bugNo = reResult[1];