r101661 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101660‎ | r101661 | r101662 >
Date:19:03, 2 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Changed CSS classes to match the names of JavaScript classes
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/es.Surface.css (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.ContentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.DocumentView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.HeadingView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.ListItemView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.ListView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.ParagraphView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.SurfaceView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.TableCellView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.TableRowView.js (modified) (history)
  • /trunk/parsers/wikidom/lib/hype/views/es.TableView.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/es.Surface.css
@@ -1,4 +1,8 @@
2 -.editSurface-input {
 2+.editSurface {
 3+ overflow: hidden;
 4+}
 5+
 6+.editSurface-surfaceView-input {
37 position: absolute;
48 z-index: -1;
59 opacity: 0;
@@ -10,29 +14,34 @@
1115 width: 1px;
1216 }
1317
14 -.editSurface-input:focus {
 18+.editSurface-surfaceView-input:focus {
1519 outline: none;
1620 }
1721
18 -.editSurface {
19 - overflow: hidden;
 22+.editSurface-surfaceView-cursor {
 23+ position: absolute;
 24+ background-color: black;
 25+ width: 1px;
 26+ height: 1.5em;
 27+ min-height: 1.5em;
 28+ display: none;
2029 }
2130
22 -.editSurface-document {
 31+.editSurface-documentView {
2332 cursor: text;
2433 margin-top: 1em;
2534 overflow: hidden;
2635 -webkit-user-select: none;
2736 }
2837
29 -.editSurface-content {
 38+.editSurface-contentView {
3039 position: relative;
3140 }
3241
33 -.editSurface-headingBlock,
34 -.editSurface-tableBlock,
35 -.editSurface-listBlock,
36 -.editSurface-paragraphBlock {
 42+.editSurface-headingView,
 43+.editSurface-tableView,
 44+.editSurface-listView,
 45+.editSurface-paragraphView {
3746 margin: 1em;
3847 margin-top: 0;
3948 position: relative;
@@ -40,61 +49,61 @@
4150 font-size: 1em;
4251 }
4352
44 -.editSurface-headingBlock-level1,
45 -.editSurface-headingBlock-level2 {
 53+.editSurface-headingView-level1,
 54+.editSurface-headingView-level2 {
4655 border-bottom: 1px solid #AAA;
4756 }
4857
49 -.editSurface-headingBlock-level1 > * {
 58+.editSurface-headingView-level1 > * {
5059 font-size:188%;
5160 font-weight: normal;
5261 }
5362
54 -.editSurface-headingBlock-level2 > * {
 63+.editSurface-headingView-level2 > * {
5564 font-size:150%;
5665 font-weight: normal;
5766 }
5867
59 -.editSurface-headingBlock-level3 > * {
 68+.editSurface-headingView-level3 > * {
6069 font-size:132%;
6170 font-weight: bold;
6271 }
6372
64 -.editSurface-headingBlock-level4 > * {
 73+.editSurface-headingView-level4 > * {
6574 font-size:116%;
6675 font-weight: bold;
6776 }
6877
69 -.editSurface-headingBlock-level5 > * {
 78+.editSurface-headingView-level5 > * {
7079 font-size:100%;
7180 font-weight: bold;
7281 }
7382
74 -.editSurface-headingBlock-level6 > * {
 83+.editSurface-headingView-level6 > * {
7584 font-size:80%;
7685 font-weight: bold;
7786 }
7887
79 -.editSurface-listItem {
 88+.editSurface-listItemView {
8089 position: relative;
8190 padding: 0 0 0 1em;
8291 background-position: left 0.6em;
8392 background-repeat: no-repeat;
8493 }
8594
86 -.editSurface-listItem-bullet {
 95+.editSurface-listItemView-bullet {
8796 background-image: url(images/bullet.png);
8897 }
8998
90 -.editSurface-listItem-number {
 99+.editSurface-listItemView-number {
91100 /* */
92101 }
93102
94 -.editSurface-listItem-bullet .editSurface-listItem-icon {
 103+.editSurface-listItemView-bullet .editSurface-listItemView-icon {
95104 display: none;
96105 }
97106
98 -.editSurface-listItem-number .editSurface-listItem-icon {
 107+.editSurface-listItemView-number .editSurface-listItemView-icon {
99108 position: absolute;
100109 right: 100%;
101110 margin-right: -0.5em;
@@ -102,43 +111,43 @@
103112 line-height: 1.5em;
104113 }
105114
106 -.editSurface-listItem-level0 {
 115+.editSurface-listItemView-level0 {
107116 margin-left: 0.5em;
108117 }
109118
110 -.editSurface-listItem-level1 {
 119+.editSurface-listItemView-level1 {
111120 margin-left: 2.5em;
112121 }
113122
114 -.editSurface-listItem-level2 {
 123+.editSurface-listItemView-level2 {
115124 margin-left: 4.5em;
116125 }
117126
118 -.editSurface-listItem-level3 {
 127+.editSurface-listItemView-level3 {
119128 margin-left: 6.5em;
120129 }
121130
122 -.editSurface-listItem-level4 {
 131+.editSurface-listItemView-level4 {
123132 margin-left: 8.5em;
124133 }
125134
126 -.editSurface-listItem-level5 {
 135+.editSurface-listItemView-level5 {
127136 margin-left: 10.5em;
128137 }
129138
130 -.editSurface-listItem-level6 {
 139+.editSurface-listItemView-level6 {
131140 margin-left: 12.5em;
132141 }
133142
134 -.editSurface-line,
135 -.editSurface-ruler {
 143+.editSurface-contentView-line,
 144+.editSurface-contentView-ruler {
136145 line-height: 1.5em;
137146 cursor: text;
138147 white-space: nowrap;
139148 color: #000000;
140149 }
141150
142 -.editSurface-ruler {
 151+.editSurface-contentView-ruler {
143152 position: absolute;
144153 top: 0;
145154 left: 0;
@@ -146,16 +155,16 @@
147156 z-index: -1000;
148157 }
149158
150 -.editSurface-line.empty {
 159+.editSurface-contentView-line.empty {
151160 display: block;
152161 width: 0px;
153162 }
154163
155 -.editSurface-whitespace {
 164+.editSurface-contentView-whitespace {
156165 color: #ffffff;
157166 }
158167
159 -.editSurface-range {
 168+.editSurface-contentView-range {
160169 display: none;
161170 position: absolute;
162171 background-color: #bbffcc;
@@ -163,16 +172,7 @@
164173 z-index: -1;
165174 }
166175
167 -.editSurface-cursor {
168 - position: absolute;
169 - background-color: black;
170 - width: 1px;
171 - height: 1.5em;
172 - min-height: 1.5em;
173 - display: none;
174 -}
175 -
176 -.editSurface-format-object {
 176+.editSurface-contentView-format-object {
177177 background-color: rgba(0,0,0,0.05);
178178 border-radius: 0.25em;
179179 margin: 1px 0 1px 1px;
@@ -180,43 +180,43 @@
181181 cursor: default;
182182 }
183183
184 -.editSurface-format-object * {
 184+.editSurface-contentView-format-object * {
185185 cursor: default !important;
186186 }
187187
188 -.editSurface-format-object a:link,
189 -.editSurface-format-object a:visited,
190 -.editSurface-format-object a:active {
 188+.editSurface-contentView-format-object a:link,
 189+.editSurface-contentView-format-object a:visited,
 190+.editSurface-contentView-format-object a:active {
191191 color: blue;
192192 }
193193
194 -.editSurface-format-italic {
 194+.editSurface-contentView-format-italic {
195195 font-style: italic;
196196 }
197197
198 -.editSurface-format-bold {
 198+.editSurface-contentView-format-bold {
199199 font-weight: bold;
200200 }
201201
202 -.editSurface-format-link {
 202+.editSurface-contentView-format-link {
203203 color: blue;
204204 text-decoration: underline;
205205 }
206206
207 -.editSurface-format-big {
 207+.editSurface-contentView-format-big {
208208 font-size: 1.2em;
209209 }
210210
211 -.editSurface-format-small,
212 -.editSurface-format-sub,
213 -.editSurface-format-super {
 211+.editSurface-contentView-format-small,
 212+.editSurface-contentView-format-sub,
 213+.editSurface-contentView-format-super {
214214 font-size: .8em;
215215 }
216216
217 -.editSurface-format-sub {
 217+.editSurface-contentView-format-sub {
218218 vertical-align: sub;
219219 }
220220
221 -.editSurface-format-super {
 221+.editSurface-contentView-format-super {
222222 vertical-align: super;
223223 }
Index: trunk/parsers/wikidom/lib/hype/views/es.ParagraphView.js
@@ -11,7 +11,7 @@
1212 es.DocumentViewLeafNode.call( this, model );
1313
1414 // DOM Changes
15 - this.$.addClass( 'editSurface-paragraphBlock' );
 15+ this.$.addClass( 'editSurface-paragraphView' );
1616 };
1717
1818 /* Inheritance */
Index: trunk/parsers/wikidom/lib/hype/views/es.TableCellView.js
@@ -11,7 +11,9 @@
1212 es.DocumentViewBranchNode.call( this, model, $( '<td>' ) );
1313
1414 // DOM Changes
15 - this.$.attr( 'style', model.getElementAttribute( 'html/style' ) );
 15+ this.$
 16+ .attr( 'style', model.getElementAttribute( 'html/style' ) )
 17+ .addClass( 'editSurface-tableCellView' );
1618 };
1719
1820 /* Inheritance */
Index: trunk/parsers/wikidom/lib/hype/views/es.TableView.js
@@ -13,7 +13,7 @@
1414 // DOM Changes
1515 this.$
1616 .attr( 'style', model.getElementAttribute( 'html/style' ) )
17 - .addClass( 'editSurface-tableBlock' );
 17+ .addClass( 'editSurface-tableView' );
1818 };
1919
2020 /* Inheritance */
Index: trunk/parsers/wikidom/lib/hype/views/es.SurfaceView.js
@@ -16,7 +16,7 @@
1717 this.$.append( this.documentView.$ );
1818
1919 this.cursor = {
20 - $: $( '<div class="editSurface-cursor"></div>' ).appendTo( this.$ ),
 20+ $: $( '<div class="editSurface-surfaceView-cursor"></div>' ).appendTo( this.$ ),
2121 interval: null,
2222 offset: null,
2323 initialLeft: null
@@ -46,7 +46,7 @@
4747 } );
4848
4949 // Hidden input
50 - this.$input = $( '<input class="editSurface-input" />' )
 50+ this.$input = $( '<input class="editSurface-surfaceView-input" />' )
5151 .prependTo( this.$ )
5252 .on( {
5353 'focus' : function() {
@@ -147,9 +147,13 @@
148148
149149 es.SurfaceView.prototype.moveCursor = function( instruction ) {
150150 if ( instruction === 'left') {
151 - this.showCursor( this.documentView.getModel().getRelativeContentOffset( this.cursor.offset, -1 ) );
 151+ this.showCursor(
 152+ this.documentView.getModel().getRelativeContentOffset( this.cursor.offset, -1 )
 153+ );
152154 } else if ( instruction === 'right' ) {
153 - this.showCursor( this.documentView.getModel().getRelativeContentOffset( this.cursor.offset, 1 ) );
 155+ this.showCursor(
 156+ this.documentView.getModel().getRelativeContentOffset( this.cursor.offset, 1 )
 157+ );
154158 } else if ( instruction === 'up' || instruction === 'down' ) {
155159 // ...
156160 } else if ( instruction === 'home' ) {
Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js
@@ -45,11 +45,12 @@
4646 } );
4747
4848 // DOM Changes
49 - this.$ranges = $( '<div class="editSurface-ranges"></div>' ).prependTo( this.$ );
50 - this.$rangeStart = $( '<div class="editSurface-range"></div>' ).appendTo( this.$ranges );
51 - this.$rangeFill = $( '<div class="editSurface-range"></div>' ).appendTo( this.$ranges );
52 - this.$rangeEnd = $( '<div class="editSurface-range"></div>' ).appendTo( this.$ranges );
53 -
 49+ this.$ranges = $( '<div class="editSurface-contentView-ranges"></div>' );
 50+ this.$rangeStart = $( '<div class="editSurface-contentView-range"></div>' );
 51+ this.$rangeFill = $( '<div class="editSurface-contentView-range"></div>' );
 52+ this.$rangeEnd = $( '<div class="editSurface-contentView-range"></div>' );
 53+ this.$.prepend( this.$ranges.append( this.$rangeStart, this.$rangeFill, this.$rangeEnd ) );
 54+
5455 // Initialization
5556 this.scanBoundaries();
5657 }
@@ -69,7 +70,7 @@
7071 es.ContentView.annotationRenderers = {
7172 'template': {
7273 'open': function( data ) {
73 - return '<span class="editSurface-format-object">' + data.html;
 74+ return '<span class="editSurface-contentView-format-object">' + data.html;
7475 },
7576 'close': '</span>',
7677 'float': function( data ) {
@@ -78,39 +79,41 @@
7980 }
8081 },
8182 'bold': {
82 - 'open': '<span class="editSurface-format-bold">',
 83+ 'open': '<span class="editSurface-contentView-format-bold">',
8384 'close': '</span>',
8485 'float': false
8586 },
8687 'italic': {
87 - 'open': '<span class="editSurface-format-italic">',
 88+ 'open': '<span class="editSurface-contentView-format-italic">',
8889 'close': '</span>',
8990 'float': false
9091 },
9192 'size': {
9293 'open': function( data ) {
93 - return '<span class="editSurface-format-' + data.type + '">';
 94+ return '<span class="editSurface-contentView-format-' + data.type + '">';
9495 },
9596 'close': '</span>',
9697 'float': false
9798 },
9899 'script': {
99100 'open': function( data ) {
100 - return '<span class="editSurface-format-' + data.type + '">';
 101+ return '<span class="editSurface-contentView-format-' + data.type + '">';
101102 },
102103 'close': '</span>',
103104 'float': false
104105 },
105106 'xlink': {
106107 'open': function( data ) {
107 - return '<span class="editSurface-format-link" data-href="' + data.href + '">';
 108+ return '<span class="editSurface-contentView-format-link" data-href="' + data.href +
 109+ '">';
108110 },
109111 'close': '</span>',
110112 'float': false
111113 },
112114 'ilink': {
113115 'open': function( data ) {
114 - return '<span class="editSurface-format-link" data-title="' + data.title + '">';
 116+ return '<span class="editSurface-contentView-format-link" data-title="' + data.title +
 117+ '">';
115118 },
116119 'close': '</span>',
117120 'float': false
@@ -129,8 +132,8 @@
130133 '>': '&gt;',
131134 '\'': '&#039;',
132135 '"': '&quot;',
133 - '\n': '<span class="editSurface-whitespace">&#182;</span>',
134 - '\t': '<span class="editSurface-whitespace">&#8702;</span>',
 136+ '\n': '<span class="editSurface-contentView-whitespace">&#182;</span>',
 137+ '\t': '<span class="editSurface-contentView-whitespace">&#8702;</span>',
135138 ' ': '&nbsp;'
136139 };
137140
@@ -363,7 +366,7 @@
364367 * TODO: The offset needs to be chosen based on nearest offset to the cursor, not offset before
365368 * the cursor.
366369 */
367 - var $ruler = $( '<div class="editSurface-ruler"></div>' ).appendTo( this.$ ),
 370+ var $ruler = $( '<div class="editSurface-contentView-ruler"></div>' ).appendTo( this.$ ),
368371 ruler = $ruler[0],
369372 fit = this.fitCharacters( line.range, ruler, position.left ),
370373 center;
@@ -448,7 +451,7 @@
449452 * measuring for those cases.
450453 */
451454 if ( line.range.start < offset ) {
452 - var $ruler = $( '<div class="editSurface-ruler"></div>' ).appendTo( this.$ ),
 455+ var $ruler = $( '<div class="editSurface-contentView-ruler"></div>' ).appendTo( this.$ ),
453456 ruler = $ruler[0];
454457 ruler.innerHTML = this.getHtml( new es.Range( line.range.start, offset ) );
455458 position.left = ruler.clientWidth;
@@ -561,7 +564,7 @@
562565 // Cleanup
563566 rs.$ruler.remove();
564567 this.lines = rs.lines;
565 - this.$.find( '.editSurface-line[line-index=' + ( this.lines.length - 1 ) + ']' )
 568+ this.$.find( '.editSurface-contentView-line[line-index=' + ( this.lines.length - 1 ) + ']' )
566569 .nextAll()
567570 .remove();
568571 rs.timeout = undefined;
@@ -603,7 +606,7 @@
604607 // In case of empty content model we still want to display empty with non-breaking space inside
605608 // This is very important for lists
606609 if(this.model.getContentLength() === 0) {
607 - var $line = $( '<div class="editSurface-line" line-index="0">&nbsp;</div>' );
 610+ var $line = $( '<div class="editSurface-contentView-line" line-index="0">&nbsp;</div>' );
608611 this.$.empty().append( $line );
609612 this.lines = [{
610613 'text': ' ',
@@ -625,7 +628,7 @@
626629 */
627630 rs.$ruler = $( '<div>&nbsp;</div>' ).appendTo( this.$ );
628631 rs.width = rs.$ruler.innerWidth();
629 - rs.ruler = rs.$ruler.addClass('editSurface-ruler')[0];
 632+ rs.ruler = rs.$ruler.addClass('editSurface-contentView-ruler')[0];
630633 // Ignore offset optimization if the width has changed or the text has never been flowed before
631634 if (this.width !== rs.width) {
632635 offset = undefined;
@@ -670,7 +673,9 @@
671674 lineCount = rs.lines.length,
672675 $line = this.$.children( '[line-index=' + lineCount + ']' );
673676 if ( !$line.length ) {
674 - $line = $( '<div class="editSurface-line" line-index="' + lineCount + '"></div>' );
 677+ $line = $(
 678+ '<div class="editSurface-contentView-line" line-index="' + lineCount + '"></div>'
 679+ );
675680 this.$.append( $line );
676681 }
677682 $line[0].innerHTML = this.getHtml( range );
@@ -684,7 +689,7 @@
685690 'fractional': fractional
686691 });
687692 // Disable links within rendered content
688 - $line.find( '.editSurface-format-object a' )
 693+ $line.find( '.editSurface-contentView-format-object a' )
689694 .mousedown( function( e ) {
690695 e.preventDefault();
691696 } )
Index: trunk/parsers/wikidom/lib/hype/views/es.ListItemView.js
@@ -11,10 +11,10 @@
1212 es.DocumentViewLeafNode.call( this, model );
1313
1414 // Properties
15 - this.$icon = $( '<div class="editSurface-listItem-icon"></div>' ).prependTo( this.$ );
 15+ this.$icon = $( '<div class="editSurface-listItemView-icon"></div>' ).prependTo( this.$ );
1616
1717 // DOM Changes
18 - this.$.addClass( 'editSurface-listItem' );
 18+ this.$.addClass( 'editSurface-listItemView' );
1919
2020 // Events
2121 this.on( 'update', this.setClasses );
@@ -31,13 +31,13 @@
3232 .attr(
3333 'class',
3434 classes
35 - .replace( /editSurface-listItem-level[0-9]+/, '' )
36 - .replace( /editSurface-listItem-(bullet|number)/, '' )
 35+ .replace( /editSurface-listItemView-level[0-9]+/, '' )
 36+ .replace( /editSurface-listItemView-(bullet|number)/, '' )
3737 )
3838 // Set the list style class from the style on top of the stack
39 - .addClass( 'editSurface-listItem-' + styles[styles.length - 1] )
 39+ .addClass( 'editSurface-listItemView-' + styles[styles.length - 1] )
4040 // Set the list level class from the length of the stack
41 - .addClass( 'editSurface-listItem-level' + ( styles.length - 1 ) );
 41+ .addClass( 'editSurface-listItemView-level' + ( styles.length - 1 ) );
4242 };
4343
4444 es.ListItemView.prototype.setNumber = function( number ) {
Index: trunk/parsers/wikidom/lib/hype/views/es.ListView.js
@@ -11,7 +11,7 @@
1212 es.DocumentViewBranchNode.call( this, model );
1313
1414 // DOM Changes
15 - this.$.addClass( 'editSurface-listBlock' );
 15+ this.$.addClass( 'editSurface-listView' );
1616
1717 // Events
1818 this.on( 'update', this.enumerate );
Index: trunk/parsers/wikidom/lib/hype/views/es.DocumentView.js
@@ -15,7 +15,7 @@
1616 this.surfaceView = surfaceView;
1717
1818 // DOM Changes
19 - this.$.addClass( 'editSurface-document' );
 19+ this.$.addClass( 'editSurface-documentView' );
2020 };
2121
2222 /**
Index: trunk/parsers/wikidom/lib/hype/views/es.HeadingView.js
@@ -11,7 +11,7 @@
1212 es.DocumentViewLeafNode.call( this, model, $( '<h' + model.getElementAttribute( 'level' ) + '>') );
1313
1414 // DOM Changes
15 - this.$.addClass( 'editSurface-headingBlock' );
 15+ this.$.addClass( 'editSurface-headingView' );
1616
1717 // Events
1818 this.on( 'update', this.setClasses );
@@ -27,9 +27,9 @@
2828 level = this.model.getElementAttribute( 'level' );
2929 this.$
3030 // Remove any existing level classes
31 - .attr( 'class', classes.replace( /editSurface-headingBlock-level[1-6]/, '' ) )
 31+ .attr( 'class', classes.replace( /editSurface-headingView-level[1-6]/, '' ) )
3232 // Add a new level class
33 - .addClass( 'editSurface-headingBlock-level' + level );
 33+ .addClass( 'editSurface-headingView-level' + level );
3434 };
3535
3636 /* Inheritance */
Index: trunk/parsers/wikidom/lib/hype/views/es.TableRowView.js
@@ -11,7 +11,9 @@
1212 es.DocumentViewBranchNode.call( this, model, $( '<tr>' ), true );
1313
1414 // DOM Changes
15 - this.$.attr( 'style', model.getElementAttribute( 'html/style' ) );
 15+ this.$
 16+ .attr( 'style', model.getElementAttribute( 'html/style' ) )
 17+ .addClass( 'editSurface-tableRowView' );
1618 };
1719
1820 /* Inheritance */

Status & tagging log