| 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 library word_finder.web.word_finder_element; | 5 library word_finder.web.word_finder_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'package:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
| 10 | 10 |
| 11 @CustomTag('word-finder-element') | 11 @CustomTag('word-finder-element') |
| 12 class WordFinderElement extends PolymerElement with ObservableMixin { | 12 class WordFinderElement extends PolymerElement with Observable { |
| 13 bool get applyAuthorStyles => true; | 13 bool get applyAuthorStyles => true; |
| 14 | 14 |
| 15 @observable List<String> charsList = toObservable( | 15 @observable List<String> charsList = toObservable( |
| 16 ['A', 'E', 'L', 'S', 'T', '']); | 16 ['A', 'E', 'L', 'S', 'T', '']); |
| 17 | 17 |
| 18 List<String> possibleWords = toObservable([ | 18 List<String> possibleWords = toObservable([ |
| 19 'LEAST', 'SETAL', 'SLATE', 'STALE', 'STEAL', 'STELA', 'TAELS', 'TALES', | 19 'LEAST', 'SETAL', 'SLATE', 'STALE', 'STEAL', 'STELA', 'TAELS', 'TALES', |
| 20 'TEALS', 'TESLA', 'AE', 'AL', 'AS', 'AT', 'EL', 'ES', 'ET', 'LA', 'TA', | 20 'TEALS', 'TESLA', 'AE', 'AL', 'AS', 'AT', 'EL', 'ES', 'ET', 'LA', 'TA', |
| 21 'ALE', 'ALS', 'ALT', 'ATE', 'EAT', 'ELS', 'ETA', 'LAS', 'LAT', 'LEA', | 21 'ALE', 'ALS', 'ALT', 'ATE', 'EAT', 'ELS', 'ETA', 'LAS', 'LAT', 'LEA', |
| 22 'LES', 'LET', 'SAE', 'SAL', 'SAT', 'SEA', 'SEL', 'SET', 'TAE', 'TAS', | 22 'LES', 'LET', 'SAE', 'SAL', 'SAT', 'SEA', 'SEL', 'SET', 'TAE', 'TAS', |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 void _swapChars() { | 108 void _swapChars() { |
| 109 var temp = charsList[sourceElementIndex]; | 109 var temp = charsList[sourceElementIndex]; |
| 110 charsList[sourceElementIndex] = charsList[targetElementIndex]; | 110 charsList[sourceElementIndex] = charsList[targetElementIndex]; |
| 111 charsList[targetElementIndex] = temp; | 111 charsList[targetElementIndex] = temp; |
| 112 } | 112 } |
| 113 } | 113 } |
| OLD | NEW |