showoff 0.19.3 → 0.19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/keymap.rb +2 -2
- data/lib/showoff/version.rb +1 -1
- data/locales/de.yml +2 -0
- data/locales/en.yml +2 -0
- data/locales/es.yml +2 -0
- data/locales/fr.yml +2 -0
- data/locales/id.yml +2 -0
- data/locales/ja.yml +2 -0
- data/locales/nl.yml +2 -0
- data/locales/pt.yml +2 -0
- data/public/js/presenter.js +22 -0
- data/public/js/showoff.js +41 -0
- data/public/js/simpleStrings-0.0.1.js +34 -12
- data/views/header.erb +1 -0
- data/views/help.erb +10 -0
- data/views/index.erb +5 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2e85b3d4cb3a4ca82c5534fd4b927092f3f3644
|
4
|
+
data.tar.gz: 7db65a31bb8715347d29cad31126b289580c6dd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1eb97c5ad914d5a80335e0787a6672b031aa051d0ec0761f6d7ff345dc8fbdcd92c7504b81765b587b4caeb24926a0e61f93e33a95bf82e3a9c2408d087c39d
|
7
|
+
data.tar.gz: cae2c69158bb9c9fd86b9169ed6c1a802ee779ffc7171aa66f835df4025c6cba6892b447e8d1c91334b781458d43a626716343788ad9dd0a85bc2576f53200be
|
data/lib/keymap.rb
CHANGED
@@ -5,10 +5,10 @@ module Keymap
|
|
5
5
|
'd' => 'DEBUG',
|
6
6
|
'up' => 'PREV',
|
7
7
|
'left' => 'PREV',
|
8
|
-
'pageup' => '
|
8
|
+
'pageup' => 'PREVSEC',
|
9
9
|
'down' => 'NEXT',
|
10
10
|
'right' => 'NEXT',
|
11
|
-
'pagedown' => '
|
11
|
+
'pagedown' => 'NEXTSEC',
|
12
12
|
'R' => 'RELOAD',
|
13
13
|
'r' => 'REFRESH',
|
14
14
|
'c' => 'CONTENTS',
|
data/lib/showoff/version.rb
CHANGED
data/locales/de.yml
CHANGED
@@ -76,6 +76,8 @@ de:
|
|
76
76
|
title: Hilfe
|
77
77
|
next: Zur nächsten Folie.
|
78
78
|
prev: Zur vorherigen Folie.
|
79
|
+
nextsec: Zur nächsten Sektion.
|
80
|
+
prevsec: Zur vorherigen Sektion.
|
79
81
|
contents: Anzeigen des Inhaltsverzeichnisses.
|
80
82
|
follow: Mitverfolgen ein/aussschalten.
|
81
83
|
help: Anzeigen der Hilfe.
|
data/locales/en.yml
CHANGED
@@ -77,6 +77,8 @@ en:
|
|
77
77
|
title: Help
|
78
78
|
next: Move to the next slide.
|
79
79
|
prev: Move to the previous slide.
|
80
|
+
nextsec: Move to the next section.
|
81
|
+
prevsec: Move to the previous section.
|
80
82
|
contents: Show the table of contents menu.
|
81
83
|
follow: Toggle follow mode.
|
82
84
|
help: Show this help dialog.
|
data/locales/es.yml
CHANGED
@@ -77,6 +77,8 @@ es:
|
|
77
77
|
title: Ayuda
|
78
78
|
next: Mover a la siguiente diapositiva.
|
79
79
|
prev: Mover a la diapositiva anterior.
|
80
|
+
nextsec: Mover a la siguiente sección.
|
81
|
+
prevsec: Mover a la sección anterior.
|
80
82
|
contents: Mostrar el menú de la tabla de contenidos.
|
81
83
|
follow: Habilitar el modo de seguimiento.
|
82
84
|
help: Mostrar éste dialogo de ayuda.
|
data/locales/fr.yml
CHANGED
@@ -76,6 +76,8 @@ fr:
|
|
76
76
|
title: Aider
|
77
77
|
next: Passer à la diapositive suivante.
|
78
78
|
prev: Passer à la diapositive précédente.
|
79
|
+
nextsec: Passer à la section suivante.
|
80
|
+
prevsec: Passer à la section précédente.
|
79
81
|
contents: Afficher le menu de la table des matières.
|
80
82
|
follow: Activer le mode de suivi.
|
81
83
|
help: Afficher cette fenêtre d'aide.
|
data/locales/id.yml
ADDED
data/locales/ja.yml
CHANGED
data/locales/nl.yml
CHANGED
data/locales/pt.yml
CHANGED
data/public/js/presenter.js
CHANGED
@@ -688,6 +688,26 @@ function presNextStep()
|
|
688
688
|
update();
|
689
689
|
}
|
690
690
|
|
691
|
+
function presPrevSec()
|
692
|
+
{
|
693
|
+
prevSec();
|
694
|
+
try { slaveWindow.prevSec(false) } catch (e) {};
|
695
|
+
try { nextWindow.gotoSlide(nextSlideNum()) } catch (e) {};
|
696
|
+
postSlide();
|
697
|
+
|
698
|
+
update();
|
699
|
+
}
|
700
|
+
|
701
|
+
function presNextSec()
|
702
|
+
{
|
703
|
+
nextSec();
|
704
|
+
try { slaveWindow.nextSec(false) } catch (e) {};
|
705
|
+
try { nextWindow.gotoSlide(nextSlideNum()) } catch (e) {};
|
706
|
+
postSlide();
|
707
|
+
|
708
|
+
update();
|
709
|
+
}
|
710
|
+
|
691
711
|
function postSlide() {
|
692
712
|
if(currentSlide) {
|
693
713
|
// clear out any existing rendered forms
|
@@ -773,7 +793,9 @@ function presenterKeyDown(event){
|
|
773
793
|
switch(getAction(event)) {
|
774
794
|
case 'DEBUG': toggleDebug(); break;
|
775
795
|
case 'PREV': presPrevStep(); break; // Watch that this uses presPrevStep and not prevStep
|
796
|
+
case 'PREVSEC': presPrevSec(); break; // Same here
|
776
797
|
case 'NEXT': presNextStep(); break; // Same here
|
798
|
+
case 'NEXTSEC': presNextSec(); break; // Same here
|
777
799
|
case 'REFRESH': reloadSlides(); break;
|
778
800
|
case 'RELOAD': reloadSlides(true); break;
|
779
801
|
case 'CONTENTS': toggleContents(); break;
|
data/public/js/showoff.js
CHANGED
@@ -615,6 +615,7 @@ function clearCookies() {
|
|
615
615
|
document.cookie = "layout=;expires=Thu, 21 Sep 1979 00:00:01 UTC;";
|
616
616
|
document.cookie = "notes=;expires=Thu, 21 Sep 1979 00:00:01 UTC;";
|
617
617
|
document.cookie = "tourVersion=;expires=Thu, 21 Sep 1979 00:00:01 UTC;";
|
618
|
+
document.cookie = "presenter=;expires=Thu, 21 Sep 1979 00:00:01 UTC;";
|
618
619
|
document.cookieHash = {};
|
619
620
|
}
|
620
621
|
|
@@ -745,6 +746,16 @@ function currentSlideFromName(name) {
|
|
745
746
|
found = count;
|
746
747
|
return false;
|
747
748
|
}
|
749
|
+
var dataSection = $(slide).attr("data-section").toLowerCase();
|
750
|
+
// firstText is usually a header for the slide
|
751
|
+
var firstText = $(slide).find(".content :first").text().replace(/[\W]+/g, '-').replace(/-+$/, '').toLowerCase();
|
752
|
+
var decodedName = decodeURIComponent(name).toLowerCase();
|
753
|
+
if (decodedName == dataSection+'/'+firstText
|
754
|
+
|| name == dataSection
|
755
|
+
|| decodedName == firstText ) {
|
756
|
+
found = count;
|
757
|
+
return false;
|
758
|
+
}
|
748
759
|
count++;
|
749
760
|
});
|
750
761
|
}
|
@@ -1554,6 +1565,34 @@ function nextStep(updatepv)
|
|
1554
1565
|
}
|
1555
1566
|
}
|
1556
1567
|
|
1568
|
+
function prevSec(updatepv)
|
1569
|
+
{
|
1570
|
+
$(currentSlide).find('video').each(function() {
|
1571
|
+
console.log('Pausing videos on ' + currentSlide.attr('id'))
|
1572
|
+
$(this).get(0).pause();
|
1573
|
+
});
|
1574
|
+
|
1575
|
+
var curSec = currentSlide.attr('data-section');
|
1576
|
+
var prevSec = $('li:has(a.navSection:contains('+curSec+'))')
|
1577
|
+
.prev('li').find('ul li a:first').attr('rel');
|
1578
|
+
gotoSlide(prevSec);
|
1579
|
+
track();
|
1580
|
+
}
|
1581
|
+
|
1582
|
+
function nextSec(updatepv)
|
1583
|
+
{
|
1584
|
+
$(currentSlide).find('video').each(function() {
|
1585
|
+
console.log('Pausing videos on ' + currentSlide.attr('id'))
|
1586
|
+
$(this).get(0).pause();
|
1587
|
+
});
|
1588
|
+
|
1589
|
+
var curSec = currentSlide.attr('data-section');
|
1590
|
+
var nextSec = $('li:has(a.navSection:contains('+curSec+'))')
|
1591
|
+
.next('li').find('ul li a:first').attr('rel');
|
1592
|
+
gotoSlide(nextSec);
|
1593
|
+
track();
|
1594
|
+
}
|
1595
|
+
|
1557
1596
|
// carrying on our grand tradition of overwriting functions of the same name with presenter.js
|
1558
1597
|
function postSlide() {
|
1559
1598
|
if(currentSlide) {
|
@@ -1658,7 +1697,9 @@ function keyDown(event){
|
|
1658
1697
|
switch(getAction(event)) {
|
1659
1698
|
case 'DEBUG': toggleDebug(); break;
|
1660
1699
|
case 'PREV': prevStep(); break;
|
1700
|
+
case 'PREVSEC': prevSec(); break;
|
1661
1701
|
case 'NEXT': nextStep(); break;
|
1702
|
+
case 'NEXTSEC': nextSec(); break;
|
1662
1703
|
case 'REFRESH': reloadSlides(); break;
|
1663
1704
|
case 'RELOAD': reloadSlides(true); break;
|
1664
1705
|
case 'CONTENTS': toggleContents(); break;
|
@@ -2,14 +2,14 @@
|
|
2
2
|
var translations = {
|
3
3
|
en: {
|
4
4
|
'greeting': 'Hello there!',
|
5
|
-
'farewell':
|
5
|
+
'farewell': 'Goodbye.'
|
6
6
|
},
|
7
7
|
fr: {
|
8
8
|
'greeting': 'Bonjour!',
|
9
|
-
'farewell':
|
9
|
+
'farewell': 'Au revoir.'},
|
10
10
|
es: {
|
11
11
|
'greeting': 'Hola!',
|
12
|
-
'farewell':
|
12
|
+
'farewell': 'Adios amigo.'
|
13
13
|
}
|
14
14
|
};
|
15
15
|
|
@@ -29,19 +29,41 @@
|
|
29
29
|
strings: {}
|
30
30
|
}, options );
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
// look up from the translation table using dot notation
|
33
|
+
// returns undefined on miss
|
34
|
+
function lookup(keyword) {
|
35
|
+
return keyword.split('.').reduce(function(obj, key){
|
36
|
+
if(obj != undefined) { return obj[key] }
|
37
|
+
}, settings.strings);
|
38
|
+
}
|
35
39
|
|
36
|
-
|
37
|
-
|
40
|
+
function interpolate(text) {
|
41
|
+
var tokens = [];
|
42
|
+
var pattern = /{{([^}]+)}}/g
|
43
|
+
while (item = pattern.exec(text)) { tokens.push(item[1] ) };
|
38
44
|
|
39
|
-
|
40
|
-
|
45
|
+
tokens.forEach(function(keyword){
|
46
|
+
if(translation = lookup(keyword)) {
|
47
|
+
text = text.replace('{{'+keyword+'}}', translation);
|
41
48
|
}
|
42
|
-
}
|
49
|
+
});
|
43
50
|
|
44
|
-
return
|
51
|
+
return text;
|
52
|
+
}
|
53
|
+
|
54
|
+
function translate(item) {
|
55
|
+
// iterate through nodes contained in this element, including plain text nodes and other elements
|
56
|
+
return $(item).contents()
|
57
|
+
.each(function() {
|
58
|
+
if(this.nodeType == 3) {
|
59
|
+
// translate directly if it's text
|
60
|
+
this.replaceWith(interpolate(this.textContent));
|
61
|
+
}
|
62
|
+
else {
|
63
|
+
// otherwise recurse inside and try again
|
64
|
+
translate(this);
|
65
|
+
}
|
66
|
+
});
|
45
67
|
}
|
46
68
|
|
47
69
|
function inline_svg(img, callback) {
|
data/views/header.erb
CHANGED
@@ -53,6 +53,7 @@
|
|
53
53
|
editUrl = "<%= @edit %>";
|
54
54
|
interactive = <%= @interactive %>;
|
55
55
|
master = <%= master_presenter? %>;
|
56
|
+
presenter = <%= valid_presenter_cookie? %>;
|
56
57
|
|
57
58
|
keymap = <%= JSON.pretty_generate @keymap %>;
|
58
59
|
keycode_dictionary = <%= JSON.pretty_generate @keycode_dictionary %>;
|
data/views/help.erb
CHANGED
@@ -10,6 +10,16 @@
|
|
10
10
|
<span class="action">PREV</span>
|
11
11
|
<span class="hotkeys"><%= mapped_keys('PREV') %></span>
|
12
12
|
</div>
|
13
|
+
<div>
|
14
|
+
<span class="description"><%= I18n.t('help.nextsec') %></span>
|
15
|
+
<span class="action">NEXTSEC</span>
|
16
|
+
<span class="hotkeys"><%= mapped_keys('NEXTSEC') %></span>
|
17
|
+
</div>
|
18
|
+
<div>
|
19
|
+
<span class="description"><%= I18n.t('help.prevsec') %></span>
|
20
|
+
<span class="action">PREVSEC</span>
|
21
|
+
<span class="hotkeys"><%= mapped_keys('PREVSEC') %></span>
|
22
|
+
</div>
|
13
23
|
<div>
|
14
24
|
<span class="description"><%= I18n.t('help.contents') %></span>
|
15
25
|
<span class="action">CONTENTS</span>
|
data/views/index.erb
CHANGED
@@ -10,6 +10,10 @@
|
|
10
10
|
var autoTour = true;
|
11
11
|
|
12
12
|
$( document ).ready(function() {
|
13
|
+
if(presenter && !window.opener) {
|
14
|
+
alert('This is an audience view designed for interactivity. If you are placing this window on a projector, you should use the Display View instead.');
|
15
|
+
}
|
16
|
+
|
13
17
|
tours['showoff:activity'] = [
|
14
18
|
{
|
15
19
|
element: ".currentSlide .activityToggle",
|
@@ -73,7 +77,7 @@
|
|
73
77
|
<hr>
|
74
78
|
|
75
79
|
<% if @feedback and not @static then %>
|
76
|
-
<p><%= I18n.t('menu.pace.label') %></p>
|
80
|
+
<p><%= I18n.t('menu.pace.label') %></p>
|
77
81
|
<div id="paceWrapper">
|
78
82
|
<div id="paceSlower" class="buttonWrapper interactive">
|
79
83
|
<i class="fa fa-minus"></i>
|
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.19.
|
4
|
+
version: 0.19.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chacon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -265,6 +265,7 @@ files:
|
|
265
265
|
- locales/en.yml
|
266
266
|
- locales/es.yml
|
267
267
|
- locales/fr.yml
|
268
|
+
- locales/id.yml
|
268
269
|
- locales/ja.yml
|
269
270
|
- locales/nl.yml
|
270
271
|
- locales/pt.yml
|