Advertisement
Guest User

Derpibooru Downvote Links

a guest
Jan 7th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name            Derpibooru Downvote Links
  3. // @namespace       N/A
  4. // @author          Background Pony
  5. // @description     Adds downvote links to the thumbnails on derpibooru.
  6. // @version         1
  7. // @include         https://derpiboo.ru/*
  8. // @include         https://derpibooru.org/*
  9. // @include         https://trixiebooru.org/*
  10. // @include         https://derpy-hoov.es/*
  11. // @include         http://derpiboo.ru/*
  12. // @include         http://derpibooru.org/*
  13. // @include         http://trixiebooru.org/*
  14. // @include         http://derpy-hoov.es/*
  15. // @grant           none
  16. // ==/UserScript==
  17.  
  18. // This software is public domain.
  19. // Do whatever you like with it, as long as you have fun.
  20. // Life is too short for worry, anger or bitterness.
  21.  
  22. function AddDownvoteLinks ()
  23. {
  24.    
  25.     var link_start = ' • <a class="vote_down_link" data-image-id="';
  26.     var link_end = '" href="#" rel="nofollow"><span class="downvote-span-downvoted">neigh</span><span class="downvote-span">neigh</span></a>';
  27.    
  28.     function addLink( index )
  29.     {
  30.         var imgid = $(this).attr("data-image-id");
  31.         $(this).children("span").append(link_start + imgid + link_end);
  32.     }
  33.  
  34.     function addAllLinks()
  35.     {
  36.         $("div.imageinfo").each( addLink );
  37.     }
  38.    
  39.     addAllLinks();
  40.     window.booru.interactions.setupLinks1();
  41.  
  42. }
  43.  
  44. (function () {
  45.     'use strict';
  46.  
  47.     var script = document.createElement('script');
  48.  
  49.     script.textContent = '(' + AddDownvoteLinks.toString() + ')();';
  50.     document.body.appendChild(script);
  51. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement