NxTIC/view/js/data-min.js

3 lines
847 B
JavaScript
Raw Normal View History

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