Index: branches/usability/acaifix/EditToolbar/EditToolbar.js |
— | — | @@ -1098,6 +1098,7 @@ |
1099 | 1099 | $j(this) |
1100 | 1100 | .find( 'button:first' ) |
1101 | 1101 | .click(); |
| 1102 | + e.preventDefault(); |
1102 | 1103 | } |
1103 | 1104 | }); |
1104 | 1105 | } |
— | — | @@ -1124,15 +1125,6 @@ |
1125 | 1126 | $j(this).find( '[rel]' ).each( function() { |
1126 | 1127 | $j(this).text( gM( $j(this).attr( 'rel' ) ) ); |
1127 | 1128 | }); |
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 | | - }); |
1137 | 1129 | $j( '#edittoolbar-table-dimensions-rows' ).val( 2 ); |
1138 | 1130 | $j( '#edittoolbar-table-dimensions-columns' ).val( 2 ); |
1139 | 1131 | }, |
— | — | @@ -1204,6 +1196,7 @@ |
1205 | 1197 | $j(this) |
1206 | 1198 | .find( 'button:first' ) |
1207 | 1199 | .click(); |
| 1200 | + e.preventDefault(); |
1208 | 1201 | } |
1209 | 1202 | }); |
1210 | 1203 | } |
— | — | @@ -1237,15 +1230,6 @@ |
1238 | 1231 | $j(this).find( '[rel]' ).each( function() { |
1239 | 1232 | $j(this).text( gM( $j(this).attr( 'rel' ) ) ); |
1240 | 1233 | }); |
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 | | - }); |
1250 | 1234 | |
1251 | 1235 | // TODO: Find a cleaner way to share this function |
1252 | 1236 | $j(this).data( 'replaceCallback', function( mode ) { |
— | — | @@ -1328,13 +1312,16 @@ |
1329 | 1313 | }, |
1330 | 1314 | dialog: { |
1331 | 1315 | 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 ); |
1333 | 1318 | $j(this).data( 'replaceCallback' ).call( this, 'find' ); |
1334 | 1319 | }, |
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 ); |
1336 | 1322 | $j(this).data( 'replaceCallback' ).call( this, 'replace' ); |
1337 | 1323 | }, |
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 ); |
1339 | 1326 | $j(this).data( 'replaceCallback' ).call( this, 'replaceAll' ); |
1340 | 1327 | }, |
1341 | 1328 | 'edittoolbar-tool-replace-close': function() { |
— | — | @@ -1342,6 +1329,7 @@ |
1343 | 1330 | $j(this).data( 'context' ).$textarea |
1344 | 1331 | .unbind( 'keypress.srdialog' ) |
1345 | 1332 | .focus(); |
| 1333 | + $j(this).closest( '.ui-dialog' ).data( 'dialogaction', false ); |
1346 | 1334 | } |
1347 | 1335 | }, |
1348 | 1336 | open: function() { |
— | — | @@ -1354,7 +1342,8 @@ |
1355 | 1343 | // when the user presses Enter |
1356 | 1344 | $j(this).closest( '.ui-dialog' ).keypress( function( e ) { |
1357 | 1345 | 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(); |
1359 | 1348 | e.preventDefault(); |
1360 | 1349 | } |
1361 | 1350 | }); |
— | — | @@ -1367,7 +1356,8 @@ |
1368 | 1357 | var dialog = $j(this).closest( '.ui-dialog' ); |
1369 | 1358 | $j(this).data( 'context' ).$textarea.bind( 'keypress.srdialog', function( e ) { |
1370 | 1359 | 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(); |
1372 | 1362 | e.preventDefault(); |
1373 | 1363 | } |
1374 | 1364 | }); |
Property changes on: branches/usability/acaifix/EditToolbar/EditToolbar.js |
___________________________________________________________________ |
Name: svn:mergeinfo |
1375 | 1365 | - /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 |
1376 | 1366 | + /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 @@ |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | 22 | // Bump the version number every time you change any of the .css/.js files |
23 | | -$wgEditToolbarStyleVersion = 74; |
| 23 | +$wgEditToolbarStyleVersion = 75; |
24 | 24 | |
25 | 25 | // Set this to true to simply override the stock toolbar for everyone |
26 | 26 | $wgEditToolbarGlobalEnable = false; |