markdown_presenter 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/presenter.html.haml +25 -24
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c94da737b6ba30dae6c917d9c23ef9692f39b8bd
4
- data.tar.gz: 8e89f2da4bae73c2c776ffdb1c387cdf0bcd1f1d
3
+ metadata.gz: 898079e062332e4063aedad7ddae4381a87c86f4
4
+ data.tar.gz: ae8da5f7fd1d8c3405bf84cbe5f1a3590e840612
5
5
  SHA512:
6
- metadata.gz: c92431c2d5c6003ed5a7cfc38f667bf3d3f2204e82880199c6e3ec88a301944a5509572e1e0af78b1a827608df1d6641345847f845599f49dab897f9e7970b0f
7
- data.tar.gz: b88615e2624eb7832e4ccc42383b1e454e4a876473d26b2bcff09a8c8a0d864dec9ad121a5d47d1a4da56127b0f636ac232a803a0a8b4c407907792d86dc5dc1
6
+ metadata.gz: ca059196abd7422c2cbda7a9cb35e3587e680ae8af14f55d626c6a70040697df123a9b3223fb5255e6077254c25cce1d6d661bf648d3b246bf13ad927ee83b80
7
+ data.tar.gz: 9a9c59831f983c879fca76a91e4bc8fa4622a59fd1b935c887e2f8ccbadf8ebf1c4248b70ecfb150d080696f9e2bb5350c412dd981bcd519ca4c5a1e26da82f4
data/presenter.html.haml CHANGED
@@ -9,41 +9,39 @@
9
9
  :css
10
10
  * { margin: 0; font-family: Ubuntu, Sans-serif;}
11
11
  html, body { height: 100%; }
12
- .container {min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -6em; overflow-x:hidden;}
13
- .progress-indicator {height: 5em;}
12
+ .topbar {height: 4em; text-align:right;}
14
13
  .slide {display:none; position:relative; padding:2px; margin-top:3em; font-size:150%; line-height:1.5em;}
15
- .progress-indicator {display:inline-block;}
16
- .floating-indicator {margin:0 0 10px 10px; padding:10px; background-color:#ccc; border-radius:6px; font-size:150%;}
17
- .floating-indicator a {font-weight:bold;}
18
- .page-indicator {margin:0 10px; display:inline-block;}
14
+ .progress-indicator {display:inline-block; margin: 10px 10px 10px auto; padding:10px; background-color:#ccc; border-radius:6px; font-size:150%;}
15
+ .progress-indicator a {font-weight:bold; font-size:110%; padding:0 10px;}
16
+ .page-status {display:inline;}
19
17
 
20
18
  %body
21
- .container
22
- .uk-grid
23
- .uk-width-large-1-4
24
-  
25
- .uk-width-large-2-4
26
- - slides.each do |s|
27
- .slide= s
28
- .uk-width-large-1-4
29
-  
30
-
31
- .progress-indicator
32
- .floating-indicator
19
+ .topbar
20
+ .progress-indicator
33
21
  %a{href: "#previous", onclick:'P.previous(); return false;'}
34
- <
35
- .page-indicator
22
+
23
+ .page-status
36
24
  %span.current-slide-number= 1
37
25
  of
38
26
  = slides.size
39
27
  %a{href: "#next", onclick:'P.next(); return false;'}
40
- >
28
+
29
+
30
+ .uk-grid
31
+ .uk-width-large-1-4
32
+  
33
+ .uk-width-large-2-4
34
+ - slides.each do |s|
35
+ .slide= s
36
+ .uk-width-large-1-4
37
+  
41
38
 
42
39
  :javascript
43
40
  $(document).ready(function(){
44
41
  var slides = $(".slide");
45
42
 
46
- var current_slide_index = 0;
43
+ var match = location.href.match(/#(.*)$/);
44
+ var current_slide_index = (match && (parseInt(match[1], 10) - 1)) || 0;
47
45
 
48
46
  var previous = function(){
49
47
  if (current_slide_index === 0) return false;
@@ -69,8 +67,11 @@
69
67
  slides.hide();
70
68
  var slide = slides.eq(index);
71
69
  slide.show();
72
- if (animation) animation(slide);
70
+
73
71
  $(".current-slide-number").text(index + 1);
72
+ location.href = location.href.replace(/#.*|$/, '#' + (index + 1));
73
+
74
+ if (animation) animation(slide);
74
75
  };
75
76
 
76
77
  $(document).keydown(function(e){
@@ -79,7 +80,7 @@
79
80
  return true;
80
81
  });
81
82
 
82
- show(0);
83
+ show(current_slide_index);
83
84
 
84
85
  P = {previous:previous, next:next};
85
86
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu Tanguay-Carel