servel 0.21.0 → 0.22.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fa8d88495eaaf272edc23d6f8ee35358cdbf85e11339fc46f786cbead036ff9
4
- data.tar.gz: dc9d48be2ce10ec35ebe1918f96985cef584bb2871ffaffebbb61ef2ea80a659
3
+ metadata.gz: 9e28a7c714a85189159aa8fb3369d97064f9d5d7d5656f030ac5b0b80c29f3ab
4
+ data.tar.gz: 8bef1a2df47d1e98793d819b4223ac19f6b36c76e6356e8a740fb1d0434e2d7d
5
5
  SHA512:
6
- metadata.gz: c06b97acc7830e90bda35051313097cf3c414f1f3f4b15e6c2ec1af4be0cc6e665ce9480ace68a20827ad8d140396f9b34630061daa929f289d0c4027f3d2997
7
- data.tar.gz: 8d0d2d034cf124464ceb421c110e01750341b9e5aa2bd009963e0bb1ec6262fe8bd24edc97b7bcb4bafaf6b0466879f65caadade8feee8b7a9663f400cb01352
6
+ metadata.gz: 212a9be1c883ea891007b9221e54acb8b339ec54f30e08ae103713115156e80ddb984d25e3e87734b9790e9c2160da65d5847b753201055e79479670456bbe3c
7
+ data.tar.gz: af195cacc8ccd4bd1fdc9f241a9a43f187fad59dd5527d4580fedc117cf6dfcbac1cc83b85eda214f8652b2578e0a82657b5fc8c4ef6c43a8b3e4926c6300f0c
data/app/_gallery.haml CHANGED
@@ -1,13 +1,14 @@
1
- %img#image
2
- %video#video{autoplay: true, controls: true}
3
- %audio#audio{autoplay: true, controls: true}
4
- #text
5
- %a#text-anchor{href: '#'}
6
- #text-content
7
1
  #controls
8
2
  #page-back.paginator ◀
9
- #page-next.paginator ▶
10
3
  #page-back-10.paginator ◀◀
4
+ #page-max-item.paginator ⤡
5
+ #page-jump-listing.paginator 🔗 Listing
11
6
  #page-next-10.paginator ▶▶
12
- #page-jump-listing.paginator
13
- #page-max-item.paginator ⤡
7
+ #page-next.paginator
8
+ #content
9
+ %img#image
10
+ %video#video{autoplay: true, controls: true}
11
+ %audio#audio{autoplay: true, controls: true}
12
+ #text
13
+ %a#text-anchor{href: '#'}
14
+ #text-content
data/app/_listing.haml CHANGED
@@ -1,4 +1,7 @@
1
- %h1 Listing of #{url_root}#{url_path}
1
+ #header
2
+ %h1#title Listing of #{url_root}#{url_path}
3
+ %h1#jump-gallery-wrapper
4
+ %a#jump-gallery{href: "#"} 🔗 Gallery
2
5
  #search-wrapper
3
6
  %input#search{type: 'search'}
4
7
  .table-wrapper
data/app/css/gallery.css CHANGED
@@ -1,8 +1,19 @@
1
1
  #gallery {
2
2
  background: #333;
3
3
  display: none;
4
+ flex-direction: column;
5
+ }
6
+
7
+ body.has-gallery.gallery #gallery {
8
+ display: flex;
9
+ }
10
+
11
+ #content {
12
+ display: flex;
4
13
  align-items: center;
5
14
  justify-content: center;
15
+ flex-grow: 1;
16
+ padding-top: 75px;
6
17
  }
7
18
 
8
19
  #image, #video, #audio, #text {
@@ -24,10 +35,6 @@
24
35
  background-color: #ffffff;
25
36
  }
26
37
 
27
- #gallery.video, #gallery.audio, #gallery.text {
28
- padding: 0 100px;
29
- }
30
-
31
38
  #gallery.video #video {
32
39
  display: block;
33
40
  }
@@ -46,154 +53,56 @@
46
53
 
47
54
  #controls {
48
55
  position: fixed;
49
- top: 0;
50
- right: 0;
51
56
  left: 0;
52
- pointer-events: none;
57
+ right: 0;
58
+ display: flex;
53
59
  }
54
60
 
55
61
  .paginator {
56
- position: absolute;
57
- width: 100px;
58
- opacity: 0;
59
- font-size: 20px;
60
- font-weight: bold;
61
- text-align: center;
62
- color: #ffffff;
63
-
64
62
  display: flex;
65
63
  align-items: center;
66
64
  justify-content: center;
67
- pointer-events: auto;
68
- }
65
+ width: 100px;
66
+ height: 75px;
69
67
 
