OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 return ""; | 369 return ""; |
370 case "keydown": | 370 case "keydown": |
371 case "keyup": | 371 case "keyup": |
372 if (!this.ctrlKey && !this.metaKey && !this.altKey) | 372 if (!this.ctrlKey && !this.metaKey && !this.altKey) |
373 return String.fromCharCode(this.which); | 373 return String.fromCharCode(this.which); |
374 else | 374 else |
375 return ""; | 375 return ""; |
376 } | 376 } |
377 }); | 377 }); |
378 | 378 |
379 Event.prototype.consume = function() | 379 /** |
| 380 * @param {boolean=} preventDefault |
| 381 */ |
| 382 Event.prototype.consume = function(preventDefault) |
380 { | 383 { |
381 this.stopImmediatePropagation(); | 384 this.stopImmediatePropagation(); |
382 this.preventDefault(); | 385 if (preventDefault) |
| 386 this.preventDefault(); |
383 this.handled = true; | 387 this.handled = true; |
384 } | 388 } |
385 | 389 |
386 Text.prototype.select = function(start, end) | 390 Text.prototype.select = function(start, end) |
387 { | 391 { |
388 start = start || 0; | 392 start = start || 0; |
389 end = end || this.textContent.length; | 393 end = end || this.textContent.length; |
390 | 394 |
391 if (start < 0) | 395 if (start < 0) |
392 start = end + start; | 396 start = end + start; |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 get: function(key) | 1246 get: function(key) |
1243 { | 1247 { |
1244 return this._map[key.__identifier]; | 1248 return this._map[key.__identifier]; |
1245 }, | 1249 }, |
1246 | 1250 |
1247 clear: function() | 1251 clear: function() |
1248 { | 1252 { |
1249 this._map = {}; | 1253 this._map = {}; |
1250 } | 1254 } |
1251 } | 1255 } |
OLD | NEW |