if ( action == 'watch' || action == 'unwatch' ) {
// save the accesskey from the title
var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : '';
if ( action == 'watch' || action == 'unwatch' ) {
// save the accesskey from the title
var keyCommand = $link.attr( 'title' ).match( /\[.*?\]$/ ) ? $link.attr( 'title' ).match( /\[.*?\]$/ )[0] : '';
if ( action == 'watching' || action == 'unwatching' ) {
$link.addClass( 'loading' );
} else {
$link.removeClass( 'loading' );
}
} else {
if ( action == 'watching' || action == 'unwatching' ) {
$link.addClass( 'loading' );
} else {
$link.removeClass( 'loading' );
}
} else {
if( $link.parents( 'li' ).attr( 'id' ) == 'ca-' + action ) {
$link.parents( 'li' ).attr( 'id', 'ca-' + otheraction );
// update the link text with the new message
if( $link.parents( 'li' ).attr( 'id' ) == 'ca-' + action ) {
$link.parents( 'li' ).attr( 'id', 'ca-' + otheraction );
// update the link text with the new message