]> code.delx.au - comingnext/commitdiff
added support for devices with 640x480 resolution as well as basic support for unknow...
authorMichael Prager <michael@pragers.de>
Mon, 16 May 2011 13:46:34 +0000 (15:46 +0200)
committerMichael Prager <michael@pragers.de>
Mon, 16 May 2011 13:46:34 +0000 (15:46 +0200)
comingNext/index.html

index 853e41e3d768d08f6fb7fa0a7f64b0365ec261b8..0480c43196309a3eee29a666c911459e87a0f7c1 100644 (file)
@@ -1289,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