promethee 1.6.60 → 1.6.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/promethee.js +1 -1
  3. data/app/assets/stylesheets/promethee.sass +1 -1
  4. data/app/views/promethee/show/_image.srcset.html.erb +1 -1
  5. data/lib/promethee/rails/version.rb +1 -1
  6. data/node_modules/@fancyapps/fancybox/README.md +62 -0
  7. data/node_modules/@fancyapps/fancybox/bower.json +23 -0
  8. data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.css +770 -0
  9. data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.js +5138 -0
  10. data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.min.css +1 -0
  11. data/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.min.js +12 -0
  12. data/node_modules/@fancyapps/fancybox/docs/index.html +1923 -0
  13. data/node_modules/@fancyapps/fancybox/gulpfile.js +67 -0
  14. data/node_modules/@fancyapps/fancybox/package.json +80 -0
  15. data/node_modules/@fancyapps/fancybox/src/css/core.css +634 -0
  16. data/node_modules/@fancyapps/fancybox/src/css/fullscreen.css +11 -0
  17. data/node_modules/@fancyapps/fancybox/src/css/share.css +96 -0
  18. data/node_modules/@fancyapps/fancybox/src/css/slideshow.css +26 -0
  19. data/node_modules/@fancyapps/fancybox/src/css/thumbs.css +120 -0
  20. data/node_modules/@fancyapps/fancybox/src/js/core.js +3064 -0
  21. data/node_modules/@fancyapps/fancybox/src/js/fullscreen.js +169 -0
  22. data/node_modules/@fancyapps/fancybox/src/js/guestures.js +885 -0
  23. data/node_modules/@fancyapps/fancybox/src/js/hash.js +216 -0
  24. data/node_modules/@fancyapps/fancybox/src/js/media.js +201 -0
  25. data/node_modules/@fancyapps/fancybox/src/js/share.js +104 -0
  26. data/node_modules/@fancyapps/fancybox/src/js/slideshow.js +181 -0
  27. data/node_modules/@fancyapps/fancybox/src/js/thumbs.js +259 -0
  28. data/node_modules/@fancyapps/fancybox/src/js/wheel.js +41 -0
  29. metadata +24 -1
@@ -0,0 +1,216 @@
1
+ // ==========================================================================
2
+ //
3
+ // Hash
4
+ // Enables linking to each modal
5
+ //
6
+ // ==========================================================================
7
+ (function(document, window, $) {
8
+ "use strict";
9
+
10
+ // Simple $.escapeSelector polyfill (for jQuery prior v3)
11
+ if (!$.escapeSelector) {
12
+ $.escapeSelector = function(sel) {
13
+ var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
14
+ var fcssescape = function(ch, asCodePoint) {
15
+ if (asCodePoint) {
16
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
17
+ if (ch === "\0") {
18
+ return "\uFFFD";
19
+ }
20
+
21
+ // Control characters and (dependent upon position) numbers get escaped as code points
22
+ return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
23
+ }
24
+
25
+ // Other potentially-special ASCII characters get backslash-escaped
26
+ return "\\" + ch;
27
+ };
28
+
29
+ return (sel + "").replace(rcssescape, fcssescape);
30
+ };
31
+ }
32
+
33
+ // Get info about gallery name and current index from url
34
+ function parseUrl() {
35
+ var hash = window.location.hash.substr(1),
36
+ rez = hash.split("-"),
37
+ index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1,
38
+ gallery = rez.join("-");
39
+
40
+ return {
41
+ hash: hash,
42
+ /* Index is starting from 1 */
43
+ index: index < 1 ? 1 : index,
44
+ gallery: gallery
45
+ };
46
+ }
47
+
48
+ // Trigger click evnt on links to open new fancyBox instance
49
+ function triggerFromUrl(url) {
50
+ var $el;
51
+
52
+ if (url.gallery !== "") {
53
+ // If we can find element matching 'data-fancybox' atribute, then trigger click event for that.
54
+ // It should start fancyBox
55
+ $el = $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']")
56
+ .eq(url.index - 1)
57
+ .trigger("click.fb-start");
58
+ }
59
+ }
60
+
61
+ // Get gallery name from current instance
62
+ function getGalleryID(instance) {
63
+ var opts, ret;
64
+
65
+ if (!instance) {
66
+ return false;
67
+ }
68
+
69
+ opts = instance.current ? instance.current.opts : instance.opts;
70
+ ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") : "");
71
+
72
+ return ret === "" ? false : ret;
73
+ }
74
+
75
+ // Start when DOM becomes ready
76
+ $(function() {
77
+ // Check if user has disabled this module
78
+ if ($.fancybox.defaults.hash === false) {
79
+ return;
80
+ }
81
+
82
+ // Update hash when opening/closing fancyBox
83
+ $(document).on({
84
+ "onInit.fb": function(e, instance) {
85
+ var url, gallery;
86
+
87
+ if (instance.group[instance.currIndex].opts.hash === false) {
88
+ return;
89
+ }
90
+
91
+ url = parseUrl();
92
+ gallery = getGalleryID(instance);
93
+
94
+ // Make sure gallery start index matches index from hash
95
+ if (gallery && url.gallery && gallery == url.gallery) {
96
+ instance.currIndex = url.index - 1;
97
+ }
98
+ },
99
+
100
+ "beforeShow.fb": function(e, instance, current, firstRun) {
101
+ var gallery;
102
+
103
+ if (!current || current.opts.hash === false) {
104
+ return;
105
+ }
106
+
107
+ // Check if need to update window hash
108
+ gallery = getGalleryID(instance);
109
+
110
+ if (!gallery) {
111
+ return;
112
+ }
113
+
114
+ // Variable containing last hash value set by fancyBox
115
+ // It will be used to determine if fancyBox needs to close after hash change is detected
116
+ instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : "");
117
+
118
+ // If current hash is the same (this instance most likely is opened by hashchange), then do nothing
119
+ if (window.location.hash === "#" + instance.currentHash) {
120
+ return;
121
+ }
122
+
123
+ if (!instance.origHash) {
124
+ instance.origHash = window.location.hash;
125
+ }
126
+
127
+ if (instance.hashTimer) {
128
+ clearTimeout(instance.hashTimer);
129
+ }
130
+
131
+ // Update hash
132
+ instance.hashTimer = setTimeout(function() {
133
+ if ("replaceState" in window.history) {
134
+ window.history[firstRun ? "pushState" : "replaceState"](
135
+ {},
136
+ document.title,
137
+ window.location.pathname + window.location.search + "#" + instance.currentHash
138
+ );
139
+
140
+ if (firstRun) {
141
+ instance.hasCreatedHistory = true;
142
+ }
143
+ } else {
144
+ window.location.hash = instance.currentHash;
145
+ }
146
+
147
+ instance.hashTimer = null;
148
+ }, 300);
149
+ },
150
+
151
+ "beforeClose.fb": function(e, instance, current) {
152
+ var gallery;
153
+
154
+ if (current.opts.hash === false) {
155
+ return;
156
+ }
157
+
158
+ gallery = getGalleryID(instance);
159
+
160
+ // Goto previous history entry
161
+ if (instance.currentHash && instance.hasCreatedHistory) {
162
+ window.history.back();
163
+ } else if (instance.currentHash) {
164
+ if ("replaceState" in window.history) {
165
+ window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || ""));
166
+ } else {
167
+ window.location.hash = instance.origHash;
168
+ }
169
+ }
170
+
171
+ instance.currentHash = null;
172
+
173
+ clearTimeout(instance.hashTimer);
174
+ }
175
+ });
176
+
177
+ // Check if need to start/close after url has changed
178
+ $(window).on("hashchange.fb", function() {
179
+ var url = parseUrl(),
180
+ fb;
181
+
182
+ // Find last fancyBox instance that has "hash"
183
+ $.each(
184
+ $(".fancybox-container")
185
+ .get()
186
+ .reverse(),
187
+ function(index, value) {
188
+ var tmp = $(value).data("FancyBox");
189
+ //isClosing
190
+ if (tmp.currentHash) {
191
+ fb = tmp;
192
+ return false;
193
+ }
194
+ }
195
+ );
196
+
197
+ if (fb) {
198
+ // Now, compare hash values
199
+ if (fb.currentHash && fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) {
200
+ fb.currentHash = null;
201
+
202
+ fb.close();
203
+ }
204
+ } else if (url.gallery !== "") {
205
+ triggerFromUrl(url);
206
+ }
207
+ });
208
+
209
+ // Check current hash and trigger click event on matching element to start fancyBox, if needed
210
+ setTimeout(function() {
211
+ if (!$.fancybox.getInstance()) {
212
+ triggerFromUrl(parseUrl());
213
+ }
214
+ }, 50);
215
+ });
216
+ })(document, window, window.jQuery || jQuery);
@@ -0,0 +1,201 @@
1
+ // ==========================================================================
2
+ //
3
+ // Media
4
+ // Adds additional media type support
5
+ //
6
+ // ==========================================================================
7
+ (function($) {
8
+ "use strict";
9
+
10
+ // Formats matching url to final form
11
+
12
+ var format = function(url, rez, params) {
13
+ if (!url) {
14
+ return;
15
+ }
16
+
17
+ params = params || "";
18
+
19
+ if ($.type(params) === "object") {
20
+ params = $.param(params, true);
21
+ }
22
+
23
+ $.each(rez, function(key, value) {
24
+ url = url.replace("$" + key, value || "");
25
+ });
26
+
27
+ if (params.length) {
28
+ url += (url.indexOf("?") > 0 ? "&" : "?") + params;
29
+ }
30
+
31
+ return url;
32
+ };
33
+
34
+ // Object containing properties for each media type
35
+
36
+ var defaults = {
37
+ youtube: {
38
+ matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,
39
+ params: {
40
+ autoplay: 1,
41
+ autohide: 1,
42
+ fs: 1,
43
+ rel: 0,
44
+ hd: 1,
45
+ wmode: "transparent",
46
+ enablejsapi: 1,
47
+ html5: 1
48
+ },
49
+ paramPlace: 8,
50
+ type: "iframe",
51
+ url: "//www.youtube.com/embed/$4",
52
+ thumb: "//img.youtube.com/vi/$4/hqdefault.jpg"
53
+ },
54
+
55
+ vimeo: {
56
+ matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,
57
+ params: {
58
+ autoplay: 1,
59
+ hd: 1,
60
+ show_title: 1,
61
+ show_byline: 1,
62
+ show_portrait: 0,
63
+ fullscreen: 1,
64
+ api: 1
65
+ },
66
+ paramPlace: 3,
67
+ type: "iframe",
68
+ url: "//player.vimeo.com/video/$2"
69
+ },
70
+
71
+ instagram: {
72
+ matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
73
+ type: "image",
74
+ url: "//$1/p/$2/media/?size=l"
75
+ },
76
+
77
+ // Examples:
78
+ // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
79
+ // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z
80
+ // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en
81
+ // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572
82
+ gmap_place: {
83
+ matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,
84
+ type: "iframe",
85
+ url: function(rez) {
86
+ return (
87
+ "//maps.google." +
88
+ rez[2] +
89
+ "/?ll=" +
90
+ (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") +
91
+ "&output=" +
92
+ (rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed")
93
+ );
94
+ }
95
+ },
96
+
97
+ // Examples:
98
+ // https://www.google.com/maps/search/Empire+State+Building/
99
+ // https://www.google.com/maps/search/?api=1&query=centurylink+field
100
+ // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393
101
+ gmap_search: {
102
+ matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,
103
+ type: "iframe",
104
+ url: function(rez) {
105
+ return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed";
106
+ }
107
+ }
108
+ };
109
+
110
+ $(document).on("objectNeedsType.fb", function(e, instance, item) {
111
+ var url = item.src || "",
112
+ type = false,
113
+ media,
114
+ thumb,
115
+ rez,
116
+ params,
117
+ urlParams,
118
+ paramObj,
119
+ provider;
120
+
121
+ media = $.extend(true, {}, defaults, item.opts.media);
122
+
123
+ // Look for any matching media type
124
+ $.each(media, function(providerName, providerOpts) {
125
+ rez = url.match(providerOpts.matcher);
126
+
127
+ if (!rez) {
128
+ return;
129
+ }
130
+
131
+ type = providerOpts.type;
132
+ provider = providerName;
133
+ paramObj = {};
134
+
135
+ if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) {
136
+ urlParams = rez[providerOpts.paramPlace];
137
+
138
+ if (urlParams[0] == "?") {
139
+ urlParams = urlParams.substring(1);
140
+ }
141
+
142
+ urlParams = urlParams.split("&");
143
+
144
+ for (var m = 0; m < urlParams.length; ++m) {
145
+ var p = urlParams[m].split("=", 2);
146
+
147
+ if (p.length == 2) {
148
+ paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
149
+ }
150
+ }
151
+ }
152
+
153
+ params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj);
154
+
155
+ url =
156
+ $.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params);
157
+
158
+ thumb =
159
+ $.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez);
160
+
161
+ if (providerName === "youtube") {
162
+ url = url.replace(/&t=((\d+)m)?(\d+)s/, function(match, p1, m, s) {
163
+ return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10));
164
+ });
165
+ } else if (providerName === "vimeo") {
166
+ url = url.replace("&%23", "#");
167
+ }
168
+
169
+ return false;
170
+ });
171
+
172
+ // If it is found, then change content type and update the url
173
+
174
+ if (type) {
175
+ if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) {
176
+ item.opts.thumb = thumb;
177
+ }
178
+
179
+ if (type === "iframe") {
180
+ item.opts = $.extend(true, item.opts, {
181
+ iframe: {
182
+ preload: false,
183
+ attr: {
184
+ scrolling: "no"
185
+ }
186
+ }
187
+ });
188
+ }
189
+
190
+ $.extend(item, {
191
+ type: type,
192
+ src: url,
193
+ origSrc: item.src,
194
+ contentSource: provider,
195
+ contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video"
196
+ });
197
+ } else if (url) {
198
+ item.type = item.opts.defaultType;
199
+ }
200
+ });
201
+ })(window.jQuery || jQuery);
@@ -0,0 +1,104 @@
1
+ //// ==========================================================================
2
+ //
3
+ // Share
4
+ // Displays simple form for sharing current url
5
+ //
6
+ // ==========================================================================
7
+ (function(document, $) {
8
+ "use strict";
9
+
10
+ $.extend(true, $.fancybox.defaults, {
11
+ btnTpl: {
12
+ share:
13
+ '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' +
14
+ '<svg viewBox="0 0 40 40">' +
15
+ '<path d="M6,30 C8,18 19,16 23,16 L23,16 L23,10 L33,20 L23,29 L23,24 C19,24 8,27 6,30 Z">' +
16
+ "</svg>" +
17
+ "</button>"
18
+ },
19
+ share: {
20
+ url: function(instance, item) {
21
+ return (
22
+ (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location
23
+ );
24
+ },
25
+ tpl:
26
+ '<div class="fancybox-share">' +
27
+ "<h1>{{SHARE}}</h1>" +
28
+ "<p>" +
29
+ '<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' +
30
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg>' +
31
+ "<span>Facebook</span>" +
32
+ "</a>" +
33
+ '<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' +
34
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg>' +
35
+ "<span>Twitter</span>" +
36
+ "</a>" +
37
+ '<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' +
38
+ '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg>' +
39
+ "<span>Pinterest</span>" +
40
+ "</a>" +
41
+ "</p>" +
42
+ '<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" /></p>' +
43
+ "</div>"
44
+ }
45
+ });
46
+
47
+ function escapeHtml(string) {
48
+ var entityMap = {
49
+ "&": "&amp;",
50
+ "<": "&lt;",
51
+ ">": "&gt;",
52
+ '"': "&quot;",
53
+ "'": "&#39;",
54
+ "/": "&#x2F;",
55
+ "`": "&#x60;",
56
+ "=": "&#x3D;"
57
+ };
58
+
59
+ return String(string).replace(/[&<>"'`=\/]/g, function(s) {
60
+ return entityMap[s];
61
+ });
62
+ }
63
+
64
+ $(document).on("click", "[data-fancybox-share]", function() {
65
+ var instance = $.fancybox.getInstance(),
66
+ current = instance.current || null,
67
+ url,
68
+ tpl;
69
+
70
+ if (!current) {
71
+ return;
72
+ }
73
+
74
+ if ($.type(current.opts.share.url) === "function") {
75
+ url = current.opts.share.url.apply(current, [instance, current]);
76
+ }
77
+
78
+ tpl = current.opts.share.tpl
79
+ .replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "")
80
+ .replace(/\{\{url\}\}/g, encodeURIComponent(url))
81
+ .replace(/\{\{url_raw\}\}/g, escapeHtml(url))
82
+ .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : "");
83
+
84
+ $.fancybox.open({
85
+ src: instance.translate(instance, tpl),
86
+ type: "html",
87
+ opts: {
88
+ animationEffect: false,
89
+ afterLoad: function(shareInstance, shareCurrent) {
90
+ // Close self if parent instance is closing
91
+ instance.$refs.container.one("beforeClose.fb", function() {
92
+ shareInstance.close(null, 0);
93
+ });
94
+
95
+ // Opening links in a popup window
96
+ shareCurrent.$content.find(".fancybox-share__links a").click(function() {
97
+ window.open(this.href, "Share", "width=550, height=450");
98
+ return false;
99
+ });
100
+ }
101
+ }
102
+ });
103
+ });
104
+ })(document, window.jQuery || jQuery);