User:Davidgothberg/monobook.js
Appearance
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 is at User:Davidgothberg/monobook.css. |
/************************************************************
Note! Old JavaScript code is stored on the talk page.
*************************************************************/
/* A JavaScript file loaded from my local web server for testing. */
importScriptURI( 'http://localhost:8080/wikipediatest.js' );
/* Works! */
/*
importStylesheet( 'User:Bob/externals.css' );
importStylesheetURI( 'http://localhost:8080/wikipediatest.css' );
*/
/*******************************************************
Note! The DavidClock has been moved to
[[User:Davidgothberg/clock.js]]. See code and usage
explanation there.
********************************************************/
window.davidClock = 300; //Static + ticking clock, every 5 minutes.
importScript( "User:Davidgothberg/clock.js" );
/* New messages history */
importScript( "User:Davidgothberg/newmessageshistory.js" );
// [[User:Lupin/popups.js]]
//importScript('User:Lupin/popups.js');
importScript('User:TheDJ/slimpopups.js');
// When true prevents loading of preview data for the popup.
simplePopups=true;
// When false makes it so the "actions" menu instead goes under the page link instead of as a separate menu.
popupActionsMenu=false;
// PopupStructure can be 'original', 'fancy', 'fancy2', 'menus', 'shortmenus', 'lite', 'nostalgia'
// popupStructure='original';
// [[User:Gerbrant/edit/top.js]]
// This will add an [edit] link at the top of all pages except preview pages and the main page.
// Originally by [[User:Pile0nades]], modified by [[User:Gerbrant]].
// [[User:Davidgothberg]] added a [purge] link.
// Add an [edit] link to pages
hookEvent("load", function ()
{
if(window.location.href.indexOf("/wiki/Special:") != -1) return;
if(document.getElementById("wikiPreview")) return;
if(document.getElementById("histlegend")) return;
if(document.getElementById("difference")) return;
if(document.getElementById("watchdetails")) return;
if(document.getElementById("mainpage")) return;
if(window.location.href.indexOf("&action=edit") == -1)
{
var pageTitle = document.title.split(" - ")[0].replace(" ", "_");
var divContainer = document.createElement("div");
divContainer.innerHTML = '<div class="editsection" style="float:right; margin-top:0px;">\
[<a href="/w/index.php?title=' + pageTitle + '&action=purge" \
title="' + pageTitle + '">purge</a>]<br/>[<a href="/w/index.php?title=' + pageTitle + '&action=edit§ion=0" \
title="' + pageTitle + '">edit</a>]</div>';
var coos = document.getElementById("coordinates");
if(coos) coos.style.right = "4.5em";
document.getElementById("content").insertBefore(
divContainer, document.getElementsByTagName("h1")[0]);
}
else if(window.location.href.indexOf("&action=edit§ion=0") != -1)
{
e = document.getElementById("wpSummary");
if(e) e.value = "/* Intro */ ";
}
});
/* Adding the "My sandbox" or "Sandbox" link. */
/*
addOnloadHook( function () {
if( wgUserName ) {
addPortletLink( 'p-personal', wgArticlePath.replace("$1", "Special:Mypage/sandbox"), 'My sandbox', 'pt-sandbox', 'Your personal sandbox', null, document.getElementById('pt-preferences'));
}
else {
addPortletLink( 'p-personal', wgArticlePath.replace("$1", "Wikipedia:Sandbox"), 'Sandbox', 'pt-sandbox', 'A sandbox where you can experiment' );
}
} );
*/
/* Add "Extended search" to the "navigation" menu. */
addOnloadHook( function() {
/* Add an "Extended search" link to the "navigation" menu". */
addPortletLink( 'p-navigation', wgArticlePath.replace("$1", "Special:Search"), 'Extended search', 'pt-search', 'More search options' );
} );
/*******************************************************
Note! The DavidClock has been moved to
[[User:Davidgothberg/clock.js]]. See code and usage
explanation there.
********************************************************/