r75243 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75242‎ | r75243 | r75244 >
Date:14:53, 23 October 2010
Author:catrope
Status:ok
Tags:
Comment:
Revert r73593, root cause has long been fixed
Modified paths:
  • /trunk/phase3/skins/common/ajaxwatch.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/ajaxwatch.js
@@ -28,7 +28,7 @@
2929
3030 wgAjaxWatch.processResult = function( response ) {
3131 response = response.watch;
32 - var $link = $j( this );
 32+ var $link = $( this );
3333 // To ensure we set the same status for all watch links with the
3434 // same target we trigger a custom event on *all* watch links.
3535 if( response.watched !== undefined ) {
@@ -46,23 +46,23 @@
4747 // Bug 12395 - update the watch checkbox on edit pages when the
4848 // page is watched or unwatched via the tab.
4949 if( response.watched !== undefined ) {
50 - $j( '#wpWatchthis' ).attr( 'checked', '1' );
 50+ $( '#wpWatchthis' ).attr( 'checked', '1' );
5151 } else {
52 - $j( '#wpWatchthis' ).removeAttr( 'checked' );
 52+ $( '#wpWatchthis' ).removeAttr( 'checked' );
5353 }
5454 };
5555
56 -$j( document ).ready( function() {
57 - var $links = $j( '.mw-watchlink a, a.mw-watchlink' );
 56+$( document ).ready( function() {
 57+ var $links = $( '.mw-watchlink a, a.mw-watchlink' );
5858 // BC with older skins
5959 $links = $links
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' ) );
 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' ) );
6262 // allowing people to add inline animated links is a little scary
6363 $links = $links.filter( ':not( #bodyContent *, #content * )' );
6464
6565 $links.each( function() {
66 - var $link = $j( this );
 66+ var $link = $( this );
6767 $link
6868 .data( 'icon', $link.parents( 'li' ).hasClass( 'icon' ) )
6969 .data( 'action', $link.attr( 'href' ).match( /[\?\&]action=unwatch/i ) ? 'unwatch' : 'watch' );
@@ -71,7 +71,7 @@
7272 });
7373
7474 $links.click( function( event ) {
75 - var $link = $j( this );
 75+ var $link = $( this );
7676
7777 if( wgAjaxWatch.supported === false || !wgEnableWriteAPI || !wfSupportsAjax() ) {
7878 // Lazy initialization so we don't toss up
@@ -82,7 +82,7 @@
8383 }
8484
8585 wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' );
86 - $j.get( wgScriptPath
 86+ $.get( wgScriptPath
8787 + '/api' + wgScriptExtension + '?action=watch&format=json&title='
8888 + encodeURIComponent( $link.data( 'target' ) )
8989 + ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ),
@@ -97,7 +97,7 @@
9898 // When a request returns, a custom event 'mw-ajaxwatch' is triggered
9999 // on *all* watch links, so they can be updated if necessary
100100 $links.bind( 'mw-ajaxwatch', function( event, target, action ) {
101 - var $link = $j( this );
 101+ var $link = $( this );
102102 var foo = $link.data( 'target' );
103103 if( $link.data( 'target' ) == target ) {
104104 var otheraction = action == 'watch'

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73593Replace $ with $j in ajaxwatch.js, was causing fatal JS errors on pages for m...werdna06:18, 23 September 2010

Status & tagging log