Advertisement
Dotsarecool

Speedrun.com <a> Link Creator

Jan 20th, 2018
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Speedrun.com Run Link
  3. // @namespace com.dotsarecool.util
  4. // @version 1.2
  5. // @description Shows actual hyperlinks for runs on the leaderboard & awaiting verification
  6. // @author Dotsarecool
  7. // @match https://www.speedrun.com/*
  8. // @grant none
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. var e = document.createElement("a");
  14. $(e).addClass("btn btn-default");
  15. $(e).html("Show Links");
  16. $(e).click(function() {
  17. $("#leaderboarddiv tr.linked, #leaderboarddiv1 tr.linked").each(function(a, b) {
  18. var h = $(this).attr("data-target").split("/");
  19. var view = "/" + h[1] + "/run/" + h[3];
  20. var edit = "/" + h[1] + "/editrun/" + h[3];
  21. $(this).append("<td class='nobr center hidden-xs'><a href='"+view+"'>Link</a></td><td class='nobr center hidden-xs'><a href='"+edit+"'>Edit</a></td>");
  22. });
  23. });
  24.  
  25. domain = document.location.toString();
  26. if(domain.includes("runsawaitingverification")) {
  27. $(".panel:first-child .panel-heading:first-child").after(e);
  28. } else if (domain.includes("/user/")) {
  29. $(".pull-right").after(e);
  30. } else {
  31. $("#submitrun").after(e);
  32. }
  33. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement