Browse files

inline javascript so that test/index generates HTML that is self-cont…

…ained (making it easier to demo)
  • Loading branch information...
1 parent d5e668a commit dd14de3b1882b75182c9c43a84be84d207e0a9df @jlong committed Jan 12, 2010
Showing with 8 additions and 4 deletions.
  1. +8 −4 test/index.haml
View
12 test/index.haml
@@ -3,10 +3,14 @@
%head
%meta{"http-equiv"=>"Content-type", :content=>"text/html; charset=utf-8"}/
%title Toggle JS
- %script{:src=>"/javascripts/prototype.js", :type=>"text/javascript"}
- %script{:src=>"/javascripts/effects.js", :type=>"text/javascript"}
- %script{:src=>"/javascripts/lowpro.js", :type=>"text/javascript"}
- %script{:src=>"/javascripts/toggle.js", :type=>"text/javascript"}
+ %script{:type=>"text/javascript"}
+ - # Inline Javascript to make this file self contained.
+ = "/* <![CDATA[ */"
+ = IO.read(File.join(File.dirname(__FILE__), 'javascripts', 'prototype.js'));
+ = IO.read(File.join(File.dirname(__FILE__), 'javascripts', 'effects.js'));
+ = IO.read(File.join(File.dirname(__FILE__), 'javascripts', 'lowpro.js'));
+ = IO.read(File.join(File.dirname(__FILE__), 'javascripts', 'toggle.js'));
+ = "/* ]]> */"
%style{:type=>"text/css"}
:sass
body

0 comments on commit dd14de3

Please sign in to comment.