<commit_before>/*
 * dependencies:
 * jquery 1.8.3
 * jquery UI
 * fos-routing
 * facebook
 *  
 */

// FansWorld Plugin Boilerplate

;(function($) {
    "use strict";
    $.ajaxianize = function(el, options) {

        // plugin's default options
        var defaults = {
            route: null,
            params: null,
            callback: null,
            errorCallback: null, 
            type: 'POST'
        };

        // to avoid confusions, use "plugin" to reference the current instance of the  object
        var plugin = this;
        plugin.settings = {}

        // constructor
        var init = function() {
            defaults.errorCallback = errorHandler;
            plugin.settings = $.extend({}, defaults, options);
            plugin.el = el;
            console.log("ajaxianize.init()")
        };

        plugin.genericAction = function(options) {

            if (arguments.length >= 2) {
                // workaround for old call system 
                // cast every argument[i] to the literal objet properties
                var settings = {
                    route: arguments[0],
                    params: arguments[1],
                    callback: arguments[2],
                    errorCallback: arguments[3],
                    type: arguments[4],
                }
                options = $.extend({}, plugin.settings, settings);
            }
            else {
                options = $.extend({}, plugin.settings, options);
            }
            console.log("settings: %s", JSON.stringify(options));

            $.ajax({
                url: 'http://' + location.host + Routing.generate(appLocale + '_' + options.route),
                type: options.type,
                data: options.params,
                success: function(r){
                    if(typeof(options.callback) !== 'undefined'){
                        options.callback(r);
                    }
                },
                error: function(r){
                    if(isFunction(options.errorCallback)){
                        options.errorCallback(r);
                    }
                }
            });
        };
        // private methods
        var search = function(method, params, callback) {
            if(!ajax.active) {
                ajax.active = true;
                
                $.ajax({
                    url: 'http://'+ location.host + Routing.generate( appLocale + '_' + method),
                    data: params,<commit_msg>0000530 refactor base.js (chau comments)<commit_after>/*
 * dependencies:
 * jquery 1.8.3
 * jquery UI
 * fos-routing
 * facebook
 *  
 */

// FansWorld Plugin Boilerplate

;(function($) {
    "use strict";
    $.ajaxianize = function(el, options) {

        // plugin's default options
        var defaults = {
            route: null,
            params: null,
            callback: null,
            errorCallback: null, 
            type: 'POST'
        };

        // to avoid confusions, use "plugin" to reference the current instance of the  object
        var plugin = this;
        plugin.settings = {}

        // constructor
        var init = function() {
            defaults.errorCallback = errorHandler;
            plugin.settings = $.extend({}, defaults, options);
            plugin.el = el;
        };

        plugin.genericAction = function(options) {

            if (arguments.length >= 2) {
                // workaround for old call system 
                // cast every argument[i] to the literal objet properties
                var settings = {
                    route: arguments[0],
                    params: arguments[1],
                    callback: arguments[2],
                    errorCallback: arguments[3],
                    type: arguments[4],
                }
                options = $.extend({}, plugin.settings, settings);
            }
            else {
                options = $.extend({}, plugin.settings, options);
            }

            $.ajax({
                url: 'http://' + location.host + Routing.generate(appLocale + '_' + options.route),
                type: options.type,
                data: options.params,
                success: function(r){
                    if(typeof(options.callback) !== 'undefined'){
                        options.callback(r);
                    }
                },
                error: function(r){
                    if(isFunction(options.errorCallback)){
                        options.errorCallback(r);
                    }
                }
            });
        };
        // private methods
        var search = function(method, params, callback) {
            if(!ajax.active) {
                ajax.active = true;
                
                $.ajax({
                    url: 'http://'+ location.host + Routing.generate( appLocale + '_' + method),
                    data: params,
{'fraction_non_alphanumeric': 0.1124031007751938, 'fraction_numerical': 0.005099959200326397, 'mean_word_length': 1.2205615942028984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6876465', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1122, 'n_words': 283}