o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1401531119.500063:@value"�{I"
class:ETI"ProcessedAsset;�FI"logical_path;�TI"adherent/members.js;�FI"
pathname;�TI"P/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/members.js;�FI"content_type;�TI"application/javascript;�TI"
mtime;�TI"2013-08-30T17:44:11+02:00;�TI"length;�Ti�I"digest;�TI"%f4f387b51121cea63c05550fe573d630;�FI"source;�TI"�// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
var frenchdatatable = {
    "sProcessing":   "Traitement en cours...",
    "sLengthMenu":   "Afficher _MENU_ éléments",
    "sZeroRecords":  "Aucun élément à afficher",
    "sInfo":         "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
    "sInfoEmpty":    "Affichage de l'élement 0 à 0 sur 0 éléments",
    "sInfoFiltered": "(filtré de _MAX_ éléments au total)",
    "sInfoPostFix":  "",
    "sSearch":       "Rechercher :",
    "sUrl":          "",
    "oPaginate": {
        "sFirst":    "Premier",
        "sPrevious": "Précédent",
        "sNext":     "Suivant",
        "sLast":     "Dernier"
    }
};

$(document).ready( function () {
    $('#members').dataTable({
      "oLanguage": frenchdatatable,
      "aoColumnDefs": [
            {
                "sType": "date-euro",
                "asSortable": ['asc', 'desc'],
                "aTargets": ['date-euro'] // les colonnes date au format français ont la classe date-euro
            },
            {
                "bSortable": false,
                "aTargets": ['actions' ]
            }]          
    });
} );

// dateHeight transforme une date au format français en un chiffre
// ce qui permet les comparaisons pour le tri des tables
// dateStr est au format jj/mm/aaaa
function dateHeight(dateStr) {
  // on cherche les 4 derniers chiffres
  var arr = dateStr.split('/');
  var val = arr[2] + arr[1] + arr[0];
  return parseInt(val)
}


// Les colonnes qui doivent être triées selon les dates au format français 
// doivent avoir comme classe date-euro (%th.date-euro).
// Dans la fonction datatable il suffit alors d'indiquer que les colonne 
// sont de type date-euro (sType: date-euro, aTargets: [date-euro]
jQuery.fn.dataTableExt.oSort['date-euro-asc'] = function(a, b) {
                        var x = dateHeight(a);
                        var y = dateHeight(b);
                        var z = ((x < y) ? -1 : ((x > y) ? 1 : 0));
                        return z;
                };

jQuery.fn.dataTableExt.oSort['date-euro-desc'] = function(a, b) {
                        var x = dateHeight(a);
                        var y = dateHeight(b);
                        var z = ((x < y) ? 1 : ((x > y) ? -1 : 0));
                        return z;
                };

// Gestion du tri des colonnes de montant
// fonctions de tri pour des nombres avec une virgule comme séparateur décimal
    jQuery.fn.dataTableExt.oSort['numeric-comma-asc']  = function(a,b) {
    var x = (a == "-") ? 0 : a.replace( /,/, "." );
    var y = (b == "-") ? 0 : b.replace( /,/, "." );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
};

jQuery.fn.dataTableExt.oSort['numeric-comma-desc'] = function(a,b) {
    var x = (a == "-") ? 0 : a.replace( /,/, "." );
    var y = (b == "-") ? 0 : b.replace( /,/, "." );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
};



//plug in permettant d'ajouter le type comma-decimals aux colonnes'
// cette méthode qui pourrait être utilisée pour les dates 
// permet à datatable d'identifier de lui même le type de la colonne
jQuery.fn.dataTableExt.aTypes.unshift(
    function ( sData )
    {
        var sValidChars = "0123456789-,";
        var Char;
        var bDecimal = false;

        /* Check the numeric part */
        for ( i=0 ; i<sData.length ; i++ )
        {
            Char = sData.charAt(i);
            if (sValidChars.indexOf(Char) == -1)
            {
                return null;
            }

            /* Only allowed one decimal place... */
            if ( Char == "," )
            {
                if ( bDecimal )
                {
                    return null;
                }
                bDecimal = true;
            }
        }

        return 'numeric-comma';
    }
);
;�TI"dependency_digest;�TI"%54a5ce06aa90a29f70dc55507eed5cb1;�FI"required_paths;�T[I"P/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/members.js;�FI"dependency_paths;�T[{I"	path;�TI"P/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/members.js;�FI"
mtime;�TI"2013-08-30T17:44:11+02:00;�TI"digest;�TI"%fae81b789c980b49412ff01e9723e62c;�FI"
_version;�TI"%ffd318ca8b794f42f5029101c2cf5d91;�F