slide-em-up 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 120">
3
+ <polygon fill="#CC0000" points="0,0 40,0 40,120 20,100 0,120"/>
4
+ </svg>
@@ -0,0 +1,29 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=1274, user-scalable=no">
6
+ <title><%= meta.title %></title>
7
+ <link rel="stylesheet" href="css/style.css">
8
+ <link rel="stylesheet" href="css/pygments/colorful.css">
9
+ </head>
10
+ <body class="list">
11
+ <header class="caption">
12
+ <h1><%= meta.title %></h1>
13
+ </header>
14
+ <% sections.each do |section| %>
15
+ <% section.slides.each do |slide| %>
16
+ <div id="slide-<%= section.number %>-<%= slide.number%>" class="slide <%= slide.classes %>">
17
+ <div><section>
18
+ <%= slide.html %>
19
+ </section></div>
20
+ </div>
21
+ <% end %>
22
+ <% end %>
23
+ <div class="progress"><div></div></div>
24
+ <% (theme.js + meta.js).each do |js| %>
25
+ <script src="<%= js %>"></script>
26
+ <% end %>
27
+ <!-- Copyright © 2010–2011 Vadim Makeev, http://pepelsbey.net/ -->
28
+ </body>
29
+ </html>
@@ -0,0 +1,213 @@
1
+ (function () {
2
+ var url = window.location,
3
+ body = document.body,
4
+ slides = document.querySelectorAll('div.slide'),
5
+ progress = document.querySelector('div.progress div'),
6
+ slideList = [],
7
+ l = slides.length,
8
+ i;
9
+
10
+ for (i = 0; i < l; i++) {
11
+ slideList.push(slides[i].id);
12
+ }
13
+
14
+ function getTransform() {
15
+ var denominator = Math.max(
16
+ body.clientWidth / window.innerWidth,
17
+ body.clientHeight / window.innerHeight
18
+ );
19
+
20
+ return 'scale(' + (1 / denominator) + ')';
21
+ }
22
+
23
+ function applyTransform(transform) {
24
+ body.style.MozTransform = transform;
25
+ body.style.WebkitTransform = transform;
26
+ body.style.OTransform = transform;
27
+ body.style.msTransform = transform;
28
+ body.style.transform = transform;
29
+ }
30
+
31
+ function enterSingleSlideMode() {
32
+ body.className = 'full';
33
+ applyTransform(getTransform());
34
+ }
35
+
36
+ function enterSlideListMode() {
37
+ body.className = 'list';
38
+ applyTransform('none');
39
+ }
40
+
41
+ function getCurrentSlideNumber() {
42
+ return slideList.indexOf(url.hash.substr(1));
43
+ }
44
+
45
+ function scrollToCurrentSlide() {
46
+ var current_slide = document.getElementById(slideList[getCurrentSlideNumber()]);
47
+
48
+ if (null != current_slide) {
49
+ window.scrollTo(0, current_slide.offsetTop);
50
+ }
51
+ }
52
+
53
+ function isSlideListMode() {
54
+ return 'full' !== url.search.substr(1);
55
+ }
56
+
57
+ function normalizeSlideNumber(slide_number) {
58
+ if (0 > slide_number) {
59
+ return slideList.length - 1;
60
+ } else if (slideList.length <= slide_number) {
61
+ return 0;
62
+ } else {
63
+ return slide_number;
64
+ }
65
+ }
66
+
67
+ function updateProgress(slide_number) {
68
+ if (!progress) return;
69
+ progress.style.width = (100 / (slideList.length - 1) * normalizeSlideNumber(slide_number)).toFixed(2) + '%';
70
+ }
71
+
72
+ function getSlideHashByNumber(slide_number) {
73
+ return '#' + slideList[normalizeSlideNumber(slide_number)];
74
+ }
75
+
76
+ function goToSlide(slide_number) {
77
+ url.hash = getSlideHashByNumber(slide_number);
78
+
79
+ if (!isSlideListMode()) {
80
+ updateProgress(slide_number);
81
+ }
82
+ }
83
+
84
+ window.addEventListener('DOMContentLoaded', function () {
85
+ if (!isSlideListMode()) {
86
+ // "?full" is present without slide hash so we should display first
87
+ // slide
88
+ if ( -1 === getCurrentSlideNumber() ) {
89
+ history.replaceState(null, null, url.pathname + '?full' + getSlideHashByNumber( 0 ) );
90
+ }
91
+
92
+ enterSingleSlideMode();
93
+ updateProgress(getCurrentSlideNumber());
94
+ }
95
+ }, false);
96
+
97
+ window.addEventListener('popstate', function (e) {
98
+ if (isSlideListMode()) {
99
+ enterSlideListMode();
100
+ scrollToCurrentSlide();
101
+ } else {
102
+ enterSingleSlideMode();
103
+ }
104
+ }, false);
105
+
106
+ window.addEventListener('resize', function (e) {
107
+ if (!isSlideListMode()) {
108
+ applyTransform(getTransform());
109
+ }
110
+ }, false);
111
+
112
+ document.addEventListener('keydown', function (e) {
113
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
114
+
115
+ var current_slide_number = getCurrentSlideNumber();
116
+
117
+ switch (e.which) {
118
+ case 9: // Tab = +1; Shift + Tab = -1
119
+ if (isSlideListMode()) {
120
+ e.preventDefault();
121
+
122
+ current_slide_number += e.shiftKey ? -1 : 1;
123
+ url.hash = getSlideHashByNumber(current_slide_number);
124
+ }
125
+ break;
126
+
127
+ case 13: // Enter
128
+ if (isSlideListMode()) {
129
+ e.preventDefault();
130
+
131
+ history.pushState(null, null, url.pathname + '?full' + getSlideHashByNumber(current_slide_number));
132
+ enterSingleSlideMode();
133
+
134
+ updateProgress(current_slide_number);
135
+ }
136
+ break;
137
+
138
+ case 27: // Esc
139
+ if (!isSlideListMode()) {
140
+ e.preventDefault();
141
+
142
+ history.pushState(null, null, url.pathname + getSlideHashByNumber(current_slide_number));
143
+ enterSlideListMode();
144
+ scrollToCurrentSlide();
145
+ }
146
+ break;
147
+
148
+ case 33: // PgUp
149
+ case 38: // Up
150
+ case 37: // Left
151
+ case 72: // h
152
+ case 75: // k
153
+ e.preventDefault();
154
+
155
+ current_slide_number--;
156
+ goToSlide(current_slide_number);
157
+ break;
158
+
159
+ case 34: // PgDown
160
+ case 40: // Down
161
+ case 39: // Right
162
+ case 76: // l
163
+ case 74: // j
164
+ e.preventDefault();
165
+
166
+ current_slide_number++;
167
+ goToSlide(current_slide_number);
168
+ break;
169
+
170
+ case 36: // Home
171
+ e.preventDefault();
172
+
173
+ current_slide_number = 0;
174
+ goToSlide(current_slide_number);
175
+ break;
176
+
177
+ case 35: // End
178
+ e.preventDefault();
179
+
180
+ current_slide_number = slideList.length - 1;
181
+ goToSlide(current_slide_number);
182
+ break;
183
+
184
+ case 32: // Space = +1; Shift + Space = -1
185
+ e.preventDefault();
186
+
187
+ current_slide_number += e.shiftKey ? -1 : 1;
188
+ goToSlide(current_slide_number);
189
+ break;
190
+
191
+ default:
192
+ // Behave as usual
193
+ }
194
+ }, false);
195
+
196
+ document.addEventListener('click', function (e) {
197
+ if (
198
+ 'SECTION' === e.target.nodeName &&
199
+ -1 !== e.target.parentNode.parentNode.className.indexOf('slide') &&
200
+ isSlideListMode()
201
+ ) {
202
+ e.preventDefault();
203
+
204
+ // NOTE: we should update hash to get things work properly
205
+ url.hash = '#' + e.target.parentNode.parentNode.id;
206
+ history.replaceState(null, null, url.pathname + '?full#' + e.target.parentNode.parentNode.id);
207
+ enterSingleSlideMode();
208
+
209
+ updateProgress(getCurrentSlideNumber());
210
+ }
211
+ }, false);
212
+
213
+ }());
metadata CHANGED
@@ -1,122 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: slide-em-up
3
- version: !ruby/object:Gem::Version
4
- hash: 21
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.8
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 7
10
- version: 0.1.7
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Bruno Michel
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2011-07-03 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-28 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: goliath
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &75474350 !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
18
+ requirements:
27
19
  - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 25
