Plugin Developer DiscussionDiscussion for FogBugz Plugin developers |
||
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?
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.
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.
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. |
Powered by FogBugz