User:Kerri Amber/rb.js

/** * * Function opens up a new section on a user's talk page when rollbacking * By Grunny (http://community.wikia.com/wiki/User:Grunny) * */ $(document).ready( function {	$( '.mw-rollback-link a' ).click( function (e) { e.preventDefault; var $rblink = $( this ); $.ajax( {			url: $rblink.attr( 'href' ),			success: function {				var	user = $rblink.attr( 'href' ).replace( /.*[&?]from=([^&]*).*/, '$1' ).replace( /\+/g, '_' ),					newurl = wgServer + wgArticlePath.replace( '$1', 'User_talk:' + user + '?action=edit&section=new' );				location.href = newurl;			},			error: function  {				$rblink.text( function ( i, val ) { return val + ' [failed]'; } );					}		} );	} ); } );