Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: client/dart.js

Issue 9226025: New dart.js bootstrap script for apps (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Bootstrap support for Dart scripts on the page as this script.
6
7 if (!document.implementation.hasFeature('dart', '1.0')) {
8 window.addEventListener("DOMContentLoaded", function (e) {
9 // Fall back to compiled JS.
danrubel 2012/01/20 21:20:36 Do we need a "is Dart available in this browser" c
vsm 2012/01/20 21:55:27 Line 7 is that check. Note, we will probably chan
10 var scripts = document.getElementsByTagName("script");
11 var length = scripts.length;
12 for (var i = 0; i < length; ++i) {
13 if (scripts[i].type == "application/dart") {
14 var script = document.createElement('script');
15 // Remap foo.dart to foo.js.
16 // TODO:
17 // - Support in-browser compilation.
18 // - Handle inline Dart scripts.
19 if (scripts[i].src && scripts[i].src != '') {
20 script.src = scripts[i].src + '.js';
21 document.body.appendChild(script);
dgrove 2012/01/20 20:57:03 won't this break scripts that want to look at thei
vsm 2012/01/20 21:55:27 Modified to replace the original script. On 2012/
22 }
23 }
24 }
25 }, false);
26 }
OLDNEW
« no previous file with comments | « no previous file | client/samples/dartcombat/dartcombat.html » ('j') | client/samples/dartcombat/dartcombat.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698