Index: trunk/parsers/wikidom/lib/hype/es.js |
— | — | @@ -62,9 +62,9 @@ |
63 | 63 | bValue = b[k]; |
64 | 64 | aType = typeof aValue; |
65 | 65 | bType = typeof bValue; |
66 | | - if ( aType !== bType |
67 | | - || ( ( aType === 'string' || aType === 'number' ) && aValue !== bValue ) |
68 | | - || ( $.isPlainObject( aValue ) && !es.compareObjects( aValue, bValue ) ) ) { |
| 66 | + if ( aType !== bType || |
| 67 | + ( ( aType === 'string' || aType === 'number' ) && aValue !== bValue ) || |
| 68 | + ( $.isPlainObject( aValue ) && !es.compareObjects( aValue, bValue ) ) ) { |
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | } |
Index: trunk/parsers/wikidom/lib/hype/bases/es.ViewNode.js |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | } |
29 | 29 | |
30 | 30 | // Extension |
31 | | - var node = $.extend( [], this ) |
| 31 | + var node = $.extend( [], this ); |
32 | 32 | |
33 | 33 | // Properties |
34 | 34 | node.model = model; |
Index: trunk/parsers/wikidom/lib/hype/bases/es.DocumentModelNode.js |
— | — | @@ -58,13 +58,15 @@ |
59 | 59 | }; |
60 | 60 | |
61 | 61 | es.DocumentModelNode.prototype.onBeforeSplice = function( index, howmany ) { |
62 | | - var diff = 0, |
| 62 | + var i, |
| 63 | + length, |
| 64 | + diff = 0, |
63 | 65 | removed = this.slice( index, index + howmany ), |
64 | 66 | added = Array.prototype.slice.call( arguments, 2 ); |
65 | | - for ( var i = 0; i < removed.length; i++ ) { |
| 67 | + for ( i = 0, length = removed.length; i < length; i++ ) { |
66 | 68 | diff -= removed[i].getElementLength(); |
67 | 69 | } |
68 | | - for ( var i = 0; i < added.length; i++ ) { |
| 70 | + for ( i = 0, length = added.length; i < length; i++ ) { |
69 | 71 | diff += added[i].getElementLength(); |
70 | 72 | } |
71 | 73 | this.adjustContentLength( diff ); |
Index: trunk/parsers/wikidom/lib/hype/bases/es.ModelNode.js |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | es.EventEmitter.call( this ); |
18 | 18 | |
19 | 19 | // Extension |
20 | | - var node = $.extend( [], this ) |
| 20 | + var node = $.extend( [], this ); |
21 | 21 | |
22 | 22 | // Reusable function for passing update events upstream |
23 | 23 | node.emitUpdate = function() { |
— | — | @@ -136,15 +136,17 @@ |
137 | 137 | * @emits update |
138 | 138 | */ |
139 | 139 | es.ModelNode.prototype.splice = function( index, howmany ) { |
140 | | - var args = Array.prototype.slice.call( arguments, 0 ); |
| 140 | + var i, |
| 141 | + length, |
| 142 | + args = Array.prototype.slice.call( arguments, 0 ); |
141 | 143 | this.emit.apply( this, ['beforeSplice'].concat( args ) ); |
142 | 144 | if ( args.length >= 3 ) { |
143 | | - for ( var i = 2; i < args.length; i++ ) { |
| 145 | + for ( i = 2, length = args.length; i < length; i++ ) { |
144 | 146 | args[i].attach( this ); |
145 | 147 | } |
146 | 148 | } |
147 | 149 | var removed = Array.prototype.splice.apply( this, args ); |
148 | | - for ( var i = 0; i < removed.length; i++ ) { |
| 150 | + for ( i = 0, length = removed.length; i < length; i++ ) { |
149 | 151 | removed[i].detach(); |
150 | 152 | removed[i].removeListener( 'update', this.emitUpdate ); |
151 | 153 | } |
Index: trunk/parsers/wikidom/lib/hype/bases/es.EventEmitter.js |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | */ |
9 | 9 | es.EventEmitter = function() { |
10 | 10 | this.events = {}; |
11 | | -} |
| 11 | +}; |
12 | 12 | |
13 | 13 | /* Methods */ |
14 | 14 | |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | return this; |
146 | 146 | } |
147 | 147 | var handlers = this.events[type]; |
148 | | - if ( handlers.length == 1 && handlers[0] === listener ) { |
| 148 | + if ( handlers.length === 1 && handlers[0] === listener ) { |
149 | 149 | delete this.events[type]; |
150 | 150 | } else { |
151 | 151 | var i = handlers.indexOf( listener ); |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | return this; |
154 | 154 | } |
155 | 155 | handlers.splice( i, 1 ); |
156 | | - if ( handlers.length == 0 ) { |
| 156 | + if ( handlers.length === 0 ) { |
157 | 157 | delete this.events[type]; |
158 | 158 | } |
159 | 159 | } |