r55247 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55246‎ | r55247 | r55248 >
Date:17:57, 18 August 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Changes the heading drop down to a custom HTML rendered version. This seems to make IE 6 very unhappy in RTL mode - and barring making the menu a fixed width like we did in the Vector skin, there doesn't seem to be a way to get the menu to align properly. Also in IE6, the clicking on the menu to show the popup seems to make IE forget the text position and all inserts are made at the begining... AKA - IE6 is wasting our development time.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/css/combined.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/combined.min.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/wikiEditor.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.css
@@ -16,10 +16,6 @@
1717 width: 100%;
1818 margin: -1px;
1919 }
20 -/* This class is used by jQuery UI*/
21 -.ui-widget {
22 - font-size: 13px !important;
23 -}
2420 .wikiEditor-ui .wikiEditor-ui-text > textarea#wpTextbox1 {
2521 margin: 0;
2622 }
@@ -35,7 +31,6 @@
3632 float: right;
3733 }
3834 .wikiEditor-ui .wikiEditor-ui-bottom {
39 - position: relative;
4035 border: solid silver 1px;
4136 border-top-width: 0;
4237 width: 100%;
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.toolbar.css
@@ -166,17 +166,83 @@
167167 body.rtl .wikiEditor-ui-toolbar .group > img.tool {
168168 float: right;
169169 }
170 -.wikiEditor-ui-toolbar .group select {
 170+.wikiEditor-ui-toolbar .group .tool-select {
171171 float: left;
172172 margin: 2px;
173173 height: 22px;
174174 cursor: pointer;
 175+ border: solid 1px silver;
 176+ padding: 0;
 177+ margin-right: 0;
 178+ cursor: pointer;
 179+ background-color: #ffffff;
175180 }
176181 /* IGNORED BY IE6 */
177 -body.rtl .wikiEditor-ui-toolbar .group > select {
 182+body.rtl .wikiEditor-ui-toolbar .group > .tool-select {
178183 float: right;
179 - font-size: 0.9em;
180184 }
 185+.wikiEditor-ui-toolbar .group .tool-select .label {
 186+ background-image: url(../images/wikiEditor/toolbar/arrow-down.png);
 187+ background-position: center right;
 188+ background-repeat: no-repeat;
 189+ padding: 0;
 190+ margin: 0;
 191+ padding-left: 4px;
 192+ padding-right: 22px;
 193+ margin-right: 4px;
 194+ cursor: pointer;
 195+}
 196+body.rtl .wikiEditor-ui-toolbar .group .tool-select .label {
 197+ background-position: center left;
 198+ padding-right: 4px;
 199+ padding-left: 22px;
 200+ margin-left: 4px;
 201+ margin-right: 0;
 202+}
 203+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu {
 204+ clear: both;
 205+}
 206+.wikiEditor-ui-toolbar .group .tool-select .menu .options {
 207+ position: absolute;
 208+ display: none;
 209+ margin-left: -1px;
 210+ border: solid 1px silver;
 211+ background-color: #ffffff;
 212+}
 213+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu {
 214+ margin-left: -1px;
 215+ margin-right: -1px;
 216+}
 217+/* IGNORED BY IE6 */
 218+.wikiEditor-ui-toolbar .group .tool-select .options {
 219+ margin-top: 22px;
 220+}
 221+.wikiEditor-ui-toolbar .group .tool-select .options .option {
 222+ display: block;
 223+ padding: 0.5em;
 224+ text-decoration: none;
 225+ color: black;
 226+ whitespace: nowrap;
 227+}
 228+.wikiEditor-ui-toolbar .group .tool-select .options .option:hover {
 229+ background-color: #f3f3f3;
 230+}
 231+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2] {
 232+ font-size: 150%;
 233+ font-weight: normal;
 234+}
 235+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-3] {
 236+ font-size: 132%;
 237+ font-weight: normal;
 238+}
 239+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-4] {
 240+ font-size: 116%;
 241+ font-weight: normal;
 242+}
 243+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-5] {
 244+ font-size: 100%;
 245+ font-weight: bold;
 246+}
