This commit is contained in:
r888888888
2014-08-18 13:13:49 -07:00
parent 1f4811dcf7
commit 461f3b4a4d
32 changed files with 2 additions and 5 deletions

View File

@@ -0,0 +1,41 @@
(function() {
Danbooru.PostPopular = {};
Danbooru.PostPopular.nav_prev = function() {
if ($("#popular-nav-links").length) {
var href = $("#popular-nav-links a[rel=prev]").attr("href");
if (href) {
location.href = href;
}
}
}
Danbooru.PostPopular.nav_next = function() {
if ($("#popular-nav-links").length) {
var href = $("#popular-nav-links a[rel=next]").attr("href");
if (href) {
location.href = href;
}
}
}
Danbooru.PostPopular.initialize_all = function() {
if ($("#c-explore-posts").length) {
if (Danbooru.meta("enable-js-navigation") === "true") {
$(document).bind("keypress", "a", function(e) {
Danbooru.PostPopular.nav_prev();
e.preventDefault();
});
$(document).bind("keypress", "d", function(e) {
Danbooru.PostPopular.nav_next();
e.preventDefault();
});
}
}
}
})();
$(document).ready(function() {
Danbooru.PostPopular.initialize_all();
});