servel 0.18.0 → 0.19.0

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
- SHA1:
3
- metadata.gz: d7c13a885b678e1a5e5cbee6baad93472321d283
4
- data.tar.gz: eec84def55b4357fc8637cf22f40fbe641e990ef
2
+ SHA256:
3
+ metadata.gz: 46aac7ea1121e835e50af2f906be76d30fb73190171842ce642381585b334ea6
4
+ data.tar.gz: 0f31b01220a763c8fcdd96561d76ee75bed06c2d052d7f5f521b8e9968f14791
5
5
  SHA512:
6
- metadata.gz: 461aff2f7d6af7cd1a7538b2fc2fb54629c02cf25eb9f2e12e1c1cf07634bab98befb70ed170c6e05fe5680cde08d052a13214b86fa485ec0ff0c60762dfa7b0
7
- data.tar.gz: 98132d09d7ea180348bfbac09cb5a8cf1d0264cec83bc000d640dfd3e279bba9fe2c001698b56aa08aa0e45b667f1ef1974ce356ed9a179556c995b3fca7d7a6
6
+ metadata.gz: febe17fedca3812eb8e2a21cff9a0e869a8a3a683bb593e85dcde279b065bdc3b47ff0c0e9789367db331b2a9b3b1183c11ccbf533769914aad9154f730315a5
7
+ data.tar.gz: 0313e123f72be5c37852fa9f1205a97ec30c44137525b8a2e776cc3527ad7bbc9e080f565632814c099d800f874f9dcfc33f1b4287881cb98cacfd936d8fdb6e
@@ -4,8 +4,10 @@
4
4
  #text
5
5
  %a#text-anchor{href: '#'}
6
6
  #text-content
7
- #page-back.paginator ◀
8
- #page-next.paginator
9
- #page-back-10.paginator ◀◀
10
- #page-next-10.paginator ▶▶
11
- #page-toggle-size.paginator
7
+ #controls
8
+ #page-back.paginator
9
+ #page-next.paginator
10
+ #page-back-10.paginator ◀◀
11
+ #page-next-10.paginator ▶▶
12
+ #page-jump-listing.paginator ▼
13
+ #page-max-item.paginator ⤡
@@ -1,6 +1,5 @@
1
1
  #gallery {
2
2
  background: #333;
3
- transform: translateZ(0px);
4
3
  display: flex;
5
4
  align-items: center;
6
5
  justify-content: center;
@@ -9,7 +8,6 @@
9
8
  #image, #video, #audio, #text {
10
9
  display: none;
11
10
  max-width: 100%;
12
- max-height: 100%;
13
11
  margin: 0 auto 0 auto;
14
12
  }
15
13
 
@@ -22,7 +20,6 @@
22
20
  }
23
21
 
24
22
  #text {
25
- overflow: auto;
26
23
  color: #000000;
27
24
  background-color: #ffffff;
28
25
  }
@@ -47,11 +44,16 @@
47
44
  display: block;
48
45
  }
49
46
 
50
- .paginator {
47
+ #controls {
51
48
  position: fixed;
52
- width: 100px;
53
- z-index: 10000;
49
+ top: 0;
50
+ right: 0;
51
+ left: 0;
52
+ }
54
53
 
54
+ .paginator {
55
+ position: absolute;
56
+ width: 100px;
55
57
  opacity: 0;
56
58
  font-size: 20px;
57
59
  font-weight: bold;
@@ -69,7 +71,7 @@
69
71
  }
70
72
 
71
73
  #page-back {
72
- top: 100px;
74
+ top: 0;
73
75
  bottom: 100px;
74
76
  left: 0;
75
77
  }
@@ -84,21 +86,26 @@
84
86
  bottom: 0;
85
87
  left: 0;
86
88
  height: 100px;
87
- z-index: 10001;
88
89
  }
89
90
 
90
91
  #page-next-10 {
91
92
  bottom: 0;
92
93
  right: 0;
93
94
  height: 100px;
94
- z-index: 10001;
95
95
  }
96
96
 
97
- #page-toggle-size {
97
+ #page-jump-listing {
98
+ right: 100px;
99
+ bottom: 0;
100
+ left: 100px;
101
+ height: 100px;
102
+ width: auto;
103
+ }
104
+
105
+ #page-max-item {
98
106
  top: 0;
99
- left: 0;
107
+ left: 100px;
100
108
  height: 100px;
101
- z-index: 10001;
102
109
  }
103
110
 
104
111
  @media screen and (max-width: 767px) {
@@ -106,10 +113,6 @@
106
113
  padding: 0;
107
114
  }
108
115
 
109
- #page-toggle-size {
110
- display: none;
111
- }
112
-
113
116
  #page-back-10 {
114
117
  top: 0;
115
118
  bottom: auto;
@@ -127,18 +130,30 @@
127
130
  }
128
131
 
129
132
  #page-back {
130
- top: 0;
131
133
  bottom: auto;
132
134
  height: 75px;
133
135
  width: 100px;
134
136
  }
135
137
 
136
138
  #page-next {
137
- top: 0;
138
139
  bottom: auto;
139
140
  height: 75px;
140
141
  width: 100px;
141
142
  }
143
+
144
+ #page-jump-listing {
145
+ top: 0;
146
+ right: 220px;
147
+ bottom: auto;
148
+ left: 220px;
149
+ height: 75px;
150
+ }
151
+
152
+ #page-max-item {
153
+ top: 75px;
154
+ left: 0;
155
+ height: 75px;
156
+ }
142
157
  }
143
158
 
