showoff 0.17.0 → 0.17.1

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: 210a91a071a71b8ec4de4b9c128917eb19eb1f2c
4
- data.tar.gz: f0cc7f2e1efc78af6bc92dfea9726d45db035425
3
+ metadata.gz: b65ae2cdb55992dc61f317faf924fd93cdefd594
4
+ data.tar.gz: f4331abee28540e37e8362c52ffe87c705405f07
5
5
  SHA512:
6
- metadata.gz: e62e8471ed1070766e8cf84d5387403d7a97ab245dabd5125595b5d986d73ab0b79ceb20ff0abfba06919b4ba9cfa45e45fcdea3b651a6a0fb4937ba17e6d239
7
- data.tar.gz: 7c11b48e407c3fe975924e14a00a18ada6d74781029186f84e87d731ac5d0cd119272ff78a6ea0094c83e5fbb924bb017584ddb5271b76fce72caa2ee91050e5
6
+ metadata.gz: f74cea3ee9a73a8b9240bcd7d11d909766ce6ecb38ec8fc57cea3ff1a57f803b5475b2afa0121685230154ae51c64751cb3d80972eddd71fd2d901ba58640efc
7
+ data.tar.gz: 938c693644cd33d34b9945131cc6c607d32fa6f162f03f4ce4a166e9eb37532fcf0d6074b9da0e254124ed5ee1a9351d3697312fd667118077eab74a652ad0be
data/lib/showoff.rb CHANGED
@@ -521,6 +521,8 @@ class ShowOff < Sinatra::Application
521
521
 
522
522
  # Process links
523
523
  doc.css('a').each do |link|
524
+ next unless link.include? 'href'
525
+ next unless link.include? 'class'
524
526
  next if link['href'].start_with? '#'
525
527
  next if link['class'].split.include? 'processed' rescue nil
526
528
 
@@ -1016,7 +1018,7 @@ class ShowOff < Sinatra::Application
1016
1018
  data << process_markdown(path, section, File.read(filename), opts)
1017
1019
  rescue Errno::ENOENT => e
1018
1020
  @logger.error e.message
1019
- data << process_markdown(path, section, "!SLIDE\n# Missing File!\n## #{fname}", opts)
1021
+ data << process_markdown(path, section, "!SLIDE\n# Missing File!\n## #{filename}", opts)
1020
1022
  end
1021
1023
  end
1022
1024
 
@@ -1766,6 +1768,8 @@ class ShowOff < Sinatra::Application
1766
1768
  end
1767
1769
  rescue NoMethodError => e
1768
1770
  @logger.warn "Invalid object #{what} requested."
1771
+ @logger.warn e.message
1772
+ @logger.debug e.backtrace.join("\n")
1769
1773
  raise Sinatra::NotFound
1770
1774
  end
1771
1775
  end
@@ -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.17.0'
3
+ SHOWOFF_VERSION = '0.17.1'
data/lib/showoff_utils.rb CHANGED
@@ -441,17 +441,12 @@ class ShowOffUtils
441
441
  # each entry in sections can be:
442
442
  # - "filename.md"
443
443
  # - { "section": "filename.md" }
444
+ # - { "section": "directory" }
444
445
  # - { "section": [ "array.md, "of.md, "files.md"] }
445
446
  # - { "include": "sections.json" }
446
447
  sections = {}
447
448
  data.map do |entry|
448
- if entry.is_a? String
449
- if File.directory? entry
450
- next Dir.glob("#{entry}/**/*.md").sort
451
- else
452
- next entry
453
- end
454
- end
449
+ next entry if entry.is_a? String
455
450
  next nil unless entry.is_a? Hash
456
451
  next entry['section'] if entry.include? 'section'
457
452
 
@@ -476,9 +471,15 @@ class ShowOffUtils
476
471
  # We do this in two passes simply because most of it was already done
477
472
  # and I don't want to waste time on legacy functionality.
478
473
  path = File.dirname(filename)
479
-
480
474
  sections[path] ||= []
481
- sections[path] << filename
475
+
476
+ if File.directory? filename
477
+ Dir.glob("#{filename}/**/*.md").sort.each do |slidefile|
478
+ sections[path] << slidefile
479
+ end
480
+ else
481
+ sections[path] << filename
482
+ end
482
483
  end
483
484
  sections
484
485
  end
