Update all assets
This commit is contained in:
@@ -1,86 +1,86 @@
|
||||
/*
|
||||
* blueimp Gallery Fullscreen JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// Defines if the gallery should open in fullscreen mode:
|
||||
fullscreen: false
|
||||
})
|
||||
|
||||
var initialize = galleryPrototype.initialize
|
||||
var close = galleryPrototype.close
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
getFullScreenElement: function () {
|
||||
return (
|
||||
document.fullscreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.msFullscreenElement
|
||||
)
|
||||
},
|
||||
|
||||
requestFullScreen: function (element) {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullscreen) {
|
||||
element.webkitRequestFullscreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
},
|
||||
|
||||
exitFullScreen: function () {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen()
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen()
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen()
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen()
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
initialize.call(this)
|
||||
if (this.options.fullscreen && !this.getFullScreenElement()) {
|
||||
this.requestFullScreen(this.container[0])
|
||||
}
|
||||
},
|
||||
|
||||
close: function () {
|
||||
if (this.getFullScreenElement() === this.container[0]) {
|
||||
this.exitFullScreen()
|
||||
}
|
||||
close.call(this)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery Fullscreen JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// Defines if the gallery should open in fullscreen mode:
|
||||
fullscreen: false
|
||||
})
|
||||
|
||||
var initialize = galleryPrototype.initialize
|
||||
var close = galleryPrototype.close
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
getFullScreenElement: function () {
|
||||
return (
|
||||
document.fullscreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.msFullscreenElement
|
||||
)
|
||||
},
|
||||
|
||||
requestFullScreen: function (element) {
|
||||
if (element.requestFullscreen) {
|
||||
element.requestFullscreen()
|
||||
} else if (element.webkitRequestFullscreen) {
|
||||
element.webkitRequestFullscreen()
|
||||
} else if (element.mozRequestFullScreen) {
|
||||
element.mozRequestFullScreen()
|
||||
} else if (element.msRequestFullscreen) {
|
||||
element.msRequestFullscreen()
|
||||
}
|
||||
},
|
||||
|
||||
exitFullScreen: function () {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen()
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen()
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen()
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen()
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
initialize.call(this)
|
||||
if (this.options.fullscreen && !this.getFullScreenElement()) {
|
||||
this.requestFullScreen(this.container[0])
|
||||
}
|
||||
},
|
||||
|
||||
close: function () {
|
||||
if (this.getFullScreenElement() === this.container[0]) {
|
||||
this.exitFullScreen()
|
||||
}
|
||||
close.call(this)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
|
||||
@@ -1,148 +1,148 @@
|
||||
/*
|
||||
* blueimp Gallery Indicator JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The tag name, Id, element or querySelector of the indicator container:
|
||||
indicatorContainer: 'ol',
|
||||
// The class for the active indicator:
|
||||
activeIndicatorClass: 'active',
|
||||
// The list object property (or data attribute) with the thumbnail URL,
|
||||
// used as alternative to a thumbnail child element:
|
||||
thumbnailProperty: 'thumbnail',
|
||||
// Defines if the gallery indicators should display a thumbnail:
|
||||
thumbnailIndicators: true
|
||||
})
|
||||
|
||||
var initSlides = galleryPrototype.initSlides
|
||||
var addSlide = galleryPrototype.addSlide
|
||||
var resetSlides = galleryPrototype.resetSlides
|
||||
var handleClick = galleryPrototype.handleClick
|
||||
var handleSlide = galleryPrototype.handleSlide
|
||||
var handleClose = galleryPrototype.handleClose
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
createIndicator: function (obj) {
|
||||
var indicator = this.indicatorPrototype.cloneNode(false)
|
||||
var title = this.getItemProperty(obj, this.options.titleProperty)
|
||||
var thumbnailProperty = this.options.thumbnailProperty
|
||||
var thumbnailUrl
|
||||
var thumbnail
|
||||
if (this.options.thumbnailIndicators) {
|
||||
if (thumbnailProperty) {
|
||||
thumbnailUrl = this.getItemProperty(obj, thumbnailProperty)
|
||||
}
|
||||
if (thumbnailUrl === undefined) {
|
||||
thumbnail = obj.getElementsByTagName && $(obj).find('img')[0]
|
||||
if (thumbnail) {
|
||||
thumbnailUrl = thumbnail.src
|
||||
}
|
||||
}
|
||||
if (thumbnailUrl) {
|
||||
indicator.style.backgroundImage = 'url("' + thumbnailUrl + '")'
|
||||
}
|
||||
}
|
||||
if (title) {
|
||||
indicator.title = title
|
||||
}
|
||||
indicator.setAttribute('role', 'link')
|
||||
return indicator
|
||||
},
|
||||
|
||||
addIndicator: function (index) {
|
||||
if (this.indicatorContainer.length) {
|
||||
var indicator = this.createIndicator(this.list[index])
|
||||
indicator.setAttribute('data-index', index)
|
||||
this.indicatorContainer[0].appendChild(indicator)
|
||||
this.indicators.push(indicator)
|
||||
}
|
||||
},
|
||||
|
||||
setActiveIndicator: function (index) {
|
||||
if (this.indicators) {
|
||||
if (this.activeIndicator) {
|
||||
this.activeIndicator.removeClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
this.activeIndicator = $(this.indicators[index])
|
||||
this.activeIndicator.addClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
},
|
||||
|
||||
initSlides: function (reload) {
|
||||
if (!reload) {
|
||||
this.indicatorContainer = this.container.find(
|
||||
this.options.indicatorContainer
|
||||
)
|
||||
if (this.indicatorContainer.length) {
|
||||
this.indicatorPrototype = document.createElement('li')
|
||||
this.indicators = this.indicatorContainer[0].children
|
||||
}
|
||||
}
|
||||
initSlides.call(this, reload)
|
||||
},
|
||||
|
||||
addSlide: function (index) {
|
||||
addSlide.call(this, index)
|
||||
this.addIndicator(index)
|
||||
},
|
||||
|
||||
resetSlides: function () {
|
||||
resetSlides.call(this)
|
||||
this.indicatorContainer.empty()
|
||||
this.indicators = []
|
||||
},
|
||||
|
||||
handleClick: function (event) {
|
||||
var target = event.target || event.srcElement
|
||||
var parent = target.parentNode
|
||||
if (parent === this.indicatorContainer[0]) {
|
||||
// Click on indicator element
|
||||
this.preventDefault(event)
|
||||
this.slide(this.getNodeIndex(target))
|
||||
} else if (parent.parentNode === this.indicatorContainer[0]) {
|
||||
// Click on indicator child element
|
||||
this.preventDefault(event)
|
||||
this.slide(this.getNodeIndex(parent))
|
||||
} else {
|
||||
return handleClick.call(this, event)
|
||||
}
|
||||
},
|
||||
|
||||
handleSlide: function (oldIndex, newIndex) {
|
||||
handleSlide.call(this, oldIndex, newIndex)
|
||||
this.setActiveIndicator(newIndex)
|
||||
},
|
||||
|
||||
handleClose: function () {
|
||||
if (this.activeIndicator) {
|
||||
this.activeIndicator.removeClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
handleClose.call(this)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery Indicator JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The tag name, Id, element or querySelector of the indicator container:
|
||||
indicatorContainer: 'ol',
|
||||
// The class for the active indicator:
|
||||
activeIndicatorClass: 'active',
|
||||
// The list object property (or data attribute) with the thumbnail URL,
|
||||
// used as alternative to a thumbnail child element:
|
||||
thumbnailProperty: 'thumbnail',
|
||||
// Defines if the gallery indicators should display a thumbnail:
|
||||
thumbnailIndicators: true
|
||||
})
|
||||
|
||||
var initSlides = galleryPrototype.initSlides
|
||||
var addSlide = galleryPrototype.addSlide
|
||||
var resetSlides = galleryPrototype.resetSlides
|
||||
var handleClick = galleryPrototype.handleClick
|
||||
var handleSlide = galleryPrototype.handleSlide
|
||||
var handleClose = galleryPrototype.handleClose
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
createIndicator: function (obj) {
|
||||
var indicator = this.indicatorPrototype.cloneNode(false)
|
||||
var title = this.getItemProperty(obj, this.options.titleProperty)
|
||||
var thumbnailProperty = this.options.thumbnailProperty
|
||||
var thumbnailUrl
|
||||
var thumbnail
|
||||
if (this.options.thumbnailIndicators) {
|
||||
if (thumbnailProperty) {
|
||||
thumbnailUrl = this.getItemProperty(obj, thumbnailProperty)
|
||||
}
|
||||
if (thumbnailUrl === undefined) {
|
||||
thumbnail = obj.getElementsByTagName && $(obj).find('img')[0]
|
||||
if (thumbnail) {
|
||||
thumbnailUrl = thumbnail.src
|
||||
}
|
||||
}
|
||||
if (thumbnailUrl) {
|
||||
indicator.style.backgroundImage = 'url("' + thumbnailUrl + '")'
|
||||
}
|
||||
}
|
||||
if (title) {
|
||||
indicator.title = title
|
||||
}
|
||||
indicator.setAttribute('role', 'link')
|
||||
return indicator
|
||||
},
|
||||
|
||||
addIndicator: function (index) {
|
||||
if (this.indicatorContainer.length) {
|
||||
var indicator = this.createIndicator(this.list[index])
|
||||
indicator.setAttribute('data-index', index)
|
||||
this.indicatorContainer[0].appendChild(indicator)
|
||||
this.indicators.push(indicator)
|
||||
}
|
||||
},
|
||||
|
||||
setActiveIndicator: function (index) {
|
||||
if (this.indicators) {
|
||||
if (this.activeIndicator) {
|
||||
this.activeIndicator.removeClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
this.activeIndicator = $(this.indicators[index])
|
||||
this.activeIndicator.addClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
},
|
||||
|
||||
initSlides: function (reload) {
|
||||
if (!reload) {
|
||||
this.indicatorContainer = this.container.find(
|
||||
this.options.indicatorContainer
|
||||
)
|
||||
if (this.indicatorContainer.length) {
|
||||
this.indicatorPrototype = document.createElement('li')
|
||||
this.indicators = this.indicatorContainer[0].children
|
||||
}
|
||||
}
|
||||
initSlides.call(this, reload)
|
||||
},
|
||||
|
||||
addSlide: function (index) {
|
||||
addSlide.call(this, index)
|
||||
this.addIndicator(index)
|
||||
},
|
||||
|
||||
resetSlides: function () {
|
||||
resetSlides.call(this)
|
||||
this.indicatorContainer.empty()
|
||||
this.indicators = []
|
||||
},
|
||||
|
||||
handleClick: function (event) {
|
||||
var target = event.target || event.srcElement
|
||||
var parent = target.parentNode
|
||||
if (parent === this.indicatorContainer[0]) {
|
||||
// Click on indicator element
|
||||
this.preventDefault(event)
|
||||
this.slide(this.getNodeIndex(target))
|
||||
} else if (parent.parentNode === this.indicatorContainer[0]) {
|
||||
// Click on indicator child element
|
||||
this.preventDefault(event)
|
||||
this.slide(this.getNodeIndex(parent))
|
||||
} else {
|
||||
return handleClick.call(this, event)
|
||||
}
|
||||
},
|
||||
|
||||
handleSlide: function (oldIndex, newIndex) {
|
||||
handleSlide.call(this, oldIndex, newIndex)
|
||||
this.setActiveIndicator(newIndex)
|
||||
},
|
||||
|
||||
handleClose: function () {
|
||||
if (this.activeIndicator) {
|
||||
this.activeIndicator.removeClass(this.options.activeIndicatorClass)
|
||||
}
|
||||
handleClose.call(this)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
|
||||
@@ -1,188 +1,188 @@
|
||||
/*
|
||||
* blueimp Gallery Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The class for video content elements:
|
||||
videoContentClass: 'video-content',
|
||||
// The class for video when it is loading:
|
||||
videoLoadingClass: 'video-loading',
|
||||
// The class for video when it is playing:
|
||||
videoPlayingClass: 'video-playing',
|
||||
// The class for video content displayed in an iframe:
|
||||
videoIframeClass: 'video-iframe',
|
||||
// The class for the video cover element:
|
||||
videoCoverClass: 'video-cover',
|
||||
// The class for the video play control:
|
||||
videoPlayClass: 'video-play',
|
||||
// Play videos inline by default:
|
||||
videoPlaysInline: true,
|
||||
// The list object property (or data attribute) for video preload:
|
||||
videoPreloadProperty: 'preload',
|
||||
// The list object property (or data attribute) for the video poster URL:
|
||||
videoPosterProperty: 'poster'
|
||||
})
|
||||
|
||||
var handleSlide = galleryPrototype.handleSlide
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
handleSlide: function (oldIndex, newIndex) {
|
||||
handleSlide.call(this, oldIndex, newIndex)
|
||||
this.setTimeout(function () {
|
||||
if (this.activeVideo) {
|
||||
this.activeVideo.pause()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
videoFactory: function (obj, callback, videoInterface) {
|
||||
var that = this
|
||||
var options = this.options
|
||||
var videoContainerNode = this.elementPrototype.cloneNode(false)
|
||||
var videoContainer = $(videoContainerNode)
|
||||
var errorArgs = [
|
||||
{
|
||||
type: 'error',
|
||||
target: videoContainerNode
|
||||
}
|
||||
]
|
||||
var video = videoInterface || document.createElement('video')
|
||||
var coverElement = this.elementPrototype.cloneNode(false)
|
||||
var playElement = document.createElement('a')
|
||||
var url = this.getItemProperty(obj, options.urlProperty)
|
||||
var sources = this.getItemProperty(obj, options.sourcesProperty)
|
||||
var title = this.getItemProperty(obj, options.titleProperty)
|
||||
var posterUrl = this.getItemProperty(obj, options.videoPosterProperty)
|
||||
var playControls = [playElement]
|
||||
var hasGalleryControls
|
||||
var isLoading
|
||||
var i
|
||||
videoContainer.addClass(options.videoContentClass)
|
||||
$(playElement).addClass(options.videoPlayClass)
|
||||
if (
|
||||
!$(coverElement)
|
||||
.addClass(options.videoCoverClass)
|
||||
.hasClass(options.toggleClass)
|
||||
) {
|
||||
playControls.push(coverElement)
|
||||
}
|
||||
coverElement.draggable = false
|
||||
if (title) {
|
||||
videoContainerNode.title = title
|
||||
playElement.setAttribute('aria-label', title)
|
||||
}
|
||||
if (posterUrl) {
|
||||
// Set as background image instead of as poster video element property:
|
||||
// - Is accessible for browsers that do not support the video element
|
||||
// - Is accessible for both video element and iframe video players
|
||||
// - Avoids visual artifacts in IE with the poster property set
|
||||
coverElement.style.backgroundImage = 'url("' + posterUrl + '")'
|
||||
}
|
||||
if (video.setAttribute) {
|
||||
if (options.videoPlaysInline) video.setAttribute('playsinline', '')
|
||||
} else {
|
||||
videoContainer.addClass(options.videoIframeClass)
|
||||
}
|
||||
video.preload =
|
||||
this.getItemProperty(obj, options.videoPreloadProperty) || 'none'
|
||||
if (this.support.source && sources) {
|
||||
for (i = 0; i < sources.length; i += 1) {
|
||||
video.appendChild(
|
||||
$.extend(this.sourcePrototype.cloneNode(false), sources[i])
|
||||
)
|
||||
}
|
||||
}
|
||||
if (url) video.src = url
|
||||
playElement.href = url || (sources && sources.length && sources[0].src)
|
||||
if (video.play && video.pause) {
|
||||
;(videoInterface || $(video))
|
||||
.on('error', function () {
|
||||
that.setTimeout(callback, errorArgs)
|
||||
})
|
||||
.on('pause', function () {
|
||||
if (video.seeking) return
|
||||
isLoading = false
|
||||
videoContainer
|
||||
.removeClass(that.options.videoLoadingClass)
|
||||
.removeClass(that.options.videoPlayingClass)
|
||||
if (hasGalleryControls) {
|
||||
that.container.addClass(that.options.controlsClass)
|
||||
}
|
||||
video.controls = false
|
||||
if (video === that.activeVideo) delete that.activeVideo
|
||||
if (that.interval) {
|
||||
// Continue slideshow interval
|
||||
that.play()
|
||||
}
|
||||
})
|
||||
.on('playing', function () {
|
||||
isLoading = false
|
||||
coverElement.removeAttribute('style')
|
||||
videoContainer
|
||||
.removeClass(that.options.videoLoadingClass)
|
||||
.addClass(that.options.videoPlayingClass)
|
||||
})
|
||||
.on('play', function () {
|
||||
// Clear slideshow timeout:
|
||||
window.clearTimeout(that.timeout)
|
||||
isLoading = true
|
||||
videoContainer.addClass(that.options.videoLoadingClass)
|
||||
if (that.container.hasClass(that.options.controlsClass)) {
|
||||
hasGalleryControls = true
|
||||
that.container.removeClass(that.options.controlsClass)
|
||||
} else {
|
||||
hasGalleryControls = false
|
||||
}
|
||||
video.controls = true
|
||||
that.activeVideo = video
|
||||
})
|
||||
$(playControls).on('click', function (event) {
|
||||
that.preventDefault(event)
|
||||
that.activeVideo = video
|
||||
if (isLoading) {
|
||||
video.pause()
|
||||
} else {
|
||||
video.play()
|
||||
}
|
||||
})
|
||||
videoContainerNode.appendChild(
|
||||
(videoInterface && videoInterface.element) || video
|
||||
)
|
||||
}
|
||||
videoContainerNode.appendChild(coverElement)
|
||||
videoContainerNode.appendChild(playElement)
|
||||
this.setTimeout(callback, [
|
||||
{
|
||||
type: 'load',
|
||||
target: videoContainerNode
|
||||
}
|
||||
])
|
||||
return videoContainerNode
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The class for video content elements:
|
||||
videoContentClass: 'video-content',
|
||||
// The class for video when it is loading:
|
||||
videoLoadingClass: 'video-loading',
|
||||
// The class for video when it is playing:
|
||||
videoPlayingClass: 'video-playing',
|
||||
// The class for video content displayed in an iframe:
|
||||
videoIframeClass: 'video-iframe',
|
||||
// The class for the video cover element:
|
||||
videoCoverClass: 'video-cover',
|
||||
// The class for the video play control:
|
||||
videoPlayClass: 'video-play',
|
||||
// Play videos inline by default:
|
||||
videoPlaysInline: true,
|
||||
// The list object property (or data attribute) for video preload:
|
||||
videoPreloadProperty: 'preload',
|
||||
// The list object property (or data attribute) for the video poster URL:
|
||||
videoPosterProperty: 'poster'
|
||||
})
|
||||
|
||||
var handleSlide = galleryPrototype.handleSlide
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
handleSlide: function (oldIndex, newIndex) {
|
||||
handleSlide.call(this, oldIndex, newIndex)
|
||||
this.setTimeout(function () {
|
||||
if (this.activeVideo) {
|
||||
this.activeVideo.pause()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
videoFactory: function (obj, callback, videoInterface) {
|
||||
var that = this
|
||||
var options = this.options
|
||||
var videoContainerNode = this.elementPrototype.cloneNode(false)
|
||||
var videoContainer = $(videoContainerNode)
|
||||
var errorArgs = [
|
||||
{
|
||||
type: 'error',
|
||||
target: videoContainerNode
|
||||
}
|
||||
]
|
||||
var video = videoInterface || document.createElement('video')
|
||||
var coverElement = this.elementPrototype.cloneNode(false)
|
||||
var playElement = document.createElement('a')
|
||||
var url = this.getItemProperty(obj, options.urlProperty)
|
||||
var sources = this.getItemProperty(obj, options.sourcesProperty)
|
||||
var title = this.getItemProperty(obj, options.titleProperty)
|
||||
var posterUrl = this.getItemProperty(obj, options.videoPosterProperty)
|
||||
var playControls = [playElement]
|
||||
var hasGalleryControls
|
||||
var isLoading
|
||||
var i
|
||||
videoContainer.addClass(options.videoContentClass)
|
||||
$(playElement).addClass(options.videoPlayClass)
|
||||
if (
|
||||
!$(coverElement)
|
||||
.addClass(options.videoCoverClass)
|
||||
.hasClass(options.toggleClass)
|
||||
) {
|
||||
playControls.push(coverElement)
|
||||
}
|
||||
coverElement.draggable = false
|
||||
if (title) {
|
||||
videoContainerNode.title = title
|
||||
playElement.setAttribute('aria-label', title)
|
||||
}
|
||||
if (posterUrl) {
|
||||
// Set as background image instead of as poster video element property:
|
||||
// - Is accessible for browsers that do not support the video element
|
||||
// - Is accessible for both video element and iframe video players
|
||||
// - Avoids visual artifacts in IE with the poster property set
|
||||
coverElement.style.backgroundImage = 'url("' + posterUrl + '")'
|
||||
}
|
||||
if (video.setAttribute) {
|
||||
if (options.videoPlaysInline) video.setAttribute('playsinline', '')
|
||||
} else {
|
||||
videoContainer.addClass(options.videoIframeClass)
|
||||
}
|
||||
video.preload =
|
||||
this.getItemProperty(obj, options.videoPreloadProperty) || 'none'
|
||||
if (this.support.source && sources) {
|
||||
for (i = 0; i < sources.length; i += 1) {
|
||||
video.appendChild(
|
||||
$.extend(this.sourcePrototype.cloneNode(false), sources[i])
|
||||
)
|
||||
}
|
||||
}
|
||||
if (url) video.src = url
|
||||
playElement.href = url || (sources && sources.length && sources[0].src)
|
||||
if (video.play && video.pause) {
|
||||
;(videoInterface || $(video))
|
||||
.on('error', function () {
|
||||
that.setTimeout(callback, errorArgs)
|
||||
})
|
||||
.on('pause', function () {
|
||||
if (video.seeking) return
|
||||
isLoading = false
|
||||
videoContainer
|
||||
.removeClass(that.options.videoLoadingClass)
|
||||
.removeClass(that.options.videoPlayingClass)
|
||||
if (hasGalleryControls) {
|
||||
that.container.addClass(that.options.controlsClass)
|
||||
}
|
||||
video.controls = false
|
||||
if (video === that.activeVideo) delete that.activeVideo
|
||||
if (that.interval) {
|
||||
// Continue slideshow interval
|
||||
that.play()
|
||||
}
|
||||
})
|
||||
.on('playing', function () {
|
||||
isLoading = false
|
||||
coverElement.removeAttribute('style')
|
||||
videoContainer
|
||||
.removeClass(that.options.videoLoadingClass)
|
||||
.addClass(that.options.videoPlayingClass)
|
||||
})
|
||||
.on('play', function () {
|
||||
// Clear slideshow timeout:
|
||||
window.clearTimeout(that.timeout)
|
||||
isLoading = true
|
||||
videoContainer.addClass(that.options.videoLoadingClass)
|
||||
if (that.container.hasClass(that.options.controlsClass)) {
|
||||
hasGalleryControls = true
|
||||
that.container.removeClass(that.options.controlsClass)
|
||||
} else {
|
||||
hasGalleryControls = false
|
||||
}
|
||||
video.controls = true
|
||||
that.activeVideo = video
|
||||
})
|
||||
$(playControls).on('click', function (event) {
|
||||
that.preventDefault(event)
|
||||
that.activeVideo = video
|
||||
if (isLoading) {
|
||||
video.pause()
|
||||
} else {
|
||||
video.play()
|
||||
}
|
||||
})
|
||||
videoContainerNode.appendChild(
|
||||
(videoInterface && videoInterface.element) || video
|
||||
)
|
||||
}
|
||||
videoContainerNode.appendChild(coverElement)
|
||||
videoContainerNode.appendChild(playElement)
|
||||
this.setTimeout(callback, [
|
||||
{
|
||||
type: 'load',
|
||||
target: videoContainerNode
|
||||
}
|
||||
])
|
||||
return videoContainerNode
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
|
||||
@@ -1,212 +1,212 @@
|
||||
/*
|
||||
* blueimp Gallery Vimeo Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, $f */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery-video'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
if (!window.postMessage) {
|
||||
return Gallery
|
||||
}
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The list object property (or data attribute) with the Vimeo video id:
|
||||
vimeoVideoIdProperty: 'vimeo',
|
||||
// The URL for the Vimeo video player, can be extended with custom parameters:
|
||||
// https://developer.vimeo.com/player/embedding
|
||||
vimeoPlayerUrl:
|
||||
'https://player.vimeo.com/video/VIDEO_ID?api=1&player_id=PLAYER_ID',
|
||||
// The prefix for the Vimeo video player ID:
|
||||
vimeoPlayerIdPrefix: 'vimeo-player-',
|
||||
// Require a click on the native Vimeo player for the initial playback:
|
||||
vimeoClickToPlay: false
|
||||
})
|
||||
|
||||
var textFactory =
|
||||
galleryPrototype.textFactory || galleryPrototype.imageFactory
|
||||
var VimeoPlayer = function (url, videoId, playerId, clickToPlay) {
|
||||
this.url = url
|
||||
this.videoId = videoId
|
||||
this.playerId = playerId
|
||||
this.clickToPlay = clickToPlay
|
||||
this.element = document.createElement('div')
|
||||
this.listeners = {}
|
||||
}
|
||||
var counter = 0
|
||||
|
||||
$.extend(VimeoPlayer.prototype, {
|
||||
on: function (type, func) {
|
||||
this.listeners[type] = func
|
||||
return this
|
||||
},
|
||||
|
||||
loadAPI: function () {
|
||||
var that = this
|
||||
var apiUrl = 'https://f.vimeocdn.com/js/froogaloop2.min.js'
|
||||
var scriptTags = document.getElementsByTagName('script')
|
||||
var i = scriptTags.length
|
||||
var scriptTag
|
||||
var called
|
||||
/**
|
||||
* Callback function
|
||||
*/
|
||||
function callback() {
|
||||
if (!called && that.playOnReady) {
|
||||
that.play()
|
||||
}
|
||||
called = true
|
||||
}
|
||||
while (i) {
|
||||
i -= 1
|
||||
if (scriptTags[i].src === apiUrl) {
|
||||
scriptTag = scriptTags[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!scriptTag) {
|
||||
scriptTag = document.createElement('script')
|
||||
scriptTag.src = apiUrl
|
||||
}
|
||||
$(scriptTag).on('load', callback)
|
||||
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
|
||||
// Fix for cached scripts on IE 8:
|
||||
if (/loaded|complete/.test(scriptTag.readyState)) {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
|
||||
onReady: function () {
|
||||
var that = this
|
||||
this.ready = true
|
||||
this.player.addEvent('play', function () {
|
||||
that.hasPlayed = true
|
||||
that.onPlaying()
|
||||
})
|
||||
this.player.addEvent('pause', function () {
|
||||
that.onPause()
|
||||
})
|
||||
this.player.addEvent('finish', function () {
|
||||
that.onPause()
|
||||
})
|
||||
if (this.playOnReady) {
|
||||
this.play()
|
||||
}
|
||||
},
|
||||
|
||||
onPlaying: function () {
|
||||
if (this.playStatus < 2) {
|
||||
this.listeners.playing()
|
||||
this.playStatus = 2
|
||||
}
|
||||
},
|
||||
|
||||
onPause: function () {
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
},
|
||||
|
||||
insertIframe: function () {
|
||||
var iframe = document.createElement('iframe')
|
||||
iframe.src = this.url
|
||||
.replace('VIDEO_ID', this.videoId)
|
||||
.replace('PLAYER_ID', this.playerId)
|
||||
iframe.id = this.playerId
|
||||
iframe.allow = 'autoplay'
|
||||
this.element.parentNode.replaceChild(iframe, this.element)
|
||||
this.element = iframe
|
||||
},
|
||||
|
||||
play: function () {
|
||||
var that = this
|
||||
if (!this.playStatus) {
|
||||
this.listeners.play()
|
||||
this.playStatus = 1
|
||||
}
|
||||
if (this.ready) {
|
||||
if (
|
||||
!this.hasPlayed &&
|
||||
(this.clickToPlay ||
|
||||
(window.navigator &&
|
||||
/iP(hone|od|ad)/.test(window.navigator.platform)))
|
||||
) {
|
||||
// Manually trigger the playing callback if clickToPlay
|
||||
// is enabled and to workaround a limitation in iOS,
|
||||
// which requires synchronous user interaction to start
|
||||
// the video playback:
|
||||
this.onPlaying()
|
||||
} else {
|
||||
this.player.api('play')
|
||||
}
|
||||
} else {
|
||||
this.playOnReady = true
|
||||
if (!window.$f) {
|
||||
this.loadAPI()
|
||||
} else if (!this.player) {
|
||||
this.insertIframe()
|
||||
this.player = $f(this.element)
|
||||
this.player.addEvent('ready', function () {
|
||||
that.onReady()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
if (this.ready) {
|
||||
this.player.api('pause')
|
||||
} else if (this.playStatus) {
|
||||
delete this.playOnReady
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
VimeoPlayer: VimeoPlayer,
|
||||
|
||||
textFactory: function (obj, callback) {
|
||||
var options = this.options
|
||||
var videoId = this.getItemProperty(obj, options.vimeoVideoIdProperty)
|
||||
if (videoId) {
|
||||
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
|
||||
obj[options.urlProperty] = 'https://vimeo.com/' + videoId
|
||||
}
|
||||
counter += 1
|
||||
return this.videoFactory(
|
||||
obj,
|
||||
callback,
|
||||
new VimeoPlayer(
|
||||
options.vimeoPlayerUrl,
|
||||
videoId,
|
||||
options.vimeoPlayerIdPrefix + counter,
|
||||
options.vimeoClickToPlay
|
||||
)
|
||||
)
|
||||
}
|
||||
return textFactory.call(this, obj, callback)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery Vimeo Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, $f */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery-video'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
if (!window.postMessage) {
|
||||
return Gallery
|
||||
}
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The list object property (or data attribute) with the Vimeo video id:
|
||||
vimeoVideoIdProperty: 'vimeo',
|
||||
// The URL for the Vimeo video player, can be extended with custom parameters:
|
||||
// https://developer.vimeo.com/player/embedding
|
||||
vimeoPlayerUrl:
|
||||
'https://player.vimeo.com/video/VIDEO_ID?api=1&player_id=PLAYER_ID',
|
||||
// The prefix for the Vimeo video player ID:
|
||||
vimeoPlayerIdPrefix: 'vimeo-player-',
|
||||
// Require a click on the native Vimeo player for the initial playback:
|
||||
vimeoClickToPlay: false
|
||||
})
|
||||
|
||||
var textFactory =
|
||||
galleryPrototype.textFactory || galleryPrototype.imageFactory
|
||||
var VimeoPlayer = function (url, videoId, playerId, clickToPlay) {
|
||||
this.url = url
|
||||
this.videoId = videoId
|
||||
this.playerId = playerId
|
||||
this.clickToPlay = clickToPlay
|
||||
this.element = document.createElement('div')
|
||||
this.listeners = {}
|
||||
}
|
||||
var counter = 0
|
||||
|
||||
$.extend(VimeoPlayer.prototype, {
|
||||
on: function (type, func) {
|
||||
this.listeners[type] = func
|
||||
return this
|
||||
},
|
||||
|
||||
loadAPI: function () {
|
||||
var that = this
|
||||
var apiUrl = 'https://f.vimeocdn.com/js/froogaloop2.min.js'
|
||||
var scriptTags = document.getElementsByTagName('script')
|
||||
var i = scriptTags.length
|
||||
var scriptTag
|
||||
var called
|
||||
/**
|
||||
* Callback function
|
||||
*/
|
||||
function callback() {
|
||||
if (!called && that.playOnReady) {
|
||||
that.play()
|
||||
}
|
||||
called = true
|
||||
}
|
||||
while (i) {
|
||||
i -= 1
|
||||
if (scriptTags[i].src === apiUrl) {
|
||||
scriptTag = scriptTags[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
if (!scriptTag) {
|
||||
scriptTag = document.createElement('script')
|
||||
scriptTag.src = apiUrl
|
||||
}
|
||||
$(scriptTag).on('load', callback)
|
||||
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
|
||||
// Fix for cached scripts on IE 8:
|
||||
if (/loaded|complete/.test(scriptTag.readyState)) {
|
||||
callback()
|
||||
}
|
||||
},
|
||||
|
||||
onReady: function () {
|
||||
var that = this
|
||||
this.ready = true
|
||||
this.player.addEvent('play', function () {
|
||||
that.hasPlayed = true
|
||||
that.onPlaying()
|
||||
})
|
||||
this.player.addEvent('pause', function () {
|
||||
that.onPause()
|
||||
})
|
||||
this.player.addEvent('finish', function () {
|
||||
that.onPause()
|
||||
})
|
||||
if (this.playOnReady) {
|
||||
this.play()
|
||||
}
|
||||
},
|
||||
|
||||
onPlaying: function () {
|
||||
if (this.playStatus < 2) {
|
||||
this.listeners.playing()
|
||||
this.playStatus = 2
|
||||
}
|
||||
},
|
||||
|
||||
onPause: function () {
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
},
|
||||
|
||||
insertIframe: function () {
|
||||
var iframe = document.createElement('iframe')
|
||||
iframe.src = this.url
|
||||
.replace('VIDEO_ID', this.videoId)
|
||||
.replace('PLAYER_ID', this.playerId)
|
||||
iframe.id = this.playerId
|
||||
iframe.allow = 'autoplay'
|
||||
this.element.parentNode.replaceChild(iframe, this.element)
|
||||
this.element = iframe
|
||||
},
|
||||
|
||||
play: function () {
|
||||
var that = this
|
||||
if (!this.playStatus) {
|
||||
this.listeners.play()
|
||||
this.playStatus = 1
|
||||
}
|
||||
if (this.ready) {
|
||||
if (
|
||||
!this.hasPlayed &&
|
||||
(this.clickToPlay ||
|
||||
(window.navigator &&
|
||||
/iP(hone|od|ad)/.test(window.navigator.platform)))
|
||||
) {
|
||||
// Manually trigger the playing callback if clickToPlay
|
||||
// is enabled and to workaround a limitation in iOS,
|
||||
// which requires synchronous user interaction to start
|
||||
// the video playback:
|
||||
this.onPlaying()
|
||||
} else {
|
||||
this.player.api('play')
|
||||
}
|
||||
} else {
|
||||
this.playOnReady = true
|
||||
if (!window.$f) {
|
||||
this.loadAPI()
|
||||
} else if (!this.player) {
|
||||
this.insertIframe()
|
||||
this.player = $f(this.element)
|
||||
this.player.addEvent('ready', function () {
|
||||
that.onReady()
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
if (this.ready) {
|
||||
this.player.api('pause')
|
||||
} else if (this.playStatus) {
|
||||
delete this.playOnReady
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
VimeoPlayer: VimeoPlayer,
|
||||
|
||||
textFactory: function (obj, callback) {
|
||||
var options = this.options
|
||||
var videoId = this.getItemProperty(obj, options.vimeoVideoIdProperty)
|
||||
if (videoId) {
|
||||
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
|
||||
obj[options.urlProperty] = 'https://vimeo.com/' + videoId
|
||||
}
|
||||
counter += 1
|
||||
return this.videoFactory(
|
||||
obj,
|
||||
callback,
|
||||
new VimeoPlayer(
|
||||
options.vimeoPlayerUrl,
|
||||
videoId,
|
||||
options.vimeoPlayerIdPrefix + counter,
|
||||
options.vimeoClickToPlay
|
||||
)
|
||||
)
|
||||
}
|
||||
return textFactory.call(this, obj, callback)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
|
||||
@@ -1,224 +1,224 @@
|
||||
/*
|
||||
* blueimp Gallery YouTube Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, YT */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery-video'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
if (!window.postMessage) {
|
||||
return Gallery
|
||||
}
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The list object property (or data attribute) with the YouTube video id:
|
||||
youTubeVideoIdProperty: 'youtube',
|
||||
// Optional object with parameters passed to the YouTube video player:
|
||||
// https://developers.google.com/youtube/player_parameters
|
||||
youTubePlayerVars: {
|
||||
wmode: 'transparent'
|
||||
},
|
||||
// Require a click on the native YouTube player for the initial playback:
|
||||
youTubeClickToPlay: false
|
||||
})
|
||||
|
||||
var textFactory =
|
||||
galleryPrototype.textFactory || galleryPrototype.imageFactory
|
||||
var YouTubePlayer = function (videoId, playerVars, clickToPlay) {
|
||||
this.videoId = videoId
|
||||
this.playerVars = playerVars
|
||||
this.clickToPlay = clickToPlay
|
||||
this.element = document.createElement('div')
|
||||
this.listeners = {}
|
||||
}
|
||||
|
||||
$.extend(YouTubePlayer.prototype, {
|
||||
on: function (type, func) {
|
||||
this.listeners[type] = func
|
||||
return this
|
||||
},
|
||||
|
||||
loadAPI: function () {
|
||||
var that = this
|
||||
var onYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady
|
||||
var apiUrl = 'https://www.youtube.com/iframe_api'
|
||||
var scriptTags = document.getElementsByTagName('script')
|
||||
var i = scriptTags.length
|
||||
var scriptTag
|
||||
window.onYouTubeIframeAPIReady = function () {
|
||||
if (onYouTubeIframeAPIReady) {
|
||||
onYouTubeIframeAPIReady.apply(this)
|
||||
}
|
||||
if (that.playOnReady) {
|
||||
that.play()
|
||||
}
|
||||
}
|
||||
while (i) {
|
||||
i -= 1
|
||||
if (scriptTags[i].src === apiUrl) {
|
||||
return
|
||||
}
|
||||
}
|
||||
scriptTag = document.createElement('script')
|
||||
scriptTag.src = apiUrl
|
||||
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
|
||||
},
|
||||
|
||||
onReady: function () {
|
||||
this.ready = true
|
||||
if (this.playOnReady) {
|
||||
this.play()
|
||||
}
|
||||
},
|
||||
|
||||
onPlaying: function () {
|
||||
if (this.playStatus < 2) {
|
||||
this.listeners.playing()
|
||||
this.playStatus = 2
|
||||
}
|
||||
},
|
||||
|
||||
onPause: function () {
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
},
|
||||
|
||||
onStateChange: function (event) {
|
||||
window.clearTimeout(this.pauseTimeout)
|
||||
switch (event.data) {
|
||||
case YT.PlayerState.PLAYING:
|
||||
this.hasPlayed = true
|
||||
this.onPlaying()
|
||||
break
|
||||
case YT.PlayerState.UNSTARTED:
|
||||
case YT.PlayerState.PAUSED:
|
||||
// YouTube sends an unstarted event if pause is triggered before the
|
||||
// video has started.
|
||||
// YouTube sends a pause event when seeking.
|
||||
// In both cases, we initiate a pause in a timeout that gets cleared
|
||||
// if followed by another event within the timeout window.
|
||||
this.pauseTimeout = galleryPrototype.setTimeout.call(
|
||||
this,
|
||||
this.onPause,
|
||||
null,
|
||||
500
|
||||
)
|
||||
break
|
||||
case YT.PlayerState.ENDED:
|
||||
this.onPause()
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
onError: function (event) {
|
||||
this.listeners.error(event)
|
||||
},
|
||||
|
||||
play: function () {
|
||||
var that = this
|
||||
if (!this.playStatus) {
|
||||
this.listeners.play()
|
||||
this.playStatus = 1
|
||||
}
|
||||
if (this.ready) {
|
||||
if (
|
||||
!this.hasPlayed &&
|
||||
(this.clickToPlay ||
|
||||
(window.navigator &&
|
||||
/iP(hone|od|ad)/.test(window.navigator.platform)))
|
||||
) {
|
||||
// Manually trigger the playing callback if clickToPlay
|
||||
// is enabled and to workaround a limitation in iOS,
|
||||
// which requires synchronous user interaction to start
|
||||
// the video playback:
|
||||
this.onPlaying()
|
||||
} else {
|
||||
this.player.playVideo()
|
||||
}
|
||||
} else {
|
||||
this.playOnReady = true
|
||||
if (!(window.YT && YT.Player)) {
|
||||
this.loadAPI()
|
||||
} else if (!this.player) {
|
||||
this.player = new YT.Player(this.element, {
|
||||
videoId: this.videoId,
|
||||
playerVars: this.playerVars,
|
||||
events: {
|
||||
onReady: function () {
|
||||
that.onReady()
|
||||
},
|
||||
onStateChange: function (event) {
|
||||
that.onStateChange(event)
|
||||
},
|
||||
onError: function (event) {
|
||||
that.onError(event)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
if (this.ready) {
|
||||
this.player.pauseVideo()
|
||||
} else if (this.playStatus) {
|
||||
delete this.playOnReady
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
YouTubePlayer: YouTubePlayer,
|
||||
|
||||
textFactory: function (obj, callback) {
|
||||
var options = this.options
|
||||
var videoId = this.getItemProperty(obj, options.youTubeVideoIdProperty)
|
||||
if (videoId) {
|
||||
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
|
||||
obj[options.urlProperty] =
|
||||
'https://www.youtube.com/watch?v=' + videoId
|
||||
}
|
||||
if (
|
||||
this.getItemProperty(obj, options.videoPosterProperty) === undefined
|
||||
) {
|
||||
obj[options.videoPosterProperty] =
|
||||
'https://img.youtube.com/vi/' + videoId + '/maxresdefault.jpg'
|
||||
}
|
||||
return this.videoFactory(
|
||||
obj,
|
||||
callback,
|
||||
new YouTubePlayer(
|
||||
videoId,
|
||||
options.youTubePlayerVars,
|
||||
options.youTubeClickToPlay
|
||||
)
|
||||
)
|
||||
}
|
||||
return textFactory.call(this, obj, callback)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery YouTube Video Factory JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define, YT */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Register as an anonymous AMD module:
|
||||
define(['./blueimp-helper', './blueimp-gallery-video'], factory)
|
||||
} else {
|
||||
// Browser globals:
|
||||
factory(window.blueimp.helper || window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
if (!window.postMessage) {
|
||||
return Gallery
|
||||
}
|
||||
|
||||
var galleryPrototype = Gallery.prototype
|
||||
|
||||
$.extend(galleryPrototype.options, {
|
||||
// The list object property (or data attribute) with the YouTube video id:
|
||||
youTubeVideoIdProperty: 'youtube',
|
||||
// Optional object with parameters passed to the YouTube video player:
|
||||
// https://developers.google.com/youtube/player_parameters
|
||||
youTubePlayerVars: {
|
||||
wmode: 'transparent'
|
||||
},
|
||||
// Require a click on the native YouTube player for the initial playback:
|
||||
youTubeClickToPlay: false
|
||||
})
|
||||
|
||||
var textFactory =
|
||||
galleryPrototype.textFactory || galleryPrototype.imageFactory
|
||||
var YouTubePlayer = function (videoId, playerVars, clickToPlay) {
|
||||
this.videoId = videoId
|
||||
this.playerVars = playerVars
|
||||
this.clickToPlay = clickToPlay
|
||||
this.element = document.createElement('div')
|
||||
this.listeners = {}
|
||||
}
|
||||
|
||||
$.extend(YouTubePlayer.prototype, {
|
||||
on: function (type, func) {
|
||||
this.listeners[type] = func
|
||||
return this
|
||||
},
|
||||
|
||||
loadAPI: function () {
|
||||
var that = this
|
||||
var onYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady
|
||||
var apiUrl = 'https://www.youtube.com/iframe_api'
|
||||
var scriptTags = document.getElementsByTagName('script')
|
||||
var i = scriptTags.length
|
||||
var scriptTag
|
||||
window.onYouTubeIframeAPIReady = function () {
|
||||
if (onYouTubeIframeAPIReady) {
|
||||
onYouTubeIframeAPIReady.apply(this)
|
||||
}
|
||||
if (that.playOnReady) {
|
||||
that.play()
|
||||
}
|
||||
}
|
||||
while (i) {
|
||||
i -= 1
|
||||
if (scriptTags[i].src === apiUrl) {
|
||||
return
|
||||
}
|
||||
}
|
||||
scriptTag = document.createElement('script')
|
||||
scriptTag.src = apiUrl
|
||||
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
|
||||
},
|
||||
|
||||
onReady: function () {
|
||||
this.ready = true
|
||||
if (this.playOnReady) {
|
||||
this.play()
|
||||
}
|
||||
},
|
||||
|
||||
onPlaying: function () {
|
||||
if (this.playStatus < 2) {
|
||||
this.listeners.playing()
|
||||
this.playStatus = 2
|
||||
}
|
||||
},
|
||||
|
||||
onPause: function () {
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
},
|
||||
|
||||
onStateChange: function (event) {
|
||||
window.clearTimeout(this.pauseTimeout)
|
||||
switch (event.data) {
|
||||
case YT.PlayerState.PLAYING:
|
||||
this.hasPlayed = true
|
||||
this.onPlaying()
|
||||
break
|
||||
case YT.PlayerState.UNSTARTED:
|
||||
case YT.PlayerState.PAUSED:
|
||||
// YouTube sends an unstarted event if pause is triggered before the
|
||||
// video has started.
|
||||
// YouTube sends a pause event when seeking.
|
||||
// In both cases, we initiate a pause in a timeout that gets cleared
|
||||
// if followed by another event within the timeout window.
|
||||
this.pauseTimeout = galleryPrototype.setTimeout.call(
|
||||
this,
|
||||
this.onPause,
|
||||
null,
|
||||
500
|
||||
)
|
||||
break
|
||||
case YT.PlayerState.ENDED:
|
||||
this.onPause()
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
onError: function (event) {
|
||||
this.listeners.error(event)
|
||||
},
|
||||
|
||||
play: function () {
|
||||
var that = this
|
||||
if (!this.playStatus) {
|
||||
this.listeners.play()
|
||||
this.playStatus = 1
|
||||
}
|
||||
if (this.ready) {
|
||||
if (
|
||||
!this.hasPlayed &&
|
||||
(this.clickToPlay ||
|
||||
(window.navigator &&
|
||||
/iP(hone|od|ad)/.test(window.navigator.platform)))
|
||||
) {
|
||||
// Manually trigger the playing callback if clickToPlay
|
||||
// is enabled and to workaround a limitation in iOS,
|
||||
// which requires synchronous user interaction to start
|
||||
// the video playback:
|
||||
this.onPlaying()
|
||||
} else {
|
||||
this.player.playVideo()
|
||||
}
|
||||
} else {
|
||||
this.playOnReady = true
|
||||
if (!(window.YT && YT.Player)) {
|
||||
this.loadAPI()
|
||||
} else if (!this.player) {
|
||||
this.player = new YT.Player(this.element, {
|
||||
videoId: this.videoId,
|
||||
playerVars: this.playerVars,
|
||||
events: {
|
||||
onReady: function () {
|
||||
that.onReady()
|
||||
},
|
||||
onStateChange: function (event) {
|
||||
that.onStateChange(event)
|
||||
},
|
||||
onError: function (event) {
|
||||
that.onError(event)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
pause: function () {
|
||||
if (this.ready) {
|
||||
this.player.pauseVideo()
|
||||
} else if (this.playStatus) {
|
||||
delete this.playOnReady
|
||||
this.listeners.pause()
|
||||
delete this.playStatus
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$.extend(galleryPrototype, {
|
||||
YouTubePlayer: YouTubePlayer,
|
||||
|
||||
textFactory: function (obj, callback) {
|
||||
var options = this.options
|
||||
var videoId = this.getItemProperty(obj, options.youTubeVideoIdProperty)
|
||||
if (videoId) {
|
||||
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
|
||||
obj[options.urlProperty] =
|
||||
'https://www.youtube.com/watch?v=' + videoId
|
||||
}
|
||||
if (
|
||||
this.getItemProperty(obj, options.videoPosterProperty) === undefined
|
||||
) {
|
||||
obj[options.videoPosterProperty] =
|
||||
'https://img.youtube.com/vi/' + videoId + '/maxresdefault.jpg'
|
||||
}
|
||||
return this.videoFactory(
|
||||
obj,
|
||||
callback,
|
||||
new YouTubePlayer(
|
||||
videoId,
|
||||
options.youTubePlayerVars,
|
||||
options.youTubeClickToPlay
|
||||
)
|
||||
)
|
||||
}
|
||||
return textFactory.call(this, obj, callback)
|
||||
}
|
||||
})
|
||||
|
||||
return Gallery
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,217 +1,217 @@
|
||||
/*
|
||||
* blueimp helper JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
;(function () {
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Object.assign polyfill
|
||||
*
|
||||
* @param {object} obj1 First object
|
||||
* @param {object} obj2 Second object
|
||||
* @returns {object} Merged object
|
||||
*/
|
||||
function extend(obj1, obj2) {
|
||||
var prop
|
||||
for (prop in obj2) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj2, prop)) {
|
||||
obj1[prop] = obj2[prop]
|
||||
}
|
||||
}
|
||||
return obj1
|
||||
}
|
||||
/**
|
||||
* Helper constructor
|
||||
*
|
||||
* @class
|
||||
* @param {*} query jQuery type query argument
|
||||
*/
|
||||
function Helper(query) {
|
||||
if (!this || this.find !== Helper.prototype.find) {
|
||||
// Called as function instead of as constructor,
|
||||
// so we simply return a new instance:
|
||||
return new Helper(query)
|
||||
}
|
||||
this.length = 0
|
||||
if (query) {
|
||||
if (typeof query === 'string') {
|
||||
query = this.find(query)
|
||||
}
|
||||
if (query.nodeType || query === query.window) {
|
||||
// Single HTML element
|
||||
this.length = 1
|
||||
this[0] = query
|
||||
} else {
|
||||
// HTML element collection
|
||||
var i = query.length
|
||||
this.length = i
|
||||
while (i) {
|
||||
i -= 1
|
||||
this[i] = query[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Helper.extend = extend
|
||||
|
||||
Helper.contains = function (container, element) {
|
||||
do {
|
||||
element = element.parentNode
|
||||
if (element === container) {
|
||||
return true
|
||||
}
|
||||
} while (element)
|
||||
return false
|
||||
}
|
||||
|
||||
Helper.parseJSON = function (string) {
|
||||
return JSON.parse(string)
|
||||
}
|
||||
|
||||
extend(Helper.prototype, {
|
||||
find: function (query) {
|
||||
var container = this[0] || document
|
||||
if (typeof query === 'string') {
|
||||
if (container.querySelectorAll) {
|
||||
query = container.querySelectorAll(query)
|
||||
} else if (query.charAt(0) === '#') {
|
||||
query = container.getElementById(query.slice(1))
|
||||
} else {
|
||||
query = container.getElementsByTagName(query)
|
||||
}
|
||||
}
|
||||
return new Helper(query)
|
||||
},
|
||||
|
||||
hasClass: function (className) {
|
||||
if (!this[0]) return false
|
||||
return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(
|
||||
this[0].className
|
||||
)
|
||||
},
|
||||
|
||||
addClass: function (className) {
|
||||
var i = this.length
|
||||
var classNames
|
||||
var element
|
||||
var j
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (!element.className) {
|
||||
element.className = className
|
||||
continue
|
||||
}
|
||||
if (!classNames) classNames = className.split(/\s+/)
|
||||
for (j = 0; j < classNames.length; j += 1) {
|
||||
if (this.hasClass(classNames[j])) {
|
||||
continue
|
||||
}
|
||||
element.className += ' ' + classNames[j]
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
removeClass: function (className) {
|
||||
// Match any of the given class names
|
||||
var regexp = new RegExp('^(?:' + className.split(/\s+/).join('|') + ')$')
|
||||
// Match any class names and their trailing whitespace
|
||||
var matcher = /(\S+)(?:\s+|$)/g
|
||||
var replacer = function (match, className) {
|
||||
// Replace class names that match the given ones
|
||||
return regexp.test(className) ? '' : match
|
||||
}
|
||||
var trimEnd = /\s+$/
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
element.className = element.className
|
||||
.replace(matcher, replacer)
|
||||
.replace(trimEnd, '')
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
on: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(eventName, handler, false)
|
||||
} else if (element.attachEvent) {
|
||||
element.attachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
off: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(eventName, handler, false)
|
||||
} else if (element.detachEvent) {
|
||||
element.detachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
empty: function () {
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
while (element.hasChildNodes()) {
|
||||
element.removeChild(element.lastChild)
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
first: function () {
|
||||
return new Helper(this[0])
|
||||
}
|
||||
})
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return Helper
|
||||
})
|
||||
} else {
|
||||
window.blueimp = window.blueimp || {}
|
||||
window.blueimp.helper = Helper
|
||||
}
|
||||
})()
|
||||
/*
|
||||
* blueimp helper JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
/* eslint-disable no-param-reassign */
|
||||
|
||||
;(function () {
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Object.assign polyfill
|
||||
*
|
||||
* @param {object} obj1 First object
|
||||
* @param {object} obj2 Second object
|
||||
* @returns {object} Merged object
|
||||
*/
|
||||
function extend(obj1, obj2) {
|
||||
var prop
|
||||
for (prop in obj2) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj2, prop)) {
|
||||
obj1[prop] = obj2[prop]
|
||||
}
|
||||
}
|
||||
return obj1
|
||||
}
|
||||
/**
|
||||
* Helper constructor
|
||||
*
|
||||
* @class
|
||||
* @param {*} query jQuery type query argument
|
||||
*/
|
||||
function Helper(query) {
|
||||
if (!this || this.find !== Helper.prototype.find) {
|
||||
// Called as function instead of as constructor,
|
||||
// so we simply return a new instance:
|
||||
return new Helper(query)
|
||||
}
|
||||
this.length = 0
|
||||
if (query) {
|
||||
if (typeof query === 'string') {
|
||||
query = this.find(query)
|
||||
}
|
||||
if (query.nodeType || query === query.window) {
|
||||
// Single HTML element
|
||||
this.length = 1
|
||||
this[0] = query
|
||||
} else {
|
||||
// HTML element collection
|
||||
var i = query.length
|
||||
this.length = i
|
||||
while (i) {
|
||||
i -= 1
|
||||
this[i] = query[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Helper.extend = extend
|
||||
|
||||
Helper.contains = function (container, element) {
|
||||
do {
|
||||
element = element.parentNode
|
||||
if (element === container) {
|
||||
return true
|
||||
}
|
||||
} while (element)
|
||||
return false
|
||||
}
|
||||
|
||||
Helper.parseJSON = function (string) {
|
||||
return JSON.parse(string)
|
||||
}
|
||||
|
||||
extend(Helper.prototype, {
|
||||
find: function (query) {
|
||||
var container = this[0] || document
|
||||
if (typeof query === 'string') {
|
||||
if (container.querySelectorAll) {
|
||||
query = container.querySelectorAll(query)
|
||||
} else if (query.charAt(0) === '#') {
|
||||
query = container.getElementById(query.slice(1))
|
||||
} else {
|
||||
query = container.getElementsByTagName(query)
|
||||
}
|
||||
}
|
||||
return new Helper(query)
|
||||
},
|
||||
|
||||
hasClass: function (className) {
|
||||
if (!this[0]) return false
|
||||
return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(
|
||||
this[0].className
|
||||
)
|
||||
},
|
||||
|
||||
addClass: function (className) {
|
||||
var i = this.length
|
||||
var classNames
|
||||
var element
|
||||
var j
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (!element.className) {
|
||||
element.className = className
|
||||
continue
|
||||
}
|
||||
if (!classNames) classNames = className.split(/\s+/)
|
||||
for (j = 0; j < classNames.length; j += 1) {
|
||||
if (this.hasClass(classNames[j])) {
|
||||
continue
|
||||
}
|
||||
element.className += ' ' + classNames[j]
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
removeClass: function (className) {
|
||||
// Match any of the given class names
|
||||
var regexp = new RegExp('^(?:' + className.split(/\s+/).join('|') + ')$')
|
||||
// Match any class names and their trailing whitespace
|
||||
var matcher = /(\S+)(?:\s+|$)/g
|
||||
var replacer = function (match, className) {
|
||||
// Replace class names that match the given ones
|
||||
return regexp.test(className) ? '' : match
|
||||
}
|
||||
var trimEnd = /\s+$/
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
element.className = element.className
|
||||
.replace(matcher, replacer)
|
||||
.replace(trimEnd, '')
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
on: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.addEventListener) {
|
||||
element.addEventListener(eventName, handler, false)
|
||||
} else if (element.attachEvent) {
|
||||
element.attachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
off: function (eventName, handler) {
|
||||
var eventNames = eventName.split(/\s+/)
|
||||
var i
|
||||
var element
|
||||
while (eventNames.length) {
|
||||
eventName = eventNames.shift()
|
||||
i = this.length
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
if (element.removeEventListener) {
|
||||
element.removeEventListener(eventName, handler, false)
|
||||
} else if (element.detachEvent) {
|
||||
element.detachEvent('on' + eventName, handler)
|
||||
}
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
empty: function () {
|
||||
var i = this.length
|
||||
var element
|
||||
while (i) {
|
||||
i -= 1
|
||||
element = this[i]
|
||||
while (element.hasChildNodes()) {
|
||||
element.removeChild(element.lastChild)
|
||||
}
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
first: function () {
|
||||
return new Helper(this[0])
|
||||
}
|
||||
})
|
||||
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(function () {
|
||||
return Helper
|
||||
})
|
||||
} else {
|
||||
window.blueimp = window.blueimp || {}
|
||||
window.blueimp.helper = Helper
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -1,140 +1,140 @@
|
||||
/*
|
||||
* blueimp Gallery Demo JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global blueimp, $ */
|
||||
|
||||
$(function () {
|
||||
'use strict'
|
||||
|
||||
// Flickr image types:
|
||||
var imageTypes = [
|
||||
// https://www.flickr.com/services/api/misc.urls.html
|
||||
'sq', // 75x75
|
||||
'q', // 150x150
|
||||
't', // 100 on longest side
|
||||
's', // 240 on longest side
|
||||
'n', // 320 on longest side
|
||||
'm', // 500 on longest side
|
||||
'z', // 640 on longest side
|
||||
'c', // 800 on longest side
|
||||
'l', // 1024 on longest side
|
||||
'h', // 1600 on longest side
|
||||
'k', // 2048 on longest side
|
||||
'o' // original dimensions
|
||||
]
|
||||
|
||||
// Load demo images from Flickr:
|
||||
$.ajax({
|
||||
url: 'https://api.flickr.com/services/rest/',
|
||||
data: {
|
||||
// https://www.flickr.com/services/api/flickr.interestingness.getList.html
|
||||
method: 'flickr.interestingness.getList',
|
||||
format: 'json',
|
||||
extras: 'url_' + imageTypes.join(',url_'),
|
||||
// eslint-disable-next-line camelcase
|
||||
api_key: '7617adae70159d09ba78cfec73c13be3'
|
||||
},
|
||||
dataType: 'jsonp',
|
||||
jsonp: 'jsoncallback'
|
||||
}).done(function (result) {
|
||||
var maxWidth = $(document.body).css('max-width')
|
||||
var sizes = '(min-width: ' + maxWidth + ') ' + maxWidth + ', 100vw'
|
||||
var carouselLinks = []
|
||||
var linksContainer = $('#links')
|
||||
// Add the demo images as links with thumbnails to the page:
|
||||
$.each(result.photos.photo, function (_, photo) {
|
||||
var thumbnail = $('<img>')
|
||||
.prop('loading', 'lazy')
|
||||
.prop('width', photo.width_sq)
|
||||
.prop('height', photo.height_sq)
|
||||
.prop('src', photo.url_sq)
|
||||
.prop('alt', photo.title)
|
||||
var srcset = []
|
||||
$.each(imageTypes, function (_, type) {
|
||||
var url = photo['url_' + type]
|
||||
var width = photo['width_' + type]
|
||||
if (url) {
|
||||
srcset.push(url + ' ' + width + 'w')
|
||||
}
|
||||
})
|
||||
srcset = srcset.join(',')
|
||||
$('<a></a>')
|
||||
.append(thumbnail)
|
||||
.prop('title', photo.title)
|
||||
.prop('href', photo.url_l)
|
||||
.attr('data-srcset', srcset)
|
||||
.attr('data-gallery', '')
|
||||
.appendTo(linksContainer)
|
||||
carouselLinks.push({
|
||||
title: photo.title,
|
||||
href: photo.url_l,
|
||||
sizes: sizes,
|
||||
srcset: srcset
|
||||
})
|
||||
})
|
||||
// Initialize the Gallery as image carousel:
|
||||
// eslint-disable-next-line new-cap
|
||||
blueimp.Gallery(carouselLinks, {
|
||||
container: '#blueimp-image-carousel',
|
||||
carousel: true
|
||||
})
|
||||
})
|
||||
|
||||
// Initialize the Gallery as video carousel:
|
||||
// eslint-disable-next-line new-cap
|
||||
blueimp.Gallery(
|
||||
[
|
||||
{
|
||||
title: 'Sintel',
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
type: 'video/webm',
|
||||
src:
|
||||
'https://upload.wikimedia.org/wikipedia/commons/f/f1/' +
|
||||
'Sintel_movie_4K.webm'
|
||||
},
|
||||
{
|
||||
type: 'video/mp4',
|
||||
src: 'https://archive.org/download/Sintel/sintel-2048-surround.mp4'
|
||||
},
|
||||
{
|
||||
type: 'video/ogg',
|
||||
src: 'https://archive.org/download/Sintel/sintel-2048-stereo.ogv'
|
||||
}
|
||||
],
|
||||
poster:
|
||||
'https://upload.wikimedia.org/wikipedia/commons/d/dc/' +
|
||||
'Sintel_1920x1080.png'
|
||||
},
|
||||
{
|
||||
title: 'LES TWINS - An Industry Ahead',
|
||||
type: 'text/html',
|
||||
youtube: 'zi4CIXpx7Bg'
|
||||
},
|
||||
{
|
||||
title: 'KN1GHT - Last Moon',
|
||||
type: 'text/html',
|
||||
vimeo: '73686146',
|
||||
poster: 'https://secure-a.vimeocdn.com/ts/448/835/448835699_960.jpg'
|
||||
}
|
||||
],
|
||||
{
|
||||
container: '#blueimp-video-carousel',
|
||||
carousel: true,
|
||||
startSlideshow: false
|
||||
}
|
||||
)
|
||||
|
||||
$('#fullscreen').change(function () {
|
||||
$('#blueimp-gallery').data('fullscreen', this.checked)
|
||||
})
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery Demo JS
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global blueimp, $ */
|
||||
|
||||
$(function () {
|
||||
'use strict'
|
||||
|
||||
// Flickr image types:
|
||||
var imageTypes = [
|
||||
// https://www.flickr.com/services/api/misc.urls.html
|
||||
'sq', // 75x75
|
||||
'q', // 150x150
|
||||
't', // 100 on longest side
|
||||
's', // 240 on longest side
|
||||
'n', // 320 on longest side
|
||||
'm', // 500 on longest side
|
||||
'z', // 640 on longest side
|
||||
'c', // 800 on longest side
|
||||
'l', // 1024 on longest side
|
||||
'h', // 1600 on longest side
|
||||
'k', // 2048 on longest side
|
||||
'o' // original dimensions
|
||||
]
|
||||
|
||||
// Load demo images from Flickr:
|
||||
$.ajax({
|
||||
url: 'https://api.flickr.com/services/rest/',
|
||||
data: {
|
||||
// https://www.flickr.com/services/api/flickr.interestingness.getList.html
|
||||
method: 'flickr.interestingness.getList',
|
||||
format: 'json',
|
||||
extras: 'url_' + imageTypes.join(',url_'),
|
||||
// eslint-disable-next-line camelcase
|
||||
api_key: '7617adae70159d09ba78cfec73c13be3'
|
||||
},
|
||||
dataType: 'jsonp',
|
||||
jsonp: 'jsoncallback'
|
||||
}).done(function (result) {
|
||||
var maxWidth = $(document.body).css('max-width')
|
||||
var sizes = '(min-width: ' + maxWidth + ') ' + maxWidth + ', 100vw'
|
||||
var carouselLinks = []
|
||||
var linksContainer = $('#links')
|
||||
// Add the demo images as links with thumbnails to the page:
|
||||
$.each(result.photos.photo, function (_, photo) {
|
||||
var thumbnail = $('<img>')
|
||||
.prop('loading', 'lazy')
|
||||
.prop('width', photo.width_sq)
|
||||
.prop('height', photo.height_sq)
|
||||
.prop('src', photo.url_sq)
|
||||
.prop('alt', photo.title)
|
||||
var srcset = []
|
||||
$.each(imageTypes, function (_, type) {
|
||||
var url = photo['url_' + type]
|
||||
var width = photo['width_' + type]
|
||||
if (url) {
|
||||
srcset.push(url + ' ' + width + 'w')
|
||||
}
|
||||
})
|
||||
srcset = srcset.join(',')
|
||||
$('<a></a>')
|
||||
.append(thumbnail)
|
||||
.prop('title', photo.title)
|
||||
.prop('href', photo.url_l)
|
||||
.attr('data-srcset', srcset)
|
||||
.attr('data-gallery', '')
|
||||
.appendTo(linksContainer)
|
||||
carouselLinks.push({
|
||||
title: photo.title,
|
||||
href: photo.url_l,
|
||||
sizes: sizes,
|
||||
srcset: srcset
|
||||
})
|
||||
})
|
||||
// Initialize the Gallery as image carousel:
|
||||
// eslint-disable-next-line new-cap
|
||||
blueimp.Gallery(carouselLinks, {
|
||||
container: '#blueimp-image-carousel',
|
||||
carousel: true
|
||||
})
|
||||
})
|
||||
|
||||
// Initialize the Gallery as video carousel:
|
||||
// eslint-disable-next-line new-cap
|
||||
blueimp.Gallery(
|
||||
[
|
||||
{
|
||||
title: 'Sintel',
|
||||
type: 'video',
|
||||
sources: [
|
||||
{
|
||||
type: 'video/webm',
|
||||
src:
|
||||
'https://upload.wikimedia.org/wikipedia/commons/f/f1/' +
|
||||
'Sintel_movie_4K.webm'
|
||||
},
|
||||
{
|
||||
type: 'video/mp4',
|
||||
src: 'https://archive.org/download/Sintel/sintel-2048-surround.mp4'
|
||||
},
|
||||
{
|
||||
type: 'video/ogg',
|
||||
src: 'https://archive.org/download/Sintel/sintel-2048-stereo.ogv'
|
||||
}
|
||||
],
|
||||
poster:
|
||||
'https://upload.wikimedia.org/wikipedia/commons/d/dc/' +
|
||||
'Sintel_1920x1080.png'
|
||||
},
|
||||
{
|
||||
title: 'LES TWINS - An Industry Ahead',
|
||||
type: 'text/html',
|
||||
youtube: 'zi4CIXpx7Bg'
|
||||
},
|
||||
{
|
||||
title: 'KN1GHT - Last Moon',
|
||||
type: 'text/html',
|
||||
vimeo: '73686146',
|
||||
poster: 'https://secure-a.vimeocdn.com/ts/448/835/448835699_960.jpg'
|
||||
}
|
||||
],
|
||||
{
|
||||
container: '#blueimp-video-carousel',
|
||||
carousel: true,
|
||||
startSlideshow: false
|
||||
}
|
||||
)
|
||||
|
||||
$('#fullscreen').change(function () {
|
||||
$('#blueimp-gallery').data('fullscreen', this.checked)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,75 +1,75 @@
|
||||
/*
|
||||
* blueimp Gallery jQuery plugin
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
factory(window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
// Global click handler to open links with data-gallery attribute
|
||||
// in the Gallery lightbox:
|
||||
$(document).on('click', '[data-gallery]', function (event) {
|
||||
// Get the container id from the data-gallery attribute:
|
||||
var id = $(this).data('gallery')
|
||||
var widget = $(id)
|
||||
var container =
|
||||
(widget.length && widget) || $(Gallery.prototype.options.container)
|
||||
var callbacks = {
|
||||
onopen: function () {
|
||||
container.data('gallery', this).trigger('open')
|
||||
},
|
||||
onopened: function () {
|
||||
container.trigger('opened')
|
||||
},
|
||||
onslide: function () {
|
||||
container.trigger('slide', arguments)
|
||||
},
|
||||
onslideend: function () {
|
||||
container.trigger('slideend', arguments)
|
||||
},
|
||||
onslidecomplete: function () {
|
||||
container.trigger('slidecomplete', arguments)
|
||||
},
|
||||
onclose: function () {
|
||||
container.trigger('close')
|
||||
},
|
||||
onclosed: function () {
|
||||
container.trigger('closed').removeData('gallery')
|
||||
}
|
||||
}
|
||||
var options = $.extend(
|
||||
// Retrieve custom options from data-attributes
|
||||
// on the Gallery widget:
|
||||
container.data(),
|
||||
{
|
||||
container: container[0],
|
||||
index: this,
|
||||
event: event
|
||||
},
|
||||
callbacks
|
||||
)
|
||||
// Select all links with the same data-gallery attribute:
|
||||
var links = $(this)
|
||||
.closest('[data-gallery-group], body')
|
||||
.find('[data-gallery="' + id + '"]')
|
||||
if (options.filter) {
|
||||
links = links.filter(options.filter)
|
||||
}
|
||||
return new Gallery(links, options)
|
||||
})
|
||||
})
|
||||
/*
|
||||
* blueimp Gallery jQuery plugin
|
||||
* https://github.com/blueimp/Gallery
|
||||
*
|
||||
* Copyright 2013, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
/* global define */
|
||||
|
||||
;(function (factory) {
|
||||
'use strict'
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define(['jquery', './blueimp-gallery'], factory)
|
||||
} else {
|
||||
factory(window.jQuery, window.blueimp.Gallery)
|
||||
}
|
||||
})(function ($, Gallery) {
|
||||
'use strict'
|
||||
|
||||
// Global click handler to open links with data-gallery attribute
|
||||
// in the Gallery lightbox:
|
||||
$(document).on('click', '[data-gallery]', function (event) {
|
||||
// Get the container id from the data-gallery attribute:
|
||||
var id = $(this).data('gallery')
|
||||
var widget = $(id)
|
||||
var container =
|
||||
(widget.length && widget) || $(Gallery.prototype.options.container)
|
||||
var callbacks = {
|
||||
onopen: function () {
|
||||
container.data('gallery', this).trigger('open')
|
||||
},
|
||||
onopened: function () {
|
||||
container.trigger('opened')
|
||||
},
|
||||
onslide: function () {
|
||||
container.trigger('slide', arguments)
|
||||
},
|
||||
onslideend: function () {
|
||||
container.trigger('slideend', arguments)
|
||||
},
|
||||
onslidecomplete: function () {
|
||||
container.trigger('slidecomplete', arguments)
|
||||
},
|
||||
onclose: function () {
|
||||
container.trigger('close')
|
||||
},
|
||||
onclosed: function () {
|
||||
container.trigger('closed').removeData('gallery')
|
||||
}
|
||||
}
|
||||
var options = $.extend(
|
||||
// Retrieve custom options from data-attributes
|
||||
// on the Gallery widget:
|
||||
container.data(),
|
||||
{
|
||||
container: container[0],
|
||||
index: this,
|
||||
event: event
|
||||
},
|
||||
callbacks
|
||||
)
|
||||
// Select all links with the same data-gallery attribute:
|
||||
var links = $(this)
|
||||
.closest('[data-gallery-group], body')
|
||||
.find('[data-gallery="' + id + '"]')
|
||||
if (options.filter) {
|
||||
links = links.filter(options.filter)
|
||||
}
|
||||
return new Gallery(links, options)
|
||||
})
|
||||
})
|
||||
|
||||
File diff suppressed because one or more lines are too long
22016
assets/Gallery-3.4.0/js/vendor/jquery.js
vendored
22016
assets/Gallery-3.4.0/js/vendor/jquery.js
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user