slideoff 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/slideoff/presentation.rb +7 -1
- data/lib/slideoff.rb +1 -1
- data/themes/modern/js/script.coffee +42 -22
- data/themes/modern/js/script.js +52 -26
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292dc9e44e4bdb71dd13dec1241465452a029329
|
4
|
+
data.tar.gz: f9b232e08f19cd6edec6c21bbf950bf199721a54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ef62a3b328560f2d65191ac6644bb6fd35fd5066978b7cc47033710d611d6d7dd0b036e6f4dd5eeded0020f70e4f28e515ba7783eb9d869ee13564709f4943f
|
7
|
+
data.tar.gz: 73a568350aa9a9b942816898d277a6c6a645b503130ca2cb0f6db9d63acbcb4b5c83a1f5ae369f9fd944109bb377fad64f132e581c3c2666021c48fe99d222dc
|
@@ -43,7 +43,7 @@ module Slideoff
|
|
43
43
|
Dir[ "#{CONFIG.pwd}#{asset}"].first ||
|
44
44
|
Dir[ "#{theme.dir}#{asset}"].first ||
|
45
45
|
Dir[ "#{common.dir}#{asset}"].first ||
|
46
|
-
(
|
46
|
+
lookup_recursive_without_static(asset).first
|
47
47
|
end
|
48
48
|
|
49
49
|
def convert_styles(dir)
|
@@ -54,6 +54,12 @@ module Slideoff
|
|
54
54
|
|
55
55
|
protected
|
56
56
|
|
57
|
+
def lookup_recursive_without_static(path)
|
58
|
+
found_paths = Dir["#{File.absolute_path(CONFIG.pwd)}/**#{path}"]
|
59
|
+
found_static_paths = Dir["#{File.absolute_path(CONFIG.static_dir)}/**#{path}"]
|
60
|
+
found_paths - found_static_paths
|
61
|
+
end
|
62
|
+
|
57
63
|
def build_theme(title)
|
58
64
|
Theme.new.tap do |t|
|
59
65
|
dir = File.expand_path("#{CONFIG.dir}/themes/#{title}")
|
data/lib/slideoff.rb
CHANGED
@@ -300,36 +300,50 @@ class Slide
|
|
300
300
|
|
301
301
|
containsInactive: -> @firstInactiveElement().length > 0
|
302
302
|
|
303
|
+
containsCurrent: -> @firstCurrentElement().length > 0
|
304
|
+
|
305
|
+
containsVisited: -> @html().find('.visited').length > 0
|
306
|
+
|
303
307
|
firstInactiveElement: -> @html().find('.inactive').first()
|
304
308
|
|
305
|
-
|
309
|
+
firstCurrentElement: -> @html().find('.current').first()
|
306
310
|
|
307
|
-
|
308
|
-
@
|
309
|
-
|
310
|
-
@
|
311
|
-
|
311
|
+
prevInteractive: ->
|
312
|
+
@firstCurrentElement().removeClass('current').addClass('inactive')
|
313
|
+
|
314
|
+
unless @containsVisited()
|
315
|
+
@prev().goto()
|
316
|
+
return
|
317
|
+
|
318
|
+
@html().find('.visited').last().removeClass('visited').addClass('current')
|
319
|
+
@decrementStep() if @html().hasClass('step-0')
|
320
|
+
|
321
|
+
nextInteractive: ->
|
322
|
+
@firstCurrentElement().removeClass('current').addClass('visited')
|
323
|
+
|
324
|
+
unless @containsInactive()
|
325
|
+
@next().goto()
|
326
|
+
return
|
312
327
|
|
313
|
-
element
|
328
|
+
element = @firstInactiveElement()
|
329
|
+
element.removeClass('inactive').addClass('current')
|
314
330
|
if element.is("pre[data-lang=sh] code")
|
315
331
|
element.typewriter()
|
316
332
|
else
|
317
|
-
element.addClass('current')
|
318
333
|
@incrementStep()
|
319
334
|
|
320
|
-
|
321
|
-
|
322
|
-
step =
|
323
|
-
while
|
324
|
-
|
325
|
-
|
335
|
+
decrementStep: ->
|
336
|
+
max_steps = @html().find('.step').length
|
337
|
+
step = max_steps
|
338
|
+
while step >= 0 && step <= max_steps && !@html().hasClass("step-#{step}")
|
339
|
+
step = step - 1
|
340
|
+
@html().removeClass("step-#{step}")
|
326
341
|
|
327
342
|
incrementStep: ->
|
328
|
-
currentHtml = Slide.current().html()
|
329
343
|
step = 0
|
330
|
-
while
|
344
|
+
while @html().hasClass("step-#{step}")
|
331
345
|
step = step + 1
|
332
|
-
|
346
|
+
@html().addClass("step-#{step}")
|
333
347
|
|
334
348
|
# private
|
335
349
|
|
@@ -366,17 +380,23 @@ class UserInterface
|
|
366
380
|
Slide.last().goto()
|
367
381
|
|
368
382
|
@nextStep: ->
|
383
|
+
return unless Mode.isSlideMode()
|
384
|
+
|
369
385
|
slide = Slide.current()
|
370
|
-
if
|
371
|
-
slide.
|
386
|
+
if slide.containsInactive() or slide.containsCurrent()
|
387
|
+
slide.nextInteractive()
|
372
388
|
else
|
373
389
|
slide.html().removeClass('incr')
|
374
|
-
slide.removePresentElement()
|
375
|
-
slide.resetStep()
|
376
390
|
slide.next().goto()
|
377
391
|
|
378
392
|
@prevStep: ->
|
379
|
-
|
393
|
+
return unless Mode.isSlideMode()
|
394
|
+
|
395
|
+
slide = Slide.current()
|
396
|
+
if slide.containsVisited() or slide.containsCurrent()
|
397
|
+
slide.prevInteractive()
|
398
|
+
else
|
399
|
+
slide.prev().goto()
|
380
400
|
|
381
401
|
@nextBigStep: ->
|
382
402
|
Slide.current().nextSection().goto()
|
data/themes/modern/js/script.js
CHANGED
@@ -420,51 +420,67 @@ Slide = (function() {
|
|
420
420
|
return this.firstInactiveElement().length > 0;
|
421
421
|
};
|
422
422
|
|
423
|
+
Slide.prototype.containsCurrent = function() {
|
424
|
+
return this.firstCurrentElement().length > 0;
|
425
|
+
};
|
426
|
+
|
427
|
+
Slide.prototype.containsVisited = function() {
|
428
|
+
return this.html().find('.visited').length > 0;
|
429
|
+
};
|
430
|
+
|
423
431
|
Slide.prototype.firstInactiveElement = function() {
|
424
432
|
return this.html().find('.inactive').first();
|
425
433
|
};
|
426
434
|
|
427
|
-
Slide.prototype.
|
428
|
-
return this.html().find('.current').first()
|
435
|
+
Slide.prototype.firstCurrentElement = function() {
|
436
|
+
return this.html().find('.current').first();
|
429
437
|
};
|
430
438
|
|
431
|
-
Slide.prototype.
|
439
|
+
Slide.prototype.prevInteractive = function() {
|
440
|
+
this.firstCurrentElement().removeClass('current').addClass('inactive');
|
441
|
+
if (!this.containsVisited()) {
|
442
|
+
this.prev().goto();
|
443
|
+
return;
|
444
|
+
}
|
445
|
+
this.html().find('.visited').last().removeClass('visited').addClass('current');
|
446
|
+
if (this.html().hasClass('step-0')) {
|
447
|
+
return this.decrementStep();
|
448
|
+
}
|
449
|
+
};
|
450
|
+
|
451
|
+
Slide.prototype.nextInteractive = function() {
|
432
452
|
var element;
|
453
|
+
this.firstCurrentElement().removeClass('current').addClass('visited');
|
433
454
|
if (!this.containsInactive()) {
|
434
|
-
this.
|
455
|
+
this.next().goto();
|
456
|
+
return;
|
435
457
|
}
|
436
458
|
element = this.firstInactiveElement();
|
437
|
-
|
438
|
-
this.removePresentElement();
|
439
|
-
element.removeClass('inactive');
|
459
|
+
element.removeClass('inactive').addClass('current');
|
440
460
|
if (element.is("pre[data-lang=sh] code")) {
|
441
461
|
return element.typewriter();
|
442
462
|
} else {
|
443
|
-
element.addClass('current');
|
444
463
|
return this.incrementStep();
|
445
464
|
}
|
446
465
|
};
|
447
466
|
|
448
|
-
Slide.prototype.
|
449
|
-
var
|
450
|
-
|
451
|
-
step =
|
452
|
-
|
453
|
-
|
454
|
-
currentHtml.removeClass("step-" + step);
|
455
|
-
_results.push(step = step + 1);
|
467
|
+
Slide.prototype.decrementStep = function() {
|
468
|
+
var max_steps, step;
|
469
|
+
max_steps = this.html().find('.step').length;
|
470
|
+
step = max_steps;
|
471
|
+
while (step >= 0 && step <= max_steps && !this.html().hasClass("step-" + step)) {
|
472
|
+
step = step - 1;
|
456
473
|
}
|
457
|
-
return
|
474
|
+
return this.html().removeClass("step-" + step);
|
458
475
|
};
|
459
476
|
|
460
477
|
Slide.prototype.incrementStep = function() {
|
461
|
-
var
|
462
|
-
currentHtml = Slide.current().html();
|
478
|
+
var step;
|
463
479
|
step = 0;
|
464
|
-
while (
|
480
|
+
while (this.html().hasClass("step-" + step)) {
|
465
481
|
step = step + 1;
|
466
482
|
}
|
467
|
-
return
|
483
|
+
return this.html().addClass("step-" + step);
|
468
484
|
};
|
469
485
|
|
470
486
|
Slide.prototype.slideList = function() {
|
@@ -523,19 +539,29 @@ UserInterface = (function() {
|
|
523
539
|
|
524
540
|
UserInterface.nextStep = function() {
|
525
541
|
var slide;
|
542
|
+
if (!Mode.isSlideMode()) {
|
543
|
+
return;
|
544
|
+
}
|
526
545
|
slide = Slide.current();
|
527
|
-
if (
|
528
|
-
return slide.
|
546
|
+
if (slide.containsInactive() || slide.containsCurrent()) {
|
547
|
+
return slide.nextInteractive();
|
529
548
|
} else {
|
530
549
|
slide.html().removeClass('incr');
|
531
|
-
slide.removePresentElement();
|
532
|
-
slide.resetStep();
|
533
550
|
return slide.next().goto();
|
534
551
|
}
|
535
552
|
};
|
536
553
|
|
537
554
|
UserInterface.prevStep = function() {
|
538
|
-
|
555
|
+
var slide;
|
556
|
+
if (!Mode.isSlideMode()) {
|
557
|
+
return;
|
558
|
+
}
|
559
|
+
slide = Slide.current();
|
560
|
+
if (slide.containsVisited() || slide.containsCurrent()) {
|
561
|
+
return slide.prevInteractive();
|
562
|
+
} else {
|
563
|
+
return slide.prev().goto();
|
564
|
+
}
|
539
565
|
};
|
540
566
|
|
541
567
|
UserInterface.nextBigStep = function() {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slideoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DSIW
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: goliath
|