Guest User

Untitled

a guest
Jun 10th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. // ==UserScript==
  2. // @name "Extra Flags for int" Complement
  3. // @namespace com.extraflagsforint.complementary
  4. // @description Complementary user script to "Extra Flags for int" that adjusts a few things
  5. // @include http*://boards.4chan.org/int/*
  6. // @include http*://boards.4chan.org/sp/*
  7. // @include http*://boards.4chan.org/pol/*
  8. // @include http*://boards.4chan.org/bant/*
  9. // @exclude http*://boards.4chan.org/int/catalog
  10. // @exclude http*://boards.4chan.org/sp/catalog
  11. // @exclude http*://boards.4chan.org/pol/catalog
  12. // @exclude http*://boards.4chan.org/bant/catalog
  13. // @version 1
  14. // @grant GM_addStyle
  15. // ==/UserScript==
  16.  
  17. GM_addStyle(".extraFlag{top:1px}");
  18. GM_addStyle(".countryFlag span{display:inline-block;width:16px;height:11px;position:relative;top:1px;background-image:url('//s.4cdn.org/image/flags.6.png');background-repeat:no-repeat;}")
  19.  
  20. var countryFlags = document.getElementsByClassName("flag");
  21. for(var i = 0; i < countryFlags.length; i++) {
  22. var flag = countryFlags[i];
  23.  
  24. var link = document.createElement("a");
  25. link.className = "countryFlag";
  26. link.href = "https://www.google.com/maps/place/" + flag.title;
  27. link.target = "_blank";
  28.  
  29. var newFlag = document.createElement("span");
  30. newFlag.title = flag.title;
  31. newFlag.className = flag.className.replace(/flag /g, "")
  32.  
  33. flag.style.display = "none";
  34. flag.parentNode.appendChild(link);
  35. link.appendChild(newFlag);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment