intranet-pictures 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/intranet/pictures/responder.rb +27 -18
  3. data/lib/intranet/pictures/version.rb +1 -1
  4. data/lib/intranet/resources/haml/pictures_browse.haml +0 -1
  5. data/lib/intranet/resources/haml/pictures_home.haml +0 -3
  6. data/lib/intranet/resources/locales/en.yml +0 -1
  7. data/lib/intranet/resources/locales/fr.yml +0 -1
  8. data/lib/intranet/resources/www/jpictures.js +32 -14
  9. data/lib/intranet/resources/www/photoswipe/photoswipe-dynamic-caption-plugin.css +47 -0
  10. data/lib/intranet/resources/www/photoswipe/photoswipe-dynamic-caption-plugin.esm.js +400 -0
  11. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.js +1382 -0
  12. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.js.map +1 -0
  13. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.min.js +5 -0
  14. data/lib/intranet/resources/www/photoswipe/photoswipe.css +383 -142
  15. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.js +5279 -0
  16. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.js.map +1 -0
  17. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.min.js +5 -0
  18. data/lib/intranet/resources/www/style.css +13 -0
  19. data/spec/intranet/pictures/responder_spec.rb +78 -58
  20. metadata +26 -28
  21. data/lib/intranet/resources/haml/pictures_photoswipe.haml +0 -23
  22. data/lib/intranet/resources/www/photoswipe/LICENSE +0 -21
  23. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.css +0 -484
  24. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.png +0 -0
  25. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.svg +0 -1
  26. data/lib/intranet/resources/www/photoswipe/default-skin/preloader.gif +0 -0
  27. data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.js +0 -861
  28. data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.min.js +0 -4
  29. data/lib/intranet/resources/www/photoswipe/photoswipe.js +0 -3734
  30. data/lib/intranet/resources/www/photoswipe/photoswipe.min.js +0 -4
@@ -1,179 +1,420 @@
1
- /*! PhotoSwipe main CSS by Dmitry Semenov | photoswipe.com | MIT license */
1
+ /*! PhotoSwipe main CSS by Dmytro Semenov | photoswipe.com */
2
+
3
+ .pswp {
4
+ --pswp-bg: #000;
5
+ --pswp-placeholder-bg: #222;
6
+
7
+
8
+ --pswp-root-z-index: 100000;
9
+
10
+ --pswp-preloader-color: rgba(79, 79, 79, 0.4);
11
+ --pswp-preloader-color-secondary: rgba(255, 255, 255, 0.9);
12
+
13
+ /* defined via js:
14
+ --pswp-transition-duration: 333ms; */
15
+
16
+ --pswp-icon-color: #fff;
17
+ --pswp-icon-color-secondary: #4f4f4f;
18
+ --pswp-icon-stroke-color: #4f4f4f;
19
+ --pswp-icon-stroke-width: 2px;
20
+
21
+ --pswp-error-text-color: var(--pswp-icon-color);
22
+ }
23
+
24
+
2
25
  /*
3
- Styles for basic PhotoSwipe functionality (sliding area, open/close transitions)
26
+ Styles for basic PhotoSwipe (pswp) functionality (sliding area, open/close transitions)
4
27
  */
5
- /* pswp = photoswipe */
28
+
6
29
  .pswp {
7
- display: none;
8
- position: absolute;
9
- width: 100%;
10
- height: 100%;
11
- left: 0;
12
- top: 0;
13
- overflow: hidden;
14
- -ms-touch-action: none;
15
- touch-action: none;
16
- z-index: 1500;
17
- -webkit-text-size-adjust: 100%;
18
- /* create separate layer, to avoid paint on window.onscroll in webkit/blink */
19
- -webkit-backface-visibility: hidden;
20
- outline: none; }
21
- .pswp * {
22
- -webkit-box-sizing: border-box;
23
- box-sizing: border-box; }
24
- .pswp img {
25
- max-width: none; }
26
-
27
- /* style is added when JS option showHideOpacity is set to true */
28
- .pswp--animate_opacity {
29
- /* 0.001, because opacity:0 doesn't trigger Paint action, which causes lag at start of transition */
30
- opacity: 0.001;
31
- will-change: opacity;
32
- /* for open/close transition */
33
- -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
34
- transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
30
+ position: fixed;
31
+ z-index: var(--pswp-root-z-index);
32
+ display: none;
33
+ touch-action: none;
34
+ outline: 0;
35
+ opacity: 0.003;
36
+ contain: layout style size;
37
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
38
+ }
39
+
40
+ /* Prevents focus outline on the root element,
41
+ (it may be focused initially) */
42
+ .pswp:focus {
43
+ outline: 0;
44
+ }
45
+
46
+ .pswp * {
47
+ box-sizing: border-box;
48
+ }
49
+
50
+ .pswp img {
51
+ max-width: none;
52
+ }
35
53
 
