From: Andrew Garrett Date: Thu, 23 Sep 2010 06:18:46 +0000 (+0000) Subject: Replace $ with $j in ajaxwatch.js, was causing fatal JS errors on pages for me. ... X-Git-Tag: 1.31.0-rc.0~34822 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ad7128576a878958eb41b76cf7cb2e08678f41d7;p=lhc%2Fweb%2Fwiklou.git Replace $ with $j in ajaxwatch.js, was causing fatal JS errors on pages for me. (resourceloader-related issue?) --- diff --git a/skins/common/ajaxwatch.js b/skins/common/ajaxwatch.js index 9ee5c08209..6406f0b501 100644 --- a/skins/common/ajaxwatch.js +++ b/skins/common/ajaxwatch.js @@ -28,7 +28,7 @@ wgAjaxWatch.setLinkText = function( $link, action ) { 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 ) { @@ -46,23 +46,23 @@ wgAjaxWatch.processResult = function( response ) { // 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' ); @@ -71,7 +71,7 @@ $( document ).ready( function() { }); $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 @@ -82,7 +82,7 @@ $( document ).ready( function() { } 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' : '' ), @@ -97,7 +97,7 @@ $( document ).ready( function() { // 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'