Permalink
Browse files

Initial commit

  • Loading branch information...
janodvarko committed Mar 7, 2012
0 parents commit c2a76a51f11dfbcf11a1b0b6331e3ee7f45fb569
Showing with 2,521 additions and 0 deletions.
  1. +7 −0 HelloAMD/chrome.manifest
  2. +54 −0 HelloAMD/chrome/content/main.js
  3. +36 −0 HelloAMD/chrome/content/mainOverlay.js
  4. +4 −0 HelloAMD/chrome/content/mainOverlay.xul
  5. +44 −0 HelloAMD/chrome/content/myModule.js
  6. +100 −0 HelloAMD/chrome/content/myPanel.js
  7. +1 −0 HelloAMD/chrome/locale/en-US/helloamd.properties
  8. +23 −0 HelloAMD/chrome/skin/classic/helloamd.css
  9. +1 −0 HelloAMD/defaults/preferences/prefs.js
  10. +24 −0 HelloAMD/install.rdf
  11. +30 −0 HelloAMD/license.txt
  12. +14 −0 HelloAMD/readme.txt
  13. +3 −0 HelloBootAMD/ant.properties
  14. +124 −0 HelloBootAMD/bootstrap.js
  15. +36 −0 HelloBootAMD/build.xml
  16. +8 −0 HelloBootAMD/chrome.manifest
  17. +52 −0 HelloBootAMD/chrome/content/main.js
  18. +39 −0 HelloBootAMD/chrome/content/mainOverlay.js
  19. +4 −0 HelloBootAMD/chrome/content/mainOverlay.xul
  20. +44 −0 HelloBootAMD/chrome/content/myModule.js
  21. +100 −0 HelloBootAMD/chrome/content/myPanel.js
  22. +1 −0 HelloBootAMD/chrome/locale/en-US/hellobootamd.properties
  23. +23 −0 HelloBootAMD/chrome/skin/classic/hellobootamd.css
  24. +1 −0 HelloBootAMD/defaults/preferences/prefs.js
  25. +26 −0 HelloBootAMD/install.rdf
  26. +30 −0 HelloBootAMD/license.txt
  27. +22 −0 HelloBootAMD/readme.txt
  28. +2 −0 HelloWorld/chrome.manifest
  29. +80 −0 HelloWorld/chrome/content/helloworld/helloWorld.js
  30. +21 −0 HelloWorld/chrome/content/helloworld/helloWorld.xul
  31. +2 −0 HelloWorld/defaults/preferences/prefs.js
  32. +24 −0 HelloWorld/install.rdf
  33. +3 −0 LinkInspector/chrome.manifest
  34. +190 −0 LinkInspector/chrome/content/inspector.js
  35. +6 −0 LinkInspector/chrome/content/inspector.xul
  36. +34 −0 LinkInspector/chrome/skin/classic/inspector.css
  37. +1 −0 LinkInspector/defaults/preferences/prefs.js
  38. +25 −0 LinkInspector/install.rdf
  39. +63 −0 SidePanel/bootstrap.js
  40. +1 −0 SidePanel/chrome.manifest
  41. +38 −0 SidePanel/chrome/content/main.js
  42. +43 −0 SidePanel/chrome/content/myNetSidePanel.js
  43. +37 −0 SidePanel/chrome/content/myPanel.js
  44. +42 −0 SidePanel/chrome/content/mySidePanel.js
  45. +23 −0 SidePanel/install.rdf
  46. +30 −0 SidePanel/license.txt
  47. +11 −0 TabularUI/.project
  48. +63 −0 TabularUI/bootstrap.js
  49. +1 −0 TabularUI/chrome.manifest
  50. +34 −0 TabularUI/chrome/content/main.js
  51. +72 −0 TabularUI/chrome/content/tabularDataPanel.js
  52. +23 −0 TabularUI/install.rdf
  53. +30 −0 TabularUI/license.txt
  54. +79 −0 Toolbar/bootstrap.js
  55. +3 −0 Toolbar/chrome.manifest
  56. +38 −0 Toolbar/chrome/content/main.js
  57. +45 −0 Toolbar/chrome/content/myListener.js
  58. +58 −0 Toolbar/chrome/content/myModule.js
  59. +63 −0 Toolbar/chrome/content/myPanel.js
  60. +5 −0 Toolbar/chrome/locale/en-US/toolbar.properties
  61. BIN Toolbar/chrome/skin/classic/button.png
  62. +23 −0 Toolbar/install.rdf
  63. +30 −0 Toolbar/license.txt
  64. +2 −0 cachelistener/chrome.manifest
  65. +103 −0 cachelistener/chrome/content/cachelistener/cacheListener.js
  66. +4 −0 cachelistener/chrome/content/cachelistener/cacheListener.xul
  67. +2 −0 cachelistener/defaults/preferences/prefs.js
  68. +24 −0 cachelistener/install.rdf
  69. +2 −0 infotip/chrome.manifest
  70. +96 −0 infotip/chrome/content/infoTip.js
  71. +5 −0 infotip/chrome/content/infoTip.xul
  72. +3 −0 infotip/defaults/preferences/prefs.js
  73. +24 −0 infotip/install.rdf
  74. +5 −0 netlistener/chrome.manifest
  75. +123 −0 netlistener/chrome/content/netlistener/netListener.js
  76. +4 −0 netlistener/chrome/content/netlistener/netListener.xul
  77. 0 netlistener/chrome/locale/en-US/netListener.properties
  78. +4 −0 netlistener/chrome/skin/classic/netListener.css
  79. +2 −0 netlistener/defaults/preferences/prefs.js
  80. +24 −0 netlistener/install.rdf
