Index: trunk/extensions/Push/Push.i18n.php |
— | — | @@ -24,5 +24,6 @@ |
25 | 25 | 'push-tab-title' => 'Pushing $1', |
26 | 26 | 'push-targets' => 'Push targets', |
27 | 27 | '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', |
29 | 30 | ); |
\ No newline at end of file |
Index: trunk/extensions/Push/Push.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | 'push-button-completed', |
61 | 61 | 'push-button-failed', |
62 | 62 | 'push-import-revision-message', |
| 63 | + 'push-import-revision-comment', |
63 | 64 | ); |
64 | 65 | |
65 | 66 | // For backward compatibility with MW < 1.17. |
Index: trunk/extensions/Push/includes/Push_Tab.php |
— | — | @@ -95,14 +95,15 @@ |
96 | 96 | * @since 0.1 |
97 | 97 | */ |
98 | 98 | public static function displayPushPage( Article $article ) { |
99 | | - global $wgOut, $wgUser, $wgTitle; |
| 99 | + global $wgOut, $wgUser, $wgTitle, $wgSitename; |
100 | 100 | |
101 | 101 | $wgOut->setPageTitle( wfMsgExt( 'push-tab-title', 'parsemag', $article->getTitle()->getText() ) ); |
102 | 102 | |
103 | 103 | self::loadJs(); |
104 | 104 | |
105 | 105 | $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' ) ) |
107 | 108 | ); |
108 | 109 | |
109 | 110 | if ( $wgUser->isAllowed( 'push' ) ) { |
— | — | @@ -180,7 +181,7 @@ |
181 | 182 | 'button', |
182 | 183 | array( |
183 | 184 | 'class' => 'push-button', |
184 | | - 'pushtarget' => $url |
| 185 | + 'pushtarget' => $url, |
185 | 186 | ), |
186 | 187 | wfMsg( 'push-button-text' ) |
187 | 188 | ) |
Index: trunk/extensions/Push/includes/ext.push.tab.js |
— | — | @@ -21,7 +21,10 @@ |
22 | 22 | this.disabled = true; |
23 | 23 | this.innerHTML = mediaWiki.msg( 'push-button-pushing' ); |
24 | 24 | |
25 | | - getLocalArtcileAndContinue( this, $(this).attr( 'pushtarget' ) ); |
| 25 | + getLocalArtcileAndContinue( |
| 26 | + this, |
| 27 | + $(this).attr( 'pushtarget' ) |
| 28 | + ); |
26 | 29 | }); |
27 | 30 | |
28 | 31 | function getLocalArtcileAndContinue( sender, targetUrl ) { |
— | — | @@ -78,10 +81,17 @@ |
79 | 82 | |
80 | 83 | function doPush( sender, targetUrl, page, token ) { |
81 | 84 | var summary = mediaWiki.msg( 'push-import-revision-message' ); |
82 | | - summary = summary.replace( '$1', 'Some wiki' ); // TODO |
| 85 | + summary = summary.replace( '$1', $('#siteName').attr('value') ); |
83 | 86 | summary = summary.replace( '$2', page.revisions[0].user ); |
84 | | - summary = summary.replace( '$3', page.revisions[0].comment ); |
85 | 87 | |
| 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 | + |
86 | 96 | $.post( |
87 | 97 | targetUrl + '/api.php', |
88 | 98 | { |