]> code.delx.au - comingnext/blobdiff - comingNext/index.html
fixed 'overdue' text setting not beeing used
[comingnext] / comingNext / index.html
index 668867eff6db9c93a388571d6b8bc511e3a19100..6ac4e420a9893798f25185e8bcae17c764120cec 100644 (file)
 .now { }\r
 .description { }\r
 .icon { }\r
+.overdue {}\r
 </style>\r
 \r
+<script type="text/javascript" src="localizedTextStrings.js" charset="utf-8" />\r
+\r
 <script>\r
 // valid types for the config object are 'Int', 'Bool', 'String', 'Enum', 'UID'\r
 var config = {\r
-monthRange: {\r
-       Type: 'Int',\r
-       Default: 2,\r
-       Value: 2,\r
-       Name: 'Month Range',\r
-       Info: 'number of months to include in the event list',},\r
-includeTodos: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Include ToDos',\r
-       Info: 'disable to remove ToDos from event list',},\r
-useBackgroundImage: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Use Background Image',\r
-       Info: 'use background_portrait.png and background_landscape.png to fake transparency. Disable to use a solid background color',},\r
-showCombinedDateTime: {\r
-       Type: 'Bool',\r
-       Default: false,\r
-       Value: false,\r
-       Name: 'Show Combined Date/Time',\r
-       Info: 'only show the time for events happening today, otherwise just show the date',},\r
-showLocation: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Show Location',\r
-       Info: 'show the location for meeting events',},\r
-showTodayAsText: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Show Today as Text',\r
-       Info: 'if enabled, the current date will be shown as "Today" instead of "31.12"',},\r
-todayText: {\r
-       Type: 'String',\r
-       Default: 'Today',\r
-       Value: 'Today',\r
-       Name: '"Today" Text',\r
-       Info: 'text to display for "Today"',},\r
-tomorrowText: {\r
-       Type: 'String',\r
-       Default: 'Tomorrow',\r
-       Value: 'Tomorrow',\r
-       Name: '"Tomorrow" Text',\r
-       Info: 'text to display for "Tomorrow"',},\r
-showNowAsText: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Show Now as Text',\r
-       Info: 'if enabled, the appointment time will be shown as "Now" instead of "12:00"',},\r
-nowText: {\r
-       Type: 'String',\r
-       Default: 'Now',\r
-       Value: 'Now',\r
-       Name: '"Now" Text',\r
-       Info: 'text to display for "Now"',},\r
-dateSeparator: {\r
-       Type: 'String',\r
-       Default: '.',\r
-       Value: '.',\r
-       Name: 'Date Separator',\r
-       Info: 'separator for dates. e.g. "31.12" or "31/12"',},\r
-dateFormat: {\r
-       Type: 'Enum',\r
-       Default: 'auto',\r
-       Value: 'auto',\r
-       ValidValues: ['auto', 'DDMM', 'MMDD'],\r
-       Name: 'Date Format',\r
-       Info: 'how dates will be displayed. \'auto\' will autodetect your phone\'s date format setting. \'MMDD\' will write month first, \'DDMM\' will write day first',},\r
-weekDayLength: {\r
-       Type: 'Int',\r
-       Default: 2,\r
-       Value: 2,\r
-       Name: 'Weekday Length',\r
-       Info: 'defines how many characters of the weekday will be shown. E.g. 2 will cut "Friday" to "Fr"',},\r
-updateDataInterval: {\r
-       Type: 'Int',\r
-       Default: 5,\r
-       Value: 5,\r
-       Name: 'Update Data Interval',\r
-       Info: 'how many minutes to wait before updating the displayed data. The higher the number, the less battery is used',},\r
-calendarApp: {\r
-       Type: 'UID',\r
-       Default: 0x10005901,\r
-       Value: 0x10005901,\r
-       Name: 'Calendar Application To Run',\r
-       Info: 'UID of the calendar app to run when clicking the widget. 0x10005901 = buildin calendar, 0x20004ec1 = Epocware Handy Calendar',},\r
-eventsPerWidget: {\r
-       Type: 'Int',\r
-       Default: 4,\r
-       Value: 4,\r
-       Name: 'Events Per Widget',\r
-       Info: 'number of events to show per widget. Default is 4',},\r
-showNothingText: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Show "Nothing" Text',\r
-       Info: 'if enabled, show a text if no events are in the list',},\r
-nothingText: {\r
-       Type: 'String',\r
-       Default: 'No further events within 2 months',\r
-       Value: 'No further events within 2 months',\r
-       Name: '"No further events..." Text',\r
-       Info: 'text to show when no events are in the list',},\r
-enableDaylightSaving: {\r
-       Type: 'Bool',\r
-       Default: true,\r
-       Value: true,\r
-       Name: 'Enable Daylight Saving (+1h)',\r
-       Info: 'enable this if you are in a timezone that has daylight saving time (+1h)',},\r
-cssStyle_background: {\r
-       Type: 'String',\r
-       Default: 'color:#ffffff; background-color:#000000',\r
-       Value: 'color:#ffffff; background-color:#000000',\r
-       Name: '.background',\r
-       Info: '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
-cssStyle_backgroundFullscreen: {\r
-       Type: 'String',\r
-       Default: 'color:#ffffff; background-color:#000000',\r
-       Value: 'color:#ffffff; background-color:#000000',\r
-       Name: '.backgroundFullscreen',\r
-       Info: 'Same as background but for the fullscreen version of the widget',},\r
-cssStyle_weekDay: {\r
-       Type: 'String',\r
-       Default: '',\r
-       Value: '',\r
-       Name: '.weekDay',\r
-       Info: 'Defines the appearance of all week day texts',},\r
-cssStyle_date: {\r
-       Type: 'String',\r
-       Default: '',\r
-       Value: '',\r
-       Name: '.date',\r
-       Info: 'Defines the appearance of all date texts',},\r
-cssStyle_today: {\r
-       Type: 'String',\r
-       Default: 'color:#ff0000',\r
-       Value: 'color:#ff0000',\r
-       Name: '.today',\r
-       Info: 'Defines the appearance of "Today" text',},\r
-cssStyle_tomorrow: {\r
-       Type: 'String',\r
-       Default: 'color:#0000ff',\r
-       Value: 'color:#0000ff',\r
-       Name: '.tomorrow',\r
-       Info: 'Defines the appearance of "Tomorrow" text',},\r
-cssStyle_time: {\r
-       Type: 'String',\r
-       Default: '',\r
-       Value: '',\r
-       Name: '.time',\r
-       Info: 'Defines the appearance of all time texts',},\r
-cssStyle_now: {\r
-       Type: 'String',\r
-       Default: 'color:#ff00ff',\r
-       Value: 'color:#ff00ff',\r
-       Name: '.now',\r
-       Info: 'Defines the appearance of "Now" text',},\r
-cssStyle_description: {\r
-       Type: 'String',\r
-       Default: '',\r
-       Value: '',\r
-       Name: '.description',\r
-       Info: 'Defines the appearance of all event descriptions',},\r
-cssStyle_icon: {\r
-       Type: 'String',\r
-       Default: 'width:15px; height:15px',\r
-       Value: 'width:15px; height:15px',\r
-       Name: '.icon',\r
-       Info: 'Defines size and appearance of icons',},\r
+       monthRange: { Type: 'Int', Default: 2, Value: 2,},\r
+       includeTodos: { Type: 'Bool', Default: true, Value: true,},\r
+       useBackgroundImage: { Type: 'Bool', Default: true, Value: true,},\r
+       backgroundImageLocation: { Type: 'Enum', Default: 'internal', Value: 'internal', ValidValues: ['internal', 'external']},\r
+       showCombinedDateTime: { Type: 'Bool', Default: false, Value: false,},\r
+       showLocation: { Type: 'Bool', Default: true, Value: true,},\r
+       showTodayAsText: { Type: 'Bool', Default: true, Value: true,},\r
+       todayText: { Type: 'String', Default: getLocalizedText('settings.default.todayText'), Value: getLocalizedText('settings.default.todayText'),},\r
+       tomorrowText: { Type: 'String', Default: getLocalizedText('settings.default.tomorrowText'), Value: getLocalizedText('settings.default.tomorrowText'),},\r
+       showNowAsText: { Type: 'Bool', Default: true, Value: true,},\r
+       nowText: { Type: 'String', Default: getLocalizedText('settings.default.nowText'), Value: getLocalizedText('settings.default.nowText'),},\r
+       markOverdueTodos: { Type: 'Bool', Default: true, Value: true,},\r
+       overdueText: {Type: 'String', Default: getLocalizedText('settings.default.overdueText'), Value: getLocalizedText('settings.default.overdueText'),},\r
+       dateSeparator: { Type: 'String', Default: getLocalizedText('settings.default.dateSeparator'), Value: getLocalizedText('settings.default.dateSeparator'),},\r
+       dateFormat: { Type: 'Enum', Default: 'auto', Value: 'auto', ValidValues: ['auto', 'DDMM', 'MMDD'],},\r
+       weekDayLength: { Type: 'Int', Default: 2, Value: 2,},\r
+       updateDataInterval: { Type: 'Int', Default: 5, Value: 5,},\r
+       calendarApp: { Type: 'UID', Default: 0x10005901, Value: 0x10005901,},\r
+       eventsPerWidget: { Type: 'Int', Default: 4, Value: 4,},\r
+       showNothingText: { Type: 'Bool', Default: true, Value: true,},\r
+       nothingText: { Type: 'String', Default: getLocalizedText('settings.default.nothingText'), Value: getLocalizedText('settings.default.nothingText'),},\r
+       enableDaylightSaving: { Type: 'Bool', Default: true, Value: true,},\r
+       hideWidgetOnCalendarOpen: { Type: 'Bool', Default: false, Value: false,},\r
+       cssStyle_background: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',},\r
+       cssStyle_backgroundFullscreen: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',},\r
+       cssStyle_weekDay: { Type: 'String', Default: '', Value: '',},\r
+       cssStyle_date: { Type: 'String', Default: '', Value: '',},\r
+       cssStyle_today: { Type: 'String', Default: 'color:#ff0000', Value: 'color:#ff0000',},\r
+       cssStyle_tomorrow: { Type: 'String', Default: 'color:#0000ff', Value: 'color:#0000ff',},\r
+       cssStyle_time: { Type: 'String', Default: '', Value: '',},\r
+       cssStyle_now: { Type: 'String', Default: 'color:#ff00ff', Value: 'color:#ff00ff',},\r
+       cssStyle_description: { Type: 'String', Default: '', Value: '',},\r
+       cssStyle_icon: { Type: 'String', Default: 'width:15px; height:15px', Value: 'width:15px; height:15px',},\r
+       cssStyle_overdue: { Type: 'String', Default: 'color:#ffff00', Value: 'color:#ffff00',},\r
 }\r
 \r