70
- .paginator:active {
68
+ font-size: 2em;
69
+ font-weight: bold;
70
+ text-align: center;
71
71
  background-color: #000000;
72
- opacity: 0.7;
73
- }
74
-
75
- #page-back {
76
- top: 0;
77
- bottom: 100px;
78
- left: 0;
79
- }
72
+ color: #ffffff;
80
73
 
81
- #page-next {
82
- top: 0;
83
- bottom: 100px;
84
- right: 0;
85
- }
86
-
87
- #page-back-10 {
88
- bottom: 0;
89
- left: 0;
90
- height: 100px;
91
- }
92
-
93
- #page-next-10 {
94
- bottom: 0;
95
- right: 0;
96
- height: 100px;
74
+ opacity: 0.4;
75
+ cursor: pointer;
97
76
  }
98
77
 
99
78
  #page-jump-listing {
100
- right: 100px;
101
- bottom: 0;
102
- left: 100px;
103
- height: 100px;
79
+ flex-grow: 1;
104
80
  width: auto;
105
81
  }
106
82
 
107
- #page-max-item {
108
- top: 0;
109
- left: 100px;
110
- height: 100px;
111
- }
112
-
113
83
  @media screen and (max-width: 767px) {
114
84
  #gallery.video, #gallery.audio, #gallery.text {
115
85
  padding: 0;
116
86
  }
117
87
 
118
- #page-back-10 {
119
- top: 0;
120
- bottom: auto;
121
- left: 120px;
122
- height: 75px;
123
- width: 100px;
124
- }
125
-
126
- #page-next-10 {
127
- top: 0;
128
- right: 120px;
129
- bottom: auto;
130
- height: 75px;
131
- width: 100px;
132
- }
133
-
134
- #page-back {
135
- bottom: auto;
136
- height: 75px;
137
- width: 100px;
138
- }
139
-
140
- #page-next {
141
- bottom: auto;
142
- height: 75px;
143
- width: 100px;
144
- }
145
-
146
- #page-jump-listing {
147
- top: 0;
148
- right: 220px;
149
- bottom: auto;
150
- left: 220px;
151
- height: 75px;
152
- }
153
-
154
- #page-max-item {
155
- top: 75px;
156
- left: 0;
157
- height: 75px;
88
+ .paginator {
89
+ width: 75px;
90
+ font-size: 20px;
158
91
  }
159
92
  }
160
93
 
161
94
  @media screen and (max-width: 479px) {
162
95
  #page-back-10 {
163
- left: 80px;
164
- width: 75px;
96
+ display: none;
165
97
  }
166
98
 
167
99
  #page-next-10 {
168
- right: 80px;
169
- width: 75px;
170
- }
171
-
172
- #page-back {
173
- width: 75px;
174
- }
175
-
176
- #page-next {
177
- width: 75px;
178
- }
179
-
180
- #page-jump-listing {
181
- top: auto;
182
- right: auto;
183
- bottom: 0;
184
- left: 0;
185
- width: 75px;
186
- }
187
-
188
- #page-max-item {
189
- width: 75px;
100
+ display: none;
190
101
  }
191
102
  }
192
103
 
193
104
  @media screen and (min-width: 768px) {
194
105
  .paginator:hover {
195
- background-color: #000000;
196
- opacity: 0.4;
197
- cursor: pointer;
106
+ opacity: 0.7;
198
107
  }
199
108
  }
data/app/css/listing.css CHANGED
@@ -1,12 +1,33 @@
1
1
  #listing {
2
+ display: none;
2
3
  padding: 10px;
3
- position: relative;
4
- z-index: 1;
5
4
  background-color: #fff;
6
5
  }
7
6
 
7
+ body.listing #listing {
8
+ display: block;
9
+ }
10
+
11
+ #header {
12
+ display: flex;
13
+ }
14
+
8
15
  #listing h1 {
9
16
  margin-top: 0;
17
+ margin-bottom: 20px;
18
+ }
19
+
20
+ #title {
21
+ flex-grow: 1;
22
+ }
23
+
24
+ #jump-gallery-wrapper {
25
+ display: none;
26
+ padding-left: 20px;
27
+ }
28
+
29
+ body.has-gallery #jump-gallery-wrapper {
30
+ display: block;
10
31
  }
11
32
 
12
33
  #search-wrapper {
@@ -96,3 +117,9 @@ span.icon {
96
117
  a.default.home, a.default.top, a.default.parent {
97
118
  font-style: oblique;
98
119
  }
120
+
121
+ @media screen and (max-width: 767px) {
122
+ #listing h1 {
123
+ font-size: 20px;
124
+ }
125
+ }
data/app/index.haml CHANGED
@@ -23,6 +23,7 @@
23
23
  #{include('js/listing.js')}
24
24
  #{include('js/ume.js')}
25
25
  #{include('js/gallery.js')}
26
+ #{include('js/index.js')}
26
27
  %body
27
28
  #gallery!= partial('gallery')
