need help on side panels

101 views
Skip to first unread message

Prasanna Bale

unread,
Mar 7, 2012, 1:21:05 PM3/7/12
to fir...@googlegroups.com
Hi,

I am working on developing an extension to Firebug. In my tool I have one main panel with couple of toolbar buttons and side panels.

I have to delete/remove/add the side panel after it is registered with the main panel (specially, when I click on any toolbarbutton of the main panel). can I do it and if so how?

I did used Firebug.unregisterPanel(panelType, state); but this function still shows the side panel.

Thanks,
Prasanna






Jan Honza Odvarko

unread,
Mar 8, 2012, 4:23:48 AM3/8/12
to fir...@googlegroups.com
Yep, I can also see the problem. The UI is not properly updated
(switching to another panel and back helps)

Please report a new issue, cross post here the number, and I'll fix it.

Honza

Prasanna Bale

unread,
Mar 8, 2012, 2:28:17 PM3/8/12
to fir...@googlegroups.com
Hi Honza,

I reported the issue into Firebug and the issue number is: 5309
Can you please fix this asap. I have to give a Demo on my tool in less than a week.

Thanks in advance,
Prasanna


--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com
To unsubscribe from this group, send email to
firebug+u...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug



--
Prasanna Bale
Visiting Software Developer - UIUC (DRES)
Tel: (217) 244-1669




Jan Honza Odvarko

unread,
Mar 8, 2012, 3:03:43 PM3/8/12
to fir...@googlegroups.com
On Thursday, March 8, 2012 8:28:17 PM UTC+1, pbale wrote:
Hi Honza,

I reported the issue into Firebug and the issue number is: 5309
Can you please fix this asap. I have to give a Demo on my tool in less than a week.
OK, putting this on top of my TODO list :-)
Honza
 

Jan Honza Odvarko

unread,
Mar 9, 2012, 7:42:35 AM3/9/12
to fir...@googlegroups.com
OK, the problem should be fixed. Also take a look at the SidePanel extension example here:
https://github.com/firebug/extension-examples/tree/master/SidePanel

Honza

Prasanna Bale

unread,
Mar 10, 2012, 12:49:48 AM3/10/12
to fir...@googlegroups.com
Thank you so much Honza. 
I did downloaded the new firebug 1.10.0a5.xpi and successfully able to delete and append the side panels .
I did looked in to the sidePanel example. its very clear. I really appreciate it.

Thanks once again

Prasanna



--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com
To unsubscribe from this group, send email to
firebug+u...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug

Prasanna Bale

unread,
Jul 31, 2012, 4:28:55 PM7/31/12
to fir...@googlegroups.com
Hello Honza,

I got a problem again with the creation of side panels. I am using Firebug 1.11.0a0

Now my panel have two toolbarbuttons say tb1 and tb2. tb1 has a side panel sp1 and tb2 should have a sidepanel sp2.

Here is the procedure to reproduce the issue:

1. click on mypanel
2. click on toolbarbutton tb1 shows sidepanel sp1
3.click on  toolbarbutton tb2 shows sidepanel sp2
4. again click on  toolbarbutton tb1 does not show sp1

I can see the panel object having the sp1 panel but I don't see on the mypanel in Firebug.

And again if I have a common sidepanel in both buttons its working fine.

Thank you in advance,
Prasanna

--
Prasu



Jan Honza Odvarko

unread,
Aug 1, 2012, 7:30:10 AM8/1/12
to Firebug
Is your extension available somewhere?
How can I test it on my machine?

Honza

On Jul 31, 10:28 pm, Prasanna Bale <bale.prasa...@gmail.com> wrote:
> Hello Honza,
>
> I got a problem again with the creation of side panels. I am using Firebug
> 1.11.0a0
>
> Now my panel have two toolbarbuttons say tb1 and tb2. tb1 has a side panel
> sp1 and tb2 should have a sidepanel sp2.
>
> Here is the procedure to reproduce the issue:
>
> 1. click on mypanel
> 2. click on toolbarbutton tb1 shows sidepanel sp1
> 3.click on  toolbarbutton tb2 shows sidepanel sp2
> 4. again click on  toolbarbutton tb1 does not show sp1
>
> I can see the panel object having the sp1 panel but I don't see on the
> mypanel in Firebug.
>
> And again if I have a common sidepanel in both buttons its working fine.
>
> Thank you in advance,
> Prasanna
>
> On Fri, Mar 9, 2012 at 11:49 PM, Prasanna Bale <bale.prasa...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > Thank you so much Honza.
> > I did downloaded the new firebug 1.10.0a5.xpi and successfully able to
> > delete and append the side panels .
> > I did looked in to the sidePanel example. its very clear. I really
> > appreciate it.
>
> > Thanks once again
>
> > Prasanna
>

Prasanna Bale

unread,
Aug 1, 2012, 1:00:26 PM8/1/12
to fir...@googlegroups.com
Honza,

Please find the attached xpi of my extension called ainspector.xpi. This works on Windows XP and Windows 7 and hopefully works on MAC.


