intranet-pictures 1.0.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/lib/intranet/pictures/json_db_provider.rb +41 -71
  3. data/lib/intranet/pictures/responder.rb +127 -89
  4. data/lib/intranet/pictures/version.rb +1 -1
  5. data/lib/intranet/resources/haml/pictures_browse.haml +8 -8
  6. data/lib/intranet/resources/haml/pictures_home.haml +18 -19
  7. data/lib/intranet/resources/locales/en.yml +0 -1
  8. data/lib/intranet/resources/locales/fr.yml +0 -1
  9. data/lib/intranet/resources/www/jpictures.js +32 -14
  10. data/lib/intranet/resources/www/photoswipe/photoswipe-dynamic-caption-plugin.css +47 -0
  11. data/lib/intranet/resources/www/photoswipe/photoswipe-dynamic-caption-plugin.esm.js +400 -0
  12. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.js +1382 -0
  13. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.js.map +1 -0
  14. data/lib/intranet/resources/www/photoswipe/photoswipe-lightbox.esm.min.js +5 -0
  15. data/lib/intranet/resources/www/photoswipe/photoswipe.css +383 -142
  16. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.js +5279 -0
  17. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.js.map +1 -0
  18. data/lib/intranet/resources/www/photoswipe/photoswipe.esm.min.js +5 -0
  19. data/lib/intranet/resources/www/style.css +13 -0
  20. data/spec/intranet/pictures/json_db_provider_spec.rb +52 -147
  21. data/spec/intranet/pictures/responder_spec.rb +176 -191
  22. data/spec/intranet/pictures/sample-db.json +28 -38
  23. data/spec/spec_helper.rb +6 -8
  24. metadata +26 -28
  25. data/lib/intranet/resources/haml/pictures_photoswipe.haml +0 -23
  26. data/lib/intranet/resources/www/photoswipe/LICENSE +0 -21
  27. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.css +0 -484
  28. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.png +0 -0
  29. data/lib/intranet/resources/www/photoswipe/default-skin/default-skin.svg +0 -1
  30. data/lib/intranet/resources/www/photoswipe/default-skin/preloader.gif +0 -0
  31. data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.js +0 -861
  32. data/lib/intranet/resources/www/photoswipe/photoswipe-ui-default.min.js +0 -4
  33. data/lib/intranet/resources/www/photoswipe/photoswipe.js +0 -3734
  34. data/lib/intranet/resources/www/photoswipe/photoswipe.min.js +0 -4
