<commit_before>MapasCulturais = MapasCulturais || {};
tabIndex = function() { window.tabEnabled = true };
jQuery(function(){
    $.fn.editableform.buttons = '<button type="button" class="editable-cancel btn btn-default">Cancelar</button> <button type="submit" class="editable-submit">Enviar</button>';
    $.fn.select2.defaults.separator = '; ';
    $.fn.editabletypes.select2.defaults.viewseparator = '; ';
    MapasCulturais.Editables.init('#editable-entity');
    MapasCulturais.AjaxUploader.init();
    MapasCulturais.MetalistManager.init();


    MapasCulturais.Remove.init();


    $('.js-registration-action').click(function(){
        if($(this).hasClass('selected'))
            return false;

        var href = $(this).data('href');
        var data = {agentId: $(this).data('agent-id')};
        var $this = $(this);

        $.post(href, data, function(response){
            $this.parent().find('.js-registration-action').removeClass('selected');
            $this.addClass('selected');

            // status = 1 (aprovado)
            // status = -6 (rejeitado)

        });
        return false;
    });

    //Máscaras de telefone

    $('.js-editable').on('shown', function(e, editable) {
        if ($(this).hasClass('js-mask-phone')) {
            var masks = ['(00) 00000-0000', '(00) 0000-00009'];
            editable.input.$input.mask(masks[1], {onKeyPress:
               function(val, e, field, options) {
                   field.mask(val.length > 14 ? masks[0] : masks[1], options) ;
               }
            });
        }

        if ($(this).hasClass('js-mask-cep')) {
            var masks = ['00000-000'];
            editable.input.$input.mask(masks[0], {onKeyPress:
               function(val, e, field, options) {
                   field.mask(masks[0], options) ;
               }
            });
        }


    });

    //Display Default Shortcuts on Editable Buttons and Focus on select2 input
    $('.editable').on('shown', function(e, editable) {
        editable.container.$form.find('.editable-cancel').attr('title', 'Cancelar Alteração (Esc)');
        //textarea display default Ctrl+Enter and Esc shortcuts<commit_msg>Máscara de hora e fixes no tamanho do editable input movidos para o editable.js comum a todos os temas<commit_after>MapasCulturais = MapasCulturais || {};
tabIndex = function() { window.tabEnabled = true };
jQuery(function(){
    $.fn.editableform.buttons = '<button type="button" class="editable-cancel btn btn-default">Cancelar</button> <button type="submit" class="editable-submit">Enviar</button>';
    $.fn.select2.defaults.separator = '; ';
    $.fn.editabletypes.select2.defaults.viewseparator = '; ';
    MapasCulturais.Editables.init('#editable-entity');
    MapasCulturais.AjaxUploader.init();
    MapasCulturais.MetalistManager.init();


    MapasCulturais.Remove.init();


    $('.js-registration-action').click(function(){
        if($(this).hasClass('selected'))
            return false;

        var href = $(this).data('href');
        var data = {agentId: $(this).data('agent-id')};
        var $this = $(this);

        $.post(href, data, function(response){
            $this.parent().find('.js-registration-action').removeClass('selected');
            $this.addClass('selected');

            // status = 1 (aprovado)
            // status = -6 (rejeitado)

        });
        return false;
    });

    //Máscaras de telefone, CEP e hora

    $('.js-editable').on('shown', function(e, editable) {
        if ($(this).hasClass('js-mask-phone')) {
            var masks = ['(00) 00000-0000', '(00) 0000-00009'];
            editable.input.$input.mask(masks[1], {onKeyPress:
               function(val, e, field, options) {
                   field.mask(val.length > 14 ? masks[0] : masks[1], options) ;
               }
            });
        }

        if ($(this).hasClass('js-mask-cep')) {
            var masks = ['00000-000'];
            editable.input.$input.mask(masks[0], {onKeyPress:
               function(val, e, field, options) {
                   field.mask(masks[0], options) ;
               }
            });
        }

        if ($(this).hasClass('js-mask-time')) {
            //Mask
            var masks = ['00:00'];
            editable.input.$input.mask(masks[0], {onKeyPress:
               function(val, e, field, options) {
                   field.mask(masks[0], options) ;
               }
            });
        }

        // Fixes editable input size based on placeholder length
        var placeholder = editable.input.$input.attr('placeholder'),
            placeholderLength = placeholder && placeholder.length > 20 ? placeholder.length : 0,
            possibleSize = Math.max(editable.value.length + 5, placeholderLength);

        if (possibleSize > 20) {
            editable.input.$input.attr('size', possibleSize);
        }

        // Fixes padding right hardcoded on 24px, now 0;
        //editable.input.$input.css('padding-right', 10);
    });

    //Display Default Shortcuts on Editable Buttons and Focus on select2 input
    $('.editable').on('shown', function(e, editable) {
        editable.container.$form.find('.editable-cancel').attr('title', 'Cancelar Alteração (Esc)');
        //textarea display default Ctrl+Enter and Esc shortcuts
{'fraction_non_alphanumeric': 0.16385998107852412, 'fraction_numerical': 0.019110690633869443, 'mean_word_length': 2.2955112219451372, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '3107783', 'n_tokens_mistral': 1664, 'n_tokens_neox': 1552, 'n_words': 294}