OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 part of swarmlib; | 5 part of swarmlib; |
6 | 6 |
7 /** | 7 /** |
8 * The base class that should be extended by all HTML applications. | 8 * The base class that should be extended by all HTML applications. |
9 * | 9 * |
10 * It should both be easy to use for users coming over from JavaScript, but | 10 * It should both be easy to use for users coming over from JavaScript, but |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 (e) => swapAndReloadCache()); | 56 (e) => swapAndReloadCache()); |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 /** | 60 /** |
61 * Erase the static splash screen. | 61 * Erase the static splash screen. |
62 * | 62 * |
63 * Assumption: if a splash screen exists, an element #appSplash contains it. | 63 * Assumption: if a splash screen exists, an element #appSplash contains it. |
64 */ | 64 */ |
65 void eraseSplashScreen() { | 65 void eraseSplashScreen() { |
66 final splash = document.query("#appSplash"); | 66 final splash = document.querySelector("#appSplash"); |
67 // Delete it if found, but it's okay for it not to be -- maybe | 67 // Delete it if found, but it's okay for it not to be -- maybe |
68 // somebody just didn't want to use our splash mechanism. | 68 // somebody just didn't want to use our splash mechanism. |
69 if (splash != null) { | 69 if (splash != null) { |
70 splash.remove(); | 70 splash.remove(); |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 /** | 74 /** |
75 * Swaps and reloads the app cache if an update is ready. Returns false if | 75 * Swaps and reloads the app cache if an update is ready. Returns false if |
76 * an update is not ready. | 76 * an update is not ready. |
(...skipping 25 matching lines...) Expand all Loading... |
102 // TODO(jmesserly): Several problems with this: | 102 // TODO(jmesserly): Several problems with this: |
103 // * How do we authenticate against the server? | 103 // * How do we authenticate against the server? |
104 // * How do we talk to a server other than thump? | 104 // * How do we talk to a server other than thump? |
105 assert(url.startsWith('/')); | 105 assert(url.startsWith('/')); |
106 return 'http://thump.googleplex.com$url'; | 106 return 'http://thump.googleplex.com$url'; |
107 } else { | 107 } else { |
108 return url; | 108 return url; |
109 } | 109 } |
110 } | 110 } |
111 } | 111 } |
OLD | NEW |