r61448 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61447‎ | r61448 | r61449 >
Date:23:49, 23 January 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: Remove the tooltip <label>s that weren't used anymore. In certain obscure cases they became visible, duplicating the tooltips above the textboxes
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
@@ -35,7 +35,7 @@
3636 array(
3737 'src' => 'Modules/Toolbar/Toolbar.js',
3838 'class' => 'wikiEditor.config.toolbar',
39 - 'version' => 26
 39+ 'version' => 27
4040 ),
4141 array(
4242 'src' => 'Modules/TemplateEditor/TemplateEditor.js',
@@ -44,10 +44,10 @@
4545 ),
4646 ),
4747 'combined' => array(
48 - array( 'src' => 'WikiEditor.combined.js', 'version' => 28 ),
 48+ array( 'src' => 'WikiEditor.combined.js', 'version' => 29 ),
4949 ),
5050 'minified' => array(
51 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 28 ),
 51+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 29 ),
5252 ),
5353 );
5454 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1106,12 +1106,10 @@
11071107 <div class="wikieditor-toolbar-field-wrapper">\
11081108 <label for="wikieditor-toolbar-link-int-target" rel="wikieditor-toolbar-tool-link-int-target"></label>\
11091109 <div id="wikieditor-toolbar-link-int-target-status" style="display: inline; float:right;"></div>\
1110 - <label rel="wikieditor-toolbar-tool-link-int-target-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
11111110 <input type="text" id="wikieditor-toolbar-link-int-target" style="width: 100%;" />\
11121111 </div>\
11131112 <div class="wikieditor-toolbar-field-wrapper">\
11141113 <label for="wikieditor-toolbar-link-int-text" rel="wikieditor-toolbar-tool-link-int-text"></label>\
1115 - <label rel="wikieditor-toolbar-tool-link-int-text-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
11161114 <input type="text" id="wikieditor-toolbar-link-int-text" style="width: 100%;" />\
11171115 </div>\
11181116 <div class="wikieditor-toolbar-field-wrapper">\
@@ -1225,24 +1223,27 @@
12261224 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
12271225 });
12281226 // Setup the tooltips in the textboxes
 1227+ $j( '#wikieditor-toolbar-link-int-target' )
 1228+ .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
 1229+ $j( '#wikieditor-toolbar-link-int-text' )
 1230+ .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
