X-Git-Url: https://git.ktnx.net/?p=icedeb.git;a=blobdiff_plain;f=chrome%2Fbutton.js;h=823c2afdb6f48973b1cadbe4dd576d17a49216e9;hp=3dadd3e4aac6d355f5492e9461db0d546ee6a7ab;hb=08b3820c088861dddf37a67ffc1ff93a78aad265;hpb=77df037a1a92e4b6d7e4d1a43f19c4a2b607916a diff --git a/chrome/button.js b/chrome/button.js index 3dadd3e..823c2af 100644 --- a/chrome/button.js +++ b/chrome/button.js @@ -26,14 +26,28 @@ function getClipboardText() { return text; } -function lookup_bts() { +function lookup_bts(in_new) { var bug = getClipboardText(); - loadURI("http://bugs.debian.org/" + bug); + if (!bug) return null; + bug = bug.replace(/^#/, ''); + var uri="http://bugs.debian.org/" + bug; + + if (in_new) { + var b = getBrowser(); + var new_tab = b.addTab(uri); + b.selectedTab = new_tab; + } + else { + loadURI(uri); + } } Debian = { btsButton: function (e) { - lookup_bts(); + if ( e.button == 0 ) + lookup_bts(false) + else if ( e.button == 1 ) + lookup_bts(true); } }