r58993 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58992‎ | r58993 | r58994 >
Date:00:26, 13 November 2009
Author:catrope
Status:deferred
Tags:
Comment:
usability: Merge r57425 from trunk to acaifix
Modified paths:
  • /branches/usability/acaifix/EditToolbar/EditToolbar.js (modified) (history)
  • /branches/usability/acaifix/EditToolbar/EditToolbar.php (modified) (history)

Diff [purge]

Index: branches/usability/acaifix/EditToolbar/EditToolbar.js
@@ -1098,6 +1098,7 @@
10991099 $j(this)
11001100 .find( 'button:first' )
11011101 .click();
 1102+ e.preventDefault();
11021103 }
11031104 });
11041105 }
@@ -1124,15 +1125,6 @@
11251126 $j(this).find( '[rel]' ).each( function() {
11261127 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
11271128 });
1128 - // Execute the action associated with the first button
1129 - // when the user presses Enter
1130 - $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
1131 - if ( ( e.keyCode || e.which ) == 13 ) {
1132 - $j(this)
1133 - .find( 'button:first' )
1134 - .click();
1135 - }
1136 - });
11371129 $j( '#edittoolbar-table-dimensions-rows' ).val( 2 );
11381130 $j( '#edittoolbar-table-dimensions-columns' ).val( 2 );
11391131 },
@@ -1204,6 +1196,7 @@
12051197 $j(this)
12061198 .find( 'button:first' )
12071199 .click();
 1200+ e.preventDefault();
12081201 }
12091202 });
12101203 }
@@ -1237,15 +1230,6 @@
12381231 $j(this).find( '[rel]' ).each( function() {
12391232 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
12401233 });
1241 - // Execute the action associated with the first button
1242 - // when the user presses Enter
1243 - $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
1244 - if ( ( e.keyCode || e.which ) == 13 ) {
1245 - $j(this)
1246 - .find( 'button:first' )
1247 - .click();
1248 - }
1249 - });
12501234
12511235 // TODO: Find a cleaner way to share this function
12521236 $j(this).data( 'replaceCallback', function( mode ) {
@@ -1328,13 +1312,16 @@
13291313 },
13301314 dialog: {
13311315 buttons: {
1332 - 'edittoolbar-tool-replace-button-findnext': function() {
 1316+ 'edittoolbar-tool-replace-button-findnext': function( e ) {
 1317+ $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
13331318 $j(this).data( 'replaceCallback' ).call( this, 'find' );
13341319 },
1335 - 'edittoolbar-tool-replace-button-replacenext': function() {
 1320+ 'edittoolbar-tool-replace-button-replacenext': function( e ) {
 1321+ $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
13361322 $j(this).data( 'replaceCallback' ).call( this, 'replace' );
13371323 },
1338 - 'edittoolbar-tool-replace-button-replaceall': function() {
 1324+ 'edittoolbar-tool-replace-button-replaceall': function( e ) {
 1325+ $j(this).closest( '.ui-dialog' ).data( 'dialogaction', e.target );
13391326 $j(this).data( 'replaceCallback' ).call( this, 'replaceAll' );
13401327 },
13411328 'edittoolbar-tool-replace-close': function() {
@@ -1342,6 +1329,7 @@
13431330 $j(this).data( 'context' ).$textarea
13441331 .unbind( 'keypress.srdialog' )
13451332 .focus();
 1333+ $j(this).closest( '.ui-dialog' ).data( 'dialogaction', false );
13461334 }
13471335 },
13481336 open: function() {
@@ -1354,7 +1342,8 @@
13551343 // when the user presses Enter
13561344 $j(this).closest( '.ui-dialog' ).keypress( function( e ) {
13571345 if ( ( e.keyCode || e.which ) == 13 ) {
1358 - $j(this).find( 'button:first' ).click();
 1346+ var button = $j(this).data( 'dialogaction' ) || $j(this).find( 'button:first' );
 1347+ button.click();
13591348 e.preventDefault();
13601349 }
13611350 });
@@ -1367,7 +1356,8 @@
13681357 var dialog = $j(this).closest( '.ui-dialog' );
13691358 $j(this).data( 'context' ).$textarea.bind( 'keypress.srdialog', function( e ) {
13701359 if ( ( e.keyCode || e.which ) == 13 ) {
1371 - dialog.find( 'button:first' ).click();
 1360+ var button = dialog.data( 'dialogaction' ) || dialog.find( 'button:first' );
 1361+ button.click();
13721362 e.preventDefault();
13731363 }
13741364 });
Property changes on: branches/usability/acaifix/EditToolbar/EditToolbar.js
___________________________________________________________________
Name: svn:mergeinfo
13751365 - /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:51646
/trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:56151-57234,58926,58973-58974
/trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js:58873,58923,58953
/trunk/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447
13761366 + /branches/REL1_15/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:51646
/trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:56151-57234,57425,58926,58973-58974
/trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js:58873,58923,58953
/trunk/phase3/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447
Index: branches/usability/acaifix/EditToolbar/EditToolbar.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditToolbarStyleVersion = 74;
 23+$wgEditToolbarStyleVersion = 75;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57425* EditToolbar: (bug 21015) Make table and link dialogs also work nicely with ...catrope14:22, 6 October 2009

Status & tagging log