From 89dd577d2fa26dac844c5a5e74ab10c7985c3167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 1 Dec 2016 11:35:44 +0100 Subject: [PATCH] Show no local storage warning only on settings tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It really makes no sense to show it on every page when we're checking whether there are settings to import. Fixes #12699 Signed-off-by: Michal Čihař --- ChangeLog | 1 + js/config.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index dff689a43e..a4748b9a8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ phpMyAdmin - ChangeLog - issue #12760 Fix Notice regarding 'Undefined index: users' - issue #12762 Fixed parsing of SQL with BINARY function - issue #12588 ReCaptcha now works without allow_url_fopen +- issue #12699 Show no local storage warning only on settings tab 4.6.5.1 (2016-11-25) - issue #12735 Incorrect parameters to escapeString in Node.php diff --git a/js/config.js b/js/config.js index 7a0f4bf53f..d2520eb8fe 100644 --- a/js/config.js +++ b/js/config.js @@ -10,7 +10,7 @@ * * @returns bool */ -function isStorageSupported(type) +function isStorageSupported(type, warn) { try { window[type].setItem('PMATest', 'test'); @@ -22,7 +22,9 @@ function isStorageSupported(type) } } catch(error) { // Not supported - PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false); + if (warn) { + PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false); + } } return false; } @@ -740,7 +742,7 @@ AJAX.registerOnload('config.js', function () { }); // detect localStorage state - var ls_supported = isStorageSupported('localStorage'); + var ls_supported = isStorageSupported('localStorage', true); var ls_exists = ls_supported ? (window.localStorage.config || false) : false; $('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide(); $('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide();