Plugin Developer Discussion

Discussion for FogBugz Plugin developers

Event for "page edit" ready?

I'm using the JQuery ready() function via my plugin to determine when a FB page is loaded. I'd also like to know when the Edit "page" is loaded -- but it doesn't trigger the ready event.

Is there another event I could use to know that FB is ready to edit a bug?
Ken Morse Send private email
Thursday, September 3, 2009
 
 
Unfortunately there doesn't seem to be a good way to detect this event right now.  I'll open a case for it.
David Fullerton Send private email
Friday, September 4, 2009
 
 
Thanks for the update, David.

What I really want to be able to do is execute some JavaScript on the client side -- but only when FB 7 is in "bug edit" mode -- is there perhaps some other way to accomplish this?
Ken Morse Send private email
Monday, September 7, 2009
 
 
The only way I can think to do this is to send down a <script> tag in one of the other interfaces used in BugEdit: IPluginBugEventDisplay, IPluginBugLink, IPluginBugDisplay.  You'll have to play around to see if this will actually work, and the timing might be tough because the scripts might run before the page is fully loaded.

Let me know how it goes.
David Fullerton Send private email
Tuesday, September 8, 2009
 
 
I have been using this JS function to detect edit mode in my plug-in.

It works for now, but is subject to break in future updates of FB if they change the XHTML of the page.


function isEditMode() {
    // this may need to be updated if FB changes HTML
    // or behavior, but it is necessary until this
    //functionality is available in the API.

    return ($("textarea[name=sEvent]").length > 0);
}
John Fuex Send private email
Thursday, September 10, 2009
 
 
Thanks John, I'll check it out.
Ken Morse Send private email
Friday, September 11, 2009
 
 
The only way I could figure out how to do this is by setting a timeout to fire repeatedly checking if the page was in edit mode (people wanted to do stuff on page load for the edit page using BugMonkey, but alas, the edit page is not really a page load... its an ajax transformation)
Michael Pryor Send private email
Friday, September 18, 2009
 
 
Could something be added via a plugin (perhaps a custom event) that could be used to signal "edit page" mode, Michael?
Ken Morse Send private email
Monday, September 21, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz