Merge remote-tracking branch 'origin/QA_4_5' into QA_4_5

This commit is contained in:
Weblate 2016-01-12 14:04:30 +01:00
commit 6b781d7fd7
4 changed files with 21 additions and 13 deletions

View File

@ -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

View File

@ -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();
@ -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;

View File

@ -604,7 +604,7 @@ $js_messages['strConsoleDebugArgsSummary'] = __('%s argument(s) passed');
$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) {

View File

@ -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();
}
@ -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();
});
@ -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);
@ -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;