[[PageOutline(2-5,Contents,pullout)]] = Hide ticket changes based on configurable rules == Description Tickets can get noisy with lots of changes. This plugin hides a configurable set of changes to reduce this clutter. A button toggles between showing and hiding the changes. See [wiki:HideChangesPlugin#Configuration examples below]. '''SECURITY WARNING:''' This plugin processes freeform !JavaScript/jQuery code from the {{{trac.ini}}} file. If this is a security concern in your Trac deployment, please do not use this plugin. == Bugs/Feature Requests Existing bugs and feature requests for HideChangesPlugin are [report:9?COMPONENT=HideChangesPlugin here]. If you have any issues, create a [/newticket?component=HideChangesPlugin new ticket]. [[TicketQuery(component=HideChangesPlugin&group=type,format=progress)]] == Download Download the zipped source from [export:hidechangesplugin here]. == Source You can check out HideChangesPlugin from [/svn/hidechangesplugin here] using Subversion, or [source:hidechangesplugin browse the source] with Trac. == Installation 1. Install the plugin after downloading and unzipping: {{{#!sh cd hidechangesplugin/trunk sudo python setup.py bdist_egg sudo cp dist/TracHideChanges*.egg /your/trac/location/plugins/ }}} See [http://trac.edgewall.org/wiki/TracPlugins TracPlugins] for more installation details and options. You'll likely need to restart Trac's web server after installation. 2. Enable the plugin by adding the following to your `trac.ini` file: {{{#!ini [components] hidechanges.* = enabled }}} You can alternatively use the Trac Web Admin GUI to enable any or all rules. 3. Create rules in the {{{[hidechanges]}}} section of {{{trac.ini}}} for which changes to hide. See the configuration options below for details and ideas. == Configuration You define rules using the {{{rule.}}} option in the {{{[hidechanges]}}} section of {{{trac.ini}}} as freeform !JavaScript/jQuery 1.8.7 code. Each rule {{{}}} must be unique. Each rule (code) must evaluate to either {{{true}}} or {{{false}}}. If {{{true}}}, the change will be hidden. A {{{changediv}}} jQuery object is available to use within each rule. An example can be helpful to explain this more concretely. === Hide commentless changes The most common type of changes to want to hide are commentless changes, eg when just a field changes without any comment. Here's how you would configure this rule in {{{trac.ini}}}: {{{#!ini [hidechanges] rule.commentless = !changediv.find('div.comment').children().length show_button_name = Show commentless changes hide_button_name = Hide commentless changes }}} The above rule is named {{{commentless}}}. It checks the change div's comment div for any children. If no children are found (length = {{{0}}}), that means the change is commentless. Since the rule needs to evaluate to {{{true}}} to hide a change, we negate the result with a {{{!}}}. In this example, we also changed the default button names to make it clear what type of comments are hidden. The button's name changes as the changes are shown or hidden. === Hide changeset changes To hide changeset changes that are in the Trac 0.12 wiki syntax: {{{#!ini [hidechanges] rule.changeset = changediv.find('p a.changeset').children().length }}} This {{{changeset}}} rule checks for an href node with the {{changeset}}} class, this is the wiki syntax for changesets introduced in Trac 0.12. If found, hide the change! You can combine both/all rules in the {{{[hidechanges]}}} section of the {{{trac.ini}}} file as long as the names are unique. You should take care in naming the buttons accordingly, as one set of buttons apply to all hidden changes. == Recent Changes [[ChangeLog(hidechangesplugin, 3)]] == Author/Contributors '''Author:''' [wiki:robguttman] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''