Protected page

User:Codeine/uncyclopedia.js

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Note: After saving, you have to bypass your browser's cache to see the changes.

  • Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button, or press Ctrl+F5.
  • Firefox: hold down the Shift key while clicking Reload; alternatively press Ctrl+F5 or Ctrl-Shift-R.
  • Opera, Konqueror and Safari users can just click the Reload button.
  • Chrome: press Ctrl+F5 or Shift+F5
// <nowiki>

var displayFlashOverride = true;

function addSomeButtons() {
  if(wgNamespaceNumber == 0) {
    addPortletLink('p-cactions', 'http://www.google.com/search?q=%22' + encodeURIComponent(wgPageName) + '%22', 'google', 'ca-google', 'g','Google search this topic');
    addPortletLink('p-cactions', 'http://en.wikipedia.org/wiki/Special:Search?search=' + encodeURIComponent(wgPageName) + '&go=Go', 'en.wp', 'ca-enwp','`','Check en.wikipedia for this topic');
  }
  if(wgArticleId != 0) {
    addPortletLink('p-cactions', wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&action=purge', 'purge', 'ca-purge', 'p', 'Purge the internal cache for this page');
  }
  if(wgAction == 'edit' || wgAction == 'submit') {
    addPortletLink('p-cactions','javascript:addtag("","","{{MTUsign|~~" + "~" + "~~}}","+MTU tagging (please move/expand/delete)")','mtu','ca-mtu', 'u', 'Tag with MTU');
    addPortletLink('p-cactions','javascript:addtag("","","{{ICU|~~" + "~" + "~~|fix}}","+ICU tagging (improve or die)")','icu','ca-icu', 'n', 'Tag with NRV');
    addPortletLink('p-cactions','javascript:replacepage("#REDIRECT:[[","]]",wgPageName,"making redirect")','redirect','ca-redirect', 'r', 'Turn page into a redirect');
  }
}
addOnloadHook(addSomeButtons);

if(wgCanonicalSpecialPageName == 'Contributions') {
  appendScript('http://www.wikia.com/index.php?title=User:Splarka/contribtools.js&action=raw&ctype=text/javascript');
}

function addtag(txtopen,txtclose,txtsample,summary) {
  if(!document.editform) return;
  document.editform.wpSummary.value = summary;
  document.editform.wpMinoredit.checked = true;
  document.editform.wpWatchthis.checked = false;
  insertTags(txtopen,txtclose,txtsample);
  document.editform.wpSave.focus();
}

function replacepage(txtopen,txtclose,txtsample,summary) {
  if(!document.editform) return;
  document.editform.wpSummary.value = summary;
  document.editform.wpMinoredit.checked = false;
  document.editform.wpWatchthis.checked = false;
  document.editform.wpTextbox1.value = '';
  insertTags(txtopen,txtclose,txtsample);
  document.editform.wpSave.focus();
}

function appendScript(url) {
  var scriptElem = document.createElement('script');
  scriptElem.setAttribute('src',url);
  scriptElem.setAttribute('type','text/javascript');
  document.getElementsByTagName('head')[0].appendChild(scriptElem);
}


// </nowiki>

// 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;