@@ -617,21 +617,22 @@ a.controls {
617
617
  }
618
618
 
619
619
  /* hide some elements when the screen is too small */
620
- @media screen and (max-width: 900px)
621
- {
622
- #topbar .fa {
620
+ @media screen and (max-width: 1024px) {
621
+ #links .fa {
623
622
  display: none;
624
623
  }
625
- .desktop a {
626
- margin-right: 0.25em;
627
- }
628
624
  }
629
625
 
626
+ @media screen and (max-width: 880px) {
627
+ #topbar #printSlides,
628
+ #topbar #statslink {
629
+ display: none;
630
+ }
631
+ }
630
632
 
631
633
  /* iPhone */
632
634
  /* Portrait */
633
- @media screen and (max-width: 480px)
634
- {
635
+ @media screen and (max-width: 640px) {
635
636
  .no-mobile {
636
637
  display: none;
637
638
  }
@@ -686,15 +687,9 @@ a.controls {
686
687
  display: inline;
687
688
  }
688
689
 
689
- #topbar {
690
- background-image: url(menu.png);
691
- background-position: left center;
692
- background-repeat: no-repeat;
693
- }
694
690
  #sidebar {
695
691
  display: block;
696
692
  position: absolute;
697
- top: 25px;
698
693
  z-index: 99999;
699
694
  height: 100%;
700
695
  overflow: scroll;
@@ -135,6 +135,11 @@ pre code {
135
135
  }
136
136
  }
137
137
 
138
+ .ui-button:active {
139
+ border-color: #263238;
140
+ background-color: #263238;
141
+ }
142
+
138
143
  /* plain (non-bullet) text */
139
144
  .content > p,
140
145
  .content > form > p {
@@ -284,64 +289,6 @@ img#disconnected {
284
289
  display: none;
285
290
  }
286
291
 
287
- #help {
288
- display: none;
289
- position:absolute;
290
- overflow: auto;
291
- top: 5%;
292
- left: 25%;
293
- width: 50%;
294
- max-height: 90%;
295
- z-index: 2147483647;
296
- padding: 0 16px 16px 16px;
297
- border-radius: 4px;
298
- -webkit-box-shadow:0 0 25px rgba(0,0,0,0.35);
299
- -moz-box-shadow:0 0 25px rgba(0,0,0,0.35);
300
- box-shadow:0 0 25px rgba(0,0,0,0.35);
301
- background-color: #fff;
302
- font-size: 0.75em;
303
- }
304
-
305
- #help div {
306
- padding: 6px 0;
307
- }
308
-
309
- #help h1 {
310
- border-bottom: 2px solid #ccc;
311
- }
312
-
313
- #help div + div {
314
- border-top: 1px solid #eee;
315
- }
316
-
317
- #help .description,
318
- #help .action,
319
- #help .hotkeys {
320
- display: inline-block;
321
- vertical-align: middle;
322
- }
323
-
324
- #help .description {
325
- width: 30%;
326
- }
327
-
328
- #help .action {
329
- width: 15%;
330
- color: gray;
331
- }
332
-
333
- #help .hotkeys {
334
- width: 25%;
335
- }
336
-
337
- #help .hotkeys .key {
338
- border: 1px solid #ccc;
339
- background-color: #dfdfdf;
340
- border-radius: 0.25em;
341
- padding: 0.15em 0.5em;
342
- margin: 0.25em;
343
- }
344
-
345
292
  /**********************************
346
293
  *** Table styling ***
347
294
  **********************************/
@@ -800,13 +747,21 @@ form .element {
800
747
  /*****************
801
748
  *** modals ***
802
749
  *****************/
750
+ #help-modal {
751
+ font-size: .9em;
752
+ }
753
+
754
+ #help-modal .ui-dialog .ui-dialog-title {
755
+ font-size: 1em;
756
+ }
757
+
803
758
  .ui-dialog.ui-widget-content {
804
759
  border: none;
805
760
  box-shadow:0 0 25px rgba(0,0,0,0.35);
806
761
  }
807
762
 
808
763
  .ui-dialog .links,
809
- .ui-dialog .description,
764
+ #settings-modal .description,
810
765
  .ui-dialog select {
811
766
  font-size: .75em;
812
767
  }
@@ -835,6 +790,10 @@ form .element {
835
790
  padding-left: 1em;
836
791
  }
