X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/32b1c2f4a166147927720ce7f92e1f9011693b1a..75550f5f7cfdc18ccda9dc69c8d510f6c077e86f:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index 1afd1a0..e8a4840 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -49,6 +49,7 @@ var config = { enableDaylightSaving: { Type: 'Bool', Default: true, Value: true,}, daylightSavingOffset: { Type: 'Int', Default: 1, Value: 1,}, hideWidgetOnCalendarOpen: { Type: 'Bool', Default: false, Value: false,}, + showCalendarIndicator: { Type: 'Bool', Default: true, Value: true,}, cssStyle_background: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',}, cssStyle_backgroundFullscreen: { Type: 'String', Default: 'color:#ffffff; background-color:#000000', Value: 'color:#ffffff; background-color:#000000',}, cssStyle_weekDay: { Type: 'String', Default: '', Value: '',}, @@ -60,6 +61,12 @@ var config = { cssStyle_description: { Type: 'String', Default: '', Value: '',}, cssStyle_icon: { Type: 'String', Default: 'width:15px; height:15px', Value: 'width:15px; height:15px',}, cssStyle_overdue: { Type: 'String', Default: 'color:#ffff00', Value: 'color:#ffff00',}, + cssStyle_calendar1: { Type: 'String', Default: 'background-color:#800000', Value: 'background-color:#800000',}, + cssStyle_calendar2: { Type: 'String', Default: 'background-color:#ff0000', Value: 'background-color:#ff0000',}, + cssStyle_calendar3: { Type: 'String', Default: 'background-color:#808000', Value: 'background-color:#808000',}, + cssStyle_calendar4: { Type: 'String', Default: 'background-color:#ffff00', Value: 'background-color:#ffff00',}, + cssStyle_calendar5: { Type: 'String', Default: 'background-color:#008000', Value: 'background-color:#008000',}, + cssStyle_calendar6: { Type: 'String', Default: 'background-color:#008080', Value: 'background-color:#008080',}, } @@ -81,6 +88,7 @@ var settingsCalEntryId = null; var settingsCache = null; var notificationRequests = new Array(); var calendarList = []; +var calendarColors = []; // vars for daylight saving time var summertime = false; // true, if current date is in summer, false if in winter @@ -90,6 +98,7 @@ var daylightSavingDates = new Object(); // caches calculated DST winter and summ var entryFields = [ "id", "Type", + "CalendarName", "Summary", "Location", "Status", @@ -331,9 +340,9 @@ function cancelNotification() try { var result = calendarService.IDataSource.Cancel(notificationRequests[i]); if (result.ErrorCode) - error('requestNotification failed with error code ' + result.ErrorCode); + error('cancelNotification failed with error code ' + result.ErrorCode); } catch (e) { - error("requestNotification: " + e + ', line ' + e.line); + error("cancelNotification: " + e + ', line ' + e.line); } } } @@ -501,6 +510,7 @@ function updateData() var newCalendarList = listCalendars(); if (newCalendarList.length != calendarList.length) { calendarList = newCalendarList; + updateCalendarColors(); cancelNotification(); requestNotification(); } @@ -710,7 +720,11 @@ function updateData() } // generate html output - entriesHtml += ''; + entriesHtml += ''; + if (config['showCalendarIndicator'].Value && calendarList.length > 1) { + entriesHtml += ' '; + } + entriesHtml += ''; if(date == null) { // some languages have very strange locale date formats, can't parse all those. Also some todos don't have dates at all. entriesHtml += '' + entryDate + ' '; @@ -813,6 +827,7 @@ function init() calendarList = listCalendars(); loadSettings(); + updateCalendarColors(); collectLocales(); //updateData(); requestNotification(); @@ -1359,6 +1374,17 @@ function sortCalendarEntries(a, b) return 0; } +function updateCalendarColors() +{ + calendarColors = []; + if (calendarList.length > 6) { + console.info("updateCalendarColors(): Warning: more calendars than available indicator colors"); + } + for(var i=0; i < calendarList.length; i++) { + calendarColors[calendarList[i]] = (i % 6) + 1; + } +} +