Skip to content

Commit 0b7d436

Browse files
author
Jonas Schubert Erlandsson
committed
Changes opal shim to insert pre code blocks with the ruby code being run before the results
1 parent b759be9 commit 0b7d436

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

opal/js/shims.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ $(document).ready(function() {
2020
$.ajax({
2121
url: $script.attr('src'),
2222
success: function( s ){
23-
src[idx] = s;
24-
waiting--;
25-
if( waiting === 0 ){ $(document).trigger('runruby'); }
23+
//src[idx] = s;
24+
//waiting--;
25+
//if( waiting === 0 ){ $(document).trigger('runruby'); }
26+
$('body').append('<pre>'+s+'</pre>');
27+
Opal.eval( s );
2628
}
2729
});
2830
} else {
29-
src[idx] = $script.text();
31+
//src[idx] = $script.text();
32+
var s;
33+
s = $script.text();
34+
$('body').append('<pre>'+s+'</pre>');
35+
Opal.eval( s );
3036
}
3137
});
3238

0 commit comments

Comments
 (0)