From 7d896bd1356aafd9e3d8e067321ae71d6863e43a Mon Sep 17 00:00:00 2001 From: Gregory Buhler Date: Thu, 22 Sep 2016 13:24:33 -0500 Subject: [PATCH] New feature for #12247, delete option added to header pop up removing local storage. Signed-off-by: Gregory Buhler --- js/config.js | 10 +++++++++- templates/prefs_autoload.phtml | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/js/config.js b/js/config.js index d3d0c5f840..b0aa6cc7be 100644 --- a/js/config.js +++ b/js/config.js @@ -836,7 +836,7 @@ function updatePrefsDate() } /** - * Prepares message which informs that localStorage preferences are available and can be imported + * Prepares message which informs that localStorage preferences are available and can be imported or deleted */ function offerPrefsAutoimport() { @@ -855,6 +855,14 @@ function offerPrefsAutoimport() prefs_autoload: 'hide' }, null, 'html'); return; + } else if ($a.attr('href') == '#delete') { + $cnt.remove(); + localStorage.clear(); + $.post('index.php', { + token: $cnt.find('input[name=token]').val(), + prefs_autoload: 'hide' + }, null, 'html'); + return; } $cnt.find('input[name=json]').val(window.localStorage.config); $cnt.find('form').submit(); diff --git a/templates/prefs_autoload.phtml b/templates/prefs_autoload.phtml index 37863e9557..fa71cdd73c 100644 --- a/templates/prefs_autoload.phtml +++ b/templates/prefs_autoload.phtml @@ -11,5 +11,6 @@
/ + / - \ No newline at end of file +