User:Sweetcheese/preview.js

// This script is under public domain, and comes with ABSOLUTELY NO WARRANTY. // You can use/modify/redistribute without any permission.

$(function { if(wgCanonicalNamespace != 'User_talk') return;  if(!document.getElementById('editform')) return;  var b = document.createElement('button');  b.innerHTML = 'Information';  b.setAttribute('type', 'button');  b.onclick = function {    var e = document.getElementById('editform');    if(e.wpTextbox1.value) e.wpTextbox1.value += "\n";    e.wpTextbox1.value += "\u007B\u007Bsubst:preview}}--\u007E\u007E\u007E\u007E";    e.wpSummary.value = 'Information';    e.wpSave.focus;  }  var p = document.createElement('p');  p.appendChild(b);  var s = document.getElementById('contentSub');  s.parentNode.insertBefore(p, s.nextSibling); });