r69423 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69422‎ | r69423 | r69424 >
Date:12:49, 16 July 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Add some animations to ajax edit and have the textarea resize automatically
Modified paths:
  • /trunk/extensions/Translate/js/quickedit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/js/quickedit.js
@@ -21,6 +21,8 @@
2222 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
2323 */
2424
 25+var dialogwidth = false;
 26+
2527 function trlOpenJsEdit( page, group ) {
2628 var url = wgScript + "?title=Special:Translate/editpage&suggestions=async&page=$1&loadgroup=$2";
2729 url = url.replace( "$1", page ).replace( "$2", group );
@@ -41,6 +43,8 @@
4244
4345 dialog.load(url, false, function() {
4446 var form = jQuery("#"+ id + " form");
 47+
 48+ form.hide().show( "clip" );
4549
4650 form.find( ".mw-translate-next" ).click( function() {
4751 trlLoadNext( page );
@@ -77,9 +81,15 @@
7882
7983 dialog.dialog({
8084 bgiframe: true,
81 - width: parseInt(trlVpWidth()*0.8),
 85+ width: dialogwidth ? dialogwidth : parseInt(trlVpWidth()*0.8),
8286 title: page,
83 - position: "top"
 87+ position: "top",
 88+ resize: function(event, ui) {
 89+ jQuery("#"+ id + " textarea").width( "100%" );
 90+ },
 91+ resizeStop: function(event, ui) {
 92+ dialogwidth = jQuery("#"+ id).width();
 93+ }
8494 });
8595
8696 return false;

Status & tagging log