+\r
+\r
 //-------------------------------------------------------\r
 // Nothing of interest from here on...\r
 //-------------------------------------------------------\r
 var panelNum = 0; // use 1 for second panel\r
-var version = "1.23";\r
+var version = "1.26";\r
+var versionURL = "http://comingnext.sourceforge.net/version.xml";\r
 var calendarService = null;\r
 var cacheEntriesHtml = [];\r
 var months_translated = [];\r
 var orientation = '';\r
 var now = new Date();\r
-var mode = 0; // 0 = homescreen, 1 = fullscreen, 2 = settings, 3 = about\r
+var mode = 0; // 0 = homescreen, 1 = fullscreen, 2 = settings, 3 = about, 4 = check for update\r
+var reqV = null; \r
 \r
 // vars for daylight saving time\r
 var daylightsavingWinter = 0;\r
@@ -288,25 +154,28 @@ function error(message)
        document.getElementById("calendarList").innerHTML = 'Error: ' + message;\r
 }\r
 \r
-function isToday(date)\r
+function areDatesEqual(date1, date2)\r
 {\r
-       if (date.getDate() == now.getDate() && date.getMonth() == now.getMonth())\r
-               return true;\r
-       return false;\r
+       return (date1.getFullYear() == date2.getFullYear() && \r
+                       date1.getMonth() == date2.getMonth() && \r
+                       date1.getDate() == date2.getDate());\r
 }\r
 \r
 function isTomorrow(date)\r
 {\r
-       if ((date.getDate() == now.getDate() + 1 && date.getMonth() == now.getMonth()) ||\r
-           (date.getDate() == 0 && date.getMonth() == now.getMonth() + 1) ||\r
-           (date.getDate() == 0 && date.getMonth() == now.getMonth() + 1 && date.getYear() == now.getYear() + 1))\r
-               return true;\r
-       return false;\r
+       // tommorow = now + 1 day\r
+       // ToDo: some days can be shorter as 24 hours(daylight saving change day)\r
+       return areDatesEqual(date, new Date (now.getTime() + 24*60*60*1000));\r
+}\r
+\r
+function isToday(date)\r
+{\r
+       return areDatesEqual(date, now);\r
 }\r
 \r
 function collectLocales()\r
 {\r
-       var tmpyear = ((panelNum == 0) ? 2000 : 2001);\r
+       var tmpyear = 2000 + panelNum;\r
        var month = 0;\r
 \r
        if (months_translated.length > 0)\r
@@ -558,6 +427,7 @@ function formatTime(date)
 \r
 function updateData()\r
 {\r
+       console.info('updateData()');\r
        calcDaylightSaving();\r
        try {\r
                // meetings have time\r
@@ -571,6 +441,8 @@ function updateData()
                        }\r
                }\r
                var meetingResult = calendarService.IDataSource.GetList(meetingListFiltering);\r
+               if (meetingResult.ErrorCode != 0)\r
+                       throw("Error fetching calendar data: " + meetingResult.ErrorCode + ': ' + meetingResult.ErrorMessage);\r
                var meetingList = meetingResult.ReturnValue;\r
 \r
                // todos don't, they start on 00:00 hrs., but should be visible anyway\r
@@ -600,11 +472,28 @@ function updateData()
                var counter = 0;\r
                var entryDate = '';\r
                var dateArr = [];\r
-               var entriesHtml = '<table>';\r
+               var fontsize = 'normal';\r
+               if (mode == 0) {\r
+                       if (config['eventsPerWidget'].Value == 3) {\r
+                               fontsize = '17pt';\r
+                               changeCssClass('.icon', 'width:20px; height:20px');\r
+                       }\r
+                       else if (config['eventsPerWidget'].Value == 5) {\r
+                               fontsize = '10pt';\r
+                               changeCssClass('.icon', 'width:10px; height:10px');\r
+                       }\r
+                       else if (config['eventsPerWidget'].Value == 6) {\r
+                               fontsize = '8pt';\r
+                               changeCssClass('.icon', 'width:8px; height:8px');\r
+                       }\r
+               }\r
+               else\r
+                       changeCssClass('.icon', config['cssStyle_icon'].Value);\r
+               var entriesHtml = '<table style="font-size:' + fontsize + ';">';\r
                var eventIds = [];\r
                var max;\r
                if (mode == 0)\r
-                       max = ((panelNum == 0) ? config['eventsPerWidget'].Value : 2 * config['eventsPerWidget'].Value);\r
+                       max = (panelNum + 1) * config['eventsPerWidget'].Value;\r
                else\r
                        max = 30; // we can display a lot more events in fullscreen mode\r
 \r
@@ -634,7 +523,7 @@ function updateData()
                                }\r
 \r
                                // make sure that we don't include an event twice (useful for ToDos that might come up twice)\r