181247 /* Booklet */
182248 .wikiEditor-ui-toolbar .booklet .index {
183249 float: left;
Index: trunk/extensions/UsabilityInitiative/css/combined.css
@@ -16,10 +16,6 @@
1717 width: 100%;
1818 margin: -1px;
1919 }
20 -/* This class is used by jQuery UI*/
21 -.ui-widget {
22 - font-size: 13px !important;
23 -}
2420 .wikiEditor-ui .wikiEditor-ui-text > textarea#wpTextbox1 {
2521 margin: 0;
2622 }
@@ -35,7 +31,6 @@
3632 float: right;
3733 }
3834 .wikiEditor-ui .wikiEditor-ui-bottom {
39 - position: relative;
4035 border: solid silver 1px;
4136 border-top-width: 0;
4237 width: 100%;
@@ -257,17 +252,83 @@
258253 body.rtl .wikiEditor-ui-toolbar .group > img.tool {
259254 float: right;
260255 }
261 -.wikiEditor-ui-toolbar .group select {
 256+.wikiEditor-ui-toolbar .group .tool-select {
262257 float: left;
263258 margin: 2px;
264259 height: 22px;
265260 cursor: pointer;
 261+ border: solid 1px silver;
 262+ padding: 0;
 263+ margin-right: 0;
 264+ cursor: pointer;
 265+ background-color: #ffffff;
266266 }
267267 /* IGNORED BY IE6 */
268 -body.rtl .wikiEditor-ui-toolbar .group > select {
 268+body.rtl .wikiEditor-ui-toolbar .group > .tool-select {
269269 float: right;
270 - font-size: 0.9em;
271270 }
 271+.wikiEditor-ui-toolbar .group .tool-select .label {
 272+ background-image: url(../images/wikiEditor/toolbar/arrow-down.png);
 273+ background-position: center right;
 274+ background-repeat: no-repeat;
 275+ padding: 0;
 276+ margin: 0;
 277+ padding-left: 4px;
 278+ padding-right: 22px;
 279+ margin-right: 4px;
 280+ cursor: pointer;
 281+}
 282+body.rtl .wikiEditor-ui-toolbar .group .tool-select .label {
 283+ background-position: center left;
 284+ padding-right: 4px;
 285+ padding-left: 22px;
 286+ margin-left: 4px;
 287+ margin-right: 0;
 288+}
 289+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu {
 290+ clear: both;
 291+}
 292+.wikiEditor-ui-toolbar .group .tool-select .menu .options {
 293+ position: absolute;
 294+ display: none;
 295+ margin-left: -1px;
 296+ border: solid 1px silver;
 297+ background-color: #ffffff;
 298+}
 299+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu {
 300+ margin-left: -1px;
 301+ margin-right: -1px;
 302+}
 303+/* IGNORED BY IE6 */
 304+.wikiEditor-ui-toolbar .group .tool-select .options {
 305+ margin-top: 22px;
 306+}
 307+.wikiEditor-ui-toolbar .group .tool-select .options .option {
 308+ display: block;
 309+ padding: 0.5em;
 310+ text-decoration: none;
 311+ color: black;
 312+ whitespace: nowrap;
 313+}
 314+.wikiEditor-ui-toolbar .group .tool-select .options .option:hover {
 315+ background-color: #f3f3f3;
 316+}
 317+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2] {
 318+ font-size: 150%;
 319+ font-weight: normal;
 320+}
 321+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-3] {
 322+ font-size: 132%;
 323+ font-weight: normal;
 324+}
 325+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-4] {
 326+ font-size: 116%;
 327+ font-weight: normal;
 328+}
 329+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-5] {
 330+ font-size: 100%;
 331+ font-weight: bold;
 332+}
