diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index 2867ddaed1..93bba05c13 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -46,15 +46,16 @@ Gallery = $.extend dialog, `<%= readHTML('Gallery.html') %>` nodes[key] = $ value, dialog for key, value of { - buttons: '.gal-buttons' - frame: '.gal-image' - name: '.gal-name' - count: '.count' - total: '.total' - sauce: '.gal-sauce' - thumbs: '.gal-thumbnails' - next: '.gal-image a' - current: '.gal-image img' + buttons: '.gal-buttons' + frame: '.gal-image' + name: '.gal-name' + dimensions: '.gal-dimensions' + count: '.count' + total: '.total' + sauce: '.gal-sauce' + thumbs: '.gal-thumbnails' + next: '.gal-image a' + current: '.gal-image img' } menuButton = $ '.menu-button', dialog @@ -179,6 +180,10 @@ Gallery = nodes.frame.scrollTop = 0 nodes.next.focus() + if Conf['Image Resolution'] and (post = g.posts.get(file.dataset.post)) and post.file.dimensions + [w, h] = post.file.dimensions.split('x') + nodes.dimensions.innerText = "#{w} x #{h} px" + # Set sauce links $.rmAll nodes.sauce if Conf['Sauce'] and Sauce.links and (post = g.posts.get(file.dataset.post)) diff --git a/src/Images/Gallery/Gallery.html b/src/Images/Gallery/Gallery.html index 9df463ae04..f3b444346b 100644 --- a/src/Images/Gallery/Gallery.html +++ b/src/Images/Gallery/Gallery.html @@ -10,6 +10,7 @@ / +
diff --git a/src/config/Config.coffee b/src/config/Config.coffee index a3443c8807..94ced9f321 100644 --- a/src/config/Config.coffee +++ b/src/config/Config.coffee @@ -245,6 +245,11 @@ Config = 'Show PDF files in gallery.' 1 ] + 'Image Resolution': [ + false + 'Shows the dimensions of the image you\'re viewing in the gallery.' + 1 + ] 'Sauce': [ true 'Add sauce links to images.' diff --git a/src/css/style.css b/src/css/style.css index cbe3c1f62c..8dd50a1fff 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -2418,6 +2418,7 @@ a:only-of-type > .remove { display: none; } .gal-name, +.gal-dimensions, .gal-count, .gal-sauce { background: rgba(0,0,0,0.6) !important; @@ -2435,6 +2436,9 @@ a:only-of-type > .remove { .gal-sauce a:hover { color: rgb(95, 95, 101) !important; } +.gal-dimensions:empty { + display: none; +} :root.gal-pdf .gal-buttons a:hover { color: rgb(204, 204, 204) !important; }