yohojo / Tribot Mentioner

// ==UserScript==
// @name         Tribot Mentioner
// @namespace    http://tribot.org/
// @version      0.1
// @description  Tribot mentioner
// @author       You
// @match        tribot.org/forums*
// @grant        none
// ==/UserScript==

(function() {
  'use strict';
   // Modified from https://stackoverflow.com/questions/400212/how-do-i-copy-to-the-clipboard-in-javascript
   
   var outerNames = $("strong[itemprop='name']");
   var textArea = document.createElement("textarea");

   textArea.style.position = 'absolute';
   textArea.style.background = 'transparent';

   function addText(){
       var postBox = $(".cke_wysiwyg_div");
    postBox.append('[member=' + $(this).prev()[0].textContent + ']');
   }

  for (var i = outerNames.length - 1; i >= 0; i--) {
    var paragraph = document.createElement("p");
    paragraph.style.cssText = "font-size: 14px; margin:0;font-weight:400;cursor: pointer;";
    paragraph.innerHTML = "@Mention";
    var textName = outerNames[i].textContent;
    paragraph.addEventListener("click", addText, false);
    outerNames[i].appendChild(paragraph);
  }

})();