Changes between Version 3 and Version 4 of HideChangesPlugin
- Timestamp:
- Jul 20, 2015, 10:45:20 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HideChangesPlugin
v3 v4 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Hide ticket changes based on configurable rules =3 = Hide ticket changes based on configurable rules 4 4 5 == Description ==5 == Description 6 6 7 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#Examples examples below].7 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#Examples examples below]. 8 8 9 '''SECURITY WARNING ! ''' This plugin processes freeform !JavaScript/jQuery code from the {{{trac.ini}}} file. If this can bea security concern in your Trac deployment, please do not use this plugin.9 '''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. 10 10 11 == Bugs/Feature Requests 11 12 12 == Configuration == 13 1. Install the plugin (after downloading and unzipping): 14 {{{ 13 Existing bugs and feature requests for HideChangesPlugin are 14 [report:9?COMPONENT=HideChangesPlugin here]. 15 16 If you have any issues, create a 17 [/newticket?component=HideChangesPlugin new ticket]. 18 19 [[TicketQuery(component=HideChangesPlugin&group=type,format=progress)]] 20 21 == Download 22 23 Download the zipped source from [download:hidechangesplugin here]. 24 25 == Source 26 27 You can check out HideChangesPlugin from [http://trac-hacks.org/svn/hidechangesplugin here] using Subversion, or [source:hidechangesplugin browse the source] with Trac. 28 29 == Installation and Configuration 30 31 1. Install the plugin after downloading and unzipping: 32 {{{#!sh 15 33 cd hidechangesplugin/trunk 16 34 sudo python setup.py bdist_egg … … 18 36 }}} 19 37 20 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.38 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. 21 39 22 2. Enable the plugin :23 {{{ 40 2. Enable the plugin by adding the following to your `trac.ini` file: 41 {{{#!ini 24 42 [components] 25 43 hidechanges.* = enabled 26 44 }}} 27 45 28 46 You can alternatively use the Trac Web Admin GUI to enable any or all rules. 29 47 30 3. Create rules in the {{{[hidechanges]}}} section of {{{trac.ini}}} for which changes to hide. 48 3. Create rules in the {{{[hidechanges]}}} section of {{{trac.ini}}} for which changes to hide. See [wiki:HideChangesPlugin#Examples examples below] for details and ideas. 31 49 50 == Example 32 51 33 == Bugs/Feature Requests == 52 You define rules using the {{{rule.<name>}}} option in the {{{[hidechanges]}}} section of {{{trac.ini}}} as freeform !JavaScript/jQuery 1.8.7 code. Each rule {{{<name>}}} 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. 34 53 35 Existing bugs and feature requests for HideChangesPlugin are 36 [report:9?COMPONENT=HideChangesPlugin here]. 54 === Hide commentless changes 37 55 38 If you have any issues, create a 39 [http://trac-hacks.org/newticket?component=HideChangesPlugin&owner=robguttman new ticket]. 40 41 == Download == 42 43 Download the zipped source from [download:hidechangesplugin here]. 44 45 == Source == 46 47 You can check out HideChangesPlugin from [http://trac-hacks.org/svn/hidechangesplugin here] using Subversion, or [source:hidechangesplugin browse the source] with Trac. 48 49 == Example == 50 You define rules using the {{{rule.<name>}}} option in the {{{[hidechanges]}}} section of {{{trac.ini}}} as freeform !JavaScript/jQuery 1.8.7 code. Each rule {{{<name>}}} 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... 51 52 === Hide commentless changes === 53 The most common type of changes to want to hide are commentless changes - e.g., when just a field changes without any comment. Here's how you would configure this rule in {{{trac.ini}}}: 54 {{{ 56 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}}}: 57 {{{#!ini 55 58 [hidechanges] 56 59 rule.commentless = !changediv.find('div.comment').children().length … … 59 62 }}} 60 63 61 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.64 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. 62 65 63 === Hide changeset changes === 66 === Hide changeset changes 67 64 68 To hide changeset changes that are in the Trac 0.12 wiki syntax: 65 {{{ 69 {{{#!ini 66 70 [hidechanges] 67 71 rule.changeset = changediv.find('p a.changeset').children().length 68 72 }}} 69 73 70 This {{{changeset}}} rule checks for an href node with the {{changeset}}} class - this is the wiki syntax for changesets introduced in Trac 0.12 (I believe).If found, hide the change!74 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! 71 75 72 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 accordinglyas one set of buttons apply to all hidden changes.76 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. 73 77 74 75 == Recent Changes == 78 == Recent Changes 76 79 77 80 [[ChangeLog(hidechangesplugin, 3)]] 78 81 79 == Author/Contributors ==82 == Author/Contributors 80 83 81 84 '''Author:''' [wiki:robguttman] [[BR]] 82 '''Maintainer:''' [ wiki:robguttman] [[BR]]85 '''Maintainer:''' [[Maintainer]] [[BR]] 83 86 '''Contributors:'''