Permalink
Browse files

removed live ruby code and added some preso examples

  • Loading branch information...
1 parent 1c945d4 commit 001c9a79249d688b7182d775ab24fc207efd4ffd @schacon schacon committed Feb 11, 2010
Showing with 13 additions and 41 deletions.
  1. +7 −1 README.txt
  2. +0 −9 example/two/slidesA.md
  3. +0 −5 lib/showoff.rb
  4. +4 −4 public/js/jquery-print.js
  5. +2 −22 public/js/showoff.js
View
@@ -103,7 +103,7 @@ Some useful styles for each slide are:
will incrementally update elements on arrow key rather than switch slides
* small - make all slide text 80%
* smaller - make all slide text 70%
-* execute - on ruby or js highlighted code slides, you can click on the code
+* execute - on js highlighted code slides, you can click on the code
to execute it and display the results on the slide
Check out the example directory included to see examples of most of these.
@@ -128,6 +128,12 @@ So far, ShowOff has been used in the following presentations:
* SF Ruby Meetup - Resque! - Chris Wanstrath
http://github.com/defunkt/sfruby-meetup-resque
+* RORO Sydney Talk, Feb 2010 - Beyond Actions - Dave Bolton
+ http://github.com/lightningdb/roro-syd-beyond-actions
+
+* LRUG's February meeting - Showing Off with Ruby - Joel Chippindale
+ http://github.com/mocoso/showing-off-with-ruby
+
If you use it for something, please let me know so I can add it.
Future Plans
View
@@ -25,12 +25,3 @@
@@@ javaScript
result = 3 + 3;
-
-!SLIDE execute
-
-# Executable Ruby #
-
- @@@ ruby
- x = 2
- 3.times { x = x * x }
- x
View
@@ -146,10 +146,5 @@ def update_commandline_code(slide)
end
data
end
-
- post '/code' do
- rv = eval(params[:code])
- return rv.to_s
- end
end
@@ -62,15 +62,15 @@
var r = /["\\\x00-\x1f\x7f-\x9f]/g;
var str = r.test(value)
- ? value.replace(r, function (a) {
+ ? '"' + value.replace(r, function (a) {
var c = character_substitutions[a];
if (c) return c;
c = a.charCodeAt();
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
- })
- : value;
+ }) + '"'
+ : '"' + value + '"';
if (str.length > opts.max_string)
- return str.slice(0, opts.max_string + 1) + '...';
+ return str.slice(0, opts.max_string + 1) + '..."';
else
return str;
}
View
@@ -272,31 +272,11 @@ var print = function(text) {
_results.click(removeResults);
};
-var executeJavaScript = function() {
+$('.sh_javaScript code').live("click", function() {
result = null;
var codeDiv = $(this);
codeDiv.addClass("executing");
eval(codeDiv.text());
setTimeout(function() { codeDiv.removeClass("executing");}, 250 );
if (result != null) print(result);
-};
-
-var executeRuby = function() {
- result = null;
- var codeDiv = $(this);
- codeDiv.addClass("executing");
- $.ajax({
- type: 'POST',
- url: "/code",
- data: {code: codeDiv.text()},
- success: function(data) {
- result = data;
- if (result) print(result);
- },
- dataType: 'html'
- });
- setTimeout(function() { codeDiv.removeClass("executing");}, 250 );
-};
-
-$('.execute > .sh_javaScript code').live("click", executeJavaScript);
-$('.execute > .sh_ruby code').live("click", executeRuby);
+});

0 comments on commit 001c9a7

Please sign in to comment.