mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
make local storage more robust (deal with gaps)
This commit is contained in:
parent
192bde119b
commit
58e13743fc
@ -139,13 +139,18 @@ egw.extend('debug', egw.MODULE_GLOBAL, function(_app, _wnd) {
|
||||
if (window.localStorage && typeof window.localStorage[LASTLOG] != 'undefined')
|
||||
{
|
||||
var lastlog = parseInt(window.localStorage[LASTLOG]);
|
||||
for(var i=lastlog; i < MAX_LOGS && typeof window.localStorage[LOG_PREFIX+i] != 'undefined'; ++i)
|
||||
for(var i=lastlog; i < lastlog+MAX_LOGS; ++i)
|
||||
{
|
||||
logs.push(JSON.parse(window.localStorage[LOG_PREFIX+i]));
|
||||
}
|
||||
for (var i=0; i < lastlog; ++i)
|
||||
{
|
||||
logs.push(JSON.parse(window.localStorage[LOG_PREFIX+i]));
|
||||
var log = window.localStorage[LOG_PREFIX+(i%MAX_LOGS)];
|
||||
if (typeof log != 'undefined')
|
||||
{
|
||||
try {
|
||||
logs.push(JSON.parse(log));
|
||||
}
|
||||
catch(e) {
|
||||
// ignore not existing log entries
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return logs;
|
||||
|
@ -228,8 +228,8 @@ function egw_getAppName()
|
||||
function egw_refresh(_msg, _app, _id, _type, _targetapp, _replace, _with, _msg_type)
|
||||
{
|
||||
// Log for debugging purposes
|
||||
egw.debug("log", "egw_refresh(%s, %s, %s, %o, %s, %s)",_msg,_app,_id,_type,_target_app,_replace,_with,_msg_type);
|
||||
|
||||
egw.debug("log", "egw_refresh(%s, %s, %s, %o, %s, %s)", _msg, _app, _id, _type, _targetapp, _replace, _with, _msg_type);
|
||||
|
||||
//alert("egw_refresh(\'"+_msg+"\',\'"+_app+"\',\'"+_id+"\',\'"+_type+"\')");
|
||||
var win = typeof _targetapp != 'undefined' ? egw_appWindow(_targetapp) : window;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user