]> git.ktnx.net Git - icedeb.git/blobdiff - chrome/content/icedeb.js
call .init(null) on created nsITransferable instance
[icedeb.git] / chrome / content / icedeb.js
index 236112a0e51589694d39d41135725b452adefb8f..a6d00da93020599b903f7f0d38e7359d6c595cbc 100644 (file)
@@ -8,6 +8,9 @@ IceDeb = {
             .createInstance(Components.interfaces.nsITransferable);
         if (!trans) return null;
 
+        if (typeof(trans.init) === 'function')
+            trans.init(null);
+
         trans.addDataFlavor("text/unicode");
         clip.getData(trans,
                 clip.supportsSelectionClipboard()
@@ -39,6 +42,7 @@ IceDeb = {
 
             word = word.replace(/^[^a-zA-Z0-9]+/, '');
             word = word.replace(/[^a-zA-Z0-9]+$/, '');
+            word = word.replace(/^Bug#/i, '');
         } while ( oldword != word );
 
         return word;
@@ -114,6 +118,36 @@ IceDeb = {
             loadURI(uri);
         }
     },
+    lookup_buildd: function(in_new) {
+        var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText());
+        var uri="https://buildd.debian.org/";
+
+        if (keyword) uri += keyword;
+
+        if (in_new) {
+            var b = getBrowser();
+            var new_tab = b.addTab(uri);
+            b.selectedTab = new_tab;
+        }
+        else {
+            loadURI(uri);
+        }
+    },
+    lookup_security: function(in_new) {
+        var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText());
+        var uri="http://security-tracker.debian.org/";
+
+        if (keyword) uri += "tracker/" + keyword;
+
+        if (in_new) {
+            var b = getBrowser();
+            var new_tab = b.addTab(uri);
+            b.selectedTab = new_tab;
+        }
+        else {
+            loadURI(uri);
+        }
+    },
 
     btsButton: function (e) {
         if ( e.button == 0 )
@@ -144,6 +178,18 @@ IceDeb = {
             IceDeb.lookup_ddpo(false)
         else if ( e.button == 1 )
             IceDeb.lookup_ddpo(true);
+    },
+    builddButton: function (e) {
+        if ( e.button == 0 )
+            IceDeb.lookup_buildd(false)
+        else if ( e.button == 1 )
+            IceDeb.lookup_buildd(true);
+    },
+    securityButton: function (e) {
+        if ( e.button == 0 )
+            IceDeb.lookup_security(false)
+        else if ( e.button == 1 )
+            IceDeb.lookup_security(true);
     }
 }