Nitorita

Anime Patchwork

Apr 16th, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. /* global $, jQuery */
  2. // ==UserScript==
  3. // @name Anime Patchwork Direct Links
  4. // @author Nitori
  5. // @description Direct links all images for Anime Patchwork
  6. // @include *ecchi.ru/blog/anime_pictures/*
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
  8. // @version 1.0
  9. // ==/UserScript==
  10. //-----------------------------------------------------------
  11. this.$ = this.jQuery = jQuery.noConflict(true); // Avoid duplicate jQuery conflict
  12. $(function() {
  13. //-----------------------------------------------------------
  14. // Set a max width
  15. $("<style type='text/css'>.photoset-image img { max-width: 900px; }</style>").appendTo("head");
  16.  
  17. // Run the function that loads all the images
  18. setTimeout(function(){
  19. var pageNum = location.href.split("/").pop().split(".")[0];
  20. location.href = "javascript:void(ls.photoset.getMore('"+pageNum+"'));";
  21. }, 1000);
  22.  
  23. // In case it's a large album
  24. setTimeout(function(){
  25. if ($("#topic-photo-more").length > 0) {
  26. var pageNum = location.href.split("/").pop().split(".")[0];
  27. location.href = "javascript:void(ls.photoset.getMore('"+pageNum+"'));"; }
  28. }, 2000);
  29.  
  30. // Convert images
  31. setTimeout(function(){
  32. $("#topic-photo-images .photoset-image").each(function(){
  33. $(this).children("img")[0].src = $(this)[0].href.replace("_1000","");
  34. //console.log($(this)[0].href.replace("_1000",""));
  35. });
  36. //-----------------------------------------------------------
  37. }, 3000);
  38. });
Advertisement
Add Comment
Please, Sign In to add comment