r59680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59679‎ | r59680 | r59681 >
Date:21:22, 2 December 2009
Author:adam
Status:ok
Tags:
Comment:
Adding some code to the ajax watch/unwatch to alter tooltips on ajax update. Bug #21538
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/skins/common/ajaxwatch.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/ajaxwatch.js
@@ -12,7 +12,9 @@
1313 watchMsg: "Watch",
1414 unwatchMsg: "Unwatch",
1515 watchingMsg: "Watching...",
16 - unwatchingMsg: "Unwatching..."
 16+ unwatchingMsg: "Unwatching...",
 17+ 'tooltip-ca-watchMsg': "Add this page to your watchlist",
 18+ 'tooltip-ca-unwatchMsg': "Remove this page from your watchlist"
1719 };
1820 }
1921
@@ -31,7 +33,14 @@
3234 if ( newText == wgAjaxWatch.watchingMsg || newText == wgAjaxWatch.unwatchingMsg ) {
3335 wgAjaxWatch.watchLinks[i].className += ' loading';
3436 } else if ( newText == wgAjaxWatch.watchMsg || newText == wgAjaxWatch.unwatchMsg ) {
35 - wgAjaxWatch.watchLinks[i].className = wgAjaxWatch.watchLinks[i].className.replace( /loading/i, '' );
 37+ wgAjaxWatch.watchLinks[i].className =
 38+ wgAjaxWatch.watchLinks[i].className.replace( /loading/i, '' );
 39+ // update the title text on the link
 40+ var keyCommand = wgAjaxWatch.watchLinks[i].title.match( /\[.*\]/ ) ?
 41+ wgAjaxWatch.watchLinks[i].title.match( /\[.*\]/ )[0] : "";
 42+ wgAjaxWatch.watchLinks[i].title = ( newText == wgAjaxWatch.watchMsg ?
 43+ wgAjaxWatch['tooltip-ca-watchMsg'] : wgAjaxWatch['tooltip-ca-unwatchMsg'] )
 44+ + " " + keyCommand;
3645 }
3746 }
3847 } else {
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1618,7 +1618,7 @@
16191619 * to ensure that client-side caches do not keep obsolete copies of global
16201620 * styles.
16211621 */
1622 -$wgStyleVersion = '255';
 1622+$wgStyleVersion = '256';
16231623
16241624
16251625 # Server-side caching:
Index: trunk/phase3/includes/Skin.php
@@ -440,7 +440,8 @@
441441
442442 if ( $wgOut->isArticleRelated() && $wgUseAjax && $wgAjaxWatch && $wgUser->isLoggedIn() ) {
443443 $msgs = (object)array();
444 - foreach ( array( 'watch', 'unwatch', 'watching', 'unwatching' ) as $msgName ) {
 444+ foreach ( array( 'watch', 'unwatch', 'watching', 'unwatching',
 445+ 'tooltip-ca-watch', 'tooltip-ca-unwatch' ) as $msgName ) {
445446 $msgs->{$msgName . 'Msg'} = wfMsg( $msgName );
446447 }
447448 $vars['wgAjaxWatch'] = $msgs;

Follow-up revisions

RevisionCommit summaryAuthorDate
r59683Follow change to r59680. Adding a better regexadam21:43, 2 December 2009
r59858wmf-deployment: Merge r59224, r59254, r59680, r59683, r59806 (usability fixes...catrope23:09, 8 December 2009

Status & tagging log