r55532 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55531‎ | r55532 | r55533 >
Date:17:55, 23 August 2009
Author:catrope
Status:deferred
Tags:
Comment:
EditToolbar:
* Fix JS error from r55012 when opening the link dialog without selecting any text and clicking Insert
* Update calls to doAction() for r55389
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -250,7 +250,7 @@
251251 options: {
252252 pre: insertText
253253 }
254 - });
 254+ }, $j(this) );
255255 $j(this).dialog( 'close' );
256256 },
257257 'edittoolbar-tool-link-cancel': function() {
@@ -260,12 +260,12 @@
261261 open: function() {
262262 // Smart pre-fill text fields
263263 var selection = $j(this).data( 'context' ).$textarea.getSelection();
 264+ $j( '#edittoolbar-link-dialog-tab-int' ).data( 'whitespace', [ '', '' ] );
 265+ $j( '#edittoolbar-link-dialog-tab-ext' ).data( 'whitespace', [ '', '' ] );
264266 if ( selection != '' ) {
265267 var inttext, inttarget, exttext, exttarget;
266268 var matches;
267269 var tab = -1;
268 - $j( '#edittoolbar-link-dialog-tab-int' ).data( 'whitespace', [ '', '' ] );
269 - $j( '#edittoolbar-link-dialog-tab-ext' ).data( 'whitespace', [ '', '' ] );
270270 if ( ( matches = selection.match( /^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/ ) ) ) {
271271 // [[foo|bar]] or [[foo]]
272272 inttarget = matches[2];
@@ -581,7 +581,7 @@
582582 pre: table,
583583 ownline: true
584584 }
585 - });
 585+ }, $j(this) );
586586 $j(this).dialog( 'close' );
587587 },
588588 'edittoolbar-tool-table-cancel': function() {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55012EditToolbar: Make the link CGD replace the selection (but preserving leading ...catrope11:59, 14 August 2009
r55389Added some support code for click tracking that builds a nice looking string ...tparscal18:36, 20 August 2009

Status & tagging log