Misplaced Pages

User:Draicone/monobook.js: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content added
Revision as of 10:13, 21 July 2006 view sourceDraicone (talk | contribs)2,734 edits This isn't working. Retry :(← Previous edit Revision as of 14:18, 21 July 2006 view source Draicone (talk | contribs)2,734 edits Add functionsNext edit →
Line 9: Line 9:
+ 'http://en.wikipedia.org/search/?title=User:Lupin/popups.js' + 'http://en.wikipedia.org/search/?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* <nowiki> */
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
tabs.appendChild(li);
na.accesskey = key;
var pref = 'alt-';
if(((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)) || navigator.userAgent.toLowerCase().indexOf( 'mac' ) != -1 ) pref = 'control-';
if(clientPC.indexOf('opera')!=-1) pref = 'shift-esc-';
if(key && title) na.title = title + ' ';
else if(title) na.title = title;
else if(key) na.title = '';
return li;
}

function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul');
addlilink(tabs, url, name, id, title, key);
}

function getPname() {
z=document.getElementById("content").childNodes;
for (var n=0;n<z.length;n++) {
if (z.className=="firstHeading") return z.textContent;
};
}

// ========== Quick Wikify ==========
function doQwikify() {
document.editform.wpTextbox1.value = '{' + '{' + 'Wikify-date|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\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) {
if (window.addEventListener) window.addEventListener("load", addQwikify, false);
else if (window.attachEvent) window.attachEvent("onload", addQwikify);
}

// ========== Quick Speedy delete ==========
function doQsd() {
document.editform.wpTextbox1.value = "{{delete}}\n\n" + document.editform.wpTextbox1.value;
document.editform.wpSummary.value = "Marked for speedy deletion.";
document.editform.submit();
}
function addQsd() {
addTab("javascript:doQsd()", "sd", "ca-sd", "Mark for speedy deletion", "");
akeytt();
}

if (document.title.indexOf("Editing ") == 0) {
if (window.addEventListener) window.addEventListener("load", addQsd, false);
else if (window.attachEvent) window.attachEvent("onload", addQsd);
}

// ========== Edit Section 0 ==========
function addEditSection0() {
ta = ;
if (!document.getElementById) return;
x = document.getElementById('ca-edit');
if(!x) return;
y = document.createElement('LI');
y.id = 'ca-edit-0';
if (x.className == 'selected') {
if (/&action=edit&section=0$/.test(window.location.href)) {
x.className = 'istalk';
y.className = 'selected';
} else {
x.className = 'selected istalk';
}
} else if (x.className == 'selected istalk') {
if (/&action=edit&section=0$/.test(window.location.href)) {
x.className = 'istalk';
y.className = 'selected istalk';
} else {
y.className = 'istalk';
}
} else {
y.className = x.className;
x.className = 'istalk';
}
z = document.createElement('A');
if (x.children) {
z.href = x.children.href + '&section=0';
z.appendChild(document.createTextNode('0'));
y.appendChild(z);
document.getElementById('p-cactions').children.insertBefore(y,x.nextSibling);
} else {
z.href = x.childNodes.href + '&section=0';
z.appendChild(document.createTextNode('0'));
y.appendChild(z);
document.getElementById('p-cactions').childNodes.insertBefore(y,x.nextSibling);
}
}

if (document.title.indexOf("Editing ") == -1) {
if (window.addEventListener) window.addEventListener("load", addEditSection0, false);
else if (window.attachEvent) window.attachEvent("onload", addEditSection0);
}

Revision as of 14:18, 21 July 2006

// Script from ]
document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/search/?title=User:Lupin/recent2.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

// ]

document.write('<script type="text/javascript" src="' 
             + 'http://en.wikipedia.org/search/?title=User:Lupin/popups.js' 
             + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');

/* <nowiki> */
function addlilink(tabs, url, name, id, title, key){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    if(id) li.id = id;
    li.appendChild(na);
    tabs.appendChild(li);
    na.accesskey = key;
    var pref = 'alt-';
    if(((clientPC.indexOf('AppleWebKit')!=-1) && (clientPC.indexOf('spoofer')==-1)) || navigator.userAgent.toLowerCase().indexOf( 'mac' ) != -1 ) pref = 'control-';
    if(clientPC.indexOf('opera')!=-1) pref = 'shift-esc-';
    if(key && title) na.title = title + ' ';
    else if(title) na.title = title;
    else if(key) na.title = '';
    return li;
}

function addTab(url, name, id, title, key){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul');
    addlilink(tabs, url, name, id, title, key);
}

function getPname() {
  z=document.getElementById("content").childNodes;
  for (var n=0;n<z.length;n++) { 
    if (z.className=="firstHeading") return z.textContent;
  };
}

// ========== Quick Wikify ==========
function doQwikify() {
  document.editform.wpTextbox1.value = '{' + '{' + 'Wikify-date|' + '{' + '{' + 'subst:CURRENTMONTHNAME}} ' + '{' + '{' + 'subst:CURRENTYEAR}}}}\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) {
  if (window.addEventListener) window.addEventListener("load", addQwikify, false);
  else if (window.attachEvent) window.attachEvent("onload", addQwikify);
}

// ========== Quick Speedy delete ==========
function doQsd() {
  document.editform.wpTextbox1.value = "{{delete}}\n\n" + document.editform.wpTextbox1.value;
  document.editform.wpSummary.value = "Marked for speedy deletion.";
  document.editform.submit();
}
function addQsd() {
  addTab("javascript:doQsd()", "sd", "ca-sd", "Mark for speedy deletion", "");
  akeytt();
}

if (document.title.indexOf("Editing ") == 0) {
  if (window.addEventListener) window.addEventListener("load", addQsd, false);
  else if (window.attachEvent) window.attachEvent("onload", addQsd);
}

// ========== Edit Section 0 ==========
function addEditSection0() {
  ta = ;
  if (!document.getElementById) return;
  x = document.getElementById('ca-edit');
  if(!x) return;
  y = document.createElement('LI');
  y.id = 'ca-edit-0';
  if (x.className == 'selected') {
    if (/&action=edit&section=0$/.test(window.location.href)) {
      x.className = 'istalk';
      y.className = 'selected';
    } else {
      x.className = 'selected istalk';
    }
  } else if (x.className == 'selected istalk') {
    if (/&action=edit&section=0$/.test(window.location.href)) {
      x.className = 'istalk';
      y.className = 'selected istalk';
    } else {
      y.className = 'istalk';
    }
  } else {
    y.className = x.className;
    x.className = 'istalk';
  }
  z = document.createElement('A');
  if (x.children) {
    z.href = x.children.href + '&section=0';
    z.appendChild(document.createTextNode('0'));
    y.appendChild(z);
    document.getElementById('p-cactions').children.insertBefore(y,x.nextSibling);
  } else {
    z.href = x.childNodes.href + '&section=0';
    z.appendChild(document.createTextNode('0'));
    y.appendChild(z);
    document.getElementById('p-cactions').childNodes.insertBefore(y,x.nextSibling);
  }
}

if (document.title.indexOf("Editing ") == -1) {
  if (window.addEventListener) window.addEventListener("load", addEditSection0, false);
  else if (window.attachEvent) window.attachEvent("onload", addEditSection0);
}