jjb, My problem is that i need both the original node in the original DOM and the value clicked on, and this was not possible with a listener in Editor since at that time the original node is not set anymore.
I've did some testings on getContextMenuItems and it's exactly what i need since at that time, both node and target are set. Unfortunately, i did not manage to monkey patch this function the way you describe. I've inserted your code in my model and in my panel prototype and it does not seem to patch anything. What is weird is that you send only one parameter (event) instead of node,target i think i must be a typo. I think i'm very close but i lack something to cross the finish line... (apart from javascript knowledge) Could you please guide on where to put this code? Gregory Le 19 mars 2010 à 18:13, John J Barton a écrit : > > > On Mar 19, 10:02 am, Duchesnes Grégory - Ilomedia > <[email protected]> wrote: >> Still talking to myself... >> >> Apparently there's no listener available to find which attribute has been >> clicked (source >> :http://groups.google.com/group/firebug-working-group/web/firebug-even...) >> I've also tried to implement a contextMenu the way Codeburner does, it seems >> to work but i can not find the original node either so it does not help. > > If you can explain what you want to achieve maybe we can help. > >> >> From what i read my last resort is to monkey patch getContextMenuItems, >> but... how do i monkey patch Firebug? I tried to extend HtmlPanel in my >> class but it failed >> Example welcome (and i leave you alone after that) > > Something like: > var fbGetContextMenuItems = Firebug.HTMLPanel.getContextMenuItems; > Firebug.HTMLPanel.getContextMenuItems = function(event) > { > var items = fbGetContextMenuItems(event); > items.push(myGreatItem); > return items; > } > > >> >> Greg >> >> Le 19 mars 2010 à 15:14, Duchesnes Grégory - Ilomedia a écrit : >> >>> Well, >> >>> i was not that stupid. >> >>> Indeed i managed to register to an event listener in Editor but the problem >>> is that it only allow me to get the value of the edited element and not its >>> type (i'd like to know if i'm editing the name of an attribute or its >>> value). >>> Is there another listener for that or maybe a property in currentPanel and >>> currentEditor? >> >>> thanks, >>> Gregory >> >>> Le 19 mars 2010 à 14:59, Duchesnes Grégory - Ilomedia a écrit : >> >>>> I'm feeling stupid sometimes, i guess it was to obvious : >> >>>> Firebug.Editor.addListener(this); >> >>>> Le 19 mars 2010 à 14:44, Duchesnes Grégory - Ilomedia a écrit : >> >>>>> Hi all, >> >>>>> follow up of my previous post, i'm now trying to use event listeners. >> >>>>> Here is what i need : >>>>> when someone clicks on an attribute in the HTML panel i need to send a >>>>> message to my own panel saying "hey an attribute has been clicked in HTML >>>>> panel". >> >>>>> i've spotted somme event listeners in editor.js, html.js and a11y.js but >>>>> i'm not sure how to use them (i'm no javascript guru in fact). Is there >>>>> an example on how to instantiate a listener in my panel? >>>>> Should i instantiate it in my prototype or in my model? >> >>>>> i've tried this for example, but it does not seem to work :( >> >>>>> var htmlPanelNode = this.context.getPanel('html').panelNode; >>>>> htmlPanelNode.addEventListener("click", this.onHtmlClick, false); >> >>>>> thanks for the help, >> >>>>> Gregory >> >>>>> -- >>>>> 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 >>>> 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 >>> 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. -- 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.