272333 /* Booklet */
273334 .wikiEditor-ui-toolbar .booklet .index {
274335 float: left;
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css
@@ -11,9 +11,6 @@
1212 width:100%;
1313 margin:-1px;
1414 }
15 -.ui-widget{
16 -font-size:13px !important;
17 -}
1815 .wikiEditor-ui .wikiEditor-ui-text > textarea#wpTextbox1{
1916 margin:0;
2017 }
@@ -29,7 +26,6 @@
3027 float:right;
3128 }
3229 .wikiEditor-ui .wikiEditor-ui-bottom{
33 -position:relative;
3430 border:solid silver 1px;
3531 border-top-width:0;
3632 width:100%;
@@ -235,16 +231,81 @@
236232 body.rtl .wikiEditor-ui-toolbar .group > img.tool{
237233 float:right;
238234 }
239 -.wikiEditor-ui-toolbar .group select{
 235+.wikiEditor-ui-toolbar .group .tool-select{
240236 float:left;
241237 margin:2px;
242238 height:22px;
243239 cursor:pointer;
 240+border:solid 1px silver;
 241+padding:0;
 242+margin-right:0;
 243+cursor:pointer;
 244+background-color:#ffffff;
244245 }
245 -body.rtl .wikiEditor-ui-toolbar .group > select{
 246+body.rtl .wikiEditor-ui-toolbar .group > .tool-select{
246247 float:right;
247 -font-size:0.9em;
248248 }
 249+.wikiEditor-ui-toolbar .group .tool-select .label{
 250+background-image:url(../images/wikiEditor/toolbar/arrow-down.png);
 251+background-position:center right;
 252+background-repeat:no-repeat;
 253+padding:0;
 254+margin:0;
 255+padding-left:4px;
 256+padding-right:22px;
 257+margin-right:4px;
 258+cursor:pointer;
 259+}
 260+body.rtl .wikiEditor-ui-toolbar .group .tool-select .label{
 261+background-position:center left;
 262+padding-right:4px;
 263+padding-left:22px;
 264+margin-left:4px;
 265+margin-right:0;
 266+}
 267+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu{
 268+clear:both;
 269+}
 270+.wikiEditor-ui-toolbar .group .tool-select .menu .options{
 271+position:absolute;
 272+display:none;
 273+margin-left:-1px;
 274+border:solid 1px silver;
 275+background-color:#ffffff;
 276+}
 277+body.rtl .wikiEditor-ui-toolbar .group .tool-select .menu{
 278+margin-left:-1px;
 279+margin-right:-1px;
 280+}
 281+.wikiEditor-ui-toolbar .group .tool-select .options {
 282+margin-top:22px;
 283+}
 284+.wikiEditor-ui-toolbar .group .tool-select .options .option{
 285+display:block;
 286+padding:0.5em;
 287+text-decoration:none;
 288+color:black;
 289+whitespace:nowrap;
 290+}
 291+.wikiEditor-ui-toolbar .group .tool-select .options .option:hover{
 292+background-color:#f3f3f3;
 293+}
 294+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-2]{
 295+font-size:150%;
 296+font-weight:normal;
 297+}
 298+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-3]{
 299+font-size:132%;
 300+font-weight:normal;
 301+}
 302+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-4]{
 303+font-size:116%;
 304+font-weight:normal;
 305+}
 306+.wikiEditor-ui-toolbar .group .tool-select .options .option[rel=heading-5]{
 307+font-size:100%;
 308+font-weight:bold;
 309+}
249310 .wikiEditor-ui-toolbar .booklet .index{
250311 float:left;
251312 width:20%;
@@ -335,4 +396,4 @@
336397 background-color:white;
337398 text-decoration:none;
338399 border-color:#a8d7f9;
339 -}
\ No newline at end of file
 400+}
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toolbar.js
@@ -277,7 +277,7 @@
278278 'alt' : label,
279279 'title' : label,
280280 'rel' : id,
281 - 'class' : 'tool tool-' + id
 281+ 'class' : 'tool tool-button'
282282 } );
283283 if ( 'action' in tool ) {
284284 $button
@@ -292,32 +292,33 @@
293293 }
294294 return $button;
295295 case 'select':
296 - var $select = $( '<select />' ).attr( { 'rel' : id, 'class' : 'tool tool-' + id } );
297 - $select.append( $( '<option />' ).text( label ) )
 296+ var $select = $( '<div />' )
 297+ .attr( { 'rel' : id, 'class' : 'tool tool-select' } )
 298+ .click( function() {
 299+ var $options = $(this).find( '.options' );
 300+ $options.animate( { 'opacity': 'toggle' }, 'fast' );
 301+ } );
 302+ $options = $( '<div />' ).addClass( 'options' );
