add: var br = document.createElement("br"); br.id = "wikitoolbar-break"; textarea.parentNode.insertBefore(br, textarea); 
context: function addWikiFormattingToolbar(textarea) {  if ((typeof(document["selection"]) == "undefined")   && (typeof(textarea["setSelectionRange"]) == "undefined")) {    return;  }    var toolbar = document.createElement("div");  toolbar.id = "wikitoolbar";  function addButton(id, title, fn) {    var a = document.createElement("a");    a.href = "#";    a.id = id;    a.title = title;    a.onclick = function() { try { fn() } catch (e) { } return false };    a.tabIndex = 400;    toolbar.appendChild(a);  }  function encloseSelection(prefix, suffix) {    textarea.focus();    var start, end, sel, scrollPos, subst;    if (typeof(document["selection"]) != "undefined") {      sel = document.selection.createRange().text;    } else if (typeof(textarea["setSelectionRange"]) != "undefined") {      start = textarea.selectionStart;      end = textarea.selectionEnd;      scrollPos = textarea.scrollTop;      sel = textarea.value.substring(start, end);    }    if (sel.match(/ $/)) { // exclude ending space char, if any      sel = sel.substring(0, sel.length - 1);      suffix = suffix + " ";    }    subst = prefix + sel + suffix;    if (typeof(document["selection"]) != "undefined") {      var range = document.selection.createRange().text = subst;      textarea.caretPos -= suffix.length;    } else if (typeof(textarea["setSelectionRange"]) != "undefined") {      textarea.value = textarea.value.substring(0, start) + subst +        textarea.value.substring(end);      if (sel) {        textarea.setSelectionRange(start + subst.length, start + subst.length);      } else {        textarea.setSelectionRange(start + prefix.length, start + prefix.length);      }      textarea.scrollTop = scrollPos;    }  }  addButton("strong", "Bold text: '''Example'''", function() {    encloseSelection("'''", "'''");  });  addButton("em", "Italic text: ''Example''", function() {    encloseSelection("''", "''");  });  addButton("heading", "Heading: == Example ==", function() {    encloseSelection("\n== ", " ==\n", "Heading");  });  addButton("link", "Link: [http://www.example.com/ Example]", function() {    encloseSelection("[", "]");  });  addButton("code", "Code block: {{{ example }}}", function() {    encloseSelection("\n{{{\n", "\n}}}\n");  });  addButton("hr", "Horizontal rule: ----", function() {    encloseSelection("\n----\n", "");  });  textarea.parentNode.insertBefore(toolbar, textarea);}
meta: 2557	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2557/4196eb2f36fe634a6bc97867d2509d15b6b3be4b/trac.js/clean/htdocs/trac.js