Class: Violations

Violations

new Violations()

List of known violations

maintains a list of violations. If the variables 'PM-worthy violations', 'warning-worthy violations' and/or 'infraction-worthy violations' exist, the names in those lists are used to set the default_user_action for each violation.
Example
var vi = new Violations({
     v                  : v,
     bb                 : bb,
     cache              : violations_cache,
     cache_updater      : function(cache) { ... },
     reload_interval    : 60 * 1000,
     error_callback     : handle_error,
     default_user_action: 'PM' // or 'warning' or 'infraction'
});

// later...
var violations = vi.violations.map(function(infraction) { ... infraction.name, infraction.value, infraction.default_user_action ... });

Extends

Methods

refresh(args){jQuery.promise}

Refresh the list of violations

downloads the violations and converts them to metadata
Name Type Description
args Object arguments passed to the constructor
Returns:
Type Description
jQuery.promise
Update this.cache using the passed cache_updater() callback