298303 if ( 'list' in tool ) {
299 - $select
300 - .data( 'list', tool.list )
301 - .data( 'context', context )
302 - .click( function() {
303 - var list = $(this).data( 'list' );
304 - var val = $(this).val();
305 - if ( val in list && 'action' in list[val] ) {
306 - $.wikiEditor.modules.toolbar.fn.doAction(
307 - $(this).data( 'context' ), list[val].action
308 - );
309 - }
310 - $(this)
311 - .find( ":selected" )
312 - .attr( 'selected', false )
313 - .find( ":first" )
314 - .attr( 'selected', true );
315 - return false;
316 - } );
317304 for ( option in tool.list ) {
318305 var optionLabel = $.wikiEditor.modules.toolbar.fn.autoMsg( tool.list[option], 'label' );
319 - $select.append( $( '<option />' ).text( optionLabel ).attr( 'value', option ) );
 306+ $options.append(
 307+ $( '<a />' )
 308+ .data( 'action', tool.list[option].action )
 309+ .data( 'context', context )
 310+ .click( function() {
 311+ $.wikiEditor.modules.toolbar.fn.doAction(
 312+ $(this).data( 'context' ), $(this).data( 'action' )
 313+ );
 314+ } )
 315+ .text( optionLabel )
 316+ .addClass( 'option' )
 317+ .attr( 'rel', option )
 318+ );
320319 }
321320 }
 321+ $select.append( $( '<div />' ).addClass( 'menu' ).append( $options ) );
 322+ $select.append( $( '<div />' ).addClass( 'label' ).text( label ) );
322323 return $select;
323324 default:
324325 return null;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1634,7 +1634,7 @@
16351635 'alt' : label,
16361636 'title' : label,
16371637 'rel' : id,
1638 - 'class' : 'tool tool-' + id
 1638+ 'class' : 'tool tool-button'
16391639 } );
16401640 if ( 'action' in tool ) {
16411641 $button
@@ -1649,32 +1649,33 @@
16501650 }
16511651 return $button;
16521652 case 'select':
1653 - var $select = $( '<select />' ).attr( { 'rel' : id, 'class' : 'tool tool-' + id } );
1654 - $select.append( $( '<option />' ).text( label ) )
 1653+ var $select = $( '<div />' )
 1654+ .attr( { 'rel' : id, 'class' : 'tool tool-select' } )
 1655+ .click( function() {
 1656+ var $options = $(this).find( '.options' );
 1657+ $options.animate( { 'opacity': 'toggle' }, 'fast' );
 1658+ } );
 1659+ $options = $( '<div />' ).addClass( 'options' );
16551660 if ( 'list' in tool ) {
1656 - $select
1657 - .data( 'list', tool.list )
1658 - .data( 'context', context )
1659 - .click( function() {
1660 - var list = $(this).data( 'list' );
1661 - var val = $(this).val();
1662 - if ( val in list && 'action' in list[val] ) {
1663 - $.wikiEditor.modules.toolbar.fn.doAction(
1664 - $(this).data( 'context' ), list[val].action
1665 - );
1666 - }
1667 - $(this)
1668 - .find( ":selected" )
1669 - .attr( 'selected', false )
1670 - .find( ":first" )
1671 - .attr( 'selected', true );
1672 - return false;
1673 - } );
16741661 for ( option in tool.list ) {
16751662 var optionLabel = $.wikiEditor.modules.toolbar.fn.autoMsg( tool.list[option], 'label' );
1676 - $select.append( $( '<option />' ).text( optionLabel ).attr( 'value', option ) );
 1663+ $options.append(
 1664+ $( '<a />' )
 1665+ .data( 'action', tool.list[option].action )
 1666+ .data( 'context', context )
 1667+ .click( function() {
 1668+ $.wikiEditor.modules.toolbar.fn.doAction(
 1669+ $(this).data( 'context' ), $(this).data( 'action' )
 1670+ );
 1671+ } )
 1672+ .text( optionLabel )
 1673+ .addClass( 'option' )
 1674+ .attr( 'rel', option )
 1675+ );
16771676 }
16781677 }
 1678+ $select.append( $( '<div />' ).addClass( 'menu' ).append( $options ) );
 1679+ $select.append( $( '<div />' ).addClass( 'label' ).text( label ) );
