Index: trunk/phase3/skins/common/ajaxwatch.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | |
30 | 30 | wgAjaxWatch.processResult = function( response ) { |
31 | 31 | response = response.watch; |
32 | | - var $link = $( this ); |
| 32 | + var $link = $j( this ); |
33 | 33 | // To ensure we set the same status for all watch links with the |
34 | 34 | // same target we trigger a custom event on *all* watch links. |
35 | 35 | if( response.watched !== undefined ) { |
— | — | @@ -46,23 +46,23 @@ |
47 | 47 | // Bug 12395 - update the watch checkbox on edit pages when the |
48 | 48 | // page is watched or unwatched via the tab. |
49 | 49 | if( response.watched !== undefined ) { |
50 | | - $( '#wpWatchthis' ).attr( 'checked', '1' ); |
| 50 | + $j( '#wpWatchthis' ).attr( 'checked', '1' ); |
51 | 51 | } else { |
52 | | - $( '#wpWatchthis' ).removeAttr( 'checked' ); |
| 52 | + $j( '#wpWatchthis' ).removeAttr( 'checked' ); |
53 | 53 | } |
54 | 54 | }; |
55 | 55 | |
56 | | -$( document ).ready( function() { |
57 | | - var $links = $( '.mw-watchlink a, a.mw-watchlink' ); |
| 56 | +$j( document ).ready( function() { |
| 57 | + var $links = $j( '.mw-watchlink a, a.mw-watchlink' ); |
58 | 58 | // BC with older skins |
59 | 59 | $links = $links |
60 | | - .add( $( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) ) |
61 | | - .add( $( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) ); |
| 60 | + .add( $j( '#ca-watch a, #ca-unwatch a, a#mw-unwatch-link1' ) ) |
| 61 | + .add( $j( 'a#mw-unwatch-link2, a#mw-watch-link2, a#mw-watch-link1' ) ); |
62 | 62 | // allowing people to add inline animated links is a little scary |
63 | 63 | $links = $links.filter( ':not( #bodyContent *, #content * )' ); |
64 | 64 | |
65 | 65 | $links.each( function() { |
66 | | - var $link = $( this ); |
| 66 | + var $link = $j( this ); |
67 | 67 | $link |
68 | 68 | .data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) ) |
69 | 69 | .data( 'action', $link.attr( 'href' ).match( /[\?\&]action=unwatch/i ) ? 'unwatch' : 'watch' ); |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | }); |
73 | 73 | |
74 | 74 | $links.click( function( event ) { |
75 | | - var $link = $( this ); |
| 75 | + var $link = $j( this ); |
76 | 76 | |
77 | 77 | if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) { |
78 | 78 | // Lazy initialization so we don't toss up |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' ); |
86 | | - $.get( wgScriptPath |
| 86 | + $j.get( wgScriptPath |
87 | 87 | + '/api' + wgScriptExtension + '?action=watch&format=json&title=' |
88 | 88 | + encodeURIComponent( $link.data( 'target' ) ) |
89 | 89 | + ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ), |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | // When a request returns, a custom event 'mw-ajaxwatch' is triggered |
99 | 99 | // on *all* watch links, so they can be updated if necessary |
100 | 100 | $links.bind( 'mw-ajaxwatch', function( event, target, action ) { |
101 | | - var $link = $( this ); |
| 101 | + var $link = $j( this ); |
102 | 102 | var foo = $link.data( 'target' ); |
103 | 103 | if( $link.data( 'target' ) == target ) { |
104 | 104 | var otheraction = action == 'watch' |