mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
add wrapper class for lightboxes
This commit is contained in:
parent
ea835b78dc
commit
5150376e12
@ -147,6 +147,7 @@ class CookedPostProcessor
|
||||
def add_lightbox!(img, original_width, original_height, upload=nil)
|
||||
# first, create a div to hold our lightbox
|
||||
lightbox = Nokogiri::XML::Node.new("div", @doc)
|
||||
lightbox["class"] = "lightbox-wrapper"
|
||||
img.add_next_sibling(lightbox)
|
||||
lightbox.add_child(img)
|
||||
|
||||
|
@ -94,7 +94,7 @@ describe CookedPostProcessor do
|
||||
|
||||
it "generates overlay information" do
|
||||
cpp.post_process_images
|
||||
cpp.html.should match_html '<div><a href="/uploads/default/1/1234567890123456.jpg" class="lightbox" title="uploaded.jpg"><img src="/uploads/default/_optimized/da3/9a3/ee5e6b4b0d_690x1380.jpg" width="690" height="1380"><div class="meta">
|
||||
cpp.html.should match_html '<div class="lightbox-wrapper"><a href="/uploads/default/1/1234567890123456.jpg" class="lightbox" title="uploaded.jpg"><img src="/uploads/default/_optimized/da3/9a3/ee5e6b4b0d_690x1380.jpg" width="690" height="1380"><div class="meta">
|
||||
<span class="filename">uploaded.jpg</span><span class="informations">1000x2000 1.21 KB</span><span class="expand"></span>
|
||||
</div></a></div>'
|
||||
cpp.should be_dirty
|
||||
|
Loading…
Reference in New Issue
Block a user