NxTIC/view/js/data.js

34 lines
778 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* [0] Gestion de l'export
=========================================================*/
var exportDeflater = new FormDeflater(
document.getElementById('export-form'),
['input'], // éléments à éviter (tagName)
['data-name'] // Attributs par ordre de priorité
);
$('#export-form #export-all').addEventListener('click', function(e){
// On récupère les données du formulaire
var deflated = exportDeflater.deflate();
/* (1) Si téléchargement de données cellulaires */
if( deflated.phone == '1' ){
api.send({ 'path': 'download/phone', 'subjects': [341] }, function(res){
// Si erreur
if( res.ModuleError != 0 )
return false;
// Sinon on lance le téléchargement
document.location = res.link;
});
}
}, false);