wgAjaxWatch.processResult = function( response ) {
response = response.watch;
- var $link = $( this );
+ var $link = $j( this );
// To ensure we set the same status for all watch links with the
// same target we trigger a custom event on *all* watch links.
if( response.watched !== undefined ) {
// Bug 12395 - update the watch checkbox on edit pages when the
// page is watched or unwatched via the tab.
if( response.watched !== undefined ) {
- $( '#wpWatchthis' ).attr( 'checked', '1' );
+ $j( '#wpWatchthis' ).attr( 'checked', '1' );
} else {
- $( '#wpWatchthis' ).removeAttr( 'checked' );
+ $j( '#wpWatchthis' ).removeAttr( 'checked' );
}
};
-$( document ).ready( function() {
- var $links = $( '.mw-watchlink a, a.mw-watchlink' );
+$j( document ).ready( function() {
+ var $links = $j( '.mw-watchlink a, a.mw-watchlink' );
// BC with older skins
$links = $links
- .add( $( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) )
- .add( $( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) );
+ .add( $j( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) )
+ .add( $j( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) );
// allowing people to add inline animated links is a little scary
$links = $links.filter( ':not( #bodyContent *, #content * )' );
$links.each( function() {
- var $link = $( this );
+ var $link = $j( this );
$link
.data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) )
.data( 'action', $link.attr( 'href' ).match( /[\?\&]action=unwatch/i ) ? 'unwatch' : 'watch' );
});
$links.click( function( event ) {
- var $link = $( this );
+ var $link = $j( this );
if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) {
// Lazy initialization so we don't toss up
}
wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' );
- $.get( wgScriptPath
+ $j.get( wgScriptPath
+ '/api' + wgScriptExtension + '?action=watch&format=json&title='
+ encodeURIComponent( $link.data( 'target' ) )
+ ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ),
// When a request returns, a custom event 'mw-ajaxwatch' is triggered
// on *all* watch links, so they can be updated if necessary
$links.bind( 'mw-ajaxwatch', function( event, target, action ) {
- var $link = $( this );
+ var $link = $j( this );
var foo = $link.data( 'target' );
if( $link.data( 'target' ) == target ) {
var otheraction = action == 'watch'