Sha256: 6bf441dd44f69aa1321a583954eacb33d1b424ab0af3524f229d044f0e807d08

Contents?: true

Size: 1.99 KB

Versions: 12

Compression:

Stored size: 1.99 KB

Contents

{I"
class:ETI"ProcessedAsset;FI"logical_path;TI"adherent/common.js;FI"
pathname;TI"O/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/common.js;FI"content_type;TI"application/javascript;TI"
mtime;Tl+†ęTI"length;TiďI"digest;TI"%b066b8025783050ac1d4312cbbc4204a;FI"source;TI"ď// fonction pour transformer une chaine avec virgule en float
// la fonction retire les espaces et remplace la virgule par le point décimal
// avant d'appeler Number, la fonction native de js.
function stringToFloat(jcdata) {

    if (jcdata === undefined) {
        return 0.0;
    }
    var d = String(jcdata).replace(/,/, '.');
    d = d.replace(/\s/g, '');
    if (isNaN(d)) {
        return 0.0;
    } else {
        return Number(d);
    }
}

// fonction permettant de mettre deux décimales à un nombre
// appelé lorsque l'utilisateur sort d'un champ pour remettre en forme sa saisir
// Par exemple 32 devient 32.00 ou 32.5 devient 32.50
function $f_two_decimals() {
    var number = stringToFloat(this.value);
    if (isNaN(number)) {
        this.value = '0.00';
    } else {
        this.value = number.toFixed(2);
    }
}

// série de fonction qui prépare les champs débit et crédit pour la saisie
// quand on entre dans un champ qui est Ă  0, on le vide
function $f_empty() {
    if (this.value === '0.00') {
        this.value = '';
    }
}

jQuery(function () {
    $('#main-zone').on('focus', '.decimal', $f_empty); //vide le champ s'il est Ă  zero (pour faciliter la saisie)
    $('#main-zone').on('blur', '.decimal', $f_two_decimals);
});
;TI"dependency_digest;TI"%1b5f85a3fa3e1749c62ec57188be5261;FI"required_paths;T[I"O/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/common.js;FI"dependency_paths;T[{I"	path;TI"O/home/jcl/rails_project/Adherent/app/assets/javascripts/adherent/common.js;FI"
mtime;TI"2015-02-22T18:19:02+01:00;TI"digest;TI"%b066b8025783050ac1d4312cbbc4204a;FI"
_version;TI"%4bf7b15359fe8e0974f7f263e26e27f4;F

Version data entries

12 entries across 6 versions & 1 rubygems

Version Path
adherent-0.2.9 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.9 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.8 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.8 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.7 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.7 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.6 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.6 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.5 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.5 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.4 spec/dummy/tmp/cache/assets/test/sprockets/707d14985ad94cdf9b5480953a10faf5
adherent-0.2.4 spec/dummy/tmp/cache/assets/test/sprockets/7c297bdb92e1b06ff2d288b928c49ff9