rack-multipage 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rack-multipage/version.rb +1 -1
- data/lib/rack-multipage.rb +18 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b98abbf91288f4c9afb976fac0d230436a55dca7
|
4
|
+
data.tar.gz: 71390d5c9b1bbaa466f8b1e41c3dcbb893388da5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f365b74f2466d985e2dc20ffb7767eaeb962efe9d784bf8282a953c18c7a805c2a39f59b7a3db4260af7bc3659733b524f9d3e92c1b7ca5a35ad58dac69306
|
7
|
+
data.tar.gz: 494cdb5aa27bf74b720d229d1d02028cbfc050924f477d67e8c4cbf68cfba8e3df5ae19c6d048580ae7ba4242394b0e7417f3f52f80559d5adb39d2cb22153fa
|
data/lib/rack-multipage.rb
CHANGED
@@ -13,11 +13,17 @@ class Rack::MultiPage
|
|
13
13
|
attr_accessor :app
|
14
14
|
attr_reader :pages_list
|
15
15
|
attr_reader :route
|
16
|
+
attr_reader :height
|
17
|
+
attr_reader :width
|
16
18
|
|
17
19
|
def initialize (app, config = {})
|
18
20
|
@app = app
|
19
21
|
@pages_list = config.fetch :pages, []
|
20
22
|
@route = config.fetch :route, "/multipage"
|
23
|
+
@height = config.fetch :height, "600"
|
24
|
+
@width = config.fetch :width, "800"
|
25
|
+
@percentage = config.fetch :width, "50"
|
26
|
+
|
21
27
|
end
|
22
28
|
|
23
29
|
def call(env)
|
@@ -28,45 +34,49 @@ class Rack::MultiPage
|
|
28
34
|
end
|
29
35
|
end
|
30
36
|
|
37
|
+
def scale
|
38
|
+
(percentage / 100).to_f
|
39
|
+
end
|
40
|
+
|
31
41
|
def css
|
32
42
|
<<-CSS
|
33
43
|
body {
|
34
44
|
background-color: #eee;
|
35
45
|
padding: 0; margin:0;
|
36
46
|
}
|
47
|
+
|
37
48
|
div.pageboxes {
|
38
49
|
height: 100%;
|
39
50
|
width: 100p%;
|
40
51
|
}
|
41
52
|
|
42
53
|
div.pageboxes .page {
|
43
|
-
height:
|
44
|
-
width:
|
54
|
+
height: #{height}px;
|
55
|
+
width: #{width}px;
|
45
56
|
border: solid 1px black;
|
46
57
|
background-color: white;
|
47
58
|
top: 0;
|
48
|
-
-webkit-transform: scale(
|
59
|
+
-webkit-transform: scale(#{scale}) ;
|
49
60
|
-webkit-transform-origin: top left ;
|
50
61
|
-webkit-box-shadow: 1px 1px 5px rgba(100,100,100,0.6)
|
51
62
|
}
|
52
63
|
|
53
64
|
div.pageboxes .box{
|
54
|
-
width:
|
55
|
-
height:
|
65
|
+
width: #{width * scale}px;
|
66
|
+
height: #{height * scale}px;
|
56
67
|
margin-left: 10px;
|
57
68
|
margin-top: 10px;
|
58
69
|
float: left;
|
59
70
|
}
|
71
|
+
|
60
72
|
div.pageboxes .page iframe{
|
61
73
|
height: 100%;
|
62
74
|
width: 100%;
|
63
75
|
border: solid 1px #eee;
|
64
76
|
border-radius: 5px;
|
65
|
-
|
66
77
|
}
|
67
|
-
CSS
|
68
|
-
|
69
78
|
|
79
|
+
CSS
|
70
80
|
end
|
71
81
|
|
72
82
|
def template(insides)
|