X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/a965ef019d26c7cd4b21922d6698a14ef166f2e6..74a8225377ee396d42dc71cd1e95c7b5b7ed8911:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index 48610ac..0480c43 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -258,10 +258,8 @@ function collectLocales() } } var result = calendarService.IDataSource.GetList(listFiltering); - if (result.ErrorCode) { - error(result.ErrorMessage); - return; - } + if (result.ErrorCode) + throw(result.ErrorMessage); var list = result.ReturnValue; } catch(e) { error(e + ', line ' + e.line); @@ -309,7 +307,7 @@ function collectLocales() var result = calendarService.IDataSource.Delete(criteria); if (result.ErrorCode) - error(result.ErrorMessage); + throw(result.ErrorMessage); } catch(e) { error('deleting temp calendar entries:' + e + ', line ' + e.line); return; @@ -674,7 +672,7 @@ function updateData() // summary can be undefined! var Summary = ((entry.Summary == null) ? '' : entry.Summary); - if (entry.Type == 'Meeting' && entry.Location != '' && config['showLocation'].Value) + if (entry.Location != '' && entry.Location != undefined && config['showLocation'].Value) Summary += ', ' + entry.Location; // fix by yves: determine start and end dates/times @@ -1291,14 +1289,22 @@ function getBackgroundImage() function updateHomescreen() { if (config['useBackgroundImage'].Value) { + // check if we have a completely unknown screen resolution + var screenHeight = screen.height; + var screenWidth = screen.width; + if (screenHeight != 640 && screenHeight != 480 && screenHeight != 360) + screenHeight = 360; // we can only assume we're in portrait mode, so we set the screen dims as needed for the following code + if (screenWidth != 640 && screenWidth != 480 && screenWidth != 360) + screenWidth = 640; // we can only assume we're in portrait mode, so we set the screen dims as needed for the following code + // check for screen rotation - if (orientation != 'portrait' && screen.width == 360 && screen.height == 640) { + if (orientation != 'portrait' && ((screenWidth == 360 && screenHeight == 640) || (screenWidth == 640 && screenHeight == 480))) { window.widget.prepareForTransition("fade"); orientation = 'portrait'; document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')'; document.getElementById('body').style.backgroundColor = 'none'; window.widget.performTransition(); - } else if (orientation != 'landscape' && screen.width == 640 && screen.height == 360) { + } else if (orientation != 'landscape' && ((screenWidth == 640 && screenHeight == 360) || (screenWidth == 480 && screenHeight == 640))) { window.widget.prepareForTransition("fade"); orientation = 'landscape'; document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')'; @@ -1556,7 +1562,8 @@ function updateCalendarColors() } } -function log(message) { +function log(message) +{ if (config['enableLogging'].Value) { console.info(message); }