scratch – Blame information for rev 115
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
115 | office | 1 | /* |
2 | * blueimp Gallery Demo JS |
||
3 | * https://github.com/blueimp/Gallery |
||
4 | * |
||
5 | * Copyright 2013, Sebastian Tschan |
||
6 | * https://blueimp.net |
||
7 | * |
||
8 | * Licensed under the MIT license: |
||
9 | * https://opensource.org/licenses/MIT |
||
10 | */ |
||
11 | |||
12 | /* global blueimp, $ */ |
||
13 | |||
14 | $(function () { |
||
15 | 'use strict' |
||
16 | |||
17 | // Load demo images from flickr: |
||
18 | $.ajax({ |
||
19 | url: 'https://api.flickr.com/services/rest/', |
||
20 | data: { |
||
21 | format: 'json', |
||
22 | method: 'flickr.interestingness.getList', |
||
23 | api_key: '7617adae70159d09ba78cfec73c13be3' // jshint ignore:line |
||
24 | }, |
||
25 | dataType: 'jsonp', |
||
26 | jsonp: 'jsoncallback' |
||
27 | }).done(function (result) { |
||
28 | var carouselLinks = [] |
||
29 | var linksContainer = $('#links') |
||
30 | var baseUrl |
||
31 | // Add the demo images as links with thumbnails to the page: |
||
32 | $.each(result.photos.photo, function (index, photo) { |
||
33 | baseUrl = 'https://farm' + photo.farm + '.static.flickr.com/' + |
||
34 | photo.server + '/' + photo.id + '_' + photo.secret |
||
35 | $('<a/>') |
||
36 | .append($('<img>').prop('src', baseUrl + '_s.jpg')) |
||
37 | .prop('href', baseUrl + '_b.jpg') |
||
38 | .prop('title', photo.title) |
||
39 | .attr('data-gallery', '') |
||
40 | .appendTo(linksContainer) |
||
41 | carouselLinks.push({ |
||
42 | href: baseUrl + '_c.jpg', |
||
43 | title: photo.title |
||
44 | }) |
||
45 | }) |
||
46 | // Initialize the Gallery as image carousel: |
||
47 | blueimp.Gallery(carouselLinks, { |
||
48 | container: '#blueimp-image-carousel', |
||
49 | carousel: true |
||
50 | }) |
||
51 | }) |
||
52 | |||
53 | // Initialize the Gallery as video carousel: |
||
54 | blueimp.Gallery([ |
||
55 | { |
||
56 | title: 'Sintel', |
||
57 | href: 'https://archive.org/download/Sintel/' + |
||
58 | 'sintel-2048-surround.mp4', |
||
59 | type: 'video/mp4', |
||
60 | poster: 'https://i.imgur.com/MUSw4Zu.jpg' |
||
61 | }, |
||
62 | { |
||
63 | title: 'Big Buck Bunny', |
||
64 | href: 'https://upload.wikimedia.org/wikipedia/commons/c/c0/' + |
||
65 | 'Big_Buck_Bunny_4K.webm', |
||
66 | type: 'video/webm', |
||
67 | poster: 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/' + |
||
68 | 'Big_Buck_Bunny_4K.webm/4000px--Big_Buck_Bunny_4K.webm.jpg' |
||
69 | }, |
||
70 | { |
||
71 | title: 'Elephants Dream', |
||
72 | href: 'https://upload.wikimedia.org/wikipedia/commons/8/83/' + |
||
73 | 'Elephants_Dream_%28high_quality%29.ogv', |
||
74 | type: 'video/ogg', |
||
75 | poster: 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/90/' + |
||
76 | 'Elephants_Dream_s1_proog.jpg/800px-Elephants_Dream_s1_proog.jpg' |
||
77 | }, |
||
78 | { |
||
79 | title: 'LES TWINS - An Industry Ahead', |
||
80 | type: 'text/html', |
||
81 | youtube: 'zi4CIXpx7Bg' |
||
82 | }, |
||
83 | { |
||
84 | title: 'KN1GHT - Last Moon', |
||
85 | type: 'text/html', |
||
86 | vimeo: '73686146', |
||
87 | poster: 'https://secure-a.vimeocdn.com/ts/448/835/448835699_960.jpg' |
||
88 | } |
||
89 | ], { |
||
90 | container: '#blueimp-video-carousel', |
||
91 | carousel: true |
||
92 | }) |
||
93 | }) |