Procedure to reproduce the problem.
  1. Open FireFox , Open Firebug
  2. Click on A11y Panel which will have 'Images', 'Controls' and 'Color Contrast' toolbar buttons
  3. By Default 'Images' toolbar button  and 'Rule Results' side panel are selected
  4. Then click on 'Color Contrast' toolbar button will have 'Font Properties' side panel
  5. Now If I again click on 'Images' toolbar button, there would be no side panel. 
  • My main javascript file is under chrome/content/ainspector-firebug.js
  • The method AINSPECTOR_FB.tabPanelUtil.addAndRemoveSidePanels() takes care of adding of removing the side panels is under Chrome/content/panel-util.js
Please let me know if you need any other information.


Thanks,
Prasanna
Prasu



ainspector.zip

Jan Honza Odvarko

unread,
Aug 2, 2012, 8:27:11 AM8/2/12
to Firebug
Hi Prasanna,

addAndRemoveSidePanels, should first, unregister the panel and then
registers new one.
(i.e. onRemoveSidePanel and then onAppendSidePanel);

It would be great if you can investigate the panel syncing logic here:
https://github.com/firebug/firebug/blob/master/extension/content/firebug/firefox/bindings.xml#L86

Perhaps we could improve it so, the order doesn't matter?

addAndRemoveSidePanels : function(flag) {
FBTrace.sysout("addAndRemoveSidePanels")
var panelType_rules = Firebug.getPanelType("rulesSidePanel");
var panelType_colorContrast =
Firebug.getPanelType("colorContrastSidePanel");

/* flag == true if it is other than color contrast toolbar
button*/
if (flag) {
if (panelType_colorContrast) {

AINSPECTOR_FB.font_properties_registered =
panelType_colorContrast;

AINSPECTOR_FB.tabPanelUtil.onRemoveSidePanel(panelType_colorContrast);
}

if (panelType_rules) {
//nothing
} else {
FBTrace.sysout("AINSPECTOR_FB.rules_registered: ",
AINSPECTOR_FB.rules_registered);
panelType_rules = AINSPECTOR_FB.rules_registered;

AINSPECTOR_FB.tabPanelUtil.onAppendSidePanel(panelType_rules);

}

} else { //if it is only color contrast panel

if (panelType_rules) {
AINSPECTOR_FB.rules_registered = panelType_rules;

AINSPECTOR_FB.tabPanelUtil.onRemoveSidePanel(panelType_rules);
}

if (panelType_colorContrast) {
//nothing
} else {
panelType_colorContrast =
AINSPECTOR_FB.font_properties_registered;

AINSPECTOR_FB.tabPanelUtil.onAppendSidePanel(panelType_colorContrast);
}

}
}

Some other notes:

1) The 'raw' argument in highlight method (panel-utils.js) was
undefined so, I appended the following condition
if (!row)
return;

So, I was able to see the toolbar with buttons (Images, Controls, …)

2) panel.name is an identifier it should not be translated
You should only translate the panel title (the title property).

3) The same for parentPanel it’s also an identifier and should not be
translated.

4) I wouldn’t recommend using DTD for locales, DTD entities are not
scriptable
and so you can’t avoid errors if there is a missing translation (DTD
entity) and e.g.
fallback to English string.

5) You don’t need an extra $AI_STR, just register your string bundle
with
Firebug.registerStringBundle and use Locale.$STR (or FBL.$STR)

6) dependents: should use identifiers of panels not titles.

7) You should consider switching to AMD syntax.

Honza

Prasanna Bale

unread,
Aug 2, 2012, 5:07:34 PM8/2/12
to fir...@googlegroups.com
Thank you Honza for the solution of side panel and the suggestions. I will implement them and follow your feedback.

Thank you once again.
Prasanna

 


Honza

--
You received this message because you are subscribed to the Google
Groups "Firebug" group.
To post to this group, send email to fir...@googlegroups.com
To unsubscribe from this group, send email to
firebug+u...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/firebug



--
Prasu



Jan Honza Odvarko

unread,
Aug 3, 2012, 2:59:42 AM8/3/12
to Firebug
You are welcome :-)

> It would be great if you can investigate the panel syncing logic here:
> https://github.com/firebug/firebug/blob/master/extension/content/fire...
> Perhaps we could improve it so, the order doesn't matter?
Please take a loot at this, if it makes sense to improve the API,
file
a new issue report so, it isn't forgotten here in the noise.

Thanks!
Honza

On Aug 2, 11:07 pm, Prasanna Bale <bale.prasa...@gmail.com> wrote:
> Thank you Honza for the solution of side panel and the suggestions. I will
> implement them and follow your feedback.
>
> Thank you once again.
> Prasanna
>
> On Thu, Aug 2, 2012 at 7:27 AM, Jan Honza Odvarko <odva...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi Prasanna,
>
> > addAndRemoveSidePanels, should first, unregister the panel and then
> > registers new one.
> > (i.e. onRemoveSidePanel and then onAppendSidePanel);
>
> > It would be great if you can investigate the panel syncing logic here:
>
> >https://github.com/firebug/firebug/blob/master/extension/content/fire...
Reply all
Reply to author
Forward
0 new messages