36
54
  .pswp--open {
37
- display: block; }
38
-
39
- .pswp--zoom-allowed .pswp__img {
40
- /* autoprefixer: off */
41
- cursor: -webkit-zoom-in;
42
- cursor: -moz-zoom-in;
43
- cursor: zoom-in; }
44
-
45
- .pswp--zoomed-in .pswp__img {
46
- /* autoprefixer: off */
47
- cursor: -webkit-grab;
48
- cursor: -moz-grab;
49
- cursor: grab; }
50
-
51
- .pswp--dragging .pswp__img {
52
- /* autoprefixer: off */
53
- cursor: -webkit-grabbing;
54
- cursor: -moz-grabbing;
55
- cursor: grabbing; }
55
+ display: block;
56
+ }
56
57
 
57
- /*
58
- Background is added as a separate element.
59
- As animating opacity is much faster than animating rgba() background-color.
60
- */
58
+ .pswp,
61
59
  .pswp__bg {
62
- position: absolute;
63
- left: 0;
64
- top: 0;
65
- width: 100%;
66
- height: 100%;
67
- background: #000;
68
- opacity: 0;
69
- -webkit-transform: translateZ(0);
70
- transform: translateZ(0);
71
- -webkit-backface-visibility: hidden;
72
- will-change: opacity; }
60
+ transform: translateZ(0);
61
+ will-change: opacity;
62
+ }
73
63
 
64
+ .pswp__bg {
65
+ opacity: 0.005;
66
+ background: var(--pswp-bg);
67
+ }
68
+
69
+ .pswp,
74
70
  .pswp__scroll-wrap {
75
- position: absolute;
76
- left: 0;
77
- top: 0;
78
- width: 100%;
79
- height: 100%;
80
- overflow: hidden; }
71
+ overflow: hidden;
72
+ }
81
73
 
74
+ .pswp,
75
+ .pswp__scroll-wrap,
76
+ .pswp__bg,
82
77
  .pswp__container,
78
+ .pswp__item,
79
+ .pswp__content,
80
+ .pswp__img,
83
81
  .pswp__zoom-wrap {
84
- -ms-touch-action: none;
85
- touch-action: none;
86
- position: absolute;
87
- left: 0;
88
- right: 0;
89
- top: 0;
90
- bottom: 0; }
82
+ position: absolute;
83
+ top: 0;
84
+ left: 0;
85
+ width: 100%;
86
+ height: 100%;
87
+ }
91
88
 
92
- /* Prevent selection and tap highlights */
93
- .pswp__container,
94
- .pswp__img {
95
- -webkit-user-select: none;
96
- -moz-user-select: none;
97
- -ms-user-select: none;
98
- user-select: none;
99
- -webkit-tap-highlight-color: transparent;
100
- -webkit-touch-callout: none; }
89
+ .pswp {
90
+ position: fixed;
91
+ }
101
92
 
93
+ .pswp__img,
102
94
  .pswp__zoom-wrap {
103
- position: absolute;
104
- width: 100%;
105
- -webkit-transform-origin: left top;
106
- -ms-transform-origin: left top;
107
- transform-origin: left top;
108
- /* for open/close transition */
109
- -webkit-transition: -webkit-transform 333ms cubic-bezier(0.4, 0, 0.22, 1);
110
- transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
95
+ width: auto;
96
+ height: auto;
97
+ }
111
98
 
112
- .pswp__bg {
113
- will-change: opacity;
114
- /* for open/close transition */
115
- -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
116
- transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
99
+ .pswp--click-to-zoom.pswp--zoom-allowed .pswp__img {
100
+ cursor: -webkit-zoom-in;
101
+ cursor: -moz-zoom-in;
102
+ cursor: zoom-in;
103
+ }
104
+
105
+ .pswp--click-to-zoom.pswp--zoomed-in .pswp__img {
106
+ cursor: move;
107
+ cursor: -webkit-grab;
108
+ cursor: -moz-grab;
109
+ cursor: grab;
110
+ }
117
111
 
118
- .pswp--animated-in .pswp__bg,
119
- .pswp--animated-in .pswp__zoom-wrap {
120
- -webkit-transition: none;
121
- transition: none; }
112
+ .pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active {
113
+ cursor: -webkit-grabbing;
114
+ cursor: -moz-grabbing;
115
+ cursor: grabbing;
116
+ }
122
117
 
118
+ /* :active to override grabbing cursor */
119
+ .pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,
120
+ .pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,
121
+ .pswp__img {
122
+ cursor: -webkit-zoom-out;
123
+ cursor: -moz-zoom-out;
124
+ cursor: zoom-out;
125
+ }
126
+
127
+
128
+ /* Prevent selection and tap highlights */
123
129
  .pswp__container,
124
- .pswp__zoom-wrap {
125
- -webkit-backface-visibility: hidden; }
130
+ .pswp__img,
131
+ .pswp__button,
132
+ .pswp__counter {
133
+ -webkit-user-select: none;
134
+ -moz-user-select: none;
135
+ -ms-user-select: none;
136
+ user-select: none;
137
+ }
126
138
 
127
139
  .pswp__item {
128
- position: absolute;
129
- left: 0;
130
- right: 0;
131
- top: 0;
132
- bottom: 0;
133
- overflow: hidden; }
140
+ /* z-index for fade transition */
141
+ z-index: 1;
142
+ overflow: hidden;
143
+ }
134
144
 
