1
0
mirror of https://github.com/bitwarden/help synced 2025-12-12 14:23:15 +00:00

fluidbox images

This commit is contained in:
Kyle Spearrin
2017-05-23 17:10:24 -04:00
parent 18c6b37fda
commit cb2ffd927c
5 changed files with 29 additions and 3 deletions

View File

@@ -15,6 +15,9 @@
<link href="/css/styles.css?v={{'now' | date: "%s"}}" <link href="/css/styles.css?v={{'now' | date: "%s"}}"
rel="stylesheet" type="text/css"> rel="stylesheet" type="text/css">
<link href="/lib/fluidbox/css/fluidbox.min.css?v={{'now' | date: "%s"}}"
rel="stylesheet" type="text/css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
@@ -140,6 +143,9 @@
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>((window.jQuery && window.jQuery.fn && window.jQuery.fn.modal) || document.write('<script src="lib\/bootstrap\/js\/bootstrap.min.js?v={{"now" | date: "%s"}}"><\/script>'));</script> <script>((window.jQuery && window.jQuery.fn && window.jQuery.fn.modal) || document.write('<script src="lib\/bootstrap\/js\/bootstrap.min.js?v={{"now" | date: "%s"}}"><\/script>'));</script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-throttle-debounce/1.1/jquery.ba-throttle-debounce.min.js"></script>
<script src="/lib/fluidbox/js/jquery.fluidbox.min.js"></script>
<script> <script>
(function (i, s, o, g, r, a, m) { (function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
@@ -158,6 +164,16 @@
eventAction: action eventAction: action
}); });
} }
$(function () {
$('a[rel="lightbox"]').fluidbox();
$(document).keydown(function (e) {
if (e.keyCode === 27) {
$('a[rel="lightbox"]').trigger('close.fluidbox');
}
});
});
</script> </script>
</body> </body>
</html> </html>

View File

@@ -3,8 +3,8 @@
class ImageTag < Liquid::Tag class ImageTag < Liquid::Tag
def render(context) def render(context)
src = @markup.strip src = @markup.strip
"<a href=\"/images/#{src}\" target=\"_blank\"> "<a href=\"/images/#{src}\" target=\"_blank\" rel=\"lightbox\">
<img class=\"img-responsive img-thumbnail\" src=\"/images/#{src}\" /> <img class=\"img-responsive img-thumbnail img-tag\" src=\"/images/#{src}\" />
</a>" </a>"
end end
end end

View File

@@ -273,6 +273,11 @@ footer {
h5 { h5 {
font-size: 16px; font-size: 16px;
} }
.img-tag {
max-width: 600px;
max-height: 600px;
}
} }
.alert { .alert {

View File

@@ -55,6 +55,10 @@ gulp.task('lib', ['clean:lib'], function () {
{ {
src: paths.npmDir + 'lunr/lunr.js', src: paths.npmDir + 'lunr/lunr.js',
dest: paths.libDir + 'lunr' dest: paths.libDir + 'lunr'
},
{
src: paths.npmDir + 'fluidbox/dist/**/*',
dest: paths.libDir + 'fluidbox'
} }
]; ];

View File

@@ -12,6 +12,7 @@
"bootstrap-sass": "3.3.7", "bootstrap-sass": "3.3.7",
"font-awesome": "4.7.0", "font-awesome": "4.7.0",
"jquery": "2.1.4", "jquery": "2.1.4",
"lunr": "0.7.1" "lunr": "0.7.1",
"fluidbox": "2.0.0"
} }
} }