scrapTF emote menu Bookmarklet

LMB adds to chat, RMB removes from list

Source (lukiday.xyz)


Download Bookmarklet:


View Bookmarklet Code:

Bookmarklet Source Code:

javascript%3A%7B%20%20var%20menuNewContent%20%3D%20document.createElement%28%27div%27%29%3B%20%09menuNewContent.className%20%3D%20%27dropdown%20customEmoteMenu%27%3B%20%09menuNewContent.appendChild%28document.createTextNode%28%27%27%29%29%3B%20%09menuNewContent.setAttribute%28%27style%27%2C%27font-size%3A%2016px%3Bvertical-align%3A%20top%3Bline-height%3A%2039.8px%3Btext-decoration%3A%20none%3Bpadding%3A%200px%2010px%3B%20position%3A%20relative%3Btop%3A%20-1.5px%3B%27%29%3B%20%09var%20usersDropdown%20%3D%20document.getElementsByClassName%28%22users-dropdown%22%29%3B%20%09usersDropdown%5B0%5D.parentNode.insertBefore%28menuNewContent%2C%20usersDropdown%5B0%5D%29%3B%20menuNewContent.innerHTML%3D%27%3Ca%20accesskey%3D%22S%22%20data-toggle%3D%22dropdown%22%20href%3D%22https%3A//chat.scrap.tf/chat%23%22%20aria-expanded%3D%22false%22%3E%20%3Ci%20class%3D%22fa%20fa-smile-o%22%3E%3C/i%3E%3C/a%3E%3Cul%20class%3D%22dropdown-menu%22%20role%3D%22menu%22%20style%3D%22max-height%3A%20924px%3B%20padding%3A%200px%2010px%3B%22%3E%3Cspan%20id%3D%22ulmenu%22%3E%3C/span%3E%3Cli%3E%3Cinput%20style%3D%22padding%3A%202px%2010px%3B%20color%3A%23000%3B%22type%3D%22text%22%20name%3D%22emoteToAdd%22%20id%3D%22emoteToAdd%22%3E%3C/input%3E%20%3Ca%20style%3D%22margin%3A%205px%205px%2010px%205px%22%20class%3D%22btn%20btn-primary%22%20onclick%3D%22addEmote%28%29%3B%22%3EAdd%3C/a%3E%3C/li%3E%3C/ul%3E%27%3B%20var%20arrayofemotes%20%3D%20%5B%5D%3B%20arrayofemotes%20%3D%20%28localStorage.getItem%28%22ScrapTF-Emotes%22%29%29.split%28%22%2C%22%29%3B%20function%20listEmotes%28%29%7B%20%09var%20i%20%3D%200%3B%20%09var%20addTo%3B%20%09arrayofemotes.forEach%28listEmote%29%3B%20%09function%20listEmote%20%28element%29%7B%20%09%09var%20emoteNewContent%20%3D%20document.createElement%28%27li%27%29%3B%20%09%09emoteNewContent.setAttribute%28%27emoteID%27%2C%20i%29%3B%20%09%09emoteNewContent.id%3Delement%3B%20%09%09emoteNewContent.className%3D%27customEmoteListItem%27%3B%20%09%09emoteNewContent.appendChild%28document.createTextNode%28%27%27%29%29%3B%20%09%09emoteNewContent.innerHTML%3D%22%3Ca%20onclick%3D%27putInChat%28%5C%22%22%20+%20emoteNewContent.id%20+%22%5C%22%29%27%20oncontextmenu%3D%27removeEmote%28%5C%22%22%20+%20emoteNewContent.id%20+%20%22%5C%22%29%3B%20return%20false%3B%27%3E%3Cdiv%3E%22%20+%20emoteNewContent.id%20+%20%22%3C/div%3E%3C/a%3E%22%3B%20%09%09if%20%28i%3D%3D%3D0%29%7B%20%09%09%09addTo%20%3D%20document.getElementById%28%22ulmenu%22%29%3B%20%09%09%7Delse%7B%20%09%09%09var%20j%20%3D%20i-1%3B%20%09%09%09addTo%20%3D%20document.getElementById%28arrayofemotes%5Bj%5D%29%3B%20%09%09%7D%3B%20%09%09addTo.parentNode.insertBefore%28emoteNewContent%2C%20addTo.nextSibling%29%3B%20%09%09i++%3B%20%09%7D%3B%20%7D%3B%20listEmotes%28%29%3B%20function%20reloadEmotes%28%29%7B%20%20%09var%20amountOfListItems%20%3D%20document.getElementsByClassName%28%27customEmoteListItem%27%29%3B%20%09while%28amountOfListItems%5B0%5D%29%7B%20%09amountOfListItems%5B0%5D.parentNode.removeChild%28amountOfListItems%5B0%5D%29%3B%20%09%7D%3B%20%09listEmotes%28%29%3B%20%7D%3B%20function%20putInChat%28emoteName%29%7B%20%09var%20chatInput%20%3D%20document.getElementsByClassName%28%22chat-txt%22%29%3B%20%09chatInput%5B0%5D.value%20%3D%20chatInput%5B0%5D.value%20+%20%22%20%3A%22%20+%20emoteName%20+%20%22%3A%22%3B%20%7D%20function%20removeEmote%28emoteName%29%7B%20%09var%20index%20%3D%20arrayofemotes.indexOf%28emoteName%29%3B%20%09if%20%28index%20%3E%20-1%29%20%7B%20%09%09arrayofemotes.splice%28index%2C%201%29%3B%20%09%09var%20element%20%3D%20document.getElementById%28emoteName%29%3B%20%09%09element.parentNode.removeChild%28element%29%3B%20%09%09storeEmotes%28%29%3B%20%09%7D%3B%20%09return%20false%3B%20%7D%3B%20function%20addEmote%28%29%7B%20var%20emoteName%20%3D%20document.getElementById%28%22emoteToAdd%22%29.value%3B%20%09if%28%21%21emoteName%29%7B%20%09%09arrayofemotes.push%28emoteName%29%3B%20%09%09storeEmotes%28%29%3B%20%09%09reloadEmotes%28%29%3B%20%09%09document.getElementById%28%22emoteToAdd%22%29.value%20%3D%20%27%27%3B%20%09%7D%3B%20%7D%3B%20function%20storeEmotes%28%29%7B%20%09localStorage.setItem%28%22ScrapTF-Emotes%22%2C%20arrayofemotes.join%28%22%2C%22%29%29%3B%20%7D%3B%20%20%7D%3Bvoid%280%29%3B


Rate it:


Tags:

Comments

Comments so far. Add yours.