135
- .pswp__img {
145
+ .pswp__hidden {
146
+ display: none !important;
147
+ }
148
+
149
+ /* Allow to click through pswp__content element, but not its children */
150
+ .pswp__content {
151
+ pointer-events: none;
152
+ }
153
+ .pswp__content > * {
154
+ pointer-events: auto;
155
+ }
156
+
157
+
158
+ /*
159
+
160
+ PhotoSwipe UI
161
+
162
+ */
163
+
164
+ /*
165
+ Error message appears when image is not loaded
166
+ (JS option errorMsg controls markup)
167
+ */
168
+ .pswp__error-msg-container {
169
+ display: grid;
170
+ }
171
+ .pswp__error-msg {
172
+ margin: auto;
173
+ font-size: 1em;
174
+ line-height: 1;
175
+ color: var(--pswp-error-text-color);
176
+ }
177
+
178
+ /*
179
+ class pswp__hide-on-close is applied to elements that
180
+ should hide (for example fade out) when PhotoSwipe is closed
181
+ and show (for example fade in) when PhotoSwipe is opened
182
+ */
183
+ .pswp .pswp__hide-on-close {
184
+ opacity: 0.005;
185
+ will-change: opacity;
186
+ transition: opacity var(--pswp-transition-duration) cubic-bezier(0.4, 0, 0.22, 1);
187
+ z-index: 10; /* always overlap slide content */
188
+ pointer-events: none; /* hidden elements should not be clickable */
189
+ }
190
+
191
+ /* class pswp--ui-visible is added when opening or closing transition starts */
192
+ .pswp--ui-visible .pswp__hide-on-close {
193
+ opacity: 1;
194
+ pointer-events: auto;
195
+ }
196
+
197
+ /* <button> styles, including css reset */
198
+ .pswp__button {
199
+ position: relative;
200
+ display: block;
201
+ width: 50px;
202
+ height: 60px;
203
+ padding: 0;
204
+ margin: 0;
205
+ overflow: hidden;
206
+ cursor: pointer;
207
+ background: none;
208
+ border: 0;
209
+ box-shadow: none;
210
+ opacity: 0.85;
211
+ -webkit-appearance: none;
212
+ -webkit-touch-callout: none;
213
+ }
214
+
215
+ .pswp__button:hover,
216
+ .pswp__button:active,
217
+ .pswp__button:focus {
218
+ transition: none;
219
+ padding: 0;
220
+ background: none;
221
+ border: 0;
222
+ box-shadow: none;
223
+ opacity: 1;
224
+ }
225
+
226
+ .pswp__button:disabled {
227
+ opacity: 0.3;
228
+ cursor: auto;
229
+ }
230
+
231
+ .pswp__icn {
232
+ fill: var(--pswp-icon-color);
233
+ color: var(--pswp-icon-color-secondary);
234
+ }
235
+
236
+ .pswp__icn {
136
237
  position: absolute;
137
- width: auto;
138
- height: auto;
139
- top: 0;
140
- left: 0; }
238
+ top: 14px;
239
+ left: 9px;
240
+ width: 32px;
241
+ height: 32px;
242
+ overflow: hidden;
243
+ pointer-events: none;
244
+ }
245
+
246
+ .pswp__icn-shadow {
247
+ stroke: var(--pswp-icon-stroke-color);
248
+ stroke-width: var(--pswp-icon-stroke-width);
249
+ fill: none;
250
+ }
251
+
252
+ .pswp__icn:focus {
253
+ outline: 0;
254
+ }
141
255
 
142
256
  /*
143
- stretched thumbnail or div placeholder element (see below)
144
- style is added to avoid flickering in webkit/blink when layers overlap
257
+ div element that matches size of large image,
258
+ large image loads on top of it,
259
+ used when msrc is not provided
145
260
  */
