Browse Source

fix permalink url for sections

master
kaos 9 years ago
parent
commit
aa826c9c15
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      main.js

+ 2
- 2
main.js View File

@ -66,14 +66,14 @@ function setVideoListener(){
currentVideo.name = currentVideo.target.parents("article").find("h2").text().trim() + ".gif";
});
jQuery(".main-wrap").on('contextmenu', "a", function(e) {
currentVideo.target = jQuery(event.target) ;
currentVideo.target = jQuery(event.target);
var previous = currentVideo.target.parents("article").prev();
var id = currentVideo.target.parents("article").data("entry-id");
if (previous.length > 0){
id = previous.data("entry-id");
}
currentVideo.permalink = "http://9gag.com/?id=" + id;
currentVideo.permalink = [location.protocol, '//', location.host, location.pathname].join('') + "?id=" + id;
if (currentVideo.permalink == undefined){
console.log("Warning: unable to find the permalink for this post")


Loading…
Cancel
Save