showoff 0.19.4 → 0.19.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a2e85b3d4cb3a4ca82c5534fd4b927092f3f3644
4
- data.tar.gz: 7db65a31bb8715347d29cad31126b289580c6dd0
3
+ metadata.gz: e7d89a81580e427dec3aeac374f270da7d41086f
4
+ data.tar.gz: 05d8ae0e8cc50901278c78b9a4863aca8229dece
5
5
  SHA512:
6
- metadata.gz: e1eb97c5ad914d5a80335e0787a6672b031aa051d0ec0761f6d7ff345dc8fbdcd92c7504b81765b587b4caeb24926a0e61f93e33a95bf82e3a9c2408d087c39d
7
- data.tar.gz: cae2c69158bb9c9fd86b9169ed6c1a802ee779ffc7171aa66f835df4025c6cba6892b447e8d1c91334b781458d43a626716343788ad9dd0a85bc2576f53200be
6
+ metadata.gz: 2ef1768cbda7e7162c7a0002be3d05c6b7ac8ef4853daa05d0b7f141bd778c2820326538318d2cab87288a4b2a3fa0572989504ac4e05a2d291abfe5a5227415
7
+ data.tar.gz: 0d005aa1173803fb79356db0cd0f882c2f493f071931ff48a9ddcd79791cc9884fbd702ce5026d63c9a97b2ab0bbcc5e06211bdc0a6f147f81d9d7f32dce78aa
@@ -1,14 +1,21 @@
1
1
  module Keymap
2
2
  def self.default()
3
3
  {
4
- 'space' => 'NEXT',
5
4
  'd' => 'DEBUG',
6
- 'up' => 'PREV',
7
- 'left' => 'PREV',
8
- 'pageup' => 'PREVSEC',
5
+ 'space' => 'NEXT',
9
6
  'down' => 'NEXT',
10
7
  'right' => 'NEXT',
11
- 'pagedown' => 'NEXTSEC',
8
+ 'pagedown' => 'NEXT',
9
+ 'up' => 'PREV',
10
+ 'left' => 'PREV',
11
+ 'pageup' => 'PREV',
12
+ 'SPACE' => 'NEXTSEC',
13
+ 'DOWN' => 'NEXTSEC',
14
+ 'RIGHT' => 'NEXTSEC',
15
+ 'PAGEDOWN' => 'NEXTSEC',
16
+ 'UP' => 'PREVSEC',
17
+ 'LEFT' => 'PREVSEC',
18
+ 'PAGEUP' => 'PREVSEC',
12
19
  'R' => 'RELOAD',
13
20
  'r' => 'REFRESH',
14
21
  'c' => 'CONTENTS',
@@ -169,6 +176,13 @@ module Keymap
169
176
  "`" => "~",
170
177
  "=" => "+",
171
178
  "-" => "_",
179
+ "space" => "SPACE",
180
+ "down" => "DOWN",
181
+ "right" => "RIGHT",
182
+ "pagedown" => "PAGEDOWN",
183
+ "up" => "UP",
184
+ "left" => "LEFT",
185
+ "pageup" => "PAGEUP",
172
186
  }
173
187
  end
174
188
 
@@ -506,6 +506,7 @@ class ShowOff < Sinatra::Application
506
506
 
507
507
  # Apply the template to the slide and replace the key to generate the content of the slide
508
508
  sl = process_content_for_replacements(template.gsub(/~~~CONTENT~~~/, slide.text))
509
+ sl = process_content_for_language(sl, I18n.locale)
509
510
  sl = Tilt[:markdown].new(nil, nil, @engine_options) { sl }.render
510
511
  sl = build_forms(sl, content_classes)
511
512
  sl = update_p_classes(sl)
@@ -535,6 +536,21 @@ class ShowOff < Sinatra::Application
535
536
  final
536
537
  end
537
538
 
