r64702 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64701‎ | r64702 | r64703 >
Date:13:55, 7 April 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Add link to translation history (if there is any) to ajax edit
Modified paths:
  • /trunk/extensions/Translate/Translate.css (modified) (history)
  • /trunk/extensions/Translate/Translate.i18n.php (modified) (history)
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)
  • /trunk/extensions/Translate/utils/TranslationEditPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/Translate.css
@@ -180,3 +180,9 @@
181181 -webkit-border-radius: 10px;
182182 background-color: #D1E231 !important;
183183 }
 184+
 185+/* Quickedit */
 186+
 187+.mw-translate-history {
 188+ float: right;
 189+}
\ No newline at end of file
Index: trunk/extensions/Translate/js/quickedit.js
@@ -49,6 +49,10 @@
5050 return false;
5151 });
5252
 53+ form.find( ".mw-translate-history" ).click( function() {
 54+ window.open( wgServer + wgScript + "?action=history&title=" + form.find( "input[name=title]" ).val() );
 55+ return false;
 56+ });
5357
5458 form.find( ".mw-translate-edit-area" ).focus();
5559
Index: trunk/extensions/Translate/utils/TranslationEditPage.php
@@ -68,6 +68,11 @@
6969 $save = Xml::submitButton( wfMsg( 'savearticle' ), array( 'style' => 'font-weight:bold' ) );
7070 $saveAndNext = Xml::submitButton( wfMsg( 'translate-js-next' ), array( 'class' => 'mw-translate-next' ) );
7171 $skip = Html::element( 'input', array( 'class' => 'mw-translate-skip', 'type' => 'button', 'value' => wfMsg( 'translate-js-skip' ) ) );
 72+ if ( $this->getTitle()->exists() ) {
 73+ $history = Html::element( 'input', array( 'class' => 'mw-translate-history', 'type' => 'button', 'value' => wfMsg( 'translate-js-history' ) ) );
 74+ } else {
 75+ $history = '';
 76+ }
7277
7378 // Use the api to submit edits
7479 $formParams = array(
@@ -78,7 +83,7 @@
7984 $form = Html::rawElement( 'form', $formParams,
8085 implode( "\n", $hidden ) . "\n" .
8186 $helpers->getBoxes() . "\n" .
82 - "$textarea\n$summary$save$saveAndNext$skip"
 87+ "$textarea\n$summary$save$saveAndNext$skip$history"
8388 );
8489
8590 echo $form;
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -309,6 +309,7 @@
310310 'translate-js-nonext' => 'This was the last message on this page.',
311311 'translate-js-skip' => 'Skip to next',
312312 'translate-js-save-failed' => 'Saving failed. Please report this error.',
 313+ 'translate-js-history' => 'Translation history',
313314
314315 // scripts/groupStatistics.php related messages
315316 'translate-gs-pos' => 'Pos.',

Status & tagging log