r77947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77946‎ | r77947 | r77948 >
Date:01:46, 7 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Message fix
Modified paths:
  • /trunk/extensions/Push/Push.i18n.php (modified) (history)
  • /trunk/extensions/Push/Push.php (modified) (history)
  • /trunk/extensions/Push/includes/Push_Tab.php (modified) (history)
  • /trunk/extensions/Push/includes/ext.push.tab.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Push/Push.i18n.php
@@ -24,5 +24,6 @@
2525 'push-tab-title' => 'Pushing $1',
2626 'push-targets' => 'Push targets',
2727 'push-add-target' => 'Add target',
28 - 'push-import-revision-message' => 'Import from $1 by $2. Last comment: $3',
 28+ 'push-import-revision-message' => 'Import from $1 by $2.$3', // $3 is 'push-import-revision-comment' or empty. 1360!
 29+ 'push-import-revision-comment' => ' Last comment: $1',
2930 );
\ No newline at end of file
Index: trunk/extensions/Push/Push.php
@@ -59,6 +59,7 @@
6060 'push-button-completed',
6161 'push-button-failed',
6262 'push-import-revision-message',
 63+ 'push-import-revision-comment',
6364 );
6465
6566 // For backward compatibility with MW < 1.17.
Index: trunk/extensions/Push/includes/Push_Tab.php
@@ -95,14 +95,15 @@
9696 * @since 0.1
9797 */
9898 public static function displayPushPage( Article $article ) {
99 - global $wgOut, $wgUser, $wgTitle;
 99+ global $wgOut, $wgUser, $wgTitle, $wgSitename;
100100
101101 $wgOut->setPageTitle( wfMsgExt( 'push-tab-title', 'parsemag', $article->getTitle()->getText() ) );
102102
103103 self::loadJs();
104104
105105 $wgOut->addHTML(
106 - Html::hidden( 'pageName', $wgTitle->getFullText(), array( 'id' => 'pageName' ) )
 106+ Html::hidden( 'pageName', $wgTitle->getFullText(), array( 'id' => 'pageName' ) ) .
 107+ Html::hidden( 'siteName', $wgSitename, array( 'id' => 'siteName' ) )
107108 );
108109
109110 if ( $wgUser->isAllowed( 'push' ) ) {
@@ -180,7 +181,7 @@
181182 'button',
182183 array(
183184 'class' => 'push-button',
184 - 'pushtarget' => $url
 185+ 'pushtarget' => $url,
185186 ),
186187 wfMsg( 'push-button-text' )
187188 )
Index: trunk/extensions/Push/includes/ext.push.tab.js
@@ -21,7 +21,10 @@
2222 this.disabled = true;
2323 this.innerHTML = mediaWiki.msg( 'push-button-pushing' );
2424
25 - getLocalArtcileAndContinue( this, $(this).attr( 'pushtarget' ) );
 25+ getLocalArtcileAndContinue(
 26+ this,
 27+ $(this).attr( 'pushtarget' )
 28+ );
2629 });
2730
2831 function getLocalArtcileAndContinue( sender, targetUrl ) {
@@ -78,10 +81,17 @@
7982
8083 function doPush( sender, targetUrl, page, token ) {
8184 var summary = mediaWiki.msg( 'push-import-revision-message' );
82 - summary = summary.replace( '$1', 'Some wiki' ); // TODO
 85+ summary = summary.replace( '$1', $('#siteName').attr('value') );
8386 summary = summary.replace( '$2', page.revisions[0].user );
84 - summary = summary.replace( '$3', page.revisions[0].comment );
8587
 88+ var comment = '';
 89+ if ( page.revisions[0].comment ) {
 90+ comment = mediaWiki.msg( 'push-import-revision-comment' );
 91+ comment = comment.replace( '$1', page.revisions[0].comment );
 92+ }
 93+
 94+ summary = summary.replace( '$3', comment );
 95+
8696 $.post(
8797 targetUrl + '/api.php',
8898 {

Status & tagging log