Sha256: 0c919ee75c5312fbe2774350c73d75457c5132e66944281b8578222224f58029

Contents?: true

Size: 1.68 KB

Versions: 12

Compression:

Stored size: 1.68 KB

Contents

{I"
class:ETI"BundledAsset;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"%e79bb6e0f660b904ef24f34b0259ec6e;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"required_assets_digest;TI"%a3949a3a43a2fabf312ff30e35ee4e4a;FI"
_version;TI"%64e62ddc273c2f5847f30d698ca14b67;F

Version data entries

12 entries across 6 versions & 1 rubygems

Version Path
adherent-0.2.9 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e
adherent-0.2.9 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.8 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.8 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e
adherent-0.2.7 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.7 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e
adherent-0.2.6 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.6 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e
adherent-0.2.5 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e
adherent-0.2.5 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.4 spec/dummy/tmp/cache/assets/development/sprockets/7c297bdb92e1b06ff2d288b928c49ff9
adherent-0.2.4 spec/dummy/tmp/cache/assets/development/sprockets/b61f4c9e983288cc4474e15a4f8a347e