From 9204b85fa54dede121b4ab8b37f7d4fed057cf14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 15 Feb 2016 08:50:53 +0100 Subject: [PATCH] Move isStorageSupported to config.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way it's included in the setup as well where it's used. Fixes #11959 Signed-off-by: Michal Čihař --- ChangeLog | 1 + js/config.js | 24 ++++++++++++++++++++++++ js/functions.js | 24 ------------------------ libraries/Header.class.php | 2 +- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9da26605f..29f34173b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ phpMyAdmin - ChangeLog - issue #11953 Do not fail getting filename with open_basedir limitations - issue #11956 unrecognized keyword interval - issue Field names and aliases are being correctly parsed now. +- issue #11959 Fix javascript error in setup 4.5.4.1 (2016-01-29) - issue #11892 Error with PMA 4.4.15.3 diff --git a/js/config.js b/js/config.js index d3d5d71f23..43309b1b93 100644 --- a/js/config.js +++ b/js/config.js @@ -3,6 +3,30 @@ * Functions used in configuration forms and on user preferences pages */ +/** + * checks whether browser supports web storage + * + * @param type the type of storage i.e. localStorage or sessionStorage + * + * @returns bool + */ +function isStorageSupported(type) +{ + try { + window[type].setItem('PMATest', 'test'); + // Check whether key-value pair was set successfully + if (window[type].getItem('PMATest') === 'test') { + // Supported, remove test variable from storage + window[type].removeItem('PMATest'); + return true; + } + } catch(error) { + // Not supported + PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false); + } + return false; +} + /** * Unbind all event handlers before tearing down a page */ diff --git a/js/functions.js b/js/functions.js index 78bbff68d4..52c959d01f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4746,30 +4746,6 @@ function PMA_ignorePhpErrors(clearPrevErrors){ $pmaErrors.remove(); } -/** - * checks whether browser supports web storage - * - * @param type the type of storage i.e. localStorage or sessionStorage - * - * @returns bool - */ -function isStorageSupported(type) -{ - try { - window[type].setItem('PMATest', 'test'); - // Check whether key-value pair was set successfully - if (window[type].getItem('PMATest') === 'test') { - // Supported, remove test variable from storage - window[type].removeItem('PMATest'); - return true; - } - } catch(error) { - // Not supported - PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false); - } - return false; -} - /** * Unbind all event handlers before tearing down a page */ diff --git a/libraries/Header.class.php b/libraries/Header.class.php index bc3de55cea..91dd54e012 100644 --- a/libraries/Header.class.php +++ b/libraries/Header.class.php @@ -200,12 +200,12 @@ class PMA_Header $this->_scripts->addFile( 'get_image.js.php?theme=' . $theme_id ); + $this->_scripts->addFile('config.js'); $this->_scripts->addFile('doclinks.js'); $this->_scripts->addFile('functions.js'); $this->_scripts->addFile('navigation.js'); $this->_scripts->addFile('indexes.js'); $this->_scripts->addFile('common.js'); - $this->_scripts->addFile('config.js'); $this->_scripts->addFile('page_settings.js'); $this->_scripts->addCode($this->getJsParamsCode()); }