http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73593

Revision: 73593
Author:   werdna
Date:     2010-09-23 06:18:46 +0000 (Thu, 23 Sep 2010)

Log Message:
-----------
Replace $ with $j in ajaxwatch.js, was causing fatal JS errors on pages for me. 
(resourceloader-related issue?)

Modified Paths:
--------------
    trunk/phase3/skins/common/ajaxwatch.js

Modified: trunk/phase3/skins/common/ajaxwatch.js
===================================================================
--- trunk/phase3/skins/common/ajaxwatch.js      2010-09-23 06:12:10 UTC (rev 
73592)
+++ trunk/phase3/skins/common/ajaxwatch.js      2010-09-23 06:18:46 UTC (rev 
73593)
@@ -28,7 +28,7 @@
 
 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 @@
        // 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 @@
        });
 
        $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 @@
                }
 
                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 @@
        // 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'



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to