12291231 $j( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' )
12301232 .each( function() {
 1233+ var tooltip = gM( $j( this ).attr( 'id' ) + '-tooltip' );
12311234 if ( $j( this ).val() == '' )
12321235 $j( this )
1233 - .val( $j( this ).prev( 'label' ).text() )
1234 - .addClass( 'wikieditor-toolbar-dialog-hint' )
1235 - .prev( 'label' )
1236 - .css( 'display', 'none' );
 1236+ .val( $j( this ).data( 'tooltip' ) )
 1237+ .addClass( 'wikieditor-toolbar-dialog-hint' );
12371238 } )
12381239 .focus( function() {
12391240 $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
1240 - if( $j( this ).val() == $j( this ).prev( 'label' ).text() )
 1241+ if( $j( this ).val() == $j( this ).data( 'tooltip' ) )
12411242 $j( this ).val( '' );
12421243 })
12431244 .bind( 'blur change', function() {
12441245 if ( $j( this ).val() == '' )
12451246 $j( this )
1246 - .val( $j( this ).prev( 'label' ).text() )
 1247+ .val( $j( this ).data( 'tooltip' ) )
12471248 .addClass( 'wikieditor-toolbar-dialog-hint' );
12481249 else
12491250 $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -10,12 +10,10 @@
1111 <div class="wikieditor-toolbar-field-wrapper">\
1212 <label for="wikieditor-toolbar-link-int-target" rel="wikieditor-toolbar-tool-link-int-target"></label>\
1313 <div id="wikieditor-toolbar-link-int-target-status" style="display: inline; float:right;"></div>\
14 - <label rel="wikieditor-toolbar-tool-link-int-target-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
1514 <input type="text" id="wikieditor-toolbar-link-int-target" style="width: 100%;" />\
1615 </div>\
1716 <div class="wikieditor-toolbar-field-wrapper">\
1817 <label for="wikieditor-toolbar-link-int-text" rel="wikieditor-toolbar-tool-link-int-text"></label>\
19 - <label rel="wikieditor-toolbar-tool-link-int-text-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
2018 <input type="text" id="wikieditor-toolbar-link-int-text" style="width: 100%;" />\
2119 </div>\
2220 <div class="wikieditor-toolbar-field-wrapper">\
@@ -40,10 +38,10 @@
4139 status='notexists';else if(typeof page.invalid!='undefined')
4240 status='invalid';}
4341 cache[target]=status;updateWidget(status);}}));}
44 -$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){if($j(this).val()=='')
45 -$j(this).val($j(this).prev('label').text()).addClass('wikieditor-toolbar-dialog-hint').prev('label').css('display','none');}).focus(function(){$j(this).removeClass('wikieditor-toolbar-dialog-hint');if($j(this).val()==$j(this).prev('label').text())
 42+$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j('#wikieditor-toolbar-link-int-target').data('tooltip',gM('wikieditor-toolbar-tool-link-int-target-tooltip'));$j('#wikieditor-toolbar-link-int-text').data('tooltip',gM('wikieditor-toolbar-tool-link-int-text-tooltip'));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').each(function(){var tooltip=gM($j(this).attr('id')+'-tooltip');if($j(this).val()=='')
 43+$j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');}).focus(function(){$j(this).removeClass('wikieditor-toolbar-dialog-hint');if($j(this).val()==$j(this).data('tooltip'))
4644 $j(this).val('');}).bind('blur change',function(){if($j(this).val()=='')
47 -$j(this).val($j(this).prev('label').text()).addClass('wikieditor-toolbar-dialog-hint');else
 45+$j(this).val($j(this).data('tooltip')).addClass('wikieditor-toolbar-dialog-hint');else
4846 $j(this).removeClass('wikieditor-toolbar-dialog-hint');});$j('#wikieditor-toolbar-link-int-target').bind('change keydown paste cut',function(){setTimeout(function(){if(isExternalLink($j('#wikieditor-toolbar-link-int-target').val()))
4947 $j('#wikieditor-toolbar-link-type-ext').attr('checked','checked');else
5048 $j('#wikieditor-toolbar-link-type-int').attr('checked','checked');if($j('#wikieditor-toolbar-link-int-text').data('untouched'))
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1025,12 +1025,10 @@
10261026 <div class="wikieditor-toolbar-field-wrapper">\
10271027 <label for="wikieditor-toolbar-link-int-target" rel="wikieditor-toolbar-tool-link-int-target"></label>\
10281028 <div id="wikieditor-toolbar-link-int-target-status" style="display: inline; float:right;"></div>\
1029 - <label rel="wikieditor-toolbar-tool-link-int-target-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
10301029 <input type="text" id="wikieditor-toolbar-link-int-target" style="width: 100%;" />\
10311030 </div>\
10321031 <div class="wikieditor-toolbar-field-wrapper">\
10331032 <label for="wikieditor-toolbar-link-int-text" rel="wikieditor-toolbar-tool-link-int-text"></label>\
1034 - <label rel="wikieditor-toolbar-tool-link-int-text-tooltip" class="wikieditor-toolbar-tool-tooltip"></label>\
10351033 <input type="text" id="wikieditor-toolbar-link-int-text" style="width: 100%;" />\
10361034 </div>\
10371035 <div class="wikieditor-toolbar-field-wrapper">\
@@ -1144,24 +1142,27 @@
11451143 $j(this).text( gM( $j(this).attr( 'rel' ) ) );
11461144 });
11471145 // Setup the tooltips in the textboxes
 1146+ $j( '#wikieditor-toolbar-link-int-target' )
 1147+ .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-target-tooltip' ) );
 1148+ $j( '#wikieditor-toolbar-link-int-text' )
 1149+ .data( 'tooltip', gM( 'wikieditor-toolbar-tool-link-int-text-tooltip' ) );
11481150 $j( '#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text' )
11491151 .each( function() {
 1152+ var tooltip = gM( $j( this ).attr( 'id' ) + '-tooltip' );
11501153 if ( $j( this ).val() == '' )
11511154 $j( this )
1152 - .val( $j( this ).prev( 'label' ).text() )
1153 - .addClass( 'wikieditor-toolbar-dialog-hint' )
1154 - .prev( 'label' )
1155 - .css( 'display', 'none' );
 1155+ .val( $j( this ).data( 'tooltip' ) )
 1156+ .addClass( 'wikieditor-toolbar-dialog-hint' );
11561157 } )
11571158 .focus( function() {
11581159 $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );
1159 - if( $j( this ).val() == $j( this ).prev( 'label' ).text() )
 1160+ if( $j( this ).val() == $j( this ).data( 'tooltip' ) )
11601161 $j( this ).val( '' );
11611162 })
11621163 .bind( 'blur change', function() {
11631164 if ( $j( this ).val() == '' )
11641165 $j( this )
1165 - .val( $j( this ).prev( 'label' ).text() )
 1166+ .val( $j( this ).data( 'tooltip' ) )
11661167 .addClass( 'wikieditor-toolbar-dialog-hint' );
11671168 else
11681169 $j( this ).removeClass( 'wikieditor-toolbar-dialog-hint' );

Status & tagging log