OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 * | 28 * |
29 * Contains diff method based on Javascript Diff Algorithm By John Resig | 29 * Contains diff method based on Javascript Diff Algorithm By John Resig |
30 * http://ejohn.org/files/jsdiff.js (released under the MIT license). | 30 * http://ejohn.org/files/jsdiff.js (released under the MIT license). |
31 */ | 31 */ |
32 | 32 |
33 /** | 33 /** |
| 34 * @param {number} offset |
| 35 * @param {string} stopCharacters |
| 36 * @param {!Node} stayWithinNode |
34 * @param {string=} direction | 37 * @param {string=} direction |
35 */ | 38 */ |
36 Node.prototype.rangeOfWord = function(offset, stopCharacters, stayWithinNode, di
rection) | 39 Node.prototype.rangeOfWord = function(offset, stopCharacters, stayWithinNode, di
rection) |
37 { | 40 { |
38 var startNode; | 41 var startNode; |
39 var startOffset = 0; | 42 var startOffset = 0; |
40 var endNode; | 43 var endNode; |
41 var endOffset = 0; | 44 var endOffset = 0; |
42 | 45 |
43 if (!stayWithinNode) | 46 if (!stayWithinNode) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 */ | 349 */ |
347 Document.prototype.createElementWithClass = function(elementName, className) | 350 Document.prototype.createElementWithClass = function(elementName, className) |
348 { | 351 { |
349 var element = this.createElement(elementName); | 352 var element = this.createElement(elementName); |
350 if (className) | 353 if (className) |
351 element.className = className; | 354 element.className = className; |
352 return element; | 355 return element; |
353 } | 356 } |
354 | 357 |
355 /** | 358 /** |
| 359 * @param {string} elementName |
356 * @param {string=} className | 360 * @param {string=} className |
357 */ | 361 */ |
358 Element.prototype.createChild = function(elementName, className) | 362 Element.prototype.createChild = function(elementName, className) |
359 { | 363 { |
360 var element = this.ownerDocument.createElementWithClass(elementName, classNa
me); | 364 var element = this.ownerDocument.createElementWithClass(elementName, classNa
me); |
361 this.appendChild(element); | 365 this.appendChild(element); |
362 return element; | 366 return element; |
363 } | 367 } |
364 | 368 |
365 DocumentFragment.prototype.createChild = Element.prototype.createChild; | 369 DocumentFragment.prototype.createChild = Element.prototype.createChild; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 */ | 661 */ |
658 function isEnterKey(event) { | 662 function isEnterKey(event) { |
659 // Check if in IME. | 663 // Check if in IME. |
660 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; | 664 return event.keyCode !== 229 && event.keyIdentifier === "Enter"; |
661 } | 665 } |
662 | 666 |
663 function consumeEvent(e) | 667 function consumeEvent(e) |
664 { | 668 { |
665 e.consume(); | 669 e.consume(); |
666 } | 670 } |
OLD | NEW |