146
- .pswp__img--placeholder {
147
- -webkit-backface-visibility: hidden; }
261
+ div.pswp__img--placeholder,
262
+ .pswp__img--with-bg {
263
+ background: var(--pswp-placeholder-bg);
264
+ }
265
+
266
+ .pswp__top-bar {
267
+ position: absolute;
268
+ left: 0;
269
+ top: 0;
270
+ width: 100%;
271
+ height: 60px;
272
+ display: flex;
273
+ flex-direction: row;
274
+ justify-content: flex-end;
275
+ z-index: 10;
276
+
277
+ /* allow events to pass through top bar itself */
278
+ pointer-events: none !important;
279
+ }
280
+ .pswp__top-bar > * {
281
+ pointer-events: auto;
282
+ /* this makes transition significantly more smooth,
283
+ even though inner elements are not animated */
284
+ will-change: opacity;
285
+ }
286
+
148
287
 
149
288
  /*
150
- div element that matches size of large image
151
- large image loads on top of it
289
+
290
+ Close button
291
+
152
292
  */
153
- .pswp__img--placeholder--blank {
154
- background: #222; }
293
+ .pswp__button--close {
294
+ margin-right: 6px;
295
+ }
155
296
 
156
- .pswp--ie .pswp__img {
157
- width: 100% !important;
158
- height: auto !important;
159
- left: 0;
160
- top: 0; }
161
297
 
162
298
  /*
163
- Error message appears when image is not loaded
164
- (JS option errorMsg controls markup)
299
+
300
+ Arrow buttons
301
+
165
302
  */
166
- .pswp__error-msg {
303
+ .pswp__button--arrow {
167
304
  position: absolute;
168
- left: 0;
305
+ top: 0;
306
+ width: 75px;
307
+ height: 100px;
169
308
  top: 50%;
170
- width: 100%;
171
- text-align: center;
309
+ margin-top: -50px;
310
+ }
311
+
312
+ .pswp__button--arrow:disabled {
313
+ display: none;
314
+ cursor: default;
315
+ }
316
+
317
+ .pswp__button--arrow .pswp__icn {
318
+ top: 50%;
319
+ margin-top: -30px;
320
+ width: 60px;
321
+ height: 60px;
322
+ background: none;
323
+ border-radius: 0;
324
+ }
325
+
326
+ .pswp--one-slide .pswp__button--arrow {
327
+ display: none;
328
+ }
329
+
330
+ /* hide arrows on touch screens */
331
+ .pswp--touch .pswp__button--arrow {
332
+ visibility: hidden;
333
+ }
334
+
335
+ /* show arrows only after mouse was used */
336
+ .pswp--has_mouse .pswp__button--arrow {
337
+ visibility: visible;
338
+ }
339
+
340
+ .pswp__button--arrow--prev {
341
+ right: auto;
342
+ left: 0px;
343
+ }
344
+
345
+ .pswp__button--arrow--next {
346
+ right: 0px;
347
+ }
348
+ .pswp__button--arrow--next .pswp__icn {
349
+ left: auto;
350
+ right: 14px;
351
+ /* flip horizontally */
352
+ transform: scale(-1, 1);
353
+ }
354
+
355
+ /*
356
+
357
+ Zoom button
358
+
359
+ */
360
+ .pswp__button--zoom {
361
+ display: none;
362
+ }
363
+
364
+ .pswp--zoom-allowed .pswp__button--zoom {
365
+ display: block;
366
+ }
367
+
368
+ /* "+" => "-" */
369
+ .pswp--zoomed-in .pswp__zoom-icn-bar-v {
370
+ display: none;
371
+ }
372
+
373
+
374
+ /*
375
+
376
+ Loading indicator
377
+
378
+ */
379
+ .pswp__preloader {
380
+ position: relative;
381
+ overflow: hidden;
382
+ width: 50px;
383
+ height: 60px;
384
+ margin-right: auto;
385
+ }
386
+
387
+ .pswp__preloader .pswp__icn {
388
+ opacity: 0;
389
+ transition: opacity 0.2s linear;
390
+ animation: pswp-clockwise 600ms linear infinite;
391
+ }
392
+
393
+ .pswp__preloader--active .pswp__icn {
394
+ opacity: 0.85;
395
+ }
396
+
397
+ @keyframes pswp-clockwise {
398
+ 0% { transform: rotate(0deg); }
399
+ 100% { transform: rotate(360deg); }
400
+ }
401
+
402
+
403
+ /*
404
+
405
+ "1 of 10" counter
406
+
407
+ */
408
+ .pswp__counter {
409
+ height: 30px;
410
+ margin: 15px 0 0 20px;
172
411
  font-size: 14px;
173
- line-height: 16px;
174
- margin-top: -8px;
175
- color: #CCC; }
412
+ line-height: 30px;
413
+ color: var(--pswp-icon-color);
414
+ text-shadow: 1px 1px 3px var(--pswp-icon-color-secondary);
415
+ opacity: 0.85;
416
+ }
176
417
 
177
- .pswp__error-msg a {
178
- color: #CCC;
179
- text-decoration: underline; }
418
+ .pswp--one-slide .pswp__counter {
419
+ display: none;
420
+ }