539
+ def process_content_for_language(content, locale)
540
+ lang = locale.to_s.split('-').first
541
+ result = content
542
+
543
+ content.scan(/^((~~~LANG:([\w-]+)~~~\n)(.+?)(\n~~~ENDLANG~~~\n))/m).each do |match|
544
+ if match[2] == lang or match[2] == locale.to_s
545
+ result.sub!(match[0], match[3])
546
+ else
547
+ result.sub!(match[0], "\n")
548
+ end
549
+ end
550
+
551
+ result
552
+ end
553
+
538
554
  # This method processes the content of the slide and replaces
539
555
  # content markers with their actual value information
540
556
  def process_content_for_replacements(content)
@@ -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.4'
3
+ SHOWOFF_VERSION = '0.19.6'
@@ -3,60 +3,6 @@
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <%= erb :header %>
6
-
7
- <script type="text/javascript">
8
- // We want the audience members to see automatic tours. We can assume that they won't be
9
- // using many server domains like the presenter might.
10
- var autoTour = true;
11
-
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
-
17
- tours['showoff:activity'] = [
18
- {
19
- element: ".currentSlide .activityToggle",
20
- intro: I18n.t('tour.activity.complete')
21
- }
22
- ];
23
-
24
- tours['showoff:form'] = [
25
- {
26
- element: ".currentSlide input.save",
27
- intro: I18n.t('tour.form.save')
28
- }
29
- ];
30
-
31
- tours['showoff:menu'] = [
32
- {
33
- element: "#hamburger",
34
- intro: I18n.t('tour.menu.start')
35
- },
36
- {
37
- element: "#navToggle",
38
- intro: I18n.t('tour.menu.navigation')
39
- },
40
- {
41
- element: "#fileDownloads",
42
- intro: I18n.t('tour.menu.download')
43
- },
44
- {
45
- element: "#paceFaster",
46
- intro: I18n.t('tour.menu.pace')
47
- },
48
- {
49
- element: "#questionToggle",
50
- intro: I18n.t('tour.menu.questions')
51
- },
52
- {
53
- element: "#feedbackToggle",
54
- intro: I18n.t('tour.menu.feedback')
55
- }
56
- ].filter(function(item) { return (document.querySelector(item['element'])) });
57
- // display tips for only the enabled features
58
- });
59
- </script>
60
6
  </head>
61
7
 
62
8
  <body>
@@ -175,5 +121,59 @@
175
121
  <%= @pause_msg %>
176
122
  </div>
177
123
 
124
+ <script defer type="text/javascript">
125
+ // We want the audience members to see automatic tours. We can assume that they won't be
126
+ // using many server domains like the presenter might.
127
+ var autoTour = true;
128
+
129
+ $( document ).ready(function() {
130
+ if(presenter && !window.opener) {
131
+ 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.');
132
+ }
133
+
134
+ tours['showoff:activity'] = [
135
+ {
136
+ element: ".currentSlide .activityToggle",
137
+ intro: I18n.t('tour.activity.complete')
138
+ }
139
+ ];
140
+
141
+ tours['showoff:form'] = [
142
+ {
143
+ element: ".currentSlide input.save",
144
+ intro: I18n.t('tour.form.save')
145
+ }
146
+ ];
147
+
148
+ tours['showoff:menu'] = [
149
+ {
150
+ element: "#hamburger",
151
+ intro: I18n.t('tour.menu.start')
152
+ },
153
+ {
154
+ element: "#navToggle",
155
+ intro: I18n.t('tour.menu.navigation')
156
+ },
157
+ {
158
+ element: "#fileDownloads",
159
+ intro: I18n.t('tour.menu.download')
160
+ },
161
+ {
162
+ element: "#paceFaster",
163
+ intro: I18n.t('tour.menu.pace')
164
+ },
165
+ {
166
+ element: "#questionToggle",
167
+ intro: I18n.t('tour.menu.questions')
168
+ },
169
+ {
170
+ element: "#feedbackToggle",
171
+ intro: I18n.t('tour.menu.feedback')
172
+ }
173
+ ].filter(function(item) { return (document.querySelector(item['element'])) });
174
+ // display tips for only the enabled features
175
+ });
176
+ </script>
177
+
178
178
  </body>
179
179
  </html>
@@ -8,117 +8,6 @@
8
8
 
