From 9b673b85f97519ae5cab5d7832cf2bd8c7823b0a Mon Sep 17 00:00:00 2001 From: Juriy Zaytsev Date: Sat, 13 Mar 2010 18:41:31 -0500 Subject: [PATCH] Make it possible to quickly select "all", "none" or "safe" options. --- index.html | 6 ++++++ master.css | 4 ++++ master.js | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/index.html b/index.html index b3988c4..3f91cdd 100644 --- a/index.html +++ b/index.html @@ -125,6 +125,12 @@ +
+ Select: + All, + None, + Safe +

diff --git a/master.css b/master.css index b8705c1..00ba40e 100644 --- a/master.css +++ b/master.css @@ -25,5 +25,9 @@ button { font-weight: bold; width: 100px; } .quiet { font-size: 0.85em; color: #888; } .short { display: inline-block; width: 20em; margin-top: 0.25em; } +.controls span { margin-right: 0.5em; margin-left: 1em; } +.controls a { margin-left: 0.1em; } +.controls a:focus, .controls a:hover { text-decoration: none; } + .deprecated-element, .deprecated-attribute { color: red; } .presentational-element, .presentational-attribute, .inaccessible-attribute { color: #FF8C00; } \ No newline at end of file diff --git a/master.js b/master.js index 322deb2..b1f657a 100644 --- a/master.js +++ b/master.js @@ -60,6 +60,29 @@ } }; + function setCheckedAttrOnCheckboxes(attrValue) { + var checkboxes = byId('options').getElementsByTagName('input'); + for (var i = checkboxes.length; i--; ) { + checkboxes[i].checked = attrValue; + } + } + + byId('select-all').onclick = function() { + setCheckedAttrOnCheckboxes(true); + return false; + }; + + byId('select-none').onclick = function() { + setCheckedAttrOnCheckboxes(false); + return false; + }; + + byId('select-safe').onclick = function() { + setCheckedAttrOnCheckboxes(true); + byId('options').getElementsByTagName('input')[10].checked = false; + return false; + }; + })(); var _gaq = _gaq || []; -- 2.34.1