r55136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55135‎ | r55136 | r55137 >
Date:10:47, 16 August 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Documentation
* Auto-focus
Modified paths:
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/js/quickedit.js
@@ -1,3 +1,27 @@
 2+/**
 3+ * JavaScript that implements the Ajax translation interface, which was at the
 4+ * time of writing this probably the biggest usability problem in the extension.
 5+ * Most importantly, it speeds up translating and keeps the list of translatable
 6+ * messages open. It also allows multiple translation dialogs, for doing quick
 7+ * updates to other messages or documentation, or translating multiple languages
 8+ * simultaneously together with the "In other languages" display included in
 9+ * translation helpers and implemented by utils/TranslationhHelpers.php.
 10+ * The form itself is implemented by utils/TranslationEditPage.php, which is
 11+ * called from Special:Translate/editpage?page=Namespace:pagename.
 12+ *
 13+ * TODO list:
 14+ * * On succesful save, update the MessageTable display too.
 15+ * * I18n for the messages
 16+ * * Integrate the (new) edittoolbar
 17+ * * Autoload ui classes
 18+ * * Instead of hc'd onscript, give them a class and use necessary triggers
 19+ * * Live-update the checks assistant
 20+ *
 21+ * @author Niklas Laxström
 22+ * @copyright Copyright © 2009 Niklas Laxström
 23+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 24+ */
 25+
226 function trlOpenJsEdit( page ) {
327 var url = wgScript + "?title=Special:Translate/editpage&page=" + page + "&uselang=" + wgUserLanguage;
428 var id = "jsedit" + page.replace( /[^a-zA-Z0-9_]/g, '_' );
@@ -9,8 +33,7 @@
1034 return false;
1135 }
1236
13 - var div = jQuery('<div id=' + id + '></div>');
14 - div.appendTo(document.body);
 37+ jQuery('<div></div>').attr('id', id).appendTo(jQuery('body'));
1538
1639 var dialog = jQuery("#"+id);
1740
@@ -18,6 +41,9 @@
1942 var form = jQuery("#"+ id + " form");
2043 var textarea = form.find( ".mw-translate-edit-area" );
2144 textarea.width(textarea.width()-4);
 45+ //textarea.wikiEditor();
 46+ textarea.focus();
 47+
2248 form.ajaxForm({
2349 datatype: "json",
2450 success: function(json) {
@@ -48,4 +74,17 @@
4975
5076 function trlVpWidth() {
5177 return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
52 -}
\ No newline at end of file
 78+}
 79+
 80+/*
 81+mvJsLoader.doLoadDepMode([
 82+ [ '$j.ui'
 83+ ],[
 84+ '$j.ui.resizable',
 85+ '$j.ui.draggable',
 86+ '$j.ui.dialog',
 87+ ]
 88+], function(){
 89+ $j('link_target').dialog( dialogConfig)
 90+});
 91+*/
\ No newline at end of file

Status & tagging log