837
792
 
793
+ .ui-dialog .ui-button {
794
+ font-size: .8em;
795
+ }
796
+
838
797
  .ui-dialog .links {
839
798
  text-align: right;
840
799
  }
@@ -853,6 +812,42 @@ form .element {
853
812
  display: none;
854
813
  }
855
814
 
815
+ #help div {
816
+ padding: 6px 0;
817
+ }
818
+
819
+ #help div + div {
820
+ border-top: 1px solid #eee;
821
+ }
822
+
823
+ #help .description,
824
+ #help .action,
825
+ #help .hotkeys {
826
+ display: inline-block;
827
+ vertical-align: middle;
828
+ }
829
+
830
+ #help .description {
831
+ width: 30%;
832
+ }
833
+
834
+ #help .action {
835
+ width: 15%;
836
+ color: gray;
837
+ }
838
+
839
+ #help .hotkeys {
840
+ width: 25%;
841
+ }
842
+
843
+ #help .hotkeys .key {
844
+ border: 1px solid #ccc;
845
+ background-color: #dfdfdf;
846
+ border-radius: 0.25em;
847
+ padding: 0.15em 0.5em;
848
+ margin: 0.25em;
849
+ }
850
+
856
851
  /*****************
857
852
  *** end modal ***
858
853
  *****************/
