User:Codeine/uncyclopedia.js

From Uncyclopedia, the content-free encyclopedia.

Jump to: navigation, search

Note - After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh); Konqueror: click Reload or press F5; Opera: clear the cache in Tools → Preferences; Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-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;
Personal tools