User:SysRq/uncyclopedia.js

From Uncyclopedia, the content-free encyclopedia

< User:SysRq(Difference between revisions)
Jump to: navigation, search
(Fixed your welcomer)
Line 36: Line 36:
 
var txt = document.editform.wpTextbox1;
 
var txt = document.editform.wpTextbox1;
 
if(txt.value.length > 0) txt.value += '\n';
 
if(txt.value.length > 0) txt.value += '\n';
txt.value += '{{subst:welcome}}\n~~~~';
+
txt.value += '{{subst:User:SysRq/welcome}}\n~~~~';
 
// document.editform.wpSave.focus();
 
// document.editform.wpSave.focus();
 
document.editform.wpSave.click();
 
document.editform.wpSave.click();

Revision as of 01:29, February 23, 2008

// To disable Flash on all pages, submit this form.
// To auto-enable Flash on all pages, change the below value to true.
var displayFlashOverride = true;
 
function getTemplate() {
  if (document.getElementById('toolbar')) {
   var toolbarDiv = document.getElementById('toolbar');
   var getTemplateButton = document.createElement('A');
   toolbarDiv.appendChild(getTemplateButton);
   getTemplateButton.innerHTML = '<a href="javascript:getTemplateOpenPage();"><img src="http://uncyclopedia.org/images/0/0f/Button_get_template.png" alt="Get the code of a template"></a>';
  };
}
YAHOO.util.Event.onDOMReady(getTemplate);
 
function getTemplateOpenPage() {
   var templateName = prompt('Name of page to get?', 'Template:');
      if (templateName == null) return;
   var templatePage = 'http://uncyclopedia.org/index.php?title=' + templateName + '&action=raw&ctype=text/javascript&dontcountme=s';
   window.open(templatePage,"templateWindow","toolbar=no, scrollbars=yes, resizable=yes, width=700, height= 350");
}
 
//<nowiki>
 
function welcomeslutbutton() {
    if(document.title.indexOf("Editing User talk:") == 0) { 
        var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
        addlilink(tabs, 'javascript:welcomeslut()', 'welcome', 'ca-welcome');
    }
}
addOnloadHook( welcomeslutbutton );
 
function welcomeslut() {
    document.editform.wpSummary.value = 'Welcome new user! (I am a linkslut)';
    document.editform.wpMinoredit.checked = true;
    document.editform.wpWatchthis.checked = false;
    var txt = document.editform.wpTextbox1;
    if(txt.value.length > 0) txt.value += '\n';
    txt.value += '{{subst:User:SysRq/welcome}}\n~~~~';
    // document.editform.wpSave.focus();
    document.editform.wpSave.click();
    // focus() sets focus on the save button. 
    // click() submits it automagically. 
    // Uncomment whichever you prefer -Spl
}
 
function addlilink(tabs, url, name, id) {
    var na = document.createElement('a');
    na.href = url;
    na.id = id;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}
 
 //</nowiki>
Personal tools
projects