diff --git a/public_html/media/css/post-upload.css b/public_html/media/css/post-upload.css
index 50b341e5..61f6ecfe 100644
--- a/public_html/media/css/post-upload.css
+++ b/public_html/media/css/post-upload.css
@@ -155,3 +155,16 @@ ul.tagit {
.post .form-wrapper {
overflow: hidden;
}
+
+#lightbox {
+ display: none;
+ position: absolute;
+ pointer-events: none;
+ max-width: 400px;
+ max-height: 400px;
+ margin-top: -50%;
+ margin-left: -50%;
+ background: white;
+ border: 0.5em solid white;
+ box-shadow: 0 0 0 3px #eee;
+}
diff --git a/public_html/media/js/post-upload.js b/public_html/media/js/post-upload.js
index 76422245..590e4a99 100644
--- a/public_html/media/js/post-upload.js
+++ b/public_html/media/js/post-upload.js
@@ -180,8 +180,7 @@ $(function()
{
return function(e)
{
- img.css('background-image', 'none');
- img.attr('src', e.target.result);
+ changeThumb(img, e.target.result);
};
})(file, img);
reader.readAsDataURL(file);
@@ -189,6 +188,14 @@ $(function()
});
}
+ function changeThumb(img, url)
+ {
+ $(img)
+ .css('background-image', 'none')
+ .attr('src', url)
+ .data('custom-thumb', true);
+ }
+
function handleURLs(urls)
{
handleInputs(urls, function(postDom, url)
@@ -202,18 +209,13 @@ $(function()
{
postDom.find('.file-name strong')
.text(data.data.title);
- postDom.find('img')
- .css('background-image', 'none')
- .attr('src', data.data.thumbnail.hqDefault);
+ changeThumb(postDom.find('img'), data.data.thumbnail.hqDefault);
});
}
else
{
- postDom.find('.file-name strong')
- .text(url);
- postDom.find('img')
- .css('background-image', 'none')
- .attr('src', url);
+ postDom.find('.file-name strong').text(url);
+ changeThumb(postDom.find('img'), url);
}
});
}
@@ -240,4 +242,24 @@ $(function()
else
$('#upload-step2').fadeIn();
}
+
+ $('.post img').mouseenter(function(e)
+ {
+ if ($(this).data('custom-thumb') != true)
+ return;
+
+ $('#lightbox')
+ .attr('src', $(this).attr('src'))
+ .show()
+ .position({
+ of: $(this),
+ my: 'center center',
+ at: 'center center',
+ })
+ .show();
+ });
+ $('.post img').mouseleave(function(e)
+ {
+ $('#lightbox').hide();
+ });
});
diff --git a/src/Views/post-upload.phtml b/src/Views/post-upload.phtml
index 66f59712..0e32d14a 100644
--- a/src/Views/post-upload.phtml
+++ b/src/Views/post-upload.phtml
@@ -107,3 +107,5 @@ LayoutHelper::addScript('../lib/tagit/jquery.tagit.js');
+
+