]> code.delx.au - comingnext/commitdiff
fixed background image beeing used in fullscreen mode (now there is an extra CSS...
authorMichael Prager <michael@pragers.de>
Fri, 18 Dec 2009 03:02:10 +0000 (04:02 +0100)
committerMichael Prager <michael@pragers.de>
Fri, 18 Dec 2009 03:02:10 +0000 (04:02 +0100)
comingNext/index.html
comingNextB/index.html

index be1dd2489b51d53db461ceb125837d45db18ddbc..7ba8bf68ea64c225f24e5264c21c1fdb321cd491 100644 (file)
@@ -8,6 +8,7 @@
 <style type="text/css">\r
 .background { color:#ffffff; background-color:#000000 } /* Defines the background of the widget. If you want to use a background image, set useBackgroundImage = true below */\r
                                        /* for the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef */\r
+.backgroundFullscreen { color:#ffffff; background-color:#000000 } /* Same as background but for the fullscreen version of the widget */\r
 .weekDay { }                           /* Defines the appearance of all week day texts */\r
 .date { }                              /* Defines the appearance of all date texts */\r
 .today { color:#ff0000; }              /* Defines the appearance of "Today" text */\r
@@ -40,6 +41,7 @@ var nothingText = 'No further events within ' + monthRange + ' months';               // text
 var enableDaylightSaving = true;// enable this if you are in a timezone that has daylight saving time (+1h)\r
 \r
 var cssStyle_background = "color:#ffffff; background-color:#000000"; // Defines the background of the widget. If you want to use a background image, set useBackgroundImage = true below. For the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef\r
+var cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000"; // Same as background but for the fullscreen version of the widget\r
 var cssStyle_weekDay = "";                     // Defines the appearance of all week day texts\r
 var cssStyle_date = "";                                // Defines the appearance of all date texts\r
 var cssStyle_today = "color:#ff0000";          // Defines the appearance of "Today" text\r
@@ -616,6 +618,7 @@ function updateScreen()
        if( window.innerHeight > 91 && mode == 0) {\r
                mode = 1;\r
                cacheEntriesHtml = '';\r
+               document.getElementById('body').style.backgroundImage = "";\r
                showFullscreen();\r
        }\r
        else if (window.innerHeight <= 91 && mode != 0) {\r
@@ -725,6 +728,7 @@ function showSettings()
                enableDaylightSaving = document.forms[0].elements["settings.enableDaylightSaving"].checked;\r
                \r
                cssStyle_background = document.forms[0].elements["settings.cssStyle_background"].value;\r
+               cssStyle_backgroundFullscreen = document.forms[0].elements["settings.cssStyle_backgroundFullscreen"].value;\r
                cssStyle_weekDay = document.forms[0].elements["settings.cssStyle_weekDay"].value;\r
                cssStyle_date = document.forms[0].elements["settings.cssStyle_date"].value;\r
                cssStyle_today = document.forms[0].elements["settings.cssStyle_today"].value;\r
@@ -774,6 +778,7 @@ function showSettings()
        '<hr><table><tr><td>Enable Daylight Saving:<br><input name="settings.enableDaylightSaving" type="checkbox" value="true" ' + (enableDaylightSaving ? 'checked="checked"' : '') + '/></td>' + printHintBox('enable this if you are in a timezone that has daylight saving time (+1h)') +\r
        '<hr style="margin-bottom:60px;"><h1 class="title">CSS Styles</h1>' +\r
        '<hr><table><tr><td>.background:<br><input class="textInput" name="settings.cssStyle_background" type="text" value="' + cssStyle_background + '" /></td>' + printHintBox('Defines the background of the widget. If you want to use a background image, enable "useBackgroundImage" instead. For the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef') +\r
+       '<hr><table><tr><td>.backgroundFullscreen:<br><input class="textInput" name="settings.cssStyle_backgroundFullscreen" type="text" value="' + cssStyle_backgroundFullscreen + '" /></td>' + printHintBox('Same as background but for the fullscreen version of the widget') +\r
        '<hr><table><tr><td>.weekDay:<br><input class="textInput" name="settings.cssStyle_weekDay" type="text" value="' + cssStyle_weekDay + '" /></td>' + printHintBox('Defines the appearance of all week day texts') +\r
        '<hr><table><tr><td>.date:<br><input class="textInput" name="settings.cssStyle_date" type="text" value="' + cssStyle_date + '" /></td>' + printHintBox('Defines the appearance of all date texts') +\r
        '<hr><table><tr><td>.today:<br><input class="textInput" name="settings.cssStyle_today" type="text" value="' + cssStyle_today + '" /></td>' + printHintBox('Defines the appearance of "Today" text') +\r
@@ -791,14 +796,8 @@ function changeCssClass(classname, properties)
        for(var i = 0; i < document.styleSheets[0]['cssRules'].length; i++)\r
        {\r
                if (document.styleSheets[0]['cssRules'][i].selectorText == classname) {\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText);\r
-                       //document.styleSheets[0]['cssRules'][i].cssText = classname + ' { ' + properties + ' }';\r
                        document.styleSheets[0].deleteRule(i);\r
-                       //document.styleSheets[0].insertRule(classname + ' { ' + properties + ' }', 0);\r
                        document.styleSheets[0].insertRule(classname + ' { ' + properties + ' }', document.styleSheets[0]['cssRules'].length);\r
-                       //document.styleSheets[0]['cssRules'][i].style.cssText = classname + ' { ' + properties + ' }';\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText);\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText + '\n'+ classname + ' { ' + properties + ' }');\r
                        break;\r
                }\r
        }\r
@@ -807,6 +806,7 @@ function changeCssClass(classname, properties)
 function updateCssClasses()\r
 {\r
        changeCssClass(".background", cssStyle_background);\r
+       changeCssClass(".backgroundFullscreen", cssStyle_backgroundFullscreen);\r
        changeCssClass(".weekDay", cssStyle_weekDay);\r
        changeCssClass(".date", cssStyle_date);\r
        changeCssClass(".today", cssStyle_today);\r
@@ -840,6 +840,7 @@ function restoreDefaultSettings()
        enableDaylightSaving = true;\r
 \r
        cssStyle_background = "color:#ffffff; background-color:#000000";\r
+       cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000";\r
        cssStyle_weekDay = "";\r
        cssStyle_date = "";\r
        cssStyle_today = "color:#ff0000";\r
@@ -953,6 +954,11 @@ function loadSettings()
                cssStyle_background = widget.preferenceForKey('cssStyle_background');\r
        else\r
                cssStyle_background = "color:#ffffff; background-color:#000000";\r
+\r
+       if (widget.preferenceForKey('cssStyle_backgroundFullscreen'))\r
+               cssStyle_backgroundFullscreen = widget.preferenceForKey('cssStyle_backgroundFullscreen');\r
+       else\r
+               cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000";\r
                \r
        if (widget.preferenceForKey('cssStyle_weekDay'))\r
                cssStyle_weekDay = widget.preferenceForKey('cssStyle_weekDay');\r
@@ -1018,6 +1024,7 @@ function saveSettings()
        widget.setPreferenceForKey(enableDaylightSaving ? 'true' : 'false', 'enableDaylightSaving');\r
        \r
        widget.setPreferenceForKey(cssStyle_background, 'cssStyle_background');\r
+       widget.setPreferenceForKey(cssStyle_backgroundFullscreen, 'cssStyle_backgroundFullscreen');\r
        widget.setPreferenceForKey(cssStyle_weekDay, 'cssStyle_weekDay');\r
        widget.setPreferenceForKey(cssStyle_date, 'cssStyle_date');\r
        widget.setPreferenceForKey(cssStyle_today, 'cssStyle_today');\r
@@ -1073,6 +1080,7 @@ function showFullscreen()
        document.getElementById("fullscreenView").style.display = "block";\r
        document.getElementById("aboutView").style.display = "none";\r
        document.getElementById("settingsView").style.display = "none";\r
+       document.getElementById('body').className = "backgroundFullscreen";\r
        createMenu();\r
        updateData();\r
 }\r
@@ -1094,6 +1102,10 @@ function updateHomescreen()
                        document.getElementById('body').style.backgroundColor = 'none';\r
                        window.widget.performTransition();\r
                }\r
+               else if (document.getElementById('body').style.backgroundImage == "")\r
+               {\r
+                       document.getElementById('body').style.backgroundImage = 'url(background_' + orientation + '.png)';\r
+               }\r
        }\r
 }\r
 \r
@@ -1103,6 +1115,7 @@ function showHomescreen()
        document.getElementById("fullscreenView").style.display = "none";\r
        document.getElementById("aboutView").style.display = "none";\r
        document.getElementById("settingsView").style.display = "none";\r
+       document.getElementById('body').className = "background";\r
        updateData();\r
 }\r
 \r
