Guest User

Untitled

a guest
Oct 27th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name       Shruggy
  3. // @namespace  http://chat.stackexchange.com/rooms/19/game-development
  4. // @version    0.1
  5. // @match      http://chat.stackexchange.com/rooms/19/game-development
  6. // ==/UserScript==
  7.  
  8. var theShruggy = \\\\(°_o)/¯"
  9. var shruggyButtonText = \\(°_o)/¯"
  10. var buttonsContainer = document.getElementById("chat-buttons");
  11. var shruggyButton = document.createElement("button");
  12. shruggyButton.setAttribute("class", "button");
  13. shruggyButton.setAttribute("id", "shrugButton");
  14. shruggyButton.innerHTML = shruggyButtonText;
  15. buttonsContainer.appendChild(shruggyButton);
  16.  
  17. /* Handle paste events */
  18. function shrugClickHandler(e) {
  19.    var inputBox = document.getElementById("input");
  20.    inputBox.value = inputBox.value + theShruggy;
  21. }
  22.  
  23. document.getElementById("shrugButton").addEventListener("click", shrugClickHandler);
Advertisement
Add Comment
Please, Sign In to add comment