| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 |
| 6 /** Common functions used by TodoMVC tests. */ |
| 7 library todomvc_common; |
| 8 |
| 9 import 'dart:html'; |
| 10 import 'package:web_ui/watcher.dart'; |
| 11 |
| 12 void markChecked(item) { |
| 13 var node = document.queryAll('input[type=checkbox]')[item + 1]; |
| 14 node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0)); |
| 15 } |
| 16 |
| 17 void checkAll() { |
| 18 var node = document.queryAll('input[type=checkbox]')[0]; |
| 19 node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0)); |
| 20 } |
| 21 |
| 22 void clearCompleted() { |
| 23 var node = document.query('#clear-completed'); |
| 24 node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0)); |
| 25 } |
| 26 |
| 27 var _newTodo = (() => document.query('#new-todo'))(); |
| 28 var _form = (() => document.query('#__e-0'))(); |
| 29 |
| 30 void addNote(String note) { |
| 31 _newTodo.value = note; |
| 32 _form.on.submit.dispatch(new Event('submit')); |
| 33 dispatch(); |
| 34 } |
| OLD | NEW |