OLD | NEW |
1 function init() | 1 function init() |
2 { | 2 { |
3 try | 3 try |
4 { | 4 { |
5 initLanguageSettings(); | 5 initLanguageSettings(); |
6 | 6 |
7 initDomainSettings(); | 7 initDomainSettings(); |
8 } | 8 } |
9 catch (err) | 9 catch (err) |
10 { | 10 { |
(...skipping 17 matching lines...) Expand all Loading... |
28 function initLanguageSettings() | 28 function initLanguageSettings() |
29 { | 29 { |
30 setElementText("title", "settings-heading"); | 30 setElementText("title", "settings-heading"); |
31 | 31 |
32 setElementText("localeLanguageLabel", "settings-language-label"); | 32 setElementText("localeLanguageLabel", "settings-language-label"); |
33 setElementText("localeLanguageDescription", "settings-language-description"); | 33 setElementText("localeLanguageDescription", "settings-language-description"); |
34 | 34 |
35 setElementText("localeBlockingLabel", "settings-blocking-label"); | 35 setElementText("localeBlockingLabel", "settings-blocking-label"); |
36 setElementText("localeBlockingDescription", "settings-blocking-description"); | 36 setElementText("localeBlockingDescription", "settings-blocking-description"); |
37 | 37 |
38 setElementText("localeLanguageLabel", "settings-language-label"); | |
39 setElementText("manageExceptions", "settings-exceptions-manage-label"); | 38 setElementText("manageExceptions", "settings-exceptions-manage-label"); |
40 setElementText("addDomain", "settings-exceptions-add-label"); | 39 setElementText("addDomain", "settings-exceptions-add-label"); |
41 setElementText("removeDomains", "settings-exceptions-remove-label"); | 40 setElementText("removeDomains", "settings-exceptions-remove-label"); |
42 | 41 |
43 var optionsLanguage = document.getElementById("language"); | 42 var optionsLanguage = document.getElementById("language"); |
| 43 |
| 44 var languageCount = UserSettings().GetLanguageCount(); |
| 45 for(var i = 0; i < languageCount; i++) |
| 46 { |
| 47 var el = document.createElement("option"); |
| 48 el.text = UserSettings().GetLanguageTitleByIndex(i); |
| 49 el.value = UserSettings().GetLanguageByIndex(i); |
| 50 |
| 51 optionsLanguage.add(el, 0); |
| 52 } |
| 53 |
44 addListener(optionsLanguage, "change", function () | 54 addListener(optionsLanguage, "change", function () |
45 { | 55 { |
46 UserSettings().SetLanguage(optionsLanguage[optionsLanguage.selectedIndex].va
lue); | 56 UserSettings().SetLanguage(optionsLanguage[optionsLanguage.selectedIndex].va
lue); |
47 }, false); | 57 }, false); |
48 | 58 |
49 var language = UserSettings().GetLanguage(); | 59 var language = UserSettings().GetLanguage(); |
50 | 60 |
51 var options = optionsLanguage.options; | 61 var options = optionsLanguage.options; |
52 for (var i = 0; i < options.length; i++) | 62 for (var i = 0; i < options.length; i++) |
53 { | 63 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 { | 139 { |
130 optionsDomain.remove(removeOptions[i]); | 140 optionsDomain.remove(removeOptions[i]); |
131 } | 141 } |
132 }, false); | 142 }, false); |
133 } | 143 } |
134 | 144 |
135 window.UserSettings = function() | 145 window.UserSettings = function() |
136 { | 146 { |
137 return window.Settings; | 147 return window.Settings; |
138 } | 148 } |
OLD | NEW |