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 | + |
2 | 26 | function trlOpenJsEdit( page ) { |
3 | 27 | var url = wgScript + "?title=Special:Translate/editpage&page=" + page + "&uselang=" + wgUserLanguage; |
4 | 28 | var id = "jsedit" + page.replace( /[^a-zA-Z0-9_]/g, '_' ); |
— | — | @@ -9,8 +33,7 @@ |
10 | 34 | return false; |
11 | 35 | } |
12 | 36 | |
13 | | - var div = jQuery('<div id=' + id + '></div>'); |
14 | | - div.appendTo(document.body); |
| 37 | + jQuery('<div></div>').attr('id', id).appendTo(jQuery('body')); |
15 | 38 | |
16 | 39 | var dialog = jQuery("#"+id); |
17 | 40 | |
— | — | @@ -18,6 +41,9 @@ |
19 | 42 | var form = jQuery("#"+ id + " form"); |
20 | 43 | var textarea = form.find( ".mw-translate-edit-area" ); |
21 | 44 | textarea.width(textarea.width()-4); |
| 45 | + //textarea.wikiEditor(); |
| 46 | + textarea.focus(); |
| 47 | + |
22 | 48 | form.ajaxForm({ |
23 | 49 | datatype: "json", |
24 | 50 | success: function(json) { |
— | — | @@ -48,4 +74,17 @@ |
49 | 75 | |
50 | 76 | function trlVpWidth() { |
51 | 77 | 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 |