/** * @file * JS functionality that creates dynamic CSS which hides permission rows and role columns. */ // Wrapper normalizes 'jQuery' to '$'. ;(function fpa_scope($, Drupal, window, document) { "use strict"; var Fpa = function (context, settings) { this.init(context, settings); return this; }; Fpa.prototype.selector = { form: '#user-admin-permissions', table : '#permissions' }; Fpa.prototype.init = function (context, settings) { this.drupal_html_class_cache = {}; this.dom = {}; this.attr = settings.attr; this.filter_timeout= null; this.filter_timeout_time = 0; this.module_match = '*='; this.filter_selector_cache = { '*=': {}, '~=': {} }; this.selector.table_base_selector = '.fpa-table-wrapper tr[' + this.attr.module + ']'; this.selector.list_counter_selector = '.fpa-perm-counter'; this.selector.list_base_selector = '.fpa-left-section li[' + this.attr.module + ']'; if (this.select(context)) { this.prepare(); this.authenticated_role_behavior(); } }; Fpa.prototype.styles = { module_active_style: '{margin-right:-1px; background-color: white; border-right: solid 1px transparent;}' }; /** * Select all elements that are used by FPA ahead of time and cache on 'Fpa' instance. */ Fpa.prototype.select = function (context) { this.dom.context = $(context); this.dom.form = this.dom.context.find(this.selector.form); // Prevent anything else from running if the form is not found. if (this.dom.form.length === 0) { return false; } this.dom.container = this.dom.form.find('.fpa-container'); // Raw element since $().html(); does not work for