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: Moved from onchange in html to addListener in JS Created July 22, 2014, 2:22 p.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') | no next file with comments »
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
@@ -8,7 +8,7 @@
}
catch (err)
{
- //alert("err: " + err);
+// alert("err: " + err);
Felix Dahlke 2014/07/22 14:28:10 That change seems unrelated :D
}
}
@@ -25,6 +25,12 @@
}
}
+function acceptableAdsChange()
+{
+ var aaCheckbox = document.getElementById("acceptableAdsCheckbox");
+ UserSettings().SetAcceptableAdsEnabled(aaCheckbox.checked);
+}
+
function initLanguageSettings()
{
setElementText("title", "settings-title");
@@ -40,7 +46,16 @@
setElementText("removeDomains", "settings-exceptions-remove-label");
setElementText("localeWorthSharing", "settings-share-label");
+
+ setElementText("acceptableAdsLabel", "settings-acceptable-ads");
+ var aaCheckbox = document.getElementById("acceptableAdsCheckbox");
+ if (aaCheckbox)
+ {
+ aaCheckbox.checked = UserSettings().IsAcceptableAdsEnabled();
+ addListener(aaCheckbox, "change", acceptableAdsChange, false);
+ }
+
var optionsLanguage = document.getElementById("language");
var languageCount = UserSettings().GetLanguageCount();
@@ -147,4 +162,4 @@
window.UserSettings = function()
{
return window.Settings;
-}
+}
Felix Dahlke 2014/07/22 14:28:10 Was this a missing EOF? If so let's keep it.
« no previous file with comments | « no previous file | html/templates/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld