X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/a4b0671b585a25871fac3f23b69b2fbe1ad3b7fa..59b781af1f1c364dcf85c0ca1032998945b9433e:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index 5f84537..812ae7f 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -34,6 +34,7 @@ var config = { fontsize: { Type: 'Enum', Default: 'auto', Value: 'auto', ValidValues: ['auto', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'],}, eventsPerWidget: { Type: 'Int', Default: 4, Value: 4,}, monthRange: { Type: 'Int', Default: 2, Value: 2,}, + maxNumberOfEventsOnFullscreen: { Type: 'Int', Default: 30, Value: 30,}, includeTodos: { Type: 'Bool', Default: true, Value: true,}, useBackgroundImage: { Type: 'Bool', Default: true, Value: true,}, backgroundImageLocation: { Type: 'Enum', Default: 'internal', Value: 'internal', ValidValues: ['internal', 'external']}, @@ -60,6 +61,7 @@ var config = { showCalendarIndicator: { Type: 'Bool', Default: true, Value: true,}, excludedCalendars: { Type: 'Array', Default: [], Value: [],}, enableLogging: { Type: 'Bool', Default: false, Value: false,}, + anonymizeLogging: { Type: 'Bool', Default: false, Value: false,}, 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: '',}, @@ -111,6 +113,7 @@ var statupSuccessful = false; // indicates if everything started up wihtout erro var use12hoursTimeFormat = false; // defines how time should be formated: 19:00 or 07:00 pm var timeFormatSeparator = ":"; // format time 19:00 or 19.00 depending on system setting var defaultFontSize = null; // default browser font size will be set by init +var displayOffset = 0; // vars for daylight saving time var summertime = false; // true, if current date is in summer, false if in winter @@ -529,6 +532,9 @@ function parseDate(dateString) log('parseDate(): fixing time +1h: ' + result); } } + if (displayOffset != 0) { + result = new Date(result.getTime() + displayOffset); + } return result; } @@ -757,7 +763,7 @@ function updateData() if (mode == 0) max = (panelNum + 1) * config['eventsPerWidget'].Value; else - max = 30; // we can display a lot more events in fullscreen mode + max = config["maxNumberOfEventsOnFullscreen"].Value; // we can display a lot more events in fullscreen mode if (config['enableLogging'].Value) { var listinfo = ""; @@ -1041,6 +1047,7 @@ function init() else { mode = 1; } + checkForOffByOneBug(); log("init(): updateScreen()"); updateScreen(); if (config['useBackgroundImage'].Value) @@ -1055,6 +1062,17 @@ function init() statupSuccessful = true; } +function checkForOffByOneBug() { + var tz = new Date().getTimezoneOffset(); + if (tz < 0) { + tz = -tz; + } + tz = tz / 60; + if (tz > 12) { + displayOffset = 24*3600*1000; + } +} + function checkOrientation() { //updateScreen(); @@ -1618,6 +1636,12 @@ function listToArray(list, calendarName) if (!itemCopy['CalendarName']) { itemCopy['CalendarName'] = calendarName; } + if (config['anonymizeLogging'].Value && config['enableLogging'].Value) { + if (itemCopy['Summary']) + itemCopy['Summary'] = getHashForString(itemCopy['Summary']); + if (itemCopy['Location']) + itemCopy['Location'] = getHashForString(itemCopy['Location']); + } array.push(itemCopy); txt += array[array.length - 1].Summary + ", "; } @@ -1752,6 +1776,17 @@ function getDefaultFontSize() return defaultFontSize; } +function getHashForString(string) +{ + // cheap hashing, loosly based on Java's String.hashCode() + for (var hash = 0, i = 0; i < string.length; i++) + hash = (hash << 5) - hash + string.charCodeAt(i); + hash = hash & hash; // Convert to 32bit integer + if (hash < 0) + hash = -hash; + return hash.toString(16).toUpperCase(); +} +