@@ -1111,7 +1124,7 @@ function showHomescreen()
 <style type="text/css">\r
 table { margin:0px; padding:0px; border-spacing:0px; }\r
 td { padding:0px 5px 0px 0px; white-space:nowrap; overflow:hidden; }\r
-hr { w_idth:100%; color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
+hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
 .settingsInfo { display:none; font-style:italic; }\r
 .title { font-weight:bold; font-size:14pt; }\r
 .textInput { width:90%; }\r
index ef67e1968c7b27fdbe74605f04deb6dc01534dda..a0e6f0d751a840c6d7678d5aab4e4cf9dee51929 100644 (file)
@@ -8,6 +8,7 @@
 <style type="text/css">\r
 .background { color:#ffffff; background-color:#000000 } /* Defines the background of the widget. If you want to use a background image, set useBackgroundImage = true below */\r
                                        /* for the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef */\r
+.backgroundFullscreen { color:#ffffff; background-color:#000000 } /* Same as background but for the fullscreen version of the widget */\r
 .weekDay { }                           /* Defines the appearance of all week day texts */\r
 .date { }                              /* Defines the appearance of all date texts */\r
 .today { color:#ff0000; }              /* Defines the appearance of "Today" text */\r
@@ -40,6 +41,7 @@ var nothingText = 'No further events within ' + monthRange + ' months';               // text
 var enableDaylightSaving = true;// enable this if you are in a timezone that has daylight saving time (+1h)\r
 \r
 var cssStyle_background = "color:#ffffff; background-color:#000000"; // Defines the background of the widget. If you want to use a background image, set useBackgroundImage = true below. For the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef\r
+var cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000"; // Same as background but for the fullscreen version of the widget\r
 var cssStyle_weekDay = "";                     // Defines the appearance of all week day texts\r
 var cssStyle_date = "";                                // Defines the appearance of all date texts\r
 var cssStyle_today = "color:#ff0000";          // Defines the appearance of "Today" text\r
@@ -616,6 +618,7 @@ function updateScreen()
        if( window.innerHeight > 91 && mode == 0) {\r
                mode = 1;\r
                cacheEntriesHtml = '';\r
+               document.getElementById('body').style.backgroundImage = "";\r
                showFullscreen();\r
        }\r
        else if (window.innerHeight <= 91 && mode != 0) {\r
@@ -725,6 +728,7 @@ function showSettings()
                enableDaylightSaving = document.forms[0].elements["settings.enableDaylightSaving"].checked;\r
                \r
                cssStyle_background = document.forms[0].elements["settings.cssStyle_background"].value;\r
+               cssStyle_backgroundFullscreen = document.forms[0].elements["settings.cssStyle_backgroundFullscreen"].value;\r
                cssStyle_weekDay = document.forms[0].elements["settings.cssStyle_weekDay"].value;\r
                cssStyle_date = document.forms[0].elements["settings.cssStyle_date"].value;\r
                cssStyle_today = document.forms[0].elements["settings.cssStyle_today"].value;\r
@@ -774,6 +778,7 @@ function showSettings()
        '<hr><table><tr><td>Enable Daylight Saving:<br><input name="settings.enableDaylightSaving" type="checkbox" value="true" ' + (enableDaylightSaving ? 'checked="checked"' : '') + '/></td>' + printHintBox('enable this if you are in a timezone that has daylight saving time (+1h)') +\r
        '<hr style="margin-bottom:60px;"><h1 class="title">CSS Styles</h1>' +\r
        '<hr><table><tr><td>.background:<br><input class="textInput" name="settings.cssStyle_background" type="text" value="' + cssStyle_background + '" /></td>' + printHintBox('Defines the background of the widget. If you want to use a background image, enable "useBackgroundImage" instead. For the default themes, black, gray, and light blue, codes are #292029, #e7dfe7, #009aef') +\r
+       '<hr><table><tr><td>.backgroundFullscreen:<br><input class="textInput" name="settings.cssStyle_backgroundFullscreen" type="text" value="' + cssStyle_backgroundFullscreen + '" /></td>' + printHintBox('Same as background but for the fullscreen version of the widget') +\r
        '<hr><table><tr><td>.weekDay:<br><input class="textInput" name="settings.cssStyle_weekDay" type="text" value="' + cssStyle_weekDay + '" /></td>' + printHintBox('Defines the appearance of all week day texts') +\r
        '<hr><table><tr><td>.date:<br><input class="textInput" name="settings.cssStyle_date" type="text" value="' + cssStyle_date + '" /></td>' + printHintBox('Defines the appearance of all date texts') +\r
        '<hr><table><tr><td>.today:<br><input class="textInput" name="settings.cssStyle_today" type="text" value="' + cssStyle_today + '" /></td>' + printHintBox('Defines the appearance of "Today" text') +\r
@@ -791,14 +796,8 @@ function changeCssClass(classname, properties)
        for(var i = 0; i < document.styleSheets[0]['cssRules'].length; i++)\r
        {\r
                if (document.styleSheets[0]['cssRules'][i].selectorText == classname) {\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText);\r
-                       //document.styleSheets[0]['cssRules'][i].cssText = classname + ' { ' + properties + ' }';\r
                        document.styleSheets[0].deleteRule(i);\r
-                       //document.styleSheets[0].insertRule(classname + ' { ' + properties + ' }', 0);\r
                        document.styleSheets[0].insertRule(classname + ' { ' + properties + ' }', document.styleSheets[0]['cssRules'].length);\r
-                       //document.styleSheets[0]['cssRules'][i].style.cssText = classname + ' { ' + properties + ' }';\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText);\r
-                       //alert(document.styleSheets[0]['cssRules'][i].cssText + '\n'+ classname + ' { ' + properties + ' }');\r
                        break;\r
                }\r
        }\r
@@ -807,6 +806,7 @@ function changeCssClass(classname, properties)
 function updateCssClasses()\r
 {\r
        changeCssClass(".background", cssStyle_background);\r
+       changeCssClass(".backgroundFullscreen", cssStyle_backgroundFullscreen);\r
        changeCssClass(".weekDay", cssStyle_weekDay);\r
        changeCssClass(".date", cssStyle_date);\r
        changeCssClass(".today", cssStyle_today);\r
@@ -840,6 +840,7 @@ function restoreDefaultSettings()
        enableDaylightSaving = true;\r
 \r
        cssStyle_background = "color:#ffffff; background-color:#000000";\r
+       cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000";\r
        cssStyle_weekDay = "";\r
        cssStyle_date = "";\r
        cssStyle_today = "color:#ff0000";\r
@@ -953,6 +954,11 @@ function loadSettings()
                cssStyle_background = widget.preferenceForKey('cssStyle_background');\r
        else\r
                cssStyle_background = "color:#ffffff; background-color:#000000";\r
+\r
+       if (widget.preferenceForKey('cssStyle_backgroundFullscreen'))\r
+               cssStyle_backgroundFullscreen = widget.preferenceForKey('cssStyle_backgroundFullscreen');\r
+       else\r
+               cssStyle_backgroundFullscreen = "color:#ffffff; background-color:#000000";\r
                \r
        if (widget.preferenceForKey('cssStyle_weekDay'))\r
                cssStyle_weekDay = widget.preferenceForKey('cssStyle_weekDay');\r
@@ -1018,6 +1024,7 @@ function saveSettings()
        widget.setPreferenceForKey(enableDaylightSaving ? 'true' : 'false', 'enableDaylightSaving');\r
        \r
        widget.setPreferenceForKey(cssStyle_background, 'cssStyle_background');\r
+       widget.setPreferenceForKey(cssStyle_backgroundFullscreen, 'cssStyle_backgroundFullscreen');\r
        widget.setPreferenceForKey(cssStyle_weekDay, 'cssStyle_weekDay');\r
        widget.setPreferenceForKey(cssStyle_date, 'cssStyle_date');\r
        widget.setPreferenceForKey(cssStyle_today, 'cssStyle_today');\r
@@ -1073,6 +1080,7 @@ function showFullscreen()
        document.getElementById("fullscreenView").style.display = "block";\r
        document.getElementById("aboutView").style.display = "none";\r
        document.getElementById("settingsView").style.display = "none";\r
+       document.getElementById('body').className = "backgroundFullscreen";\r
        createMenu();\r
        updateData();\r
 }\r
@@ -1094,6 +1102,10 @@ function updateHomescreen()
                        document.getElementById('body').style.backgroundColor = 'none';\r
                        window.widget.performTransition();\r
                }\r
+               else if (document.getElementById('body').style.backgroundImage == "")\r
+               {\r
+                       document.getElementById('body').style.backgroundImage = 'url(background_' + orientation + '.png)';\r
+               }\r
        }\r
 }\r
 \r
@@ -1103,6 +1115,7 @@ function showHomescreen()
        document.getElementById("fullscreenView").style.display = "none";\r
        document.getElementById("aboutView").style.display = "none";\r
        document.getElementById("settingsView").style.display = "none";\r
+       document.getElementById('body').className = "background";\r
        updateData();\r
 }\r
 \r
@@ -1111,7 +1124,7 @@ function showHomescreen()
 <style type="text/css">\r
 table { margin:0px; padding:0px; border-spacing:0px; }\r
 td { padding:0px 5px 0px 0px; white-space:nowrap; overflow:hidden; }\r
-hr { w_idth:100%; color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
+hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
 .settingsInfo { display:none; font-style:italic; }\r
 .title { font-weight:bold; font-size:14pt; }\r
 .textInput { width:90%; }\r