Baris Soner Usakli 12 years ago
commit 613325c4ec

@ -23,8 +23,8 @@
</div>
<script>
// Alternate Logins
var altLoginEl = document.querySelector('.alt-logins');
altLoginEl.addEventListener('click', function(e) {
if (e.target.nodeName === 'LI') {
document.location.href = e.target.getAttribute('data-url');

@ -1,13 +1,21 @@
<!-- START Register Template -->
<h1>Register</h1>
<div class="well">
<form method="post" action="/register">
<label for="email">Email Address</label><input type="email" name="email" placeholder="Enter Email Address" id="email" /> <span id="email-notify" class="label label-important"></span> <br />
<label for="username">Username</label><input type="text" name="username" placeholder="Enter Username" id="username" /> <span id="username-notify" class="label label-success"></span> <br />
<label for="password">Password</label><input type="password" name="password" placeholder="Enter Password" id="password" /><br />
<button class="btn btn-primary" id="register" type="submit">Register Now</button>
</form>
<div class="row-fluid">
<div class="well {register_window:spansize}">
<form method="post" action="/register">
<label for="email">Email Address</label><input type="email" name="email" placeholder="Enter Email Address" id="email" /> <span id="email-notify" class="label label-important"></span> <br />
<label for="username">Username</label><input type="text" name="username" placeholder="Enter Username" id="username" /> <span id="username-notify" class="label label-success"></span> <br />
<label for="password">Password</label><input type="password" name="password" placeholder="Enter Password" id="password" /><br />
<button class="btn btn-primary" id="register" type="submit">Register Now</button>
</form>
</div>
<div class="well span6 {alternate_logins:display}">
<h4>Alternative Logins</h4>
<ul class="alt-logins">
<li data-url="/auth/twitter" class="twitter {twitter:display}"></li>
<li data-url="/auth/google" class="google {google:display}"></li>
<li data-url="/auth/facebook" class="facebook {facebook:display}"></li>
</ul>
</div>
</div>
<script type="text/javascript">
(function() {
@ -47,5 +55,13 @@
email_notify.innerHTML = '';
}
});
// Alternate Logins
var altLoginEl = document.querySelector('.alt-logins');
altLoginEl.addEventListener('click', function(e) {
if (e.target.nodeName === 'LI') {
document.location.href = e.target.getAttribute('data-url');
}
});
}());
</script>

@ -122,6 +122,28 @@ var express = require('express'),
}
}
res.send(JSON.stringify(data));
break;
case 'register' :
var data = {},
login_strategies = auth.get_login_strategies(),
num_strategies = login_strategies.length;
if (num_strategies == 0) {
data = {
'register_window:spansize': 'span12',
'alternate_logins:display': 'none'
};
} else {
data = {
'register_window:spansize': 'span6',
'alternate_logins:display': 'block'
}
for (var i=0, ii=num_strategies; i<ii; i++) {
data[login_strategies[i] + ':display'] = 'active';
}
}
res.send(JSON.stringify(data));
break;
case 'topic' :

Loading…
Cancel
Save