Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 055aba4

Browse files
author
Nick Litwin
committed
Change password tips to require one number or symbol
2 parents 84252c6 + 8fb7747 commit 055aba4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1149
-145
lines changed

app/account/login/login.controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
TcAuthService.socialLogin(backend, callbackUrl);
102102
};
103103

104+
vm.$stateParams = $stateParams;
104105
}
105106

106107
})();

app/account/login/login.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
a.forgot-password(ui-sref="resetPassword") Forgot Password?
3333

3434
p.redirect Don't have an account?
35-
a(ui-sref="register") Join Now.
35+
a(ui-sref="register(vm.$stateParams)") Join Now.
3636

app/account/register/register.controller.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
userId: vm.socialUserId,
8888
name: vm.firstname + " " + vm.lastname,
8989
email: vm.socialProfile.email,
90-
emailVerified: vm.socialProfile.emailVerified,
90+
emailVerified: vm.socialProfile.email_verified,
9191
providerType: vm.socialProvider
9292
}
9393
}
@@ -120,5 +120,7 @@
120120
callbackURL: callbackUrl
121121
});
122122
}
123+
124+
vm.$stateParams = $stateParams;
123125
}
124126
})();

app/account/register/register.jade

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
p.form-error(ng-show="vm.registerForm.email.$dirty && vm.registerForm.email.$invalid") Please enter a valid email address.
6464

6565
.validation-bar(ng-class="{ 'success-bar': (vm.registerForm.password.$valid) }")
66-
toggle-password
66+
toggle-password(ng-if="!vm.isSocialRegistration")
6767

6868
.tips.password-tips(ng-show="vm.passwordFocus")
6969
h3 Password Tips:
@@ -72,7 +72,7 @@
7272

7373
p(ng-class="{ 'has-letter': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasLetter) }") At least one letter
7474

75-
p(ng-class="{ 'has-number': (vm.registerForm.password.$dirty && !vm.registerForm.password.$error.hasNumber && !vm.registerForm.password.$error.hasSymbol) }") At least one number or symbol
75+
p(ng-class="{ 'has-number': (vm.registerForm.password.$dirty && (!vm.registerForm.password.$error.hasNumber || !vm.registerForm.password.$error.hasSymbol)) }") At least one number or symbol
7676

7777
button(type="submit", ng-disabled="vm.registerForm.$invalid", ng-class="{'enabled-button': vm.registerForm.$valid}") Join
7878

@@ -90,4 +90,4 @@
9090
i.fa.fa-google-plus-square(ng-click="vm.socialRegister('google-oauth2')")
9191

9292
p.redirect Already have an account?
93-
a(ui-sref="login") Login.
93+
a(ui-sref="login(vm.$stateParams)") Login.

app/account/reset-password/reset-password.jade

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545

4646
p(ng-class="{ 'has-letter': (vm.resetPasswordForm.password.$dirty && !vm.resetPasswordForm.password.$error.hasLetter) }") At least one letter
4747

48-
p(ng-class="{ 'has-symbol': (vm.resetPasswordForm.password.$dirty && !vm.resetPasswordForm.password.$error.hasSymbol) }") At least one symbol
49-
50-
p(ng-class="{ 'has-number': (vm.resetPasswordForm.password.$dirty && !vm.resetPasswordForm.password.$error.hasNumber) }") At least one number
48+
p(ng-class="{ 'has-number': (vm.resetPasswordForm.password.$dirty && (!vm.resetPasswordForm.password.$error.hasNumber || !vm.resetPasswordForm.password.$error.hasSymbol) }") At least one number or symbol
5149

5250
.form-errors
5351
p.form-error(ng-show="vm.resetFailed") We were unable to reset your password. Please request another reset link. If you continue to have trouble, please contact

app/directives/account/toggle-password/toggle-password.directive.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
passwordInput.focus();
2121
});
2222

23+
element.bind('keyup', function(event) {
24+
if (event.keyCode === 13) {
25+
passwordInput.blur();
26+
}
27+
});
28+
2329
vm.onFocus = function(event) {
2430
vm.passwordFocus = true;
2531
vm.placeholder = '';

app/directives/distribution-graph/distribution-graph.directive.jade

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.graph-viewer
1+
.graph-viewer(ng-show="graphState.show == 'distribution'")
22
.distribution-graph
33

44
.info-port
@@ -8,3 +8,6 @@
88
.rating(ng-if="!displayCoders")
99
.num {{rating}}
1010
.label RATING
11+
12+
.compare
13+
button(ng-click="graphState.show = 'history'") COMPARE

app/directives/distribution-graph/distribution-graph.directive.js

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
scope: {
1313
promise: '=',
14-
rating: '='
14+
rating: '=',
15+
graphState: '='
1516
},
1617
controller: ['$scope', DistributionGraphController]
1718
};
@@ -55,9 +56,11 @@
5556
'end': Infinity
5657
}
5758
];
58-
var w = 700,
59+
var w = 600,
5960
h = 400,
60-
padding = 100;
61+
padding = { top: 20, left: 100, bottom: 100, right: 0 };
62+
var totalW = w + padding.left + padding.right;
63+
var totalH = h + padding.top + padding.bottom;
6164

