Index: trunk/extensions/VisualEditor/tests/es/es.TransactionProcessor.test.js |
— | — | @@ -175,7 +175,9 @@ |
176 | 176 | 'rollback keeps model tree up to date with removals' |
177 | 177 | ); |
178 | 178 | |
179 | | - var paragraphBreak = documentModel.prepareInsertion( 2, [ { 'type': '/paragraph' }, { 'type': 'paragraph' } ] ); |
| 179 | + var paragraphBreak = documentModel.prepareInsertion( |
| 180 | + 2, [{ 'type': '/paragraph' }, { 'type': 'paragraph' }] |
| 181 | + ); |
180 | 182 | |
181 | 183 | // Test 13 |
182 | 184 | es.TransactionProcessor.commit( documentModel, paragraphBreak ); |
— | — | @@ -192,7 +194,7 @@ |
193 | 195 | ], |
194 | 196 | 'commit applies an insertion transaction that splits the paragraph' |
195 | 197 | ); |
196 | | - |
| 198 | + |
197 | 199 | // Test 14 |
198 | 200 | deepEqual( |
199 | 201 | documentModel.getChildren()[0].getContent(), |
— | — | @@ -223,7 +225,7 @@ |
224 | 226 | ], |
225 | 227 | 'rollback reverses the effect of a paragraph split on the content' |
226 | 228 | ); |
227 | | - |
| 229 | + |
228 | 230 | // Test 17 |
229 | 231 | deepEqual( |
230 | 232 | documentModel.getChildren()[0].getContent(), |
Index: trunk/extensions/VisualEditor/modules/es/es.js |
— | — | @@ -51,11 +51,12 @@ |
52 | 52 | /** |
53 | 53 | * Wrapper for Array.prototype.indexOf |
54 | 54 | * |
55 | | - * @param arr {Array} Array to search in |
56 | | - * @param elem {Mixed} Element to search for |
57 | | - * @return {Number} Index of elem in arr, or -1 if not found. Comparisons are done with === |
| 55 | + * @param {Mixed} value Element to search for |
| 56 | + * @param {Array} array Array to search in |
| 57 | + * @param {Integer} [fromIndex=0] Index to being searching from |
| 58 | + * @return {Number} Index of value in array, or -1 if not found. Comparisons are done with === |
58 | 59 | */ |
59 | | -es.arrayIndexOf = $.inArray; |
| 60 | +es.inArray = $.inArray; |
60 | 61 | |
61 | 62 | /** |
62 | 63 | * Recursively compares string and number property between two objects. |
Index: trunk/extensions/VisualEditor/modules/es/bases/es.DocumentBranchNode.js |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | * @returns {Integer} Index of child node or -1 if node was not found |
44 | 44 | */ |
45 | 45 | es.DocumentBranchNode.prototype.indexOf = function( node ) { |
46 | | - return es.arrayIndexOf( this.children, node ); |
| 46 | + return es.inArray( node, this.children ); |
47 | 47 | }; |
48 | 48 | |
49 | 49 | /** |
Index: trunk/extensions/VisualEditor/modules/es/bases/es.EventEmitter.js |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | if ( handlers.length === 1 && handlers[0] === listener ) { |
150 | 150 | delete this.events[type]; |
151 | 151 | } else { |
152 | | - var i = es.arrayIndexOf( handlers, listener ); |
| 152 | + var i = es.inArray( listener, handlers ); |
153 | 153 | if ( i < 0 ) { |
154 | 154 | return this; |
155 | 155 | } |
Index: trunk/extensions/VisualEditor/modules/es/views/es.ContentView.js |
— | — | @@ -180,7 +180,7 @@ |
181 | 181 | renderers[type].close( annotation.data ) : renderers[type].close; |
182 | 182 | } else { |
183 | 183 | // Find the annotation in the stack |
184 | | - var depth = es.arrayIndexOf( stack, annotation ), |
| 184 | + var depth = es.inArray( annotation, stack ), |
185 | 185 | i; |
186 | 186 | if ( depth === -1 ) { |
187 | 187 | throw 'Invalid stack error. An element is missing from the stack.'; |