Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.watch.ajax.js |
— | — | @@ -82,10 +82,18 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | wgAjaxWatch.setLinkText( $link, $link.data( 'action' ) + 'ing' ); |
| 86 | + |
| 87 | + var reqData = { |
| 88 | + 'action': 'watch', |
| 89 | + 'format': 'json', |
| 90 | + 'title': $link.data( 'target' ) |
| 91 | + }; |
| 92 | + if ( $link.data( 'action' ) == 'unwatch' ) { |
| 93 | + reqData['unwatch'] = ''; |
| 94 | + } |
86 | 95 | $.getJSON( mw.config.get( 'wgScriptPath' ) |
87 | | - + '/api' + mw.config.get( 'wgScriptExtension' ) + '?action=watch&format=json&title=' |
88 | | - + encodeURIComponent( $link.data( 'target' ) ) |
89 | | - + ( $link.data( 'action' ) == 'unwatch' ? '&unwatch' : '' ), |
| 96 | + + '/api' + mw.config.get( 'wgScriptExtension' ), |
| 97 | + reqData, |
90 | 98 | function( data, textStatus, xhr ) { |
91 | 99 | wgAjaxWatch.processResult( data, $link ); |
92 | 100 | } |