showoff 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/showoff.rb CHANGED
@@ -100,10 +100,16 @@ class ShowOff < Sinatra::Application
100
100
  md += "</div>\n"
101
101
  md += "</div>\n"
102
102
  final += update_commandline_code(md)
103
+ final = update_p_classes(final)
103
104
  end
104
105
  final
105
106
  end
106
107
 
108
+ # find any lines that start with a <p>.(something) and turn them into <p class="something">
109
+ def update_p_classes(markdown)
110
+ markdown.gsub(/<p>\.(.*?) /, '<p class="\1">')
111
+ end
112
+
107
113
  def update_image_paths(path, slide, static=false)
108
114
  paths = path.split('/')
109
115
  paths.pop
@@ -145,6 +145,7 @@ h1, h2, h3 {
145
145
 
146
146
  pre { margin-left: 40px; font-size: 2.8em; }
147
147
 
148
+ .notes { display: none }
148
149
  .hidden { position:absolute; top:0; left:-9999px; width:1px; height:1px; overflow:hidden; }
149
150
  .offscreen { position:absolute; top:0; left:-9999px; overflow:hidden; }
150
151
  #debugInfo { margin-left: 30px; }
data/public/js/showoff.js CHANGED
@@ -177,6 +177,18 @@ function showSlide(back_step) {
177
177
  bind('swipeleft', swipeLeft).
178
178
  bind('swiperight', swipeRight)
179
179
  removeResults()
180
+
181
+ return getCurrentNotes()
182
+ }
183
+
184
+ function getSlideProgress()
185
+ {
186
+ return (slidenum + 1) + '/' + slideTotal
187
+ }
188
+
189
+ function getCurrentNotes()
190
+ {
191
+ return currentSlide.find("p.notes").text()
180
192
  }
181
193
 
182
194
  function getSlidePercent()
@@ -204,14 +216,14 @@ function determineIncremental()
204
216
  function prevStep()
205
217
  {
206
218
  slidenum--
207
- showSlide(true) // We show the slide fully loaded
219
+ return showSlide(true) // We show the slide fully loaded
208
220
  }
209
221
 
210
222
  function nextStep()
211
223
  {
212
224
  if (incrCurr >= incrSteps) {
213
225
  slidenum++
214
- showSlide()
226
+ return showSlide()
215
227
  } else {
216
228
  elem = incrElem.eq(incrCurr)
217
229
  if (incrCode && elem.hasClass('command')) {
@@ -225,7 +237,7 @@ function nextStep()
225
237
 
226
238
  function prevStep() {
227
239
  slidenum--
228
- showSlide(true) // We show the slide fully loaded
240
+ return showSlide(true) // We show the slide fully loaded
229
241
  }
230
242
 
231
243
  function doDebugStuff()
@@ -251,7 +263,7 @@ function keyDown(event)
251
263
  return true;
252
264
 
253
265
  debug('keyDown: ' + key)
254
-
266
+
255
267
  if (key >= 48 && key <= 57) // 0 - 9
256
268
  {
257
269
  gotoSlidenum = gotoSlidenum * 10 + (key - 48);
@@ -304,7 +316,7 @@ function keyDown(event)
304
316
  }
305
317
  else if (key == 66 || key == 70) // f for footer (also "b" which is what kensington remote "stop" button sends
306
318
  {
307
- $('#footer').toggle()
319
+ toggleFooter()
308
320
  }
309
321
  else if (key == 27) // esc
310
322
  {
@@ -313,6 +325,11 @@ function keyDown(event)
313
325
  return true
314
326
  }
315
327
 
328
+ function toggleFooter()
329
+ {
330
+ $('#footer').toggle()
331
+ }
332
+
316
333
  function keyUp(event) {
317
334
  var key = event.keyCode;
318
335
  debug('keyUp: ' + key);
@@ -324,11 +341,11 @@ function keyUp(event) {
324
341
 
325
342
 
326
343
  function swipeLeft() {
327
- prevStep()
344
+ nextStep()
328
345
  }
329
346
 
330
347
  function swipeRight() {
331
- nextStep()
348
+ prevStep()
332
349
  }
333
350
 
334
351
  function ListMenu(s)
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.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
@@ -167,7 +167,7 @@ files:
167
167
  - public/js/sh_main.min.js
168
168
  - public/js/showoff.client.js
169
169
  - public/js/showoff.js
170
- has_rdoc: false
170
+ has_rdoc: true
171
171
  homepage: http://github.com/schacon/showoff
172
172
  licenses: []
173
173