aboutsummaryrefslogtreecommitdiffstats
path: root/lib/skip-process-bug.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-22 17:18:44 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-22 17:18:44 +0200
commitc1f7615fa2a5dcc15fa3ed7962016537dd31bbfd (patch)
treec166ac80ff488e8706161a4defb373ee71e13bcd /lib/skip-process-bug.js
parent390f9042f82e4aaa6a57d08b9a5edfb38f688abf (diff)
downloadbugzilla-triage-c1f7615fa2a5dcc15fa3ed7962016537dd31bbfd.tar.gz
Make fixing MIME type again (includes creation of util.httpPOST)
- it is useful to have variable in the same module where the function using it is. - a lot of this magic and mystery - add this.win property - yuhooo, we have timer module, so I don't have to fish it from this.doc.defaultView (which doesn't work anyway)
Diffstat (limited to 'lib/skip-process-bug.js')
-rw-r--r--lib/skip-process-bug.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/lib/skip-process-bug.js b/lib/skip-process-bug.js
deleted file mode 100644
index f4e98cc..0000000
--- a/lib/skip-process-bug.js
+++ /dev/null
@@ -1,46 +0,0 @@
-jetpack.future.import("pageMods");
-
-// http://maymay.net/blog/2008/06/15/\
-// ridiculously-simple-javascript-version-string-to-object-parser/
-function parseVersionString (str) {
- if (typeof(str) != 'string') { return false; }
- var x = str.split('.');
- // parse from string or default to 0 if can't parse
- var maj = parseInt(x[0]) || 0;
- var min = parseInt(x[1]) || 0;
- var pat = parseInt(x[2]) || 0;
- return {
- major: maj,
- minor: min,
- patch: pat
- };
-}
-
-var callback = function(document){
- var stemURL = "https://HOSTNAME/show_bug.cgi?id=";
- var titleStr = $("title",document).text();
- var REArr = RegExp("[0-9]+").exec(titleStr);
- var REHostname = RegExp("\/\/([^/]+)\/").exec(document.location.toString());
- if (REArr) {
- var bugNo = REArr[0];
- var hostname = REHostname[1];
- console.log("bugNo = " + bugNo + ", hostname = " + hostname);
- var currentFFVersion = parseVersionString(jetpack.__parent__.navigator.vendorSub);
- console.log("currentFFVersion = " + currentFFVersion.toSource());
- if ((currentFFVersion.major >= 3) && (currentFFVersion.minor >= 6)) {
- var emailsSent = $("#bugzilla-body > dl:first",document).text();
- emailsSent = emailsSent.replace(/^(\s*)$/mg,"");
- jetpack.notifications.show(emailsSent);
- }
- document.location = stemURL.replace("HOSTNAME",hostname) + bugNo;
- }
-};
-
-var options = {};
-options.matches = [
- "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"
- ];
-jetpack.pageMods.add(callback, options);