From 74a8225377ee396d42dc71cd1e95c7b5b7ed8911 Mon Sep 17 00:00:00 2001 From: Michael Prager Date: Mon, 16 May 2011 15:46:34 +0200 Subject: [PATCH] added support for devices with 640x480 resolution as well as basic support for unknown resolutions --- comingNext/index.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/comingNext/index.html b/comingNext/index.html index 853e41e..0480c43 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -1289,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() + ')'; -- 2.39.2