30
- segments:
31
- - 0
32
- - 9
33
- version: "0.9"
20
+ - !ruby/object:Gem::Version
21
+ version: '0.9'
34
22
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: redcarpet
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *75474350
25
+ - !ruby/object:Gem::Dependency
26
+ name: redcarpet
27
+ requirement: &75474100 !ruby/object:Gem::Requirement
40
28
  none: false
41
- requirements:
29
+ requirements:
42
30
  - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 45
45
- segments:
46
- - 1
47
- - 17
48
- version: "1.17"
31
+ - !ruby/object:Gem::Version
32
+ version: '1.17'
49
33
  type: :runtime
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- name: erubis
53
34
  prerelease: false
54
- requirement: &id003 !ruby/object:Gem::Requirement
35
+ version_requirements: *75474100
36
+ - !ruby/object:Gem::Dependency
37
+ name: erubis
38
+ requirement: &75473870 !ruby/object:Gem::Requirement
55
39
  none: false
56
- requirements:
40
+ requirements:
57
41
  - - ~>
58
- - !ruby/object:Gem::Version
59
- hash: 13
60
- segments:
61
- - 2
62
- - 7
63
- version: "2.7"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.7'
64
44
  type: :runtime
65
- version_requirements: *id003
66
- - !ruby/object:Gem::Dependency
67
- name: yajl-ruby
68
45
  prerelease: false
