Commit 367eedaf authored by Erick Hitter's avatar Erick Hitter

SMS Support. See #4.

* Make common aspects of Ajax modals modular.
* Render basics of SMS modal window.

Also, random formatting changes and general cleanup.
parent 6fd3ca1c
( function( $ ) {
$( document ).ready( function() {
// Build link
var link = $( '#authy-send-sms' ),
ajax = AuthyForWP.ajax,
username = $( '#user_login' ).val();
if ( username )
ajax += '&username=' + username;
ajax += '&KeepThis=true&TB_iframe=true&height=250&width=450';
link.attr( 'href', ajax );
link.addClass( 'thickbox' );
// Capture provided username
$( '#user_login' ).on( 'keyup keydown keypress', function() {
var username = $( this ).val();
// console.log( ajax.indexOf( 'username' ) );
if ( -1 == ajax.indexOf( 'username' ) ) {
ajax += '&username=' + username;
} else {
ajax = ajax.replace( /username[=]?[^&]*/i, 'username=' + username, ajax );
}
link.attr( 'href', ajax );
} );
} );
} )( jQuery );
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment