User:Joe N/monobook.js
Appearance
(Redirected from User:Borg Sphere/monobook.js)
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:Joe N/monobook.css. |
importScript('User:Ioeth/friendly.js');
var magicURL = "http://books.google.com/";
importScript('User:Lunchboxhero/externISBN.js');
importScript('User:Ioeth/friendly.js');
FriendlyConfig = {
watchWelcomes : false,
markWelcomesAsMinor : true,
insertUsername : true,
insertSignature : true,
quickWelcomeMode : "semiauto",
quickWelcomeTemplate : "Welcome",
maskTemplateInSummary : true,
markSharedAsMinor : true,
groupByDefault : true,
watchTaggedPages : false,
markTaggedPagesAsMinor : true
};
importScript('User:TheFearow/qstring.js');
$(doAddQuickPreview);
function doAddQuickPreview() {
if ((mw.config.get('wgAction') != "edit") && (mw.config.get('wgAction') != "submit")) return;
var qbutton = document.getElementById("wpPreview").cloneNode(false);
qbutton.value = "Quick preview";
qbutton.type="button";
qbutton.tabindex="6";
qbutton.accessKey="g";
qbutton.id="dlQuickPreview";
qbutton.title="Preview your changes";
qbutton.addEventListener("click", doQuickPreview, false);
document.getElementById("wpPreview").parentNode.insertBefore(qbutton,document.getElementById("wpDiff"));
}
function doQuickPreview() {
var bt = document.getElementById("dlQuickPreview");
document.getElementById("contentSub").innerHTML = "Getting preview";
bt.value="Getting preview";
bt.disabled=true;
var form = document.editform;
var postData = {
'wpMinoredit': form.wpMinoredit.checked,
'wpWatchthis': form.wpWatchthis.checked,
'wpStarttime': form.wpStarttime.value,
'wpEdittime': form.wpEdittime.value,
'wpAutoSummary': form.wpAutoSummary.value,
'wpEditToken': form.wpEditToken.value,
'wpSummary': "Quick preview",
'wpTextbox1': document.editform.wpTextbox1.value
};
var addr = document.URL;
addr = addr.replace("&action=edit", "&action=submit");
addr += "&wpPreview=true&live=true";
var qwxmlhttp = sajax_init_object(null);
qwxmlhttp.overrideMimeType('text/xml');
qwxmlhttp.open( 'POST' , addr, true);
qwxmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
qwxmlhttp.onload = function() {
document.getElementById("wikiPreview").innerHTML = unescape(qwxmlhttp.responseText.replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/"/g,'"'));
bt.disabled=false;
bt.value = "Quick preview";
document.getElementById("contentSub").innerHTML = "";
}
qwxmlhttp.send(QueryString.create(postData));
}
importScript('Wikipedia:WikiProject User scripts/Scripts/qSig');
$(function () {
if (!mw.config.get('wgCanonicalSpecialPageName') || mw.config.get('wgCanonicalSpecialPageName') != "Watchlist") return;
if (!document.forms[0] || !document.forms[0].namespace) return;
var link = document.createElement('a');
link.id = 'listSince';
link.href = '#listSince'; // must have a href to show as link!
var then = +(new Date());
var fixLinkHref = function () {
var url = window.location.href.split('#')[0];
var days = (( +(new Date()) - then ) + (60 * 1000)) / (1000 * 3600 * 24);
if (url.match(/[?&]days=/))
this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days);
else
this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days;
return true;
};
link.onclick = fixLinkHref;
link.onmousedown = fixLinkHref; // react to middle clicks too
var frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode(' | '));
frag.appendChild(link);
link.appendChild(document.createTextNode('Changes'));
frag.appendChild(document.createTextNode(' since last load.'));
// just one little ID attribute would be _so_ nice...
var nsSelectForm = document.getElementsByTagName('form')[0];
nsSelectForm.parentNode.insertBefore(frag, nsSelectForm);
});
//