User:Davidgothberg/vector.js: Difference between revisions

Content deleted Content added
Showing davidClockDate again.
m Maintenance: Replacing addPortletLink() with mw.util.addPortletLink() (mw:ResourceLoader/Migration_guide_(users)#addPortletLink)
 
(9 intermediate revisions by 3 users not shown)
Line 1:
/* A JavaScript file loaded from my local web server for testing. */
importScriptURImw.loader.load( 'http://localhost:8080/wikipediatest.js' );
 
 
Line 18:
 
/* New messages history */
//importScript( "User:Davidgothberg/newmessageshistory.js" );
 
 
Line 24:
// Add some links in the navigation and toolbox menus
// on the left side of the page.
// NOTE! My code here should be updated with new function names et.c.,
addOnloadHook( function() {
// see message at [[User talk:Davidgothberg/vector.js]].
addOnloadHook$( function() {
// Add an "Extended search" link to the "navigation" menu".
mw.util.addPortletLink( 'p-navigation', mw.config.get('wgArticlePath').replace("$1", "Special:Search"), 'Extended search', 'pt-search', 'More search options' );
// Add "Secure server view" or "Normal server view" link.
if( wgServer == "http://en.wikipedia.org" ) {
addPortletLink( "p-tb",
"https://secure.wikimedia.org/wikipedia/en/wiki/" + wgPageName,
"Secure server view", "pt-securepage", "Secure server view" );
}
else if( wgServer == "https://secure.wikimedia.org" ) {
addPortletLink( "p-tb",
"http://en.wikipedia.org/wiki/" + wgPageName,
"Normal server view", "pt-securepage", "Normal server view" );
}
// List subpages of the current page.
mw.util.addPortletLink( "p-tb", mw.config.get('wgScript') + "?title=Special:PrefixIndex/" + mw.config.get('wgPageName') + "/",
"Subpages", "pt-subpages", "Subpages" );
// List template transclusion count of the current template page.
if ( mw.config.get('wgNamespaceNumber') == 10 || mw.config.get('wgNamespaceNumber') == 11 ) {
mw.util.addPortletLink( "p-tb",
"http://toolserver.org/~jarry/templatecount/index.php?lang=en&name="
+ mw.config.get('wgTitle') + "#bottom",
"Template transclusions", "pt-transclusion-count", "Transclusion count" );
}
Line 71 ⟶ 61:
/* Makes the "compare selected revisions" button on history pages
into a link (allows diffs in new windows, tabs, etc.)
[[User:Superm401/Compare link.js]] */
(Stopped working when they redesigned the history pages.) */
//importScript("User:Superm401/Compare link.js");
 
 
 
/* Colour matching brackets in a copy of the edit box.
[[User:ais523/bracketmatch.js]] */
(Stopped working when they redesigned the edit box.)*/
//importScript("User:ais523/bracketmatch.js");
 
Line 85 ⟶ 77:
much faster than standard preview/changes buttons.
[[User:Js/ajaxPreview]] */
 
importScript("User:Js/ajaxPreview.js");
ajaxPreviewButton = 'P'; // "Preview" button text, when above.
ajaxDiffButton = 'D'; // "Changes" button text, when above.
ajaxPreviewPos = 'bottom'; // Buttons on the bottom, replacing standard.
/*/ Code to execute after each preview update. */
ajaxPreviewExec = function(previewArea) {
if (window.setupTooltips)
Line 115 ⟶ 108:
}
 
addOnloadHook$( function() {
// document.getElementById('p-cactions').className = 'vectorTabs';
var elems = document.getElementById('p-cactions').getElementsByTagName('li');