Skip to content

Commit f51c1a2

Browse files
committed
Layout: show embedded images in lightbox [closes #49]
1 parent e04dddc commit f51c1a2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

gulp.front.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module.exports = function () {
1717

1818
gulp.task('front-css-remote', function () {
1919
remoteSrc([
20-
'twitter-bootstrap/3.3.6/css/bootstrap.min.css'
20+
'twitter-bootstrap/3.3.6/css/bootstrap.min.css',
21+
'magnific-popup.js/1.1.0/magnific-popup.min.css'
2122
], {
2223
base: 'https://cdnjs.cloudflare.com/ajax/libs/'
2324
})
@@ -49,7 +50,8 @@ module.exports = function () {
4950
'handlebars.js/4.0.3/handlebars.min.js',
5051
'chosen/1.4.2/chosen.jquery.min.js',
5152
'canvasjs/1.7.0/canvasjs.min.js',
52-
'clipboard.js/1.5.5/clipboard.min.js'
53+
'clipboard.js/1.5.5/clipboard.min.js',
54+
'magnific-popup.js/1.1.0/jquery.magnific-popup.min.js'
5355
], {
5456
base: 'https://cdnjs.cloudflare.com/ajax/libs/'
5557
})

www/assets/front/js/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ $(function () {
9393
Componette.selectable($(this));
9494
});
9595

96+
// Embedded images in README
97+
$('.readme').find('img').each(function (i, e) {
98+
var $img = $(e).closest('a');
99+
if ($img.attr('href').match(/\.(jpeg|jpg|gif|png)$/) != null) {
100+
$img.magnificPopup({
101+
type: 'image'
102+
});
103+
}
104+
});
105+
96106
// Stats
97107
(function () {
98108
var $addon = $('#addon-stats');

0 commit comments

Comments
 (0)