From: Damyan Ivanov Date: Mon, 2 Mar 2009 20:42:36 +0000 (+0200) Subject: add new PTS lookup button X-Git-Tag: 0.3 X-Git-Url: https://git.ktnx.net/?p=icedeb.git;a=commitdiff_plain;h=2c8bc47dd316733f9b14462665d909247b2f08b4 add new PTS lookup button --- diff --git a/chrome/icedeb-pts.png b/chrome/icedeb-pts.png new file mode 100644 index 0000000..08c77cc Binary files /dev/null and b/chrome/icedeb-pts.png differ diff --git a/chrome/icedeb.css b/chrome/icedeb.css index 6b21319..e66fb31 100644 --- a/chrome/icedeb.css +++ b/chrome/icedeb.css @@ -2,16 +2,20 @@ #wrapper-icedeb-bts {list-style-image: url("chrome://icedeb/content/icedeb-bts.png");} +#icedeb-pts, +#wrapper-icedeb-pts +{list-style-image: url("chrome://icedeb/content/icedeb-pts.png");} + /* common style for all custom buttons */ -.icedeb-bts +.icedeb-button {-moz-image-region: rect( 0px 24px 24px 0px);} -.icedeb-bts:hover +.icedeb-bbutton:hover {-moz-image-region: rect(24px 24px 48px 0px);} -[iconsize="small"] .icedeb-bts +[iconsize="small"] .icedeb-button {-moz-image-region: rect( 0px 40px 16px 24px);} -[iconsize="small"] .icedeb-bts:hover +[iconsize="small"] .icedeb-button:hover {-moz-image-region: rect(24px 40px 40px 24px);} diff --git a/chrome/icedeb.js b/chrome/icedeb.js index 823c2af..66159cf 100644 --- a/chrome/icedeb.js +++ b/chrome/icedeb.js @@ -42,12 +42,33 @@ 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); + } +} + 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); } } diff --git a/chrome/icedeb.xul b/chrome/icedeb.xul index 68cd39b..b390d03 100644 --- a/chrome/icedeb.xul +++ b/chrome/icedeb.xul @@ -12,6 +12,7 @@ + @@ -20,7 +21,14 @@ 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" + class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-bts icedeb-button" + /> + + diff --git a/install.rdf b/install.rdf index 31a45a3..97e046c 100644 --- a/install.rdf +++ b/install.rdf @@ -11,7 +11,7 @@ em:creator="Damyan Ivanov" em:id="icedeb@modsoftsys.com-uuid" - em:version="0.2" + em:version="0.3" em:homepageURL="" em:iconURL="chrome://icedeb/content/icon.png" > diff --git a/res/button-bts.xcf b/res/button-bts.xcf index 3ef3eb1..de1ea8a 100644 Binary files a/res/button-bts.xcf and b/res/button-bts.xcf differ