set -e
set -u
-export PKG=debian-bts@modsoftsys.com
+export PKG=icedeb@modsoftsys.com-uuid
[ ! -e $PKG.xpi ] || rm $PKG.xpi
-content debian-bts chrome/
-style chrome://global/content/customizeToolbar.xul chrome://debian-bts/content/button.css
+content icedeb chrome/
+style chrome://global/content/customizeToolbar.xul chrome://icedeb/content/icedeb.css
# Firefox
-overlay chrome://browser/content/browser.xul chrome://debian-bts/content/button.xul
+overlay chrome://browser/content/browser.xul chrome://icedeb/content/icedeb.xul
+++ /dev/null
-#debian-bts-query-button-1,
-#wrapper-debian-bts-query-button-1
-{list-style-image: url("chrome://debian-bts/content/button-1.png");}
-
-/* common style for all custom buttons */
-.debian-bts-query-button
-{-moz-image-region: rect( 0px 24px 24px 0px);}
-
-.debian-bts-query-button:hover
-{-moz-image-region: rect(24px 24px 48px 0px);}
-
-[iconsize="small"] .debian-bts-query-button
-{-moz-image-region: rect( 0px 40px 16px 24px);}
-
-[iconsize="small"] .debian-bts-query-button:hover
-{-moz-image-region: rect(24px 40px 40px 24px);}
-
+++ /dev/null
-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);
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/css"
- href="chrome://debian-bts/content/button.css"?>
-
-<!DOCTYPE overlay >
-<overlay id="debian-bts-button-overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/x-javascript"
- src="chrome://debian-bts/content/button.js"/>
-
-<!-- Firefox -->
-<toolbarpalette id="BrowserToolbarPalette">
- <toolbarbutton id="debian-bts-query-button-1"/>
- </toolbarpalette>
-
-
-<!-- button details -->
-<toolbarbutton id="debian-bts-query-button-1"
- label="Debian BTS"
- tooltiptext="Query Debian BTS using the text in the clipboard"
- onclick="Debian.btsButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional debian-bts-query-button"
- />
-
-</overlay>
-
--- /dev/null
+#icedeb-bts,
+#wrapper-icedeb-bts
+{list-style-image: url("chrome://icedeb/content/icedeb-bts.png");}
+
+/* common style for all custom buttons */
+.icedeb-bts
+{-moz-image-region: rect( 0px 24px 24px 0px);}
+
+.icedeb-bts:hover
+{-moz-image-region: rect(24px 24px 48px 0px);}
+
+[iconsize="small"] .icedeb-bts
+{-moz-image-region: rect( 0px 40px 16px 24px);}
+
+[iconsize="small"] .icedeb-bts:hover
+{-moz-image-region: rect(24px 40px 40px 24px);}
+
--- /dev/null
+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);
+ }
+}
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/css"
+ href="chrome://icedeb/content/icedeb.css"?>
+
+<!DOCTYPE overlay >
+<overlay id="icedeb-overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<script type="application/x-javascript"
+ src="chrome://icedeb/content/icedeb.js"/>
+
+<!-- Firefox -->
+<toolbarpalette id="BrowserToolbarPalette">
+ <toolbarbutton id="icedeb-bts"/>
+ </toolbarpalette>
+
+
+<!-- button details -->
+<toolbarbutton id="icedeb-bts"
+ label="Debian BTS"
+ tooltiptext="Query Debian BTS using the text in the clipboard"
+ onclick="Debian.btsButton(event)"
+ class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-bts"
+ />
+
+</overlay>
+
<Description
about="urn:mozilla:install-manifest"
- em:name="Debian BTS"
- em:description="Query Debian bug-tracking system using the text in the clipboard"
+ em:name="Debian buttons"
+ em:description="Collection of buttons for querying Debian-related pages using the text in the clipboard"
em:creator="Damyan Ivanov"
- em:id="debian-bts-query@modsoftsys.com"
- em:version="0.1"
+ em:id="icedeb@modsoftsys.com-uuid"
+ em:version="0.2"
em:homepageURL=""
- em:iconURL="chrome://debian-bts/content/icon.png" >
+ em:iconURL="chrome://icedeb/content/icon.png" >
<em:targetApplication><!-- Firefox -->
<Description
<em:file>
<Description
- about="urn:mozilla:extension:debian-bts"
- em:package="content/debian-bts/" />
+ about="urn:mozilla:extension:icedeb"
+ em:package="content/icedeb/" />
</em:file>
</Description>