@@ -79,10 +79,6 @@ $(document).ready(function(){
79
79
  bind('swipeleft', presNextStep). // next
80
80
  bind('swiperight', presPrevStep); // prev
81
81
 
82
- $('#topbar #slideSource').click( function(e) {
83
- $('#sidebar').toggle();
84
- });
85
-
86
82
  $('#topbar #update').click( function(e) {
87
83
  e.preventDefault();
88
84
  $.get("/getpage", function(data) {
data/public/js/showoff.js CHANGED
@@ -91,6 +91,21 @@ function setupPreso(load_slides, prefix) {
91
91
  // yes, this is a global
92
92
  annotations = new Annotate();
93
93
 
94
+ $("#help-modal").dialog({
95
+ autoOpen: false,
96
+ dialogClass: "no-close",
97
+ draggable: false,
98
+ height: 640,
99
+ modal: true,
100
+ resizable: false,
101
+ width: 640,
102
+ buttons: {
103
+ Close: function() {
104
+ $( this ).dialog( "close" );
105
+ }
106
+ }
107
+ });
108
+
94
109
  // wait until the presentation is loaded to hook up the previews.
95
110
  $("body").bind("showoff:loaded", function (event) {
96
111
  $('#navigation li a.navItem').hover(function() {
@@ -225,7 +240,15 @@ function zoom(presenter) {
225
240
  }
226
241
 
227
242
  // Calculate margins to center the thing *before* scaling
228
- var hMargin = (hBody - hSlide) /2;
243
+ // On mobile, we'll top align, everywhere else vertical center it.
244
+ if(mobile()) {
245
+ // (center of slide to top) - (half of the zoomed slide)
246
+ //var hMargin = (hSlide/2 * newZoom) - (hSlide / 2);
247
+ var hMargin = (hSlide * newZoom - hSlide) / 2;
248
+ }
249
+ else {
250
+ var hMargin = (hBody - hSlide) /2;
251
+ }
229
252
  var wMargin = (wBody - wSlide) /2;
230
253
 
231
254
  preso.css("margin", hMargin + "px " + wMargin + "px");
@@ -1361,7 +1384,8 @@ function toggleFooter() {
1361
1384
  }
1362
1385
 
1363
1386
  function toggleHelp () {
1364
- $('#help').toggle();
1387
+ var help = $("#help-modal");
1388
+ help.dialog("isOpen") ? help.dialog("close") : help.dialog("open");
1365
1389
  }
1366
1390
 
1367
1391
  function toggleContents () {
@@ -1685,7 +1709,7 @@ function setupStats(data)
1685
1709
 
1686
1710
  /* Is this a mobile device? */
1687
1711
  function mobile() {
1688
- return ( $(window).width() <= 480 )
1712
+ return ( $(window).width() <= 640 )
1689
1713
  }
1690
1714
 
1691
1715
  /* check browser support for one or more css properties */
data/views/header.erb CHANGED
@@ -25,6 +25,7 @@
25
25
  <script type="text/javascript" src="<%= @asset_path %>/js/zoomline-0.0.1.js"></script>
26
26
  <script type="text/javascript" src="<%= @asset_path %>/js/highlight.pack-9.2.0.js"></script>
27
27
  <script type="text/javascript" src="<%= @asset_path %>/js/mermaid-6.0.0-min.js"></script>
28
+ <script type="text/javascript" src="<%= @asset_path %>/js/jquery-ui-1.12.1.js"></script>
28
29
 
29
30
  <script type="text/javascript" src="<%= @asset_path %>/js/coffee-script-1.1.3-pre.js"></script>
30
31
 
data/views/help.erb CHANGED
@@ -1,84 +1,85 @@
1
- <div id="help">
2
- <h1>Showoff Hotkeys</h1>
3
- <div>
4
- <span class="description">Move to the next slide.</span>
5
- <span class="action">NEXT</span>
6
- <span class="hotkeys"><%= mapped_keys('NEXT') %></span>
7
- </div>
8
- <div>
9
- <span class="description">Move to the previous slide.</span>
10
- <span class="action">PREV</span>
11
- <span class="hotkeys"><%= mapped_keys('PREV') %></span>
12
- </div>
13
- <div>
14
- <span class="description">Show the table of contents menu.</span>
15
- <span class="action">CONTENTS</span>
16
- <span class="hotkeys"><%= mapped_keys('CONTENTS') %></span>
17
- </div>
18
- <div>
19
- <span class="description">Toggle follow mode.</span>
20
- <span class="action">FOLLOW</span>
21
- <span class="hotkeys"><%= mapped_keys('FOLLOW') %></span>
22
- </div>
23
- <div>
24
- <span class="description">Show this help dialog.</span>
25
- <span class="action">HELP</span>
26
- <span class="hotkeys"><%= mapped_keys('HELP') %></span>
27
- </div>
1
+ <div id="help-modal" title="Help">
2
+ <div id="help">
3
+ <div>
4
+ <span class="description">Move to the next slide.</span>
5
+ <span class="action">NEXT</span>
6
+ <span class="hotkeys"><%= mapped_keys('NEXT') %></span>
7
+ </div>
8
+ <div>
9
+ <span class="description">Move to the previous slide.</span>
10
+ <span class="action">PREV</span>
11
+ <span class="hotkeys"><%= mapped_keys('PREV') %></span>
12
+ </div>
13
+ <div>
14
+ <span class="description">Show the table of contents menu.</span>
15
+ <span class="action">CONTENTS</span>
16
+ <span class="hotkeys"><%= mapped_keys('CONTENTS') %></span>
17
+ </div>
18
+ <div>
19
+ <span class="description">Toggle follow mode.</span>
20
+ <span class="action">FOLLOW</span>
21
+ <span class="hotkeys"><%= mapped_keys('FOLLOW') %></span>
22
+ </div>
23
+ <div>
24
+ <span class="description">Show this help dialog.</span>
25
+ <span class="action">HELP</span>
26
+ <span class="hotkeys"><%= mapped_keys('HELP') %></span>
27
+ </div>
28
28
 
29
- <hr />
29
+ <hr />
30
30
 
31
- <div>
32
- <span class="description">Refresh slide content.</span>
33
- <span class="action">REFRESH</span>
34
- <span class="hotkeys"><%= mapped_keys('REFRESH') %></span>
35
- </div>
36
- <div>
37
- <span class="description">Completely reload Showoff.</span>
38
- <span class="action">RELOAD</span>
39
- <span class="hotkeys"><%= mapped_keys('RELOAD') %></span>
40
- </div>
41
- <div>
42
- <span class="description">Blank the screen.</span>
43
- <span class="action">BLANK</span>
44
- <span class="hotkeys"><%= mapped_keys('BLANK') %></span>
45
- </div>
46
- <div>
47
- <span class="description">Toggle the display footer.</span>
48
- <span class="action">FOOTER</span>
49
- <span class="hotkeys"><%= mapped_keys('FOOTER') %></span>
50
- </div>
51
- <div>
52
- <span class="description">Toggle notes display.</span>
53
- <span class="action">NOTES</span>
54
- <span class="hotkeys"><%= mapped_keys('NOTES') %></span>
55
- </div>
56
- <div>
57
- <span class="description">Clear code execution results.</span>
58
- <span class="action">CLEAR</span>
59
- <span class="hotkeys"><%= mapped_keys('CLEAR') %></span>
60
- </div>
61
- <div>
62
- <span class="description">Pause the presentation.</span>
63
- <span class="action">PAUSE</span>
64
- <span class="hotkeys"><%= mapped_keys('PAUSE') %></span>
65
- </div>
66
- <div>
67
- <span class="description">Display slideshow of <tt>preshow</tt> images on a timer.</span>
68
- <span class="action">PRESHOW</span>
69
- <span class="hotkeys"><%= mapped_keys('PRESHOW') %></span>
70
- </div>
71
- <div>
72
- <span class="description">Execute the first visible code block.</span>
73
- <span class="action">EXECUTE</span>
74
- <span class="hotkeys"><%= mapped_keys('EXECUTE') %></span>
75
- </div>
31
+ <div>
32
+ <span class="description">Refresh slide content.</span>
33
+ <span class="action">REFRESH</span>
34
+ <span class="hotkeys"><%= mapped_keys('REFRESH') %></span>
35
+ </div>
36
+ <div>
37
+ <span class="description">Completely reload Showoff.</span>
38
+ <span class="action">RELOAD</span>
39
+ <span class="hotkeys"><%= mapped_keys('RELOAD') %></span>
40
+ </div>
41
+ <div>
42
+ <span class="description">Blank the screen.</span>
43
+ <span class="action">BLANK</span>
44
+ <span class="hotkeys"><%= mapped_keys('BLANK') %></span>
45
+ </div>
46
+ <div>
47
+ <span class="description">Toggle the display footer.</span>
48
+ <span class="action">FOOTER</span>
49
+ <span class="hotkeys"><%= mapped_keys('FOOTER') %></span>
50
+ </div>
51
+ <div>
52
+ <span class="description">Toggle notes display.</span>
53
+ <span class="action">NOTES</span>
54
+ <span class="hotkeys"><%= mapped_keys('NOTES') %></span>
55
+ </div>
56
+ <div>
57
+ <span class="description">Clear code execution results.</span>
58
+ <span class="action">CLEAR</span>
59
+ <span class="hotkeys"><%= mapped_keys('CLEAR') %></span>
60
+ </div>
61
+ <div>
62
+ <span class="description">Pause the presentation.</span>
63
+ <span class="action">PAUSE</span>
64
+ <span class="hotkeys"><%= mapped_keys('PAUSE') %></span>
65
+ </div>
66
+ <div>
67
+ <span class="description">Display slideshow of <tt>preshow</tt> images on a timer.</span>
68
+ <span class="action">PRESHOW</span>
69
+ <span class="hotkeys"><%= mapped_keys('PRESHOW') %></span>
70
+ </div>
71
+ <div>
72
+ <span class="description">Execute the first visible code block.</span>
73
+ <span class="action">EXECUTE</span>
74
+ <span class="hotkeys"><%= mapped_keys('EXECUTE') %></span>
75
+ </div>
76
76
 
77
- <hr />
77
+ <hr />
78
78
 
79
- <div>
80
- <span class="description">Show debugging information.</span>
81
- <span class="action">DEBUG</span>
82
- <span class="hotkeys"><%= mapped_keys('DEBUG') %></span>
79
+ <div>
80
+ <span class="description">Show debugging information.</span>
81
+ <span class="action">DEBUG</span>
82
+ <span class="hotkeys"><%= mapped_keys('DEBUG') %></span>
83
+ </div>
83
84
  </div>
84
85
  </div>
data/views/presenter.erb CHANGED
@@ -8,7 +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
- <script type="text/javascript" src="<%= @asset_path %>/js/jquery-ui-1.12.1.js"></script>
12
11
 
13
12
  <script type="text/javascript">
14
13
  editUrl = "<%= @edit %>";
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.17.0
4
+ version: 0.17.1
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-02-24 00:00:00.000000000 Z
12
+ date: 2017-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -329,7 +329,6 @@ files:
329
329
  - public/css/highlight/xcode.css
330
330
  - public/css/highlight/zenburn.css
331
331
  - public/css/jquery-ui-1.12.1.css
332
- - public/css/menu.png
333
332
  - public/css/mermaid-6.0.0.css
334
333
  - public/css/onepage.css
335
334
  - public/css/pace.png
data/public/css/menu.png DELETED
Binary file