aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-22 09:49:01 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-22 09:49:01 +0200
commitd4a81c5de43ba4eed359ef0e25ed24b7399de3d5 (patch)
treea0683376f9368551511a440acb20f01f95548f12
parent7f2711d924220659fed80f547e52509d65154e7a (diff)
downloadbugzilla-triage-d4a81c5de43ba4eed359ef0e25ed24b7399de3d5.tar.gz
Make skipping over attachment.cgi work and more cleanup
- improve regexp in main.js / skipThisPage - fix util.notification to not crash - remove non-ASCII characters from package.json
-rw-r--r--Makefile2
-rw-r--r--lib/main.js7
-rw-r--r--lib/util.js12
-rw-r--r--package.json2
4 files changed, 12 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 9cfbba3..e95c52d 100644
--- a/Makefile
+++ b/Makefile
@@ -5,4 +5,4 @@ install:
/home/matej/Dokumenty/website/ceplovi.cz/matej/progs/data/
test:
- cfx run -a firefox -P ~/.mozilla/firefox/zj3uh9ia.devel-SDK/
+ cfx run -a firefox -P ~/.mozilla/firefox/zj3uh9ia.devel-SDK/ &
diff --git a/lib/main.js b/lib/main.js
index 7c72599..61a566d 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -32,7 +32,8 @@ config.skipMatches = [
"https://bugzilla.redhat.com/process_bug.cgi",
"https://bugzilla.redhat.com/post_bug.cgi",
"https://bugzilla.mozilla.org/post_bug.cgi",
- "https://bugzilla.mozilla.org/process_bug.cgi"
+ "https://bugzilla.mozilla.org/process_bug.cgi",
+ "https://bugzilla.redhat.com/attachment.cgi$"
];
// ==============================================================
@@ -74,10 +75,10 @@ function isOurPage(window, matchingURLs) {
function skipThisPage(doc) {
var stemURL = "https://HOSTNAME/show_bug.cgi?id=";
var titleStr = doc.getElementsByTagName("title")[0].textContent;
- var REArr = new RegExp("[0-9]+").exec(titleStr);
+ var REArr = new RegExp("[bB]ug\\s+([0-9]+)").exec(titleStr);
var hostname = urlMod.URL(doc.location.href).host;
if (REArr) {
- var bugNo = REArr[0];
+ var bugNo = REArr[1];
console.log("bugNo = " + bugNo + ", hostname = " + hostname);
var emailsSent = doc.
querySelector("#bugzilla-body > dl:nth-of-type(1)").textContent;
diff --git a/lib/util.js b/lib/util.js
index b832ac0..02fd476 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -62,12 +62,12 @@ exports.notification = function notification(msg) {
if (typeof(msg) === "object") {
body = msg.body;
- }
- if ("title" in msg) {
- title = msg.title;
- }
- if ("icon" in msg) {
- icon = msg.icon;
+ if ("title" in msg) {
+ title = msg.title;
+ }
+ if ("icon" in msg) {
+ icon = msg.icon;
+ }
}
try {
var classObj = Cc["@mozilla.org/alerts-service;1"];
diff --git a/package.json b/package.json
index 96db7e7..bdf786c 100644
--- a/package.json
+++ b/package.json
@@ -4,5 +4,5 @@
"jetpack-core"
],
"description": "Help for triage on bugzilla",
- "author": "Mat\u011bj Cepl (http://matej.ceplovi.cz)"
+ "author": "Matej Cepl (http://matej.ceplovi.cz)"
}