-                               if (eventIds[entry.id] == 1) {\r
+                               if (eventIds[entry.id] == 1 && entry.Type == 'ToDo') {\r
                                        console.info('skipped (already included) ' + entry.id);\r
                                        counter--;\r
                                        continue;\r
@@ -706,10 +595,20 @@ function updateData()
                                }\r
 \r
                                // skip events for the first panel in case this is the second one and we're not in fullscreen mode\r
-                               if (mode == 0 && panelNum == 1 && counter < config['eventsPerWidget'].Value + 1) {\r
+                               if (mode == 0 && panelNum > 0 && counter < panelNum * config['eventsPerWidget'].Value + 1) {\r
                                        console.info('skipping (already in first widget) ' + entry.id);\r
                                        continue;\r
                                }\r
+                               \r
+                               // mark overdue todos\r
+                               var overdue = false;\r
+                               if (entry.Type == 'ToDo') {\r
+                                       var tmp1 = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0,0,0);\r
+                                       var tmp2 = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0,0,0);\r
+                                       if (tmp1.getTime() < tmp2.getTime()) {\r
+                                               overdue = true;\r
+                                       }\r
+                               }\r
 \r
                                // generate html output\r
                                entriesHtml += '<tr><td><img class="icon" src="' + entry.Type + '.png" /></td>';\r
