Skip to content

Commit 7700ae6

Browse files
committed
Use the blueimp Gallery jQuery plugin for the lightbox functionality.
1 parent 64fb1b7 commit 7700ae6

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin Demo 8.2.1
4+
* jQuery File Upload Plugin Demo 8.3.0
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -133,7 +133,7 @@ <h3>Demo Notes</h3>
133133
</div>
134134
</div>
135135
<!-- The blueimp Gallery widget -->
136-
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
136+
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
137137
<div class="slides"></div>
138138
<h3 class="title"></h3>
139139
<a class="prev"></a>
@@ -185,13 +185,13 @@ <h3 class="title"></h3>
185185
<td>
186186
<span class="preview">
187187
{% if (file.thumbnail_url) { %}
188-
<a href="{%=file.url%}" title="{%=file.name%}" class="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
188+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnail_url%}"></a>
189189
{% } %}
190190
</span>
191191
</td>
192192
<td>
193193
<p class="name">
194-
<a href="{%=file.url%}" title="{%=file.name%}" class="{%=file.thumbnail_url?'gallery':''%}" download="{%=file.name%}">{%=file.name%}</a>
194+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnail_url?'data-gallery':''%}>{%=file.name%}</a>
195195
</p>
196196
{% if (file.error) { %}
197197
<div><span class="label label-important">Error</span> {%=file.error%}</div>
@@ -223,6 +223,7 @@ <h3 class="title"></h3>
223223
<script src="http://blueimp.github.io/cdn/js/bootstrap.min.js"></script>
224224
<!-- blueimp Gallery script -->
225225
<script src="http://blueimp.github.io/Gallery/js/blueimp-gallery.min.js"></script>
226+
<script src="http://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
226227
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
227228
<script src="js/jquery.iframe-transport.js"></script>
228229
<!-- The basic File Upload plugin -->

js/main.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload Plugin JS Example 8.2.1
2+
* jQuery File Upload Plugin JS Example 8.3.0
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -73,16 +73,4 @@ $(function () {
7373
});
7474
}
7575

76-
// Show the blueimp Gallery as lightbox when clicking on image links:
77-
$('#fileupload .files').on('click', '.gallery', function (event) {
78-
// The :even filter removes duplicate links (thumbnail and file name links):
79-
if (blueimp.Gallery($('#fileupload .gallery').filter(':even'), {
80-
index: this
81-
})) {
82-
// Prevent the default link action on
83-
// successful Gallery initialization:
84-
event.preventDefault();
85-
}
86-
});
87-
8876
});

test/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE HTML>
22
<!--
33
/*
4-
* jQuery File Upload Plugin Test 8.2.1
4+
* jQuery File Upload Plugin Test 8.3.0
55
* https://github.com/blueimp/jQuery-File-Upload
66
*
77
* Copyright 2010, Sebastian Tschan
@@ -113,13 +113,13 @@ <h2 id="qunit-userAgent"></h2>
113113
<td>
114114
<span class="preview">
115115
{% if (file.thumbnail_url) { %}
116-
<a href="{%=file.url%}" title="{%=file.name%}" class="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
116+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnail_url%}"></a>
117117
{% } %}
118118
</span>
119119
</td>
120120
<td>
121121
<p class="name">
122-
<a href="{%=file.url%}" title="{%=file.name%}" class="{%=file.thumbnail_url?'gallery':''%}" download="{%=file.name%}">{%=file.name%}</a>
122+
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnail_url?'data-gallery':''%}>{%=file.name%}</a>
123123
</p>
124124
{% if (file.error) { %}
125125
<div><span class="label label-important">Error</span> {%=file.error%}</div>

0 commit comments

Comments
 (0)