28
29
  #listing!= partial('listing', { url_root: url_root, url_path: url_path })
data/app/js/gallery.js CHANGED
@@ -94,11 +94,7 @@ var Gallery = (function() {
94
94
  document.body.addEventListener("click", function(e) {
95
95
  if(!e.target) return;
96
96
 
97
- if(e.target.matches("a.media:not(.new-tab)")) {
98
- e.preventDefault();
99
- jump(e.target.dataset.url);
100
- }
101
- else if(e.target.matches("#page-back")) {
97
+ if(e.target.matches("#page-back")) {
102
98
  e.stopPropagation();
103
99
  prev();
104
100
  }
@@ -115,8 +111,8 @@ var Gallery = (function() {
115
111
  fastForward();
116
112
  }
117
113
  else if(e.target.matches("#page-jump-listing")) {
118
- e.stopPropagation();
119
- $("#listing").scrollIntoView();
114
+ e.preventDefault();
115
+ Index.jumpListing();
120
116
  }
121
117
  else if(e.target.closest("#page-max-item")) {
122
118
  e.stopPropagation();
@@ -140,11 +136,11 @@ var Gallery = (function() {
140
136
  }
141
137
 
142
138
  function layout() {
143
- var viewportHeight = document.documentElement.clientHeight + "px";
144
- $gallery.style.minHeight = viewportHeight;
145
- $("#controls").style.height = viewportHeight;
139
+ var viewportHeight = document.documentElement.clientHeight;
140
+ $gallery.style.minHeight = viewportHeight + "px";
146
141
 
147
- var maxHeight = layoutItemMax ? "none" : viewportHeight;
142
+ var controlsHeight = $("#controls").scrollHeight;
143
+ var maxHeight = layoutItemMax ? "none" : (viewportHeight - controlsHeight) + "px";
148
144
  $("#image").style.maxHeight = maxHeight;
149
145
  $("#video").style.maxHeight = maxHeight;
150
146
  $("#audio").style.maxHeight = maxHeight;
@@ -152,7 +148,7 @@ var Gallery = (function() {
152
148
 
153
149
  function initLayout() {
154
150
  window.addEventListener("resize", layout);
155
- layout();
151
+ setTimeout(layout, 0);
156
152
  }
157
153
 
158
154
  function onEntriesUpdate() {
@@ -167,7 +163,7 @@ var Gallery = (function() {
167
163
  onEntriesUpdate();
168
164
 
169
165
  if(Entries.hasMedia()) {
170
- $gallery.style.display = "flex";
166
+ document.body.classList.add("has-gallery");
171
167
 
172
168
  initEvents();
173
169
  initLayout();
data/app/js/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ var Index = (function() {
4
+ function jumpListing() {
5
+ document.body.classList.remove("gallery");
6
+ document.body.classList.add("listing");
7
+ }
8
+
9
+ function jumpGallery() {
10
+ document.body.classList.remove("listing");
11
+ document.body.classList.add("gallery");
12
+ }
13
+
14
+ function init() {
15
+ if(document.body.classList.contains("has-gallery")) jumpGallery();
16
+ else jumpListing();
17
+ }
18
+
19
+ return {
20
+ init: init,
21
+ jumpListing: jumpListing,
22
+ jumpGallery: jumpGallery
23
+ };
24
+ })();
25
+
26
+ window.addEventListener("DOMContentLoaded", Index.init);
data/app/js/listing.js CHANGED
@@ -99,10 +99,19 @@ var Listing = (function() {
99
99
  document.body.addEventListener("click", function(e) {
100
100
  if(!e.target) return;
101
101
 
102
- if(e.target.closest("th.sortable")) {
102
+ if(e.target.matches("#jump-gallery")) {
103
+ e.preventDefault();
104
+ Index.jumpGallery();
105
+ }
106
+ else if(e.target.closest("th.sortable")) {
103
107
  e.preventDefault();
104
108
  applySort(e.target.closest("th.sortable"));
105
109
  }
110
+ else if(e.target.matches("a.media:not(.new-tab)")) {
111
+ e.preventDefault();
112
+ Gallery.jump(e.target.dataset.url);
113
+ Index.jumpGallery();
114
+ }
106
115
  });
107
116
 
108
117
  $("#search").addEventListener("keyup", function(e) {
@@ -1,3 +1,3 @@
1
1
  module Servel
2
- VERSION = "0.21.0"
2
+ VERSION = "0.22.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.21.0
4
+ version: 0.22.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-09-02 00:00:00.000000000 Z
11
+ date: 2018-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -133,6 +133,7 @@ files:
133
133
  - app/index.haml
134
134
  - app/js/entries.js
135
135
  - app/js/gallery.js
136
+ - app/js/index.js
136
137
  - app/js/listing.js
137
138
  - app/js/natural-orderby.min.js
138
139
  - app/js/ume.js