User:TheFearow/smartedit.js

// Starting nice smartedit scripts importScript("User:TheFearow/ajax.js");

function simpleEdit(page, content, summary, minor){ editPage(page, content, summary, minor, false); } function simpleAppend(page, text, summary, minor){ var content = getPageText(page); content = content + "\n" + text; editPage(page, content, summary, minor, false); } function simplePrepend(page, text, summary, minor){ var content = getPageText(page); content = text + "\n" + content; editPage(page, content, summary, minor, false); } function showProgressBox(text){ var box = null; if(document.getElementById('ajaxprogressbox') == null){ box = document.createElement('div'); }else{ box = document.getElementById('ajaxprogressbox'); } box.setAttribute('id', 'ajaxprogressbox'); box.setAttribute('name', 'ajaxprogressbox'); box.setAttribute('width', '200'); box.setAttribute('height', '200'); box.style.position = "absolute"; box.style.border = "solid 1px #000000"; var x = (screen.width/2)-100; var y = (screen.height/2)-100; box.style.x = x; box.style.y = y; box.style.width = '200px'; box.style.height = '200px'; box.innerHTML =  + text + ; alert("Generated box"+x+y+': '+box.style); document.childNodes[1].appendChild(box); } function hideBox{ document.getElementById('ajaxprogressbox').style.display = 'none'; }