Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: html/static/js/IESettings.js

Issue 9998007: Initial libadblockplus integration (Closed)
Patch Set: More integration, reflecting latest libadblockplus changes Created April 9, 2013, 5:48 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Shared/PluginUserSettings.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Shared/PluginUserSettings.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld