]> git.ktnx.net Git - icedeb.git/commitdiff
open in new tab on middle-click
authorDamyan Ivanov <dmn@debian.org>
Thu, 26 Feb 2009 13:13:19 +0000 (15:13 +0200)
committerDamyan Ivanov <dmn@debian.org>
Thu, 26 Feb 2009 13:13:19 +0000 (15:13 +0200)
chrome/button.js

index 3dadd3e4aac6d355f5492e9461db0d546ee6a7ab..823c2afdb6f48973b1cadbe4dd576d17a49216e9 100644 (file)
@@ -26,14 +26,28 @@ function getClipboardText() {
     return text;
 }
 
     return text;
 }
 
-function lookup_bts() {
+function lookup_bts(in_new) {
     var bug = getClipboardText();
     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) {
 }
 
 Debian = {
     btsButton: function (e) {
-        lookup_bts();
+        if ( e.button == 0 )
+            lookup_bts(false)
+        else if ( e.button == 1 )
+            lookup_bts(true);
     }
 }
 
     }
 }