@@ -1,484 +0,0 @@
1
- /*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */
2
- /*
3
-
4
- Contents:
5
-
6
- 1. Buttons
7
- 2. Share modal and links
8
- 3. Index indicator ("1 of X" counter)
9
- 4. Caption
10
- 5. Loading indicator
11
- 6. Additional styles (root element, top bar, idle state, hidden state, etc.)
12
-
13
- */
14
- /*
15
-
16
- 1. Buttons
17
-
18
- */
19
- /* <button> css reset */
20
- .pswp__button {
21
- width: 44px;
22
- height: 44px;
23
- position: relative;
24
- background: none;
25
- cursor: pointer;
26
- overflow: visible;
27
- -webkit-appearance: none;
28
- display: block;
29
- border: 0;
30
- padding: 0;
31
- margin: 0;
32
- float: right;
33
- opacity: 0.75;
34
- -webkit-transition: opacity 0.2s;
35
- transition: opacity 0.2s;
36
- -webkit-box-shadow: none;
37
- box-shadow: none; }
38
- .pswp__button:focus, .pswp__button:hover {
39
- opacity: 1; }
40
- .pswp__button:active {
41
- outline: none;
42
- opacity: 0.9; }
43
- .pswp__button::-moz-focus-inner {
44
- padding: 0;
45
- border: 0; }
46
-
47
- /* pswp__ui--over-close class it added when mouse is over element that should close gallery */
48
- .pswp__ui--over-close .pswp__button--close {
49
- opacity: 1; }
50
-
51
- .pswp__button,
52
- .pswp__button--arrow--left:before,
53
- .pswp__button--arrow--right:before {
54
- background: url(default-skin.png) 0 0 no-repeat;
55
- background-size: 264px 88px;
56
- width: 44px;
57
- height: 44px; }
58
-
59
- @media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-min-device-pixel-ratio: 1.09375), (min-resolution: 105dpi), (min-resolution: 1.1dppx) {
60
- /* Serve SVG sprite if browser supports SVG and resolution is more than 105dpi */
61
- .pswp--svg .pswp__button,
62
- .pswp--svg .pswp__button--arrow--left:before,
63
- .pswp--svg .pswp__button--arrow--right:before {
64
- background-image: url(default-skin.svg); }
65
- .pswp--svg .pswp__button--arrow--left,
66
- .pswp--svg .pswp__button--arrow--right {
67
- background: none; } }
68
-
69
- .pswp__button--close {
70
- background-position: 0 -44px; }
71
-
72
- .pswp__button--share {
73
- background-position: -44px -44px; }
74
-
75
- .pswp__button--fs {
76
- display: none; }
77
-
78
- .pswp--supports-fs .pswp__button--fs {
79
- display: block; }
80
-
81
- .pswp--fs .pswp__button--fs {
82
- background-position: -44px 0; }
83
-
84
- .pswp__button--zoom {
85
- display: none;
86
- background-position: -88px 0; }
87
-
88
- .pswp--zoom-allowed .pswp__button--zoom {
89
- display: block; }
90
-
91
- .pswp--zoomed-in .pswp__button--zoom {
92
- background-position: -132px 0; }
93
-
94
- /* no arrows on touch screens */
95
- .pswp--touch .pswp__button--arrow--left,
96
- .pswp--touch .pswp__button--arrow--right {
97
- visibility: hidden; }
98
-
99
- /*
100
- Arrow buttons hit area
101
- (icon is added to :before pseudo-element)
102
- */
103
- .pswp__button--arrow--left,
104
- .pswp__button--arrow--right {
105
- background: none;
106
- top: 50%;
107
- margin-top: -50px;
108
- width: 70px;
109
- height: 100px;
110
- position: absolute; }
111
-
112
- .pswp__button--arrow--left {
113
- left: 0; }
114
-
115
- .pswp__button--arrow--right {
116
- right: 0; }
117
-
118
- .pswp__button--arrow--left:before,
119
- .pswp__button--arrow--right:before {
120
- content: '';
121
- top: 35px;
122
- background-color: rgba(0, 0, 0, 0.3);
123
- height: 30px;
124
- width: 32px;
125
- position: absolute; }
126
-
127
- .pswp__button--arrow--left:before {
128
- left: 6px;
129
- background-position: -138px -44px; }
130
-
131
- .pswp__button--arrow--right:before {
132
- right: 6px;
133
- background-position: -94px -44px; }
134
-
135
- /*
136
-
137
- 2. Share modal/popup and links
138
-
139
- */
140
- .pswp__counter,
141
- .pswp__share-modal {
142
- -webkit-user-select: none;
143
- -moz-user-select: none;
144
- -ms-user-select: none;
145
- user-select: none; }
146
-
147
- .pswp__share-modal {
148
- display: block;
149
- background: rgba(0, 0, 0, 0.5);
150
- width: 100%;
151
- height: 100%;
152
- top: 0;
153
- left: 0;
154
- padding: 10px;
155
- position: absolute;
156
- z-index: 1600;
157
- opacity: 0;
158
- -webkit-transition: opacity 0.25s ease-out;
159
- transition: opacity 0.25s ease-out;
160
- -webkit-backface-visibility: hidden;
161
- will-change: opacity; }
162
-
163
- .pswp__share-modal--hidden {
164
- display: none; }
165
-
166
- .pswp__share-tooltip {
167
- z-index: 1620;
168
- position: absolute;
169
- background: #FFF;
170
- top: 56px;
171
- border-radius: 2px;
172
- display: block;
173
- width: auto;
174
- right: 44px;
175
- -webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
176
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
177
- -webkit-transform: translateY(6px);
178
- -ms-transform: translateY(6px);
179
- transform: translateY(6px);
180
- -webkit-transition: -webkit-transform 0.25s;
181
- transition: transform 0.25s;
182
- -webkit-backface-visibility: hidden;
183
- will-change: transform; }
184
- .pswp__share-tooltip a {
185
- display: block;
186
- padding: 8px 12px;
187
- color: #000;
188
- text-decoration: none;
189
- font-size: 14px;
190
- line-height: 18px; }
191
- .pswp__share-tooltip a:hover {
192
- text-decoration: none;
193
- color: #000; }
194
- .pswp__share-tooltip a:first-child {
195
- /* round corners on the first/last list item */
196
- border-radius: 2px 2px 0 0; }
197
- .pswp__share-tooltip a:last-child {
198
- border-radius: 0 0 2px 2px; }
199
-
200
- .pswp__share-modal--fade-in {
201
- opacity: 1; }
202
- .pswp__share-modal--fade-in .pswp__share-tooltip {
203
- -webkit-transform: translateY(0);
204
- -ms-transform: translateY(0);
205
- transform: translateY(0); }
206
-
207
- /* increase size of share links on touch devices */
208
- .pswp--touch .pswp__share-tooltip a {
209
- padding: 16px 12px; }
210
-
211
- a.pswp__share--facebook:before {
212
- content: '';
213
- display: block;
214
- width: 0;
215
- height: 0;
216
- position: absolute;
217
- top: -12px;
218
- right: 15px;
219
- border: 6px solid transparent;
220
- border-bottom-color: #FFF;
221
- -webkit-pointer-events: none;
222
- -moz-pointer-events: none;
223
- pointer-events: none; }
224
-
225
- a.pswp__share--facebook:hover {
226
- background: #3E5C9A;
227
- color: #FFF; }
228
- a.pswp__share--facebook:hover:before {
229
- border-bottom-color: #3E5C9A; }
230
-
231
- a.pswp__share--twitter:hover {
232
- background: #55ACEE;
233
- color: #FFF; }
234
-
235
- a.pswp__share--pinterest:hover {
236
- background: #CCC;
237
- color: #CE272D; }
238
-
239
- a.pswp__share--download:hover {
240
- background: #DDD; }
241
-
242
- /*
243
-
244
- 3. Index indicator ("1 of X" counter)
245
-
246
- */
247
- .pswp__counter {
248
- position: absolute;
249
- left: 0;
250
- top: 0;
251
- height: 44px;
252
- font-size: 100%; /* patch intranet */
253
- font-weight: bold; /* patch intranet */
254
- line-height: 44px;
255
- color: #FFF;
256
- opacity: 0.75;
257
- padding: 0 10px; }
258
-
259
- /*
260
-
261
- 4. Caption
262
-
263
- */
264
- .pswp__caption {
265
- position: absolute;
266
- left: 0;
267
- bottom: 0;
268
- width: 100%;
269
- min-height: 44px; }
270
- .pswp__caption small {
271
- font-size: 11px;
272
- color: #BBB; }
273
-
274
- .pswp__caption__center {
275
- text-align: center; /* patch intranet */
276
- /*max-width: 420px;*/ /* patch intranet */
277
- margin: 0 auto;
278
- font-size: 100%; /* patch intranet */
279
- padding: 0.625em; /* patch intranet */
280
- /*line-height: 20px;*/ /* patch intranet */
281
- font-weight: bold; /* patch intranet */
282
- color: #CCC; }
283
-
284
- .pswp__caption--empty {
285
- display: none; }
286
-
287
- /* Fake caption element, used to calculate height of next/prev image */
288
- .pswp__caption--fake {
289
- visibility: hidden; }
290
-
291
- /*
292
-
293
- 5. Loading indicator (preloader)
294
-
295
- You can play with it here - http://codepen.io/dimsemenov/pen/yyBWoR
296
-
297
- */
298
- .pswp__preloader {
299
- width: 44px;
300
- height: 44px;
301
- position: absolute;
302
- top: 0;
303
- left: 50%;
304
- margin-left: -22px;
305
- opacity: 0;
306
- -webkit-transition: opacity 0.25s ease-out;
307
- transition: opacity 0.25s ease-out;
308
- will-change: opacity;
309
- direction: ltr; }
310
-
311
- .pswp__preloader__icn {
312
- width: 20px;
313
- height: 20px;
314
- margin: 12px; }
315
-
316
- .pswp__preloader--active {
317
- opacity: 1; }
318
- .pswp__preloader--active .pswp__preloader__icn {
319
- /* We use .gif in browsers that don't support CSS animation */
320
- background: url(preloader.gif) 0 0 no-repeat; }
321
-
322
- .pswp--css_animation .pswp__preloader--active {
323
- opacity: 1; }
324
- .pswp--css_animation .pswp__preloader--active .pswp__preloader__icn {
325
- -webkit-animation: clockwise 500ms linear infinite;
326
- animation: clockwise 500ms linear infinite; }
327
- .pswp--css_animation .pswp__preloader--active .pswp__preloader__donut {
328
- -webkit-animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite;
329
- animation: donut-rotate 1000ms cubic-bezier(0.4, 0, 0.22, 1) infinite; }
330
-
331
- .pswp--css_animation .pswp__preloader__icn {
332
- background: none;
333
- opacity: 0.75;
334
- width: 14px;
335
- height: 14px;
336
- position: absolute;
337
- left: 15px;
338
- top: 15px;
339
- margin: 0; }
340
-
341
- .pswp--css_animation .pswp__preloader__cut {
342
- /*
343
- The idea of animating inner circle is based on Polymer ("material") loading indicator
344
- by Keanu Lee https://blog.keanulee.com/2014/10/20/the-tale-of-three-spinners.html
345
- */
346
- position: relative;
347
- width: 7px;
348
- height: 14px;
349
- overflow: hidden; }
350
-
351
- .pswp--css_animation .pswp__preloader__donut {
352
- -webkit-box-sizing: border-box;
353
- box-sizing: border-box;
354
- width: 14px;
355
- height: 14px;
356
- border: 2px solid #FFF;
357
- border-radius: 50%;
358
- border-left-color: transparent;
359
- border-bottom-color: transparent;
360
- position: absolute;
361
- top: 0;
362
- left: 0;
363
- background: none;
364
- margin: 0; }
365
-
366
- @media screen and (max-width: 1024px) {
367
- .pswp__preloader {
368
- position: relative;
369
- left: auto;
370
- top: auto;
371
- margin: 0;
372
- float: right; } }
373
-
374
- @-webkit-keyframes clockwise {
375
- 0% {
376
- -webkit-transform: rotate(0deg);
377
- transform: rotate(0deg); }
378
- 100% {
379
- -webkit-transform: rotate(360deg);
380
- transform: rotate(360deg); } }
381
-
382
- @keyframes clockwise {
383
- 0% {
384
- -webkit-transform: rotate(0deg);
385
- transform: rotate(0deg); }
386
- 100% {
387
- -webkit-transform: rotate(360deg);
388
- transform: rotate(360deg); } }
389
-
390
- @-webkit-keyframes donut-rotate {
391
- 0% {
392
- -webkit-transform: rotate(0);
393
- transform: rotate(0); }
394
- 50% {
395
- -webkit-transform: rotate(-140deg);
396
- transform: rotate(-140deg); }
397
- 100% {
398
- -webkit-transform: rotate(0);
399
- transform: rotate(0); } }
400
-
401
- @keyframes donut-rotate {
402
- 0% {
403
- -webkit-transform: rotate(0);
404
- transform: rotate(0); }
405
- 50% {
406
- -webkit-transform: rotate(-140deg);
407
- transform: rotate(-140deg); }
408
- 100% {
409
- -webkit-transform: rotate(0);
410
- transform: rotate(0); } }
411
-
412
- /*
413
-
414
- 6. Additional styles
415
-
416
- */
417
- /* root element of UI */
418
- .pswp__ui {
419
- -webkit-font-smoothing: auto;
420
- visibility: visible;
421
- opacity: 1;
422
- z-index: 1550; }
423
-
424
- /* top black bar with buttons and "1 of X" indicator */
425
- .pswp__top-bar {
426
- position: absolute;
427
- left: 0;
428
- top: 0;
429
- height: 44px;
430
- width: 100%; }
431
-
432
- .pswp__caption,
433
- .pswp__top-bar,
434
- .pswp--has_mouse .pswp__button--arrow--left,
435
- .pswp--has_mouse .pswp__button--arrow--right {
436
- -webkit-backface-visibility: hidden;
437
- will-change: opacity;
438
- -webkit-transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1);
439
- transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
440
-
441
- /* pswp--has_mouse class is added only when two subsequent mousemove events occur */
442
- .pswp--has_mouse .pswp__button--arrow--left,
443
- .pswp--has_mouse .pswp__button--arrow--right {
444
- visibility: visible; }
445
-
446
- .pswp__top-bar,
447
- .pswp__caption {
448
- background-color: rgba(0, 0, 0, 0.5); }
449
-
450
- /* pswp__ui--fit class is added when main image "fits" between top bar and bottom bar (caption) */
451
- .pswp__ui--fit .pswp__top-bar,
452
- .pswp__ui--fit .pswp__caption {
453
- background-color: rgba(0, 0, 0, 0.3); }
454
-
455
- /* pswp__ui--idle class is added when mouse isn't moving for several seconds (JS option timeToIdle) */
456
- .pswp__ui--idle .pswp__top-bar {
457
- opacity: 0; }
458
-
459
- .pswp__ui--idle .pswp__button--arrow--left,
460
- .pswp__ui--idle .pswp__button--arrow--right {
461
- opacity: 0; }
462
-
463
- /*
464
- pswp__ui--hidden class is added when controls are hidden
465
- e.g. when user taps to toggle visibility of controls
466
- */
467
- .pswp__ui--hidden .pswp__top-bar,
468
- .pswp__ui--hidden .pswp__caption,
469
- .pswp__ui--hidden .pswp__button--arrow--left,
470
- .pswp__ui--hidden .pswp__button--arrow--right {
471
- /* Force paint & create composition layer for controls. */
472
- opacity: 0.001; }
473
-
474
- /* pswp__ui--one-slide class is added when there is just one item in gallery */
475
- .pswp__ui--one-slide .pswp__button--arrow--left,
476
- .pswp__ui--one-slide .pswp__button--arrow--right,
477
- .pswp__ui--one-slide .pswp__counter {
478
- display: none; }
479
-
480
- .pswp__element--disabled {
481
- display: none !important; }
482
-
483
- .pswp--minimal--dark .pswp__top-bar {
484
- background: none; }
@@ -1 +0,0 @@
1
- <svg width="264" height="88" viewBox="0 0 264 88" xmlns="http://www.w3.org/2000/svg"><title>default-skin 2</title><g fill="none" fill-rule="evenodd"><g><path d="M67.002 59.5v3.768c-6.307.84-9.184 5.75-10.002 9.732 2.22-2.83 5.564-5.098 10.002-5.098V71.5L73 65.585 67.002 59.5z" id="Shape" fill="#fff"/><g fill="#fff"><path d="M13 29v-5h2v3h3v2h-5zM13 15h5v2h-3v3h-2v-5zM31 15v5h-2v-3h-3v-2h5zM31 29h-5v-2h3v-3h2v5z" id="Shape"/></g><g fill="#fff"><path d="M62 24v5h-2v-3h-3v-2h5zM62 20h-5v-2h3v-3h2v5zM70 20v-5h2v3h3v2h-5zM70 24h5v2h-3v3h-2v-5z"/></g><path d="M20.586 66l-5.656-5.656 1.414-1.414L22 64.586l5.656-5.656 1.414 1.414L23.414 66l5.656 5.656-1.414 1.414L22 67.414l-5.656 5.656-1.414-1.414L20.586 66z" fill="#fff"/><path d="M111.785 65.03L110 63.5l3-3.5h-10v-2h10l-3-3.5 1.785-1.468L117 59l-5.215 6.03z" fill="#fff"/><path d="M152.215 65.03L154 63.5l-3-3.5h10v-2h-10l3-3.5-1.785-1.468L147 59l5.215 6.03z" fill="#fff"/><g><path id="Rectangle-11" fill="#fff" d="M160.957 28.543l-3.25-3.25-1.413 1.414 3.25 3.25z"/><path d="M152.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" id="Oval-1" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M150 21h5v1h-5z"/></g><g><path d="M116.957 28.543l-1.414 1.414-3.25-3.25 1.414-1.414 3.25 3.25z" fill="#fff"/><path d="M108.5 27c3.038 0 5.5-2.462 5.5-5.5s-2.462-5.5-5.5-5.5-5.5 2.462-5.5 5.5 2.462 5.5 5.5 5.5z" stroke="#fff" stroke-width="1.5"/><path fill="#fff" d="M106 21h5v1h-5z"/><path fill="#fff" d="M109.043 19.008l-.085 5-1-.017.085-5z"/></g></g></g></svg>