showoff 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.txt CHANGED
@@ -103,7 +103,7 @@ Some useful styles for each slide are:
103
103
  will incrementally update elements on arrow key rather than switch slides
104
104
  * small - make all slide text 80%
105
105
  * smaller - make all slide text 70%
106
- * execute - on ruby or js highlighted code slides, you can click on the code
106
+ * execute - on js highlighted code slides, you can click on the code
107
107
  to execute it and display the results on the slide
108
108
 
109
109
  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:
128
128
  * SF Ruby Meetup - Resque! - Chris Wanstrath
129
129
  http://github.com/defunkt/sfruby-meetup-resque
130
130
 
131
+ * RORO Sydney Talk, Feb 2010 - Beyond Actions - Dave Bolton
132
+ http://github.com/lightningdb/roro-syd-beyond-actions
133
+
134
+ * LRUG's February meeting - Showing Off with Ruby - Joel Chippindale
135
+ http://github.com/mocoso/showing-off-with-ruby
136
+
131
137
  If you use it for something, please let me know so I can add it.
132
138
 
133
139
  Future Plans
data/lib/showoff.rb CHANGED
@@ -146,10 +146,5 @@ class ShowOff < Sinatra::Application
146
146
  end
147
147
  data
148
148
  end
149
-
150
- post '/code' do
151
- rv = eval(params[:code])
152
- return rv.to_s
153
- end
154
149
 
155
150
  end
@@ -62,15 +62,15 @@
62
62
  var r = /["\\\x00-\x1f\x7f-\x9f]/g;
63
63
 
64
64
  var str = r.test(value)
65
- ? value.replace(r, function (a) {
65
+ ? '"' + value.replace(r, function (a) {
66
66
  var c = character_substitutions[a];
67
67
  if (c) return c;
68
68
  c = a.charCodeAt();
69
69
  return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
70
- })
71
- : value;
70
+ }) + '"'
71
+ : '"' + value + '"';
72
72
  if (str.length > opts.max_string)
73
- return str.slice(0, opts.max_string + 1) + '...';
73
+ return str.slice(0, opts.max_string + 1) + '..."';
74
74
  else
75
75
  return str;
76
76
  }
data/public/js/showoff.js CHANGED
@@ -272,31 +272,11 @@ var print = function(text) {
272
272
  _results.click(removeResults);
273
273
  };
274
274
 
275
- var executeJavaScript = function() {
275
+ $('.sh_javaScript code').live("click", function() {
276
276
  result = null;
277
277
  var codeDiv = $(this);
278
278
  codeDiv.addClass("executing");
279
279
  eval(codeDiv.text());
280
280
  setTimeout(function() { codeDiv.removeClass("executing");}, 250 );
281
281
  if (result != null) print(result);
282
- };
283
-
284
- var executeRuby = function() {
285
- result = null;
286
- var codeDiv = $(this);
287
- codeDiv.addClass("executing");
288
- $.ajax({
289
- type: 'POST',
290
- url: "/code",
291
- data: {code: codeDiv.text()},
292
- success: function(data) {
293
- result = data;
294
- if (result) print(result);
295
- },
296
- dataType: 'html'
297
- });
298
- setTimeout(function() { codeDiv.removeClass("executing");}, 250 );
299
- };
300
-
301
- $('.execute > .sh_javaScript code').live("click", executeJavaScript);
302
- $('.execute > .sh_ruby code').live("click", executeRuby);
282
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon