j1-template 2021.2.4 → 2021.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/connectors/ad/google-adsense.html +7 -0
  3. data/_includes/themes/j1/modules/connectors/translators/google-translator.html +2 -1
  4. data/_layouts/default.html +0 -1
  5. data/assets/data/iso-639-language-codes-flags.json +224 -0
  6. data/assets/data/{translator_languages.json → iso-639-language-codes.json} +111 -142
  7. data/assets/data/translator.html +24 -20
  8. data/assets/themes/j1/adapter/js/translator.1.js +525 -0
  9. data/assets/themes/j1/adapter/js/translator.js +104 -181
  10. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.css +27 -12
  11. data/assets/themes/j1/core/css/themes/bootstrap/bootstrap.min.css +1 -1
  12. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.css +27 -12
  13. data/assets/themes/j1/core/css/themes/uno-dark/bootstrap.min.css +1 -1
  14. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.css +59 -22
  15. data/assets/themes/j1/core/css/themes/uno-light/bootstrap.min.css +1 -1
  16. data/assets/themes/j1/modules/lightGallery/js/modules/lg-thumbnail.js +16 -8
  17. data/assets/themes/j1/modules/translator/js/translator.js +208 -236
  18. data/assets/themes/j1/modules/translator/js/translator.min.js +2 -2
  19. data/lib/j1/version.rb +1 -1
  20. data/lib/starter_web/Gemfile +1 -1
  21. data/lib/starter_web/_config.yml +1 -1
  22. data/lib/starter_web/_data/j1_config.yml +2 -22
  23. data/lib/starter_web/_data/modules/defaults/translator.yml +77 -64
  24. data/lib/starter_web/_data/modules/translator.yml +1 -0
  25. data/lib/starter_web/_includes/attributes.asciidoc +1 -1
  26. data/lib/starter_web/_plugins/lunr_index.rb +1 -1
  27. data/lib/starter_web/package.json +1 -1
  28. data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +3 -3
  29. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  30. data/lib/starter_web/utilsrv/package.json +1 -1
  31. metadata +5 -7
  32. data/assets/data/msdropdown.json +0 -155
  33. data/assets/themes/j1/modules/lightGallery/js/modules/lg-video.js +0 -342
  34. data/assets/themes/j1/modules/lightGallery/js/modules/lg-video.min.js +0 -5
  35. data/lib/starter_web/assets/images/pages/features/percentage_global_mobile_tr.jpg +0 -0
