From: Michael Prager Date: Sat, 2 Jun 2012 13:23:43 +0000 (+0200) Subject: added option to anonymize debug logfiles X-Git-Url: https://code.delx.au/comingnext/commitdiff_plain/c6d28755aa280795cfa8a12285f929d40e475e1c added option to anonymize debug logfiles --- diff --git a/Readme.txt b/Readme.txt index 7c8fdc9..da867bf 100644 --- a/Readme.txt +++ b/Readme.txt @@ -302,3 +302,4 @@ Changelog: - fixed help button on settings page require double tap (bug no. 3302891) - added "show icons" option to enable users to hide icons if desired (bug no. 3521427) - added "font size" option to easily customize text size + - added option to anonymize debug logfiles diff --git a/comingNext/ca.lproj/localizedTextStrings.js b/comingNext/ca.lproj/localizedTextStrings.js index 220bcc9..e452601 100644 --- a/comingNext/ca.lproj/localizedTextStrings.js +++ b/comingNext/ca.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Calendaris inclosos'; localizedText['settings.info.excludedCalendars'] = 'aquí es poden especificar quins calendaris s\'han de mostrar si es fa servir més d\'ún'; localizedText['settings.name.enableLogging'] = 'Habilitar Registre'; localizedText['settings.info.enableLogging'] = 'escriure informació de depuració a C:\\Data\\jslog_widget.log. Nota: Registre d\'errors de Javascript a fitxer ha d\'estar habilitat a la configuració del navegador.'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymize Logging'; +localizedText['settings.info.anonymizeLogging'] = 'enable this to anonymize the display and logging of event summaries and locations. This allows users to create anonymized logs.'; localizedText['settings.name.cssStyle_background'] = '.background'; localizedText['settings.info.cssStyle_background'] = 'Defineix el fons del widget. Si voleu fer servir imatge, establiu useBackgroundImage = true. Per negre, gris i blau els codis són #292029, #e7dfe7, #009aef'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.backgroundFullscreen'; diff --git a/comingNext/cs.lproj/localizedTextStrings.js b/comingNext/cs.lproj/localizedTextStrings.js index a7f804c..5793302 100644 --- a/comingNext/cs.lproj/localizedTextStrings.js +++ b/comingNext/cs.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Zahrnuté kalendáře'; localizedText['settings.info.excludedCalendars'] = 'Zde můžete určit, které kalendáře se zobrazí v případě více definování více kalendářů'; localizedText['settings.name.enableLogging'] = 'Povolit protokolování'; localizedText['settings.info.enableLogging'] = 'zápis ladění informací na C:\\Data\\jslog_widget.log. Poznámka: Javascript chyba záznamu do souboru musí být aktivována v nastavení prohlížeče'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymize Logging'; +localizedText['settings.info.anonymizeLogging'] = 'enable this to anonymize the display and logging of event summaries and locations. This allows users to create anonymized logs.'; localizedText['settings.name.cssStyle_background'] = '. na pozadí'; localizedText['settings.info.cssStyle_background'] = 'Definuje na pozadí widgetu. Chcete-li nastavit obrázek na pozadí, nastavit useBackgroundImage = true below. Pro výchozí téma, černá, Å¡edá a světle modrá, kódy # 292029, # e7dfe7, # 009aef'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.pozadí Fullscreen'; diff --git a/comingNext/de.lproj/localizedTextStrings.js b/comingNext/de.lproj/localizedTextStrings.js index 1a8cf3c..3289e27 100644 --- a/comingNext/de.lproj/localizedTextStrings.js +++ b/comingNext/de.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Anzuzeigende Kalender'; localizedText['settings.info.excludedCalendars'] = 'falls du mehrere Kalender angelegt hast, kannst du hier festlegen, welche Kalender angezeigt werden sollen'; localizedText['settings.name.enableLogging'] = 'Enable Logging'; localizedText['settings.info.enableLogging'] = 'write debug information to C:\\Data\\jslog_widget.log. Note: Javascript error logging to file needs to be enabled in your browser settings for this.'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymisiertes Logging'; +localizedText['settings.info.anonymizeLogging'] = 'diese Option einschalten, um die Anzeige und das Loggen von Ereignissen zu anonymisieren. Dies ermöglicht es Benutzern, anonymisierte Logdateien zu erstellen.'; localizedText['settings.name.cssStyle_background'] = '.background'; localizedText['settings.info.cssStyle_background'] = 'Definiert den Hintergrund des Widgets. Falls Sie ein Hintergrundbild verwenden möchten, aktivieren Sie die Einstellung "Benutze Hintergrundbild". Für die Standardthemes des N97 ("schwarz", "grau" und "helles Blau") lauten die Farbcodes #292029, #e7dfe7 und #009aef.'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.backgroundFullscreen'; diff --git a/comingNext/es.lproj/localizedTextStrings.js b/comingNext/es.lproj/localizedTextStrings.js index d5b7547..62b4434 100644 --- a/comingNext/es.lproj/localizedTextStrings.js +++ b/comingNext/es.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Calendarios incluidos'; localizedText['settings.info.excludedCalendars'] = 'Aquí se puede especificar qué calendarios se mostrarán si se han definido varios calendarios'; localizedText['settings.name.enableLogging'] = 'Enable Logging'; localizedText['settings.info.enableLogging'] = 'write debug information to C:\\Data\\jslog_widget.log. Note: Javascript error logging to file needs to be enabled in your browser settings for this.'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymize Logging'; +localizedText['settings.info.anonymizeLogging'] = 'enable this to anonymize the display and logging of event summaries and locations. This allows users to create anonymized logs.'; localizedText['settings.name.cssStyle_background'] = '.background'; localizedText['settings.info.cssStyle_background'] = 'Define el fondo de aplicación del widget. Para usar una imagen de fondo personalizada, ponga useBackgroundImage = true debajo. Para el temo por defecto, negro, gris, y azul claro, los códigos son #292029, #e7dfe7, #009aef'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.backgroundFullscreen'; diff --git a/comingNext/fi.lproj/localizedTextStrings.js b/comingNext/fi.lproj/localizedTextStrings.js index c02eaf4..ee72c21 100644 --- a/comingNext/fi.lproj/localizedTextStrings.js +++ b/comingNext/fi.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Näytettävät kalenterit'; localizedText['settings.info.excludedCalendars'] = 'Tästä voit valita, mitkä kalentereistasi haluat näkyvät widgetissä'; localizedText['settings.name.enableLogging'] = 'Käytä lokia'; localizedText['settings.info.enableLogging'] = 'Kirjoittaa ohjelman suorituksessa tapahtuneet virheet kansioon C:\\Data\\jslog_widget.log. Huomioi: Javascript virheiden kirjoitus lokiin täytyy olla päällä selaimestasi, jotta voit käyttää tätä.'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymize Logging'; +localizedText['settings.info.anonymizeLogging'] = 'enable this to anonymize the display and logging of event summaries and locations. This allows users to create anonymized logs.'; localizedText['settings.name.cssStyle_background'] = '.background'; localizedText['settings.info.cssStyle_background'] = 'Määrittää widgetin taustan. Jos haluat käyttää taustakuvaa, aseta useBackgroundImage = true below. Oletusteemojen värikoodit, mustalle, harmaalle, and vaaleansiniselle, ovat #292029, #e7dfe7, #009aef'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.backgroundFullscreen'; diff --git a/comingNext/fr.lproj/localizedTextStrings.js b/comingNext/fr.lproj/localizedTextStrings.js index a0f0767..dd1910d 100644 --- a/comingNext/fr.lproj/localizedTextStrings.js +++ b/comingNext/fr.lproj/localizedTextStrings.js @@ -83,6 +83,8 @@ localizedText['settings.name.excludedCalendars'] = 'Included Calendars'; localizedText['settings.info.excludedCalendars'] = 'here you can specify which calendars should be displayed if multiple calendars have been defined'; localizedText['settings.name.enableLogging'] = 'Enable Logging'; localizedText['settings.info.enableLogging'] = 'write debug information to C:\\Data\\jslog_widget.log. Note: Javascript error logging to file needs to be enabled in your browser settings for this.'; +localizedText['settings.name.anonymizeLogging'] = 'Anonymize Logging'; +localizedText['settings.info.anonymizeLogging'] = 'enable this to anonymize the display and logging of event summaries and locations. This allows users to create anonymized logs.'; localizedText['settings.name.cssStyle_background'] = '.background'; localizedText['settings.info.cssStyle_background'] = 'Definit le style CSS du fond du widget. Si vous voulez mettre une image de fond, cocher "Utiliser Background Image". Pour le thème par défaut, noir, gris, and bleu, les codes sont #292029, #e7dfe7, #009aef'; localizedText['settings.name.cssStyle_backgroundFullscreen'] = '.backgroundFullscreen'; diff --git a/comingNext/index.html b/comingNext/index.html index 5f84537..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: '',}, @@ -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,6 +1759,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(); +} +