From b8250966408ac114774c0e7fb75a2cc3c4ab3350 Mon Sep 17 00:00:00 2001 From: MathuraMG Date: Thu, 25 Aug 2016 17:46:30 -0400 Subject: [PATCH 1/4] make preferences radio buttons --- client/modules/IDE/components/Preferences.js | 74 +++++++++++++++----- client/styles/components/_preferences.scss | 4 ++ 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/client/modules/IDE/components/Preferences.js b/client/modules/IDE/components/Preferences.js index a705a098..276bd686 100644 --- a/client/modules/IDE/components/Preferences.js +++ b/client/modules/IDE/components/Preferences.js @@ -150,47 +150,85 @@ class Preferences extends React.Component {

Autosave

- - + name="autosave" + id="autosave-off" + className="preference__radio-button" + value="Off" + checked={!this.props.autosave} + /> +

Lint Warning Sound

- - + name="lint warning" + id="lint-warning-off" + className="preference__radio-button" + value="Off" + checked={!this.props.lintWarning} + /> +

Accessible Text-based Canvas

Used with screen reader
+
- - + name="text output" + id="text-output-off" + className="preference__radio-button" + value="Off" + checked={!this.props.textOutput} + /> + +
diff --git a/client/styles/components/_preferences.scss b/client/styles/components/_preferences.scss index 06ca4b70..92892f3b 100644 --- a/client/styles/components/_preferences.scss +++ b/client/styles/components/_preferences.scss @@ -81,6 +81,10 @@ padding-left: #{28 / $base-font-size}rem; } +.preference__radio-button { + @extend %hidden-element; +} + .preference__option { @extend %preference-option; list-style-type: none; From 1803067aeb5a1b2c31c00e91b9a165be835aa9a9 Mon Sep 17 00:00:00 2001 From: MathuraMG Date: Thu, 25 Aug 2016 17:59:02 -0400 Subject: [PATCH 2/4] change labels --- client/modules/IDE/components/Toolbar.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/modules/IDE/components/Toolbar.js b/client/modules/IDE/components/Toolbar.js index 79226d70..74e78b6a 100644 --- a/client/modules/IDE/components/Toolbar.js +++ b/client/modules/IDE/components/Toolbar.js @@ -51,15 +51,15 @@ class Toolbar extends React.Component { return (
p5js Logo - +
); From fe803d52d0f1c23979cb56f504cbf676216d9928 Mon Sep 17 00:00:00 2001 From: MathuraMG Date: Mon, 29 Aug 2016 14:39:23 -0400 Subject: [PATCH 3/4] remove preference__option--selected --- client/modules/IDE/components/Preferences.js | 69 ++++++++------------ client/styles/abstracts/_placeholders.scss | 3 - client/styles/components/_preferences.scss | 8 ++- 3 files changed, 34 insertions(+), 46 deletions(-) diff --git a/client/modules/IDE/components/Preferences.js b/client/modules/IDE/components/Preferences.js index 276bd686..da8c6251 100644 --- a/client/modules/IDE/components/Preferences.js +++ b/client/modules/IDE/components/Preferences.js @@ -38,38 +38,7 @@ class Preferences extends React.Component { preferences: true, 'preferences--selected': this.props.isVisible }); - let preferencesTabOptionClass = classNames({ - preference__option: true, - 'preference__option--selected': this.props.isTabIndent - }); - let preferencesSpaceOptionClass = classNames({ - preference__option: true, - 'preference__option--selected': !this.props.isTabIndent - }); - let autosaveOnClass = classNames({ - preference__option: true, - 'preference__option--selected': this.props.autosave - }); - let autosaveOffClass = classNames({ - preference__option: true, - 'preference__option--selected': !this.props.autosave - }); - let lintWarningOnClass = classNames({ - preference__option: true, - 'preference__option--selected': this.props.lintWarning - }); - let lintWarningOffClass = classNames({ - preference__option: true, - 'preference__option--selected': !this.props.lintWarning - }); - let textOutputOnClass = classNames({ - preference__option: true, - 'preference__option--selected': this.props.textOutput - }); - let textOutputOffClass = classNames({ - preference__option: true, - 'preference__option--selected': !this.props.textOutput - }); + return (
@@ -143,8 +112,28 @@ class Preferences extends React.Component {
Increase
- - + + + +
@@ -160,7 +149,7 @@ class Preferences extends React.Component { value="On" checked={this.props.autosave} /> - + this.props.setAutosave(false)} @@ -171,7 +160,7 @@ class Preferences extends React.Component { value="Off" checked={!this.props.autosave} /> - +
@@ -187,7 +176,7 @@ class Preferences extends React.Component { value="On" checked={this.props.lintWarning} /> - + this.props.setLintWarning(false)} @@ -198,7 +187,7 @@ class Preferences extends React.Component { value="Off" checked={!this.props.lintWarning} /> - +
@@ -216,7 +205,7 @@ class Preferences extends React.Component { value="On" checked={this.props.textOutput} /> - + this.props.setTextOutput(false)} @@ -227,7 +216,7 @@ class Preferences extends React.Component { value="Off" checked={!this.props.textOutput} /> - +
diff --git a/client/styles/abstracts/_placeholders.scss b/client/styles/abstracts/_placeholders.scss index aa8c9f39..dadf6267 100644 --- a/client/styles/abstracts/_placeholders.scss +++ b/client/styles/abstracts/_placeholders.scss @@ -104,9 +104,6 @@ &:hover { color: $light-primary-text-color; } - &--selected { - color: $light-primary-text-color; - } } %modal { diff --git a/client/styles/components/_preferences.scss b/client/styles/components/_preferences.scss index 92892f3b..d33c355c 100644 --- a/client/styles/components/_preferences.scss +++ b/client/styles/components/_preferences.scss @@ -89,9 +89,7 @@ @extend %preference-option; list-style-type: none; padding: 0; - &--selected { - @extend %preference-option--selected; - } + color: $light-inactive-text-color; } .preference__options { @@ -100,6 +98,10 @@ width: #{70 / $base-font-size}rem; } +.preference__radio-button:checked + .preference__option { + color: $light-primary-text-color; +} + .preference--hidden { @extend %hidden-element; } From fbc6f1c97af673c3563e015c80a6555f4456bd41 Mon Sep 17 00:00:00 2001 From: MathuraMG Date: Mon, 29 Aug 2016 16:36:35 -0400 Subject: [PATCH 4/4] switch to onChange --- client/modules/IDE/components/Preferences.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/modules/IDE/components/Preferences.js b/client/modules/IDE/components/Preferences.js index da8c6251..0cf77843 100644 --- a/client/modules/IDE/components/Preferences.js +++ b/client/modules/IDE/components/Preferences.js @@ -114,7 +114,7 @@ class Preferences extends React.Component {
Spaces this.props.setAutosave(true)} + onChange={() => this.props.setAutosave(true)} aria-label="autosave on" name="autosave" id="autosave-on" @@ -152,7 +152,7 @@ class Preferences extends React.Component { this.props.setAutosave(false)} + onChange={() => this.props.setAutosave(false)} aria-label="autosave off" name="autosave" id="autosave-off" @@ -168,7 +168,7 @@ class Preferences extends React.Component {
this.props.setLintWarning(true)} + onChange={() => this.props.setLintWarning(true)} aria-label="lint warning on" name="lint warning" id="lint-warning-on" @@ -179,7 +179,7 @@ class Preferences extends React.Component { this.props.setLintWarning(false)} + onChange={() => this.props.setLintWarning(false)} aria-label="lint warning off" name="lint warning" id="lint-warning-off" @@ -197,7 +197,7 @@ class Preferences extends React.Component {
this.props.setTextOutput(true)} + onChange={() => this.props.setTextOutput(true)} aria-label="text output on" name="text output" id="text-output-on" @@ -208,7 +208,7 @@ class Preferences extends React.Component { this.props.setTextOutput(false)} + onChange={() => this.props.setTextOutput(false)} aria-label="text output off" name="text output" id="text-output-off"