6265
activate();
6366

@@ -71,45 +74,48 @@
7174
removeTrailingZeroes(ranges);
7275
var xScale = d3.scale.ordinal()
7376
.domain(d3.range(ranges.length))
74-
.rangeRoundBands([padding, w], 0.05);
77+
.rangeRoundBands([padding.left, padding.left + w], 0.05);
7578
var yScale = d3.scale.linear()
7679
.domain([0, d3.max(ranges, function(range) { return range.number }) + 1])
77-
.range([h - padding, 0]);
80+
.range([totalH - padding.bottom, padding.top]);
7881
var xScale2 = d3.scale.linear()
7982
.domain([ranges[0].start,
8083
d3.max(ranges, function(range) { return range.end })])
81-
.range([padding, w]);
84+
.range([padding.left, totalW - padding.right]);
8285
var svg = d3.select('div.distribution-graph')
8386
.append('svg')
84-
.attr('width', w)
85-
.attr('height', h);
87+
.attr('width', totalW)
88+
.attr('height', totalH);
8689

8790
svg.append('rect')
88-
.attr('x', padding)
89-
.attr('y', 0)
91+
.attr('x', padding.left)
92+
.attr('y', padding.top)
9093
.attr('width', w)
91-
.attr('height', h - padding)
92-
.attr('fill', '#eeeeee')
94+
.attr('height', h)
95+
.attr('fill', '#f6f6f6')
9396

9497
svg.append('g')
9598
.attr('class', 'grid')
96-
.attr('transform', 'translate(' + padding + ',0)')
99+
.attr('transform', 'translate(' + padding.left + ',0)')
97100
.call(
98-
yAxis(5).tickSize(-w, 0, 0)
101+
yAxis(5).tickSize(-totalW, 0, 0)
99102
.tickFormat('')
100103
)
101104

102105
svg.append('g')
103106
.attr('class', 'axis')
104-
.attr('transform', 'translate(' + padding + ',0)')
107+
.attr('transform', 'translate(' + padding.left + ', 0)')
105108
.call(yAxis(5))
106109

107110

111+
function logr(x) {
112+
console.log(x); return x;
113+
}
108114
svg.append('line')
109115
.attr('x1', xScale2($scope.rating))
110-
.attr('y1', h - padding)
116+
.attr('y1', totalH - padding.bottom)
111117
.attr('x2', xScale2($scope.rating))
112-
.attr('y2', 0)
118+
.attr('y2', padding.top)
113119
.attr('class', 'my-rating')
114120
.attr('stroke-width', 2)
115121
.attr('stroke', ratingToColor($scope.colors, $scope.rating));
@@ -127,7 +133,7 @@
127133
})
128134
.attr('width', xScale.rangeBand())
129135
.attr('height', function(d) {
130-
return h - padding - yScale(d.number);
136+
return totalH - padding.bottom - yScale(d.number);
131137
})
132138
.attr('fill', function(d) {
133139
return ratingToColor($scope.colors, d.start);
@@ -153,20 +159,20 @@
153159
.attr('class', 'xaxis')
154160
.attr('x1', function(d, i) {
155161
if (i === 0) {
156-
return padding;
162+
return padding.left;
157163
} else {
158164
return xScale(i) - .5;
159165
}
160166
})
161167
.attr('x2', function(d, i) {
162168
if (i === ranges.length - 1) {
163-
return w;
169+
return totalW - padding.right;
164170
} else {
165171
return xScale(i) + xScale.rangeBand() + .5;
166172
}
167173
})
168-
.attr('y1', h - padding + .5)
169-
.attr('y2', h - padding + .5)
174+
.attr('y1', h + padding.top + .5)
175+
.attr('y2', h + padding.top + .5)
170176
.attr('stroke', function(d) {
171177
return ratingToColor($scope.colors, d.start);
172178
})
@@ -185,7 +191,7 @@
185191

186192
svg.append('g')
187193
.attr('class', 'axis')
188-
.attr('transform', 'translate(0,' + (h - padding) + ')')
194+
.attr('transform', 'translate(0,' + (h + padding.top) + ')')
189195
.call(xAxis)
190196
.selectAll('text')
191197
.attr('x', 9)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.history-graph-container(ng-show="graphState.show == 'history'")
2+
.history-graph
3+
4+
.info-port
5+
.rating
6+
.num {{historyRating || rating}}
7+
.label RATING
8+
.history-info(ng-if="historyRating")
9+
| Attained on {{historyDate}} in challenge "{{historyChallenge}}"
10+
.lower
11+
button(ng-click="graphState.show = 'distribution'") COMPARE

0 commit comments

Comments
 (0)