Skip to content

Commit

Permalink
using enumerables in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsu committed Mar 10, 2011
1 parent 278cc58 commit c1f0bc3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 6 additions & 2 deletions index.haml
Expand Up @@ -30,6 +30,8 @@
var foo = new Foo();
alert(foo.world());

var arr = [ 1, 2, 3, 4 ];
alert(js2(arr).reduce(\#{ return $1 + $2 }));


%input.run{ :type => 'button', :value => 'Run' }
Expand Down Expand Up @@ -96,7 +98,9 @@
font-size: 1.2em
:javascript
$('.run').click(function () {
eval(js2.render($('.code').val()));
$(function () {
$('.run').click(function () {
eval(js2.render($('.code').val()));
});
});
11 changes: 8 additions & 3 deletions index.html
Expand Up @@ -24,7 +24,10 @@ <h2>Try</h2>
}

var foo = new Foo();
alert(foo.world());</textarea>
alert(foo.world());

var arr = [ 1, 2, 3, 4 ];
alert(js2(arr).reduce(#{ return $1 + $2 }));</textarea>
<input class='run' type='button' value='Run' />
<h2>Install</h2>
<p>
Expand Down Expand Up @@ -81,8 +84,10 @@ <h2>Source</h2>
</style>
<script type='text/javascript'>
//<![CDATA[
$('.run').click(function () {
eval(js2.render($('.code').val()));
$(function () {
$('.run').click(function () {
eval(js2.render($('.code').val()));
});
});
//]]>
</script>

0 comments on commit c1f0bc3

Please sign in to comment.