144
159
  @media screen and (max-width: 479px) {
@@ -159,6 +174,18 @@
159
174
  #page-next {
160
175
  width: 75px;
161
176
  }
177
+
178
+ #page-jump-listing {
179
+ top: auto;
180
+ right: auto;
181
+ bottom: 0;
182
+ left: 0;
183
+ width: 75px;
184
+ }
185
+
186
+ #page-max-item {
187
+ width: 75px;
188
+ }
162
189
  }
163
190
 
164
191
  @media screen and (min-width: 768px) {
@@ -1,5 +1,8 @@
1
1
  #listing {
2
2
  padding: 10px;
3
+ position: relative;
4
+ z-index: 1;
5
+ background-color: #fff;
3
6
  }
4
7
 
5
8
  #listing h1 {
@@ -7,7 +7,6 @@
7
7
  :css
8
8
  #{include('css/normalize.css')}
9
9
  #{include('css/common.css')}
10
- #{include('css/index.css')}
11
10
  #{include('css/listing.css')}
12
11
  #{include('css/gallery.css')}
13
12
  #{include('css/gallery-text.css')}
@@ -1,10 +1,10 @@
1
1
  var $;
2
2
 
3
3
  var Gallery = (function() {
4
- var TYPES = ["image", "video", "audio", "text"];
5
4
  var urls = [];
6
5
  var types = [];
7
6
  var currentIndex = 0;
7
+ var layoutItemMax = false;
8
8
  var $gallery;
9
9
 
10
10
  function initItems() {
@@ -19,7 +19,7 @@ var Gallery = (function() {
19
19
 
20
20
  function renderText(url) {
21
21
  var http = new XMLHttpRequest();
22
- http.open("GET", url, true);
22
+ http.open("GET", url);
23
23
  http.onload = function() {
24
24
  $("#text-content").innerHTML = ume(http.responseText);
25
25
  $("#text").scrollTop = 0;
@@ -29,18 +29,11 @@ var Gallery = (function() {
29
29
  }
30
30
 
31
31
  function clearContent() {
32
- for(var i = 0; i < TYPES.length; i++) {
33
- var type = TYPES[i];
34
-
35
- $gallery.classList.remove(type);
36
-
37
- if(type == "text") {
38
- $("#text-content").innerHTML = "";
39
- }
40
- else {
41
- $("#" + type).src = "about:none";
42
- }
43
- }
32
+ $gallery.classList.remove("image", "video", "audio", "text");
33
+ $("#image").src = "about:none";
34
+ $("#video").src = "about:none";
35
+ $("#audio").src = "about:none";
36
+ $("#text-content").innerHTML = "";
44
37
  }
45
38
 
46
39
  function render() {
@@ -127,9 +120,14 @@ var Gallery = (function() {
127
120
  e.stopPropagation();
128
121
  fastForward();
129
122
  }
130
- else if(e.target.matches("#page-toggle-size")) {
123
+ else if(e.target.matches("#page-jump-listing")) {
124
+ e.stopPropagation();
125
+ $("#listing").scrollIntoView();
126
+ }
127
+ else if(e.target.closest("#page-max-item")) {
131
128
  e.stopPropagation();
132
- document.body.classList.toggle("split-screen");
129
+ layoutItemMax = !layoutItemMax;
130
+ layout();
133
131
  }
134
132
  });
135
133
 
@@ -145,11 +143,28 @@ var Gallery = (function() {
145
143
  });
146
144
  }
147
145
 
146
+ function layout() {
147
+ var viewportHeight = document.documentElement.clientHeight + "px";
148
+ $gallery.style.minHeight = viewportHeight;
149
+ $("#controls").style.height = viewportHeight;
150
+
151
+ var maxHeight = layoutItemMax ? "none" : viewportHeight;
152
+ $("#image").style.maxHeight = maxHeight;
153
+ $("#video").style.maxHeight = maxHeight;
154
+ $("#audio").style.maxHeight = maxHeight;
155
+ }
156
+
157
+ function initLayout() {
158
+ window.addEventListener("resize", layout);
159
+ layout();
160
+ }
161
+
148
162
  function init() {
149
163
  $gallery = $("#gallery");
150
164
 
151
165
  initItems();
152
166
  initEvents();
167
+ initLayout();
153
168
  render();
154
169
  }
155
170
 
@@ -1,3 +1,3 @@
1
1
  module Servel
2
- VERSION = "0.18.0"
2
+ VERSION = "0.19.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: servel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brenton "B-Train" Fletcher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-25 00:00:00.000000000 Z
11
+ date: 2018-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -153,7 +153,6 @@ files:
153
153
  - lib/servel/templates/css/gallery-text.css
154
154
  - lib/servel/templates/css/gallery.css
155
155
  - lib/servel/templates/css/home.css
156
- - lib/servel/templates/css/index.css
157
156
  - lib/servel/templates/css/listing.css
158
157
  - lib/servel/templates/css/normalize.css
159
158
  - lib/servel/templates/home.haml
@@ -184,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
183
  version: '0'
185
184
  requirements: []
186
185
  rubyforge_project:
187
- rubygems_version: 2.6.14
186
+ rubygems_version: 2.7.6
188
187
  signing_key:
189
188
  specification_version: 4
190
189
  summary: Serves files and directories over HTTP.
@@ -1,15 +0,0 @@
1
- html, body, #gallery {
2
- height: 100%;
3
- }
4
-
5
- body.split-screen #listing {
6
- height: 100%;
7
- width: 50%;
8
- float: left;
9
- overflow: auto;
10
- }
11
-
12
- body.split-screen #gallery {
13
- width: 50%;
14
- float: right;
15
- }