From: Damyan Ivanov Date: Mon, 2 Mar 2009 20:53:42 +0000 (+0200) Subject: add .deb lookup button X-Git-Tag: 0.4~4 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=c3fadf7aca3227a9287629b8eecd566cb46cacbc;p=icedeb.git add .deb lookup button --- diff --git a/chrome/icedeb-deb.png b/chrome/icedeb-deb.png new file mode 100644 index 0000000..1e8cb38 Binary files /dev/null and b/chrome/icedeb-deb.png differ diff --git a/chrome/icedeb.css b/chrome/icedeb.css index e66fb31..8ecf6fb 100644 --- a/chrome/icedeb.css +++ b/chrome/icedeb.css @@ -6,6 +6,10 @@ #wrapper-icedeb-pts {list-style-image: url("chrome://icedeb/content/icedeb-pts.png");} +#icedeb-deb, +#wrapper-icedeb-deb +{list-style-image: url("chrome://icedeb/content/icedeb-deb.png");} + /* common style for all custom buttons */ .icedeb-button {-moz-image-region: rect( 0px 24px 24px 0px);} diff --git a/chrome/icedeb.js b/chrome/icedeb.js index 66159cf..df6363f 100644 --- a/chrome/icedeb.js +++ b/chrome/icedeb.js @@ -57,6 +57,21 @@ function lookup_pts(in_new) { } } +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 ) @@ -69,6 +84,12 @@ Debian = { 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); } } diff --git a/chrome/icedeb.xul b/chrome/icedeb.xul index b390d03..3f83af0 100644 --- a/chrome/icedeb.xul +++ b/chrome/icedeb.xul @@ -13,6 +13,7 @@ + @@ -31,5 +32,12 @@ class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-pts icedeb-button" /> + + diff --git a/install.rdf b/install.rdf index 97e046c..497de0b 100644 --- a/install.rdf +++ b/install.rdf @@ -11,7 +11,7 @@ em:creator="Damyan Ivanov" em:id="icedeb@modsoftsys.com-uuid" - em:version="0.3" + em:version="0.4" em:homepageURL="" em:iconURL="chrome://icedeb/content/icon.png" > diff --git a/res/button-bts.xcf b/res/button-bts.xcf index de1ea8a..8426828 100644 Binary files a/res/button-bts.xcf and b/res/button-bts.xcf differ