showoff 0.19.3 → 0.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a66af4fa19b9d002a82e7462e0ff2c12d744396
4
- data.tar.gz: 0c16695b14e89667f5c87bbb14b29f7959bc54bd
3
+ metadata.gz: a2e85b3d4cb3a4ca82c5534fd4b927092f3f3644
4
+ data.tar.gz: 7db65a31bb8715347d29cad31126b289580c6dd0
5
5
  SHA512:
6
- metadata.gz: a1dad721827fc36f22b2543b21ec3affe9979b38719dc150df31b1b348134fdc524684cec211936a83aa5b8b99c65c97b00787461e8f5988e39e3f7db870d3e2
7
- data.tar.gz: fcc295154155d5f098be51a0d7e28fb7e686d042567a6ca7f509edf21d0ac8bbb82269e3f2384c1e65d5bf0d6acc28f3995ae1bdbfbd879f9acc4fa6424e6717
6
+ metadata.gz: e1eb97c5ad914d5a80335e0787a6672b031aa051d0ec0761f6d7ff345dc8fbdcd92c7504b81765b587b4caeb24926a0e61f93e33a95bf82e3a9c2408d087c39d
7
+ data.tar.gz: cae2c69158bb9c9fd86b9169ed6c1a802ee779ffc7171aa66f835df4025c6cba6892b447e8d1c91334b781458d43a626716343788ad9dd0a85bc2576f53200be
@@ -5,10 +5,10 @@ module Keymap
5
5
  'd' => 'DEBUG',
6
6
  'up' => 'PREV',
7
7
  'left' => 'PREV',
8
- 'pageup' => 'PREV',
8
+ 'pageup' => 'PREVSEC',
9
9
  'down' => 'NEXT',
10
10
  'right' => 'NEXT',
11
- 'pagedown' => 'NEXT',
11
+ 'pagedown' => 'NEXTSEC',
12
12
  'R' => 'RELOAD',
13
13
  'r' => 'REFRESH',
14
14
  'c' => 'CONTENTS',
@@ -1,3 +1,3 @@
1
1
  # No namespace here since ShowOff is a class and I'd have to inherit from
2
2
  # Sinatra::Application (which we don't want to load here)
3
- SHOWOFF_VERSION = '0.19.3'
3
+ SHOWOFF_VERSION = '0.19.4'
@@ -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.
@@ -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.
@@ -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.
@@ -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.
@@ -0,0 +1,2 @@
1
+ id:
2
+ name: Showoff Presentation
@@ -77,6 +77,8 @@ ja:
77
77
  title: ヘルプ
78
78
  next: 次のスライドに移動します。
79
79
  prev: 前のスライドに移動します。
80
+ nextsec: 次のセクションに移動します。
81
+ prevsec: 前のセクションに移動します。
80
82
  contents: 目次メニュを表示する。
81
83
  follow: フォローモードを切り替えます。
82
84
  help: このヘルプダイアログを表示します。
@@ -76,6 +76,8 @@ nl:
76
76
  title: Help
77
77
  next: Ga naar de volgende slide.
78
78
  prev: Ga naar de vorige slide.
79
+ nextsec: Ga naar de volgende deel.
80
+ prevsec: Ga naar de vorige deel.
79
81
  contents: Toon de inhoudsopgave.
80
82
  follow: Schakel volgmodus in.
81
83
  help: Toon dit scherm.
@@ -76,6 +76,8 @@ pt:
76
76
  title: Ajuda
77
77
  next: Ir para o próximo slide.
78
78
  prev: Ir para o slide anterior.
79
+ nextsec: Ir para a próxima seção.
80
+ prevsec: Ir para a seção anterior.
79
81
  contents: Mostrar o Índice.
80
82
  follow: Alternar modo seguidor.
81
83
  help: Mostrar esta ajuda.
@@ -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;
@@ -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': "Goodbye.'
5
+ 'farewell': 'Goodbye.'
6
6
  },
7
7
  fr: {
8
8
  'greeting': 'Bonjour!',
9
- 'farewell': "Au revoir.'}.
9
+ 'farewell': 'Au revoir.'},
10
10
  es: {
11
11
  'greeting': 'Hola!',
12
- 'farewell': "Adios amigo.'
12
+ 'farewell': 'Adios amigo.'
13
13
  }
14
14
  };
15
15
 
@@ -29,19 +29,41 @@
29
29
  strings: {}
30
30
  }, options );
31
31
 
32
- function translate(item) {
33
- item = $(item);
34
- var text = item.text();
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
- if(matches = text.match(/^{{(.*)}}$/) ) {
37
- keyword = matches[1];
40
+ function interpolate(text) {
41
+ var tokens = [];
42
+ var pattern = /{{([^}]+)}}/g
43
+ while (item = pattern.exec(text)) { tokens.push(item[1] ) };
38
44
 
39
- if(keyword in settings.strings) {
40
- item.text(settings.strings[keyword]);
45
+ tokens.forEach(function(keyword){
46
+ if(translation = lookup(keyword)) {
47
+ text = text.replace('{{'+keyword+'}}', translation);
41
48
  }
42
- }
49
+ });
43
50
 
44
- return item;
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) {
@@ -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 %>;
@@ -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>
@@ -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.3
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: 2017-10-25 00:00:00.000000000 Z
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