Swyter Tweaks for Series.ly

Puts direct links in the series.ly site.

  1. // ==UserScript==
  2. // @name Swyter Tweaks for Series.ly
  3. // @description Puts direct links in the series.ly site.
  4. // @match http://series.ly/*
  5. // @grant none
  6. // @run-at document-end
  7. // @version 2014.04.11
  8. // @author Swyter
  9. // @namespace https://greasyfork.org/users/4813
  10. // ==/UserScript==
  11.  
  12. function when_external_loaded()
  13. {
  14. console.log("Binding Swyter Tweaks for Series.ly...");
  15.  
  16. function navLink(idc,idv,host,mediaType,linkPoints)
  17. {
  18. window.open('/scripts/media/gotoLink.php?idv='+idv);
  19. /* mark entry as selected, lifted from the original function */
  20. $("#reportLink-"+idv).show();
  21. $("#link_"+idv).addClass("lastSelected");
  22. /* mark episode as seen */
  23. onEpisode(idc);
  24. }
  25. }
  26.  
  27.  
  28. // Ugly as hell so it stays crossplatform! :-)
  29. document.head.appendChild(
  30. inject_fn = document.createElement("script")
  31. );
  32.  
  33. inject_fn.innerHTML = when_external_loaded.toString().match(/{([\s\S]+)}/)[1];