]> code.delx.au - comingnext/commitdiff
added "font size" option to easily customize text size.
authorMichael Prager <mail@michaelprager.de>
Sat, 19 May 2012 17:25:01 +0000 (19:25 +0200)
committerMichael Prager <mail@michaelprager.de>
Sat, 19 May 2012 17:25:01 +0000 (19:25 +0200)
13 files changed:
Readme.txt
comingNext/ca.lproj/localizedTextStrings.js
comingNext/cs.lproj/localizedTextStrings.js
comingNext/de.lproj/localizedTextStrings.js
comingNext/es.lproj/localizedTextStrings.js
comingNext/fi.lproj/localizedTextStrings.js
comingNext/fr.lproj/localizedTextStrings.js
comingNext/index.html
comingNext/it.lproj/localizedTextStrings.js
comingNext/localizedTextStrings.js
comingNext/pl.lproj/localizedTextStrings.js
comingNext/pt-BR.lproj/localizedTextStrings.js
comingNext/ru.lproj/localizedTextStrings.js

index 696ba1f2266f720db119a7d8254e9f130c2c8de1..7c8fdc9e8260d3f22b9e6ba55279586f87e35e0d 100644 (file)
@@ -301,3 +301,4 @@ Changelog:
   - fixed display problems on E6 (bug no. 3509394)\r
   - fixed help button on settings page require double tap (bug no. 3302891)\r
   - added "show icons" option to enable users to hide icons if desired (bug no. 3521427)\r
+  - added "font size" option to easily customize text size\r
index 22a6226cffda95a6819592be22fbeb006d68f055..220bcc9ab4214467e639d8a22629df8fcdb2e26c 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Ajuda';
 localizedText['settings.save'] = 'Desa';\r
 localizedText['settings.cancel'] = 'Cancel.lar';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Interval Mensual';\r
index 59cdfb39cef64746ab0503ae808439591996e493..a7f804c58c6ce4ebf545e7bbff4313620f659276 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Pomoc';
 localizedText['settings.save'] = 'Uložit';\r
 localizedText['settings.cancel'] = 'Zrušit';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Měsíců';\r
index e6980c550d3ebb8a6e0379f4514f7ce7b5942066..1a8cf3c65bbbce07bb1b203f7a9e1482ecfab94d 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Hilfe';
 localizedText['settings.save'] = 'Speichern';\r
 localizedText['settings.cancel'] = 'Abbruch';\r
 \r
+localizedText['settings.name.fontsize'] = 'Schriftgröße';\r
+localizedText['settings.info.fontsize'] = 'ändern, falls die Schrift zu groß oder klein ist. "Automatisch" passt die Schriftgröße automatisch der Anzahl der anzuzeigenden Ereignisse an.';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatisch';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Monatsspanne';\r
index fa63c8def0c266650543983e82a7ffef8fc93df0..d5b7547b6ffe45bf6992ce420241c696a1a8c62e 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Ayuda';
 localizedText['settings.save'] = 'Guardar';\r
 localizedText['settings.cancel'] = 'Cancelar';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Rango del Mes';\r
index 40d8aace70c8e6bb9fc57957def8a4693a4eb3c8..c02eaf447a7b0bbe76f06d6b93d88a4e984f4b8c 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Ohje';
 localizedText['settings.save'] = 'Tallenna';\r
 localizedText['settings.cancel'] = 'Peruuta';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Näytetyt kuukaudet';\r
index 82025a5fbfcd750796a48d7b5e6d5715a4c39015..a0f0767f6781814ab9efdb001cc097060df4027e 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Aide';
 localizedText['settings.save'] = 'Sauver';\r
 localizedText['settings.cancel'] = 'Annuler';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Nombre de mois';\r
