]> git.ktnx.net Git - icedeb.git/blobdiff - chrome/button.js
rename to icedeb; bts-stamp the bts button
[icedeb.git] / chrome / button.js
diff --git a/chrome/button.js b/chrome/button.js
deleted file mode 100644 (file)
index 823c2af..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-function getClipboardText() {
-    var clip = Components.classes['@mozilla.org/widget/clipboard;1']
-        .getService(Components.interfaces.nsIClipboard);
-    if (!clip) return null;
-
-    var trans = Components.classes['@mozilla.org/widget/transferable;1']
-        .createInstance(Components.interfaces.nsITransferable);
-    if (!trans) return null;
-
-    trans.addDataFlavor("text/unicode");
-    clip.getData(trans,
-            clip.supportsSelectionClipboard()
-            ? clip.kSelectionClipboard
-            : clip.kGlobalClipboard
-    );
-
-    var str = new Object;
-    var strLength = new Object;
-    trans.getTransferData("text/unicode", str, strLength);
-
-    var text = null;
-
-    if (str) str  = str.value.QueryInterface(Components.interfaces.nsISupportsString);
-    if (str) text = str.data.substring(0, strLength.value / 2);
-
-    return text;
-}
-
-function lookup_bts(in_new) {
-    var bug = getClipboardText();
-    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) {
-        if ( e.button == 0 )
-            lookup_bts(false)
-        else if ( e.button == 1 )
-            lookup_bts(true);
-    }
-}
-