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

Unified Diff: client/tools/htmlconverter.py

Issue 9877008: Move the DOMContentLoaded logic into the generated JavaScript (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/gen.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tools/htmlconverter.py
===================================================================
--- client/tools/htmlconverter.py (revision 5935)
+++ client/tools/htmlconverter.py (working copy)
@@ -38,24 +38,12 @@
$ cd %s/frog
$ ./tools/build.py -m release""")
-ENTRY_POINT_DOM = """
+ENTRY_POINT = """
#library('entry');
-#import('dart:dom');
#import('%s', prefix: 'original');
-main() {
- window.addEventListener('DOMContentLoaded', (e) => original.main(), false);
-}
+main() => original.main();
vsm 2012/03/28 17:17:57 I think we can just get rid of this trampoline fil
kasperl 2012/03/28 17:56:29 I think the plan is to get rid of htmlconverter.py
"""
-ENTRY_POINT_HTML = """
-#library('entry');
-#import('dart:html');
-#import('%s', prefix: 'original');
-main() {
- window.on.contentLoaded.add((e) => original.main());
-}
-"""
-
CSS_TEMPLATE = '<style type="text/css">%s</style>'
CHROMIUM_SCRIPT_TEMPLATE = '<script type="application/javascript">%s</script>'
@@ -149,14 +137,9 @@
f.write("#library('inlinedcode');\n")
f.write(body)
- if useDartHtml:
- entryPoint = ENTRY_POINT_HTML
- else:
- entryPoint = ENTRY_POINT_DOM
-
wrappedfile = join(indir, 'entry.dart')
with open(wrappedfile, 'w') as f:
- f.write(entryPoint % inputfile)
+ f.write(ENTRY_POINT % inputfile)
status, out, err = execute(self.compileCommand(wrappedfile, outdir),
self.verbose)
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | frog/gen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698