9
9
  <script type="text/javascript" src="<%= @asset_path %>/js/TimeCircles-89ac5ae.js"></script>
10
10
  <script type="text/javascript" src="<%= @asset_path %>/js/presenter.js?v=<%= SHOWOFF_VERSION %>"></script>
11
-
12
- <script type="text/javascript">
13
- editUrl = "<%= @edit %>";
14
- issueUrl = "<%= @issues %>";
15
- autoTour = false;
16
-
17
- // increment this each time we add features with new tour stops.
18
- tourVersion = 1;
19
-
20
- $(function() {
21
- tours['showoff:activity'] = [
22
- {
23
- element: ".currentSlide .count",
24
- intro: I18n.t('tour.activity.count')
25
- }
26
- ];
27
-
28
- tours['showoff:form'] = [
29
- {
30
- element: "#notes",
31
- intro: I18n.t('tour.form.responses'),
32
- scrollToElement: false
33
- },
34
- {
35
- element: ".currentSlide input.display",
36
- intro: I18n.t('tour.form.display')
37
- }
38
- ];
39
-
40
- tours['showoff:presenter'] = [
41
- {
42
- intro: I18n.t('tour.welcome'),
43
- version: 1
44
- },
45
- {
46
- element: "#slaveWindow",
47
- intro: I18n.t('tour.displayview'),
48
- version: 1
49
- },
50
- {
51
- element: "#annotationLabel",
52
- intro: I18n.t('tour.annotations'),
53
- version: 1
54
- },
55
- {
56
- element: "#timerSection",
57
- intro: I18n.t('tour.timer'),
58
- version: 1
59
- },
60
- {
61
- element: "#feedbackPace",
62
- intro: I18n.t('tour.pace'),
63
- version: 1
64
- },
65
- {
66
- element: "#questions",
67
- intro: I18n.t('tour.questions'),
68
- version: 1
69
- },
70
- {
71
- element: "#notes-controls",
72
- intro: I18n.t('tour.notes'),
73
- highlightClass: "tourDark",
74
- version: 1
75
- },
76
- {
77
- element: "#slideSource",
78
- intro: I18n.t('tour.slidesource'),
79
- version: 1
80
- },
81
- {
82
- element: "#settings",
83
- intro: I18n.t('tour.settings'),
84
- version: 1
85
- },
86
- {
87
- element: "#edit",
88
- intro: I18n.t('tour.edit'),
89
- version: 1
90
- },
91
- {
92
- element: "#report",
93
- intro: I18n.t('tour.report'),
94
- version: 1
95
- }
96
- ].filter(function(item) {
97
- // filter out tips for features that have been turned off
98
- return ((item['element'] == undefined) || document.querySelector(item['element']));
99
- });
100
-
101
- // Only autoshow when served from localhost, since we don't know if we have a consistent domain for our cookie otherwise.
102
- if ( location.hostname == 'localhost' || location.hostname == '127.0.0.1' ) {
103
-
104
- // enables the flag that shows feature tours
105
- autoTour = true;
106
-
107
- var clientTour = document.cookieHash['tourVersion'] || 0;
108
- if(clientTour < tourVersion) {
109
- // now make a temporary duplicate of only recent items
110
- tours['showoff:presenter:auto'] = tours['showoff:presenter'].filter(function(item) {
111
- return (item['version'] > clientTour);
112
- });
113
-
114
- // we don't need to let this record, because we've already tested clientTour
115
- showTour('showoff:presenter:auto', false);
116
- }
117
-
118
- }
119
- });
120
-
121
- </script>
122
11
  </head>
123
12
 
124
13
  <body class="presenter">
@@ -311,5 +200,117 @@
311
200
  <%= @slides %>
312
201
  </div>
313
202
  </div><!-- end pagewrapper -->
