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 +7 -1
- data/lib/showoff.rb +0 -5
- data/public/js/jquery-print.js +4 -4
- data/public/js/showoff.js +2 -22
- metadata +1 -1
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
|
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
data/public/js/jquery-print.js
CHANGED
@@ -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
|
-
|
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
|
+
});
|