r93638 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93637‎ | r93638 | r93639 >
Date:19:19, 1 August 2011
Author:inez
Status:deferred
Tags:
Comment:
Use native <ul> and <ol> lists instead of mimicing them with <div>s. This change is especially useful for numbered lists, since now we don't have to handle localization on our own - browser does it for us.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.Container.js (modified) (history)
  • /trunk/parsers/wikidom/lib/es/es.ListBlockItem.js (modified) (history)
  • /trunk/parsers/wikidom/lib/es/es.ListBlockList.js (modified) (history)
  • /trunk/parsers/wikidom/lib/es/es.Surface.css (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.Surface.css
@@ -30,6 +30,7 @@
3131 position: relative;
3232 }
3333
 34+/*
3435 .editSurface-list {
3536 padding-left: 1em;
3637 }
@@ -40,6 +41,7 @@
4142 background-position: left 0.5em;
4243 background-repeat: no-repeat;
4344 }
 45+*/
4446
4547 .editSurface-line,
4648 .editSurface-ruler {
Index: trunk/parsers/wikidom/lib/es/es.ListBlockItem.js
@@ -15,7 +15,7 @@
1616 */
1717 es.ListBlockItem = function( content, lists ) {
1818 es.EventEmitter.call( this );
19 - es.Container.call( this, 'item', 'lists', lists );
 19+ es.Container.call( this, 'item', 'lists', lists, 'li' );
2020 this.content = content || new es.Content();
2121 this.$line = $( '<div class="editSurface-list-line"></div>' );
2222 this.$content = $( '<div class="editSurface-list-content"></div>' );
@@ -122,7 +122,6 @@
123123 if ( position.top < itemOffset.top + this.$line.height() ) {
124124 position.top -= itemOffset.top;
125125 position.left -= itemOffset.left;
126 - position.left += this.$.parent().offset().left - itemOffset.left;
127126 return globalOffset + this.flow.getOffset( position );
128127 }
129128
Index: trunk/parsers/wikidom/lib/es/es.Container.js
@@ -10,7 +10,7 @@
1111 * @emits "update" when items argument causes items to be appended
1212 * @property $ {jQuery} Container element
1313 */
14 -es.Container = function( typeName, listName, items ) {
 14+es.Container = function( typeName, listName, items, tagName ) {
1515 es.EventEmitter.call( this );
1616 if ( typeof typeName !== 'string' ) {
1717 typeName = 'container';
@@ -18,10 +18,13 @@
1919 if ( typeof listName !== 'string' ) {
2020 listName = 'items';
2121 }
 22+ if ( typeof tagName !== 'string' ) {
 23+ tagName = 'div';
 24+ }
2225 this._typeName = typeName;
2326 this._listName = listName;
2427 this._list = this[listName] = [];
25 - this.$ = $( '<div></div>' )
 28+ this.$ = $( '<' + tagName + '/>' )
2629 .addClass( 'editSurface-' + typeName )
2730 .data( typeName, this );
2831 // Auto-append
Index: trunk/parsers/wikidom/lib/es/es.ListBlockList.js
@@ -12,8 +12,8 @@
1313 */
1414 es.ListBlockList = function( style, items ) {
1515 es.EventEmitter.call( this );
16 - es.Container.call( this, 'list', 'items', items );
1716 this.style = style || 'bullet';
 17+ es.Container.call( this, 'list', 'items', items, this.style == 'bullet' ? 'ul' : 'ol' );
1818 };
1919
2020 /* Static Methods */

Status & tagging log