2015-06-05 16:52:57 +00:00
|
|
|
|
|
|
|
function getData() {
|
|
|
|
var data = [{
|
|
|
|
link: 'https://www.youtube.com/watch?v=RRq2_Pjyko8&index=1&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd',
|
2017-06-02 18:28:38 +00:00
|
|
|
video: 'https://app.filebot.net/getting-started/videos/rename.mp4',
|
2015-06-05 16:52:57 +00:00
|
|
|
image: 'images/rename.png',
|
|
|
|
thumb: 'images/rename.thumb.png'
|
|
|
|
}, {
|
|
|
|
link: 'https://www.youtube.com/watch?v=btNSv7AnMMw&index=2&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd',
|
2017-06-02 18:28:38 +00:00
|
|
|
video: 'https://app.filebot.net/getting-started/videos/episodes.mp4',
|
2015-06-05 16:52:57 +00:00
|
|
|
image: 'images/episodes.png',
|
|
|
|
thumb: 'images/episodes.thumb.png'
|
|
|
|
}, {
|
|
|
|
link: 'https://www.youtube.com/watch?v=q-oZ_hovsTY&index=3&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd',
|
2017-06-02 18:28:38 +00:00
|
|
|
video: 'https://app.filebot.net/getting-started/videos/subtitle-lookup.mp4',
|
2015-06-05 16:52:57 +00:00
|
|
|
image: 'images/subtitle-hash-lookup.png',
|
|
|
|
thumb: 'images/subtitle-hash-lookup.thumb.png'
|
|
|
|
}, {
|
|
|
|
link: 'https://www.youtube.com/watch?v=R80tKtHf4zw&index=4&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd',
|
2017-06-02 18:28:38 +00:00
|
|
|
video: 'https://app.filebot.net/getting-started/videos/subtitle-search.mp4',
|
2015-06-05 16:52:57 +00:00
|
|
|
image: 'images/subtitle-search.png',
|
|
|
|
thumb: 'images/subtitle-search.thumb.png'
|
|
|
|
}, {
|
|
|
|
link: 'https://www.youtube.com/watch?v=4KWkSPr3fQY&index=5&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd',
|
2017-06-02 18:28:38 +00:00
|
|
|
video: 'https://app.filebot.net/getting-started/videos/sfv.mp4',
|
2015-06-05 16:52:57 +00:00
|
|
|
image: 'images/sfv.png',
|
|
|
|
thumb: 'images/sfv.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/rename.screenshot.png',
|
|
|
|
thumb: 'images/rename.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/format.screenshot.png',
|
|
|
|
thumb: 'images/format.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/subtitle-hash-lookup.screenshot.png',
|
|
|
|
thumb: 'images/subtitle-hash-lookup.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/subtitle-search.screenshot.png',
|
|
|
|
thumb: 'images/subtitle-search.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/sfv.screenshot.png',
|
|
|
|
thumb: 'images/sfv.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/cli.screenshot.png',
|
|
|
|
thumb: 'images/cli.screenshot.thumb.png'
|
|
|
|
}, {
|
|
|
|
image: 'images/node.screenshot.png',
|
|
|
|
thumb: 'images/node.screenshot.thumb.png'
|
|
|
|
}]
|
|
|
|
|
2017-06-02 19:27:09 +00:00
|
|
|
var embed = location.hash.length > 0
|
2015-06-12 10:44:44 +00:00
|
|
|
var youtube = !(/zh(.CN)?/i).test(navigator.locale ? navigator.locale : navigator.language) // YouTube is blocked in China (mainland)
|
2015-06-05 16:52:57 +00:00
|
|
|
|
2017-06-02 19:27:09 +00:00
|
|
|
if (embed) {
|
2015-06-05 16:52:57 +00:00
|
|
|
data = data.slice(0, 5) // use only tutorial images
|
|
|
|
|
|
|
|
if (location.hash == '#mas') {
|
|
|
|
data.splice(1, 0, {
|
|
|
|
image: 'images/permissions.png',
|
|
|
|
thumb: 'images/permissions.thumb.png'
|
2016-01-23 16:50:31 +00:00
|
|
|
}) // add sandbox permissions
|
|
|
|
data.splice(3, 1) // remove subtitle support
|
|
|
|
data.splice(3, 1) // remove subtitle support
|
2015-06-05 16:52:57 +00:00
|
|
|
} else if (location.hash == '#usc') {
|
|
|
|
data[0].link = 'https://www.youtube.com/watch?v=sEFP3CsntNs&index=6&list=PLdPvEJhzxLMCEJJpb1mJtVkOpS7FfALnd' // ubuntu video
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-02 19:27:09 +00:00
|
|
|
data.forEach(function(it) {
|
|
|
|
it.video = it[youtube ? 'link' : 'video']
|
|
|
|
})
|
|
|
|
|
2015-06-05 16:52:57 +00:00
|
|
|
if (!youtube) {
|
|
|
|
data.forEach(function(it) {
|
2017-06-02 19:27:09 +00:00
|
|
|
it['iframe'] = it.video
|
2015-06-05 16:52:57 +00:00
|
|
|
delete it.video
|
|
|
|
})
|
|
|
|
}
|
|
|
|
return data
|
|
|
|
}
|
|
|
|
|
|
|
|
function runGalleria() {
|
|
|
|
var data = getData()
|
|
|
|
|
|
|
|
Galleria.run('.galleria', {
|
|
|
|
dataSource: data,
|
|
|
|
popupLinks: true,
|
|
|
|
maxScaleRatio: 1,
|
|
|
|
youtube: {
|
|
|
|
VQ: 'HD1080'
|
|
|
|
},
|
|
|
|
thumbnails: 'lazy'
|
|
|
|
})
|
|
|
|
|
|
|
|
Galleria.ready(function() {
|
|
|
|
this.bind("image", function(e) {
|
|
|
|
if (this.doLazyLoadChunks !== false) {
|
|
|
|
this.doLazyLoadChunks = false
|
|
|
|
this.lazyLoadChunks(data.length)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.attachKeyboard({
|
|
|
|
left: this.prev,
|
|
|
|
right: this.next
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
function isFullScreen() {
|
|
|
|
return (document.fullScreenElement && document.fullScreenElement !== null) || document.mozFullScreen || document.webkitIsFullScreen
|
|
|
|
}
|
|
|
|
|
|
|
|
function requestFullScreen(element) {
|
|
|
|
if (element.requestFullscreen)
|
|
|
|
element.requestFullscreen()
|
|
|
|
else if (element.msRequestFullscreen)
|
|
|
|
element.msRequestFullscreen()
|
|
|
|
else if (element.mozRequestFullScreen)
|
|
|
|
element.mozRequestFullScreen()
|
|
|
|
else if (element.webkitRequestFullscreen)
|
|
|
|
element.webkitRequestFullscreen()
|
|
|
|
}
|
|
|
|
|
|
|
|
function exitFullScreen() {
|
|
|
|
if (document.exitFullscreen)
|
|
|
|
document.exitFullscreen()
|
|
|
|
else if (document.msExitFullscreen)
|
|
|
|
document.msExitFullscreen()
|
|
|
|
else if (document.mozCancelFullScreen)
|
|
|
|
document.mozCancelFullScreen()
|
|
|
|
else if (document.webkitExitFullscreen)
|
|
|
|
document.webkitExitFullscreen()
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggleFullScreen(element) {
|
|
|
|
if (isFullScreen())
|
|
|
|
exitFullScreen()
|
|
|
|
else
|
|
|
|
requestFullScreen(element || document.documentElement)
|
|
|
|
}
|