@@ -1,155 +0,0 @@
1
- ---
2
- regenerate: true
3
- exclude_from_search: true
4
- ---
5
-
6
- {% capture cache %}
7
-
8
- {% comment %}
9
- # -----------------------------------------------------------------------------
10
- # ~/assets/data/msdropdown.json
11
- # The Liquid template is used by J1 Translator module to create msDropdown
12
- # (select) elements DYNAMICALLY
13
- #
14
- # Product/Info:
15
- # https://jekyll.one
16
- #
17
- # Copyright (C) 2021 Juergen Adams
18
- #
19
- # J1 Template is licensed under the MIT License.
20
- # For details, see https://jekyll.one
21
- # -----------------------------------------------------------------------------
22
- # NOTE:
23
- # Be carefull change the Liquid code. If the code is changed, check the
24
- # integrity of the JSON data created. Invalid JSON data will cause the
25
- # the J1 Translator module to fail.
26
- # -----------------------------------------------------------------------------
27
- # Test data:
28
- # {{ liquid_var | debug }}
29
- # -----------------------------------------------------------------------------
30
- {% endcomment %}
31
-
32
- {% comment %} Set config data
33
- -------------------------------------------------------------------------------- {% endcomment %}
34
- {% assign environment = site.environment %}
35
-
36
- {
37
- "googleLanguages":
38
- [
39
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "af", "text": "Afrikaans"},
40
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sq", "text": "Albanian"},
41
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ar", "text": "Arabic"},
42
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "hy", "text": "Armenian"},
43
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "az", "text": "Azerbaijani"},
44
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "eu", "text": "Basque"},
45
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "be", "text": "Belarusian"},
46
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "bn", "text": "Bengali"},
47
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "bg", "text": "Bulgarian"},
48
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ca", "text": "Catalan"},
49
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "zh-CN", "text": "Chinese (Simplified)"},
50
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "zh-TW", "text": "Chinese (Traditional)"},
51
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "hr", "text": "Croatian"},
52
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "cs", "text": "Czech"},
53
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "da", "text": "Danish"},
54
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "nl", "text": "Dutch"},
55
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "eo", "text": "Esperanto"},
56
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "et", "text": "Estonian"},
57
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "tl", "text": "Filipino"},
58
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "fi", "text": "Finnish"},
59
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "fr", "text": "French"},
60
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "gl", "text": "Galician"},
61
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ka", "text": "Georgian"},
62
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "de", "text": "German"},
63
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "el", "text": "Greek"},
64
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "gu", "text": "Gujarati"},
65
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ht", "text": "Haitian Creole"},
66
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "iw", "text": "Hebrew"},
67
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "hi", "text": "Hindi"},
68
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "hu", "text": "Hungarian"},
69
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "is", "text": "Icelandic"},
70
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "id", "text": "Indonesian"},
71
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ga", "text": "Irish"},
72
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "it", "text": "Italian"},
73
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ja", "text": "Japanese"},
74
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "kn", "text": "Kannada"},
75
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ko", "text": "Korean"},
76
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "la", "text": "Latin"},
77
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "lv", "text": "Latvian"},
78
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "lt", "text": "Lithuanian"},
79
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "mk", "text": "Macedonian"},
80
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ms", "text": "Malay"},
81
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "mt", "text": "Maltese"},
82
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "no", "text": "Norwegian"},
83
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "fa", "text": "Persian"},
84
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "pl", "text": "Polish"},
85
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "pt", "text": "Portuguese"},
86
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ro", "text": "Romanian"},
87
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ru", "text": "Russian"},
88
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sr", "text": "Serbian"},
89
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sk", "text": "Slovak"},
90
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sl", "text": "Slovenian"},
91
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "es", "text": "Spanish"},
92
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sw", "text": "Swahili"},
93
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sv", "text": "Swedish"},
94
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ta", "text": "Tamil"},
95
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "te", "text": "Telugu"},
96
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "th", "text": "Thai"},
97
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "tr", "text": "Turkish"},
98
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "uk", "text": "Ukrainian"},
99
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ur", "text": "Urdu"},
100
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "vi", "text": "Vietnamese"},
101
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "cy", "text": "Welsh"},
102
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "yi", "text": "Yiddish"}
103
- ],
104
-
105
- "deeplLanguages":
106
- [
107
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "bg", "text": "Bulgarian" },
108
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "cs", "text": "Czech" },
109
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "da", "text": "Danish" },
110
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "de", "text": "German" },
111
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "el", "text": "Greek" },
112
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "es", "text": "Spanish" },
113
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "en", "text": "English" },
114
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "en-us", "text": "English (American)" },
115
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "en-uk", "text": "English (British)" },
116
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "et", "text": "Estonian" },
117
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ft", "text": "Finnish" },
118
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "fr", "text": "French" },
119
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "hu", "text": "Hungarian" },
120
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "it", "text": "Italian" },
121
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ja", "text": "Japanese" },
122
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "lv", "text": "Latvian" },
123
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "lt", "text": "Lithuanian" },
124
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "nl", "text": "Dutch" },
125
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "af", "text": "Polish" },
126
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "pt", "text": "Portuguese" },
127
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "pt-pt", "text": "Portuguese (Portugal)" },
128
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "pt-br", "text": "Portuguese (Brazilian)" },
129
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ro", "text": "Romanian" },
130
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "ru", "text": "Russian" },
131
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sk", "text": "Slovak" },
132
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sl", "text": "Slovenian" },
133
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "sv", "text": "Swedish" },
134
- {"imageCss": "flag-icon flag-icon-cz rectangle size-md", "value": "zh", "text": "Chinese" }
135
- ],
136
-
137
- "jsonTest":
138
- [
139
- {"description":"Choose your payment gateway", "value":"", "text":"Payment Gateway"},
140
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Amex-56.png", "description":"My life. My card...", "value":"amex", "text":"Amex"},
141
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Discover-56.png", "description":"It pays to Discover...", "value":"Discover", "text":"Discover"},
142
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Mastercard-56.png", "title":"For everything else...", "description":"For everything else...", "value":"Mastercard", "text":"Mastercard"},
143
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Cash-56.png", "description":"Sorry not available...", "value":"cash", "text":"Cash on delivery", "disabled":true},
144
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Visa-56.png", "description":"All you need...", "value":"Visa", "text":"Visa"},
145
- {"image":"/assets/themes/j1/modules/imageDropdown/icons/Paypal-56.png", "description":"Pay and get paid...", "value":"Paypal", "text":"Paypal"}
146
- ]
147
- }
148
-
149
- {% endcapture %}
150
- {% if production %}
151
- {{ cache | minifyJSON }}
152
- {% else %}
153
- {{ cache | strip_empty_lines }}
154
- {% endif %}
155
- {% assign cache = nil %}
@@ -1,342 +0,0 @@
1
- /*! lg-video - v1.2.2 - 2018-05-01
2
- * http://sachinchoolur.github.io/lightGallery
3
- * Copyright (c) 2018 Sachin N; Licensed GPLv3 */
4
-
5
- (function (root, factory) {
6
- if (typeof define === 'function' && define.amd) {
7
- // AMD. Register as an anonymous module unless amdModuleId is set
8
- define(['jquery'], function (a0) {
9
- return (factory(a0));
10
- });
11
- } else if (typeof module === 'object' && module.exports) {
12
- // Node. Does not work with strict CommonJS, but
13
- // only CommonJS-like environments that support module.exports,
14
- // like Node.
15
- module.exports = factory(require('jquery'));
16
- } else {
17
- factory(root["jQuery"]);
18
- }
19
- }(this, function ($) {
20
-
21
- (function() {
22
-
23
- 'use strict';
24
-
25
- var defaults = {
26
- videoMaxWidth: '855px',
27
-
28
- autoplayFirstVideo: true,
29
-
30
- youtubePlayerParams: false,
31
- vimeoPlayerParams: false,
32
- dailymotionPlayerParams: false,
33
- vkPlayerParams: false,
34
-
35
- videojs: false,
36
- videojsOptions: {}
37
- };
38
-
39
- var Video = function(element) {
40
-
41
- this.core = $(element).data('lightGallery');
42
-
43
- this.$el = $(element);
44
- this.core.s = $.extend({}, defaults, this.core.s);
45
- this.videoLoaded = false;
46
-
47
- this.init();
48
-
49
- return this;
50
- };
51
-
52
- Video.prototype.init = function() {
53
- var _this = this;
54
-
55
- // Event triggered when video url found without poster
56
- _this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this));
57
-
58
- // Set max width for video
59
- _this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this));
60
-
61
- if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
62
- _this.core.$el.on('onSlideClick.lg.tm', function() {
63
- var $el = _this.core.$slide.eq(_this.core.index);
64
- _this.loadVideoOnclick($el);
65
- });
66
- } else {
67
-
68
- // For IE 9 and bellow
69
- _this.core.$slide.on('click.lg', function() {
70
- _this.loadVideoOnclick($(this));
71
- });
72
- }
73
-
74
- _this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this));
75
-
76
- _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
77
- _this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
78
- });
79
-
80
- if (_this.core.s.autoplayFirstVideo) {
81
- _this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index) {
82
- if (!_this.core.lGalleryOn) {
83
- var $el = _this.core.$slide.eq(index);
84
- setTimeout(function () {
85
- _this.loadVideoOnclick($el);
86
- }, 100);
87
- }
88
- });
89
- }
90
- };
91
-
92
- Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) {
93
- var video = '';
94
- var autoplay = 1;
95
- var a = '';
96
- var isVideo = this.core.isVideo(src, index) || {};
97
-
98
- // Enable autoplay based on setting for first video if poster doesn't exist
99
- if (noPoster) {
100
- if (this.videoLoaded) {
101
- autoplay = 0;
102
- } else {
103
- autoplay = this.core.s.autoplayFirstVideo ? 1 : 0;
104
- }
105
- }
106
-
107
- if (isVideo.youtube) {
108
-
109
- a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
110
- if (this.core.s.youtubePlayerParams) {
111
- a = a + '&' + $.param(this.core.s.youtubePlayerParams);
112
- }
113
-
114
- video = '<iframe class="lg-video-object lg-youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>';
115
-
116
- } else if (isVideo.vimeo) {
117
-
118
- a = '?autoplay=' + autoplay + '&api=1';
119
- if (this.core.s.vimeoPlayerParams) {
120
- a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
121
- }
122
-
123
- video = '<iframe class="lg-video-object lg-vimeo ' + addClass + '" width="560" height="315" src="//player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
124
-
125
- } else if (isVideo.dailymotion) {
126
-
127
- a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
128
- if (this.core.s.dailymotionPlayerParams) {
129
- a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
130
- }
131
-
132
- video = '<iframe class="lg-video-object lg-dailymotion ' + addClass + '" width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[1] + a + '" frameborder="0" allowfullscreen></iframe>';
133
-
134
- } else if (isVideo.html5) {
135
- var fL = html.substring(0, 1);
136
- if (fL === '.' || fL === '#') {
137
- html = $(html).html();
138
- }
139
-
140
- video = html;
141
-
142
- } else if (isVideo.vk) {
143
-
144
- a = '&autoplay=' + autoplay;
145
- if (this.core.s.vkPlayerParams) {
146
- a = a + '&' + $.param(this.core.s.vkPlayerParams);
147
- }
148
-
149
- video = '<iframe class="lg-video-object lg-vk ' + addClass + '" width="560" height="315" src="//vk.com/video_ext.php?' + isVideo.vk[1] + a + '" frameborder="0" allowfullscreen></iframe>';
150
-
151
- }
152
-
153
- return video;
154
- };
155
-
156
- Video.prototype.loadVideoOnclick = function($el){
157
-
158
- var _this = this;
159
- // check slide has poster
160
- if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
161
-
162
- // check already video element present
163
- if (!$el.hasClass('lg-has-video')) {
164
-
165
- $el.addClass('lg-video-playing lg-has-video');
166
-
167
- var _src;
168
- var _html;
169
- var _loadVideo = function(_src, _html) {
170
-
171
- $el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
172
-
173
- if (_html) {
174
- if (_this.core.s.videojs) {
175
- try {
176
- videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
177
- this.play();
178
- });
179
- } catch (e) {
180
- console.error('Make sure you have included videojs');
181
- }
182
- } else {
183
- _this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
184
- }
185
- }
186
-
187
- };
188
-
189
- if (_this.core.s.dynamic) {
190
-
191
- _src = _this.core.s.dynamicEl[_this.core.index].src;
192
- _html = _this.core.s.dynamicEl[_this.core.index].html;
193
-
194
- _loadVideo(_src, _html);
195
-
196
- } else {
197
-
198
- _src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src');
199
- _html = _this.core.$items.eq(_this.core.index).attr('data-html');
200
-
201
- _loadVideo(_src, _html);
202
-
203
- }
204
-
205
- var $tempImg = $el.find('.lg-object');
206
- $el.find('.lg-video').append($tempImg);
207
-
208
- // @todo loading icon for html5 videos also
209
- // for showing the loading indicator while loading video
210
- if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
211
- $el.removeClass('lg-complete');
212
- $el.find('.lg-video-object').on('load.lg error.lg', function() {
213
- $el.addClass('lg-complete');
214
- });
215
- }
216
-
217
- } else {
218
-
219
- var youtubePlayer = $el.find('.lg-youtube').get(0);
220
- var vimeoPlayer = $el.find('.lg-vimeo').get(0);
221
- var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
222
- var html5Player = $el.find('.lg-html5').get(0);
223
- if (youtubePlayer) {
224
- youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
225
- } else if (vimeoPlayer) {
226
- try {
227
- $f(vimeoPlayer).api('play');
228
- } catch (e) {
229
- console.error('Make sure you have included froogaloop2 js');
230
- }
231
- } else if (dailymotionPlayer) {
232
- dailymotionPlayer.contentWindow.postMessage('play', '*');
233
-
234
- } else if (html5Player) {
235
- if (_this.core.s.videojs) {
236
- try {
237
- videojs(html5Player).play();
238
- } catch (e) {
239
- console.error('Make sure you have included videojs');
240
- }
241
- } else {
242
- html5Player.play();
243
- }
244
- }
245
-
246
- $el.addClass('lg-video-playing');
247
-
248
- }
249
- }
250
- };
251
-
252
- Video.prototype.destroy = function() {
253
- this.videoLoaded = false;
254
- };
255
-
256
- function onHasVideo(event, index, src, html) {
257
- /*jshint validthis:true */
258
- var _this = this;
259
- _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
260
- if (html) {
261
- if (_this.core.s.videojs) {
262
- try {
263
- videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
264
- if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
265
- this.play();
266
- }
267
- });
268
- } catch (e) {
269
- console.error('Make sure you have included videojs');
270
- }
271
- } else {
272
- if(!_this.videoLoaded && _this.core.s.autoplayFirstVideo) {
273
- _this.core.$slide.eq(index).find('.lg-html5').get(0).play();
274
- }
275
- }
276
- }
277
- }
278
-
279
- function onAferAppendSlide(event, index) {
280
- /*jshint validthis:true */
281
- var $videoCont = this.core.$slide.eq(index).find('.lg-video-cont');
282
- if (!$videoCont.hasClass('lg-has-iframe')) {
283
- $videoCont.css('max-width', this.core.s.videoMaxWidth);
284
- this.videoLoaded = true;
285
- }
286
- }
287
-
288
- function onBeforeSlide(event, prevIndex, index) {
289
- /*jshint validthis:true */
290
- var _this = this;
291
-
292
- var $videoSlide = _this.core.$slide.eq(prevIndex);
293
- var youtubePlayer = $videoSlide.find('.lg-youtube').get(0);
294
- var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0);
295
- var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0);
296
- var vkPlayer = $videoSlide.find('.lg-vk').get(0);
297
- var html5Player = $videoSlide.find('.lg-html5').get(0);
298
- if (youtubePlayer) {
299
- youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
300
- } else if (vimeoPlayer) {
301
- try {
302
- $f(vimeoPlayer).api('pause');
303
- } catch (e) {
304
- console.error('Make sure you have included froogaloop2 js');
305
- }
306
- } else if (dailymotionPlayer) {
307
- dailymotionPlayer.contentWindow.postMessage('pause', '*');
308
-
309
- } else if (html5Player) {
310
- if (_this.core.s.videojs) {
311
- try {
312
- videojs(html5Player).pause();
313
- } catch (e) {
314
- console.error('Make sure you have included videojs');
315
- }
316
- } else {
317
- html5Player.pause();
318
- }
319
- } if (vkPlayer) {
320
- $(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay'));
321
- }
322
-
323
- var _src;
324
- if (_this.core.s.dynamic) {
325
- _src = _this.core.s.dynamicEl[index].src;
326
- } else {
327
- _src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src');
328
-
329
- }
330
-
331
- var _isVideo = _this.core.isVideo(_src, index) || {};
332
- if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion || _isVideo.vk) {
333
- _this.core.$outer.addClass('lg-hide-download');
334
- }
335
-
336
- }
337
-
338
- $.fn.lightGallery.modules.video = Video;
339
-
340
- })();
341
-
342
- }));
@@ -1,5 +0,0 @@
1
- /*! lg-video - v1.2.2 - 2018-05-01
2
- * http://sachinchoolur.github.io/lightGallery
3
- * Copyright (c) 2018 Sachin N; Licensed GPLv3 */
4
-
5
- !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(a,b,c,d){var e=this;if(e.core.$slide.eq(b).find(".lg-video").append(e.loadVideo(c,"lg-object",!0,b,d)),d)if(e.core.s.videojs)try{videojs(e.core.$slide.eq(b).find(".lg-html5").get(0),e.core.s.videojsOptions,function(){!e.videoLoaded&&e.core.s.autoplayFirstVideo&&this.play()})}catch(a){console.error("Make sure you have included videojs")}else!e.videoLoaded&&e.core.s.autoplayFirstVideo&&e.core.$slide.eq(b).find(".lg-html5").get(0).play()}function c(a,b){var c=this.core.$slide.eq(b).find(".lg-video-cont");c.hasClass("lg-has-iframe")||(c.css("max-width",this.core.s.videoMaxWidth),this.videoLoaded=!0)}function d(b,c,d){var e=this,f=e.core.$slide.eq(c),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(i)i.contentWindow.postMessage("pause","*");else if(k)if(e.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("Make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=e.core.s.dynamic?e.core.s.dynamicEl[d].src:e.core.$items.eq(d).attr("href")||e.core.$items.eq(d).attr("data-src");var m=e.core.isVideo(l,d)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&e.core.$outer.addClass("lg-hide-download")}var e={videoMaxWidth:"855px",autoplayFirstVideo:!0,youtubePlayerParams:!1,vimeoPlayerParams:!1,dailymotionPlayerParams:!1,vkPlayerParams:!1,videojs:!1,videojsOptions:{}},f=function(b){return this.core=a(b).data("lightGallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoLoaded=!1,this.init(),this};f.prototype.init=function(){var e=this;e.core.$el.on("hasVideo.lg.tm",b.bind(this)),e.core.$el.on("onAferAppendSlide.lg.tm",c.bind(this)),e.core.doCss()&&e.core.$items.length>1&&(e.core.s.enableSwipe||e.core.s.enableDrag)?e.core.$el.on("onSlideClick.lg.tm",function(){var a=e.core.$slide.eq(e.core.index);e.loadVideoOnclick(a)}):e.core.$slide.on("click.lg",function(){e.loadVideoOnclick(a(this))}),e.core.$el.on("onBeforeSlide.lg.tm",d.bind(this)),e.core.$el.on("onAfterSlide.lg.tm",function(a,b){e.core.$slide.eq(b).removeClass("lg-video-playing")}),e.core.s.autoplayFirstVideo&&e.core.$el.on("onAferAppendSlide.lg.tm",function(a,b){if(!e.core.lGalleryOn){var c=e.core.$slide.eq(b);setTimeout(function(){e.loadVideoOnclick(c)},100)}})},f.prototype.loadVideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isVideo(b,e)||{};if(d&&(h=this.videoLoaded?0:this.core.s.autoplayFirstVideo?1:0),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubePlayerParams&&(i=i+"&"+a.param(this.core.s.youtubePlayerParams)),g='<iframe class="lg-video-object lg-youtube '+c+'" width="560" height="315" src="//www.youtube.com/embed/'+j.youtube[1]+i+'" frameborder="0" allowfullscreen></iframe>';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoPlayerParams&&(i=i+"&"+a.param(this.core.s.vimeoPlayerParams)),g='<iframe class="lg-video-object lg-vimeo '+c+'" width="560" height="315" src="//player.vimeo.com/video/'+j.vimeo[1]+i+'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postMessage",this.core.s.dailymotionPlayerParams&&(i=i+"&"+a.param(this.core.s.dailymotionPlayerParams)),g='<iframe class="lg-video-object lg-dailymotion '+c+'" width="560" height="315" src="//www.dailymotion.com/embed/video/'+j.dailymotion[1]+i+'" frameborder="0" allowfullscreen></iframe>';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkPlayerParams&&(i=i+"&"+a.param(this.core.s.vkPlayerParams)),g='<iframe class="lg-video-object lg-vk '+c+'" width="560" height="315" src="//vk.com/video_ext.php?'+j.vk[1]+i+'" frameborder="0" allowfullscreen></iframe>');return g},f.prototype.loadVideoOnclick=function(a){var b=this;if(a.find(".lg-object").hasClass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasClass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("Make sure you have included froogaloop2 js")}else if(e)e.contentWindow.postMessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("Make sure you have included videojs")}else f.play();a.addClass("lg-video-playing")}else{a.addClass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadVideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsOptions,function(){this.play()})}catch(a){console.error("Make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicEl[b.core.index].src,h=b.core.s.dynamicEl[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasClass("lg-html5")||(a.removeClass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addClass("lg-complete")}))}},f.prototype.destroy=function(){this.videoLoaded=!1},a.fn.lightGallery.modules.video=f}()});