This commit is contained in:
xdrm-brackets 2016-05-21 18:28:33 +02:00
parent 1a3169f484
commit f2d3cc17f8
2 changed files with 3 additions and 4 deletions

2
view/js/data-min.js vendored
View File

@ -1,3 +1,3 @@
var subjectList=$("#subject-list"),subjectAdd=$("#add-subject"),exportDeflater=new FormDeflater(document.getElementById("export-form"),["input"],["data-name"]);subjectAdd.addEventListener("click",function(b){b=document.createElement("input");b.type="number";b.dataset.name="subjects";b.placeholder="Sujet";b.style="width: 5em; display: block;";subjectList.appendChild(b)},!1);
$("#export-form #export-all").addEventListener("click",function(b){var a=(new FormDeflater(subjectList,["input"],["data-name"])).deflate().subjects;b=[];a instanceof Array||(a=[a]);for(var c=0;c<a.length;c++)0<a[c].length&&!isNaN(a[c])&&b.push(a[c]);a=exportDeflater.deflate();a={path:"download/multiple",phone:"1"==a.phone,facebook:"1"==a.facebook,survey:"1"==a.survey,all:"all"==a.group};console.warn(b);0<b.length&&(a.subjects=b);api.send(a,function(a){if(0!=a.ModuleError)return!1;document.location=
$("#export-form #export-all").addEventListener("click",function(b){var a=(new FormDeflater(subjectList,["input"],["data-name"])).deflate().subjects;b=[];a instanceof Array||(a=[a]);for(var c=0;c<a.length;c++)0<a[c].length&&!isNaN(a[c])&&b.push(a[c]);a=exportDeflater.deflate();c={path:"download/multiple",phone:"1"==a.phone,facebook:"1"==a.facebook,survey:"1"==a.survey,all:"all"==a.group};"all"!=a.group&&0<b.length&&(c.subjects=b);api.send(c,function(a){if(0!=a.ModuleError)return!1;document.location=
a.link;Notification.success("OK","Lancement du t\u00e9l\u00e9chargement..")})},!1);

View File

@ -58,14 +58,13 @@ $('#export-form #export-all').addEventListener('click', function(e){
};
// On ajoute les sujets s'il y en a
console.warn(subjects);
if( subjects.length > 0 )
if( deflated.group != 'all' && subjects.length > 0 )
request.subjects = subjects;
/* (5) On lance la requête */
api.send(request, function(res){
// Si erreur
if( res.ModuleError != 0 )
return false;