<commit_before>var share = {};

share.init = function(){
    console.log("SHARE INIT")
    $(".btn.share, i.close-share").on('click', function(event){
        $(".btn.share").toggleClass('active');
        $(".share-box").slideToggle();
    });

    $(".btn-checkbox").on('click', function(){
        $(this).toggleClass('active');

        if($(this).hasClass('fb')){
            if($(this).hasClass('active')){
                FB.ui({
                    method: 'permissions.request',
                    'perms': window.FBperms,
                    'display': 'popup',
                    'response_type': 'signed_request',
                    'fbconnect': 1,
                    'next': 'http://' + location.host + Routing.generate( appLocale + '_' + 'facebook_jstoken')
                },
                function(response) {
                    console.log(response);
                });
            }
        }
        if($(this).hasClass('tw')){
            if($(this).hasClass('active')){
                window.open(Routing.generate(appLocale + '_' + 'twitter_redirect'), 'fw_twit_link', 'menubar=no,status=no,toolbar=no,width=500,height=300');
            }
        }
    });
    share.autocomplete();
    share.it();
};

share.selectedList = [];
share.autocomplete = function(){

/*
    $("input[data-token-input]").tokenInput(Routing.generate(appLocale+'_share_ajaxwith'), {
        theme: 'fansworld',
        queryParam: 'term',
        preventDuplicates: true,
        propertyToSearch: 'label',
        onAdd: function(item){
            share.selectedList.push(item);
        }
    });
*/
    $("input[data-token-input]").fwTagify({action: 'share'});
};

share.it = function(){
    $("#share_it").on('click', function(){
        var params = {};

        console.log("share algo papi");

        params['tw'] = $(".btn-checkbox.tw").hasClass('active');
        params['fw'] = $(".btn-checkbox.fw").hasClass('active');
        params['fb'] = $(".btn-checkbox.fb").hasClass('active');

        params['message'] = $("input.wywtsay").val();
        params['entity-type'] = $("a.btn.share").attr('data-type');
        params['entity-id'] = $("a.btn.share").attr('data-id');

        //var shareWith = $("input[data-token-input]").tokenInput('get');
        var shareWith = $("input[data-token-input]").data('fwTagify').getAllTags();

        console.log("shareWith: ");
        console.log(shareWith);
        params['share-list'] = {};



        // User can only share with idol, team and user entities<commit_msg>nueva opcion tagear solo entidades sugeridas<commit_after>var share = {};

share.init = function(){
    console.log("SHARE INIT")
    $(".btn.share, i.close-share").on('click', function(event){
        $(".btn.share").toggleClass('active');
        $(".share-box").slideToggle();
    });

    $(".btn-checkbox").on('click', function(){
        $(this).toggleClass('active');

        if($(this).hasClass('fb')){
            if($(this).hasClass('active')){
                FB.ui({
                    method: 'permissions.request',
                    'perms': window.FBperms,
                    'display': 'popup',
                    'response_type': 'signed_request',
                    'fbconnect': 1,
                    'next': 'http://' + location.host + Routing.generate( appLocale + '_' + 'facebook_jstoken')
                },
                function(response) {
                    console.log(response);
                });
            }
        }
        if($(this).hasClass('tw')){
            if($(this).hasClass('active')){
                window.open(Routing.generate(appLocale + '_' + 'twitter_redirect'), 'fw_twit_link', 'menubar=no,status=no,toolbar=no,width=500,height=300');
            }
        }
    });
    share.autocomplete();
    share.it();
};

share.selectedList = [];
share.autocomplete = function(){

/*
    $("input[data-token-input]").tokenInput(Routing.generate(appLocale+'_share_ajaxwith'), {
        theme: 'fansworld',
        queryParam: 'term',
        preventDuplicates: true,
        propertyToSearch: 'label',
        onAdd: function(item){
            share.selectedList.push(item);
        }
    });
*/
    $("input[data-token-input]").fwTagify({action: 'share', suggestionsOnly: true});
};

share.it = function(){
    $("#share_it").on('click', function(){
        var params = {};

        console.log("share algo papi");

        params['tw'] = $(".btn-checkbox.tw").hasClass('active');
        params['fw'] = $(".btn-checkbox.fw").hasClass('active');
        params['fb'] = $(".btn-checkbox.fb").hasClass('active');

        params['message'] = $("input.wywtsay").val();
        params['entity-type'] = $("a.btn.share").attr('data-type');
        params['entity-id'] = $("a.btn.share").attr('data-id');

        //var shareWith = $("input[data-token-input]").tokenInput('get');
        var shareWith = $("input[data-token-input]").data('fwTagify').getAllTags();

        console.log("shareWith: ");
        console.log(shareWith);
        params['share-list'] = {};



        // User can only share with idol, team and user entities
{'fraction_non_alphanumeric': 0.20250195465207194, 'fraction_numerical': 0.002736512900703675, 'mean_word_length': 2.2427122940430926, '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': '7139234', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1505, 'n_words': 206}