
1 changed files with 39 additions and 0 deletions
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
var capitalize = function(some_string) { |
||||
if (some_string) { |
||||
return some_string[0].toUpperCase() + some_string.substring(1).toLowerCase(); |
||||
} else { |
||||
return(""); |
||||
} |
||||
} |
||||
|
||||
$(function() { |
||||
// Handler for .ready() called.
|
||||
|
||||
$("#deformCancel").on("click", function(event) { |
||||
window.location.href = "/"; |
||||
}) |
||||
|
||||
$(".o3-pwd-visibility").on("click", function(event) { |
||||
// handle password visibility
|
||||
var target = $(event.delegateTarget) |
||||
var pwd = target.parent().children("input") |
||||
if (pwd.attr("type") == "password") { |
||||
target.removeClass("o3-pwd-dots"); |
||||
target.addClass("o3-pwd-text"); |
||||
pwd.attr("type", "text") |
||||
} else { |
||||
target.addClass("o3-pwd-dots"); |
||||
target.removeClass("o3-pwd-text"); |
||||
pwd.attr("type", "password") |
||||
} |
||||
}); |
||||
|
||||
$(".o3-reg-username-source").on("keyup", function(event){ |
||||
// automatic username creation
|
||||
var first_name = $(".o3-reg-firstname").val(); |
||||
var last_name = $(".o3-reg-lastname").val(); |
||||
var user_name = capitalize(first_name) + capitalize(last_name) |
||||
$(".o3-reg-username").val(user_name); |
||||
}); |
||||
|
||||
}); |
Loading…
Reference in new issue