From e26c2feb787f1421b64c88dd106a0cdc0b327af9 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 25 Nov 2009 00:45:32 +0100 Subject: Upstreaming works and a little cleanups. --- bugzillaBugTriage.js | 119 ++++++++++++++++++++++----------------------------- 1 file changed, 52 insertions(+), 67 deletions(-) diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index 731ca7d..0058531 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -109,7 +109,7 @@ $.getJSON(PCIIDsURL, filterByRegexp = function(list, chosingMark) { var chosenPair = []; if (list.length > 0) { - chosenPair = list.filter( + chosenPair = list.filter ( function (pair) { return new RegExp(pair.regexp, "i").test(chosingMark); }); @@ -150,44 +150,6 @@ isInList = function(mbr, list) { return (list.indexOf(mbr) !== -1); }; -/** - * This function creates a new anchor element and uses location properties (inherent) - * to get the desired URL data. Some String operations are used (to normalize results - * across browsers). - * originally from http://snipplr.com/view.php?codeview&id=12659 - * - * @param url String with URL - * @return object with parameters set - * - */ -function parseURL(url) { - var a = $('a',this.doc).get(0); - a.href = url; - return { - source: url, - protocol: a.protocol.replace(':',''), - host: a.hostname, - port: a.port, - query: a.search, - params: (function(){ - var ret = {}, - seg = a.search.replace(/^\?/,'').split('&'), - len = seg.length, i = 0, s; - for (;i0) && this.maintCCAddr === "xgl-maint@redhat.com") { // Add find chip magic button @@ -1409,8 +1391,11 @@ function bzPage(doc) { this.buildButtons(topRow,bottomRow); // FIXME this doesn't work as it should. + // Shouldn't we use .val() again instead of .text()? $("#component",this.doc).change(function (){ - that.changeOwner(that.defaultAssignee); + that.component = $("#component option:selected:first", this.doc).text(); + that.changeOwner(filterByRegexp(defAssigneeList, that.component). + toLowerCase()); }); } -- cgit