]> git.ktnx.net Git - icedeb.git/blobdiff - chrome/icedeb.js
add .deb lookup button
[icedeb.git] / chrome / icedeb.js
index 823c2afdb6f48973b1cadbe4dd576d17a49216e9..df6363f3cfab8cfa1124fd07411783f32eb2349e 100644 (file)
@@ -42,12 +42,54 @@ function lookup_bts(in_new) {
     }
 }
 
+function lookup_pts(in_new) {
+    var pkg = getClipboardText();
+    if (!pkg) return null;
+    var uri="http://packages.qa.debian.org/" + pkg;
+
+    if (in_new) {
+        var b = getBrowser();
+        var new_tab = b.addTab(uri);
+        b.selectedTab = new_tab;
+    }
+    else {
+        loadURI(uri);
+    }
+}
+
+function lookup_deb(in_new) {
+    var pkg = getClipboardText();
+    if (!pkg) return null;
+    var uri="http://packages.debian.org/" + pkg;
+
+    if (in_new) {
+        var b = getBrowser();
+        var new_tab = b.addTab(uri);
+        b.selectedTab = new_tab;
+    }
+    else {
+        loadURI(uri);
+    }
+}
+
 Debian = {
     btsButton: function (e) {
         if ( e.button == 0 )
             lookup_bts(false)
         else if ( e.button == 1 )
             lookup_bts(true);
+    },
+    ptsButton: function (e) {
+        if ( e.button == 0 )
+            lookup_pts(false)
+        else if ( e.button == 1 )
+            lookup_pts(true);
+    },
+    debButton: function (e) {
+        if ( e.button == 0 )
+            lookup_deb(false)
+        else if ( e.button == 1 )
+            lookup_deb(true);
     }
 }