@@ -720,7 +619,10 @@ function updateData()
                                        var weekDay = date.toLocaleDateString().substr(0,config['weekDayLength'].Value);\r
                                        var time = formatTime(date);\r
                                        var dateStr = formatDate(date, entryDate);\r
-                                       if (entry.Type == 'ToDo' || entry.Type == 'Anniversary' || entry.Type == 'DayEvent' || entry.Type == 'Reminder') {\r
+                                       if (entry.Type == 'ToDo' && overdue && config['markOverdueTodos'].Value) {\r
+                                               dateStr = '<span class="overdue">' + config['overdueText'].Value + '</span>';\r
+                                               entriesHtml += '<td colspan="4" width="1px"><span class="date">' + dateStr + '</span> ';\r
+                                       } else if (entry.Type == 'ToDo' || entry.Type == 'Anniversary' || entry.Type == 'DayEvent' || entry.Type == 'Reminder') {\r
                                                if ((isToday(date) || isTomorrow(date)) && config['showTodayAsText'].Value) // show weekday if the date string is not text. looks odd otherwise\r
                                                        entriesHtml += '<td colspan="4" width="1px"><span class="date">' + dateStr + '</span> ';\r
                                                else\r
@@ -745,8 +647,10 @@ function updateData()
                        }\r
                }\r
                entriesHtml += '</table>';\r
