gent_styleguide 2.9.2 → 2.12.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.
- package/.codeclimate.yml +51 -14
- package/CHANGELOG.md +15 -1
- package/CONTRIBUTING.md +8 -1
- package/README.md +23 -6
- package/build/styleguide/js/base-min.js +68 -1
- package/build/styleguide/js/breadcrumbs.binding-min.js +13 -1
- package/build/styleguide/js/breadcrumbs.functions-min.js +131 -1
- package/build/styleguide/js/button-drop-min.js +38 -1
- package/build/styleguide/js/button-drop.binding-min.js +13 -1
- package/build/styleguide/js/button-drop.functions-min.js +48 -1
- package/build/styleguide/js/gallery.binding-min.js +12 -1
- package/build/styleguide/js/gallery.functions-min.js +29 -1
- package/build/styleguide/js/hamburger-menu.binding-min.js +17 -1
- package/build/styleguide/js/hamburger-menu.functions-min.js +166 -1
- package/build/styleguide/js/header.binding-min.js +18 -1
- package/build/styleguide/js/header.functions-min.js +73 -1
- package/build/styleguide/js/input-date.binding-min.js +8 -1
- package/build/styleguide/js/input-date.functions-min.js +27 -1
- package/build/styleguide/js/input-multiselect-chosen.binding-min.js +31 -1
- package/build/styleguide/js/input-multiselect-chosen.functions-min.js +24 -1
- package/build/styleguide/js/teaser-collection.binding-min.js +14 -1
- package/build/styleguide/sass/00-settings/_vars.scss +2 -3
- package/build/styleguide/sass/01-mixins/grid/_default_classes.scss +8 -6
- package/build/styleguide/sass/01-mixins/grid/_mixins.scss +22 -20
- package/build/styleguide/sass/11-base/forms/_forms.scss +3 -0
- package/build/styleguide/sass/11-base/grid/_grid.scss +2 -2
- package/build/styleguide/sass/21-atoms/fieldset/_fieldset.scss +1 -1
- package/build/styleguide/sass/21-atoms/inputs/input-multiselect-chosen/_input-multiselect-chosen.scss +1 -1
- package/build/styleguide/sass/21-atoms/tag/_tag.scss +0 -5
- package/build/styleguide/sass/31-molecules/building-blocks/breadcrumbs/_breadcrumbs.scss +33 -37
- package/build/styleguide/sass/31-molecules/building-blocks/hamburger-menu/_hamburger-menu.scss +1 -1
- package/build/styleguide/sass/31-molecules/status-message/_status-message.scss +1 -0
- package/build/styleguide/sass/41-organisms/header/_header.scss +2 -2
- package/build/styleguide/sass/main_cli.scss +12 -11
- package/nbproject/private/private.properties +1 -0
- package/nbproject/private/private.xml +8 -0
- package/nbproject/project.properties +5 -0
- package/nbproject/project.xml +9 -0
- package/package.json +7 -9
- package/.github/ISSUE_TEMPLATE.md +0 -32
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -30
- package/.mdl.style.rb +0 -9
- package/.mdlrc +0 -1
- package/.travis.yml +0 -27
- package/build/styleguide/vendor/chosen-js/README.md +0 -47
- package/build/styleguide/vendor/chosen-js/chosen-sprite.png +0 -0
- package/build/styleguide/vendor/chosen-js/chosen-sprite@2x.png +0 -0
- package/build/styleguide/vendor/chosen-js/chosen.css +0 -490
- package/build/styleguide/vendor/chosen-js/chosen.jquery.js +0 -1349
- package/build/styleguide/vendor/chosen-js/chosen.jquery.min.js +0 -3
- package/build/styleguide/vendor/chosen-js/chosen.min.css +0 -11
- package/build/styleguide/vendor/chosen-js/chosen.proto.js +0 -1389
- package/build/styleguide/vendor/chosen-js/chosen.proto.min.js +0 -3
- package/build/styleguide/vendor/jquery/AUTHORS.txt +0 -301
- package/build/styleguide/vendor/jquery/LICENSE.txt +0 -36
- package/build/styleguide/vendor/jquery/README.md +0 -67
- package/build/styleguide/vendor/jquery/dist/core.js +0 -476
- package/build/styleguide/vendor/jquery/dist/jquery.js +0 -10253
- package/build/styleguide/vendor/jquery/dist/jquery.min.js +0 -4
- package/build/styleguide/vendor/jquery/dist/jquery.min.map +0 -1
- package/build/styleguide/vendor/jquery/dist/jquery.slim.js +0 -8160
- package/build/styleguide/vendor/jquery/dist/jquery.slim.min.js +0 -4
- package/build/styleguide/vendor/jquery/dist/jquery.slim.min.map +0 -1
- package/build/styleguide/vendor/jquery/external/sizzle/LICENSE.txt +0 -36
- package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.js +0 -2272
- package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.min.js +0 -3
- package/build/styleguide/vendor/jquery/external/sizzle/dist/sizzle.min.map +0 -1
- package/build/styleguide/vendor/jquery/package.json +0 -97
- package/build/styleguide/vendor/jquery/src/.eslintrc.json +0 -5
- package/build/styleguide/vendor/jquery/src/ajax/jsonp.js +0 -102
- package/build/styleguide/vendor/jquery/src/ajax/load.js +0 -76
- package/build/styleguide/vendor/jquery/src/ajax/parseXML.js +0 -30
- package/build/styleguide/vendor/jquery/src/ajax/script.js +0 -77
- package/build/styleguide/vendor/jquery/src/ajax/var/location.js +0 -5
- package/build/styleguide/vendor/jquery/src/ajax/var/nonce.js +0 -7
- package/build/styleguide/vendor/jquery/src/ajax/var/rquery.js +0 -5
- package/build/styleguide/vendor/jquery/src/ajax/xhr.js +0 -169
- package/build/styleguide/vendor/jquery/src/ajax.js +0 -855
- package/build/styleguide/vendor/jquery/src/attributes/attr.js +0 -141
- package/build/styleguide/vendor/jquery/src/attributes/classes.js +0 -174
- package/build/styleguide/vendor/jquery/src/attributes/prop.js +0 -143
- package/build/styleguide/vendor/jquery/src/attributes/support.js +0 -33
- package/build/styleguide/vendor/jquery/src/attributes/val.js +0 -190
- package/build/styleguide/vendor/jquery/src/attributes.js +0 -13
- package/build/styleguide/vendor/jquery/src/callbacks.js +0 -234
- package/build/styleguide/vendor/jquery/src/core/DOMEval.js +0 -16
- package/build/styleguide/vendor/jquery/src/core/access.js +0 -70
- package/build/styleguide/vendor/jquery/src/core/init.js +0 -128
- package/build/styleguide/vendor/jquery/src/core/nodeName.js +0 -13
- package/build/styleguide/vendor/jquery/src/core/parseHTML.js +0 -65
- package/build/styleguide/vendor/jquery/src/core/ready-no-deferred.js +0 -96
- package/build/styleguide/vendor/jquery/src/core/ready.js +0 -86
- package/build/styleguide/vendor/jquery/src/core/readyException.js +0 -13
- package/build/styleguide/vendor/jquery/src/core/stripAndCollapse.js +0 -14
- package/build/styleguide/vendor/jquery/src/core/support.js +0 -20
- package/build/styleguide/vendor/jquery/src/core/var/rsingleTag.js +0 -6
- package/build/styleguide/vendor/jquery/src/core.js +0 -476
- package/build/styleguide/vendor/jquery/src/css/addGetHookIf.js +0 -26
- package/build/styleguide/vendor/jquery/src/css/adjustCSS.js +0 -71
- package/build/styleguide/vendor/jquery/src/css/curCSS.js +0 -65
- package/build/styleguide/vendor/jquery/src/css/hiddenVisibleSelectors.js +0 -15
- package/build/styleguide/vendor/jquery/src/css/showHide.js +0 -105
- package/build/styleguide/vendor/jquery/src/css/support.js +0 -89
- package/build/styleguide/vendor/jquery/src/css/var/cssExpand.js +0 -5
- package/build/styleguide/vendor/jquery/src/css/var/getStyles.js +0 -17
- package/build/styleguide/vendor/jquery/src/css/var/isHiddenWithinTree.js +0 -34
- package/build/styleguide/vendor/jquery/src/css/var/rmargin.js +0 -5
- package/build/styleguide/vendor/jquery/src/css/var/rnumnonpx.js +0 -7
- package/build/styleguide/vendor/jquery/src/css/var/swap.js +0 -26
- package/build/styleguide/vendor/jquery/src/css.js +0 -438
- package/build/styleguide/vendor/jquery/src/data/Data.js +0 -161
- package/build/styleguide/vendor/jquery/src/data/var/acceptData.js +0 -19
- package/build/styleguide/vendor/jquery/src/data/var/dataPriv.js +0 -7
- package/build/styleguide/vendor/jquery/src/data/var/dataUser.js +0 -7
- package/build/styleguide/vendor/jquery/src/data.js +0 -179
- package/build/styleguide/vendor/jquery/src/deferred/exceptionHook.js +0 -21
- package/build/styleguide/vendor/jquery/src/deferred.js +0 -391
- package/build/styleguide/vendor/jquery/src/deprecated.js +0 -40
- package/build/styleguide/vendor/jquery/src/dimensions.js +0 -56
- package/build/styleguide/vendor/jquery/src/effects/Tween.js +0 -123
- package/build/styleguide/vendor/jquery/src/effects/animatedSelector.js +0 -15
- package/build/styleguide/vendor/jquery/src/effects.js +0 -699
- package/build/styleguide/vendor/jquery/src/event/ajax.js +0 -22
- package/build/styleguide/vendor/jquery/src/event/alias.js +0 -29
- package/build/styleguide/vendor/jquery/src/event/focusin.js +0 -55
- package/build/styleguide/vendor/jquery/src/event/support.js +0 -11
- package/build/styleguide/vendor/jquery/src/event/trigger.js +0 -185
- package/build/styleguide/vendor/jquery/src/event.js +0 -746
- package/build/styleguide/vendor/jquery/src/exports/amd.js +0 -26
- package/build/styleguide/vendor/jquery/src/exports/global.js +0 -34
- package/build/styleguide/vendor/jquery/src/jquery.js +0 -41
- package/build/styleguide/vendor/jquery/src/manipulation/_evalUrl.js +0 -23
- package/build/styleguide/vendor/jquery/src/manipulation/buildFragment.js +0 -104
- package/build/styleguide/vendor/jquery/src/manipulation/getAll.js +0 -32
- package/build/styleguide/vendor/jquery/src/manipulation/setGlobalEval.js +0 -22
- package/build/styleguide/vendor/jquery/src/manipulation/support.js +0 -35
- package/build/styleguide/vendor/jquery/src/manipulation/var/rcheckableType.js +0 -5
- package/build/styleguide/vendor/jquery/src/manipulation/var/rscriptType.js +0 -5
- package/build/styleguide/vendor/jquery/src/manipulation/var/rtagName.js +0 -5
- package/build/styleguide/vendor/jquery/src/manipulation/wrapMap.js +0 -29
- package/build/styleguide/vendor/jquery/src/manipulation.js +0 -488
- package/build/styleguide/vendor/jquery/src/offset.js +0 -229
- package/build/styleguide/vendor/jquery/src/queue/delay.js +0 -24
- package/build/styleguide/vendor/jquery/src/queue.js +0 -145
- package/build/styleguide/vendor/jquery/src/selector-native.js +0 -237
- package/build/styleguide/vendor/jquery/src/selector-sizzle.js +0 -19
- package/build/styleguide/vendor/jquery/src/selector.js +0 -3
- package/build/styleguide/vendor/jquery/src/serialize.js +0 -130
- package/build/styleguide/vendor/jquery/src/traversing/findFilter.js +0 -106
- package/build/styleguide/vendor/jquery/src/traversing/var/dir.js +0 -22
- package/build/styleguide/vendor/jquery/src/traversing/var/rneedsContext.js +0 -8
- package/build/styleguide/vendor/jquery/src/traversing/var/siblings.js +0 -17
- package/build/styleguide/vendor/jquery/src/traversing.js +0 -191
- package/build/styleguide/vendor/jquery/src/var/ObjectFunctionString.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/arr.js +0 -5
- package/build/styleguide/vendor/jquery/src/var/class2type.js +0 -6
- package/build/styleguide/vendor/jquery/src/var/concat.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/document.js +0 -5
- package/build/styleguide/vendor/jquery/src/var/documentElement.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/fnToString.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/getProto.js +0 -5
- package/build/styleguide/vendor/jquery/src/var/hasOwn.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/indexOf.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/pnum.js +0 -5
- package/build/styleguide/vendor/jquery/src/var/push.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/rcssNum.js +0 -9
- package/build/styleguide/vendor/jquery/src/var/rnothtmlwhite.js +0 -8
- package/build/styleguide/vendor/jquery/src/var/slice.js +0 -7
- package/build/styleguide/vendor/jquery/src/var/support.js +0 -6
- package/build/styleguide/vendor/jquery/src/var/toString.js +0 -7
- package/build/styleguide/vendor/jquery/src/wrap.js +0 -77
- package/build/styleguide/vendor/lightgallery/.editorconfig +0 -16
- package/build/styleguide/vendor/lightgallery/.gitattributes +0 -1
- package/build/styleguide/vendor/lightgallery/.jscsrc +0 -7
- package/build/styleguide/vendor/lightgallery/.jshintrc +0 -18
- package/build/styleguide/vendor/lightgallery/.travis.yml +0 -9
- package/build/styleguide/vendor/lightgallery/Gruntfile.js +0 -208
- package/build/styleguide/vendor/lightgallery/LICENSE.md +0 -686
- package/build/styleguide/vendor/lightgallery/README.md +0 -191
- package/build/styleguide/vendor/lightgallery/contributing.md +0 -34
- package/build/styleguide/vendor/lightgallery/demo/img/1-1600.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/1-375.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/1-480.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/1.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/13-1600.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/13-375.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/13-480.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/13.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/2-1600.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/2-375.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/2-480.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/2.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/4-1600.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/4-375.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/4-480.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/4.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/thumb-1.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/thumb-13.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/thumb-2.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/img/thumb-4.jpg +0 -0
- package/build/styleguide/vendor/lightgallery/demo/index.html +0 -162
- package/build/styleguide/vendor/lightgallery/dist/css/lg-fb-comment-box.css +0 -57
- package/build/styleguide/vendor/lightgallery/dist/css/lg-fb-comment-box.min.css +0 -1
- package/build/styleguide/vendor/lightgallery/dist/css/lg-transitions.css +0 -779
- package/build/styleguide/vendor/lightgallery/dist/css/lg-transitions.min.css +0 -1
- package/build/styleguide/vendor/lightgallery/dist/css/lightgallery.css +0 -982
- package/build/styleguide/vendor/lightgallery/dist/css/lightgallery.min.css +0 -1
- package/build/styleguide/vendor/lightgallery/dist/fonts/lg.eot +0 -0
- package/build/styleguide/vendor/lightgallery/dist/fonts/lg.svg +0 -47
- package/build/styleguide/vendor/lightgallery/dist/fonts/lg.ttf +0 -0
- package/build/styleguide/vendor/lightgallery/dist/fonts/lg.woff +0 -0
- package/build/styleguide/vendor/lightgallery/dist/img/loading.gif +0 -0
- package/build/styleguide/vendor/lightgallery/dist/img/video-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/dist/img/vimeo-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/dist/img/youtube-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/dist/js/lightgallery-all.js +0 -3331
- package/build/styleguide/vendor/lightgallery/dist/js/lightgallery-all.min.js +0 -5
- package/build/styleguide/vendor/lightgallery/dist/js/lightgallery.js +0 -1364
- package/build/styleguide/vendor/lightgallery/dist/js/lightgallery.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/lib/jquery.mousewheel.min.js +0 -8
- package/build/styleguide/vendor/lightgallery/lib/lg.png +0 -0
- package/build/styleguide/vendor/lightgallery/lib/picturefill.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/lightGallery.jquery.json +0 -27
- package/build/styleguide/vendor/lightgallery/modules/lg-autoplay.js +0 -206
- package/build/styleguide/vendor/lightgallery/modules/lg-autoplay.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-fullscreen.js +0 -116
- package/build/styleguide/vendor/lightgallery/modules/lg-fullscreen.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-hash.js +0 -101
- package/build/styleguide/vendor/lightgallery/modules/lg-hash.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-pager.js +0 -105
- package/build/styleguide/vendor/lightgallery/modules/lg-pager.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-share.js +0 -107
- package/build/styleguide/vendor/lightgallery/modules/lg-share.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-thumbnail.js +0 -478
- package/build/styleguide/vendor/lightgallery/modules/lg-thumbnail.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-video.js +0 -317
- package/build/styleguide/vendor/lightgallery/modules/lg-video.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/modules/lg-zoom.js +0 -527
- package/build/styleguide/vendor/lightgallery/modules/lg-zoom.min.js +0 -4
- package/build/styleguide/vendor/lightgallery/package.json +0 -60
- package/build/styleguide/vendor/lightgallery/selection.json +0 -407
- package/build/styleguide/vendor/lightgallery/src/css/lg-fb-comment-box.css +0 -54
- package/build/styleguide/vendor/lightgallery/src/css/lg-fb-comment-box.css.map +0 -7
- package/build/styleguide/vendor/lightgallery/src/css/lg-transitions.css +0 -776
- package/build/styleguide/vendor/lightgallery/src/css/lg-transitions.css.map +0 -7
- package/build/styleguide/vendor/lightgallery/src/css/lightgallery.css +0 -979
- package/build/styleguide/vendor/lightgallery/src/css/lightgallery.css.map +0 -7
- package/build/styleguide/vendor/lightgallery/src/fonts/lg.eot +0 -0
- package/build/styleguide/vendor/lightgallery/src/fonts/lg.svg +0 -47
- package/build/styleguide/vendor/lightgallery/src/fonts/lg.ttf +0 -0
- package/build/styleguide/vendor/lightgallery/src/fonts/lg.woff +0 -0
- package/build/styleguide/vendor/lightgallery/src/img/loading.gif +0 -0
- package/build/styleguide/vendor/lightgallery/src/img/video-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/src/img/vimeo-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/src/img/youtube-play.png +0 -0
- package/build/styleguide/vendor/lightgallery/src/js/.jshintrc +0 -22
- package/build/styleguide/vendor/lightgallery/src/js/lightgallery.js +0 -1342
- package/build/styleguide/vendor/lightgallery/src/sass/lg-animations.scss +0 -714
- package/build/styleguide/vendor/lightgallery/src/sass/lg-autoplay.scss +0 -36
- package/build/styleguide/vendor/lightgallery/src/sass/lg-core.scss +0 -272
- package/build/styleguide/vendor/lightgallery/src/sass/lg-fb-comment-box.scss +0 -52
- package/build/styleguide/vendor/lightgallery/src/sass/lg-fonts.scss +0 -22
- package/build/styleguide/vendor/lightgallery/src/sass/lg-fullscreen.scss +0 -9
- package/build/styleguide/vendor/lightgallery/src/sass/lg-mixins.scss +0 -330
- package/build/styleguide/vendor/lightgallery/src/sass/lg-pager.scss +0 -89
- package/build/styleguide/vendor/lightgallery/src/sass/lg-share.scss +0 -135
- package/build/styleguide/vendor/lightgallery/src/sass/lg-theme-default.scss +0 -208
- package/build/styleguide/vendor/lightgallery/src/sass/lg-thumbnail.scss +0 -111
- package/build/styleguide/vendor/lightgallery/src/sass/lg-transitions.scss +0 -766
- package/build/styleguide/vendor/lightgallery/src/sass/lg-variables.scss +0 -57
- package/build/styleguide/vendor/lightgallery/src/sass/lg-video.scss +0 -110
- package/build/styleguide/vendor/lightgallery/src/sass/lg-zoom.scss +0 -69
- package/build/styleguide/vendor/lightgallery/src/sass/lightgallery.scss +0 -15
- package/build/styleguide/vendor/lightgallery/src/sass/prepros.cfg +0 -530
- package/build/styleguide/vendor/lightgallery/test/.jshintrc +0 -33
- package/build/styleguide/vendor/lightgallery/test/lightgallery.html +0 -27
- package/build/styleguide/vendor/lightgallery/test/lightgallery_test.js +0 -16
- package/build/styleguide/vendor/masonry-layout/README.md +0 -80
- package/build/styleguide/vendor/masonry-layout/dist/masonry.pkgd.js +0 -2499
- package/build/styleguide/vendor/masonry-layout/dist/masonry.pkgd.min.js +0 -9
- package/build/styleguide/vendor/masonry-layout/masonry.js +0 -239
- package/postinstall.sh +0 -76
- package/version_tag.sh +0 -99
- package/yarn.lock +0 -7827
|
@@ -1,3331 +0,0 @@
|
|
|
1
|
-
/*! lightgallery - v1.6.2 - 2017-10-03
|
|
2
|
-
* http://sachinchoolur.github.io/lightGallery/
|
|
3
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
4
|
-
/*! lightgallery - v1.6.2 - 2017-10-03
|
|
5
|
-
* http://sachinchoolur.github.io/lightGallery/
|
|
6
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
7
|
-
(function (root, factory) {
|
|
8
|
-
if (typeof define === 'function' && define.amd) {
|
|
9
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
10
|
-
define(['jquery'], function (a0) {
|
|
11
|
-
return (factory(a0));
|
|
12
|
-
});
|
|
13
|
-
} else if (typeof exports === 'object') {
|
|
14
|
-
// Node. Does not work with strict CommonJS, but
|
|
15
|
-
// only CommonJS-like environments that support module.exports,
|
|
16
|
-
// like Node.
|
|
17
|
-
module.exports = factory(require('jquery'));
|
|
18
|
-
} else {
|
|
19
|
-
factory(root["jQuery"]);
|
|
20
|
-
}
|
|
21
|
-
}(this, function ($) {
|
|
22
|
-
|
|
23
|
-
(function() {
|
|
24
|
-
'use strict';
|
|
25
|
-
|
|
26
|
-
var defaults = {
|
|
27
|
-
|
|
28
|
-
mode: 'lg-slide',
|
|
29
|
-
|
|
30
|
-
// Ex : 'ease'
|
|
31
|
-
cssEasing: 'ease',
|
|
32
|
-
|
|
33
|
-
//'for jquery animation'
|
|
34
|
-
easing: 'linear',
|
|
35
|
-
speed: 600,
|
|
36
|
-
height: '100%',
|
|
37
|
-
width: '100%',
|
|
38
|
-
addClass: '',
|
|
39
|
-
startClass: 'lg-start-zoom',
|
|
40
|
-
backdropDuration: 150,
|
|
41
|
-
hideBarsDelay: 6000,
|
|
42
|
-
|
|
43
|
-
useLeft: false,
|
|
44
|
-
|
|
45
|
-
closable: true,
|
|
46
|
-
loop: true,
|
|
47
|
-
escKey: true,
|
|
48
|
-
keyPress: true,
|
|
49
|
-
controls: true,
|
|
50
|
-
slideEndAnimatoin: true,
|
|
51
|
-
hideControlOnEnd: false,
|
|
52
|
-
mousewheel: true,
|
|
53
|
-
|
|
54
|
-
getCaptionFromTitleOrAlt: true,
|
|
55
|
-
|
|
56
|
-
// .lg-item || '.lg-sub-html'
|
|
57
|
-
appendSubHtmlTo: '.lg-sub-html',
|
|
58
|
-
|
|
59
|
-
subHtmlSelectorRelative: false,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @desc number of preload slides
|
|
63
|
-
* will exicute only after the current slide is fully loaded.
|
|
64
|
-
*
|
|
65
|
-
* @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th
|
|
66
|
-
* slide will be loaded in the background after the 4th slide is fully loaded..
|
|
67
|
-
* if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ...
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
preload: 1,
|
|
71
|
-
showAfterLoad: true,
|
|
72
|
-
selector: '',
|
|
73
|
-
selectWithin: '',
|
|
74
|
-
nextHtml: '',
|
|
75
|
-
prevHtml: '',
|
|
76
|
-
|
|
77
|
-
// 0, 1
|
|
78
|
-
index: false,
|
|
79
|
-
|
|
80
|
-
iframeMaxWidth: '100%',
|
|
81
|
-
|
|
82
|
-
download: true,
|
|
83
|
-
counter: true,
|
|
84
|
-
appendCounterTo: '.lg-toolbar',
|
|
85
|
-
|
|
86
|
-
swipeThreshold: 50,
|
|
87
|
-
enableSwipe: true,
|
|
88
|
-
enableDrag: true,
|
|
89
|
-
|
|
90
|
-
dynamic: false,
|
|
91
|
-
dynamicEl: [],
|
|
92
|
-
galleryId: 1
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
function Plugin(element, options) {
|
|
96
|
-
|
|
97
|
-
// Current lightGallery element
|
|
98
|
-
this.el = element;
|
|
99
|
-
|
|
100
|
-
// Current jquery element
|
|
101
|
-
this.$el = $(element);
|
|
102
|
-
|
|
103
|
-
// lightGallery settings
|
|
104
|
-
this.s = $.extend({}, defaults, options);
|
|
105
|
-
|
|
106
|
-
// When using dynamic mode, ensure dynamicEl is an array
|
|
107
|
-
if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) {
|
|
108
|
-
throw ('When using dynamic mode, you must also define dynamicEl as an Array.');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// lightGallery modules
|
|
112
|
-
this.modules = {};
|
|
113
|
-
|
|
114
|
-
// false when lightgallery complete first slide;
|
|
115
|
-
this.lGalleryOn = false;
|
|
116
|
-
|
|
117
|
-
this.lgBusy = false;
|
|
118
|
-
|
|
119
|
-
// Timeout function for hiding controls;
|
|
120
|
-
this.hideBartimeout = false;
|
|
121
|
-
|
|
122
|
-
// To determine browser supports for touch events;
|
|
123
|
-
this.isTouch = ('ontouchstart' in document.documentElement);
|
|
124
|
-
|
|
125
|
-
// Disable hideControlOnEnd if sildeEndAnimation is true
|
|
126
|
-
if (this.s.slideEndAnimatoin) {
|
|
127
|
-
this.s.hideControlOnEnd = false;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Gallery items
|
|
131
|
-
if (this.s.dynamic) {
|
|
132
|
-
this.$items = this.s.dynamicEl;
|
|
133
|
-
} else {
|
|
134
|
-
if (this.s.selector === 'this') {
|
|
135
|
-
this.$items = this.$el;
|
|
136
|
-
} else if (this.s.selector !== '') {
|
|
137
|
-
if (this.s.selectWithin) {
|
|
138
|
-
this.$items = $(this.s.selectWithin).find(this.s.selector);
|
|
139
|
-
} else {
|
|
140
|
-
this.$items = this.$el.find($(this.s.selector));
|
|
141
|
-
}
|
|
142
|
-
} else {
|
|
143
|
-
this.$items = this.$el.children();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// .lg-item
|
|
148
|
-
this.$slide = '';
|
|
149
|
-
|
|
150
|
-
// .lg-outer
|
|
151
|
-
this.$outer = '';
|
|
152
|
-
|
|
153
|
-
this.init();
|
|
154
|
-
|
|
155
|
-
return this;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
Plugin.prototype.init = function() {
|
|
159
|
-
|
|
160
|
-
var _this = this;
|
|
161
|
-
|
|
162
|
-
// s.preload should not be more than $item.length
|
|
163
|
-
if (_this.s.preload > _this.$items.length) {
|
|
164
|
-
_this.s.preload = _this.$items.length;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// if dynamic option is enabled execute immediately
|
|
168
|
-
var _hash = window.location.hash;
|
|
169
|
-
if (_hash.indexOf('lg=' + this.s.galleryId) > 0) {
|
|
170
|
-
|
|
171
|
-
_this.index = parseInt(_hash.split('&slide=')[1], 10);
|
|
172
|
-
|
|
173
|
-
$('body').addClass('lg-from-hash');
|
|
174
|
-
if (!$('body').hasClass('lg-on')) {
|
|
175
|
-
setTimeout(function() {
|
|
176
|
-
_this.build(_this.index);
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
$('body').addClass('lg-on');
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (_this.s.dynamic) {
|
|
184
|
-
|
|
185
|
-
_this.$el.trigger('onBeforeOpen.lg');
|
|
186
|
-
|
|
187
|
-
_this.index = _this.s.index || 0;
|
|
188
|
-
|
|
189
|
-
// prevent accidental double execution
|
|
190
|
-
if (!$('body').hasClass('lg-on')) {
|
|
191
|
-
setTimeout(function() {
|
|
192
|
-
_this.build(_this.index);
|
|
193
|
-
$('body').addClass('lg-on');
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
|
|
198
|
-
// Using different namespace for click because click event should not unbind if selector is same object('this')
|
|
199
|
-
_this.$items.on('click.lgcustom', function(event) {
|
|
200
|
-
|
|
201
|
-
// For IE8
|
|
202
|
-
try {
|
|
203
|
-
event.preventDefault();
|
|
204
|
-
event.preventDefault();
|
|
205
|
-
} catch (er) {
|
|
206
|
-
event.returnValue = false;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
_this.$el.trigger('onBeforeOpen.lg');
|
|
210
|
-
|
|
211
|
-
_this.index = _this.s.index || _this.$items.index(this);
|
|
212
|
-
|
|
213
|
-
// prevent accidental double execution
|
|
214
|
-
if (!$('body').hasClass('lg-on')) {
|
|
215
|
-
_this.build(_this.index);
|
|
216
|
-
$('body').addClass('lg-on');
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
Plugin.prototype.build = function(index) {
|
|
224
|
-
|
|
225
|
-
var _this = this;
|
|
226
|
-
|
|
227
|
-
_this.structure();
|
|
228
|
-
|
|
229
|
-
// module constructor
|
|
230
|
-
$.each($.fn.lightGallery.modules, function(key) {
|
|
231
|
-
_this.modules[key] = new $.fn.lightGallery.modules[key](_this.el);
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
// initiate slide function
|
|
235
|
-
_this.slide(index, false, false, false);
|
|
236
|
-
|
|
237
|
-
if (_this.s.keyPress) {
|
|
238
|
-
_this.keyPress();
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (_this.$items.length > 1) {
|
|
242
|
-
|
|
243
|
-
_this.arrow();
|
|
244
|
-
|
|
245
|
-
setTimeout(function() {
|
|
246
|
-
_this.enableDrag();
|
|
247
|
-
_this.enableSwipe();
|
|
248
|
-
}, 50);
|
|
249
|
-
|
|
250
|
-
if (_this.s.mousewheel) {
|
|
251
|
-
_this.mousewheel();
|
|
252
|
-
}
|
|
253
|
-
} else {
|
|
254
|
-
_this.$slide.on('click.lg', function() {
|
|
255
|
-
_this.$el.trigger('onSlideClick.lg');
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
_this.counter();
|
|
260
|
-
|
|
261
|
-
_this.closeGallery();
|
|
262
|
-
|
|
263
|
-
_this.$el.trigger('onAfterOpen.lg');
|
|
264
|
-
|
|
265
|
-
// Hide controllers if mouse doesn't move for some period
|
|
266
|
-
_this.$outer.on('mousemove.lg click.lg touchstart.lg', function() {
|
|
267
|
-
|
|
268
|
-
_this.$outer.removeClass('lg-hide-items');
|
|
269
|
-
|
|
270
|
-
clearTimeout(_this.hideBartimeout);
|
|
271
|
-
|
|
272
|
-
// Timeout will be cleared on each slide movement also
|
|
273
|
-
_this.hideBartimeout = setTimeout(function() {
|
|
274
|
-
_this.$outer.addClass('lg-hide-items');
|
|
275
|
-
}, _this.s.hideBarsDelay);
|
|
276
|
-
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
_this.$outer.trigger('mousemove.lg');
|
|
280
|
-
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
Plugin.prototype.structure = function() {
|
|
284
|
-
var list = '';
|
|
285
|
-
var controls = '';
|
|
286
|
-
var i = 0;
|
|
287
|
-
var subHtmlCont = '';
|
|
288
|
-
var template;
|
|
289
|
-
var _this = this;
|
|
290
|
-
|
|
291
|
-
$('body').append('<div class="lg-backdrop"></div>');
|
|
292
|
-
$('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms');
|
|
293
|
-
|
|
294
|
-
// Create gallery items
|
|
295
|
-
for (i = 0; i < this.$items.length; i++) {
|
|
296
|
-
list += '<div class="lg-item"></div>';
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Create controlls
|
|
300
|
-
if (this.s.controls && this.$items.length > 1) {
|
|
301
|
-
controls = '<div class="lg-actions">' +
|
|
302
|
-
'<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' +
|
|
303
|
-
'<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' +
|
|
304
|
-
'</div>';
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
|
308
|
-
subHtmlCont = '<div class="lg-sub-html"></div>';
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' +
|
|
312
|
-
'<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' +
|
|
313
|
-
'<div class="lg-inner">' + list + '</div>' +
|
|
314
|
-
'<div class="lg-toolbar lg-group">' +
|
|
315
|
-
'<span class="lg-close lg-icon"></span>' +
|
|
316
|
-
'</div>' +
|
|
317
|
-
controls +
|
|
318
|
-
subHtmlCont +
|
|
319
|
-
'</div>' +
|
|
320
|
-
'</div>';
|
|
321
|
-
|
|
322
|
-
$('body').append(template);
|
|
323
|
-
this.$outer = $('.lg-outer');
|
|
324
|
-
this.$slide = this.$outer.find('.lg-item');
|
|
325
|
-
|
|
326
|
-
if (this.s.useLeft) {
|
|
327
|
-
this.$outer.addClass('lg-use-left');
|
|
328
|
-
|
|
329
|
-
// Set mode lg-slide if use left is true;
|
|
330
|
-
this.s.mode = 'lg-slide';
|
|
331
|
-
} else {
|
|
332
|
-
this.$outer.addClass('lg-use-css3');
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// For fixed height gallery
|
|
336
|
-
_this.setTop();
|
|
337
|
-
$(window).on('resize.lg orientationchange.lg', function() {
|
|
338
|
-
setTimeout(function() {
|
|
339
|
-
_this.setTop();
|
|
340
|
-
}, 100);
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
// add class lg-current to remove initial transition
|
|
344
|
-
this.$slide.eq(this.index).addClass('lg-current');
|
|
345
|
-
|
|
346
|
-
// add Class for css support and transition mode
|
|
347
|
-
if (this.doCss()) {
|
|
348
|
-
this.$outer.addClass('lg-css3');
|
|
349
|
-
} else {
|
|
350
|
-
this.$outer.addClass('lg-css');
|
|
351
|
-
|
|
352
|
-
// Set speed 0 because no animation will happen if browser doesn't support css3
|
|
353
|
-
this.s.speed = 0;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
this.$outer.addClass(this.s.mode);
|
|
357
|
-
|
|
358
|
-
if (this.s.enableDrag && this.$items.length > 1) {
|
|
359
|
-
this.$outer.addClass('lg-grab');
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
if (this.s.showAfterLoad) {
|
|
363
|
-
this.$outer.addClass('lg-show-after-load');
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
if (this.doCss()) {
|
|
367
|
-
var $inner = this.$outer.find('.lg-inner');
|
|
368
|
-
$inner.css('transition-timing-function', this.s.cssEasing);
|
|
369
|
-
$inner.css('transition-duration', this.s.speed + 'ms');
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
setTimeout(function() {
|
|
373
|
-
$('.lg-backdrop').addClass('in');
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
setTimeout(function() {
|
|
377
|
-
_this.$outer.addClass('lg-visible');
|
|
378
|
-
}, this.s.backdropDuration);
|
|
379
|
-
|
|
380
|
-
if (this.s.download) {
|
|
381
|
-
this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>');
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// Store the current scroll top value to scroll back after closing the gallery..
|
|
385
|
-
this.prevScrollTop = $(window).scrollTop();
|
|
386
|
-
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
// For fixed height gallery
|
|
390
|
-
Plugin.prototype.setTop = function() {
|
|
391
|
-
if (this.s.height !== '100%') {
|
|
392
|
-
var wH = $(window).height();
|
|
393
|
-
var top = (wH - parseInt(this.s.height, 10)) / 2;
|
|
394
|
-
var $lGallery = this.$outer.find('.lg');
|
|
395
|
-
if (wH >= parseInt(this.s.height, 10)) {
|
|
396
|
-
$lGallery.css('top', top + 'px');
|
|
397
|
-
} else {
|
|
398
|
-
$lGallery.css('top', '0px');
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// Find css3 support
|
|
404
|
-
Plugin.prototype.doCss = function() {
|
|
405
|
-
// check for css animation support
|
|
406
|
-
var support = function() {
|
|
407
|
-
var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
|
|
408
|
-
var root = document.documentElement;
|
|
409
|
-
var i = 0;
|
|
410
|
-
for (i = 0; i < transition.length; i++) {
|
|
411
|
-
if (transition[i] in root.style) {
|
|
412
|
-
return true;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
if (support()) {
|
|
418
|
-
return true;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
return false;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* @desc Check the given src is video
|
|
426
|
-
* @param {String} src
|
|
427
|
-
* @return {Object} video type
|
|
428
|
-
* Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] }
|
|
429
|
-
*/
|
|
430
|
-
Plugin.prototype.isVideo = function(src, index) {
|
|
431
|
-
|
|
432
|
-
var html;
|
|
433
|
-
if (this.s.dynamic) {
|
|
434
|
-
html = this.s.dynamicEl[index].html;
|
|
435
|
-
} else {
|
|
436
|
-
html = this.$items.eq(index).attr('data-html');
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
if (!src) {
|
|
440
|
-
if(html) {
|
|
441
|
-
return {
|
|
442
|
-
html5: true
|
|
443
|
-
};
|
|
444
|
-
} else {
|
|
445
|
-
console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html');
|
|
446
|
-
return false;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
|
|
451
|
-
var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
|
|
452
|
-
var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i);
|
|
453
|
-
var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i);
|
|
454
|
-
|
|
455
|
-
if (youtube) {
|
|
456
|
-
return {
|
|
457
|
-
youtube: youtube
|
|
458
|
-
};
|
|
459
|
-
} else if (vimeo) {
|
|
460
|
-
return {
|
|
461
|
-
vimeo: vimeo
|
|
462
|
-
};
|
|
463
|
-
} else if (dailymotion) {
|
|
464
|
-
return {
|
|
465
|
-
dailymotion: dailymotion
|
|
466
|
-
};
|
|
467
|
-
} else if (vk) {
|
|
468
|
-
return {
|
|
469
|
-
vk: vk
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* @desc Create image counter
|
|
476
|
-
* Ex: 1/10
|
|
477
|
-
*/
|
|
478
|
-
Plugin.prototype.counter = function() {
|
|
479
|
-
if (this.s.counter) {
|
|
480
|
-
$(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>');
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* @desc add sub-html into the slide
|
|
486
|
-
* @param {Number} index - index of the slide
|
|
487
|
-
*/
|
|
488
|
-
Plugin.prototype.addHtml = function(index) {
|
|
489
|
-
var subHtml = null;
|
|
490
|
-
var subHtmlUrl;
|
|
491
|
-
var $currentEle;
|
|
492
|
-
if (this.s.dynamic) {
|
|
493
|
-
if (this.s.dynamicEl[index].subHtmlUrl) {
|
|
494
|
-
subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl;
|
|
495
|
-
} else {
|
|
496
|
-
subHtml = this.s.dynamicEl[index].subHtml;
|
|
497
|
-
}
|
|
498
|
-
} else {
|
|
499
|
-
$currentEle = this.$items.eq(index);
|
|
500
|
-
if ($currentEle.attr('data-sub-html-url')) {
|
|
501
|
-
subHtmlUrl = $currentEle.attr('data-sub-html-url');
|
|
502
|
-
} else {
|
|
503
|
-
subHtml = $currentEle.attr('data-sub-html');
|
|
504
|
-
if (this.s.getCaptionFromTitleOrAlt && !subHtml) {
|
|
505
|
-
subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt');
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
if (!subHtmlUrl) {
|
|
511
|
-
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
|
512
|
-
|
|
513
|
-
// get first letter of subhtml
|
|
514
|
-
// if first letter starts with . or # get the html form the jQuery object
|
|
515
|
-
var fL = subHtml.substring(0, 1);
|
|
516
|
-
if (fL === '.' || fL === '#') {
|
|
517
|
-
if (this.s.subHtmlSelectorRelative && !this.s.dynamic) {
|
|
518
|
-
subHtml = $currentEle.find(subHtml).html();
|
|
519
|
-
} else {
|
|
520
|
-
subHtml = $(subHtml).html();
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
} else {
|
|
524
|
-
subHtml = '';
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
|
529
|
-
|
|
530
|
-
if (subHtmlUrl) {
|
|
531
|
-
this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl);
|
|
532
|
-
} else {
|
|
533
|
-
this.$outer.find(this.s.appendSubHtmlTo).html(subHtml);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
} else {
|
|
537
|
-
|
|
538
|
-
if (subHtmlUrl) {
|
|
539
|
-
this.$slide.eq(index).load(subHtmlUrl);
|
|
540
|
-
} else {
|
|
541
|
-
this.$slide.eq(index).append(subHtml);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
// Add lg-empty-html class if title doesn't exist
|
|
546
|
-
if (typeof subHtml !== 'undefined' && subHtml !== null) {
|
|
547
|
-
if (subHtml === '') {
|
|
548
|
-
this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html');
|
|
549
|
-
} else {
|
|
550
|
-
this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html');
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
this.$el.trigger('onAfterAppendSubHtml.lg', [index]);
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* @desc Preload slides
|
|
559
|
-
* @param {Number} index - index of the slide
|
|
560
|
-
*/
|
|
561
|
-
Plugin.prototype.preload = function(index) {
|
|
562
|
-
var i = 1;
|
|
563
|
-
var j = 1;
|
|
564
|
-
for (i = 1; i <= this.s.preload; i++) {
|
|
565
|
-
if (i >= this.$items.length - index) {
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
this.loadContent(index + i, false, 0);
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
for (j = 1; j <= this.s.preload; j++) {
|
|
573
|
-
if (index - j < 0) {
|
|
574
|
-
break;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
this.loadContent(index - j, false, 0);
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
/**
|
|
582
|
-
* @desc Load slide content into slide.
|
|
583
|
-
* @param {Number} index - index of the slide.
|
|
584
|
-
* @param {Boolean} rec - if true call loadcontent() function again.
|
|
585
|
-
* @param {Boolean} delay - delay for adding complete class. it is 0 except first time.
|
|
586
|
-
*/
|
|
587
|
-
Plugin.prototype.loadContent = function(index, rec, delay) {
|
|
588
|
-
|
|
589
|
-
var _this = this;
|
|
590
|
-
var _hasPoster = false;
|
|
591
|
-
var _$img;
|
|
592
|
-
var _src;
|
|
593
|
-
var _poster;
|
|
594
|
-
var _srcset;
|
|
595
|
-
var _sizes;
|
|
596
|
-
var _html;
|
|
597
|
-
var getResponsiveSrc = function(srcItms) {
|
|
598
|
-
var rsWidth = [];
|
|
599
|
-
var rsSrc = [];
|
|
600
|
-
for (var i = 0; i < srcItms.length; i++) {
|
|
601
|
-
var __src = srcItms[i].split(' ');
|
|
602
|
-
|
|
603
|
-
// Manage empty space
|
|
604
|
-
if (__src[0] === '') {
|
|
605
|
-
__src.splice(0, 1);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
rsSrc.push(__src[0]);
|
|
609
|
-
rsWidth.push(__src[1]);
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
var wWidth = $(window).width();
|
|
613
|
-
for (var j = 0; j < rsWidth.length; j++) {
|
|
614
|
-
if (parseInt(rsWidth[j], 10) > wWidth) {
|
|
615
|
-
_src = rsSrc[j];
|
|
616
|
-
break;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
if (_this.s.dynamic) {
|
|
622
|
-
|
|
623
|
-
if (_this.s.dynamicEl[index].poster) {
|
|
624
|
-
_hasPoster = true;
|
|
625
|
-
_poster = _this.s.dynamicEl[index].poster;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
_html = _this.s.dynamicEl[index].html;
|
|
629
|
-
_src = _this.s.dynamicEl[index].src;
|
|
630
|
-
|
|
631
|
-
if (_this.s.dynamicEl[index].responsive) {
|
|
632
|
-
var srcDyItms = _this.s.dynamicEl[index].responsive.split(',');
|
|
633
|
-
getResponsiveSrc(srcDyItms);
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
_srcset = _this.s.dynamicEl[index].srcset;
|
|
637
|
-
_sizes = _this.s.dynamicEl[index].sizes;
|
|
638
|
-
|
|
639
|
-
} else {
|
|
640
|
-
|
|
641
|
-
if (_this.$items.eq(index).attr('data-poster')) {
|
|
642
|
-
_hasPoster = true;
|
|
643
|
-
_poster = _this.$items.eq(index).attr('data-poster');
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
_html = _this.$items.eq(index).attr('data-html');
|
|
647
|
-
_src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src');
|
|
648
|
-
|
|
649
|
-
if (_this.$items.eq(index).attr('data-responsive')) {
|
|
650
|
-
var srcItms = _this.$items.eq(index).attr('data-responsive').split(',');
|
|
651
|
-
getResponsiveSrc(srcItms);
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
_srcset = _this.$items.eq(index).attr('data-srcset');
|
|
655
|
-
_sizes = _this.$items.eq(index).attr('data-sizes');
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
//if (_src || _srcset || _sizes || _poster) {
|
|
660
|
-
|
|
661
|
-
var iframe = false;
|
|
662
|
-
if (_this.s.dynamic) {
|
|
663
|
-
if (_this.s.dynamicEl[index].iframe) {
|
|
664
|
-
iframe = true;
|
|
665
|
-
}
|
|
666
|
-
} else {
|
|
667
|
-
if (_this.$items.eq(index).attr('data-iframe') === 'true') {
|
|
668
|
-
iframe = true;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
var _isVideo = _this.isVideo(_src, index);
|
|
673
|
-
if (!_this.$slide.eq(index).hasClass('lg-loaded')) {
|
|
674
|
-
if (iframe) {
|
|
675
|
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>');
|
|
676
|
-
} else if (_hasPoster) {
|
|
677
|
-
var videoClass = '';
|
|
678
|
-
if (_isVideo && _isVideo.youtube) {
|
|
679
|
-
videoClass = 'lg-has-youtube';
|
|
680
|
-
} else if (_isVideo && _isVideo.vimeo) {
|
|
681
|
-
videoClass = 'lg-has-vimeo';
|
|
682
|
-
} else {
|
|
683
|
-
videoClass = 'lg-has-html5';
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>');
|
|
687
|
-
|
|
688
|
-
} else if (_isVideo) {
|
|
689
|
-
_this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>');
|
|
690
|
-
_this.$el.trigger('hasVideo.lg', [index, _src, _html]);
|
|
691
|
-
} else {
|
|
692
|
-
_this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>');
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
_this.$el.trigger('onAferAppendSlide.lg', [index]);
|
|
696
|
-
|
|
697
|
-
_$img = _this.$slide.eq(index).find('.lg-object');
|
|
698
|
-
if (_sizes) {
|
|
699
|
-
_$img.attr('sizes', _sizes);
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
if (_srcset) {
|
|
703
|
-
_$img.attr('srcset', _srcset);
|
|
704
|
-
try {
|
|
705
|
-
picturefill({
|
|
706
|
-
elements: [_$img[0]]
|
|
707
|
-
});
|
|
708
|
-
} catch (e) {
|
|
709
|
-
console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.');
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
if (this.s.appendSubHtmlTo !== '.lg-sub-html') {
|
|
714
|
-
_this.addHtml(index);
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
_this.$slide.eq(index).addClass('lg-loaded');
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
|
721
|
-
|
|
722
|
-
// For first time add some delay for displaying the start animation.
|
|
723
|
-
var _speed = 0;
|
|
724
|
-
|
|
725
|
-
// Do not change the delay value because it is required for zoom plugin.
|
|
726
|
-
// If gallery opened from direct url (hash) speed value should be 0
|
|
727
|
-
if (delay && !$('body').hasClass('lg-from-hash')) {
|
|
728
|
-
_speed = delay;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
setTimeout(function() {
|
|
732
|
-
_this.$slide.eq(index).addClass('lg-complete');
|
|
733
|
-
_this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]);
|
|
734
|
-
}, _speed);
|
|
735
|
-
|
|
736
|
-
});
|
|
737
|
-
|
|
738
|
-
// @todo check load state for html5 videos
|
|
739
|
-
if (_isVideo && _isVideo.html5 && !_hasPoster) {
|
|
740
|
-
_this.$slide.eq(index).addClass('lg-complete');
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
if (rec === true) {
|
|
744
|
-
if (!_this.$slide.eq(index).hasClass('lg-complete')) {
|
|
745
|
-
_this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() {
|
|
746
|
-
_this.preload(index);
|
|
747
|
-
});
|
|
748
|
-
} else {
|
|
749
|
-
_this.preload(index);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
//}
|
|
754
|
-
};
|
|
755
|
-
|
|
756
|
-
/**
|
|
757
|
-
* @desc slide function for lightgallery
|
|
758
|
-
** Slide() gets call on start
|
|
759
|
-
** ** Set lg.on true once slide() function gets called.
|
|
760
|
-
** Call loadContent() on slide() function inside setTimeout
|
|
761
|
-
** ** On first slide we do not want any animation like slide of fade
|
|
762
|
-
** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately
|
|
763
|
-
** ** Else loadContent() should wait for the transition to complete.
|
|
764
|
-
** ** So set timeout s.speed + 50
|
|
765
|
-
<=> ** loadContent() will load slide content in to the particular slide
|
|
766
|
-
** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function.
|
|
767
|
-
** ** preload will execute only when the previous slide is fully loaded (images iframe)
|
|
768
|
-
** ** avoid simultaneous image load
|
|
769
|
-
<=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value
|
|
770
|
-
** loadContent() <====> Preload();
|
|
771
|
-
|
|
772
|
-
* @param {Number} index - index of the slide
|
|
773
|
-
* @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag
|
|
774
|
-
* @param {Boolean} fromThumb - true if slide function called via thumbnail click
|
|
775
|
-
* @param {String} direction - Direction of the slide(next/prev)
|
|
776
|
-
*/
|
|
777
|
-
Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) {
|
|
778
|
-
|
|
779
|
-
var _prevIndex = this.$outer.find('.lg-current').index();
|
|
780
|
-
var _this = this;
|
|
781
|
-
|
|
782
|
-
// Prevent if multiple call
|
|
783
|
-
// Required for hsh plugin
|
|
784
|
-
if (_this.lGalleryOn && (_prevIndex === index)) {
|
|
785
|
-
return;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
var _length = this.$slide.length;
|
|
789
|
-
var _time = _this.lGalleryOn ? this.s.speed : 0;
|
|
790
|
-
|
|
791
|
-
if (!_this.lgBusy) {
|
|
792
|
-
|
|
793
|
-
if (this.s.download) {
|
|
794
|
-
var _src;
|
|
795
|
-
if (_this.s.dynamic) {
|
|
796
|
-
_src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src);
|
|
797
|
-
} else {
|
|
798
|
-
_src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'));
|
|
799
|
-
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
if (_src) {
|
|
803
|
-
$('#lg-download').attr('href', _src);
|
|
804
|
-
_this.$outer.removeClass('lg-hide-download');
|
|
805
|
-
} else {
|
|
806
|
-
_this.$outer.addClass('lg-hide-download');
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
|
811
|
-
|
|
812
|
-
_this.lgBusy = true;
|
|
813
|
-
|
|
814
|
-
clearTimeout(_this.hideBartimeout);
|
|
815
|
-
|
|
816
|
-
// Add title if this.s.appendSubHtmlTo === lg-sub-html
|
|
817
|
-
if (this.s.appendSubHtmlTo === '.lg-sub-html') {
|
|
818
|
-
|
|
819
|
-
// wait for slide animation to complete
|
|
820
|
-
setTimeout(function() {
|
|
821
|
-
_this.addHtml(index);
|
|
822
|
-
}, _time);
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
this.arrowDisable(index);
|
|
826
|
-
|
|
827
|
-
if (!direction) {
|
|
828
|
-
if (index < _prevIndex) {
|
|
829
|
-
direction = 'prev';
|
|
830
|
-
} else if (index > _prevIndex) {
|
|
831
|
-
direction = 'next';
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
if (!fromTouch) {
|
|
836
|
-
|
|
837
|
-
// remove all transitions
|
|
838
|
-
_this.$outer.addClass('lg-no-trans');
|
|
839
|
-
|
|
840
|
-
this.$slide.removeClass('lg-prev-slide lg-next-slide');
|
|
841
|
-
|
|
842
|
-
if (direction === 'prev') {
|
|
843
|
-
|
|
844
|
-
//prevslide
|
|
845
|
-
this.$slide.eq(index).addClass('lg-prev-slide');
|
|
846
|
-
this.$slide.eq(_prevIndex).addClass('lg-next-slide');
|
|
847
|
-
} else {
|
|
848
|
-
|
|
849
|
-
// next slide
|
|
850
|
-
this.$slide.eq(index).addClass('lg-next-slide');
|
|
851
|
-
this.$slide.eq(_prevIndex).addClass('lg-prev-slide');
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
// give 50 ms for browser to add/remove class
|
|
855
|
-
setTimeout(function() {
|
|
856
|
-
_this.$slide.removeClass('lg-current');
|
|
857
|
-
|
|
858
|
-
//_this.$slide.eq(_prevIndex).removeClass('lg-current');
|
|
859
|
-
_this.$slide.eq(index).addClass('lg-current');
|
|
860
|
-
|
|
861
|
-
// reset all transitions
|
|
862
|
-
_this.$outer.removeClass('lg-no-trans');
|
|
863
|
-
}, 50);
|
|
864
|
-
} else {
|
|
865
|
-
|
|
866
|
-
this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide');
|
|
867
|
-
var touchPrev;
|
|
868
|
-
var touchNext;
|
|
869
|
-
if (_length > 2) {
|
|
870
|
-
touchPrev = index - 1;
|
|
871
|
-
touchNext = index + 1;
|
|
872
|
-
|
|
873
|
-
if ((index === 0) && (_prevIndex === _length - 1)) {
|
|
874
|
-
|
|
875
|
-
// next slide
|
|
876
|
-
touchNext = 0;
|
|
877
|
-
touchPrev = _length - 1;
|
|
878
|
-
} else if ((index === _length - 1) && (_prevIndex === 0)) {
|
|
879
|
-
|
|
880
|
-
// prev slide
|
|
881
|
-
touchNext = 0;
|
|
882
|
-
touchPrev = _length - 1;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
} else {
|
|
886
|
-
touchPrev = 0;
|
|
887
|
-
touchNext = 1;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
if (direction === 'prev') {
|
|
891
|
-
_this.$slide.eq(touchNext).addClass('lg-next-slide');
|
|
892
|
-
} else {
|
|
893
|
-
_this.$slide.eq(touchPrev).addClass('lg-prev-slide');
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
_this.$slide.eq(index).addClass('lg-current');
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
if (_this.lGalleryOn) {
|
|
900
|
-
setTimeout(function() {
|
|
901
|
-
_this.loadContent(index, true, 0);
|
|
902
|
-
}, this.s.speed + 50);
|
|
903
|
-
|
|
904
|
-
setTimeout(function() {
|
|
905
|
-
_this.lgBusy = false;
|
|
906
|
-
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
|
907
|
-
}, this.s.speed);
|
|
908
|
-
|
|
909
|
-
} else {
|
|
910
|
-
_this.loadContent(index, true, _this.s.backdropDuration);
|
|
911
|
-
|
|
912
|
-
_this.lgBusy = false;
|
|
913
|
-
_this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]);
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
_this.lGalleryOn = true;
|
|
917
|
-
|
|
918
|
-
if (this.s.counter) {
|
|
919
|
-
$('#lg-counter-current').text(index + 1);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
}
|
|
923
|
-
_this.index = index;
|
|
924
|
-
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
/**
|
|
928
|
-
* @desc Go to next slide
|
|
929
|
-
* @param {Boolean} fromTouch - true if slide function called via touch event
|
|
930
|
-
*/
|
|
931
|
-
Plugin.prototype.goToNextSlide = function(fromTouch) {
|
|
932
|
-
var _this = this;
|
|
933
|
-
var _loop = _this.s.loop;
|
|
934
|
-
if (fromTouch && _this.$slide.length < 3) {
|
|
935
|
-
_loop = false;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
if (!_this.lgBusy) {
|
|
939
|
-
if ((_this.index + 1) < _this.$slide.length) {
|
|
940
|
-
_this.index++;
|
|
941
|
-
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
|
942
|
-
_this.slide(_this.index, fromTouch, false, 'next');
|
|
943
|
-
} else {
|
|
944
|
-
if (_loop) {
|
|
945
|
-
_this.index = 0;
|
|
946
|
-
_this.$el.trigger('onBeforeNextSlide.lg', [_this.index]);
|
|
947
|
-
_this.slide(_this.index, fromTouch, false, 'next');
|
|
948
|
-
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
|
949
|
-
_this.$outer.addClass('lg-right-end');
|
|
950
|
-
setTimeout(function() {
|
|
951
|
-
_this.$outer.removeClass('lg-right-end');
|
|
952
|
-
}, 400);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
};
|
|
957
|
-
|
|
958
|
-
/**
|
|
959
|
-
* @desc Go to previous slide
|
|
960
|
-
* @param {Boolean} fromTouch - true if slide function called via touch event
|
|
961
|
-
*/
|
|
962
|
-
Plugin.prototype.goToPrevSlide = function(fromTouch) {
|
|
963
|
-
var _this = this;
|
|
964
|
-
var _loop = _this.s.loop;
|
|
965
|
-
if (fromTouch && _this.$slide.length < 3) {
|
|
966
|
-
_loop = false;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
if (!_this.lgBusy) {
|
|
970
|
-
if (_this.index > 0) {
|
|
971
|
-
_this.index--;
|
|
972
|
-
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
|
973
|
-
_this.slide(_this.index, fromTouch, false, 'prev');
|
|
974
|
-
} else {
|
|
975
|
-
if (_loop) {
|
|
976
|
-
_this.index = _this.$items.length - 1;
|
|
977
|
-
_this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]);
|
|
978
|
-
_this.slide(_this.index, fromTouch, false, 'prev');
|
|
979
|
-
} else if (_this.s.slideEndAnimatoin && !fromTouch) {
|
|
980
|
-
_this.$outer.addClass('lg-left-end');
|
|
981
|
-
setTimeout(function() {
|
|
982
|
-
_this.$outer.removeClass('lg-left-end');
|
|
983
|
-
}, 400);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
Plugin.prototype.keyPress = function() {
|
|
990
|
-
var _this = this;
|
|
991
|
-
if (this.$items.length > 1) {
|
|
992
|
-
$(window).on('keyup.lg', function(e) {
|
|
993
|
-
if (_this.$items.length > 1) {
|
|
994
|
-
if (e.keyCode === 37) {
|
|
995
|
-
e.preventDefault();
|
|
996
|
-
_this.goToPrevSlide();
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
if (e.keyCode === 39) {
|
|
1000
|
-
e.preventDefault();
|
|
1001
|
-
_this.goToNextSlide();
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
$(window).on('keydown.lg', function(e) {
|
|
1008
|
-
if (_this.s.escKey === true && e.keyCode === 27) {
|
|
1009
|
-
e.preventDefault();
|
|
1010
|
-
if (!_this.$outer.hasClass('lg-thumb-open')) {
|
|
1011
|
-
_this.destroy();
|
|
1012
|
-
} else {
|
|
1013
|
-
_this.$outer.removeClass('lg-thumb-open');
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
Plugin.prototype.arrow = function() {
|
|
1020
|
-
var _this = this;
|
|
1021
|
-
this.$outer.find('.lg-prev').on('click.lg', function() {
|
|
1022
|
-
_this.goToPrevSlide();
|
|
1023
|
-
});
|
|
1024
|
-
|
|
1025
|
-
this.$outer.find('.lg-next').on('click.lg', function() {
|
|
1026
|
-
_this.goToNextSlide();
|
|
1027
|
-
});
|
|
1028
|
-
};
|
|
1029
|
-
|
|
1030
|
-
Plugin.prototype.arrowDisable = function(index) {
|
|
1031
|
-
|
|
1032
|
-
// Disable arrows if s.hideControlOnEnd is true
|
|
1033
|
-
if (!this.s.loop && this.s.hideControlOnEnd) {
|
|
1034
|
-
if ((index + 1) < this.$slide.length) {
|
|
1035
|
-
this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled');
|
|
1036
|
-
} else {
|
|
1037
|
-
this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled');
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
if (index > 0) {
|
|
1041
|
-
this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled');
|
|
1042
|
-
} else {
|
|
1043
|
-
this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled');
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
|
|
1048
|
-
Plugin.prototype.setTranslate = function($el, xValue, yValue) {
|
|
1049
|
-
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
|
1050
|
-
if (this.s.useLeft) {
|
|
1051
|
-
$el.css('left', xValue);
|
|
1052
|
-
} else {
|
|
1053
|
-
$el.css({
|
|
1054
|
-
transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)'
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
Plugin.prototype.touchMove = function(startCoords, endCoords) {
|
|
1060
|
-
|
|
1061
|
-
var distance = endCoords - startCoords;
|
|
1062
|
-
|
|
1063
|
-
if (Math.abs(distance) > 15) {
|
|
1064
|
-
// reset opacity and transition duration
|
|
1065
|
-
this.$outer.addClass('lg-dragging');
|
|
1066
|
-
|
|
1067
|
-
// move current slide
|
|
1068
|
-
this.setTranslate(this.$slide.eq(this.index), distance, 0);
|
|
1069
|
-
|
|
1070
|
-
// move next and prev slide with current slide
|
|
1071
|
-
this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0);
|
|
1072
|
-
this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0);
|
|
1073
|
-
}
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
Plugin.prototype.touchEnd = function(distance) {
|
|
1077
|
-
var _this = this;
|
|
1078
|
-
|
|
1079
|
-
// keep slide animation for any mode while dragg/swipe
|
|
1080
|
-
if (_this.s.mode !== 'lg-slide') {
|
|
1081
|
-
_this.$outer.addClass('lg-slide');
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0');
|
|
1085
|
-
|
|
1086
|
-
// set transition duration
|
|
1087
|
-
setTimeout(function() {
|
|
1088
|
-
_this.$outer.removeClass('lg-dragging');
|
|
1089
|
-
if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
|
1090
|
-
_this.goToNextSlide(true);
|
|
1091
|
-
} else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) {
|
|
1092
|
-
_this.goToPrevSlide(true);
|
|
1093
|
-
} else if (Math.abs(distance) < 5) {
|
|
1094
|
-
|
|
1095
|
-
// Trigger click if distance is less than 5 pix
|
|
1096
|
-
_this.$el.trigger('onSlideClick.lg');
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
_this.$slide.removeAttr('style');
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
// remove slide class once drag/swipe is completed if mode is not slide
|
|
1103
|
-
setTimeout(function() {
|
|
1104
|
-
if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') {
|
|
1105
|
-
_this.$outer.removeClass('lg-slide');
|
|
1106
|
-
}
|
|
1107
|
-
}, _this.s.speed + 100);
|
|
1108
|
-
|
|
1109
|
-
};
|
|
1110
|
-
|
|
1111
|
-
Plugin.prototype.enableSwipe = function() {
|
|
1112
|
-
var _this = this;
|
|
1113
|
-
var startCoords = 0;
|
|
1114
|
-
var endCoords = 0;
|
|
1115
|
-
var isMoved = false;
|
|
1116
|
-
|
|
1117
|
-
if (_this.s.enableSwipe && _this.doCss()) {
|
|
1118
|
-
|
|
1119
|
-
_this.$slide.on('touchstart.lg', function(e) {
|
|
1120
|
-
if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) {
|
|
1121
|
-
e.preventDefault();
|
|
1122
|
-
_this.manageSwipeClass();
|
|
1123
|
-
startCoords = e.originalEvent.targetTouches[0].pageX;
|
|
1124
|
-
}
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
|
-
_this.$slide.on('touchmove.lg', function(e) {
|
|
1128
|
-
if (!_this.$outer.hasClass('lg-zoomed')) {
|
|
1129
|
-
e.preventDefault();
|
|
1130
|
-
endCoords = e.originalEvent.targetTouches[0].pageX;
|
|
1131
|
-
_this.touchMove(startCoords, endCoords);
|
|
1132
|
-
isMoved = true;
|
|
1133
|
-
}
|
|
1134
|
-
});
|
|
1135
|
-
|
|
1136
|
-
_this.$slide.on('touchend.lg', function() {
|
|
1137
|
-
if (!_this.$outer.hasClass('lg-zoomed')) {
|
|
1138
|
-
if (isMoved) {
|
|
1139
|
-
isMoved = false;
|
|
1140
|
-
_this.touchEnd(endCoords - startCoords);
|
|
1141
|
-
} else {
|
|
1142
|
-
_this.$el.trigger('onSlideClick.lg');
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
}
|
|
1147
|
-
|
|
1148
|
-
};
|
|
1149
|
-
|
|
1150
|
-
Plugin.prototype.enableDrag = function() {
|
|
1151
|
-
var _this = this;
|
|
1152
|
-
var startCoords = 0;
|
|
1153
|
-
var endCoords = 0;
|
|
1154
|
-
var isDraging = false;
|
|
1155
|
-
var isMoved = false;
|
|
1156
|
-
if (_this.s.enableDrag && _this.doCss()) {
|
|
1157
|
-
_this.$slide.on('mousedown.lg', function(e) {
|
|
1158
|
-
// execute only on .lg-object
|
|
1159
|
-
if (!_this.$outer.hasClass('lg-zoomed')) {
|
|
1160
|
-
if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
|
|
1161
|
-
e.preventDefault();
|
|
1162
|
-
|
|
1163
|
-
if (!_this.lgBusy) {
|
|
1164
|
-
_this.manageSwipeClass();
|
|
1165
|
-
startCoords = e.pageX;
|
|
1166
|
-
isDraging = true;
|
|
1167
|
-
|
|
1168
|
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
|
1169
|
-
_this.$outer.scrollLeft += 1;
|
|
1170
|
-
_this.$outer.scrollLeft -= 1;
|
|
1171
|
-
|
|
1172
|
-
// *
|
|
1173
|
-
|
|
1174
|
-
_this.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
|
1175
|
-
|
|
1176
|
-
_this.$el.trigger('onDragstart.lg');
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
});
|
|
1182
|
-
|
|
1183
|
-
$(window).on('mousemove.lg', function(e) {
|
|
1184
|
-
if (isDraging) {
|
|
1185
|
-
isMoved = true;
|
|
1186
|
-
endCoords = e.pageX;
|
|
1187
|
-
_this.touchMove(startCoords, endCoords);
|
|
1188
|
-
_this.$el.trigger('onDragmove.lg');
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
|
|
1192
|
-
$(window).on('mouseup.lg', function(e) {
|
|
1193
|
-
if (isMoved) {
|
|
1194
|
-
isMoved = false;
|
|
1195
|
-
_this.touchEnd(endCoords - startCoords);
|
|
1196
|
-
_this.$el.trigger('onDragend.lg');
|
|
1197
|
-
} else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) {
|
|
1198
|
-
_this.$el.trigger('onSlideClick.lg');
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
// Prevent execution on click
|
|
1202
|
-
if (isDraging) {
|
|
1203
|
-
isDraging = false;
|
|
1204
|
-
_this.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
1205
|
-
}
|
|
1206
|
-
});
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1209
|
-
};
|
|
1210
|
-
|
|
1211
|
-
Plugin.prototype.manageSwipeClass = function() {
|
|
1212
|
-
var _touchNext = this.index + 1;
|
|
1213
|
-
var _touchPrev = this.index - 1;
|
|
1214
|
-
if (this.s.loop && this.$slide.length > 2) {
|
|
1215
|
-
if (this.index === 0) {
|
|
1216
|
-
_touchPrev = this.$slide.length - 1;
|
|
1217
|
-
} else if (this.index === this.$slide.length - 1) {
|
|
1218
|
-
_touchNext = 0;
|
|
1219
|
-
}
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
this.$slide.removeClass('lg-next-slide lg-prev-slide');
|
|
1223
|
-
if (_touchPrev > -1) {
|
|
1224
|
-
this.$slide.eq(_touchPrev).addClass('lg-prev-slide');
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
this.$slide.eq(_touchNext).addClass('lg-next-slide');
|
|
1228
|
-
};
|
|
1229
|
-
|
|
1230
|
-
Plugin.prototype.mousewheel = function() {
|
|
1231
|
-
var _this = this;
|
|
1232
|
-
_this.$outer.on('mousewheel.lg', function(e) {
|
|
1233
|
-
|
|
1234
|
-
if (!e.deltaY) {
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
if (e.deltaY > 0) {
|
|
1239
|
-
_this.goToPrevSlide();
|
|
1240
|
-
} else {
|
|
1241
|
-
_this.goToNextSlide();
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
e.preventDefault();
|
|
1245
|
-
});
|
|
1246
|
-
|
|
1247
|
-
};
|
|
1248
|
-
|
|
1249
|
-
Plugin.prototype.closeGallery = function() {
|
|
1250
|
-
|
|
1251
|
-
var _this = this;
|
|
1252
|
-
var mousedown = false;
|
|
1253
|
-
this.$outer.find('.lg-close').on('click.lg', function() {
|
|
1254
|
-
_this.destroy();
|
|
1255
|
-
});
|
|
1256
|
-
|
|
1257
|
-
if (_this.s.closable) {
|
|
1258
|
-
|
|
1259
|
-
// If you drag the slide and release outside gallery gets close on chrome
|
|
1260
|
-
// for preventing this check mousedown and mouseup happened on .lg-item or lg-outer
|
|
1261
|
-
_this.$outer.on('mousedown.lg', function(e) {
|
|
1262
|
-
|
|
1263
|
-
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) {
|
|
1264
|
-
mousedown = true;
|
|
1265
|
-
} else {
|
|
1266
|
-
mousedown = false;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
});
|
|
1270
|
-
|
|
1271
|
-
_this.$outer.on('mouseup.lg', function(e) {
|
|
1272
|
-
|
|
1273
|
-
if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) {
|
|
1274
|
-
if (!_this.$outer.hasClass('lg-dragging')) {
|
|
1275
|
-
_this.destroy();
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
});
|
|
1280
|
-
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
};
|
|
1284
|
-
|
|
1285
|
-
Plugin.prototype.destroy = function(d) {
|
|
1286
|
-
|
|
1287
|
-
var _this = this;
|
|
1288
|
-
|
|
1289
|
-
if (!d) {
|
|
1290
|
-
_this.$el.trigger('onBeforeClose.lg');
|
|
1291
|
-
$(window).scrollTop(_this.prevScrollTop);
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
/**
|
|
1296
|
-
* if d is false or undefined destroy will only close the gallery
|
|
1297
|
-
* plugins instance remains with the element
|
|
1298
|
-
*
|
|
1299
|
-
* if d is true destroy will completely remove the plugin
|
|
1300
|
-
*/
|
|
1301
|
-
|
|
1302
|
-
if (d) {
|
|
1303
|
-
if (!_this.s.dynamic) {
|
|
1304
|
-
// only when not using dynamic mode is $items a jquery collection
|
|
1305
|
-
this.$items.off('click.lg click.lgcustom');
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
$.removeData(_this.el, 'lightGallery');
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
// Unbind all events added by lightGallery
|
|
1312
|
-
this.$el.off('.lg.tm');
|
|
1313
|
-
|
|
1314
|
-
// Distroy all lightGallery modules
|
|
1315
|
-
$.each($.fn.lightGallery.modules, function(key) {
|
|
1316
|
-
if (_this.modules[key]) {
|
|
1317
|
-
_this.modules[key].destroy();
|
|
1318
|
-
}
|
|
1319
|
-
});
|
|
1320
|
-
|
|
1321
|
-
this.lGalleryOn = false;
|
|
1322
|
-
|
|
1323
|
-
clearTimeout(_this.hideBartimeout);
|
|
1324
|
-
this.hideBartimeout = false;
|
|
1325
|
-
$(window).off('.lg');
|
|
1326
|
-
$('body').removeClass('lg-on lg-from-hash');
|
|
1327
|
-
|
|
1328
|
-
if (_this.$outer) {
|
|
1329
|
-
_this.$outer.removeClass('lg-visible');
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
$('.lg-backdrop').removeClass('in');
|
|
1333
|
-
|
|
1334
|
-
setTimeout(function() {
|
|
1335
|
-
if (_this.$outer) {
|
|
1336
|
-
_this.$outer.remove();
|
|
1337
|
-
}
|
|
1338
|
-
|
|
1339
|
-
$('.lg-backdrop').remove();
|
|
1340
|
-
|
|
1341
|
-
if (!d) {
|
|
1342
|
-
_this.$el.trigger('onCloseAfter.lg');
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
}, _this.s.backdropDuration + 50);
|
|
1346
|
-
};
|
|
1347
|
-
|
|
1348
|
-
$.fn.lightGallery = function(options) {
|
|
1349
|
-
return this.each(function() {
|
|
1350
|
-
if (!$.data(this, 'lightGallery')) {
|
|
1351
|
-
$.data(this, 'lightGallery', new Plugin(this, options));
|
|
1352
|
-
} else {
|
|
1353
|
-
try {
|
|
1354
|
-
$(this).data('lightGallery').init();
|
|
1355
|
-
} catch (err) {
|
|
1356
|
-
console.error('lightGallery has not initiated properly');
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
});
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
|
-
$.fn.lightGallery.modules = {};
|
|
1363
|
-
|
|
1364
|
-
})();
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}));
|
|
1368
|
-
|
|
1369
|
-
/*! lg-autoplay - v1.0.4 - 2017-03-28
|
|
1370
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
1371
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
1372
|
-
|
|
1373
|
-
(function (root, factory) {
|
|
1374
|
-
if (typeof define === 'function' && define.amd) {
|
|
1375
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
1376
|
-
define(['jquery'], function (a0) {
|
|
1377
|
-
return (factory(a0));
|
|
1378
|
-
});
|
|
1379
|
-
} else if (typeof exports === 'object') {
|
|
1380
|
-
// Node. Does not work with strict CommonJS, but
|
|
1381
|
-
// only CommonJS-like environments that support module.exports,
|
|
1382
|
-
// like Node.
|
|
1383
|
-
module.exports = factory(require('jquery'));
|
|
1384
|
-
} else {
|
|
1385
|
-
factory(jQuery);
|
|
1386
|
-
}
|
|
1387
|
-
}(this, function ($) {
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
(function() {
|
|
1391
|
-
|
|
1392
|
-
'use strict';
|
|
1393
|
-
|
|
1394
|
-
var defaults = {
|
|
1395
|
-
autoplay: false,
|
|
1396
|
-
pause: 5000,
|
|
1397
|
-
progressBar: true,
|
|
1398
|
-
fourceAutoplay: false,
|
|
1399
|
-
autoplayControls: true,
|
|
1400
|
-
appendAutoplayControlsTo: '.lg-toolbar'
|
|
1401
|
-
};
|
|
1402
|
-
|
|
1403
|
-
/**
|
|
1404
|
-
* Creates the autoplay plugin.
|
|
1405
|
-
* @param {object} element - lightGallery element
|
|
1406
|
-
*/
|
|
1407
|
-
var Autoplay = function(element) {
|
|
1408
|
-
|
|
1409
|
-
this.core = $(element).data('lightGallery');
|
|
1410
|
-
|
|
1411
|
-
this.$el = $(element);
|
|
1412
|
-
|
|
1413
|
-
// Execute only if items are above 1
|
|
1414
|
-
if (this.core.$items.length < 2) {
|
|
1415
|
-
return false;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
1419
|
-
this.interval = false;
|
|
1420
|
-
|
|
1421
|
-
// Identify if slide happened from autoplay
|
|
1422
|
-
this.fromAuto = true;
|
|
1423
|
-
|
|
1424
|
-
// Identify if autoplay canceled from touch/drag
|
|
1425
|
-
this.canceledOnTouch = false;
|
|
1426
|
-
|
|
1427
|
-
// save fourceautoplay value
|
|
1428
|
-
this.fourceAutoplayTemp = this.core.s.fourceAutoplay;
|
|
1429
|
-
|
|
1430
|
-
// do not allow progress bar if browser does not support css3 transitions
|
|
1431
|
-
if (!this.core.doCss()) {
|
|
1432
|
-
this.core.s.progressBar = false;
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
this.init();
|
|
1436
|
-
|
|
1437
|
-
return this;
|
|
1438
|
-
};
|
|
1439
|
-
|
|
1440
|
-
Autoplay.prototype.init = function() {
|
|
1441
|
-
var _this = this;
|
|
1442
|
-
|
|
1443
|
-
// append autoplay controls
|
|
1444
|
-
if (_this.core.s.autoplayControls) {
|
|
1445
|
-
_this.controls();
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
// Create progress bar
|
|
1449
|
-
if (_this.core.s.progressBar) {
|
|
1450
|
-
_this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>');
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
// set progress
|
|
1454
|
-
_this.progress();
|
|
1455
|
-
|
|
1456
|
-
// Start autoplay
|
|
1457
|
-
if (_this.core.s.autoplay) {
|
|
1458
|
-
_this.$el.one('onSlideItemLoad.lg.tm', function() {
|
|
1459
|
-
_this.startlAuto();
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
// cancel interval on touchstart and dragstart
|
|
1464
|
-
_this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() {
|
|
1465
|
-
if (_this.interval) {
|
|
1466
|
-
_this.cancelAuto();
|
|
1467
|
-
_this.canceledOnTouch = true;
|
|
1468
|
-
}
|
|
1469
|
-
});
|
|
1470
|
-
|
|
1471
|
-
// restore autoplay if autoplay canceled from touchstart / dragstart
|
|
1472
|
-
_this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() {
|
|
1473
|
-
if (!_this.interval && _this.canceledOnTouch) {
|
|
1474
|
-
_this.startlAuto();
|
|
1475
|
-
_this.canceledOnTouch = false;
|
|
1476
|
-
}
|
|
1477
|
-
});
|
|
1478
|
-
|
|
1479
|
-
};
|
|
1480
|
-
|
|
1481
|
-
Autoplay.prototype.progress = function() {
|
|
1482
|
-
|
|
1483
|
-
var _this = this;
|
|
1484
|
-
var _$progressBar;
|
|
1485
|
-
var _$progress;
|
|
1486
|
-
|
|
1487
|
-
_this.$el.on('onBeforeSlide.lg.tm', function() {
|
|
1488
|
-
|
|
1489
|
-
// start progress bar animation
|
|
1490
|
-
if (_this.core.s.progressBar && _this.fromAuto) {
|
|
1491
|
-
_$progressBar = _this.core.$outer.find('.lg-progress-bar');
|
|
1492
|
-
_$progress = _this.core.$outer.find('.lg-progress');
|
|
1493
|
-
if (_this.interval) {
|
|
1494
|
-
_$progress.removeAttr('style');
|
|
1495
|
-
_$progressBar.removeClass('lg-start');
|
|
1496
|
-
setTimeout(function() {
|
|
1497
|
-
_$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
|
1498
|
-
_$progressBar.addClass('lg-start');
|
|
1499
|
-
}, 20);
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
|
|
1503
|
-
// Remove setinterval if slide is triggered manually and fourceautoplay is false
|
|
1504
|
-
if (!_this.fromAuto && !_this.core.s.fourceAutoplay) {
|
|
1505
|
-
_this.cancelAuto();
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
_this.fromAuto = false;
|
|
1509
|
-
|
|
1510
|
-
});
|
|
1511
|
-
};
|
|
1512
|
-
|
|
1513
|
-
// Manage autoplay via play/stop buttons
|
|
1514
|
-
Autoplay.prototype.controls = function() {
|
|
1515
|
-
var _this = this;
|
|
1516
|
-
var _html = '<span class="lg-autoplay-button lg-icon"></span>';
|
|
1517
|
-
|
|
1518
|
-
// Append autoplay controls
|
|
1519
|
-
$(this.core.s.appendAutoplayControlsTo).append(_html);
|
|
1520
|
-
|
|
1521
|
-
_this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() {
|
|
1522
|
-
if ($(_this.core.$outer).hasClass('lg-show-autoplay')) {
|
|
1523
|
-
_this.cancelAuto();
|
|
1524
|
-
_this.core.s.fourceAutoplay = false;
|
|
1525
|
-
} else {
|
|
1526
|
-
if (!_this.interval) {
|
|
1527
|
-
_this.startlAuto();
|
|
1528
|
-
_this.core.s.fourceAutoplay = _this.fourceAutoplayTemp;
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
});
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
|
-
// Autostart gallery
|
|
1535
|
-
Autoplay.prototype.startlAuto = function() {
|
|
1536
|
-
var _this = this;
|
|
1537
|
-
|
|
1538
|
-
_this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s');
|
|
1539
|
-
_this.core.$outer.addClass('lg-show-autoplay');
|
|
1540
|
-
_this.core.$outer.find('.lg-progress-bar').addClass('lg-start');
|
|
1541
|
-
|
|
1542
|
-
_this.interval = setInterval(function() {
|
|
1543
|
-
if (_this.core.index + 1 < _this.core.$items.length) {
|
|
1544
|
-
_this.core.index++;
|
|
1545
|
-
} else {
|
|
1546
|
-
_this.core.index = 0;
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
_this.fromAuto = true;
|
|
1550
|
-
_this.core.slide(_this.core.index, false, false, 'next');
|
|
1551
|
-
}, _this.core.s.speed + _this.core.s.pause);
|
|
1552
|
-
};
|
|
1553
|
-
|
|
1554
|
-
// cancel Autostart
|
|
1555
|
-
Autoplay.prototype.cancelAuto = function() {
|
|
1556
|
-
clearInterval(this.interval);
|
|
1557
|
-
this.interval = false;
|
|
1558
|
-
this.core.$outer.find('.lg-progress').removeAttr('style');
|
|
1559
|
-
this.core.$outer.removeClass('lg-show-autoplay');
|
|
1560
|
-
this.core.$outer.find('.lg-progress-bar').removeClass('lg-start');
|
|
1561
|
-
};
|
|
1562
|
-
|
|
1563
|
-
Autoplay.prototype.destroy = function() {
|
|
1564
|
-
|
|
1565
|
-
this.cancelAuto();
|
|
1566
|
-
this.core.$outer.find('.lg-progress-bar').remove();
|
|
1567
|
-
};
|
|
1568
|
-
|
|
1569
|
-
$.fn.lightGallery.modules.autoplay = Autoplay;
|
|
1570
|
-
|
|
1571
|
-
})();
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
}));
|
|
1575
|
-
|
|
1576
|
-
/*! lg-fullscreen - v1.0.1 - 2016-09-30
|
|
1577
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
1578
|
-
* Copyright (c) 2016 Sachin N; Licensed GPLv3 */
|
|
1579
|
-
|
|
1580
|
-
(function (root, factory) {
|
|
1581
|
-
if (typeof define === 'function' && define.amd) {
|
|
1582
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
1583
|
-
define(['jquery'], function (a0) {
|
|
1584
|
-
return (factory(a0));
|
|
1585
|
-
});
|
|
1586
|
-
} else if (typeof exports === 'object') {
|
|
1587
|
-
// Node. Does not work with strict CommonJS, but
|
|
1588
|
-
// only CommonJS-like environments that support module.exports,
|
|
1589
|
-
// like Node.
|
|
1590
|
-
module.exports = factory(require('jquery'));
|
|
1591
|
-
} else {
|
|
1592
|
-
factory(jQuery);
|
|
1593
|
-
}
|
|
1594
|
-
}(this, function ($) {
|
|
1595
|
-
|
|
1596
|
-
(function() {
|
|
1597
|
-
|
|
1598
|
-
'use strict';
|
|
1599
|
-
|
|
1600
|
-
var defaults = {
|
|
1601
|
-
fullScreen: true
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
var Fullscreen = function(element) {
|
|
1605
|
-
|
|
1606
|
-
// get lightGallery core plugin data
|
|
1607
|
-
this.core = $(element).data('lightGallery');
|
|
1608
|
-
|
|
1609
|
-
this.$el = $(element);
|
|
1610
|
-
|
|
1611
|
-
// extend module defalut settings with lightGallery core settings
|
|
1612
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
1613
|
-
|
|
1614
|
-
this.init();
|
|
1615
|
-
|
|
1616
|
-
return this;
|
|
1617
|
-
};
|
|
1618
|
-
|
|
1619
|
-
Fullscreen.prototype.init = function() {
|
|
1620
|
-
var fullScreen = '';
|
|
1621
|
-
if (this.core.s.fullScreen) {
|
|
1622
|
-
|
|
1623
|
-
// check for fullscreen browser support
|
|
1624
|
-
if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled &&
|
|
1625
|
-
!document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
|
|
1626
|
-
return;
|
|
1627
|
-
} else {
|
|
1628
|
-
fullScreen = '<span class="lg-fullscreen lg-icon"></span>';
|
|
1629
|
-
this.core.$outer.find('.lg-toolbar').append(fullScreen);
|
|
1630
|
-
this.fullScreen();
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
|
-
Fullscreen.prototype.requestFullscreen = function() {
|
|
1636
|
-
var el = document.documentElement;
|
|
1637
|
-
if (el.requestFullscreen) {
|
|
1638
|
-
el.requestFullscreen();
|
|
1639
|
-
} else if (el.msRequestFullscreen) {
|
|
1640
|
-
el.msRequestFullscreen();
|
|
1641
|
-
} else if (el.mozRequestFullScreen) {
|
|
1642
|
-
el.mozRequestFullScreen();
|
|
1643
|
-
} else if (el.webkitRequestFullscreen) {
|
|
1644
|
-
el.webkitRequestFullscreen();
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
|
-
|
|
1648
|
-
Fullscreen.prototype.exitFullscreen = function() {
|
|
1649
|
-
if (document.exitFullscreen) {
|
|
1650
|
-
document.exitFullscreen();
|
|
1651
|
-
} else if (document.msExitFullscreen) {
|
|
1652
|
-
document.msExitFullscreen();
|
|
1653
|
-
} else if (document.mozCancelFullScreen) {
|
|
1654
|
-
document.mozCancelFullScreen();
|
|
1655
|
-
} else if (document.webkitExitFullscreen) {
|
|
1656
|
-
document.webkitExitFullscreen();
|
|
1657
|
-
}
|
|
1658
|
-
};
|
|
1659
|
-
|
|
1660
|
-
// https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
|
|
1661
|
-
Fullscreen.prototype.fullScreen = function() {
|
|
1662
|
-
var _this = this;
|
|
1663
|
-
|
|
1664
|
-
$(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() {
|
|
1665
|
-
_this.core.$outer.toggleClass('lg-fullscreen-on');
|
|
1666
|
-
});
|
|
1667
|
-
|
|
1668
|
-
this.core.$outer.find('.lg-fullscreen').on('click.lg', function() {
|
|
1669
|
-
if (!document.fullscreenElement &&
|
|
1670
|
-
!document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
|
|
1671
|
-
_this.requestFullscreen();
|
|
1672
|
-
} else {
|
|
1673
|
-
_this.exitFullscreen();
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
|
|
1677
|
-
};
|
|
1678
|
-
|
|
1679
|
-
Fullscreen.prototype.destroy = function() {
|
|
1680
|
-
|
|
1681
|
-
// exit from fullscreen if activated
|
|
1682
|
-
this.exitFullscreen();
|
|
1683
|
-
|
|
1684
|
-
$(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg');
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
|
-
$.fn.lightGallery.modules.fullscreen = Fullscreen;
|
|
1688
|
-
|
|
1689
|
-
})();
|
|
1690
|
-
|
|
1691
|
-
}));
|
|
1692
|
-
|
|
1693
|
-
/*! lg-pager - v1.0.2 - 2017-01-22
|
|
1694
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
1695
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
1696
|
-
|
|
1697
|
-
(function (root, factory) {
|
|
1698
|
-
if (typeof define === 'function' && define.amd) {
|
|
1699
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
1700
|
-
define(['jquery'], function (a0) {
|
|
1701
|
-
return (factory(a0));
|
|
1702
|
-
});
|
|
1703
|
-
} else if (typeof exports === 'object') {
|
|
1704
|
-
// Node. Does not work with strict CommonJS, but
|
|
1705
|
-
// only CommonJS-like environments that support module.exports,
|
|
1706
|
-
// like Node.
|
|
1707
|
-
module.exports = factory(require('jquery'));
|
|
1708
|
-
} else {
|
|
1709
|
-
factory(jQuery);
|
|
1710
|
-
}
|
|
1711
|
-
}(this, function ($) {
|
|
1712
|
-
|
|
1713
|
-
(function() {
|
|
1714
|
-
|
|
1715
|
-
'use strict';
|
|
1716
|
-
|
|
1717
|
-
var defaults = {
|
|
1718
|
-
pager: false
|
|
1719
|
-
};
|
|
1720
|
-
|
|
1721
|
-
var Pager = function(element) {
|
|
1722
|
-
|
|
1723
|
-
this.core = $(element).data('lightGallery');
|
|
1724
|
-
|
|
1725
|
-
this.$el = $(element);
|
|
1726
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
1727
|
-
if (this.core.s.pager && this.core.$items.length > 1) {
|
|
1728
|
-
this.init();
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
return this;
|
|
1732
|
-
};
|
|
1733
|
-
|
|
1734
|
-
Pager.prototype.init = function() {
|
|
1735
|
-
var _this = this;
|
|
1736
|
-
var pagerList = '';
|
|
1737
|
-
var $pagerCont;
|
|
1738
|
-
var $pagerOuter;
|
|
1739
|
-
var timeout;
|
|
1740
|
-
|
|
1741
|
-
_this.core.$outer.find('.lg').append('<div class="lg-pager-outer"></div>');
|
|
1742
|
-
|
|
1743
|
-
if (_this.core.s.dynamic) {
|
|
1744
|
-
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
|
1745
|
-
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + _this.core.s.dynamicEl[i].thumb + '" /></div></span>';
|
|
1746
|
-
}
|
|
1747
|
-
} else {
|
|
1748
|
-
_this.core.$items.each(function() {
|
|
1749
|
-
|
|
1750
|
-
if (!_this.core.s.exThumbImage) {
|
|
1751
|
-
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).find('img').attr('src') + '" /></div></span>';
|
|
1752
|
-
} else {
|
|
1753
|
-
pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).attr(_this.core.s.exThumbImage) + '" /></div></span>';
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
$pagerOuter = _this.core.$outer.find('.lg-pager-outer');
|
|
1760
|
-
|
|
1761
|
-
$pagerOuter.html(pagerList);
|
|
1762
|
-
|
|
1763
|
-
$pagerCont = _this.core.$outer.find('.lg-pager-cont');
|
|
1764
|
-
$pagerCont.on('click.lg touchend.lg', function() {
|
|
1765
|
-
var _$this = $(this);
|
|
1766
|
-
_this.core.index = _$this.index();
|
|
1767
|
-
_this.core.slide(_this.core.index, false, true, false);
|
|
1768
|
-
});
|
|
1769
|
-
|
|
1770
|
-
$pagerOuter.on('mouseover.lg', function() {
|
|
1771
|
-
clearTimeout(timeout);
|
|
1772
|
-
$pagerOuter.addClass('lg-pager-hover');
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
$pagerOuter.on('mouseout.lg', function() {
|
|
1776
|
-
timeout = setTimeout(function() {
|
|
1777
|
-
$pagerOuter.removeClass('lg-pager-hover');
|
|
1778
|
-
});
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
_this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) {
|
|
1782
|
-
$pagerCont.removeClass('lg-pager-active');
|
|
1783
|
-
$pagerCont.eq(index).addClass('lg-pager-active');
|
|
1784
|
-
});
|
|
1785
|
-
|
|
1786
|
-
};
|
|
1787
|
-
|
|
1788
|
-
Pager.prototype.destroy = function() {
|
|
1789
|
-
|
|
1790
|
-
};
|
|
1791
|
-
|
|
1792
|
-
$.fn.lightGallery.modules.pager = Pager;
|
|
1793
|
-
|
|
1794
|
-
})();
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
}));
|
|
1798
|
-
|
|
1799
|
-
/*! lg-thumbnail - v1.1.0 - 2017-08-08
|
|
1800
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
1801
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
1802
|
-
|
|
1803
|
-
(function (root, factory) {
|
|
1804
|
-
if (typeof define === 'function' && define.amd) {
|
|
1805
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
1806
|
-
define(['jquery'], function (a0) {
|
|
1807
|
-
return (factory(a0));
|
|
1808
|
-
});
|
|
1809
|
-
} else if (typeof exports === 'object') {
|
|
1810
|
-
// Node. Does not work with strict CommonJS, but
|
|
1811
|
-
// only CommonJS-like environments that support module.exports,
|
|
1812
|
-
// like Node.
|
|
1813
|
-
module.exports = factory(require('jquery'));
|
|
1814
|
-
} else {
|
|
1815
|
-
factory(jQuery);
|
|
1816
|
-
}
|
|
1817
|
-
}(this, function ($) {
|
|
1818
|
-
|
|
1819
|
-
(function() {
|
|
1820
|
-
|
|
1821
|
-
'use strict';
|
|
1822
|
-
|
|
1823
|
-
var defaults = {
|
|
1824
|
-
thumbnail: true,
|
|
1825
|
-
|
|
1826
|
-
animateThumb: true,
|
|
1827
|
-
currentPagerPosition: 'middle',
|
|
1828
|
-
|
|
1829
|
-
thumbWidth: 100,
|
|
1830
|
-
thumbHeight: '80px',
|
|
1831
|
-
thumbContHeight: 100,
|
|
1832
|
-
thumbMargin: 5,
|
|
1833
|
-
|
|
1834
|
-
exThumbImage: false,
|
|
1835
|
-
showThumbByDefault: true,
|
|
1836
|
-
toogleThumb: true,
|
|
1837
|
-
pullCaptionUp: true,
|
|
1838
|
-
|
|
1839
|
-
enableThumbDrag: true,
|
|
1840
|
-
enableThumbSwipe: true,
|
|
1841
|
-
swipeThreshold: 50,
|
|
1842
|
-
|
|
1843
|
-
loadYoutubeThumbnail: true,
|
|
1844
|
-
youtubeThumbSize: 1,
|
|
1845
|
-
|
|
1846
|
-
loadVimeoThumbnail: true,
|
|
1847
|
-
vimeoThumbSize: 'thumbnail_small',
|
|
1848
|
-
|
|
1849
|
-
loadDailymotionThumbnail: true
|
|
1850
|
-
};
|
|
1851
|
-
|
|
1852
|
-
var Thumbnail = function(element) {
|
|
1853
|
-
|
|
1854
|
-
// get lightGallery core plugin data
|
|
1855
|
-
this.core = $(element).data('lightGallery');
|
|
1856
|
-
|
|
1857
|
-
// extend module default settings with lightGallery core settings
|
|
1858
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
1859
|
-
|
|
1860
|
-
this.$el = $(element);
|
|
1861
|
-
this.$thumbOuter = null;
|
|
1862
|
-
this.thumbOuterWidth = 0;
|
|
1863
|
-
this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin));
|
|
1864
|
-
this.thumbIndex = this.core.index;
|
|
1865
|
-
|
|
1866
|
-
if (this.core.s.animateThumb) {
|
|
1867
|
-
this.core.s.thumbHeight = '100%';
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
// Thumbnail animation value
|
|
1871
|
-
this.left = 0;
|
|
1872
|
-
|
|
1873
|
-
this.init();
|
|
1874
|
-
|
|
1875
|
-
return this;
|
|
1876
|
-
};
|
|
1877
|
-
|
|
1878
|
-
Thumbnail.prototype.init = function() {
|
|
1879
|
-
var _this = this;
|
|
1880
|
-
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
|
1881
|
-
if (this.core.s.showThumbByDefault) {
|
|
1882
|
-
setTimeout(function(){
|
|
1883
|
-
_this.core.$outer.addClass('lg-thumb-open');
|
|
1884
|
-
}, 700);
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
if (this.core.s.pullCaptionUp) {
|
|
1888
|
-
this.core.$outer.addClass('lg-pull-caption-up');
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
this.build();
|
|
1892
|
-
if (this.core.s.animateThumb && this.core.doCss()) {
|
|
1893
|
-
if (this.core.s.enableThumbDrag) {
|
|
1894
|
-
this.enableThumbDrag();
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
if (this.core.s.enableThumbSwipe) {
|
|
1898
|
-
this.enableThumbSwipe();
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
this.thumbClickable = false;
|
|
1902
|
-
} else {
|
|
1903
|
-
this.thumbClickable = true;
|
|
1904
|
-
}
|
|
1905
|
-
|
|
1906
|
-
this.toogle();
|
|
1907
|
-
this.thumbkeyPress();
|
|
1908
|
-
}
|
|
1909
|
-
};
|
|
1910
|
-
|
|
1911
|
-
Thumbnail.prototype.build = function() {
|
|
1912
|
-
var _this = this;
|
|
1913
|
-
var thumbList = '';
|
|
1914
|
-
var vimeoErrorThumbSize = '';
|
|
1915
|
-
var $thumb;
|
|
1916
|
-
var html = '<div class="lg-thumb-outer">' +
|
|
1917
|
-
'<div class="lg-thumb lg-group">' +
|
|
1918
|
-
'</div>' +
|
|
1919
|
-
'</div>';
|
|
1920
|
-
|
|
1921
|
-
switch (this.core.s.vimeoThumbSize) {
|
|
1922
|
-
case 'thumbnail_large':
|
|
1923
|
-
vimeoErrorThumbSize = '640';
|
|
1924
|
-
break;
|
|
1925
|
-
case 'thumbnail_medium':
|
|
1926
|
-
vimeoErrorThumbSize = '200x150';
|
|
1927
|
-
break;
|
|
1928
|
-
case 'thumbnail_small':
|
|
1929
|
-
vimeoErrorThumbSize = '100x75';
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
_this.core.$outer.addClass('lg-has-thumb');
|
|
1933
|
-
|
|
1934
|
-
_this.core.$outer.find('.lg').append(html);
|
|
1935
|
-
|
|
1936
|
-
_this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer');
|
|
1937
|
-
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
|
1938
|
-
|
|
1939
|
-
if (_this.core.s.animateThumb) {
|
|
1940
|
-
_this.core.$outer.find('.lg-thumb').css({
|
|
1941
|
-
width: _this.thumbTotalWidth + 'px',
|
|
1942
|
-
position: 'relative'
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
if (this.core.s.animateThumb) {
|
|
1947
|
-
_this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px');
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
function getThumb(src, thumb, index) {
|
|
1951
|
-
var isVideo = _this.core.isVideo(src, index) || {};
|
|
1952
|
-
var thumbImg;
|
|
1953
|
-
var vimeoId = '';
|
|
1954
|
-
|
|
1955
|
-
if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
|
|
1956
|
-
if (isVideo.youtube) {
|
|
1957
|
-
if (_this.core.s.loadYoutubeThumbnail) {
|
|
1958
|
-
thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg';
|
|
1959
|
-
} else {
|
|
1960
|
-
thumbImg = thumb;
|
|
1961
|
-
}
|
|
1962
|
-
} else if (isVideo.vimeo) {
|
|
1963
|
-
if (_this.core.s.loadVimeoThumbnail) {
|
|
1964
|
-
thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg';
|
|
1965
|
-
vimeoId = isVideo.vimeo[1];
|
|
1966
|
-
} else {
|
|
1967
|
-
thumbImg = thumb;
|
|
1968
|
-
}
|
|
1969
|
-
} else if (isVideo.dailymotion) {
|
|
1970
|
-
if (_this.core.s.loadDailymotionThumbnail) {
|
|
1971
|
-
thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1];
|
|
1972
|
-
} else {
|
|
1973
|
-
thumbImg = thumb;
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
} else {
|
|
1977
|
-
thumbImg = thumb;
|
|
1978
|
-
}
|
|
1979
|
-
|
|
1980
|
-
thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
|
|
1981
|
-
vimeoId = '';
|
|
1982
|
-
}
|
|
1983
|
-
|
|
1984
|
-
if (_this.core.s.dynamic) {
|
|
1985
|
-
for (var i = 0; i < _this.core.s.dynamicEl.length; i++) {
|
|
1986
|
-
getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i);
|
|
1987
|
-
}
|
|
1988
|
-
} else {
|
|
1989
|
-
_this.core.$items.each(function(i) {
|
|
1990
|
-
|
|
1991
|
-
if (!_this.core.s.exThumbImage) {
|
|
1992
|
-
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
|
|
1993
|
-
} else {
|
|
1994
|
-
getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i);
|
|
1995
|
-
}
|
|
1996
|
-
|
|
1997
|
-
});
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
_this.core.$outer.find('.lg-thumb').html(thumbList);
|
|
2001
|
-
|
|
2002
|
-
$thumb = _this.core.$outer.find('.lg-thumb-item');
|
|
2003
|
-
|
|
2004
|
-
// Load vimeo thumbnails
|
|
2005
|
-
$thumb.each(function() {
|
|
2006
|
-
var $this = $(this);
|
|
2007
|
-
var vimeoVideoId = $this.attr('data-vimeo-id');
|
|
2008
|
-
|
|
2009
|
-
if (vimeoVideoId) {
|
|
2010
|
-
$.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
|
|
2011
|
-
format: 'json'
|
|
2012
|
-
}, function(data) {
|
|
2013
|
-
$this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]);
|
|
2014
|
-
});
|
|
2015
|
-
}
|
|
2016
|
-
});
|
|
2017
|
-
|
|
2018
|
-
// manage active class for thumbnail
|
|
2019
|
-
$thumb.eq(_this.core.index).addClass('active');
|
|
2020
|
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
|
2021
|
-
$thumb.removeClass('active');
|
|
2022
|
-
$thumb.eq(_this.core.index).addClass('active');
|
|
2023
|
-
});
|
|
2024
|
-
|
|
2025
|
-
$thumb.on('click.lg touchend.lg', function() {
|
|
2026
|
-
var _$this = $(this);
|
|
2027
|
-
setTimeout(function() {
|
|
2028
|
-
|
|
2029
|
-
// In IE9 and bellow touch does not support
|
|
2030
|
-
// Go to slide if browser does not support css transitions
|
|
2031
|
-
if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) {
|
|
2032
|
-
_this.core.index = _$this.index();
|
|
2033
|
-
_this.core.slide(_this.core.index, false, true, false);
|
|
2034
|
-
}
|
|
2035
|
-
}, 50);
|
|
2036
|
-
});
|
|
2037
|
-
|
|
2038
|
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
|
2039
|
-
_this.animateThumb(_this.core.index);
|
|
2040
|
-
});
|
|
2041
|
-
|
|
2042
|
-
$(window).on('resize.lg.thumb orientationchange.lg.thumb', function() {
|
|
2043
|
-
setTimeout(function() {
|
|
2044
|
-
_this.animateThumb(_this.core.index);
|
|
2045
|
-
_this.thumbOuterWidth = _this.$thumbOuter.width();
|
|
2046
|
-
}, 200);
|
|
2047
|
-
});
|
|
2048
|
-
|
|
2049
|
-
};
|
|
2050
|
-
|
|
2051
|
-
Thumbnail.prototype.setTranslate = function(value) {
|
|
2052
|
-
// jQuery supports Automatic CSS prefixing since jQuery 1.8.0
|
|
2053
|
-
this.core.$outer.find('.lg-thumb').css({
|
|
2054
|
-
transform: 'translate3d(-' + (value) + 'px, 0px, 0px)'
|
|
2055
|
-
});
|
|
2056
|
-
};
|
|
2057
|
-
|
|
2058
|
-
Thumbnail.prototype.animateThumb = function(index) {
|
|
2059
|
-
var $thumb = this.core.$outer.find('.lg-thumb');
|
|
2060
|
-
if (this.core.s.animateThumb) {
|
|
2061
|
-
var position;
|
|
2062
|
-
switch (this.core.s.currentPagerPosition) {
|
|
2063
|
-
case 'left':
|
|
2064
|
-
position = 0;
|
|
2065
|
-
break;
|
|
2066
|
-
case 'middle':
|
|
2067
|
-
position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2);
|
|
2068
|
-
break;
|
|
2069
|
-
case 'right':
|
|
2070
|
-
position = this.thumbOuterWidth - this.core.s.thumbWidth;
|
|
2071
|
-
}
|
|
2072
|
-
this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position;
|
|
2073
|
-
if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) {
|
|
2074
|
-
this.left = this.thumbTotalWidth - this.thumbOuterWidth;
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
|
-
if (this.left < 0) {
|
|
2078
|
-
this.left = 0;
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
if (this.core.lGalleryOn) {
|
|
2082
|
-
if (!$thumb.hasClass('on')) {
|
|
2083
|
-
this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms');
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
if (!this.core.doCss()) {
|
|
2087
|
-
$thumb.animate({
|
|
2088
|
-
left: -this.left + 'px'
|
|
2089
|
-
}, this.core.s.speed);
|
|
2090
|
-
}
|
|
2091
|
-
} else {
|
|
2092
|
-
if (!this.core.doCss()) {
|
|
2093
|
-
$thumb.css('left', -this.left + 'px');
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
this.setTranslate(this.left);
|
|
2098
|
-
|
|
2099
|
-
}
|
|
2100
|
-
};
|
|
2101
|
-
|
|
2102
|
-
// Enable thumbnail dragging and swiping
|
|
2103
|
-
Thumbnail.prototype.enableThumbDrag = function() {
|
|
2104
|
-
|
|
2105
|
-
var _this = this;
|
|
2106
|
-
var startCoords = 0;
|
|
2107
|
-
var endCoords = 0;
|
|
2108
|
-
var isDraging = false;
|
|
2109
|
-
var isMoved = false;
|
|
2110
|
-
var tempLeft = 0;
|
|
2111
|
-
|
|
2112
|
-
_this.$thumbOuter.addClass('lg-grab');
|
|
2113
|
-
|
|
2114
|
-
_this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) {
|
|
2115
|
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
|
2116
|
-
// execute only on .lg-object
|
|
2117
|
-
e.preventDefault();
|
|
2118
|
-
startCoords = e.pageX;
|
|
2119
|
-
isDraging = true;
|
|
2120
|
-
|
|
2121
|
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
|
2122
|
-
_this.core.$outer.scrollLeft += 1;
|
|
2123
|
-
_this.core.$outer.scrollLeft -= 1;
|
|
2124
|
-
|
|
2125
|
-
// *
|
|
2126
|
-
_this.thumbClickable = false;
|
|
2127
|
-
_this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing');
|
|
2128
|
-
}
|
|
2129
|
-
});
|
|
2130
|
-
|
|
2131
|
-
$(window).on('mousemove.lg.thumb', function(e) {
|
|
2132
|
-
if (isDraging) {
|
|
2133
|
-
tempLeft = _this.left;
|
|
2134
|
-
isMoved = true;
|
|
2135
|
-
endCoords = e.pageX;
|
|
2136
|
-
|
|
2137
|
-
_this.$thumbOuter.addClass('lg-dragging');
|
|
2138
|
-
|
|
2139
|
-
tempLeft = tempLeft - (endCoords - startCoords);
|
|
2140
|
-
|
|
2141
|
-
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
|
2142
|
-
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
if (tempLeft < 0) {
|
|
2146
|
-
tempLeft = 0;
|
|
2147
|
-
}
|
|
2148
|
-
|
|
2149
|
-
// move current slide
|
|
2150
|
-
_this.setTranslate(tempLeft);
|
|
2151
|
-
|
|
2152
|
-
}
|
|
2153
|
-
});
|
|
2154
|
-
|
|
2155
|
-
$(window).on('mouseup.lg.thumb', function() {
|
|
2156
|
-
if (isMoved) {
|
|
2157
|
-
isMoved = false;
|
|
2158
|
-
_this.$thumbOuter.removeClass('lg-dragging');
|
|
2159
|
-
|
|
2160
|
-
_this.left = tempLeft;
|
|
2161
|
-
|
|
2162
|
-
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
|
2163
|
-
_this.thumbClickable = true;
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
} else {
|
|
2167
|
-
_this.thumbClickable = true;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
if (isDraging) {
|
|
2171
|
-
isDraging = false;
|
|
2172
|
-
_this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab');
|
|
2173
|
-
}
|
|
2174
|
-
});
|
|
2175
|
-
|
|
2176
|
-
};
|
|
2177
|
-
|
|
2178
|
-
Thumbnail.prototype.enableThumbSwipe = function() {
|
|
2179
|
-
var _this = this;
|
|
2180
|
-
var startCoords = 0;
|
|
2181
|
-
var endCoords = 0;
|
|
2182
|
-
var isMoved = false;
|
|
2183
|
-
var tempLeft = 0;
|
|
2184
|
-
|
|
2185
|
-
_this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) {
|
|
2186
|
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
|
2187
|
-
e.preventDefault();
|
|
2188
|
-
startCoords = e.originalEvent.targetTouches[0].pageX;
|
|
2189
|
-
_this.thumbClickable = false;
|
|
2190
|
-
}
|
|
2191
|
-
});
|
|
2192
|
-
|
|
2193
|
-
_this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) {
|
|
2194
|
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
|
2195
|
-
e.preventDefault();
|
|
2196
|
-
endCoords = e.originalEvent.targetTouches[0].pageX;
|
|
2197
|
-
isMoved = true;
|
|
2198
|
-
|
|
2199
|
-
_this.$thumbOuter.addClass('lg-dragging');
|
|
2200
|
-
|
|
2201
|
-
tempLeft = _this.left;
|
|
2202
|
-
|
|
2203
|
-
tempLeft = tempLeft - (endCoords - startCoords);
|
|
2204
|
-
|
|
2205
|
-
if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) {
|
|
2206
|
-
tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth;
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
if (tempLeft < 0) {
|
|
2210
|
-
tempLeft = 0;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
// move current slide
|
|
2214
|
-
_this.setTranslate(tempLeft);
|
|
2215
|
-
|
|
2216
|
-
}
|
|
2217
|
-
});
|
|
2218
|
-
|
|
2219
|
-
_this.core.$outer.find('.lg-thumb').on('touchend.lg', function() {
|
|
2220
|
-
if (_this.thumbTotalWidth > _this.thumbOuterWidth) {
|
|
2221
|
-
|
|
2222
|
-
if (isMoved) {
|
|
2223
|
-
isMoved = false;
|
|
2224
|
-
_this.$thumbOuter.removeClass('lg-dragging');
|
|
2225
|
-
if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) {
|
|
2226
|
-
_this.thumbClickable = true;
|
|
2227
|
-
}
|
|
2228
|
-
|
|
2229
|
-
_this.left = tempLeft;
|
|
2230
|
-
} else {
|
|
2231
|
-
_this.thumbClickable = true;
|
|
2232
|
-
}
|
|
2233
|
-
} else {
|
|
2234
|
-
_this.thumbClickable = true;
|
|
2235
|
-
}
|
|
2236
|
-
});
|
|
2237
|
-
|
|
2238
|
-
};
|
|
2239
|
-
|
|
2240
|
-
Thumbnail.prototype.toogle = function() {
|
|
2241
|
-
var _this = this;
|
|
2242
|
-
if (_this.core.s.toogleThumb) {
|
|
2243
|
-
_this.core.$outer.addClass('lg-can-toggle');
|
|
2244
|
-
_this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>');
|
|
2245
|
-
_this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() {
|
|
2246
|
-
_this.core.$outer.toggleClass('lg-thumb-open');
|
|
2247
|
-
});
|
|
2248
|
-
}
|
|
2249
|
-
};
|
|
2250
|
-
|
|
2251
|
-
Thumbnail.prototype.thumbkeyPress = function() {
|
|
2252
|
-
var _this = this;
|
|
2253
|
-
$(window).on('keydown.lg.thumb', function(e) {
|
|
2254
|
-
if (e.keyCode === 38) {
|
|
2255
|
-
e.preventDefault();
|
|
2256
|
-
_this.core.$outer.addClass('lg-thumb-open');
|
|
2257
|
-
} else if (e.keyCode === 40) {
|
|
2258
|
-
e.preventDefault();
|
|
2259
|
-
_this.core.$outer.removeClass('lg-thumb-open');
|
|
2260
|
-
}
|
|
2261
|
-
});
|
|
2262
|
-
};
|
|
2263
|
-
|
|
2264
|
-
Thumbnail.prototype.destroy = function() {
|
|
2265
|
-
if (this.core.s.thumbnail && this.core.$items.length > 1) {
|
|
2266
|
-
$(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb');
|
|
2267
|
-
this.$thumbOuter.remove();
|
|
2268
|
-
this.core.$outer.removeClass('lg-has-thumb');
|
|
2269
|
-
}
|
|
2270
|
-
};
|
|
2271
|
-
|
|
2272
|
-
$.fn.lightGallery.modules.Thumbnail = Thumbnail;
|
|
2273
|
-
|
|
2274
|
-
})();
|
|
2275
|
-
|
|
2276
|
-
}));
|
|
2277
|
-
|
|
2278
|
-
/*! lg-video - v1.1.0 - 2017-08-08
|
|
2279
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
2280
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
2281
|
-
|
|
2282
|
-
(function (root, factory) {
|
|
2283
|
-
if (typeof define === 'function' && define.amd) {
|
|
2284
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
2285
|
-
define(['jquery'], function (a0) {
|
|
2286
|
-
return (factory(a0));
|
|
2287
|
-
});
|
|
2288
|
-
} else if (typeof exports === 'object') {
|
|
2289
|
-
// Node. Does not work with strict CommonJS, but
|
|
2290
|
-
// only CommonJS-like environments that support module.exports,
|
|
2291
|
-
// like Node.
|
|
2292
|
-
module.exports = factory(require('jquery'));
|
|
2293
|
-
} else {
|
|
2294
|
-
factory(jQuery);
|
|
2295
|
-
}
|
|
2296
|
-
}(this, function ($) {
|
|
2297
|
-
|
|
2298
|
-
(function() {
|
|
2299
|
-
|
|
2300
|
-
'use strict';
|
|
2301
|
-
|
|
2302
|
-
var defaults = {
|
|
2303
|
-
videoMaxWidth: '855px',
|
|
2304
|
-
youtubePlayerParams: false,
|
|
2305
|
-
vimeoPlayerParams: false,
|
|
2306
|
-
dailymotionPlayerParams: false,
|
|
2307
|
-
vkPlayerParams: false,
|
|
2308
|
-
videojs: false,
|
|
2309
|
-
videojsOptions: {}
|
|
2310
|
-
};
|
|
2311
|
-
|
|
2312
|
-
var Video = function(element) {
|
|
2313
|
-
|
|
2314
|
-
this.core = $(element).data('lightGallery');
|
|
2315
|
-
|
|
2316
|
-
this.$el = $(element);
|
|
2317
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
2318
|
-
this.videoLoaded = false;
|
|
2319
|
-
|
|
2320
|
-
this.init();
|
|
2321
|
-
|
|
2322
|
-
return this;
|
|
2323
|
-
};
|
|
2324
|
-
|
|
2325
|
-
Video.prototype.init = function() {
|
|
2326
|
-
var _this = this;
|
|
2327
|
-
|
|
2328
|
-
// Event triggered when video url found without poster
|
|
2329
|
-
_this.core.$el.on('hasVideo.lg.tm', function(event, index, src, html) {
|
|
2330
|
-
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
|
|
2331
|
-
if (html) {
|
|
2332
|
-
if (_this.core.s.videojs) {
|
|
2333
|
-
try {
|
|
2334
|
-
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
|
2335
|
-
if (!_this.videoLoaded) {
|
|
2336
|
-
this.play();
|
|
2337
|
-
}
|
|
2338
|
-
});
|
|
2339
|
-
} catch (e) {
|
|
2340
|
-
console.error('Make sure you have included videojs');
|
|
2341
|
-
}
|
|
2342
|
-
} else {
|
|
2343
|
-
if(!_this.videoLoaded) {
|
|
2344
|
-
_this.core.$slide.eq(index).find('.lg-html5').get(0).play();
|
|
2345
|
-
}
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
});
|
|
2349
|
-
|
|
2350
|
-
// Set max width for video
|
|
2351
|
-
_this.core.$el.on('onAferAppendSlide.lg.tm', function(event, index) {
|
|
2352
|
-
var $videoCont = _this.core.$slide.eq(index).find('.lg-video-cont');
|
|
2353
|
-
if (!$videoCont.hasClass('lg-has-iframe')) {
|
|
2354
|
-
$videoCont.css('max-width', _this.core.s.videoMaxWidth);
|
|
2355
|
-
_this.videoLoaded = true;
|
|
2356
|
-
}
|
|
2357
|
-
});
|
|
2358
|
-
|
|
2359
|
-
var loadOnClick = function($el) {
|
|
2360
|
-
// check slide has poster
|
|
2361
|
-
if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) {
|
|
2362
|
-
|
|
2363
|
-
// check already video element present
|
|
2364
|
-
if (!$el.hasClass('lg-has-video')) {
|
|
2365
|
-
|
|
2366
|
-
$el.addClass('lg-video-playing lg-has-video');
|
|
2367
|
-
|
|
2368
|
-
var _src;
|
|
2369
|
-
var _html;
|
|
2370
|
-
var _loadVideo = function(_src, _html) {
|
|
2371
|
-
|
|
2372
|
-
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
|
|
2373
|
-
|
|
2374
|
-
if (_html) {
|
|
2375
|
-
if (_this.core.s.videojs) {
|
|
2376
|
-
try {
|
|
2377
|
-
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() {
|
|
2378
|
-
this.play();
|
|
2379
|
-
});
|
|
2380
|
-
} catch (e) {
|
|
2381
|
-
console.error('Make sure you have included videojs');
|
|
2382
|
-
}
|
|
2383
|
-
} else {
|
|
2384
|
-
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
|
|
2385
|
-
}
|
|
2386
|
-
}
|
|
2387
|
-
|
|
2388
|
-
};
|
|
2389
|
-
|
|
2390
|
-
if (_this.core.s.dynamic) {
|
|
2391
|
-
|
|
2392
|
-
_src = _this.core.s.dynamicEl[_this.core.index].src;
|
|
2393
|
-
_html = _this.core.s.dynamicEl[_this.core.index].html;
|
|
2394
|
-
|
|
2395
|
-
_loadVideo(_src, _html);
|
|
2396
|
-
|
|
2397
|
-
} else {
|
|
2398
|
-
|
|
2399
|
-
_src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src');
|
|
2400
|
-
_html = _this.core.$items.eq(_this.core.index).attr('data-html');
|
|
2401
|
-
|
|
2402
|
-
_loadVideo(_src, _html);
|
|
2403
|
-
|
|
2404
|
-
}
|
|
2405
|
-
|
|
2406
|
-
var $tempImg = $el.find('.lg-object');
|
|
2407
|
-
$el.find('.lg-video').append($tempImg);
|
|
2408
|
-
|
|
2409
|
-
// @todo loading icon for html5 videos also
|
|
2410
|
-
// for showing the loading indicator while loading video
|
|
2411
|
-
if (!$el.find('.lg-video-object').hasClass('lg-html5')) {
|
|
2412
|
-
$el.removeClass('lg-complete');
|
|
2413
|
-
$el.find('.lg-video-object').on('load.lg error.lg', function() {
|
|
2414
|
-
$el.addClass('lg-complete');
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
|
|
2418
|
-
} else {
|
|
2419
|
-
|
|
2420
|
-
var youtubePlayer = $el.find('.lg-youtube').get(0);
|
|
2421
|
-
var vimeoPlayer = $el.find('.lg-vimeo').get(0);
|
|
2422
|
-
var dailymotionPlayer = $el.find('.lg-dailymotion').get(0);
|
|
2423
|
-
var html5Player = $el.find('.lg-html5').get(0);
|
|
2424
|
-
if (youtubePlayer) {
|
|
2425
|
-
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
|
|
2426
|
-
} else if (vimeoPlayer) {
|
|
2427
|
-
try {
|
|
2428
|
-
$f(vimeoPlayer).api('play');
|
|
2429
|
-
} catch (e) {
|
|
2430
|
-
console.error('Make sure you have included froogaloop2 js');
|
|
2431
|
-
}
|
|
2432
|
-
} else if (dailymotionPlayer) {
|
|
2433
|
-
dailymotionPlayer.contentWindow.postMessage('play', '*');
|
|
2434
|
-
|
|
2435
|
-
} else if (html5Player) {
|
|
2436
|
-
if (_this.core.s.videojs) {
|
|
2437
|
-
try {
|
|
2438
|
-
videojs(html5Player).play();
|
|
2439
|
-
} catch (e) {
|
|
2440
|
-
console.error('Make sure you have included videojs');
|
|
2441
|
-
}
|
|
2442
|
-
} else {
|
|
2443
|
-
html5Player.play();
|
|
2444
|
-
}
|
|
2445
|
-
}
|
|
2446
|
-
|
|
2447
|
-
$el.addClass('lg-video-playing');
|
|
2448
|
-
|
|
2449
|
-
}
|
|
2450
|
-
}
|
|
2451
|
-
};
|
|
2452
|
-
|
|
2453
|
-
if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) {
|
|
2454
|
-
_this.core.$el.on('onSlideClick.lg.tm', function() {
|
|
2455
|
-
var $el = _this.core.$slide.eq(_this.core.index);
|
|
2456
|
-
loadOnClick($el);
|
|
2457
|
-
});
|
|
2458
|
-
} else {
|
|
2459
|
-
|
|
2460
|
-
// For IE 9 and bellow
|
|
2461
|
-
_this.core.$slide.on('click.lg', function() {
|
|
2462
|
-
loadOnClick($(this));
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
_this.core.$el.on('onBeforeSlide.lg.tm', function(event, prevIndex, index) {
|
|
2467
|
-
|
|
2468
|
-
var $videoSlide = _this.core.$slide.eq(prevIndex);
|
|
2469
|
-
var youtubePlayer = $videoSlide.find('.lg-youtube').get(0);
|
|
2470
|
-
var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0);
|
|
2471
|
-
var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0);
|
|
2472
|
-
var vkPlayer = $videoSlide.find('.lg-vk').get(0);
|
|
2473
|
-
var html5Player = $videoSlide.find('.lg-html5').get(0);
|
|
2474
|
-
if (youtubePlayer) {
|
|
2475
|
-
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
|
|
2476
|
-
} else if (vimeoPlayer) {
|
|
2477
|
-
try {
|
|
2478
|
-
$f(vimeoPlayer).api('pause');
|
|
2479
|
-
} catch (e) {
|
|
2480
|
-
console.error('Make sure you have included froogaloop2 js');
|
|
2481
|
-
}
|
|
2482
|
-
} else if (dailymotionPlayer) {
|
|
2483
|
-
dailymotionPlayer.contentWindow.postMessage('pause', '*');
|
|
2484
|
-
|
|
2485
|
-
} else if (html5Player) {
|
|
2486
|
-
if (_this.core.s.videojs) {
|
|
2487
|
-
try {
|
|
2488
|
-
videojs(html5Player).pause();
|
|
2489
|
-
} catch (e) {
|
|
2490
|
-
console.error('Make sure you have included videojs');
|
|
2491
|
-
}
|
|
2492
|
-
} else {
|
|
2493
|
-
html5Player.pause();
|
|
2494
|
-
}
|
|
2495
|
-
} if (vkPlayer) {
|
|
2496
|
-
$(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay'));
|
|
2497
|
-
}
|
|
2498
|
-
|
|
2499
|
-
var _src;
|
|
2500
|
-
if (_this.core.s.dynamic) {
|
|
2501
|
-
_src = _this.core.s.dynamicEl[index].src;
|
|
2502
|
-
} else {
|
|
2503
|
-
_src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src');
|
|
2504
|
-
|
|
2505
|
-
}
|
|
2506
|
-
|
|
2507
|
-
var _isVideo = _this.core.isVideo(_src, index) || {};
|
|
2508
|
-
if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion || _isVideo.vk) {
|
|
2509
|
-
_this.core.$outer.addClass('lg-hide-download');
|
|
2510
|
-
}
|
|
2511
|
-
|
|
2512
|
-
//$videoSlide.addClass('lg-complete');
|
|
2513
|
-
|
|
2514
|
-
});
|
|
2515
|
-
|
|
2516
|
-
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) {
|
|
2517
|
-
_this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
|
|
2518
|
-
});
|
|
2519
|
-
};
|
|
2520
|
-
|
|
2521
|
-
Video.prototype.loadVideo = function(src, addClass, noposter, index, html) {
|
|
2522
|
-
var video = '';
|
|
2523
|
-
var autoplay = 1;
|
|
2524
|
-
var a = '';
|
|
2525
|
-
var isVideo = this.core.isVideo(src, index) || {};
|
|
2526
|
-
|
|
2527
|
-
// Enable autoplay for first video if poster doesn't exist
|
|
2528
|
-
if (noposter) {
|
|
2529
|
-
if (this.videoLoaded) {
|
|
2530
|
-
autoplay = 0;
|
|
2531
|
-
} else {
|
|
2532
|
-
autoplay = 1;
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
if (isVideo.youtube) {
|
|
2537
|
-
|
|
2538
|
-
a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
|
|
2539
|
-
if (this.core.s.youtubePlayerParams) {
|
|
2540
|
-
a = a + '&' + $.param(this.core.s.youtubePlayerParams);
|
|
2541
|
-
}
|
|
2542
|
-
|
|
2543
|
-
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>';
|
|
2544
|
-
|
|
2545
|
-
} else if (isVideo.vimeo) {
|
|
2546
|
-
|
|
2547
|
-
a = '?autoplay=' + autoplay + '&api=1';
|
|
2548
|
-
if (this.core.s.vimeoPlayerParams) {
|
|
2549
|
-
a = a + '&' + $.param(this.core.s.vimeoPlayerParams);
|
|
2550
|
-
}
|
|
2551
|
-
|
|
2552
|
-
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>';
|
|
2553
|
-
|
|
2554
|
-
} else if (isVideo.dailymotion) {
|
|
2555
|
-
|
|
2556
|
-
a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
|
|
2557
|
-
if (this.core.s.dailymotionPlayerParams) {
|
|
2558
|
-
a = a + '&' + $.param(this.core.s.dailymotionPlayerParams);
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
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>';
|
|
2562
|
-
|
|
2563
|
-
} else if (isVideo.html5) {
|
|
2564
|
-
var fL = html.substring(0, 1);
|
|
2565
|
-
if (fL === '.' || fL === '#') {
|
|
2566
|
-
html = $(html).html();
|
|
2567
|
-
}
|
|
2568
|
-
|
|
2569
|
-
video = html;
|
|
2570
|
-
|
|
2571
|
-
} else if (isVideo.vk) {
|
|
2572
|
-
|
|
2573
|
-
a = '&autoplay=' + autoplay;
|
|
2574
|
-
if (this.core.s.vkPlayerParams) {
|
|
2575
|
-
a = a + '&' + $.param(this.core.s.vkPlayerParams);
|
|
2576
|
-
}
|
|
2577
|
-
|
|
2578
|
-
video = '<iframe class="lg-video-object lg-vk ' + addClass + '" width="560" height="315" src="http://vk.com/video_ext.php?' + isVideo.vk[1] + a + '" frameborder="0" allowfullscreen></iframe>';
|
|
2579
|
-
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
return video;
|
|
2583
|
-
};
|
|
2584
|
-
|
|
2585
|
-
Video.prototype.destroy = function() {
|
|
2586
|
-
this.videoLoaded = false;
|
|
2587
|
-
};
|
|
2588
|
-
|
|
2589
|
-
$.fn.lightGallery.modules.video = Video;
|
|
2590
|
-
|
|
2591
|
-
})();
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
}));
|
|
2595
|
-
|
|
2596
|
-
/*! lg-zoom - v1.1.0 - 2017-08-08
|
|
2597
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
2598
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
2599
|
-
|
|
2600
|
-
(function (root, factory) {
|
|
2601
|
-
if (typeof define === 'function' && define.amd) {
|
|
2602
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
2603
|
-
define(['jquery'], function (a0) {
|
|
2604
|
-
return (factory(a0));
|
|
2605
|
-
});
|
|
2606
|
-
} else if (typeof exports === 'object') {
|
|
2607
|
-
// Node. Does not work with strict CommonJS, but
|
|
2608
|
-
// only CommonJS-like environments that support module.exports,
|
|
2609
|
-
// like Node.
|
|
2610
|
-
module.exports = factory(require('jquery'));
|
|
2611
|
-
} else {
|
|
2612
|
-
factory(jQuery);
|
|
2613
|
-
}
|
|
2614
|
-
}(this, function ($) {
|
|
2615
|
-
|
|
2616
|
-
(function() {
|
|
2617
|
-
|
|
2618
|
-
'use strict';
|
|
2619
|
-
|
|
2620
|
-
var getUseLeft = function() {
|
|
2621
|
-
var useLeft = false;
|
|
2622
|
-
var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
|
2623
|
-
if (isChrome && parseInt(isChrome[2], 10) < 54) {
|
|
2624
|
-
useLeft = true;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
return useLeft;
|
|
2628
|
-
};
|
|
2629
|
-
|
|
2630
|
-
var defaults = {
|
|
2631
|
-
scale: 1,
|
|
2632
|
-
zoom: true,
|
|
2633
|
-
actualSize: true,
|
|
2634
|
-
enableZoomAfter: 300,
|
|
2635
|
-
useLeftForZoom: getUseLeft()
|
|
2636
|
-
};
|
|
2637
|
-
|
|
2638
|
-
var Zoom = function(element) {
|
|
2639
|
-
|
|
2640
|
-
this.core = $(element).data('lightGallery');
|
|
2641
|
-
|
|
2642
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
2643
|
-
|
|
2644
|
-
if (this.core.s.zoom && this.core.doCss()) {
|
|
2645
|
-
this.init();
|
|
2646
|
-
|
|
2647
|
-
// Store the zoomable timeout value just to clear it while closing
|
|
2648
|
-
this.zoomabletimeout = false;
|
|
2649
|
-
|
|
2650
|
-
// Set the initial value center
|
|
2651
|
-
this.pageX = $(window).width() / 2;
|
|
2652
|
-
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
|
2653
|
-
}
|
|
2654
|
-
|
|
2655
|
-
return this;
|
|
2656
|
-
};
|
|
2657
|
-
|
|
2658
|
-
Zoom.prototype.init = function() {
|
|
2659
|
-
|
|
2660
|
-
var _this = this;
|
|
2661
|
-
var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>';
|
|
2662
|
-
|
|
2663
|
-
if (_this.core.s.actualSize) {
|
|
2664
|
-
zoomIcons += '<span id="lg-actual-size" class="lg-icon"></span>';
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2667
|
-
if (_this.core.s.useLeftForZoom) {
|
|
2668
|
-
_this.core.$outer.addClass('lg-use-left-for-zoom');
|
|
2669
|
-
} else {
|
|
2670
|
-
_this.core.$outer.addClass('lg-use-transition-for-zoom');
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
this.core.$outer.find('.lg-toolbar').append(zoomIcons);
|
|
2674
|
-
|
|
2675
|
-
// Add zoomable class
|
|
2676
|
-
_this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) {
|
|
2677
|
-
|
|
2678
|
-
// delay will be 0 except first time
|
|
2679
|
-
var _speed = _this.core.s.enableZoomAfter + delay;
|
|
2680
|
-
|
|
2681
|
-
// set _speed value 0 if gallery opened from direct url and if it is first slide
|
|
2682
|
-
if ($('body').hasClass('lg-from-hash') && delay) {
|
|
2683
|
-
|
|
2684
|
-
// will execute only once
|
|
2685
|
-
_speed = 0;
|
|
2686
|
-
} else {
|
|
2687
|
-
|
|
2688
|
-
// Remove lg-from-hash to enable starting animation.
|
|
2689
|
-
$('body').removeClass('lg-from-hash');
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
_this.zoomabletimeout = setTimeout(function() {
|
|
2693
|
-
_this.core.$slide.eq(index).addClass('lg-zoomable');
|
|
2694
|
-
}, _speed + 30);
|
|
2695
|
-
});
|
|
2696
|
-
|
|
2697
|
-
var scale = 1;
|
|
2698
|
-
/**
|
|
2699
|
-
* @desc Image zoom
|
|
2700
|
-
* Translate the wrap and scale the image to get better user experience
|
|
2701
|
-
*
|
|
2702
|
-
* @param {String} scaleVal - Zoom decrement/increment value
|
|
2703
|
-
*/
|
|
2704
|
-
var zoom = function(scaleVal) {
|
|
2705
|
-
|
|
2706
|
-
var $image = _this.core.$outer.find('.lg-current .lg-image');
|
|
2707
|
-
var _x;
|
|
2708
|
-
var _y;
|
|
2709
|
-
|
|
2710
|
-
// Find offset manually to avoid issue after zoom
|
|
2711
|
-
var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2;
|
|
2712
|
-
var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop();
|
|
2713
|
-
|
|
2714
|
-
_x = _this.pageX - offsetX;
|
|
2715
|
-
_y = _this.pageY - offsetY;
|
|
2716
|
-
|
|
2717
|
-
var x = (scaleVal - 1) * (_x);
|
|
2718
|
-
var y = (scaleVal - 1) * (_y);
|
|
2719
|
-
|
|
2720
|
-
$image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
|
|
2721
|
-
|
|
2722
|
-
if (_this.core.s.useLeftForZoom) {
|
|
2723
|
-
$image.parent().css({
|
|
2724
|
-
left: -x + 'px',
|
|
2725
|
-
top: -y + 'px'
|
|
2726
|
-
}).attr('data-x', x).attr('data-y', y);
|
|
2727
|
-
} else {
|
|
2728
|
-
$image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y);
|
|
2729
|
-
}
|
|
2730
|
-
};
|
|
2731
|
-
|
|
2732
|
-
var callScale = function() {
|
|
2733
|
-
if (scale > 1) {
|
|
2734
|
-
_this.core.$outer.addClass('lg-zoomed');
|
|
2735
|
-
} else {
|
|
2736
|
-
_this.resetZoom();
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
if (scale < 1) {
|
|
2740
|
-
scale = 1;
|
|
2741
|
-
}
|
|
2742
|
-
|
|
2743
|
-
zoom(scale);
|
|
2744
|
-
};
|
|
2745
|
-
|
|
2746
|
-
var actualSize = function(event, $image, index, fromIcon) {
|
|
2747
|
-
var w = $image.prop('offsetWidth');
|
|
2748
|
-
var nw;
|
|
2749
|
-
if (_this.core.s.dynamic) {
|
|
2750
|
-
nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w;
|
|
2751
|
-
} else {
|
|
2752
|
-
nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w;
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
var _scale;
|
|
2756
|
-
|
|
2757
|
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
|
2758
|
-
scale = 1;
|
|
2759
|
-
} else {
|
|
2760
|
-
if (nw > w) {
|
|
2761
|
-
_scale = nw / w;
|
|
2762
|
-
scale = _scale || 2;
|
|
2763
|
-
}
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
if (fromIcon) {
|
|
2767
|
-
_this.pageX = $(window).width() / 2;
|
|
2768
|
-
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
|
2769
|
-
} else {
|
|
2770
|
-
_this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX;
|
|
2771
|
-
_this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY;
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
|
-
callScale();
|
|
2775
|
-
setTimeout(function() {
|
|
2776
|
-
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
2777
|
-
}, 10);
|
|
2778
|
-
};
|
|
2779
|
-
|
|
2780
|
-
var tapped = false;
|
|
2781
|
-
|
|
2782
|
-
// event triggered after appending slide content
|
|
2783
|
-
_this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) {
|
|
2784
|
-
|
|
2785
|
-
// Get the current element
|
|
2786
|
-
var $image = _this.core.$slide.eq(index).find('.lg-image');
|
|
2787
|
-
|
|
2788
|
-
$image.on('dblclick', function(event) {
|
|
2789
|
-
actualSize(event, $image, index);
|
|
2790
|
-
});
|
|
2791
|
-
|
|
2792
|
-
$image.on('touchstart', function(event) {
|
|
2793
|
-
if (!tapped) {
|
|
2794
|
-
tapped = setTimeout(function() {
|
|
2795
|
-
tapped = null;
|
|
2796
|
-
}, 300);
|
|
2797
|
-
} else {
|
|
2798
|
-
clearTimeout(tapped);
|
|
2799
|
-
tapped = null;
|
|
2800
|
-
actualSize(event, $image, index);
|
|
2801
|
-
}
|
|
2802
|
-
|
|
2803
|
-
event.preventDefault();
|
|
2804
|
-
});
|
|
2805
|
-
|
|
2806
|
-
});
|
|
2807
|
-
|
|
2808
|
-
// Update zoom on resize and orientationchange
|
|
2809
|
-
$(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() {
|
|
2810
|
-
_this.pageX = $(window).width() / 2;
|
|
2811
|
-
_this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
|
2812
|
-
zoom(scale);
|
|
2813
|
-
});
|
|
2814
|
-
|
|
2815
|
-
$('#lg-zoom-out').on('click.lg', function() {
|
|
2816
|
-
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
|
2817
|
-
scale -= _this.core.s.scale;
|
|
2818
|
-
callScale();
|
|
2819
|
-
}
|
|
2820
|
-
});
|
|
2821
|
-
|
|
2822
|
-
$('#lg-zoom-in').on('click.lg', function() {
|
|
2823
|
-
if (_this.core.$outer.find('.lg-current .lg-image').length) {
|
|
2824
|
-
scale += _this.core.s.scale;
|
|
2825
|
-
callScale();
|
|
2826
|
-
}
|
|
2827
|
-
});
|
|
2828
|
-
|
|
2829
|
-
$('#lg-actual-size').on('click.lg', function(event) {
|
|
2830
|
-
actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true);
|
|
2831
|
-
});
|
|
2832
|
-
|
|
2833
|
-
// Reset zoom on slide change
|
|
2834
|
-
_this.core.$el.on('onBeforeSlide.lg.tm', function() {
|
|
2835
|
-
scale = 1;
|
|
2836
|
-
_this.resetZoom();
|
|
2837
|
-
});
|
|
2838
|
-
|
|
2839
|
-
// Drag option after zoom
|
|
2840
|
-
_this.zoomDrag();
|
|
2841
|
-
|
|
2842
|
-
_this.zoomSwipe();
|
|
2843
|
-
|
|
2844
|
-
};
|
|
2845
|
-
|
|
2846
|
-
// Reset zoom effect
|
|
2847
|
-
Zoom.prototype.resetZoom = function() {
|
|
2848
|
-
this.core.$outer.removeClass('lg-zoomed');
|
|
2849
|
-
this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y');
|
|
2850
|
-
this.core.$slide.find('.lg-image').removeAttr('style data-scale');
|
|
2851
|
-
|
|
2852
|
-
// Reset pagx pagy values to center
|
|
2853
|
-
this.pageX = $(window).width() / 2;
|
|
2854
|
-
this.pageY = ($(window).height() / 2) + $(window).scrollTop();
|
|
2855
|
-
};
|
|
2856
|
-
|
|
2857
|
-
Zoom.prototype.zoomSwipe = function() {
|
|
2858
|
-
var _this = this;
|
|
2859
|
-
var startCoords = {};
|
|
2860
|
-
var endCoords = {};
|
|
2861
|
-
var isMoved = false;
|
|
2862
|
-
|
|
2863
|
-
// Allow x direction drag
|
|
2864
|
-
var allowX = false;
|
|
2865
|
-
|
|
2866
|
-
// Allow Y direction drag
|
|
2867
|
-
var allowY = false;
|
|
2868
|
-
|
|
2869
|
-
_this.core.$slide.on('touchstart.lg', function(e) {
|
|
2870
|
-
|
|
2871
|
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
|
2872
|
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
|
2873
|
-
|
|
2874
|
-
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
|
2875
|
-
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
|
2876
|
-
if ((allowX || allowY)) {
|
|
2877
|
-
e.preventDefault();
|
|
2878
|
-
startCoords = {
|
|
2879
|
-
x: e.originalEvent.targetTouches[0].pageX,
|
|
2880
|
-
y: e.originalEvent.targetTouches[0].pageY
|
|
2881
|
-
};
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
|
-
});
|
|
2886
|
-
|
|
2887
|
-
_this.core.$slide.on('touchmove.lg', function(e) {
|
|
2888
|
-
|
|
2889
|
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
|
2890
|
-
|
|
2891
|
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
|
2892
|
-
var distanceX;
|
|
2893
|
-
var distanceY;
|
|
2894
|
-
|
|
2895
|
-
e.preventDefault();
|
|
2896
|
-
isMoved = true;
|
|
2897
|
-
|
|
2898
|
-
endCoords = {
|
|
2899
|
-
x: e.originalEvent.targetTouches[0].pageX,
|
|
2900
|
-
y: e.originalEvent.targetTouches[0].pageY
|
|
2901
|
-
};
|
|
2902
|
-
|
|
2903
|
-
// reset opacity and transition duration
|
|
2904
|
-
_this.core.$outer.addClass('lg-zoom-dragging');
|
|
2905
|
-
|
|
2906
|
-
if (allowY) {
|
|
2907
|
-
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
|
2908
|
-
} else {
|
|
2909
|
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
|
2910
|
-
}
|
|
2911
|
-
|
|
2912
|
-
if (allowX) {
|
|
2913
|
-
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
|
2914
|
-
} else {
|
|
2915
|
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
|
2916
|
-
}
|
|
2917
|
-
|
|
2918
|
-
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
|
2919
|
-
|
|
2920
|
-
if (_this.core.s.useLeftForZoom) {
|
|
2921
|
-
_$el.css({
|
|
2922
|
-
left: distanceX + 'px',
|
|
2923
|
-
top: distanceY + 'px'
|
|
2924
|
-
});
|
|
2925
|
-
} else {
|
|
2926
|
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
|
2927
|
-
}
|
|
2928
|
-
}
|
|
2929
|
-
|
|
2930
|
-
}
|
|
2931
|
-
|
|
2932
|
-
});
|
|
2933
|
-
|
|
2934
|
-
_this.core.$slide.on('touchend.lg', function() {
|
|
2935
|
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
|
2936
|
-
if (isMoved) {
|
|
2937
|
-
isMoved = false;
|
|
2938
|
-
_this.core.$outer.removeClass('lg-zoom-dragging');
|
|
2939
|
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
|
2940
|
-
|
|
2941
|
-
}
|
|
2942
|
-
}
|
|
2943
|
-
});
|
|
2944
|
-
|
|
2945
|
-
};
|
|
2946
|
-
|
|
2947
|
-
Zoom.prototype.zoomDrag = function() {
|
|
2948
|
-
|
|
2949
|
-
var _this = this;
|
|
2950
|
-
var startCoords = {};
|
|
2951
|
-
var endCoords = {};
|
|
2952
|
-
var isDraging = false;
|
|
2953
|
-
var isMoved = false;
|
|
2954
|
-
|
|
2955
|
-
// Allow x direction drag
|
|
2956
|
-
var allowX = false;
|
|
2957
|
-
|
|
2958
|
-
// Allow Y direction drag
|
|
2959
|
-
var allowY = false;
|
|
2960
|
-
|
|
2961
|
-
_this.core.$slide.on('mousedown.lg.zoom', function(e) {
|
|
2962
|
-
|
|
2963
|
-
// execute only on .lg-object
|
|
2964
|
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
|
2965
|
-
|
|
2966
|
-
allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height();
|
|
2967
|
-
allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width();
|
|
2968
|
-
|
|
2969
|
-
if (_this.core.$outer.hasClass('lg-zoomed')) {
|
|
2970
|
-
if ($(e.target).hasClass('lg-object') && (allowX || allowY)) {
|
|
2971
|
-
e.preventDefault();
|
|
2972
|
-
startCoords = {
|
|
2973
|
-
x: e.pageX,
|
|
2974
|
-
y: e.pageY
|
|
2975
|
-
};
|
|
2976
|
-
|
|
2977
|
-
isDraging = true;
|
|
2978
|
-
|
|
2979
|
-
// ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723
|
|
2980
|
-
_this.core.$outer.scrollLeft += 1;
|
|
2981
|
-
_this.core.$outer.scrollLeft -= 1;
|
|
2982
|
-
|
|
2983
|
-
_this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing');
|
|
2984
|
-
}
|
|
2985
|
-
}
|
|
2986
|
-
});
|
|
2987
|
-
|
|
2988
|
-
$(window).on('mousemove.lg.zoom', function(e) {
|
|
2989
|
-
if (isDraging) {
|
|
2990
|
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
|
2991
|
-
var distanceX;
|
|
2992
|
-
var distanceY;
|
|
2993
|
-
|
|
2994
|
-
isMoved = true;
|
|
2995
|
-
endCoords = {
|
|
2996
|
-
x: e.pageX,
|
|
2997
|
-
y: e.pageY
|
|
2998
|
-
};
|
|
2999
|
-
|
|
3000
|
-
// reset opacity and transition duration
|
|
3001
|
-
_this.core.$outer.addClass('lg-zoom-dragging');
|
|
3002
|
-
|
|
3003
|
-
if (allowY) {
|
|
3004
|
-
distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
|
3005
|
-
} else {
|
|
3006
|
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
|
3007
|
-
}
|
|
3008
|
-
|
|
3009
|
-
if (allowX) {
|
|
3010
|
-
distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
|
3011
|
-
} else {
|
|
3012
|
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
if (_this.core.s.useLeftForZoom) {
|
|
3016
|
-
_$el.css({
|
|
3017
|
-
left: distanceX + 'px',
|
|
3018
|
-
top: distanceY + 'px'
|
|
3019
|
-
});
|
|
3020
|
-
} else {
|
|
3021
|
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
|
3022
|
-
}
|
|
3023
|
-
}
|
|
3024
|
-
});
|
|
3025
|
-
|
|
3026
|
-
$(window).on('mouseup.lg.zoom', function(e) {
|
|
3027
|
-
|
|
3028
|
-
if (isDraging) {
|
|
3029
|
-
isDraging = false;
|
|
3030
|
-
_this.core.$outer.removeClass('lg-zoom-dragging');
|
|
3031
|
-
|
|
3032
|
-
// Fix for chrome mouse move on click
|
|
3033
|
-
if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
|
|
3034
|
-
endCoords = {
|
|
3035
|
-
x: e.pageX,
|
|
3036
|
-
y: e.pageY
|
|
3037
|
-
};
|
|
3038
|
-
_this.touchendZoom(startCoords, endCoords, allowX, allowY);
|
|
3039
|
-
|
|
3040
|
-
}
|
|
3041
|
-
|
|
3042
|
-
isMoved = false;
|
|
3043
|
-
}
|
|
3044
|
-
|
|
3045
|
-
_this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab');
|
|
3046
|
-
|
|
3047
|
-
});
|
|
3048
|
-
};
|
|
3049
|
-
|
|
3050
|
-
Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) {
|
|
3051
|
-
|
|
3052
|
-
var _this = this;
|
|
3053
|
-
var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap');
|
|
3054
|
-
var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object');
|
|
3055
|
-
var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x);
|
|
3056
|
-
var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y);
|
|
3057
|
-
var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2;
|
|
3058
|
-
var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY);
|
|
3059
|
-
var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2;
|
|
3060
|
-
var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX);
|
|
3061
|
-
|
|
3062
|
-
if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
|
|
3063
|
-
if (allowY) {
|
|
3064
|
-
if (distanceY <= -maxY) {
|
|
3065
|
-
distanceY = -maxY;
|
|
3066
|
-
} else if (distanceY >= -minY) {
|
|
3067
|
-
distanceY = -minY;
|
|
3068
|
-
}
|
|
3069
|
-
}
|
|
3070
|
-
|
|
3071
|
-
if (allowX) {
|
|
3072
|
-
if (distanceX <= -maxX) {
|
|
3073
|
-
distanceX = -maxX;
|
|
3074
|
-
} else if (distanceX >= -minX) {
|
|
3075
|
-
distanceX = -minX;
|
|
3076
|
-
}
|
|
3077
|
-
}
|
|
3078
|
-
|
|
3079
|
-
if (allowY) {
|
|
3080
|
-
_$el.attr('data-y', Math.abs(distanceY));
|
|
3081
|
-
} else {
|
|
3082
|
-
distanceY = -Math.abs(_$el.attr('data-y'));
|
|
3083
|
-
}
|
|
3084
|
-
|
|
3085
|
-
if (allowX) {
|
|
3086
|
-
_$el.attr('data-x', Math.abs(distanceX));
|
|
3087
|
-
} else {
|
|
3088
|
-
distanceX = -Math.abs(_$el.attr('data-x'));
|
|
3089
|
-
}
|
|
3090
|
-
|
|
3091
|
-
if (_this.core.s.useLeftForZoom) {
|
|
3092
|
-
_$el.css({
|
|
3093
|
-
left: distanceX + 'px',
|
|
3094
|
-
top: distanceY + 'px'
|
|
3095
|
-
});
|
|
3096
|
-
} else {
|
|
3097
|
-
_$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)');
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
|
-
}
|
|
3101
|
-
};
|
|
3102
|
-
|
|
3103
|
-
Zoom.prototype.destroy = function() {
|
|
3104
|
-
|
|
3105
|
-
var _this = this;
|
|
3106
|
-
|
|
3107
|
-
// Unbind all events added by lightGallery zoom plugin
|
|
3108
|
-
_this.core.$el.off('.lg.zoom');
|
|
3109
|
-
$(window).off('.lg.zoom');
|
|
3110
|
-
_this.core.$slide.off('.lg.zoom');
|
|
3111
|
-
_this.core.$el.off('.lg.tm.zoom');
|
|
3112
|
-
_this.resetZoom();
|
|
3113
|
-
clearTimeout(_this.zoomabletimeout);
|
|
3114
|
-
_this.zoomabletimeout = false;
|
|
3115
|
-
};
|
|
3116
|
-
|
|
3117
|
-
$.fn.lightGallery.modules.zoom = Zoom;
|
|
3118
|
-
|
|
3119
|
-
})();
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
}));
|
|
3123
|
-
|
|
3124
|
-
/*! lg-hash - v1.0.2 - 2017-06-03
|
|
3125
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
3126
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
3127
|
-
|
|
3128
|
-
(function (root, factory) {
|
|
3129
|
-
if (typeof define === 'function' && define.amd) {
|
|
3130
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
3131
|
-
define(['jquery'], function (a0) {
|
|
3132
|
-
return (factory(a0));
|
|
3133
|
-
});
|
|
3134
|
-
} else if (typeof exports === 'object') {
|
|
3135
|
-
// Node. Does not work with strict CommonJS, but
|
|
3136
|
-
// only CommonJS-like environments that support module.exports,
|
|
3137
|
-
// like Node.
|
|
3138
|
-
module.exports = factory(require('jquery'));
|
|
3139
|
-
} else {
|
|
3140
|
-
factory(jQuery);
|
|
3141
|
-
}
|
|
3142
|
-
}(this, function ($) {
|
|
3143
|
-
|
|
3144
|
-
(function() {
|
|
3145
|
-
|
|
3146
|
-
'use strict';
|
|
3147
|
-
|
|
3148
|
-
var defaults = {
|
|
3149
|
-
hash: true
|
|
3150
|
-
};
|
|
3151
|
-
|
|
3152
|
-
var Hash = function(element) {
|
|
3153
|
-
|
|
3154
|
-
this.core = $(element).data('lightGallery');
|
|
3155
|
-
|
|
3156
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
3157
|
-
|
|
3158
|
-
if (this.core.s.hash) {
|
|
3159
|
-
this.oldHash = window.location.hash;
|
|
3160
|
-
this.init();
|
|
3161
|
-
}
|
|
3162
|
-
|
|
3163
|
-
return this;
|
|
3164
|
-
};
|
|
3165
|
-
|
|
3166
|
-
Hash.prototype.init = function() {
|
|
3167
|
-
var _this = this;
|
|
3168
|
-
var _hash;
|
|
3169
|
-
|
|
3170
|
-
// Change hash value on after each slide transition
|
|
3171
|
-
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
|
3172
|
-
if (history.replaceState) {
|
|
3173
|
-
history.replaceState(null, null, '#lg=' + _this.core.s.galleryId + '&slide=' + index);
|
|
3174
|
-
} else {
|
|
3175
|
-
window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index;
|
|
3176
|
-
}
|
|
3177
|
-
});
|
|
3178
|
-
|
|
3179
|
-
// Listen hash change and change the slide according to slide value
|
|
3180
|
-
$(window).on('hashchange.lg.hash', function() {
|
|
3181
|
-
_hash = window.location.hash;
|
|
3182
|
-
var _idx = parseInt(_hash.split('&slide=')[1], 10);
|
|
3183
|
-
|
|
3184
|
-
// it galleryId doesn't exist in the url close the gallery
|
|
3185
|
-
if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) {
|
|
3186
|
-
_this.core.slide(_idx, false, false);
|
|
3187
|
-
} else if (_this.core.lGalleryOn) {
|
|
3188
|
-
_this.core.destroy();
|
|
3189
|
-
}
|
|
3190
|
-
|
|
3191
|
-
});
|
|
3192
|
-
};
|
|
3193
|
-
|
|
3194
|
-
Hash.prototype.destroy = function() {
|
|
3195
|
-
|
|
3196
|
-
if (!this.core.s.hash) {
|
|
3197
|
-
return;
|
|
3198
|
-
}
|
|
3199
|
-
|
|
3200
|
-
// Reset to old hash value
|
|
3201
|
-
if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) {
|
|
3202
|
-
if (history.replaceState) {
|
|
3203
|
-
history.replaceState(null, null, this.oldHash);
|
|
3204
|
-
} else {
|
|
3205
|
-
window.location.hash = this.oldHash;
|
|
3206
|
-
}
|
|
3207
|
-
} else {
|
|
3208
|
-
if (history.replaceState) {
|
|
3209
|
-
history.replaceState(null, document.title, window.location.pathname + window.location.search);
|
|
3210
|
-
} else {
|
|
3211
|
-
window.location.hash = '';
|
|
3212
|
-
}
|
|
3213
|
-
}
|
|
3214
|
-
|
|
3215
|
-
this.core.$el.off('.lg.hash');
|
|
3216
|
-
|
|
3217
|
-
};
|
|
3218
|
-
|
|
3219
|
-
$.fn.lightGallery.modules.hash = Hash;
|
|
3220
|
-
|
|
3221
|
-
})();
|
|
3222
|
-
|
|
3223
|
-
}));
|
|
3224
|
-
|
|
3225
|
-
/*! lg-share - v1.1.0 - 2017-10-03
|
|
3226
|
-
* http://sachinchoolur.github.io/lightGallery
|
|
3227
|
-
* Copyright (c) 2017 Sachin N; Licensed GPLv3 */
|
|
3228
|
-
|
|
3229
|
-
(function (root, factory) {
|
|
3230
|
-
if (typeof define === 'function' && define.amd) {
|
|
3231
|
-
// AMD. Register as an anonymous module unless amdModuleId is set
|
|
3232
|
-
define(['jquery'], function (a0) {
|
|
3233
|
-
return (factory(a0));
|
|
3234
|
-
});
|
|
3235
|
-
} else if (typeof exports === 'object') {
|
|
3236
|
-
// Node. Does not work with strict CommonJS, but
|
|
3237
|
-
// only CommonJS-like environments that support module.exports,
|
|
3238
|
-
// like Node.
|
|
3239
|
-
module.exports = factory(require('jquery'));
|
|
3240
|
-
} else {
|
|
3241
|
-
factory(jQuery);
|
|
3242
|
-
}
|
|
3243
|
-
}(this, function ($) {
|
|
3244
|
-
|
|
3245
|
-
(function() {
|
|
3246
|
-
|
|
3247
|
-
'use strict';
|
|
3248
|
-
|
|
3249
|
-
var defaults = {
|
|
3250
|
-
share: true,
|
|
3251
|
-
facebook: true,
|
|
3252
|
-
facebookDropdownText: 'Facebook',
|
|
3253
|
-
twitter: true,
|
|
3254
|
-
twitterDropdownText: 'Twitter',
|
|
3255
|
-
googlePlus: true,
|
|
3256
|
-
googlePlusDropdownText: 'GooglePlus',
|
|
3257
|
-
pinterest: true,
|
|
3258
|
-
pinterestDropdownText: 'Pinterest'
|
|
3259
|
-
};
|
|
3260
|
-
|
|
3261
|
-
var Share = function(element) {
|
|
3262
|
-
|
|
3263
|
-
this.core = $(element).data('lightGallery');
|
|
3264
|
-
|
|
3265
|
-
this.core.s = $.extend({}, defaults, this.core.s);
|
|
3266
|
-
if (this.core.s.share) {
|
|
3267
|
-
this.init();
|
|
3268
|
-
}
|
|
3269
|
-
|
|
3270
|
-
return this;
|
|
3271
|
-
};
|
|
3272
|
-
|
|
3273
|
-
Share.prototype.init = function() {
|
|
3274
|
-
var _this = this;
|
|
3275
|
-
var shareHtml = '<span id="lg-share" class="lg-icon">' +
|
|
3276
|
-
'<ul class="lg-dropdown" style="position: absolute;">';
|
|
3277
|
-
shareHtml += _this.core.s.facebook ? '<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.facebookDropdownText + '</span></a></li>' : '';
|
|
3278
|
-
shareHtml += _this.core.s.twitter ? '<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.twitterDropdownText + '</span></a></li>' : '';
|
|
3279
|
-
shareHtml += _this.core.s.googlePlus ? '<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.googlePlusDropdownText + '</span></a></li>' : '';
|
|
3280
|
-
shareHtml += _this.core.s.pinterest ? '<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.pinterestDropdownText + '</span></a></li>' : '';
|
|
3281
|
-
shareHtml += '</ul></span>';
|
|
3282
|
-
|
|
3283
|
-
this.core.$outer.find('.lg-toolbar').append(shareHtml);
|
|
3284
|
-
this.core.$outer.find('.lg').append('<div id="lg-dropdown-overlay"></div>');
|
|
3285
|
-
$('#lg-share').on('click.lg', function(){
|
|
3286
|
-
_this.core.$outer.toggleClass('lg-dropdown-active');
|
|
3287
|
-
});
|
|
3288
|
-
|
|
3289
|
-
$('#lg-dropdown-overlay').on('click.lg', function(){
|
|
3290
|
-
_this.core.$outer.removeClass('lg-dropdown-active');
|
|
3291
|
-
});
|
|
3292
|
-
|
|
3293
|
-
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) {
|
|
3294
|
-
|
|
3295
|
-
setTimeout(function() {
|
|
3296
|
-
|
|
3297
|
-
$('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.getSahreProps(index, 'facebookShareUrl') || window.location.href)));
|
|
3298
|
-
|
|
3299
|
-
$('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href)));
|
|
3300
|
-
|
|
3301
|
-
$('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href)));
|
|
3302
|
-
|
|
3303
|
-
$('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText'));
|
|
3304
|
-
|
|
3305
|
-
}, 100);
|
|
3306
|
-
});
|
|
3307
|
-
};
|
|
3308
|
-
|
|
3309
|
-
Share.prototype.getSahreProps = function(index, prop){
|
|
3310
|
-
var shareProp = '';
|
|
3311
|
-
if(this.core.s.dynamic) {
|
|
3312
|
-
shareProp = this.core.s.dynamicEl[index][prop];
|
|
3313
|
-
} else {
|
|
3314
|
-
var _href = this.core.$items.eq(index).attr('href');
|
|
3315
|
-
var _prop = this.core.$items.eq(index).data(prop);
|
|
3316
|
-
shareProp = prop === 'src' ? _href || _prop : _prop;
|
|
3317
|
-
}
|
|
3318
|
-
return shareProp;
|
|
3319
|
-
};
|
|
3320
|
-
|
|
3321
|
-
Share.prototype.destroy = function() {
|
|
3322
|
-
|
|
3323
|
-
};
|
|
3324
|
-
|
|
3325
|
-
$.fn.lightGallery.modules.share = Share;
|
|
3326
|
-
|
|
3327
|
-
})();
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
}));
|