// ==UserScript== // @name New Inline Tier Charts // @namespace DusanAndWarric // @description This will provide an inline tier chart for Dawn of the Dragons.Maps created by Brayden.Tiers collected by Warric. // @include http://www.27thdimension.com/dotd/tierChartsStandalone.html // @include http://www.kongregate.com/games/5thplanetgames/dawn-of-the-dragons* // @include https://www.kongregate.com/games/5thplanetgames/dawn-of-the-dragons* // @include http://www.kongregate.com/games/5thPlanetGames/dawn-of-the-dragons* // @include https://www.kongregate.com/games/5thPlanetGames/dawn-of-the-dragons* // @include http://kongregate.com/games/5thplanetgames/dawn-of-the-dragons* // @include https://kongregate.com/games/5thplanetgames/dawn-of-the-dragons* // @include http://kongregate.com/games/5thPlanetGames/dawn-of-the-dragons* // @include https://kongregate.com/games/5thPlanetGames/dawn-of-the-dragons* // @include http://www.dawnofthedragons.com/game* // @include http://www.dawnofthedragons.com/ // @include http://www.dawnofthedragons.com // @include http://dawnofthedragons.com/game* // @include http://web1.dawnofthedragons.com/live_standalone* // @include http://www.newgrounds.com/portal/view/609826* // @include http://newgrounds.com/portal/view/609826* // @include http://dawnofthedragons.com/ // @include http://armorgames.com/dawn-of-the-dragons-game/13509* // @include http://www.armorgames.com/dawn-of-the-dragons-game/13509* // @version 3.1.3 // @grant none // @downloadURL none // ==/UserScript== (function(data){ "use strict"; var create = function(label, src,addButton) { var wrapper = document.createElement("li"); wrapper.appendChild(document.createElement("img")); //handling image wrapper.firstChild.setAttribute("src",src); wrapper.firstChild.setAttribute("alt",label); wrapper.firstChild.setAttribute("onclick","this.parentNode.setAttribute('class','')"); //adding button addButton(label,"this.parentNode.setAttribute('class',this.parentNode.getAttribute('class')==='active'?'':'active');",wrapper); //returning result return wrapper; }; var addButton = function(label,func,parent) { parent.appendChild(document.createElement("button")); parent.lastChild.setAttribute("onclick",func); parent.lastChild.appendChild(document.createTextNode(label)); }; var list = document.createElement("ul"); list.setAttribute("id","NewInlineTierCharts"); list.appendChild(document.createElement("li")); addButton("Switch Side","this.parentNode.parentNode.setAttribute('class',this.parentNode.parentNode.getAttribute('class')==='right'?'':'right');",list.firstChild); for(var counter=0;counter