<commit_before>// Once, javascript is written in a modular format, all initialization
// code should be called from here.
Sufia = {
    initialize: function () {
        this.autocomplete();
        this.saveWorkControl();
        this.saveWorkFixed();
        this.popovers();
        this.permissions();
        this.notifications();
        this.transfers();
        this.relationshipsTable();
        this.fileManager();
        this.selectWorkType();
        this.datatable();
        this.admin();
    },

    admin: function() {
      var AdminSetControls = require('sufia/admin/admin_set_controls');
      var controls = new AdminSetControls($('#admin-set-controls'));
    },

    datatable: function () {
        // This keeps the datatable from being added to a table that already has it.
        // This is a problem when turbolinks is active.
        if ($('.dataTables_wrapper').size() === 0) {
            $('.datatable').DataTable();
        }
    },

    autocomplete: function () {
        var ac = require('sufia/autocomplete');
        var autocomplete = new ac.Autocomplete()
        $('.multi_value.form-group').manage_fields({
          add: function(e, element) {
            autocomplete.fieldAdded(element)
          }
        });
        autocomplete.setup();
    },

    saveWorkControl: function () {
        var sw = require('sufia/save_work/save_work_control');
        var control = new sw.SaveWorkControl($("#form-progress"))
    },

    saveWorkFixed: function () {
        // Setting test to false to skip native and go right to polyfill
        FixedSticky.tests.sticky = false;
        $('#savewidget').fixedsticky();
    },

    // initialize popover helpers
    popovers: function () {
        $("a[data-toggle=popover]").popover({html: true})
            .click(function () {
                return false;
            });
    },

    permissions: function () {
        var perm = require('sufia/permissions/control');
        new perm.PermissionsControl($("#share"), 'tmpl-work-grant');
        new perm.PermissionsControl($("#permission"), 'tmpl-file-set-grant');
    },

    notifications: function () {
        var note = require('sufia/notifications');
        $('[data-update-poll-url]').each(function () {
            var interval = $(this).data('update-poll-interval');
            var url = $(this).data('update-poll-url');
            new note.Notifications(url, interval);<commit_msg>Activate javascript for adding users when editing batch permissions<commit_after>// Once, javascript is written in a modular format, all initialization
// code should be called from here.
Sufia = {
    initialize: function () {
        this.autocomplete();
        this.saveWorkControl();
        this.saveWorkFixed();
        this.popovers();
        this.permissions();
        this.notifications();
        this.transfers();
        this.relationshipsTable();
        this.fileManager();
        this.selectWorkType();
        this.datatable();
        this.admin();
    },

    admin: function() {
      var AdminSetControls = require('sufia/admin/admin_set_controls');
      var controls = new AdminSetControls($('#admin-set-controls'));
    },

    datatable: function () {
        // This keeps the datatable from being added to a table that already has it.
        // This is a problem when turbolinks is active.
        if ($('.dataTables_wrapper').size() === 0) {
            $('.datatable').DataTable();
        }
    },

    autocomplete: function () {
        var ac = require('sufia/autocomplete');
        var autocomplete = new ac.Autocomplete()
        $('.multi_value.form-group').manage_fields({
          add: function(e, element) {
            autocomplete.fieldAdded(element)
          }
        });
        autocomplete.setup();
    },

    saveWorkControl: function () {
        var sw = require('sufia/save_work/save_work_control');
        var control = new sw.SaveWorkControl($("#form-progress"))
    },

    saveWorkFixed: function () {
        // Setting test to false to skip native and go right to polyfill
        FixedSticky.tests.sticky = false;
        $('#savewidget').fixedsticky();
    },

    // initialize popover helpers
    popovers: function () {
        $("a[data-toggle=popover]").popover({html: true})
            .click(function () {
                return false;
            });
    },

    permissions: function () {
        var perm = require('sufia/permissions/control');
        // On the edit work page
        new perm.PermissionsControl($("#share"), 'tmpl-work-grant');
        // On the edit fileset page
        new perm.PermissionsControl($("#permission"), 'tmpl-file-set-grant');
        // On the batch edit page
        new perm.PermissionsControl($("#form_permissions"), 'tmpl-file-set-grant');
    },

    notifications: function () {
        var note = require('sufia/notifications');
        $('[data-update-poll-url]').each(function () {
            var interval = $(this).data('update-poll-interval');
            var url = $(this).data('update-poll-url');
            new note.Notifications(url, interval);
{'fraction_non_alphanumeric': 0.14254944194243196, 'fraction_numerical': 0.00039161934599569217, 'mean_word_length': 2.287001287001287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '651596', 'n_tokens_mistral': 1414, 'n_tokens_neox': 1365, 'n_words': 317}