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

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: Address comments 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
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 // Remap foo.dart to foo.js.
15 // TODO:
16 // - Support in-browser compilation.
17 // - Handle inline Dart scripts.
18 if (scripts[i].src && scripts[i].src != '') {
19 var script = document.createElement('script');
20 script.src = scripts[i].src + '.js';
21 var parent = scripts[i].parentNode;
22 parent.replaceChild(script, scripts[i]);
dgrove 2012/01/20 22:01:13 does this really work? (ie, the script starts exec
23 }
24 }
25 }
26 }, false);
27 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698