Skip to content

Commit

Permalink
Pseudo cross-browser styling for readonly Auth Strategies
Browse files Browse the repository at this point in the history
* Using this as a subtle notice that a strategy has been disabled in case someone isn't watching dev
* Fx still doesn't support styling unfortunately *( https://bugzilla.mozilla.org/show_bug.cgi?id=910022 )* so plain disable it. Should cut down on b/w but also possible Code testing increase with visible delineation in dev.

Post OpenUserJS#1174 and reminder-ed in OpenUserJS#1189 ... related to OpenUserJS#1732 OpenUserJS#1733
  • Loading branch information
Martii committed Aug 17, 2020
1 parent b5d5688 commit 9dc091a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ exports.register = function (aReq, aRes) {
if (!aStrategy.oauth) {
options.strategies.push({
'strat': aStrategyKey,
'display': aStrategy.name
'display': aStrategy.name,
'disabled': aStrategy.readonly
});
}
});
Expand All @@ -265,7 +266,8 @@ exports.register = function (aReq, aRes) {
aAvailableStrategies.forEach(function (aStrategy) {
options.strategies.push({
'strat': aStrategy.name,
'display': aStrategy.display
'display': aStrategy.display,
'disabled': aStrategy.readonly
});
});

Expand Down
12 changes: 8 additions & 4 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,12 +992,14 @@ exports.userEditPreferencesPage = function (aReq, aRes, aNext) {
if (userStrats.indexOf(aStrat.name) > -1) {
options.usedStrategies.push({
'strat': aStrat.name,
'display': aStrat.display
'display': aStrat.display,
'disabled': aStrat.readonly
});
} else {
options.openStrategies.push({
'strat': aStrat.name,
'display': aStrat.display
'display': aStrat.display,
'disabled': aStrat.readonly
});
}
});
Expand All @@ -1010,12 +1012,14 @@ exports.userEditPreferencesPage = function (aReq, aRes, aNext) {
if (userStrats.indexOf(name) > -1) {
options.usedStrategies.push({
'strat': name,
'display': strategy.name
'display': strategy.name,
'disabled': strategy.readonly
});
} else {
options.openStrategies.push({
'strat': name,
'display': strategy.name
'display': strategy.name,
'disabled': strategy.readonly
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion views/pages/loginPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h3>
</div>
<select name="auth" class="form-control">
{{#strategies}}
<option value="{{strat}}" {{#selected}}selected="selected"{{/selected}}>{{display}}</option>
<option value="{{strat}}" {{#selected}}selected="selected"{{/selected}}{{#disabled}} disabled="disabled"{{/disabled}}>{{display}}</option>
{{/strategies}}
</select>
<div style="width: 100%;">
Expand Down
2 changes: 1 addition & 1 deletion views/pages/userEditPreferencesPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="edit-authentication">Authentication</h2>
</span>
<select name="auth" class="form-control">
{{#openStrategies}}
<option value="{{strat}}">{{display}}</option>
<option value="{{strat}}"{{#disabled}} disabled="disabled"{{/disabled}}>{{display}}</option>
{{/openStrategies}}
</select>
<div style="width: 100%;">
Expand Down

0 comments on commit 9dc091a

Please sign in to comment.