initial import of custom toolbar button template
authorDamyan Ivanov <dmn@debian.org>
Thu, 26 Feb 2009 10:53:33 +0000 (12:53 +0200)
committerDamyan Ivanov <dmn@debian.org>
Thu, 26 Feb 2009 10:53:33 +0000 (12:53 +0200)
build [new file with mode: 0644]
chrome.manifest [new file with mode: 0644]
chrome/button-1.png [new file with mode: 0644]
chrome/button.css [new file with mode: 0644]
chrome/button.js [new file with mode: 0644]
chrome/button.xul [new file with mode: 0644]
chrome/icon.png [new file with mode: 0644]
install.rdf [new file with mode: 0644]

diff --git a/build b/build
new file mode 100644 (file)
index 0000000..687488d
--- /dev/null
+++ b/build
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+set -u
+
+export PKG=custom-toolbar-button@example.com
+
+[ ! -e $PKG.xpi ] || rm $PKG.xpi
+
+jar -v -M -c -f $PKG.xpi chrome install* chrome.manifest
diff --git a/chrome.manifest b/chrome.manifest
new file mode 100644 (file)
index 0000000..fbf3dc4
--- /dev/null
@@ -0,0 +1,5 @@
+content custombutton chrome/
+style chrome://global/content/customizeToolbar.xul chrome://custombutton/content/button.css
+
+# Firefox
+overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul
diff --git a/chrome/button-1.png b/chrome/button-1.png
new file mode 100644 (file)
index 0000000..9f77b37
Binary files /dev/null and b/chrome/button-1.png differ
diff --git a/chrome/button.css b/chrome/button.css
new file mode 100644 (file)
index 0000000..ce1ccc1
--- /dev/null
@@ -0,0 +1,17 @@
+#custom-button-1,
+#wrapper-custom-button-1
+{list-style-image: url("chrome://custombutton/content/button-1.png");}
+
+/* common style for all custom buttons */
+.custombutton                  
+{-moz-image-region: rect( 0px 24px 24px  0px);}
+
+.custombutton:hover     
+{-moz-image-region: rect(24px 24px 48px  0px);}
+
+[iconsize="small"] .custombutton
+{-moz-image-region: rect( 0px 40px 16px 24px);}
+
+[iconsize="small"] .custombutton:hover
+{-moz-image-region: rect(24px 40px 40px 24px);}
+
diff --git a/chrome/button.js b/chrome/button.js
new file mode 100644 (file)
index 0000000..f1ec859
--- /dev/null
@@ -0,0 +1,8 @@
+CustomButton = {
+
+1: function () {
+         alert("Just testing")  
+               },
+
+}
+
diff --git a/chrome/button.xul b/chrome/button.xul
new file mode 100644 (file)
index 0000000..46e14e1
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/css"
+  href="chrome://custombutton/content/button.css"?>
+
+<!DOCTYPE overlay >
+<overlay id="custombutton-overlay"
+  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+<script type="application/x-javascript"
+  src="chrome://custombutton/content/button.js"/>
+
+<!-- Firefox -->
+<toolbarpalette id="BrowserToolbarPalette">
+  <toolbarbutton id="custom-button-1"/>
+  </toolbarpalette>
+
+
+<!-- button details -->
+<toolbarbutton id="custom-button-1"
+  label="Custom"
+  tooltiptext="My custom toolbar button"
+  oncommand="CustomButton[1]()"
+  class="toolbarbutton-1 chromeclass-toolbar-additional custombutton"
+  />
+
+</overlay>
+
diff --git a/chrome/icon.png b/chrome/icon.png
new file mode 100644 (file)
index 0000000..2e4b028
Binary files /dev/null and b/chrome/icon.png differ
diff --git a/install.rdf b/install.rdf
new file mode 100644 (file)
index 0000000..7f7d670
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<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="Custom Button"
+    em:description="My custom toolbar button"
+    em:creator="My name"
+
+    em:id="custom-toolbar-button@example.com"
+    em:version="1.0"
+    em:homepageURL="http://developer.mozilla.org/en/docs/Custom_Toolbar_Button"
+
+    em:iconURL="chrome://custombutton/content/icon.png" >
+
+    <em:targetApplication><!-- Firefox -->
+      <Description
+        em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
+        em:minVersion="1.4"
+        em:maxVersion="99" />
+    </em:targetApplication>
+
+    <em:file>
+      <Description
+        about="urn:mozilla:extension:custombutton"
+        em:package="content/custombutton/" />
+    </em:file>
+
+  </Description>
+
+</RDF>
+