Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/QA_4_5' into QA_4_5
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Jan 12, 2016
2 parents 5b57719 + 0f23dd5 commit 6b781d7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ phpMyAdmin - ChangeLog
- issue #11804 Misleading message for configuration storage
- issue #11772 Table pagination does nothing when session expired
- issue #11840 Index comments not working properly
- issue #11791 Better handle local storage errors

4.5.3.1 (2015-12-25)
- issue #11774 Undefined offset 2
Expand Down
4 changes: 2 additions & 2 deletions js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ AJAX.registerOnload('config.js', function () {
});

// detect localStorage state
var ls_supported = window.localStorage || false;
var ls_supported = isStorageSupported('localStorage');
var ls_exists = ls_supported ? (window.localStorage.config || false) : false;
$('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide();
$('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide();
Expand Down Expand Up @@ -811,7 +811,7 @@ function updatePrefsDate()
*/
function offerPrefsAutoimport()
{
var has_config = (window.localStorage || false) && (window.localStorage.config || false);
var has_config = (isStorageSupported('localStorage')) && (window.localStorage.config || false);
var $cnt = $('#prefs_autoload');
if (!$cnt.length || !has_config) {
return;
Expand Down
2 changes: 1 addition & 1 deletion js/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ function () {
$js_messages['strConsoleDebugShowArgs'] = __('Show arguments');
$js_messages['strConsoleDebugHideArgs'] = __('Hide arguments');
$js_messages['strConsoleDebugTimeTaken'] = __('Time taken:');
$js_messages['strNoLocalStorage'] = __('Your web browser does not support local storage of settings or the quota limit has been reached, some features may not work properly for you. In Safari, such problem is commonly caused by "Private Mode Browsing".');
$js_messages['strNoLocalStorage'] = __('There was a problem accessing your browser storage, some features may not work properly for you. It is likely that the browser doesn\'t support storage or the quota limit has been reached. In Firefox, corrupted storage can also cause such a problem, clearing your "Offline Website Data" might help. In Safari, such problem is commonly caused by "Private Mode Browsing".');

echo "var PMA_messages = new Array();\n";
foreach ($js_messages as $name => $js_message) {
Expand Down
27 changes: 17 additions & 10 deletions js/server_status_monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,10 @@ AJAX.registerOnload('server_status_monitor.js', function () {
} catch (err) {
alert(PMA_messages.strFailedBuildingGrid);
// If an exception is thrown, load default again
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
if (isStorageSupported('localStorage')) {
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
}
rebuildGrid();
}

Expand All @@ -659,9 +661,11 @@ AJAX.registerOnload('server_status_monitor.js', function () {

$('a[href="#clearMonitorConfig"]').click(function (event) {
event.preventDefault();
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
window.localStorage.removeItem('monitorVersion');
if (isStorageSupported('localStorage')) {
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
window.localStorage.removeItem('monitorVersion');
}
$(this).hide();
rebuildGrid();
});
Expand Down Expand Up @@ -938,17 +942,20 @@ AJAX.registerOnload('server_status_monitor.js', function () {
var i;

/* Apply default values & config */
if (window.localStorage) {
if (window.localStorage.monitorCharts) {
if (isStorageSupported('localStorage')) {
if (typeof window.localStorage.monitorCharts !== 'undefined') {
runtime.charts = $.parseJSON(window.localStorage.monitorCharts);
}
if (window.localStorage.monitorSettings) {
if (typeof window.localStorage.monitorSettings !== 'undefined') {
monitorSettings = $.parseJSON(window.localStorage.monitorSettings);
}

$('a[href="#clearMonitorConfig"]').toggle(runtime.charts !== null);

if (runtime.charts !== null && monitorProtocolVersion != window.localStorage.monitorVersion) {
if (runtime.charts !== null
&& typeof window.localStorage.monitorVersion !== 'undefined'
&& monitorProtocolVersion != window.localStorage.monitorVersion
) {
$('#emptyDialog').dialog({title: PMA_messages.strIncompatibleMonitorConfig});
$('#emptyDialog').html(PMA_messages.strIncompatibleMonitorConfigDescription);

Expand Down Expand Up @@ -2122,7 +2129,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
gridCopy[key].maxYLabel = elem.maxYLabel;
});

if (window.localStorage) {
if (isStorageSupported('localStorage')) {
window.localStorage.monitorCharts = JSON.stringify(gridCopy);
window.localStorage.monitorSettings = JSON.stringify(monitorSettings);
window.localStorage.monitorVersion = monitorProtocolVersion;
Expand Down

0 comments on commit 6b781d7

Please sign in to comment.