From 53b14ec6742a2fe2d5e5b519f6051a11373653c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Wed, 25 Feb 2015 00:09:37 +0100 Subject: [PATCH] Added clearing database functionality and fixed link in about --- data/en-US.properties | 4 ++++ data/es.properties | 5 ++++- index.html | 2 +- js/app.js | 15 +++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/data/en-US.properties b/data/en-US.properties index 95cf3eb..a287627 100644 --- a/data/en-US.properties +++ b/data/en-US.properties @@ -21,3 +21,7 @@ about_text_1 = ToDoList is free software: you can redistribute it and/or modify about_text_2 = ToDoList is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. about_text_3 = You should have received a copy of the GNU General Public License along with ToDoList. If not, see . about_text_4 = Started and written originally by José Carlos Cuevas +warning_popup_title = Warning - All data will be lost +warning_popup_message = This will erase all data and it cannot be undone. Are you sure you want to reset the app? +warning_popup_cancel = Cancel +warning_popup_done = Ok diff --git a/data/es.properties b/data/es.properties index e4e8416..64d0781 100644 --- a/data/es.properties +++ b/data/es.properties @@ -21,4 +21,7 @@ about_text_1 = ToDoList is free software: you can redistribute it and/or modify about_text_2 = ToDoList is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. about_text_3 = You should have received a copy of the GNU General Public License along with ToDoList. If not, see . about_text_4 = Iniciado y escrito originalmente por José Carlos Cuevas ; - +warning_popup_title = Peligro - Toda la información se perderá +warning_popup_message = Esto borrará toda la información y no se puede deshacer. ¿Está seguro de que quiere reiniciar la aplicación? +warning_popup_cancel = Cancelar +warning_popup_done = Aceptar diff --git a/index.html b/index.html index 6e92e45..25c23bc 100644 --- a/index.html +++ b/index.html @@ -67,7 +67,7 @@
- Visit the source code + Visit the source code

ToDoList is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/js/app.js b/js/app.js index 4fff16c..1c6ac2f 100644 --- a/js/app.js +++ b/js/app.js @@ -175,5 +175,20 @@ window.addEventListener('DOMContentLoaded', function() { var listID = $('#delete_list').data('currentlist'); deleteListClicked(listID); }); + + $('#reset_app').click(function() { + $.afui.popup({ + title: translate('warning_popup_title'), + message: translate('warning_popup_message'), + cancelText: translate('warning_popup_cancel'), + doneText: translate('warning_popup_done'), + doneCallback: function() { + $('ul#list_of_lists').find('[id^=list_]').parent().remove(); + db.lists.clear(); + db.items.clear(); + }, + cancelOnly: false + }); + }); } });