@Honza:
Thanks! The tutorials are really helpful for getting into Firebug
extension development!
I tried the the xpi but the activation does not work and the disable/
enable options are not added to the tab mini menu
When I add this.panelName = "myActivablePanel" to the
MyActivableModule - initialize method it works fine (using Firebug
1.5X.4)
Adding this.panelName to the initialize method:
Firebug.MyActivableModule = extend(Firebug.ActivableModule,
{
initialize: function()
{
this.panelName = "myActivablePanel";
Firebug.ActivableModule.initialize.apply(this, arguments);
if (FBTrace.DBG_ACTIVABLEPANEL)
FBTrace.sysout("ActivableModule.initialize;");
},
...
Also, getOptionsMenuItems has to be declared/overridden in the
extension.
It has to return at least an empty array/no custom menu items.
Otherwise the mini menu - enable and disable options will not be
added.
Thomas
On Sep 17, 2:54 pm, "Honza (Jan Odvarko)" <[email protected]> wrote:
> I tried to summarize the APIs
> here:http://www.softwareishard.com/blog/firebug-tutorial/extending-firebug...
>
> There is also an example xpi.
>
> Honza
>
> On Sep 17, 2:59 am, John J Barton <[email protected]> wrote:
>
> > Ok excellent! Can you suggest, based on your experience, where we
> > could add some documentation to make it clearer?
>
> > jjb
>
> > On Sep 16, 3:22 pm, tan <[email protected]> wrote:
>
> > > Hi again
>
> > > I have made the code to show the mini menu and the enable and disable
> > > options
> > > After studying the Firebug code and the Firecookie extension I found
> > > this (Ok! It is still a bit cargo cultish ;) )
>
> > > ActivablePanel - getOptionsMenuItems must be overridden, and return at
> > > least an empty array.
> > > ActivableModule - initialize override must set this.panelName =
> > > "myPanel"
>
> > > And offcourse the extension preference file must have:
>
> > > pref("extensions.firebug.myPanel.enableSites", false);
>
> > > Please comment if you see anything wrong, and again thanks for the
> > > tips and the replies
>
> > > Best regards,
> > > Thomas
>
> > > On Sep 16, 7:09 pm, tan <[email protected]> wrote:
>
> > > > No, running the code above, the tab does not have the mini menu at
> > > > all.
>
> > > > Thanks for the replies here,
>
> > > > Thomas
>
> > > > On Sep 16, 5:44 am, John J Barton <[email protected]> wrote:
>
> > > > > Does the panel tab mini-menu have enable/disable and does that part
> > > > > work?
>
> > > > > jjb
>
> > > > > On Sep 15, 2:17 pm, tan <[email protected]> wrote:
>
> > > > > > Yes, a typo from my side, there is also a wrongly placed comma in
> > > > > > the
> > > > > > last method in MyPanelModel ;)
>
> > > > > > After removing these bugs and I run the code, the panel is created
> > > > > > and
> > > > > > looks OK, but I expected the Fb tab to be disabled when I choose
> > > > > > Disable All Panels from the Firebug menu. This does not happen.
>
> > > > > > I may miss something here
>
> > > > > > Thomas
>
> > > > > > On Sep 15, 10:55 pm, Pedro Simonetti Garcia
> > > > > > <[email protected]>
> > > > > > wrote:
>
> > > > > > > Hi there,
>
> > > > > > > Just a small thing I have noticed:
>
> > > > > > > name : myPanel,
>
> > > > > > > should be
>
> > > > > > > name : "myPanel",
>
> > > > > > > Otherwise it seems to be correct.
>
> > > > > > > Pedro Simonetti.
>
> > > > > > > 2010/9/15 tan <[email protected]>:
>
> > > > > > > > Hi again
>
> > > > > > > > No, it did not work
>
> > > > > > > > Here is an outline of the code
>
> > > > > > > > Thomas
>
> > > > > > > > FBL.ns(function() { with ( FBL ) {
>
> > > > > > > > function MyPanel() {}
> > > > > > > > MyPanel.prototype = extend( Firebug.ActivablePanel,
> > > > > > > > {
> > > > > > > > name : myPanel,
> > > > > > > > title : "My Panel",
>
> > > > > > > > initialize : function()
> > > > > > > > {
> > > > > > > > Firebug.ActivablePanel.initialize.apply( this, arguments
> > > > > > > > );
> > > > > > > > },
>
> > > > > > > > shutdown : function()
> > > > > > > > {
> > > > > > > > Firebug.ActivableModule.shutdown.apply( this, arguments
> > > > > > > > );
> > > > > > > > },
>
> > > > > > > > destroy : function( state )
> > > > > > > > {
> > > > > > > > Firebug.unregisterUIListener(this);
> > > > > > > > Firebug.ActivablePanel.destroy.apply( this, arguments );
> > > > > > > > },
>
> > > > > > > > enablePanel: function(module)
> > > > > > > > {
> > > > > > > > Firebug.ActivablePanel.enablePanel.apply( this,
> > > > > > > > arguments );
> > > > > > > > },
>
> > > > > > > > disablePanel: function(module)
> > > > > > > > {
> > > > > > > > Firebug.ActivablePanel.disablePanel.apply( this,
> > > > > > > > arguments );
> > > > > > > > }
> > > > > > > > });
>
> > > > > > > > Firebug.MyPanelModel = extend( Firebug.ActivableModule,
> > > > > > > > {
> > > > > > > > initialize: function()
> > > > > > > > {
> > > > > > > > Firebug.ActivableModule.initialize.apply( this,
> > > > > > > > arguments );
> > > > > > > > },
>
> > > > > > > > initContext: function( context, persistedState )
> > > > > > > > {
> > > > > > > > Firebug.ActivableModule.initContext.apply( this,
> > > > > > > > arguments );
> > > > > > > > },
>
> > > > > > > > showContext: function( browser, context )
> > > > > > > > {
> > > > > > > > Firebug.ActivableModule.showContext.apply( this,
> > > > > > > > arguments );
> > > > > > > > },
>
> > > > > > > > loadedContext : function( context )
> > > > > > > > {
> > > > > > > > },
>
> > > > > > > > showPanel : function( browser, panel )
> > > > > > > > {
> > > > > > > > },
>
> > > > > > > > addStyleSheet : function( doc )
> > > > > > > > {
> > > > > > > > },
>
> > > > > > > > reattachContext : function( browser, context )
> > > > > > > > {
> > > > > > > > },
> > > > > > > > });
>
> > > > > > > > /* Domplate code */
>
> > > > > > > > /*
> > > > > > > > Registration
> > > > > > > > */
> > > > > > > > Firebug.registerPanel( MyPanel );
> > > > > > > > Firebug.registerActivableModule( Firebug.MyPanelModel );
>
> > > > > > > > }});
>
> > > > > > > > On Sep 14, 10:59 pm, John J Barton <[email protected]>
> > > > > > > > wrote:
> > > > > > > >> On Sep 14, 12:04 pm, tan <[email protected]> wrote:
>
> > > > > > > >> > Hi
>
> > > > > > > >> > Are there any information about how to use the
> > > > > > > >> > ActivablePanel?
>
> > > > > > > >> > My guess right now is that using ActivablePanel would create
> > > > > > > >> > a panel
> > > > > > > >> > that can be activated globally (Global: Activate/Disable All
> > > > > > > >> > Panels)
>
> > > > > > > >> > My first naive try was to use this
>
> > > > > > > >> > MyPanel.prototype = extend( Firebug.ActivablePanel,
>
> > > > > > > >> If you implement initialize() then you need to propagate it to
> > > > > > > >> the
> > > > > > > >> parent:
> > > > > > > >> Firebug.ActivablePanel.initialize.apply(this, arguments);
>
> > > > > > > >> And you need to register your new panel:
> > > > > > > >> Firebug.registerPanel(NetPanel);
>
> > > > > > > >> Does this help?
> > > > > > > >> jjb
>
> > > > > > > >> > ...
>
> > > > > > > >> > But I guess it needs some more configuration ;)
>
> > > > > > > >> > I have tried to look in the Fb source, but have not quite
> > > > > > > >> > figured it
> > > > > > > >> > out yet.
>
> > > > > > > >> > So, the question is how do we use the Activation thing?
>
> > > > > > > >> > Thanks in advance
>
> > > > > > > >> > Best regards,
> > > > > > > >> > Thomas
>
> > > > > > > > --
> > > > > > > > You received this message because you are subscribed to the
> > > > > > > > Google Groups "Firebug" group.
> > > > > > > > To post to this group, send email to [email protected].
> > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > [email protected].
> > > > > > > > For more options, visit this group
> > > > > > > > athttp://groups.google.com/group/firebug?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en.