add sauce to gallery
This commit is contained in:
parent
7742edd22c
commit
49a4d8c6e6
@ -51,6 +51,7 @@ Gallery =
|
|||||||
name: '.gal-name'
|
name: '.gal-name'
|
||||||
count: '.count'
|
count: '.count'
|
||||||
total: '.total'
|
total: '.total'
|
||||||
|
sauce: '.gal-sauce'
|
||||||
thumbs: '.gal-thumbnails'
|
thumbs: '.gal-thumbnails'
|
||||||
next: '.gal-image a'
|
next: '.gal-image a'
|
||||||
current: '.gal-image img'
|
current: '.gal-image img'
|
||||||
@ -178,6 +179,15 @@ Gallery =
|
|||||||
nodes.frame.scrollTop = 0
|
nodes.frame.scrollTop = 0
|
||||||
nodes.next.focus()
|
nodes.next.focus()
|
||||||
|
|
||||||
|
# Set sauce links
|
||||||
|
$.rmAll nodes.sauce
|
||||||
|
if Conf['Sauce'] and Sauce.links and (post = g.posts.get(file.dataset.post))
|
||||||
|
sauces = []
|
||||||
|
for link in Sauce.links
|
||||||
|
if (node = Sauce.createSauceLink link, post, post.files[file.dataset.file])
|
||||||
|
sauces.push $.tn(' '), node
|
||||||
|
$.add nodes.sauce, sauces
|
||||||
|
|
||||||
# Continue slideshow if moving forward, stop otherwise
|
# Continue slideshow if moving forward, stop otherwise
|
||||||
if Gallery.slideshow and (newID > oldID or (oldID is Gallery.images.length-1 and newID is 0))
|
if Gallery.slideshow and (newID > oldID or (oldID is Gallery.images.length-1 and newID is 0))
|
||||||
Gallery.setupTimer()
|
Gallery.setupTimer()
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
<a href="javascript:;" class="menu-button"><i></i></a>
|
<a href="javascript:;" class="menu-button"><i></i></a>
|
||||||
<a href="javascript:;" class="gal-close">×</a>
|
<a href="javascript:;" class="gal-close">×</a>
|
||||||
</span>
|
</span>
|
||||||
<a class="gal-name" target="_blank"></a>
|
<div class="gal-labels">
|
||||||
<span class="gal-count">
|
<span class="gal-count">
|
||||||
<span class="count"></span> / <span class="total"></span>
|
<span class="count"></span> / <span class="total"></span>
|
||||||
</span>
|
</span>
|
||||||
|
<a class="gal-name" target="_blank"></a>
|
||||||
|
<span class="gal-sauce"></span>
|
||||||
|
</div>
|
||||||
<div class="gal-prev"></div>
|
<div class="gal-prev"></div>
|
||||||
<div class="gal-image">
|
<div class="gal-image">
|
||||||
<a href="javascript:;"><img></a>
|
<a href="javascript:;"><img></a>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Sauce =
|
Sauce =
|
||||||
init: ->
|
init: ->
|
||||||
return unless g.VIEW in ['index', 'thread'] and Conf['Sauce']
|
return unless g.VIEW in ['index', 'thread'] and Conf['Sauce']
|
||||||
|
$.addClass doc, 'show-sauce'
|
||||||
|
|
||||||
links = []
|
links = []
|
||||||
for link in Conf['sauces'].split '\n'
|
for link in Conf['sauces'].split '\n'
|
||||||
|
|||||||
@ -2395,53 +2395,59 @@ a:only-of-type > .remove {
|
|||||||
bottom: 2px;
|
bottom: 2px;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
}
|
}
|
||||||
.gal-buttons,
|
.gal-labels {
|
||||||
.gal-name,
|
|
||||||
.gal-count {
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 195px;
|
|
||||||
}
|
|
||||||
.gal-hide-thumbnails .gal-buttons,
|
|
||||||
.gal-hide-thumbnails .gal-count,
|
|
||||||
.gal-hide-thumbnails .gal-name {
|
|
||||||
right: 44px;
|
|
||||||
}
|
|
||||||
.gal-name {
|
|
||||||
bottom: 6px;
|
bottom: 6px;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-direction: column;
|
||||||
|
flex-direction: column;
|
||||||
|
-webkit-align-items: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
}
|
||||||
|
:root:not(.show-sauce) .gal-sauce {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.gal-name,
|
||||||
|
.gal-count,
|
||||||
|
.gal-sauce {
|
||||||
background: rgba(0,0,0,0.6) !important;
|
background: rgba(0,0,0,0.6) !important;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 1px 5px 2px 5px;
|
padding: 1px 5px 2px 5px;
|
||||||
|
margin-top: 3px;
|
||||||
|
color: #ffffff !important;
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
color: white !important;
|
}
|
||||||
|
.gal-sauce a {
|
||||||
|
color: #ffffff !important;
|
||||||
}
|
}
|
||||||
.gal-name:hover,
|
.gal-name:hover,
|
||||||
.gal-buttons a:hover {
|
.gal-buttons a:hover,
|
||||||
|
.gal-sauce a:hover {
|
||||||
color: rgb(95, 95, 101) !important;
|
color: rgb(95, 95, 101) !important;
|
||||||
}
|
}
|
||||||
:root.gal-pdf .gal-buttons a:hover {
|
:root.gal-pdf .gal-buttons a:hover {
|
||||||
color: rgb(204, 204, 204) !important;
|
color: rgb(204, 204, 204) !important;
|
||||||
}
|
}
|
||||||
.gal-count {
|
.gal-buttons,
|
||||||
bottom: 27px;
|
.gal-labels {
|
||||||
background: rgba(0,0,0,0.6) !important;
|
position: fixed;
|
||||||
border-radius: 3px;
|
right: 195px;
|
||||||
padding: 1px 5px 2px 5px;
|
|
||||||
color: #ffffff !important;
|
|
||||||
}
|
}
|
||||||
:root:not(.gal-fit-width):not(.gal-pdf) .gal-name {
|
.gal-hide-thumbnails .gal-buttons,
|
||||||
|
.gal-hide-thumbnails .gal-labels {
|
||||||
|
right: 44px;
|
||||||
|
}
|
||||||
|
:root:not(.gal-fit-width):not(.gal-pdf) .gal-labels {
|
||||||
bottom: 23px !important;
|
bottom: 23px !important;
|
||||||
}
|
}
|
||||||
:root:not(.gal-fit-width):not(.gal-pdf) .gal-count {
|
|
||||||
bottom: 44px !important;
|
|
||||||
}
|
|
||||||
:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,
|
:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-buttons,
|
||||||
:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-name,
|
:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-labels {
|
||||||
:root.gal-fit-height:not(.gal-pdf):not(.gal-hide-thumbnails) .gal-count {
|
|
||||||
right: 178px !important;
|
right: 178px !important;
|
||||||
}
|
}
|
||||||
:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,
|
:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-buttons,
|
||||||
:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-name,
|
:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-labels {
|
||||||
:root.gal-hide-thumbnails.gal-fit-height:not(.gal-pdf) .gal-count {
|
|
||||||
right: 28px !important;
|
right: 28px !important;
|
||||||
}
|
}
|
||||||
:root.gallery-open.fixed #header-bar:not(.autohide),
|
:root.gallery-open.fixed #header-bar:not(.autohide),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user