69
- requirement: &id004 !ruby/object:Gem::Requirement
46
+ version_requirements: *75473870
47
+ - !ruby/object:Gem::Dependency
48
+ name: yajl-ruby
49
+ requirement: &75473640 !ruby/object:Gem::Requirement
70
50
  none: false
71
- requirements:
51
+ requirements:
72
52
  - - ~>
73
- - !ruby/object:Gem::Version
74
- hash: 27
75
- segments:
76
- - 0
77
- - 8
78
- version: "0.8"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.8'
79
55
  type: :runtime
80
- version_requirements: *id004
81
- - !ruby/object:Gem::Dependency
82
- name: albino
83
56
  prerelease: false
84
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *75473640
58
+ - !ruby/object:Gem::Dependency
59
+ name: albino
60
+ requirement: &75473400 !ruby/object:Gem::Requirement
85
61
  none: false
86
- requirements:
62
+ requirements:
87
63
  - - ~>
88
- - !ruby/object:Gem::Version
89
- hash: 9
90
- segments:
91
- - 1
92
- - 3
93
- version: "1.3"
64
+ - !ruby/object:Gem::Version
65
+ version: '1.3'
94
66
  type: :runtime
95
- version_requirements: *id005
96
- - !ruby/object:Gem::Dependency
97
- name: minitest
98
67
  prerelease: false
99
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *75473400
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: &75473170 !ruby/object:Gem::Requirement
100
72
  none: false
101
- requirements:
73
+ requirements:
102
74
  - - ~>
103
- - !ruby/object:Gem::Version
104
- hash: 5
105
- segments:
106
- - 2
107
- - 3
108
- version: "2.3"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.3'
109
77
  type: :development
110
- version_requirements: *id006
78
+ prerelease: false
79
+ version_requirements: *75473170
111
80
  description: Slide'em up is a presentation tool that displays markdown-formatted slides
112
81
  email: bruno.michel@af83.com
113
- executables:
82
+ executables:
114
83
  - slide-em-up
115
84
  extensions: []
116
-
117
- extra_rdoc_files:
85
+ extra_rdoc_files:
118
86
  - README.md
119
- files:
87
+ files:
120
88
  - MIT-LICENSE
121
89
  - README.md
122
90
  - Gemfile
@@ -125,8 +93,21 @@ files:
125
93
  - lib/slide-em-up/slides_api.rb
126
94
  - lib/slide-em-up/presentation.rb
127
95
  - lib/slide-em-up/version.rb
96
+ - themes/shower/index.erb
97
+ - themes/shower/js/script.js
98
+ - themes/shower/css/fonts.css
99
+ - themes/shower/css/reset.css
100
+ - themes/shower/css/style.css
101
+ - themes/shower/images/ribbon.svg
102
+ - themes/shower/images/grid.png
103
+ - themes/shower/images/linen.png
104
+ - themes/shower/README
128
105
  - themes/common/fonts/league_gothic-webfont.ttf
129
106
  - themes/common/fonts/crimson_text.ttf
107
+ - themes/common/fonts/DroidSansMono.ttf
108
+ - themes/common/fonts/TargetBlank.otf
109
+ - themes/common/fonts/DroidSansMono.svg
110
+ - themes/common/fonts/TargetBlank.svg
130
111
  - themes/common/fonts/crimson_text_bold.ttf
131
112
  - themes/common/fonts/crimson_text_semibold.ttf
132
113
  - themes/common/css/pygments/colorful.css
@@ -142,39 +123,28 @@ files:
142
123
  - themes/html5rocks/css/default.css
143
124
  - themes/html5rocks/css/sea_wave.css
144
125
  - themes/html5rocks/README
145
- has_rdoc: true
146
126
  homepage: http://github.com/nono/slide-em-up
147
127
  licenses: []
148
-
149
128
  post_install_message:
150
129
  rdoc_options: []
151
-
152
- require_paths:
130
+ require_paths:
153
131
  - lib
154
- required_ruby_version: !ruby/object:Gem::Requirement
132
+ required_ruby_version: !ruby/object:Gem::Requirement
155
133
  none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 3
160
- segments:
161
- - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ! '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
139
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- hash: 3
169
- segments:
170
- - 0
171
- version: "0"
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
172
144
  requirements: []
173
-
174
145
  rubyforge_project:
175
- rubygems_version: 1.5.2
146
+ rubygems_version: 1.8.5
176
147
  signing_key:
177
148
  specification_version: 3
178
149
  summary: Slide'em up is a presentation tool that displays markdown-formatted slides
179
150
  test_files: []
180
-