parade 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/parade/renderers/update_image_paths.rb +3 -1
- data/lib/parade/server.rb +9 -2
- data/lib/parade/version.rb +1 -1
- data/lib/public/js/parade.js +7 -32
- data/lib/views/index.erb +29 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmQ4ZTVkZmZkN2YwYWIwYmZlNjZlNDdmMGY1OWIyMGI2MjhkNDY4NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWU1ZWIyZDNiYmYwYzExMTJhZjU2ZDc2MTQxMTVjZWM3Y2U5MzJlOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWI5MmRhMDUyYjkyYzczYzhlMzA1ZjExYTBjOWJkNmVkMzg0NTEwOTYxYzFj
|
10
|
+
NWMzNDEwNWNhNTU3ZDI5NzA3ZjAxMTBiOGRiMTdjZjUzNzBlMDE4ZGI2NThh
|
11
|
+
ZTg3N2UyMWY3OTc0YTgyMGFmYzU2NjdhYmEwMjk0NWQ4ZGQwMTc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTdjMGQ0NTdiOWU5YTJhMGY0ZDE1YTE0ODdkMDk3MjBkOGE3MzM3ZWIzMjY2
|
14
|
+
MWM5ZTliOWI4ZDI1MDgwODQxMDI2N2RkYjc3MjAyZTFlZmE1OWRiMWU0NDNl
|
15
|
+
YzlhYTFiZGQzNDE0MDBjOWM0NGFiYjFjZDQ1Y2QyY2JhMjg2Y2Q=
|
@@ -32,7 +32,9 @@ module Parade
|
|
32
32
|
content.gsub(/img src=["'](?!https?:\/\/)\/?([^\/].*?)["']/) do |image_source|
|
33
33
|
image_name = Regexp.last_match(1)
|
34
34
|
|
35
|
-
|
35
|
+
presentation_path_prefix = options[:presentation_path_prefix].to_s
|
36
|
+
|
37
|
+
html_image_path = File.join(presentation_path_prefix,"/","image",image_name)
|
36
38
|
updated_image_source = %{img src="#{html_image_path}"}
|
37
39
|
|
38
40
|
html_asset_path = File.join(render_root_path,image_name)
|
data/lib/parade/server.rb
CHANGED
@@ -91,12 +91,17 @@ module Parade
|
|
91
91
|
|
92
92
|
helpers do
|
93
93
|
|
94
|
+
def presentation_path_prefix
|
95
|
+
env['SCRIPT_NAME'].to_s
|
96
|
+
end
|
97
|
+
|
94
98
|
#
|
95
99
|
# A shortcut to define a CSS resource file within a view template
|
96
100
|
#
|
97
101
|
def css(*filepaths)
|
98
102
|
filepaths.map do |filepath|
|
99
|
-
|
103
|
+
css_path = File.join(presentation_path_prefix,"css",filepath)
|
104
|
+
%{<link rel="stylesheet" href="#{css_path}" type="text/css"/>}
|
100
105
|
end.join("\n")
|
101
106
|
end
|
102
107
|
|
@@ -105,7 +110,8 @@ module Parade
|
|
105
110
|
#
|
106
111
|
def js(*filepaths)
|
107
112
|
filepaths.map do |filepath|
|
108
|
-
|
113
|
+
js_path = File.join(presentation_path_prefix,"js",filepath)
|
114
|
+
%{<script type="text/javascript" src="#{js_path}"></script>}
|
109
115
|
end.join("\n")
|
110
116
|
end
|
111
117
|
|
@@ -173,6 +179,7 @@ module Parade
|
|
173
179
|
end
|
174
180
|
|
175
181
|
def slides(options = {})
|
182
|
+
options = { presentation_path_prefix: presentation_path_prefix }
|
176
183
|
presentation.to_html(options)
|
177
184
|
end
|
178
185
|
|
data/lib/parade/version.rb
CHANGED
data/lib/public/js/parade.js
CHANGED
@@ -161,15 +161,14 @@ $(document).ready(function() {
|
|
161
161
|
this.element.hide()
|
162
162
|
},
|
163
163
|
load: function(options,afterLoad) {
|
164
|
-
|
165
|
-
var slidesURL = "/slides?height=" + options.height + "&width=" + options.width;
|
164
|
+
|
165
|
+
var slidesURL = options.urlPrefix + "/slides?height=" + options.height + "&width=" + options.width;
|
166
|
+
|
166
167
|
$("#slides").load(slidesURL,$.proxy(function() {
|
167
168
|
this.slides = $("#slides > .slide");
|
168
169
|
afterLoad();
|
169
|
-
// $("#slides img").batchImageLoad({
|
170
|
-
// loadingCompleteCallback: presentation.initialize()
|
171
|
-
// });
|
172
170
|
},this));
|
171
|
+
|
173
172
|
},
|
174
173
|
size: function() {
|
175
174
|
return this.slides.size();
|
@@ -311,7 +310,8 @@ $(document).ready(function() {
|
|
311
310
|
init: function() {
|
312
311
|
|
313
312
|
var options = { height: this.presentationFrame.height(),
|
314
|
-
width: this.presentationFrame.width()
|
313
|
+
width: this.presentationFrame.width(),
|
314
|
+
urlPrefix: arguments[0] };
|
315
315
|
|
316
316
|
this.slides = new Slides(options,$.proxy(function() {
|
317
317
|
this.start();
|
@@ -531,29 +531,4 @@ $(document).ready(function() {
|
|
531
531
|
});
|
532
532
|
|
533
533
|
|
534
|
-
});
|
535
|
-
|
536
|
-
$(document).ready(function() {
|
537
|
-
presentation = new Presentation();
|
538
|
-
|
539
|
-
var locationWatcher = new LocationWatcher();
|
540
|
-
locationWatcher.start();
|
541
|
-
|
542
|
-
/* Add Support for Devices */
|
543
|
-
|
544
|
-
var presoElement = document.getElementById('preso');
|
545
|
-
|
546
|
-
Hammer(presoElement).on("swipeleft", function() {
|
547
|
-
$.publish("presentation:slide:next");
|
548
|
-
});
|
549
|
-
|
550
|
-
Hammer(presoElement).on("swiperight", function() {
|
551
|
-
$.publish("presentation:slide:previous");
|
552
|
-
});
|
553
|
-
|
554
|
-
// bind event handlers
|
555
|
-
/* window.onresize = resized; */
|
556
|
-
/* window.onscroll = scrolled; */
|
557
|
-
/* window.onunload = unloaded; */
|
558
|
-
|
559
|
-
});
|
534
|
+
});
|
data/lib/views/index.erb
CHANGED
@@ -26,5 +26,34 @@
|
|
26
26
|
<%= pause_message %>
|
27
27
|
</div>
|
28
28
|
|
29
|
+
<script type="text/javascript">
|
30
|
+
|
31
|
+
$(document).ready(function() {
|
32
|
+
presentation = new Presentation('<%= presentation_path_prefix %>');
|
33
|
+
|
34
|
+
var locationWatcher = new LocationWatcher();
|
35
|
+
locationWatcher.start();
|
36
|
+
|
37
|
+
/* Add Support for Touch Devices */
|
38
|
+
|
39
|
+
var presoElement = document.getElementById('preso');
|
40
|
+
|
41
|
+
Hammer(presoElement).on("swipeleft", function() {
|
42
|
+
$.publish("presentation:slide:next");
|
43
|
+
});
|
44
|
+
|
45
|
+
Hammer(presoElement).on("swiperight", function() {
|
46
|
+
$.publish("presentation:slide:previous");
|
47
|
+
});
|
48
|
+
|
49
|
+
// bind event handlers
|
50
|
+
/* window.onresize = resized; */
|
51
|
+
/* window.onscroll = scrolled; */
|
52
|
+
/* window.onunload = unloaded; */
|
53
|
+
|
54
|
+
});
|
55
|
+
|
56
|
+
</script>
|
57
|
+
|
29
58
|
</body>
|
30
59
|
</html>
|