OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Part of the template compilation that concerns with extracting information | 6 * Part of the template compilation that concerns with extracting information |
7 * from the HTML parse tree. | 7 * from the HTML parse tree. |
8 */ | 8 */ |
9 library analyzer; | 9 library analyzer; |
10 | 10 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 _messages.warning('Event handler $name will be interpreted as an inline ' | 488 _messages.warning('Event handler $name will be interpreted as an inline ' |
489 'JavaScript event handler. Use the form ' | 489 'JavaScript event handler. Use the form ' |
490 'on-event-name="handlerName(\$event)" if you want a Dart handler ' | 490 'on-event-name="handlerName(\$event)" if you want a Dart handler ' |
491 'that will automatically update the UI based on model changes.', | 491 'that will automatically update the UI based on model changes.', |
492 info.node.sourceSpan); | 492 info.node.sourceSpan); |
493 return; | 493 return; |
494 } | 494 } |
495 | 495 |
496 if (name == 'on-key-down' || name == 'on-key-up' || | 496 if (name == 'on-key-down' || name == 'on-key-up' || |
497 name == 'on-key-press') { | 497 name == 'on-key-press') { |
498 value = '\$event = new autogenerated.KeyEvent(\$event); $value'; | 498 value = '\$event = new autogenerated.KeyEvent.wrap(\$event); $value'; |
499 } | 499 } |
500 | 500 |
501 _addEvent(info, toCamelCase(name), (elem) => value); | 501 _addEvent(info, toCamelCase(name), (elem) => value); |
502 info.removeAttributes.add(name); | 502 info.removeAttributes.add(name); |
503 } | 503 } |
504 | 504 |
505 EventInfo _addEvent(ElementInfo info, String name, ActionDefinition action) { | 505 EventInfo _addEvent(ElementInfo info, String name, ActionDefinition action) { |
506 var events = info.events.putIfAbsent(name, () => <EventInfo>[]); | 506 var events = info.events.putIfAbsent(name, () => <EventInfo>[]); |
507 var eventInfo = new EventInfo(name, action); | 507 var eventInfo = new EventInfo(name, action); |
508 events.add(eventInfo); | 508 events.add(eventInfo); |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 } | 1234 } |
1235 } | 1235 } |
1236 } | 1236 } |
1237 } | 1237 } |
1238 } | 1238 } |
1239 } | 1239 } |
1240 | 1240 |
1241 return seen; | 1241 return seen; |
1242 } | 1242 } |
1243 } | 1243 } |
OLD | NEW |