@@ -0,0 +1,7 @@
+content helloamd chrome/content/
+skin helloamd classic/1.0 chrome/skin/classic/
+locale helloamd en-US chrome/locale/en-US/
+
+resource helloamd chrome/
+
+overlay chrome://firebug/content/firebugOverlay.xul chrome://helloamd/content/mainOverlay.xul
@@ -0,0 +1,54 @@
+/* See license.txt for terms of usage */
+
+define([
+ "firebug/lib/trace",
+ "firebug/trace/traceModule",
+ "firebug/trace/traceListener",
+ "helloamd/myPanel",
+ "helloamd/myModule",
+],
+function(FBTrace, TraceModule, TraceListener) {
+
+// ********************************************************************************************* //
+// Documentation
+//
+// Firebug coding style: http://getfirebug.com/wiki/index.php/Coding_Style
+// Firebug tracing: http://getfirebug.com/wiki/index.php/FBTrace
+
+// ********************************************************************************************* //
+// The application/extension object
+
+var theApp =
+{
+ initialize: function()
+ {
+ // Register trace customization listener for FBTrace. DBG_HELLOAMD represents a CSS rule
+ // that is automatially associated with all logs prefixed with "helloAMD;".
+ // The prefix is removed (third parameter is true).
+ // The last parameter represents URL of the stylesheet that should be used by
+ // the tracing console.
+ this.traceListener = new TraceListener("helloAMD;", "DBG_HELLOAMD", true,
+ "resource://helloamd/skin/classic/helloamd.css");
+ TraceModule.addListener(this.traceListener);
+
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; HelloAMD extension initialize");
+
+ // TODO: Extension initialization
+ },
+
+ shutdown: function()
+ {
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; HelloAMD extension shutdown");
+
+ // TODO: Extension shutdown
+
+ TraceModule.removeListener(this.traceListener);
+ }
+}
+
+return theApp;
+
+// ********************************************************************************************* //
+});
@@ -0,0 +1,36 @@
+/* See license.txt for terms of usage */
+
+// ********************************************************************************************* //
+// Author: Jan Odvarko, odvarko@gmail.com
+//
+// Use this file together with mainOverlay.xul that loads the entire extension. This file
+// can be used as is, the only thing you need to provide is unique "extensionName" <ext-name>
+//
+// Search for <ext-name> keyword thourough this extension and replace by unique ID.
+//
+// Content of the mainOverlay.xul overlay should look like as follows:
+//
+// <?xml version="1.0"?>
+// <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+// <script type="application/x-javascript" src="chrome://<ext-name>/content/mainOverlay.js"/>
+// </overlay>
+//
+// The mainOverlay.xul file is used only to load the extension. The loading proces can be
+// also done through bootstrap.js (restartless Firefox support), but it needs additional
+// Firebug APIs support.
+//
+// Do not use XUL for any UI (you wouldn't be able to use restartless add-on support later).
+// Firebug UI should be extended only through Firebug related API.
+
+// ********************************************************************************************* //
+// Registration
+
+// Notice that <ext-name> is used to build chrome paths like: chrome://<ext-name>/content/main.js
+// The <ext-name> should comd from chrome.manifest: resource helloamd chrome/
+
+// The registration process will automatically look for 'main' module and load it.
+// TODO: Replace with your extension credentials.
+var config = {id: "helloamd@janodvarko.cz"};
+Firebug.registerExtension("helloamd", config);
+
+// ********************************************************************************************* //
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <script type="application/x-javascript" src="chrome://helloamd/content/mainOverlay.js"/>
+</overlay>
@@ -0,0 +1,44 @@
+/* See license.txt for terms of usage */
+
+define([
+ "firebug/lib/object",
+ "firebug/lib/trace",
+],
+function(Obj, FBTrace) {
+
+// ********************************************************************************************* //
+// Custom Module Implementation
+
+Firebug.MyModule = Obj.extend(Firebug.Module,
+{
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Initialization
+
+ initialize: function(owner)
+ {
+ Firebug.Module.initialize.apply(this, arguments);
+
+ // TODO: Module initialization (there is one module instance per browser window)
+
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; MyModule.initialize");
+ },
+
+ shutdown: function()
+ {
+ Firebug.Module.shutdown.apply(this, arguments);
+
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; MyModule.shutdown");
+ },
+});
+
+// ********************************************************************************************* //
+// Registration
+
+Firebug.registerModule(Firebug.MyModule);
+
+return Firebug.MyModule;
+
+// ********************************************************************************************* //
+});
@@ -0,0 +1,100 @@
+/* See license.txt for terms of usage */
+
+define([
+ "firebug/lib/object",
+ "firebug/lib/trace",
+ "firebug/lib/locale",
+ "firebug/lib/domplate"
+],
+function(Obj, FBTrace, Locale, Domplate) {
+
+// ********************************************************************************************* //
+// Custom Panel Implementation
+
+var panelName = "helloamd";
+
+function MyPanel() {}
+MyPanel.prototype = Obj.extend(Firebug.Panel,
+{
+ name: panelName,
+ title: "Hello AMD World!",
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Initialization
+
+ initialize: function()
+ {
+ Firebug.Panel.initialize.apply(this, arguments);
+
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; MyPanel.initialize");
+
+ // TODO: Panel initialization (there is one panel instance per browser tab)
+
+ this.refresh();
+ },
+
+ destroy: function(state)
+ {
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; MyPanel.destroy");
+
+ Firebug.Panel.destroy.apply(this, arguments);
+ },
+
+ show: function(state)
+ {
+ Firebug.Panel.show.apply(this, arguments);
+
+ if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; MyPanel.show");
+ },
+
+ refresh: function()
+ {
+ // Render panel content. The HTML result of the template corresponds to:
+ //this.panelNode.innerHTML = "<span>" + Locale.$STR("helloamd.panel.label") + "</span>";
+ this.MyTemplate.render(this.panelNode);
+
+ // TODO: Render panel content
+ }
+});
+
+// ********************************************************************************************* //
+// Panel UI (Domplate)
+
+// Register locales before the following template definition.
+Firebug.registerStringBundle("chrome://helloamd/locale/helloamd.properties");
+
+/**
+ * Domplate template used to render panel's content. Note that the template uses
+ * localized strings and so, Firebug.registerStringBundle for the appropriate
+ * locale file must be already executed at this moment.
+ */
+with (Domplate) {
+MyPanel.prototype.MyTemplate = domplate(
+{
+ tag:
+ SPAN(
+ Locale.$STR("helloamd.panel.label")
+ ),
+
+ render: function(parentNode)
+ {
+ this.tag.replace({}, parentNode);
+ }
+})}
+
+// ********************************************************************************************* //
+// Registration
+
+Firebug.registerPanel(MyPanel);
+Firebug.registerStylesheet("resource://helloamd/skin/classic/helloamd.css");
+
+if (FBTrace.DBG_HELLOAMD)
+ FBTrace.sysout("helloAMD; myPanel.js, stylesheet registered");
+
+return MyPanel;
+
+// ********************************************************************************************* //
+});
@@ -0,0 +1 @@
+helloamd.panel.label=Hello AMD World!
@@ -0,0 +1,23 @@
+/* See license.txt for terms of usage */
+
+/*************************************************************************************************/
+
+/* Style applied on the panel node.
+ Rule syntax: .panelNode-<ext-id> */
+.panelNode-helloamd {
+ overflow: hidden;
+ color: green;
+ padding: 10px;
+ font-size: 12px;
+ font-weight: bold;
+}
+
+/*************************************************************************************************/
+
+/* Firebug Tracing Console customization. All messages from this example use this color.
+ This helps to distinguish logs from those coming from Firebug
+ Rule syntax: .DBG_<ext-id>
+ See: http://getfirebug.com/wiki/index.php/FBTrace for more details */
+.DBG_HELLOAMD {
+ color: rgb(101, 0, 114);
+}
@@ -0,0 +1 @@
+pref("extensions.firebug.DBG_HELLOAMD", true);
@@ -0,0 +1,24 @@
+<?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:id>helloamd@janodvarko.cz</em:id>
+ <em:version>0.5</em:version>
+
+ <!-- Firefox -->
+ <em:targetApplication>
+ <Description>
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
+ <em:minVersion>4.0</em:minVersion>
+ <em:maxVersion>20.0.*</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+
+ <em:name>Hello AMD!</em:name>
+ <em:description>Firebug Hello AMD extension shows how to use Asynchronous Module Definition in Firebug extensions</em:description>
+ <em:creator>Jan Odvarko</em:creator>
+ <em:homepageURL>http://www.janodvarko.cz</em:homepageURL>
+ </Description>
+</RDF>
@@ -0,0 +1,30 @@
+Software License Agreement (BSD License)
+
+Copyright (c) 2007, Parakey Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+* Neither the name of Parakey Inc. nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior
+ written permission of Parakey Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,14 @@
+/* See license.txt for terms of usage */
+
+Author: Jan Odvarko, odvarko@gmail.com
+
+This extension serves as an example of a Firebug extension based on
+Asynchronous Module Definition (AMD)
+
+Support APIs for AMD based extension is introduced in Firebug 1.9
+
+TODO:
+
+* Firebug needs API for creating a new toolbar and appending a button
+ into an existing toolbar. This shouldn't be done through XUL overlays
+ anymore (to support restartless/bootstrapped extensions in the future)
@@ -0,0 +1,3 @@
+# DO NOT MERGE INTO TRUNK
+RELEASE=.1
+VERSION=0.5
Oops, something went wrong.

0 comments on commit c2a76a5

Please sign in to comment.