diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml
index 3196d72c..e276ccef 100644
--- a/application/views/scripts/index/index.phtml
+++ b/application/views/scripts/index/index.phtml
@@ -54,12 +54,15 @@
fileEnCours as $file) {?>
-=$file->fichier?> |
-=$file->dateAdded?> |
-=$file->nbLigneT?> |
-=$file->nbLigne?> |
-=$file->error?> |
-Remise à zéro et redémarrage |
+ =$file->fichier?> |
+ =$file->dateAdded?> |
+ =$file->nbLigneT?> |
+ =$file->nbLigne?> |
+ =$file->error?> |
+
+ Remise à zéro et redémarrage
+
+ |
diff --git a/public/scripts/enrichissement.js b/public/scripts/enrichissement.js
index 37c5017f..0144c957 100644
--- a/public/scripts/enrichissement.js
+++ b/public/scripts/enrichissement.js
@@ -1,3 +1,16 @@
+var nbSeconds = 10;
+var timer;
+function updateInfo()
+{
+ $('tr.encours:first-child').each(function(){
+ var objet = $(this);
+ var id = $(this).attr('id');
+ $.getJSON('/index/getinfo', {id: id}, function(data){
+ if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
+ });
+ });
+}
+
$(document).ready(function(){
$("a.setprofil").click(function(e){
@@ -10,24 +23,26 @@ $(document).ready(function(){
});
});
+ $('a.restart').click(function(e){
+ e.preventDefault();
+ var href = $(this).attr('href');
+ if (confirm("Attention en cliquant sur Ok l'enrichissement va être reinitialiser")) {
+ window.location = href;
+ }
+ });
+
+ //Focus entrant sur le document, on relance le script
$(document).focusin(function(){
updateInfo();
- timer = setInterval(updateInfo, 10000);
+ timer = setInterval(updateInfo, nbSeconds*100);
});
+
+ //Sortie du focus sur le document on arrête le script
$(document).focusout(function(){
clearInterval(timer);
});
- timer = setInterval(updateInfo, 10000);
+
+ //Démarrage du time
+ timer = setInterval(updateInfo, nbSeconds*100);
});
-var timer;
-function updateInfo()
-{
- $('tr.encours:first-child').each(function(){
- var objet = $(this);
- var id = $(this).attr('id');
- $.getJSON('/index/getinfo', {id: id}, function(data){
- if (data!=''){ objet.find('td.ligne').text(data.nbLigneT); }
- });
- });
-}
\ No newline at end of file