r55691 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55690‎ | r55691 | r55692 >
Date:08:26, 31 August 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
Edit half-working button to go back to normal edit
Modified paths:
  • /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/js/quickedit.js
@@ -39,6 +39,16 @@
4040
4141 dialog = dialog.load(url, false, function() {
4242 var form = jQuery("#"+ id + " form");
 43+
 44+ var fb = form.find( ".mw-translate-fb" );
 45+ fb.click( function() {
 46+ var queryString = form.formSerialize();
 47+ // FIXME: forward contents of the text area
 48+ var newWindow = window.open( wgScript + "?title=" + page + "&action=edit&from=xjs" );
 49+ dialog.dialog("close");
 50+ return false;
 51+ } );
 52+
4353 var textarea = form.find( ".mw-translate-edit-area" );
4454 textarea.width(textarea.width()-4);
4555 //textarea.wikiEditor();
Index: trunk/extensions/Translate/utils/TranslationEditPage.php
@@ -60,7 +60,9 @@
6161 $hidden[] = Xml::hidden( 'action', 'edit' );
6262
6363 $summary = Xml::inputLabel( wfMsg( 'summary' ), 'summary', 'summary', 40 );
64 - $save = Html::input( 'submit', wfMsg( 'savearticle' ), 'submit' );
 64+ $save = Xml::submitButton( wfMsg( 'savearticle' ), array( 'style' => 'font-weight:bold' ));
 65+ $normal = Xml::element( 'input', array( 'class' => 'mw-translate-fb',
 66+ 'value' => wfMsg( 'translate-js-fb' ), 'type' => 'button' ) );
6567
6668 // Use the api to submit edits
6769 $formParams = array(
@@ -71,7 +73,7 @@
7274 $form = Html::rawElement( 'form', $formParams,
7375 implode( "\n", $hidden ) . "\n" .
7476 $helpers->getBoxes() . "\n" .
75 - "$textarea\n$summary$save"
 77+ "$textarea\n$summary$save$normal"
7678 );
7779
7880 echo $form;
Index: trunk/extensions/Translate/Translate.i18n.php
@@ -305,6 +305,8 @@
306306 'translate-import-err-warnings' => 'The file is not well formed.
307307 Make sure your editor does not remove msgctxt fields.
308308 Details: $1',
 309+
 310+ 'translate-js-fb' => 'Normal edit',
309311 );
310312
311313 /** Message documentation (Message documentation)

Status & tagging log