http://www.mediawiki.org/wiki/Special:Code/MediaWiki/55136

Revision: 55136
Author:   nikerabbit
Date:     2009-08-16 10:47:14 +0000 (Sun, 16 Aug 2009)

Log Message:
-----------
* Documentation
* Auto-focus

Modified Paths:
--------------
    trunk/extensions/Translate/js/quickedit.js

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



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to