#!/usr/bin/make -f
-# vim: noet ts=8 ft=makefile
+# vim: noet sts=8 sw=8 ts=8 ft=makefile
PKG := icedeb
-ALL_FILES := README TODO install.rdf chrome.manifest \
- $(shell find res -type f) $(shell find chrome -type f)
+ALL_FILES := README TODO manifest.json icedeb.js icedeb.css icedeb.html icedeb-content.js \
+ $(shell find res -type f) icons/openlogo-nd.svg icons/icedeb-addon.png
all: $(PKG).xpi
$(PKG).xpi: $(ALL_FILES)
rm -f $@
zip $@ $^
-XCF := res/button-bts.xcf
-
-chrome/content/icedeb-bts.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "bts small" "bts big"
-chrome/content/icedeb-buildd.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "buildd small" "buildd big"
-chrome/content/icedeb-ddpo.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "DD small" "DD big"
-chrome/content/icedeb-deb.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "deb small" "deb big"
-chrome/content/icedeb-ml.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "ML small" "ML big"
-chrome/content/icedeb-pts.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "pts small" "pts big"
-chrome/content/icedeb-security.png: $(XCF)
- xcf2png -o "$@" "$<" "base" "security small" "security big"
+icons/icedeb-addon.png: res/icon.xcf
+ xcf2png -o "$@" $< -f -T
export PKG=icedeb
-btn2png() {
- local tag="$1"
- local btn="${2:-$tag}"
-
- xcf2png -o "chrome/content/$PKG-$btn.png" res/button-bts.xcf "base" "$tag small" "$tag big"
-}
-
xcf2png -o "icons/icedeb-addon.png" res/icon.xcf -f -T
-btn2png bts
-btn2png pts
-btn2png deb
-btn2png ML ml
-btn2png DD ddpo
-btn2png buildd
-btn2png security
-
[ ! -e $PKG.xpi ] || rm $PKG.xpi
zip -r $PKG.xpi README TODO res \
+++ /dev/null
-content icedeb chrome/content/
-style chrome://global/content/customizeToolbar.xul chrome://icedeb/content/icedeb.css
-
-locale icedeb en-US chrome/locale/en-US/
-locale icedeb bg-BG chrome/locale/bg-BG/
-
-# Firefox
-overlay chrome://browser/content/browser.xul chrome://icedeb/content/icedeb.xul
+++ /dev/null
-#icedeb-bts,
-#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");}
-
-#icedeb-deb,
-#wrapper-icedeb-deb
-{list-style-image: url("chrome://icedeb/content/icedeb-deb.png");}
-
-#icedeb-ml,
-#wrapper-icedeb-ml
-{list-style-image: url("chrome://icedeb/content/icedeb-ml.png");}
-
-#icedeb-ddpo,
-#wrapper-icedeb-ddpo
-{list-style-image: url("chrome://icedeb/content/icedeb-ddpo.png");}
-
-#icedeb-buildd,
-#wrapper-icedeb-buildd
-{list-style-image: url("chrome://icedeb/content/icedeb-buildd.png");}
-
-#icedeb-security,
-#wrapper-icedeb-security
-{list-style-image: url("chrome://icedeb/content/icedeb-security.png");}
-
-/* common style for all custom buttons */
-.icedeb-button
-{-moz-image-region: rect( 0px 24px 24px 0px);}
-
-[iconsize="small"] .icedeb-button
-{-moz-image-region: rect( 0px 40px 16px 24px);}
+++ /dev/null
-IceDeb = {
- getClipboardText: function() {
- 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;
-
- if (typeof(trans.init) === 'function')
- trans.init(null);
-
- trans.addDataFlavor("text/unicode");
- clip.getData(trans,
- clip.supportsSelectionClipboard()
- ? clip.kSelectionClipboard
- : clip.kGlobalClipboard
- );
-
- var s = new Object;
- var p;
- var len = new Object;
- trans.getTransferData("text/unicode", s, len);
-
- var text = null;
- var res;
-
- if (s)
- p = s.value.QueryInterface(Components.interfaces.nsISupportsString, res);
- if (p)
- text = p.data.substring(0, len.value / 2);
-
- return text;
- },
- trim_keyword: function(word) {
- if (!word) return word;
-
- var oldword;
- do {
- oldword = word;
-
- word = word.replace(/^[^a-zA-Z0-9]+/, '');
- word = word.replace(/[^a-zA-Z0-9]+$/, '');
- word = word.replace(/^Bug#/i, '');
- } while ( oldword != word );
-
- return word;
- },
- lookup_bts: function(in_new) {
- var bug = IceDeb.trim_keyword(IceDeb.getClipboardText());
- if (!bug) return null;
- var uri="https://bugs.debian.org/" + bug;
-
- if (in_new) {
- var b = getBrowser();
- var new_tab = b.addTab(uri);
- b.selectedTab = new_tab;
- }
- else {
- loadURI(uri);
- }
- },
- lookup_pts: function(in_new) {
- var pkg = IceDeb.trim_keyword(IceDeb.getClipboardText());
- if (!pkg) return null;
- var uri="https://tracker.debian.org/" + pkg;
-
- if (in_new) {
- var b = getBrowser();
- var new_tab = b.addTab(uri);
- b.selectedTab = new_tab;
- }
- else {
- loadURI(uri);
- }
- },
- lookup_deb: function(in_new) {
- var pkg = IceDeb.trim_keyword(IceDeb.getClipboardText());
- if (!pkg) return null;
- var uri="https://packages.debian.org/" + pkg;
-
- if (in_new) {
- var b = getBrowser();
- var new_tab = b.addTab(uri);
- b.selectedTab = new_tab;
- }
- else {
- loadURI(uri);
- }
- },
- lookup_ml: function(in_new) {
- var msg_id = IceDeb.trim_keyword(IceDeb.getClipboardText());
- if (!msg_id) msg_id = '';
- var uri="https://lists.debian.org/msgid-search/" + msg_id;
-
- if (in_new) {
- var b = getBrowser();
- var new_tab = b.addTab(uri);
- b.selectedTab = new_tab;
- }
- else {
- loadURI(uri);
- }
- },
- lookup_ddpo: function(in_new) {
- var keyword = IceDeb.trim_keyword(IceDeb.getClipboardText());
- var uri="https://qa.debian.org/developer.php";
-
- if (keyword) uri += "?login=" + keyword;
-
- if (in_new) {
- var b = getBrowser();
- var new_tab = b.addTab(uri);
- b.selectedTab = new_tab;
- }
- else {
- 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="https://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 )
- IceDeb.lookup_bts(false)
- else if ( e.button == 1 )
- IceDeb.lookup_bts(true);
- },
- ptsButton: function (e) {
- if ( e.button == 0 )
- IceDeb.lookup_pts(false)
- else if ( e.button == 1 )
- IceDeb.lookup_pts(true);
- },
- debButton: function (e) {
- if ( e.button == 0 )
- IceDeb.lookup_deb(false)
- else if ( e.button == 1 )
- IceDeb.lookup_deb(true);
- },
- mlButton: function (e) {
- if ( e.button == 0 )
- IceDeb.lookup_ml(false)
- else if ( e.button == 1 )
- IceDeb.lookup_ml(true);
- },
- ddpoButton: function (e) {
- if ( e.button == 0 )
- 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);
- }
-}
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet type="text/css"
- href="chrome://icedeb/content/icedeb.css"?>
-
-<!DOCTYPE overlay SYSTEM "chrome://icedeb/locale/icedeb.dtd">
-
-<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"/>
- <toolbarbutton id="icedeb-pts"/>
- <toolbarbutton id="icedeb-deb"/>
- <toolbarbutton id="icedeb-ml"/>
- <toolbarbutton id="icedeb-ddpo"/>
- <toolbarbutton id="icedeb-buildd"/>
- <toolbarbutton id="icedeb-security"/>
- </toolbarpalette>
-
-
-<!-- button details -->
-<toolbarbutton id="icedeb-bts"
- label="&bts.label;"
- tooltiptext="&bts.tooltiptext;"
- onclick="IceDeb.btsButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-bts icedeb-button"
- />
-
-<toolbarbutton id="icedeb-pts"
- label="&pts.label;"
- tooltiptext="&pts.tooltiptext;"
- onclick="IceDeb.ptsButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-pts icedeb-button"
- />
-
-<toolbarbutton id="icedeb-deb"
- label="&deb.label;"
- tooltiptext="&deb.tooltiptext;"
- onclick="IceDeb.debButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-deb icedeb-button"
- />
-
-<toolbarbutton id="icedeb-ml"
- label="&ml.label;"
- tooltiptext="&ml.tooltiptext;"
- onclick="IceDeb.mlButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-ml icedeb-button"
- />
-
-<toolbarbutton id="icedeb-ddpo"
- label="&ddpo.label;"
- tooltiptext="&ddpo.tooltiptext;"
- onclick="IceDeb.ddpoButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-ddpo icedeb-button"
- />
-
-<toolbarbutton id="icedeb-buildd"
- label="&buildd.label;"
- tooltiptext="&buildd.tooltiptext;"
- onclick="IceDeb.builddButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-buildd icedeb-button"
- />
-
-<toolbarbutton id="icedeb-security"
- label="&security.label;"
- tooltiptext="&security.tooltiptext;"
- onclick="IceDeb.securityButton(event)"
- class="toolbarbutton-1 chromeclass-toolbar-additional icedeb-security icedeb-button"
- />
-
-</overlay>
-
+++ /dev/null
-<!ENTITY bts.label "Грешки">
-<!ENTITY bts.tooltiptext "Запитване до системата за проследяване на проблеми на Дебиан">
-<!ENTITY pts.label "Пакет-източник">
-<!ENTITY pts.tooltiptext "Запитване до системата за следене на пакети на Дебиан">
-<!ENTITY deb.label ".deb пакет">
-<!ENTITY deb.tooltiptext "Информация за пакет">
-<!ENTITY ml.label "Списъци">
-<!ENTITY ml.tooltiptext "Търсене по идентификатор на съобщение в пощенските списъци на Дебиан">
-<!ENTITY ddpo.label "Обзор">
-<!ENTITY ddpo.tooltiptext "Обобщена информация за пакетите на даден разработчик на Дебиан">
-<!ENTITY buildd.label "журнали от компилацията">
-<!ENTITY buildd.tooltiptext "Информация от системите за автоматично компилиране на пакети">
-<!ENTITY security.label "информация за сигурността">
-<!ENTITY security.tooltiptext "Информация от сигурността на пакет или доклад на mitre.org (CVE)">
+++ /dev/null
-<!ENTITY bts.label "Debian BTS">
-<!ENTITY bts.tooltiptext "Query Debian BTS using the text in the clipboard">
-<!ENTITY pts.label "Debian PTS">
-<!ENTITY pts.tooltiptext "Query Debian Package tracking system using the text in the clipboard">
-<!ENTITY deb.label ".deb info">
-<!ENTITY deb.tooltiptext "Show information about binary deb package">
-<!ENTITY ml.label "Debian ML">
-<!ENTITY ml.tooltiptext "Search Debian mailing list by message ID">
-<!ENTITY ddpo.label "DDPO">
-<!ENTITY ddpo.tooltiptext "Show an overview of Debian developer contributions">
-<!ENTITY buildd.label "build logs">
-<!ENTITY buildd.tooltiptext "Show logs from Debian auto-builders">
-<!ENTITY security.label "security information">
-<!ENTITY security.tooltiptext "Information about package security status or mitre.org report (CVE)">
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:name>Debian buttons</em:name>
- <em:description>Query Debian-related pages using the text in the clipboard</em:description>
- <em:creator>Damyan Ivanov</em:creator>
- <em:id>{8fb11c5b-84eb-4da0-9128-292eacce2dcb}</em:id>
- <em:version>1.11</em:version>
- <em:homepageURL>http://icedeb.ktnx.net/</em:homepageURL>
- <em:type>2</em:type> <!-- type=extension -->
- <em:iconURL>chrome://icedeb/content/icon.png</em:iconURL>
- <em:targetApplication><!-- Firefox -->
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>1.4</em:minVersion>
- <em:maxVersion>31.*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>