Plugin Developer Discussion

Discussion for FogBugz Plugin developers

Manipulating CSS classes using a plug-in

Is there a way within a plug-in to manipulate the CSS class applied to the text of a case or individual history items on a case?

Here is an over-simplified example that explains what I am trying to do without going into the gory details of my plug-in idea.

* Add a new field to a case called "Color".
* Depending on the value, display the body of the case in the color specified based on the field value.


I'm thinking that maybe the best way to implement this would be to somehow inject my code to manipulate/Add HTML between when FB reads the case details and displays them in the form. Is this possible with the plug-in API?
John Fuex Send private email
Monday, June 8, 2009
 
 
I've been playing with this some more tonight and the only way I have found to do remotely what I am trying to accomplish is to implement the BugCommitBefore method in IPluginBugCommit and insert some extra HTML into the BugEvent.sHTML property.

I'd definitely prefer to not have to edit the actual contents of the bug to do this.

Any chance we could some methods added to the IPluginBugEventDisplay interface with a method BugEventViewDisplay that is called for each event entry?

This would give me both a way to tweak the HTML formatting AND introduce a new way to add a hook for Event specific UI elements (implemented as HTML links).

I've got two or three ideas for plug-ins that this would make possible.
John Fuex Send private email
Monday, June 8, 2009
 
 
This is something we had considered for a future version, but your post and the Markdown plugin on uservoice are enough to convince me to open a case to try to get it done for release.  The interface I'm thinking of would be something along the lines of

interface IPluginBugEventDisplay
{
    string BugEventDisplay(CBug bug, CBugEvent event)
}

where the string returned is an HTML string to display where the comments are displayed.
David Fullerton Send private email
Tuesday, June 9, 2009
 
 
It seems like there is a contention problem here. What about this:

interface IPluginBugEventDisplay
{
    string BugEventDisplay(CBug bug, CBugEvent event, string currentresults)
}

That way the calls to BugEventDisplay could be chained between together, and TranslateTextIntoLinks could be called before passing control to this interface.
Stefan Rusek Send private email
Wednesday, June 10, 2009
 
 
Good point.  I would have figured that out eventually :)  It'll work like IPluginWikiPageDisplay.
David Fullerton Send private email
Wednesday, June 10, 2009
 
 

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

Other recent topics Other recent topics
 
Powered by FogBugz