diff --git a/public_html/cache.manifest b/public_html/cache.manifest index 7a81c67..aab2531 100644 --- a/public_html/cache.manifest +++ b/public_html/cache.manifest @@ -1,5 +1,5 @@ CACHE MANIFEST -# Date : 2016/09/06 - Version : 6 +# Date : 2016/09/07 - Version : 1 CACHE: index.html diff --git a/public_html/inc/main.js b/public_html/inc/main.js index 30db47a..54c9957 100644 --- a/public_html/inc/main.js +++ b/public_html/inc/main.js @@ -133,6 +133,21 @@ on_close_copy_scase_modal=function () { $('#copy_scase_modal form')[0].reset(); } +/*********************** + * Reset scase + **********************/ +on_reset_scase_btn_click=function(event) { + navbar_collapse_hide(); + var scase=scases.byName($('#cats').data('scase')); + if (scase) { + myconfirm('Voulez-vous vraiment réinitialiser la valise '+$('#cats').data('scase')+' ?', + function(data) { + scases.resetSCase(scase.name); + scases.save(); + show_scase(scase); + }); + } +} /*********************** * Delete scase **********************/ @@ -603,6 +618,7 @@ $( document ).ready( function() { $("#copy_scase_modal").on('hidden.bs.modal',on_close_copy_scase_modal); $("#copy_scase_modal form").bind('submit',on_valid_copy_scase_modal); + $('#reset_scase_btn').bind('click',on_reset_scase_btn_click); $('#delete_scase_btn').bind('click',on_delete_scase_btn_click); $('#add_cat_btn').bind('click',on_add_cat_btn_click); diff --git a/public_html/inc/mysc_objects.js b/public_html/inc/mysc_objects.js index 1d48012..4db5098 100644 --- a/public_html/inc/mysc_objects.js +++ b/public_html/inc/mysc_objects.js @@ -181,6 +181,14 @@ function SCaseList() { return false; } + this.resetSCase=function(name) { + for (el in this) { + if (this.isSCase(this[el]) && this[el].name==name) { + return this[el].reset(); + } + } + return false; + } } function SCase(name,data) { @@ -211,6 +219,17 @@ function SCase(name,data) { return this.cats.length; } + this.reset=function() { + this.cats.each(function(idx,cat) { + for (idx in cat.things) { + if (cat.things[idx].checked) { + cat.things[idx].checked=false; + } + } + }); + return true; + } + /* * Contructor */ diff --git a/public_html/index.html b/public_html/index.html index 5e35a20..7144ae1 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -62,6 +62,7 @@ div.panel-heading, li.list-group-item, a {
  • Renommer la valise
  • Copier la valise
  • +
  • RĂ©initialiser la valise
  • Supprimer la valise