-               if (config['showNothingText'].Value && entriesHtml == '<table></table>')\r
-                       entriesHtml = '<div style="width:295px; height:75px; text-align:center; line-height:75px; overflow:visible;">' + config['nothingText'].Value + '</div>';\r
+               if (config['showNothingText'].Value && entriesHtml == '<table></table>') {\r
+                       var text = config['nothingText'].Value.replace(/%d/, config['monthRange'].Value);\r
+                       entriesHtml = '<div style="width:295px; height:75px; text-align:center; line-height:75px; overflow:visible;">' + text + '</div>';\r
+               }\r
                if (cacheEntriesHtml != entriesHtml) {\r
                        if (mode == 0)\r
                                document.getElementById('calendarList').innerHTML = entriesHtml;\r
@@ -785,7 +689,8 @@ function launchCalendar()
 {\r
        try {\r
                widget.openApplication(config['calendarApp'].Value, "");\r
-               //window.close();\r
+               if (config['hideWidgetOnCalendarOpen'].Value)\r
+                       window.close();\r
        } catch(e) {\r
                error('starting Calendar App');\r
                return;\r
@@ -794,11 +699,16 @@ function launchCalendar()
 \r
 function init()\r
 {\r
+       console.info('New widget instance starting up...');\r
+       \r
        try {\r
                // call calendar service\r
-               calendarService = device.getServiceObject("Service.Calendar", "IDataSource");\r
+               if (device != "undefined")\r
+                       calendarService = device.getServiceObject("Service.Calendar", "IDataSource");\r
+               else\r
+                       throw('device object does not exist');\r
        } catch(e) {\r
-               error('loading Calendar service');\r
+               error('loading Calendar service: ' + e + ', line ' + e.line);\r
                return;\r
        }\r
 \r
@@ -822,28 +732,29 @@ function createMenu()
        window.menu.setLeftSoftkeyLabel("",null);\r
        window.menu.setRightSoftkeyLabel("",null);\r
        var id = 0;\r
-       var menuSettings = new MenuItem("Settings", id++);\r
-       var menuCallApp = new MenuItem("Open Calendar App", id++);\r
-       var menuAbout = new MenuItem("About", id++);\r
+       var menuSettings = new MenuItem(getLocalizedText('menu.settings'), id++);\r
+       var menuCallApp = new MenuItem(getLocalizedText('menu.openCalendarApp'), 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
        window.menu.clear();\r
        window.menu.append(menuCallApp);\r
        window.menu.append(menuSettings);\r
+       window.menu.append(menuUpdate);\r
        window.menu.append(menuAbout);  \r
 }\r
 \r
 function showSettings()\r
 {\r
        mode = 2;\r
-       document.getElementById("homescreenView").style.display = "none";\r
-       document.getElementById("fullscreenView").style.display = "none";\r
-       document.getElementById("aboutView").style.display = "none";\r
+       hideViews();\r
        document.getElementById("settingsView").style.display = "block";\r
        document.onclick = null;\r
        \r
-       window.menu.setLeftSoftkeyLabel("Save", function()\r
+       window.menu.setLeftSoftkeyLabel(getLocalizedText('settings.save'), function()\r
        {\r
                for (var key in config) {\r
                        if (config[key].Type == 'String')\r
@@ -871,7 +782,7 @@ function showSettings()
                mode = 1;\r
                showFullscreen();\r
        });\r
-       window.menu.setRightSoftkeyLabel("Cancel", function()\r
+       window.menu.setRightSoftkeyLabel(getLocalizedText('settings.cancel'), function()\r
        {\r
                mode = 1;\r
                showFullscreen();\r
@@ -880,21 +791,21 @@ function showSettings()
        var settingsHtml = '<form>';\r
        for (var key in config) {\r
                if (config[key].Type == 'String')\r
-                       settingsHtml += '<table><tr><td>' + config[key].Name + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="' + config[key].Value + '" /></td>' + printHintBox(config[key].Info) + '<hr />';\r
+                       settingsHtml += '<table><tr><td>' + getLocalizedText('settings.name.' + key) + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="' + config[key].Value + '" /></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                else if (config[key].Type == 'Int')\r
-                       settingsHtml += '<table><tr><td>' + config[key].Name + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="' + config[key].Value + '" /></td>' + printHintBox(config[key].Info) + '<hr />';\r
+                       settingsHtml += '<table><tr><td>' + getLocalizedText('settings.name.' + key) + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="' + config[key].Value + '" /></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                else if (config[key].Type == 'Bool')\r
-                       settingsHtml += '<table><tr><td>' + config[key].Name + '<br /><input name="settings.' + key + '" type="checkbox" value="true" ' + (config[key].Value ? 'checked="checked"' : '') + '/></td>' + printHintBox(config[key].Info) + '<hr />';\r
+                       settingsHtml += '<table><tr><td>' + getLocalizedText('settings.name.' + key) + '<br /><input name="settings.' + key + '" type="checkbox" value="true" ' + (config[key].Value ? 'checked="checked"' : '') + '/></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                else if (config[key].Type == 'UID')\r
-                       settingsHtml += '<table><tr><td>' + config[key].Name + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="0x' + config[key].Value.toString(16) + '" /></td>' + printHintBox(config[key].Info) + '<hr />';\r
+                       settingsHtml += '<table><tr><td>' + getLocalizedText('settings.name.' + key) + '<br /><input class="textInput" name="settings.' + key + '" type="text" value="0x' + config[key].Value.toString(16) + '" /></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                else if (config[key].Type == 'Enum') {\r
-                       settingsHtml += '<table><tr><td>' + config[key].Name + '<br /><select name="settings.' + key + '" size="1">';\r
+                       settingsHtml += '<table><tr><td>' + getLocalizedText('settings.name.' + key) + '<br /><select name="settings.' + key + '" size="1">';\r
                        for(var i = 0; i < config[key].ValidValues.length; i++)\r
-                               settingsHtml += '<option label="' + config[key].ValidValues[i] + '"' + (config[key].Value == config[key].ValidValues[i] ? ' selected="selected"' : '') + '>' + config[key].ValidValues[i] + '</option>';\r
-                       settingsHtml += '</select></div></td>' + printHintBox(config[key].Info) + '<hr />';\r
+                               settingsHtml += '<option value="' + config[key].ValidValues[i] + '"' + (config[key].Value == config[key].ValidValues[i] ? ' selected="selected"' : '') + '>' + getLocalizedText('settings.validValues.' + key + '.' + config[key].ValidValues[i]) + '</option>';\r
+                       settingsHtml += '</select></div></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                }\r
        }\r
-       settingsHtml += '<input name="reset" type="button" value="Restore Defaults" onclick="javascript:restoreDefaultSettings();showSettings();" />';\r
+       settingsHtml += '<input name="reset" type="button" value="' + getLocalizedText('settings.restoreDefaults') + '" onclick="javascript:restoreDefaultSettings();showSettings();" />';\r
        settingsHtml += '</form>';\r
        document.getElementById("settingsList").innerHTML = settingsHtml;\r
 }\r
@@ -914,7 +825,7 @@ function changeCssClass(classname, properties)
 function updateCssClasses()\r
 {\r
        for(var key in config) {\r
-               changeCssClass(config[key].Name, config[key].Value);\r
+               changeCssClass(getLocalizedText('settings.name.' + key), config[key].Value);\r
        }\r
 }\r
 \r
@@ -941,7 +852,7 @@ function loadSettings()
                }\r
                else\r
                        config[key].Value = config[key].Default;\r
-               \r
+               console.info('Settings: ' + key + '=\'' + config[key].Value + '\'');\r
        }\r
 }\r
 \r
@@ -973,21 +884,19 @@ var uniqueId = 0;
 function printHintBox(text)\r
 {\r
        uniqueId++;\r
-       return '<td width="1%" align="right" onclick="javascript:toggleVisibility(\'info' + uniqueId + '\')">Help</td></tr></table>'+\r
+       return '<td width="1%" align="right" onclick="javascript:toggleVisibility(\'info' + uniqueId + '\')">' + getLocalizedText('settings.help') + '</td></tr></table>'+\r
               '<div class="settingsInfo" id="info' + uniqueId + '">' + text + '</div>';\r
 }\r
 \r
 function showAbout()\r
 {\r
        mode = 3;\r
-       document.getElementById("homescreenView").style.display = "none";\r
-       document.getElementById("fullscreenView").style.display = "none";\r
+       hideViews();\r
        document.getElementById("aboutView").style.display = "block";\r
-       document.getElementById("settingsView").style.display = "none";\r
        document.onclick = null;\r
        \r
        window.menu.setLeftSoftkeyLabel(" ", function(){});\r
-       window.menu.setRightSoftkeyLabel("Back", function()\r
+       window.menu.setRightSoftkeyLabel(getLocalizedText('softkey.back'), function()\r
        {\r
                mode = 1;\r
                showFullscreen();\r
@@ -1003,16 +912,24 @@ function updateFullscreen()
 \r
 function showFullscreen()\r
 {\r
-       document.getElementById("homescreenView").style.display = "none";\r
+       hideViews();\r
        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
        document.onclick = launchCalendar;\r
        createMenu();\r
        updateData();\r
 }\r
 \r
+function getBackgroundImage()\r
+{\r
+       var bgImage;\r
+       if (config['backgroundImageLocation'].Value == config['backgroundImageLocation'].ValidValues[0]) // internal\r
+               bgImage = 'background_' + orientation + '.png';\r
+       else\r
+               bgImage = 'C:/Data/background_' + panelNum + '_' + orientation + '.png';\r
+       return bgImage;\r
+}\r
+\r
 function updateHomescreen()\r
 {\r
        if (config['useBackgroundImage'].Value) {\r
@@ -1020,34 +937,104 @@ function updateHomescreen()
                if (orientation != 'portrait' && screen.width == 360 && screen.height == 640) {\r
                        window.widget.prepareForTransition("fade");\r
                        orientation = 'portrait';\r
-                       document.getElementById('body').style.backgroundImage = 'url(background_' + orientation + '.png)';\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
                        window.widget.prepareForTransition("fade");\r
                        orientation = 'landscape';\r
-                       document.getElementById('body').style.backgroundImage = 'url(background_' + orientation + '.png)';\r
+                       document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')';\r
                        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
+                       document.getElementById('body').style.backgroundImage = 'url(' + getBackgroundImage() + ')';\r
                }\r
        }\r
 }\r
 \r
 function showHomescreen()\r
 {\r
+       hideViews();\r
        document.getElementById("homescreenView").style.display = "block";\r
-       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
        document.onclick = null;\r
        updateData();\r
 }\r
 \r
+function getLocalizedText(p_Txt)\r
+{\r
+       if (localizedText[p_Txt])\r
+               return localizedText[p_Txt];\r
+       else \r
+               return 'ERROR: missing translation for ' + p_Txt;\r
+}\r
+\r
+function showUpdate()\r
+{\r
+       mode = 4;\r
+       hideViews();\r
+       document.getElementById("updateView").style.display = "block";\r
+       document.onclick = null;\r
+       \r
+       window.menu.setLeftSoftkeyLabel(getLocalizedText('update.checknow'), function(){\r
+               checkForUpdate();\r
+       });\r
+       window.menu.setRightSoftkeyLabel(getLocalizedText('softkey.back'), function()\r
+       {\r
+               mode = 1;\r
+               showFullscreen();\r
+       });\r
+       \r
+       document.getElementById("currentVersion").innerHTML = getLocalizedText("update.current") + version;\r
+       checkForUpdate();\r
+}\r
+\r
+function checkForUpdate()\r
+{\r
+       // asynch XHR to server url\r
+       reqV = new XMLHttpRequest();\r
+       reqV.onreadystatechange = checkForUpdateCallback;\r
+       document.getElementById("updateDiv").innerHTML = getLocalizedText("update.checking");\r
+       reqV.open("GET", versionURL, true);\r
+       reqV.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" ); // disable caching\r
+       reqV.send(null);\r
+}\r
+\r
+function checkForUpdateCallback()\r
+{ \r
+       if (reqV.readyState == 4) {\r
+               if (reqV.status == 200) {\r
+                       var resultXml = reqV.responseText;\r
+                       if (resultXml) {\r
+                               var div = document.getElementById("tmp");\r
+                               div.innerHTML = resultXml;\r
+                               var newVersion = div.getElementsByTagName('version')[0].innerHTML;\r
+                               var newVersionURL = div.getElementsByTagName('url')[0].innerHTML;\r
+                               div.innerHTML = "";\r
+                               if (version != newVersion) {\r
+                                       document.getElementById("updateDiv").innerHTML = getLocalizedText("update.download").replace(/%1/, newVersion).replace(/%2/, newVersionURL);\r
+                               }\r
+                               else {\r
+                                       document.getElementById("updateDiv").innerHTML = getLocalizedText("update.nonewversion");\r
+                               }\r
+                       }\r
+               }\r
+               else {\r
+                       document.getElementById("updateDiv").innerHTML = getLocalizedText("update.error") + reqV.status + " " + reqV.responseText;\r
+               }\r
+       }\r
+}\r
+\r
+function hideViews()\r
+{\r
+       document.getElementById("homescreenView").style.display = "none";\r
+       document.getElementById("fullscreenView").style.display = "none";\r
+       document.getElementById("aboutView").style.display = "none";\r
+       document.getElementById("settingsView").style.display = "none";\r
+       document.getElementById("updateView").style.display = "none";\r
+}\r
 </script>\r
 \r
 <style type="text/css">\r
@@ -1057,10 +1044,11 @@ hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; borde
 .settingsInfo { display:none; font-style:italic; }\r
 .title { font-weight:bold; font-size:14pt; }\r
 .textInput { width:90%; }\r
+.credits { margin-left:40px; text-indent: -20px; margin-bottom:0px; }\r
 #homescreenView { width: 315px; height:91px; overflow:hidden; }\r
 #calendarList { position:absolute; left:10px; top:4px; width:295px; height:75px; overflow:hidden; }\r
 #name { text-align:center; }\r
-#appicon { display: block; margin-left: auto; margin-right: auto; margin-top: 50px; }\r
+#appicon { display: block; margin-left: auto; margin-right: auto; margin-top: 10px; }\r
 #smallappicon { width:22px; height:22px; margin-right:10px; float:left; }\r
 </style>\r
 \r
@@ -1087,9 +1075,22 @@ hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; borde
        <h1 id="name">Coming Next</h1>\r
        <hr />\r
        <p>Created by Dr. Cochambre and Michael Prager.</p>\r
+       <p>Contributions:</p>\r
+               <p class="credits">Paul Moore (bug fixes, new features and code cleanup)</p>\r
+               <p class="credits">Manfred Hanselmann (DST support)</p>\r
+               <p class="credits">Christophe Milsent (translation support & french translation</p>\r
+               <p class="credits">Flavio Nathan (portuguese-brazilian translation</p>\r
        <p>This software is open source and licensed under the GPLv3.</p>\r
-       <p>Visit https://sourceforge.net/projects/comingnext/ for free updates.</p>\r
+       <p>Visit sourceforge.net/projects/comingnext for free updates.</p>\r
+       <hr />\r
+</div>\r
+<div id="updateView" style="display:none">\r
+       <img src="Icon.png" id="smallappicon">\r
+       <h1 class="title">Check for update</h1>\r
        <hr />\r
+       <div id="currentVersion">Coming Next ??</div>\r
+       <div id="updateDiv"></div>\r
+       <div id="tmp" style="display:none;"></div>\r
 </div>\r
 </body>\r
 \r