Changes between Version 1 and Version 2 of HideChangesPlugin


Ignore:
Timestamp:
Jan 4, 2011, 7:07:08 PM (13 years ago)
Author:
Rob Guttman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HideChangesPlugin

    v1 v2  
    55== Description ==
    66
    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.
     7Tickets 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
     9'''SECURITY WARNING! ''' This plugin processes freeform !JavaScript/jQuery code from the {{{trac.ini}}} file.  If this can be a security concern in your Trac deployment, please do not use this plugin.
     10
     11
     12== Configuration ==
     13 1. Install the plugin (after downloading and unzipping):
     14    {{{
     15    cd hidechangesplugin/trunk
     16    sudo python setup.py bdist_egg
     17    sudo cp dist/TracHideChanges*.egg /your/trac/location/plugins/
     18    }}}
     19
     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.
     21
     22 2. Enable the plugin:
     23    {{{
     24    [components]
     25    hidechanges.* = enabled
     26    }}}
     27
     28    You can alternatively use the Trac Web Admin GUI to enable any or all rules.
     29
     30 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
    832
    933== Bugs/Feature Requests ==
     
    2448
    2549== Example ==
     50You 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...
    2651
    27 Coming...
     52=== Hide commentless changes ===
     53The 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{{{
     55[hidechanges]
     56rule.commentless = !changediv.find('div.comment').children().length
     57show_button_name = Show commentless changes
     58hide_button_name = Hide commentless changes
     59}}}
     60
     61The 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
     63=== Hide changeset changes ===
     64To hide changeset changes that are in the Trac 0.12 wiki syntax:
     65{{{
     66[hidechanges]
     67rule.changeset = changediv.find('p a.changeset').children().length
     68}}}
     69
     70The 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.
    2871
    2972== Recent Changes ==