Skip to content

Commit

Permalink
HelloBootAMD example: code update
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Aug 20, 2013
1 parent 49988fd commit ec31095
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 62 deletions.
3 changes: 1 addition & 2 deletions HelloBootAMD/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ function firebugFrameLoad(Firebug)
"chrome://hellobootamd/skin/hellobootamd.css");

// The registration process will automatically look for 'main' module and load it.
// The is the same what happens in a XUL overlay applied on:
// chrome://firebug/content/firebugOverlay.xul
// The is the same what happens in a XUL overlay (see HelloAMD example, mainOverlay.xul & .js)
var config = {id: "hellobootamd@janodvarko.cz"};
Firebug.registerExtension("hellobootamd", config);
}
Expand Down
5 changes: 0 additions & 5 deletions HelloBootAMD/chrome.manifest
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
content hellobootamd chrome/content/
skin hellobootamd classic/1.0 chrome/skin/classic/
locale hellobootamd en-US chrome/locale/en-US/

# The extension is bootstrapped in this scenario
# To switch to XUL overlay based extension change 'em:bootstrap' to false in install.rdf
# and use the following line:
#overlay chrome://firebug/content/firebugOverlay.xul chrome://hellobootamd/content/mainOverlay.xul
4 changes: 2 additions & 2 deletions HelloBootAMD/chrome/content/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ var theApp =
FBTrace.sysout("helloBootAMD; HelloBootAMD extension shutdown");

// Unregister all registered Firebug components
Firebug.unregisterPanel(Firebug.MyPanel);
Firebug.unregisterModule(Firebug.MyModule);
Firebug.unregisterPanel(MyPanel);
Firebug.unregisterModule(MyModule);
Firebug.unregisterStylesheet("chrome://hellobootamd/skin/hellobootamd.css");
Firebug.unregisterStringBundle("chrome://hellobootamd/locale/hellobootamd.properties");

Expand Down
39 changes: 0 additions & 39 deletions HelloBootAMD/chrome/content/mainOverlay.js

This file was deleted.

4 changes: 0 additions & 4 deletions HelloBootAMD/chrome/content/mainOverlay.xul

This file was deleted.

6 changes: 3 additions & 3 deletions HelloBootAMD/chrome/content/myModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function(Obj, FBTrace) {
// ********************************************************************************************* //
// Custom Module Implementation

Firebug.MyModule = Obj.extend(Firebug.Module,
var MyModule = Obj.extend(Firebug.Module,
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Initialization
Expand All @@ -36,9 +36,9 @@ Firebug.MyModule = Obj.extend(Firebug.Module,
// ********************************************************************************************* //
// Registration

Firebug.registerModule(Firebug.MyModule);
Firebug.registerModule(MyModule);

return Firebug.MyModule;
return MyModule;

// ********************************************************************************************* //
});
15 changes: 8 additions & 7 deletions HelloBootAMD/chrome/content/myPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ function(Obj, FBTrace, Locale, Domplate) {

var panelName = "hellobootamd";

Firebug.MyPanel = function MyPanel() {};
Firebug.MyPanel.prototype = Obj.extend(Firebug.Panel,
function MyPanel() {};
MyPanel.prototype = Obj.extend(Firebug.Panel,
{
name: panelName,
title: "Hello Boot AMD!",
Expand Down Expand Up @@ -66,13 +66,14 @@ Firebug.MyPanel.prototype = Obj.extend(Firebug.Panel,
// Register locales before the following template definition.
Firebug.registerStringBundle("chrome://hellobootamd/locale/hellobootamd.properties");

var {domplate, SPAN} = Domplate;

/**
* 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) {
Firebug.MyPanel.prototype.MyTemplate = domplate(
MyPanel.prototype.MyTemplate = domplate(
{
tag:
SPAN(
Expand All @@ -83,18 +84,18 @@ Firebug.MyPanel.prototype.MyTemplate = domplate(
{
this.tag.replace({}, parentNode);
}
})}
});

// ********************************************************************************************* //
// Registration

Firebug.registerPanel(Firebug.MyPanel);
Firebug.registerPanel(MyPanel);
Firebug.registerStylesheet("chrome://hellobootamd/skin/hellobootamd.css");

if (FBTrace.DBG_HELLOBOOTAMD)
FBTrace.sysout("helloBootAMD; myPanel.js, stylesheet registered");

return Firebug.MyPanel;
return MyPanel;

// ********************************************************************************************* //
});

0 comments on commit ec31095

Please sign in to comment.