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