]> code.delx.au - comingnext/blobdiff - comingNext/index.html
Revert "added NaN validation check for settings with numbers"
[comingnext] / comingNext / index.html
index af47f3b3a08cf8999686e6d593093a3b028ac33e..7e774b94776fc97fb990360e248f64f20c02d9f6 100644 (file)
@@ -99,6 +99,7 @@ var calendarColors = [];
 var updateTimer = null;\r
 var screenRotationTimer = null;\r
 var lastUpdateTime = now;\r
+var errorOccured = false;\r
 \r
 // vars for daylight saving time\r
 var summertime = false; // true, if current date is in summer, false if in winter\r
@@ -193,6 +194,9 @@ function error(message)
 {\r
        console.info('Error: ' + message);\r
        document.getElementById("calendarList").innerHTML = 'Error: ' + message;\r
+       document.getElementById("fullscreenCalendarList").innerHTML = 'Error: ' + message;\r
+       errorOccured = true;\r
+       document.onclick = null;\r
 }\r
 \r
 function areDatesEqual(date1, date2)\r
@@ -515,6 +519,9 @@ function formatTime(date)
 function updateData()\r
 {\r
        console.info('updateData()');\r
+       if (errorOccured) {\r
+               return;\r
+       }\r
 \r
        // check if we got additional or less calendars since our last update\r
        var newCalendarList = listCalendars();\r
@@ -847,8 +854,8 @@ function init()
                else\r
                        throw('device object does not exist');\r
        } catch(e) {\r
-               error('loading Calendar service: ' + e + ', line ' + e.line);\r
-               return;\r
+               error('loading Calendar service: ' + e + ', line ' + e.line + '<br /><a onclick="widget.openURL(\'http://comingnext.sf.net/help\'); return false;" href="http://comingnext.sf.net/help">' + getLocalizedText('menu.help') + '</a>');\r
+               //return;\r
        }\r
 \r
        calendarList = listCalendars();\r
@@ -896,15 +903,18 @@ function createMenu()
        var id = 0;\r
        var menuSettings = new MenuItem(getLocalizedText('menu.settings'), id++);\r
        var menuCallApp = new MenuItem(getLocalizedText('menu.openCalendarApp'), id++);\r
+       var menuHelp = new MenuItem(getLocalizedText('menu.help'), id++);\r
        var menuUpdate = new MenuItem(getLocalizedText('menu.update'), id++);\r
        var menuAbout = new MenuItem(getLocalizedText('menu.about'), id++);\r
        menuSettings.onSelect = showSettings;\r
        menuAbout.onSelect = showAbout;\r
        menuCallApp.onSelect = launchCalendar;\r
        menuUpdate.onSelect = showUpdate;\r
+       menuHelp.onSelect = showHelp;\r
        window.menu.clear();\r
        window.menu.append(menuCallApp);\r
        window.menu.append(menuSettings);\r
+       window.menu.append(menuHelp);\r
        window.menu.append(menuUpdate);\r
        window.menu.append(menuAbout);  \r
 }\r
@@ -1203,6 +1213,10 @@ function showAbout()
        document.getElementById("name").innerHTML = "Coming Next " + version;\r
 }\r
 \r
+function showHelp() {\r
+       widget.openURL('http://comingnext.sf.net/help');\r
+}\r
+\r
 function updateFullscreen()\r
 {\r
 }\r
@@ -1213,13 +1227,16 @@ function showFullscreen()
        hideViews();\r
        document.getElementById("fullscreenView").style.display = "block";\r
        document.getElementById('body').className = "backgroundFullscreen";\r
-       document.onclick = launchCalendar;\r
+       if (!errorOccured)\r
+               document.onclick = launchCalendar;\r
        createMenu();\r
        updateData();\r
 }\r
 \r
 function getBackgroundImage()\r
 {\r
+       if (errorOccured)\r
+               return '';\r
        var bgImage;\r
        if (config['backgroundImageLocation'].Value == config['backgroundImageLocation'].ValidValues[0]) // internal\r
                bgImage = 'background_' + orientation + '.png';\r
@@ -1495,6 +1512,7 @@ function updateCalendarColors()
 </script>\r
 \r
 <style type="text/css">\r
+a { color:#aaccff }\r
 table { margin:0px; padding:0px; border-spacing:0px; }\r
 td { padding:0px 5px 0px 0px; white-space:nowrap; overflow:hidden; }\r
 hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; border-style:none; }\r
@@ -1541,7 +1559,7 @@ hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; borde
                <p class="credits">Marcella Ferrari (italian translation)</p>\r
                <p class="credits">Venos (italian translation)</p>\r
        <p>This software is open source and licensed under the GPLv3.</p>\r
-       <p>Visit <a onclick="widget.openURL('http://sourceforge.net/projects/comingnext'); return false;" href="http://sourceforge.net/projects/comingnext">sourceforge.net/projects/comingnext</a> for free updates.</p>\r
+       <p>Visit <a onclick="widget.openURL('http://comingnext.sf.net/'); return false;" href="http://comingnext.sf.net/">comingnext.sf.net</a> for free updates.</p>\r
        <hr />\r
 </div>\r
 <div id="updateView" style="display:none">\r