<__trans phrase="You have added [_1] to your list of banned IP addresses." params=""> <__trans phrase="You have successfully deleted the selected IP addresses from the list."> jQuery.mtValidateRules['.ipaddress'] = function( $e ){ return /^(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])\.(\d|[01]?\d\d|2[0-4]\d|25[0-5])$/.test($e.val()) }; jQuery.mtValidateMessages['.ipaddress'] = '<__trans phrase="Invalid IP address.">'; function openCreateMode () { jQuery('#content-actions').hide(); jQuery('#create-inline-ipban').show(); jQuery('#actions-bar-top').hide(); jQuery('#ip-address').mtUnvalidate().val('').focus(); } function closeCreateMode () { jQuery('#content-actions').show(); jQuery('#create-inline-ipban').hide(); jQuery('#actions-bar-top').show(); current_edit = 0; } jQuery('#create-inline-ipban').submit(function() { // If input has focus, jQuery.wrap() throws exception... // Change focus before validate. jQuery('#submit-ipban').focus(); if ( !jQuery('#ip-address').mtValidate('simple') ) { jQuery('#ip-address').focus(); return false; } renderList({ __mode: 'save', _type: 'banlist', ip: jQuery('#ip-address').val(), forward_list: 1, magic_token: 1 }); closeCreateMode(); return false; }); jQuery('#create-inline-ipban button.mt-cancel-action').click(function() { jQuery('#ip-address').mtUnvalidate(); closeCreateMode(); return false; }); jQuery('#action-ban-ip').click( function() { openCreateMode(); return false; });