r62965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62964‎ | r62965 | r62966 >
Date:17:23, 25 February 2010
Author:adam
Status:ok
Tags:
Comment:
WikiEditor Dialogs - Fixing a case where the link status was not being updated when the check boxes were being switched automatically on the insert link dialog
Modified paths:
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -16,14 +16,14 @@
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 50 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 51 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 52 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 53 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 52 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 53 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1088,11 +1088,13 @@
10891089 // $j(this).val() is the old value, before the keypress
10901090 // Defer this until $j(this).val() has been updated
10911091 setTimeout( function() {
1092 - if ( isExternalLink( $j( '#wikieditor-toolbar-link-int-target' ).val() ) )
 1092+ if ( isExternalLink( $j( '#wikieditor-toolbar-link-int-target' ).val() ) ) {
10931093 $j( '#wikieditor-toolbar-link-type-ext' ).attr( 'checked', 'checked' );
1094 - else
 1094+ updateWidget( 'external' );
 1095+ } else {
10951096 $j( '#wikieditor-toolbar-link-type-int' ).attr( 'checked', 'checked' );
1096 -
 1097+ updateExistence();
 1098+ }
10971099 if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) )
10981100 if ( $j( '#wikieditor-toolbar-link-int-target' ).val() ==
10991101 $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) {
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -42,9 +42,8 @@
4343 $j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').click(function(){if($j('#wikieditor-toolbar-link-type-ext').is(':checked'))
4444 updateWidget('external');if($j('#wikieditor-toolbar-link-type-int').is(':checked'))
4545 updateExistence();});var u=mw.usability;$j(this).find('[rel]').each(function(){$j(this).text(u.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',u.getMsg('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=u.getMsg($j(this).attr('id')+'-tooltip');if($j(this).val()=='')
46 -$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}).focus(function(){if($j(this).val()==$j(this).data('tooltip')){$j(this).val('').removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('change',function(){if($j(this).val()!=$j(this).data('tooltip')){$j(this).removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('blur',function(){if($j(this).val()==''){$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val()))
47 -$j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else
48 -$j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched'))
 46+$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}).focus(function(){if($j(this).val()==$j(this).data('tooltip')){$j(this).val('').removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('change',function(){if($j(this).val()!=$j(this).data('tooltip')){$j(this).removeClass('wikieditor-toolbar-dialog-hint').data('tooltip-mode',false);}}).bind('blur',function(){if($j(this).val()==''){$j(this).addClass('wikieditor-toolbar-dialog-hint').val($j(this).data('tooltip')).data('tooltip-mode',true);}});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val())){$j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');updateWidget('external');}else{$j('#wikieditor-toolbar-link-type-int').attr('checked','checked');updateExistence();}
 47+if($j('#wikieditor-toolbar-link-int-text').data('untouched'))
4948 if($j('#wikieditor-toolbar-link-int-target').val()==$j('#wikieditor-toolbar-link-int-target').data('tooltip')){$j('#wikieditor-toolbar-link-int-text').addClass('wikieditor-toolbar-dialog-hint').val($j('#wikieditor-toolbar-link-int-text').data('tooltip')).change();}else{$j('#wikieditor-toolbar-link-int-text').val($j('#wikieditor-toolbar-link-int-target').val()).change();}},0);});$j('#wikieditor-toolbar-link-int-text').bind('change keydown paste cut',function(){var oldVal=$j(this).val();var that=this;setTimeout(function(){if($j(that).val()!=oldVal)
5049 $j(that).data('untouched',false);},0);});var existsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-exists');var notexistsMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-notexists');var invalidMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-invalid');var externalMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-external');var loadingMsg=u.getMsg('wikieditor-toolbar-tool-link-int-target-status-loading');$j('#wikieditor-toolbar-link-int-target-status').append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-exists').append(existsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-notexists').append(notexistsMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-invalid').append(invalidMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-external').append(externalMsg)).append($j('<div />').attr('id','wikieditor-toolbar-link-int-target-status-loading').append($j('<img />').attr({'src':$j.wikiEditor.imgPath+'dialogs/'+'loading.gif','alt':loadingMsg,'title':loadingMsg}))).data('existencecache',{}).children().hide();$j('#wikieditor-toolbar-link-int-target').bind('keyup paste cut',function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
5150 var timerID=setTimeout(updateExistence,120);$j(this).data('timerID',timerID);}).change(function(){if(typeof $j(this).data('timerID')!='undefined'){clearTimeout($j(this).data('timerID'));}
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1039,11 +1039,13 @@
10401040 // $j(this).val() is the old value, before the keypress
10411041 // Defer this until $j(this).val() has been updated
10421042 setTimeout( function() {
1043 - if ( isExternalLink( $j( '#wikieditor-toolbar-link-int-target' ).val() ) )
 1043+ if ( isExternalLink( $j( '#wikieditor-toolbar-link-int-target' ).val() ) ) {
10441044 $j( '#wikieditor-toolbar-link-type-ext' ).attr( 'checked', 'checked' );
1045 - else
 1045+ updateWidget( 'external' );
 1046+ } else {
10461047 $j( '#wikieditor-toolbar-link-type-int' ).attr( 'checked', 'checked' );
1047 -
 1048+ updateExistence();
 1049+ }
10481050 if ( $j( '#wikieditor-toolbar-link-int-text' ).data( 'untouched' ) )
10491051 if ( $j( '#wikieditor-toolbar-link-int-target' ).val() ==
10501052 $j( '#wikieditor-toolbar-link-int-target' ).data( 'tooltip' ) ) {

Status & tagging log