On Jan 5, 1:57 am, Tatablack <[email protected]> wrote:
> Hi, John. First, thanks.. comments below.
>
> On Jan 5, 5:37 am, John J Barton <[email protected]> wrote:
>
>
>
> > On Jan 4, 5:05 pm, Tatablack <[email protected]> wrote:
>
> > > Hi, all.
>
> > > I'm working on a Firebug extension meant to "beautify" JavaScript code
> > > as shown in the Script and Net panels (the beautifying work is done by
> > > the JS Beautifier library).
> > > The Net Panel stuff is finished (just one glitch left to be sorted
> > > out). I'm not sure which is the best way to go with the script panel,
> > > and that's why I'm here.
> > > I'm sorry if some of what I'll write may sound confused - it probably
> > > is, given that I'm still trying to understand Firebug's internals.
>
> > > I added a button in the Script toolbar, just to the right of the
> > > "fbLocationList" combo (the one showing available JS files).
>
> > To the left would be more in keeping with the design...
>
> In that toolbar, I see:
>
> fbScriptFilterMenu fbLocationSeparator fbLocationList
> fbDebuggerButtons
>
> Do you think that the new button should be placed between
> fbLocationSeparator and fbLocationList?

No, I'd put it to the extreme left, the first child of fbScriptButtons

>
> > > Clicking the button, I'm able to get the currently displayed JS text,
> > > like this:
>
> > > context.sourceCache.loadText(context.panelMap.script.location.href)
>
> > I'm not sure where you are putting your code, but in a panel it would
> > be this.context and this.location.  Especially the second expression is
> > quite odd.
>
> The code is executed when clicking on the new toolbar button.
> In the XUL source, the oncommand attribute of the toolbarbutton is:
>
> oncommand="Firebug.FireBeautyModule.beautifyScript(FirebugContext)"
>
> So, what I have is the context. I'm not sure if I can pass something
> besides FirebugContext... may I?

You could, it is just javascript...

> As to the second expression, I'll turn that into a question: if all I
> have is the context, how can I get the current panel and its location?

var panel = context.getPanel("script");

,,,

jjb
-- 
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.


Reply via email to