User:Mathwizard1232/roughdraft/Scripts
From Wikipedia, the free encyclopedia
/*
function AddToolboxLink(link,title,id)
{
var objUL = document.all['p-tb'].children(1).children(0);
objLI = createLI('but' + id + 'Stub');
objLI.appendChild(createA(link,title));
objUL.appendChild(objLI);
}
function addToolbox()
{
var objUL = document.all['p-tb'].children(1).children(0);
var objHR = document.createElement('hr');
objUL.appendChild(objHR);
AddToolboxLink("http://en.wikipedia.org/w/index.php?title=User:Mathwizard1232/monobook.js&action=history;","Open History","TBox");
}
function QTest() {
//document.editform.wpTextbox1.value = "{{wikify}}\n\n" + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = "Various testing";
document.editform.wpMinoredit.checked = true;
//document.editform.submit();
}
// ========== Quick Wikify ==========
function doQwikify() {
document.editform.wpTextbox1.value = "{{wikify}}\n\n" + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = "Marked for wikification.";
document.editform.wpMinoredit.checked = true;
document.editform.submit();
}
function addQwikify() {
addTab("javascript:doQwikify()", "wikify", "ca-wikify", "Mark for wikification", "");
akeytt();
}
//if (document.title.indexOf("Editing ") == 0)
addOnloadHook(addQwikify);
addOnloadHook(function() {
// if this is preview page or generated page, stop
if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;
// get the page title
var pageTitle = document.title.split(" - ")[0].replace(" ", "_");
// create div and set innerHTML to link // Creating where to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:15px;margin-top:3px;">[<a href="/w/index.php?title='+pageTitle+'&action=edit§ion=0" title="'+document.title.split(" - ")[0]+'">edit top</a>]</div>';
// insert divContainer into the DOM before the h1 // Creating the actual button, I think
if(window.location.href.indexOf("&action=edit") == -1)
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
//What to do once link is followed
if(window.location.href.indexOf("&action=edit§ion=0") != -1)
{
//QTest();
}
});
/*function Button() {
// if this is preview page or generated page, stop
if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;
// get the page title
var pageTitle = document.title.split(" - ")[0].replace(" ", "_");
// create div and set innerHTML to link // Creating where to link
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:15px;margin-top:3px;">[<a href="/w/index.php?title='+pageTitle+'&action=edit§ion=0" title="'+document.title.split(" - ")[0]+'">edit top</a>]</div>';
// insert divContainer into the DOM before the h1 // Creating the actual button, I think
if(window.location.href.indexOf("&action=edit") == -1)
document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);
//What to do once link is followed
if(window.location.href.indexOf("&action=edit§ion=0") != -1)
{
if (document.getElementById("ca-hist") != -1)
{
window.alert("Found history button.");
//document.getElementById("ca-history").click();
location.href = 'http://en.wikipedia.org/w/index.php?title=User:Mathwizard1232/monobook.js&action=history';
}
//QTest();
}
}*/
//addOnloadHook(Button);
*/

