Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Bootstrap support for Dart scripts on the page as this script. | 5 // Bootstrap support for Dart scripts on the page as this script. |
| 6 if (navigator.webkitStartDart) { | 6 if (navigator.webkitStartDart) { |
| 7 navigator.webkitStartDart(); | 7 if (navigator.webkitStartDart()) { |
|
vsm
2012/05/16 19:14:01
Minor nit: I'd suggest changing failure from true
Anton Muhin
2012/05/17 14:20:28
We need to think out landing process as if I chang
| |
| 8 document.body.innerHTML = 'This build has expired. Please download a new Da rtium at http://www.dartlang.org/dartium/index.html'; | |
| 9 } | |
| 8 } else { | 10 } else { |
| 9 // TODO: | 11 // TODO: |
| 10 // - Support in-browser compilation. | 12 // - Support in-browser compilation. |
| 11 // - Handle inline Dart scripts. | 13 // - Handle inline Dart scripts. |
| 12 window.addEventListener("DOMContentLoaded", function (e) { | 14 window.addEventListener("DOMContentLoaded", function (e) { |
| 13 // Fall back to compiled JS. Run through all the scripts and | 15 // Fall back to compiled JS. Run through all the scripts and |
| 14 // replace them if they have a type that indicate that they source | 16 // replace them if they have a type that indicate that they source |
| 15 // in Dart code. | 17 // in Dart code. |
| 16 // | 18 // |
| 17 // <script type="application/dart" src="<file>.dart"></script> | 19 // <script type="application/dart" src="<file>.dart"></script> |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 36 } else { | 38 } else { |
| 37 script.src = scripts[i].src + '.js'; | 39 script.src = scripts[i].src + '.js'; |
| 38 } | 40 } |
| 39 var parent = scripts[i].parentNode; | 41 var parent = scripts[i].parentNode; |
| 40 parent.replaceChild(script, scripts[i]); | 42 parent.replaceChild(script, scripts[i]); |
| 41 } | 43 } |
| 42 } | 44 } |
| 43 } | 45 } |
| 44 }, false); | 46 }, false); |
| 45 } | 47 } |
| OLD | NEW |