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

Unified Diff: html/static/js/IESettings.js

Issue 5427527162003456: Issue 1086 - Add acceptable ads checkbox to the settings page (Closed)
Patch Set: Created July 21, 2014, 11:42 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | html/templates/index.html » ('j') | html/templates/index.html » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: html/static/js/IESettings.js
===================================================================
--- a/html/static/js/IESettings.js
+++ b/html/static/js/IESettings.js
@@ -25,6 +25,20 @@
}
}
+function setCheckboxCheck(id, val)
+{
+ var el = document.getElementById(id);
+ if (el)
+ {
+ el.checked = val;
+ }
+}
+
+function acceptableAdsChange(cb)
+{
+ UserSettings().SetAcceptableAdsEnabled(cb.checked);
+}
+
function initLanguageSettings()
{
setElementText("title", "settings-title");
@@ -40,7 +54,11 @@
setElementText("removeDomains", "settings-exceptions-remove-label");
setElementText("localeWorthSharing", "settings-share-label");
+
+ setElementText("acceptableAdsLabel", "settings-acceptable-ads");
+ setCheckboxCheck("acceptableAdsCheckbox", UserSettings().IsAcceptableAdsEnabled());
+
var optionsLanguage = document.getElementById("language");
var languageCount = UserSettings().GetLanguageCount();
« no previous file with comments | « no previous file | html/templates/index.html » ('j') | html/templates/index.html » ('J')

Powered by Google App Engine
This is Rietveld