New Inline Tier Charts

This will provide an inline tier chart for Dawn of the Dragons.Maps created by Brayden.Tiers collected by Warric.

当前为 2017-01-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name New Inline Tier Charts
  3. // @namespace DusanAndWarric
  4. // @description This will provide an inline tier chart for Dawn of the Dragons.Maps created by Brayden.Tiers collected by Warric.
  5. // @include http://www.27thdimension.com/dotd/tierChartsStandalone.html
  6. // @include http://www.kongregate.com/games/5thplanetgames/dawn-of-the-dragons*
  7. // @include https://www.kongregate.com/games/5thplanetgames/dawn-of-the-dragons*
  8. // @include http://www.kongregate.com/games/5thPlanetGames/dawn-of-the-dragons*
  9. // @include https://www.kongregate.com/games/5thPlanetGames/dawn-of-the-dragons*
  10. // @include http://kongregate.com/games/5thplanetgames/dawn-of-the-dragons*
  11. // @include https://kongregate.com/games/5thplanetgames/dawn-of-the-dragons*
  12. // @include http://kongregate.com/games/5thPlanetGames/dawn-of-the-dragons*
  13. // @include https://kongregate.com/games/5thPlanetGames/dawn-of-the-dragons*
  14. // @include http://www.dawnofthedragons.com/game*
  15. // @include http://www.dawnofthedragons.com/
  16. // @include http://www.dawnofthedragons.com
  17. // @include http://dawnofthedragons.com/game*
  18. // @include http://www.newgrounds.com/portal/view/609826*
  19. // @include http://newgrounds.com/portal/view/609826*
  20. // @include http://dawnofthedragons.com/
  21. // @include http://armorgames.com/dawn-of-the-dragons-game/13509*
  22. // @include http://www.armorgames.com/dawn-of-the-dragons-game/13509*
  23. // @version 3.0.3
  24. // @grant none
  25. // ==/UserScript==
  26. (function(data){
  27. "use strict";
  28. var create = function(label, src,addButton) {
  29. var wrapper = document.createElement("li");
  30. wrapper.appendChild(document.createElement("img"));
  31. //handling image
  32. wrapper.firstChild.setAttribute("src",src);
  33. wrapper.firstChild.setAttribute("alt",label);
  34. wrapper.firstChild.setAttribute("onclick","this.parentNode.setAttribute('class','')");
  35. //adding button
  36. addButton(label,"this.parentNode.setAttribute('class',this.parentNode.getAttribute('class')==='active'?'':'active');",wrapper);
  37. //returning result
  38. return wrapper;
  39. };
  40. var addButton = function(label,func,parent) {
  41. parent.appendChild(document.createElement("button"));
  42. parent.lastChild.setAttribute("onclick",func);
  43. parent.lastChild.appendChild(document.createTextNode(label));
  44. };
  45. var list = document.createElement("ul");
  46. list.setAttribute("id","NewInlineTierCharts");
  47. list.appendChild(document.createElement("li"));
  48. addButton("Switch Side","this.parentNode.parentNode.setAttribute('class',this.parentNode.parentNode.getAttribute('class')==='right'?'':'right');",list.firstChild);
  49. for(var counter=0;counter<data.length;counter++) {
  50. list.appendChild(create(data[counter][0],data[counter][1],addButton));
  51. }
  52. var styles = document.createElement("style");
  53. styles.setAttribute("type","text/css");
  54. styles.appendChild(document.createTextNode(
  55. "#NewInlineTierCharts{position:fixed;top:0;left:0;z-index:100000;}"+
  56. "#NewInlineTierCharts.right{left:auto;right:0;}"+
  57. "#NewInlineTierCharts,#NewInlineTierCharts li{margin:0;padding:0;list-style: none;display:block;}"+
  58. "#NewInlineTierCharts img{width:auto;display:none;background-color:#fff;}"+
  59. "#NewInlineTierCharts button{color:#000;border: 1px solid #000;width:60px;display:block;background-color:#fff;background-image:linear-gradient(to bottom,rgba(255,255,255,0.1),rgba(255,255,255,0.2),rgba(0,0,0,0.1));font-weight:normal;line-height:normal;}"+
  60. "#NewInlineTierCharts .active img{display:block;position:fixed;top:0;left:62px;z-index:100000;}"+
  61. "#NewInlineTierCharts.right .active img{left:auto;right:62px;}"+
  62. "#NewInlineTierCharts .active button{background:#222;color:#fff;}"
  63. ));
  64. document.getElementsByTagName("head")[0].appendChild(styles);
  65. document.getElementsByTagName("body")[0].appendChild(list);
  66. })(
  67. [
  68. ["Z1-9","http://i.imgur.com/396UKjy.png"],
  69. ["Small","http://image.prntscr.com/image/b6dd93cca3c94725aa4f76b32337cec3.png"],
  70. ["Med","http://image.prntscr.com/image/6370121658fb4f859f877ae5d4e525d6.png"],
  71. ["Large","http://image.prntscr.com/image/460e45426e3b4e5f9c7c54890cda0a42.png"],
  72. ["Epic","http://image.prntscr.com/image/22daf6034f434cf489f754d00e199f2d.png"],
  73. ["Colo","http://image.prntscr.com/image/4d6c9cf28e4f4bdfafdc34e50ee68fac.png"],
  74. ["Giga","http://image.prntscr.com/image/60d795ad46094c318b22b5f2a4f07b66.png"],
  75. ["Elite","http://image.prntscr.com/image/bbf3151e78624377a4c8a82fc32362c1.png"],
  76. ["Old Guild","http://image.prntscr.com/image/6afdca29e2f14617ad6ee220615ebc54.png"],
  77. ["Guild 1/2","http://image.prntscr.com/image/ecb8c73134954e61ad5990a476cd78d4.png"],
  78. ["Guild 2/2","http://image.prntscr.com/image/7df09c5b6cd8466dadb589a1ec0f91e8.png"],
  79. ["BoB Map","http://image.prntscr.com/image/c2e51e16d13d478fbf94519ce049205d.png"],
  80. ["MaM Map","http://image.prntscr.com/image/930ff0b3014946e4b47640c0e911b20b.png"],
  81. ["GD Map","http://image.prntscr.com/image/3e2dd0cba4a946019030e1de06b4d67d.png"],
  82. ["GoC Map","http://image.prntscr.com/image/d7fd2caa19424243bf72de840299c7d0.png"],
  83. ["FW Map","http://image.prntscr.com/image/9102f877110749389a61c294cdfdc5e7.png"],
  84. ["NQ Map","http://image.prntscr.com/image/8ff8ffda715249ceab473cde5f1eca0d.png"],
  85. ["RT Map","http://image.prntscr.com/image/c5e04173e4944041a02f234b7e4297fb.png"]
  86. ]
  87. );