forked from GithubBackups/vichan
Merge pull request #404 from Pashe/catalog-hover-improvements
Catalog hover improvements
This commit is contained in:
commit
8c435737ad
@ -133,19 +133,8 @@ function imageHoverStart(e) { //Pashe, anonish, WTFPL
|
|||||||
if ($this.parent().attr("href").match("src")) {
|
if ($this.parent().attr("href").match("src")) {
|
||||||
fullUrl = $this.parent().attr("href");
|
fullUrl = $this.parent().attr("href");
|
||||||
} else if (isOnCatalog()) {
|
} else if (isOnCatalog()) {
|
||||||
$this.css("cursor", "progress");
|
fullUrl = $this.attr("data-fullimage");
|
||||||
fullUrl = $this.attr("src");
|
if (!isImage(getFileExtension(fullUrl))) {fullUrl = $this.attr("src");}
|
||||||
$.ajax(($this.parent().attr("href").replace(/\.html$/, ".json")), {
|
|
||||||
success: function (result) {
|
|
||||||
$this.css("cursor", "unset");
|
|
||||||
fullUrl = result.posts[0].tim + result.posts[0].ext;
|
|
||||||
if (!isImage(getFileExtension(fullUrl))) {return;}
|
|
||||||
$("#chx_hoverImage").attr("src", "/" + thisBoard + "/" + fullUrl);
|
|
||||||
$("#chx_hoverImage").on("load", function() {$this.css("cursor", "none")});
|
|
||||||
},
|
|
||||||
async: true,
|
|
||||||
cache: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isVideo(getFileExtension(fullUrl))) {return;}
|
if (isVideo(getFileExtension(fullUrl))) {return;}
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
{% if post.youtube %}
|
{% if post.youtube %}
|
||||||
<img src="https://img.youtube.com/vi/{{ post.youtube }}/0.jpg"
|
<img src="https://img.youtube.com/vi/{{ post.youtube }}/0.jpg"
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="{{post.file}}"
|
<img src="{{post.file}}" data-fullimage="{{post.fullimage}}"
|
||||||
{% endif %}
|
{% endif %}
|
||||||
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
|
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
|
||||||
</a>
|
</a>
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
|
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
|
||||||
|
$post['fullimage'] = $config['uri_img'] . $files[0]->file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user