X-Git-Url: https://code.delx.au/comingnext/blobdiff_plain/ce7aa7df767789faa22bf9a3e2183608da11ab64..c6d28755aa280795cfa8a12285f929d40e475e1c:/comingNext/index.html diff --git a/comingNext/index.html b/comingNext/index.html index 3016c5d..abc25fd 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -60,6 +60,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: '',}, @@ -741,14 +742,14 @@ function updateData() if (mode == 0) { if (config['fontsize'].Value == config['fontsize'].ValidValues[0]) { fontsize = parseInt(72 / config['eventsPerWidget'].Value) + 'px'; - lineheight = parseInt(82 / config['eventsPerWidget'].Value) + 'px'; + lineheight = parseInt(72 / config['eventsPerWidget'].Value) + 'px'; } } if (config['fontsize'].Value != config['fontsize'].ValidValues[0]) { fontsize = config['fontsize'].Value + 'px'; lineheight = fontsize; } - changeCssClass('.icon', config['cssStyle_icon'].Value + '; width:' + lineheight + '; height:' + lineheight + ';'); + changeCssClass('.icon', config['cssStyle_icon'].Value + '; width:' + fontsize + '; height:' + fontsize + ';'); var entriesHtml = ''; if (mode == 0) entriesHtml = '
'; if (config['showCalendarIndicator'].Value && calendarList.length - config['excludedCalendars'].Value.length > 1) { - entriesHtml += ''; + entriesHtml += ''; } if (config['showIcons'].Value) entriesHtml += ''; @@ -1618,6 +1619,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,12 +1759,23 @@ 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(); +} +
' + entriesHtml; // this is needed to center the actual content vertically @@ -893,7 +894,7 @@ function updateData() // generate html output entriesHtml += '