203
+
204
+ <script defer type="text/javascript">
205
+ editUrl = "<%= @edit %>";
206
+ issueUrl = "<%= @issues %>";
207
+ autoTour = false;
208
+
209
+ // increment this each time we add features with new tour stops.
210
+ tourVersion = 1;
211
+
212
+ $(function() {
213
+ tours['showoff:activity'] = [
214
+ {
215
+ element: ".currentSlide .count",
216
+ intro: I18n.t('tour.activity.count')
217
+ }
218
+ ];
219
+
220
+ tours['showoff:form'] = [
221
+ {
222
+ element: "#notes",
223
+ intro: I18n.t('tour.form.responses'),
224
+ scrollToElement: false
225
+ },
226
+ {
227
+ element: ".currentSlide input.display",
228
+ intro: I18n.t('tour.form.display')
229
+ }
230
+ ];
231
+
232
+ tours['showoff:presenter'] = [
233
+ {
234
+ intro: I18n.t('tour.welcome'),
235
+ version: 1
236
+ },
237
+ {
238
+ element: "#slaveWindow",
239
+ intro: I18n.t('tour.displayview'),
240
+ version: 1
241
+ },
242
+ {
243
+ element: "#annotationLabel",
244
+ intro: I18n.t('tour.annotations'),
245
+ version: 1
246
+ },
247
+ {
248
+ element: "#timerSection",
249
+ intro: I18n.t('tour.timer'),
250
+ version: 1
251
+ },
252
+ {
253
+ element: "#feedbackPace",
254
+ intro: I18n.t('tour.pace'),
255
+ version: 1
256
+ },
257
+ {
258
+ element: "#questions",
259
+ intro: I18n.t('tour.questions'),
260
+ version: 1
261
+ },
262
+ {
263
+ element: "#notes-controls",
264
+ intro: I18n.t('tour.notes'),
265
+ highlightClass: "tourDark",
266
+ version: 1
267
+ },
268
+ {
269
+ element: "#slideSource",
270
+ intro: I18n.t('tour.slidesource'),
271
+ version: 1
272
+ },
273
+ {
274
+ element: "#settings",
275
+ intro: I18n.t('tour.settings'),
276
+ version: 1
277
+ },
278
+ {
279
+ element: "#edit",
280
+ intro: I18n.t('tour.edit'),
281
+ version: 1
282
+ },
283
+ {
284
+ element: "#report",
285
+ intro: I18n.t('tour.report'),
286
+ version: 1
287
+ }
288
+ ].filter(function(item) {
289
+ // filter out tips for features that have been turned off
290
+ return ((item['element'] == undefined) || document.querySelector(item['element']));
291
+ });
292
+
293
+ // Only autoshow when served from localhost, since we don't know if we have a consistent domain for our cookie otherwise.
294
+ if ( location.hostname == 'localhost' || location.hostname == '127.0.0.1' ) {
295
+
296
+ // enables the flag that shows feature tours
297
+ autoTour = true;
298
+
299
+ var clientTour = document.cookieHash['tourVersion'] || 0;
300
+ if(clientTour < tourVersion) {
301
+ // now make a temporary duplicate of only recent items
302
+ tours['showoff:presenter:auto'] = tours['showoff:presenter'].filter(function(item) {
303
+ return (item['version'] > clientTour);
304
+ });
305
+
306
+ // we don't need to let this record, because we've already tested clientTour
307
+ showTour('showoff:presenter:auto', false);
308
+ }
309
+
310
+ }
311
+ });
312
+
313
+ </script>
314
+
314
315
  </body>
315
316
  </html>
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
4
+ version: 0.19.6
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: 2018-02-13 00:00:00.000000000 Z
12
+ date: 2018-03-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -211,16 +211,16 @@ dependencies:
211
211
  name: commonmarker
212
212
  requirement: !ruby/object:Gem::Requirement
213
213
  requirements:
214
- - - "<="
214
+ - - ">="
215
215
  - !ruby/object:Gem::Version
216
- version: 0.14.4
216
+ version: '0'
217
217
  type: :runtime
218
218
  prerelease: false
219
219
  version_requirements: !ruby/object:Gem::Requirement
220
220
  requirements:
221
- - - "<="
221
+ - - ">="
222
222
  - !ruby/object:Gem::Version
223
- version: 0.14.4
223
+ version: '0'
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: mg
226
226
  requirement: !ruby/object:Gem::Requirement