Statistics: Posted by Jason Caldwell — October 28th, 2011, 2:47 pm
Statistics: Posted by antseo — October 28th, 2011, 1:18 pm
Statistics: Posted by Raam Dev — October 28th, 2011, 1:10 pm
Statistics: Posted by Cristián Lávaque — October 7th, 2011, 3:56 am
Statistics: Posted by sonora — October 7th, 2011, 1:51 am
Statistics: Posted by bsowards — September 14th, 2011, 10:40 am
Statistics: Posted by bsowards — September 6th, 2011, 12:22 pm
Statistics: Posted by antseo — September 4th, 2011, 2:56 pm
Statistics: Posted by bsowards — September 4th, 2011, 11:12 am
Statistics: Posted by bsowards — September 4th, 2011, 9:41 am
Statistics: Posted by Cristián Lávaque — September 2nd, 2011, 11:00 pm
<?php
add_action ("login_head", "s2_email_to_username", 1000);
function s2_email_to_username ()
{
?>
<script type = "text/javascript">
(function ($) /* Wraps this `$ = jQuery` routine. */
{
$.fn.swapWith = function (to) /* Utility extension for jQuery. */
{
return this.each (function ()
{
var $to = $ (to).clone (true), $from = $ (this).clone (true);
$(to).replaceWith ($from), $ (this).replaceWith ($to);
});
};
/**/
$(document).ready (function () /* Handles email-to-username on keyup. */
{
var email = 'input#user_email', login = 'input#user_login';
$(email).closest ('p').swapWith ($ (login).closest ('p')), $ (email).keyup (function ()
{
$(login).val ($.trim ($ (email).val ().split (/@/)[0].replace (/[^\w]/gi, '')));
});
});
}) (jQuery);
</script>
<?php
}
?>
Statistics: Posted by Jason Caldwell — September 2nd, 2011, 8:53 pm
Statistics: Posted by Jason Caldwell — September 2nd, 2011, 7:28 pm
Statistics: Posted by Cristián Lávaque — September 1st, 2011, 10:08 pm
Statistics: Posted by bsowards — September 1st, 2011, 10:00 am