diff --git a/css/taskOverlay.css b/css/taskOverlay.css
index a1a2dd40c..9e17b43f6 100644
--- a/css/taskOverlay.css
+++ b/css/taskOverlay.css
@@ -166,7 +166,8 @@ body:not(.touch)
opacity: 0.8;
}
#add-task {
- width: 80%;
+ display:inline-block;
+ width: 40%;
margin-left: 10%;
padding: 1.25em;
text-align: center;
@@ -261,3 +262,29 @@ body.dark-mode #task-overlay {
.dark-mode #switch-task-button {
color: dodgerblue;
}
+
+#destroy-all-tasks {
+ display:inline-block;
+ width: 40%;
+ margin-left: 0%;
+ padding: 1.25em;
+ text-align: center;
+ color: inherit;
+ background-color: rgb(245, 245, 245);
+ cursor: pointer;
+}
+.dark-mode #destroy-all-tasks {
+ background-color: rgb(33, 37, 43);
+ color: lightgrey;
+}
+#destroy-all-tasks:hover {
+ background-color: rgb(235, 235, 235);
+}
+.dark-mode #destroy-all-tasks:hover {
+ background-color: rgb(44, 49, 56);
+}
+#destroy-all-tasks .i {
+ opacity: 0.75;
+ vertical-align: middle;
+ margin-right: 0.25em;
+}
\ No newline at end of file
diff --git a/index.html b/index.html
index c1d1961b2..2aaf39372 100644
--- a/index.html
+++ b/index.html
@@ -222,10 +222,16 @@
id="task-overlay-navbar"
>
diff --git a/js/browserUI.js b/js/browserUI.js
index bc44e478b..53ef7cd29 100644
--- a/js/browserUI.js
+++ b/js/browserUI.js
@@ -65,6 +65,19 @@ function destroyTask (id) {
tasks.destroy(id)
}
+/* Destroys all tasks */
+function destroyAllTasks () {
+ tasks.forEach( function(task) {
+ task.tabs.forEach(function (tab) {
+ webviews.destroy(tab.id)
+ })
+ }
+ )
+
+ tasks.destroyAll();
+ return addTask();
+}
+
/* destroys the webview and tab element for a tab */
function destroyTab (id) {
tabBar.removeTab(id)
@@ -225,5 +238,6 @@ module.exports = {
closeTask,
closeTab,
switchToTask,
- switchToTab
+ switchToTab,
+ destroyAllTasks
}
diff --git a/js/searchbar/customBangs.js b/js/searchbar/customBangs.js
index b834be583..c8d0d5b53 100644
--- a/js/searchbar/customBangs.js
+++ b/js/searchbar/customBangs.js
@@ -208,6 +208,20 @@ function initialize () {
}
})
+ bangsPlugin.registerCustomBang({
+ phrase: '!destroyalltasks',
+ snippet: l('destroyAllTasks'),
+ isAction: false,
+ fn: function () {
+ browserUI.destroyAllTasks();
+
+ taskOverlay.show()
+ setTimeout(function () {
+ taskOverlay.hide()
+ }, 600)
+ }
+ })
+
bangsPlugin.registerCustomBang({
phrase: '!nametask',
snippet: l('nameTask'),
diff --git a/js/taskOverlay/taskOverlay.js b/js/taskOverlay/taskOverlay.js
index 57c7c2907..0f7aee144 100644
--- a/js/taskOverlay/taskOverlay.js
+++ b/js/taskOverlay/taskOverlay.js
@@ -16,6 +16,8 @@ var taskContainer = document.getElementById('task-area')
var taskSwitcherButton = document.getElementById('switch-task-button')
var addTaskButton = document.getElementById('add-task')
var addTaskLabel = addTaskButton.querySelector('span')
+var destroyAllTasksButton = document.getElementById('destroy-all-tasks')
+var destroyAllTasksLabel = destroyAllTasksButton.querySelector('span')
var taskOverlayNavbar = document.getElementById('task-overlay-navbar')
function addTaskFromMenu () {
@@ -374,6 +376,8 @@ var taskOverlay = {
taskSwitcherButton.title = l('viewTasks')
addTaskLabel.textContent = l('newTask')
+ destroyAllTasksLabel.textContent = l('destroyAllTasks')
+
taskSwitcherButton.addEventListener('click', function () {
taskOverlay.toggle()
})
@@ -383,6 +387,11 @@ var taskOverlay = {
taskOverlay.hide()
})
+ destroyAllTasksButton.addEventListener('click', function(e) {
+ browserUI.destroyAllTasks()
+ taskOverlay.hide()
+ })
+
taskOverlayNavbar.addEventListener('click', function () {
taskOverlay.hide()
})
diff --git a/localization/languages/ar.json b/localization/languages/ar.json
index 9689506b6..cd7b6be4c 100644
--- a/localization/languages/ar.json
+++ b/localization/languages/ar.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "عرض المهام",
"newTask": "مهمة جديدة", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": " %n مهمة رقم", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": null //missing translation
diff --git a/localization/languages/bg.json b/localization/languages/bg.json
index 6e6873ae8..89a31e1f8 100644
--- a/localization/languages/bg.json
+++ b/localization/languages/bg.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Преглеждане на задачи",
"newTask": "Отваряне на нова задача", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Задача %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Задачата е изтрита.
Върни обратно?"
diff --git a/localization/languages/bn.json b/localization/languages/bn.json
index 732f7b6e0..04ef97891 100644
--- a/localization/languages/bn.json
+++ b/localization/languages/bn.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "কাজগুলি দেখুন",
"newTask": "ত্যে", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "টাস্ক%n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "কার্য মোছা হয়েছে
Undo?"
diff --git a/localization/languages/cs.json b/localization/languages/cs.json
index 7dd2d5f0f..a90c914c7 100644
--- a/localization/languages/cs.json
+++ b/localization/languages/cs.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Zobrazit dimenze",
"newTask": "Nová dimenze", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Dimenze %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Dimenze uzavřena.
Zpět?"
diff --git a/localization/languages/de.json b/localization/languages/de.json
index 89e28f307..99f691d76 100644
--- a/localization/languages/de.json
+++ b/localization/languages/de.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Aufgaben anzeigen",
"newTask": "Neue Aufgabe", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Aufgabe %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Aufgabe gelöscht.
Rückgängig machen?"
diff --git a/localization/languages/en-US.json b/localization/languages/en-US.json
index b3c3cd04e..bc37d0ff3 100644
--- a/localization/languages/en-US.json
+++ b/localization/languages/en-US.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "View Tasks",
"newTask": "New Task", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":"Clear Tasks", // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Task %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Task deleted.
Undo?"
diff --git a/localization/languages/es.json b/localization/languages/es.json
index 7505f9bc7..3aa367730 100644
--- a/localization/languages/es.json
+++ b/localization/languages/es.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Ver tareas",
"newTask": "Nueva tarea", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Tarea %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Tarea eliminada.
¿Deshacer?"
diff --git a/localization/languages/fa.json b/localization/languages/fa.json
index e4e3bc98b..5bdebb947 100644
--- a/localization/languages/fa.json
+++ b/localization/languages/fa.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "نمایش وظایف",
"newTask": "وظیفه جدید",
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "وظیفه %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": null //missing translation
diff --git a/localization/languages/fr.json b/localization/languages/fr.json
index 5c00c5603..a64426a3b 100644
--- a/localization/languages/fr.json
+++ b/localization/languages/fr.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Voir les tâches",
"newTask": "Ouvrir une nouvelle tâche", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Tâche %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Tâche supprimée.
Annuler ?"
diff --git a/localization/languages/hu.json b/localization/languages/hu.json
index 46ffa94af..4f36df5a9 100644
--- a/localization/languages/hu.json
+++ b/localization/languages/hu.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Feladat megtekintése",
"newTask": "Új feladat", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Feladat %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": null //missing translation
diff --git a/localization/languages/it.json b/localization/languages/it.json
index 0e8ca4913..02e2c136d 100644
--- a/localization/languages/it.json
+++ b/localization/languages/it.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Mostra Task",
"newTask": "Nuovo Task", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Task %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Task eliminato.
Annullare?"
diff --git a/localization/languages/ja.json b/localization/languages/ja.json
index 3b03a269c..4cd6de3c1 100644
--- a/localization/languages/ja.json
+++ b/localization/languages/ja.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "タスクを表示",
"newTask": "新規タスク", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "タスク %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "タスクは削除されます。
キャンセル?"
diff --git a/localization/languages/ko.json b/localization/languages/ko.json
index 8f647d90f..864d4510c 100644
--- a/localization/languages/ko.json
+++ b/localization/languages/ko.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "작업장 보기",
"newTask": "새 작업장", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "작업장 %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "작업장을 제거했습니다.
되돌릴까요?"
diff --git a/localization/languages/lt.json b/localization/languages/lt.json
index b17b7e55d..68aabf531 100644
--- a/localization/languages/lt.json
+++ b/localization/languages/lt.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Rodyti užduotis",
"newTask": "Nauja užduotis", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Užduotis %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": null //missing translation
diff --git a/localization/languages/pl.json b/localization/languages/pl.json
index 50f81cd99..198d90b32 100644
--- a/localization/languages/pl.json
+++ b/localization/languages/pl.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Wyświetl zadania",
"newTask": "Nowe zadanie", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Zadanie %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Zadanie usunięte.
Cofnąć?"
diff --git a/localization/languages/pt-BR.json b/localization/languages/pt-BR.json
index c7fc5cce6..cecad50cc 100644
--- a/localization/languages/pt-BR.json
+++ b/localization/languages/pt-BR.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Ver tarefas",
"newTask": "Nova Tarefa", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Tarefa %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Tarefa deletada!
desfazer?"
diff --git a/localization/languages/pt-PT.json b/localization/languages/pt-PT.json
index d70124573..d5e112546 100644
--- a/localization/languages/pt-PT.json
+++ b/localization/languages/pt-PT.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Ver tarefas",
"newTask": "Nova tarefa", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Tarefa %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Tarefa eliminada.
Desfazer?"
diff --git a/localization/languages/ru.json b/localization/languages/ru.json
index 96ea05387..6b66ca07b 100644
--- a/localization/languages/ru.json
+++ b/localization/languages/ru.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Показать задачи",
"newTask": "Новая задача", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Задача %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Задача удалена.
Отменить?"
diff --git a/localization/languages/tr.json b/localization/languages/tr.json
index 2d9b19e7d..c76f1326c 100644
--- a/localization/languages/tr.json
+++ b/localization/languages/tr.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Görevleri Görüntüle",
"newTask": "Yeni Görev", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Görev %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Görev silindi.
Geri?"
diff --git a/localization/languages/uk.json b/localization/languages/uk.json
index a035923c0..0ba504a6f 100644
--- a/localization/languages/uk.json
+++ b/localization/languages/uk.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Переглянути завдання",
"newTask": "Нове завдання", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Завдання %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Завдання видалено.
Скасувати?"
diff --git a/localization/languages/uz.json b/localization/languages/uz.json
index 25d61d260..5183677b5 100644
--- a/localization/languages/uz.json
+++ b/localization/languages/uz.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Vazifalarni ko'rish",
"newTask": "Yangi vazfa", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Vazifa %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "Vazifa o'chirildi.
Bekor qilasizmi?"
diff --git a/localization/languages/vi.json b/localization/languages/vi.json
index 3f264b4d7..8bb08340c 100644
--- a/localization/languages/vi.json
+++ b/localization/languages/vi.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "Xem quá trình",
"newTask": "Tao quá trình", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "Quá trình %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
/* find in page toolbar */
"searchInPage": "Tìm kiếm trong trang", //this is used as the placeholder text for the textbox in the find in page toolbar
diff --git a/localization/languages/zh-CN.json b/localization/languages/zh-CN.json
index b89b47b40..dd619a35b 100644
--- a/localization/languages/zh-CN.json
+++ b/localization/languages/zh-CN.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "查看标签组",
"newTask": "新建标签组", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "标签组 %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "标签组已删除
恢复?"
diff --git a/localization/languages/zh-TW.json b/localization/languages/zh-TW.json
index 3f9836d23..bee0cafc6 100644
--- a/localization/languages/zh-TW.json
+++ b/localization/languages/zh-TW.json
@@ -67,6 +67,7 @@
/* task overlay */
"viewTasks": "查看工作",
"newTask": "新增工作", //"new" is a verb - it is used for a button at the bottom of the task overlay
+ "destroyAllTasks":null, // "clear" is a verb - it is used on the button that clears all tasks at the bottom of the task overlay
"defaultTaskName": "工作 %n", //this is the name used for newly-created tasks; %n is replaced with a number ("task 1", "task 2", etc)
"taskDeleteWarning": {
"unsafeHTML": "工作已刪除
復原"