16791680 return $select;
16801681 default:
16811682 return null;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -152,11 +152,9 @@
153153 if('tools'in group){for(tool in group.tools){$group.append($.wikiEditor.modules.toolbar.fn.buildTool(context,tool,group.tools[tool]));}}
154154 return $group;},buildTool:function(context,id,tool){if('filters'in tool){for(filter in tool.filters){if($(tool.filters[filter]).size()==0){return null;}}}
155155 var label=$.wikiEditor.modules.toolbar.fn.autoMsg(tool,'label');switch(tool.type){case'button':var src=tool.icon;if(src.indexOf('http://')!==0&&src.indexOf('https://')!==0){src=$.wikiEditor.modules.toolbar.imgPath+src;}
156 -$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-'+id});if('action'in tool){$button.data('action',tool.action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'));return false;});}
157 -return $button;case'select':var $select=$('<select />').attr({'rel':id,'class':'tool tool-'+id});$select.append($('<option />').text(label))
158 -if('list'in tool){$select.data('list',tool.list).data('context',context).click(function(){var list=$(this).data('list');var val=$(this).val();if(val in list&&'action'in list[val]){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),list[val].action);}
159 -$(this).find(":selected").attr('selected',false).find(":first").attr('selected',true);return false;});for(option in tool.list){var optionLabel=$.wikiEditor.modules.toolbar.fn.autoMsg(tool.list[option],'label');$select.append($('<option />').text(optionLabel).attr('value',option));}}
160 -return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.modules.toolbar.fn.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).click(function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');$.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));});},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)}
 156+$button=$('<img />').attr({'src':src,'width':22,'height':22,'alt':label,'title':label,'rel':id,'class':'tool tool-button'});if('action'in tool){$button.data('action',tool.action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'));return false;});}
 157+return $button;case'select':var $select=$('<div />').attr({'rel':id,'class':'tool tool-select'}).click(function(){var $options=$(this).find('.options');$options.animate({'opacity':'toggle'},'fast');});$options=$('<div />').addClass('options');if('list'in tool){for(option in tool.list){var optionLabel=$.wikiEditor.modules.toolbar.fn.autoMsg(tool.list[option],'label');$options.append($('<a />').data('action',tool.list[option].action).data('context',context).click(function(){$.wikiEditor.modules.toolbar.fn.doAction($(this).data('context'),$(this).data('action'));}).text(optionLabel).addClass('option').attr('rel',option));}}
 158+$select.append($('<div />').addClass('menu').append($options));$select.append($('<div />').addClass('label').text(label));return $select;default:return null;}},buildBookmark:function(context,id,page){var label=$.wikiEditor.modules.toolbar.fn.autoMsg(page,'label');return $('<div />').text(label).attr('rel',id).data('context',context).click(function(){$(this).parent().parent().find('.page').hide();$(this).parent().parent().find('.page-'+$(this).attr('rel')).show();$(this).siblings().removeClass('current');$(this).addClass('current');var section=$(this).parent().parent().attr('rel');$.cookie('wikiEditor-'+$(this).data('context').instance+'-booklet-'+section+'-page',$(this).attr('rel'));});},buildPage:function(context,id,page){var $page=$('<div />').attr({'class':'page page-'+id,'rel':id});switch(page.layout){case'table':$page.addClass('page-table');var html='<table cellpadding=0 cellspacing=0 '+'border=0 width="100%" class="table table-"'+id+'">';if('headings'in page){html+=$.wikiEditor.modules.toolbar.fn.buildHeading(context,page.headings)}
161159 if('rows'in page){for(row in page.rows){html+=$.wikiEditor.modules.toolbar.fn.buildRow(context,page.rows[row])}}
162160 $page.html(html);break;case'characters':$page.addClass('page-characters');$characters=$('<div />').data('context',context).data('actions',{});var actions=$characters.data('actions');if('language'in page){$characters.attr('lang',page.language);}
163161 if('direction'in page){$characters.attr('dir',page.direction);}

Follow-up revisions

RevisionCommit summaryAuthorDate
r55257wmf-deployment: Merge r55247 and r55251 to fix bug 20221 (Edit box loses chan...catrope18:56, 18 August 2009

Status & tagging log