index e5b472c5e591e8b5df92c0fb08e581438bce64fa..ccb19f6831f7d1a125f13fd6f62c322e3f9aa582 100644 (file)
@@ -31,6 +31,7 @@
 <script type="text/javascript">\r
 // valid types for the config object are 'Int', 'Bool', 'String', 'Enum', 'UID', 'Array'\r
 var config = {\r
+       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'],},\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
@@ -109,6 +110,7 @@ var entryLists = null; // stores all fetched calendar entries until data is refr
 var statupSuccessful = false; // indicates if everything started up wihtout errors. If we detect an error after that, it might just be a temporary problem e.g. by a backup process.\r
 var use12hoursTimeFormat = false; // defines how time should be formated: 19:00 or 07:00 pm\r
 var timeFormatSeparator = ":"; // format time 19:00 or 19.00 depending on system setting\r
+var defaultFontSize = null; // default browser font size will be set by init\r
 \r
 // vars for daylight saving time\r
 var summertime = false; // true, if current date is in summer, false if in winter\r
@@ -734,24 +736,19 @@ function updateData()
                var counter = 0;\r
                var entryDate = '';\r
                var dateArr = [];\r
-               var fontsize = 'normal';\r
-               var lineheight = 'normal';\r
+               var fontsize = getDefaultFontSize()[1] + 'px';\r
+               var lineheight = fontsize;\r
                if (mode == 0) {\r
-                       fontsize = parseInt(72 / config['eventsPerWidget'].Value) + 'px';\r
-                       lineheight = parseInt(82 / config['eventsPerWidget'].Value) + 'px';\r
-                       \r
-                       if (config['eventsPerWidget'].Value == 3) {\r
-                               changeCssClass('.icon', 'width:20px; height:20px');\r
-                       }\r
-                       else if (config['eventsPerWidget'].Value == 5) {\r
-                               changeCssClass('.icon', 'width:10px; height:10px');\r
-                       }\r
-                       else if (config['eventsPerWidget'].Value == 6) {\r
-                               changeCssClass('.icon', 'width:8px; height:8px');\r
+                       if (config['fontsize'].Value == config['fontsize'].ValidValues[0]) {\r
+                               fontsize = parseInt(72 / config['eventsPerWidget'].Value) + 'px';\r
+                               lineheight = parseInt(82 / config['eventsPerWidget'].Value) + 'px';\r
                        }\r
                }\r
-               else\r
-                       changeCssClass('.icon', config['cssStyle_icon'].Value);\r
+               if (config['fontsize'].Value != config['fontsize'].ValidValues[0]) {\r
+                       fontsize = config['fontsize'].Value + 'px';\r
+                       lineheight = fontsize;\r
+               }\r
+               changeCssClass('.icon', config['cssStyle_icon'].Value + '; width:' + lineheight + '; height:' + lineheight + ';');\r
                var entriesHtml = '<table style="font-size:' + fontsize + '; line-height:' + lineheight + ';">';\r
                if (mode == 0)\r
                        entriesHtml = '<table width="307" height="82"><tr><td>' + entriesHtml; // this is needed to center the actual content vertically\r
@@ -1174,8 +1171,12 @@ function showSettings()
                        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>' + 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 value="' + config[key].ValidValues[i] + '"' + (config[key].Value == config[key].ValidValues[i] ? ' selected="selected"' : '') + '>' + getLocalizedText('settings.validValues.' + key + '.' + config[key].ValidValues[i]) + '</option>';\r
+                       for(var i = 0; i < config[key].ValidValues.length; i++) {\r
+                               var text = getLocalizedText('settings.validValues.' + key + '.' + config[key].ValidValues[i]);\r
+                               if (text.indexOf('ERROR') == 0)\r
+                                       text = config[key].ValidValues[i];\r
+                               settingsHtml += '<option value="' + config[key].ValidValues[i] + '"' + (config[key].Value == config[key].ValidValues[i] ? ' selected="selected"' : '') + '>' + text + '</option>';\r
+                       }\r
                        settingsHtml += '</select></div></td>' + printHintBox(getLocalizedText('settings.info.' + key)) + '<hr />';\r
                }\r
                else if (config[key].Type == 'Array') {\r
@@ -1736,6 +1737,21 @@ function log(message)
        }\r
 }\r
 \r
+function getDefaultFontSize()\r
+{\r
+       if (defaultFontSize == null) {\r
+               var pa = document.body;\r
+               var who = document.createElement('div');\r
+               who.className = 'defaultEm';\r
+               who.appendChild(document.createTextNode('M'));\r
+               pa.appendChild(who);\r
+               var fs = [who.offsetWidth, who.offsetHeight];\r
+               pa.removeChild(who);\r
+               defaultFontSize = fs;\r
+       }\r
+       return defaultFontSize;\r
+}\r
+\r
 </script>\r
 \r
 <style type="text/css">\r
@@ -1752,6 +1768,7 @@ hr { color:#ffffff; background-color:#ffffff; height:1px; text-align:left; borde
 #name { text-align:center; }\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
+.defaultEm { font-size:1em; position:absolute; line-height:1; padding:0; visibility:hidden; } \r
 </style>\r
 \r
 </head>\r
index d8b99089035a28c7cc6b070a565c6a16fc1fe57c..6e0d8cbd17cde8812d35b4727366ca24368c44dd 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Aiuto';
 localizedText['settings.save'] = 'Salva';\r
 localizedText['settings.cancel'] = 'Annulla';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Numero Mesi';\r
index bce7f37b9e8f27f7dc518ffba339e522610d7f9f..4175290383d97dc1bcc30ace7b854e9f6c71d182 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Help';
 localizedText['settings.save'] = 'Save';\r
 localizedText['settings.cancel'] = 'Cancel';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Month Range';\r
index 66ea0dd288a5b79a389e1b0ed492044724d1fe35..eb9d0dc8d4bb940795967ababc1327fd83cbe186 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Pomoc';
 localizedText['settings.save'] = 'Zapisz';\r
 localizedText['settings.cancel'] = 'Anuluj';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Zakres miesięcy';\r
index 8120ea534e805da82f929068a914f451f3046b87..43c3953a056db7c101bafadcc96afa44c7ef84f0 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'ajuda';
 localizedText['settings.save'] = 'Salva';\r
 localizedText['settings.cancel'] = 'Cancela';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Faixa do Mês';\r
index ac8f92de41164a0581d9a2f020d3dbd77da96af9..2bd9ade9d971df1993776a3242fe68bc1b37fa97 100644 (file)
@@ -13,6 +13,9 @@ localizedText['settings.help'] = 'Помощь';
 localizedText['settings.save'] = 'Сохранить';\r
 localizedText['settings.cancel'] = 'Отмена';\r
 \r
+localizedText['settings.name.fontsize'] = 'Font Size';\r
+localizedText['settings.info.fontsize'] = 'change this if text is too small or large for you. "Automatic" will adjust text size according to number of events to display';\r
+localizedText['settings.validValues.fontsize.auto'] = 'Automatic';\r
 localizedText['settings.name.showIcons'] = 'Show Icons';\r
 localizedText['settings.info.showIcons'] = 'disable this to hide event type icons';\r
 localizedText['settings.name.monthRange'] = 'Количество месяцев';\r