@@ -63,7 +63,7 @@ public function the_todo_list() {
6363 </span>
6464 </summary>
6565 <div id="todo-list-completed-delete-all-wrapper">
66- <button id="todo-list-completed-delete-all" onclick="prplTodoWidget.deleteAllCompletedTasks ()">
66+ <button id="todo-list-completed-delete-all" onclick="prplTodoWidget.showDeleteAllPopover ()">
6767 <span style="display: inline-block; width: 18px; height: 18px;">
6868 <svg role="img" aria-hidden="true" focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="#9ca3af" d="M32.99 47.88H15.01c-3.46 0-6.38-2.7-6.64-6.15L6.04 11.49l-.72.12c-.82.14-1.59-.41-1.73-1.22-.14-.82.41-1.59 1.22-1.73.79-.14 1.57-.26 2.37-.38h.02c2.21-.33 4.46-.6 6.69-.81v-.72c0-3.56 2.74-6.44 6.25-6.55 2.56-.08 5.15-.08 7.71 0 3.5.11 6.25 2.99 6.25 6.55v.72c2.24.2 4.48.47 6.7.81.79.12 1.59.25 2.38.39.82.14 1.36.92 1.22 1.73-.14.82-.92 1.36-1.73 1.22l-.72-.12-2.33 30.24c-.27 3.45-3.18 6.15-6.64 6.15Zm-17.98-3h17.97c1.9 0 3.51-1.48 3.65-3.38l2.34-30.46c-2.15-.3-4.33-.53-6.48-.7h-.03c-5.62-.43-11.32-.43-16.95 0h-.03c-2.15.17-4.33.4-6.48.7l2.34 30.46c.15 1.9 1.75 3.38 3.65 3.38ZM24 7.01c2.37 0 4.74.07 7.11.22v-.49c0-1.93-1.47-3.49-3.34-3.55-2.5-.08-5.03-.08-7.52 0-1.88.06-3.34 1.62-3.34 3.55v.49c2.36-.15 4.73-.22 7.11-.22Zm5.49 32.26h-.06c-.83-.03-1.47-.73-1.44-1.56l.79-20.65c.03-.83.75-1.45 1.56-1.44.83.03 1.47.73 1.44 1.56l-.79 20.65c-.03.81-.7 1.44-1.5 1.44Zm-10.98 0c-.8 0-1.47-.63-1.5-1.44l-.79-20.65c-.03-.83.61-1.52 1.44-1.56.84 0 1.52.61 1.56 1.44l.79 20.65c.03.83-.61 1.52-1.44 1.56h-.06Z"></path></svg>
6969 </span>
@@ -72,6 +72,31 @@ public function the_todo_list() {
7272 </div>
7373 <ul id="todo-list-completed" class="prpl-todo-list prpl-suggested-tasks-list"></ul>
7474 </details>
75+ <div id="todo-list-completed-delete-all-popover" class="prpl-popover" popover>
76+ <div class="prpl-note">
77+ <span class="prpl-note-icon">
78+ <?php \progress_planner ()->the_asset ( 'images/icon_exclamation_triangle_solid.svg ' ); ?>
79+ </span>
80+ <span class="prpl-note-text">
81+ <?php \esc_html_e ( 'Are you sure you want to delete all completed tasks? This action cannot be undone. ' , 'progress-planner ' ); ?>
82+ </span>
83+ </div>
84+
85+ <div class="prpl-buttons-wrapper">
86+ <button id="todo-list-completed-delete-all-cancel" onclick="prplTodoWidget.closeDeleteAllPopover()">
87+ <?php
88+ /* translators: %1$s is the strong tag, %2$s is the closing strong tag. */
89+ printf ( \esc_html__ ( '%1$sNo%2$s, keep this list ' , 'progress-planner ' ), '<strong> ' , '</strong> ' );
90+ ?>
91+ </button>
92+ <button id="todo-list-completed-delete-all-confirm" onclick="prplTodoWidget.deleteAllCompletedTasksAndClosePopover()">
93+ <?php
94+ /* translators: %1$s is the strong tag, %2$s is the closing strong tag. */
95+ printf ( \esc_html__ ( '%1$sYes%2$s, delete all completed tasks ' , 'progress-planner ' ), '<strong> ' , '</strong> ' );
96+ ?>
97+ </button>
98+ </div>
99+ </div>
75100 <?php
76101 }
77102
0 commit comments