From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// ====================================

// Twinkle anti-vandalism

// Wikipedia:WikiProject User scripts/Scripts/Twinkle

// ====================================



importScript('User:AzaToth/twinkle.js');



// ====================================

// Adds a drop-down menu to the search box to choose the namespace to search in.

// Wikipedia:WikiProject User scripts/Scripts/Multi-NS search

// ====================================



addOnloadHook(function () {

    var searchGoButton = document.getElementById('searchGoButton');

    if (!searchGoButton) return;



    var searchNsHidden = document.createElement('input');

    searchNsHidden.id = 'searchNsHidden';

    searchNsHidden.type = 'hidden';

    searchNsHidden.name = 'ns0';

    searchNsHidden.value = '1';



    var searchNsMenu = document.createElement('select');

    searchNsMenu.id = 'searchNsMenu';

    searchNsMenu.name = 'ns';

    searchNsMenu.optionssearchNsMenu.options.length = new Option('(Main)', 0);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Talk', 1);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('User', 2);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('User talk', 3);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Wikipedia', 4);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Wikipedia talk', 5);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Image', 6);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Image talk', 7);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('MediaWiki', 8);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('MediaWiki talk', 9);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Template', 10);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Template talk', 11);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Help', 12);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Help talk', 13);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Category', 14);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Category talk', 15);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Portal', 100);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Portal talk', 101);

    searchNsMenu.onchange = function () {

        searchNsHidden.name = 'ns' + (this.selectedIndex < 0 ? '0' : 

this.optionsthis.selectedIndex].value);

    };

    // From /skins-1.5/monobook/main.css?5:

    searchNsMenu.style.width = '10.9em';

    searchNsMenu.style.margin = '0';

    searchNsMenu.style.fontSize = '95%';

    searchGoButton.parentNode.insertBefore(searchNsHidden, searchGoButton);

    searchGoButton.parentNode.insertBefore(searchNsMenu, searchGoButton);

});



// ====================================

// Duplicates tabs at bottom

// Wikipedia:WikiProject User scripts/Scripts/Duplicate tabs at bottom

// ====================================



addOnloadHook(function () {

    var tabs = document.getElementById('p-cactions').cloneNode(true);

    tabs.id = 'mytabs';

    var listitems = tabs.getElementsByTagName('LI');

    for (i=0;i<listitems.length;i++) {

        if(listitemsi].id) listitemsi].id = 'mytabs-' + listitemsi].id;

    }



    content = document.getElementById("content");    // Find the content div

    content.parentNode.insertBefore(tabs, content.nextSibling);    // Place tab list right after content div

});





// ====================================

// Unwatch button on watchlist

// http://en.wikipedia.org/wiki/User_talk:Alex_Smotrov/wlunwatch.js

// ====================================



importScript('User:Alex Smotrov/wlunwatch.js');



// ====================================

// Shows version differences in body text form

// User:Cacycle/wikEdDiff

// ====================================



// install [[User:Cacycle/wikEdDiff]] enhanced diff view using ajax

document.write('<script type="text/javascript" src="'

+ 'http://en.wikipedia.org/?title=User:Cacycle/wikEdDiff.js'

+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');



// ====================================

// Edit top section

// User:Ais523/editsection0tab.js

// ====================================



// Simplified edit section 0 ([[User:ais523/editsection0tab.js]])

// <source lang="javascript">

addOnloadHook(function()

{

  var x=document.getElementById('ca-history');

  if(x!=null)

    mw.util.addPortletLink('p-cactions', mw.config.get('wgServer')+mw.config.get('wgScript')+"?title="+encodeURIComponent(mw.config.get('wgPageName'))+

                                 "&action=edit&section=0", '0', 'ca-edit-0',

                                 'Edit the lead section of this page', '0', x);

});

// </source>

// [[Category:Wikipedia scripts]]



// ====================================

// History script

// http://en.wikipedia.org/wiki/User_talk:Alex_Smotrov/histcomb.js

// ====================================



importScript('User:Alex Smotrov/histcomb.js')



addOnloadHook ( extendededitlinks ) ;

 

function extendededitlinks_get_event_target ( e ) {

  var targ ;

  if (!e) var e = window.event;

  if (e.target) targ = e.target;

  else if (e.srcElement) targ = e.srcElement;

  if (targ.nodeType == 3) targ = targ.parentNode; // defeat Safari bug

  while ( targ.nodeType != 1 || targ.className != "editsection" ) targ = targ.parentNode ;

  return targ ;

}

 

function extendededitlinks_is_relevant_heading ( current , compare ) {

  if ( current.nodeType != 1 ) return false ;

  if ( current.tagName.length != 2 ) return false ;

  if ( current.tagName.substr ( 0 , 1 ) != "H" ) return false ;

  if ( current.tagName> compare.tagName) return false ;

  return true ;

}

 

function extendededitlinks_onmouseover ( e ) {

  var target = extendededitlinks_get_event_target ( e ) ;

 

  var h2 = target ;

  while ( h2.nodeType != 1 || h2.tagName.substr(0,1) != "H" ) h2 = h2.parentNode;

 

  var newdiv = document.createElement ( "div" ) ;

  newdiv.style.backgroundColor = "#DDDDDD" ;

//  newdiv.style.border = "1px solid black" ;

//  newdiv.style.padding = "2px" ;

 

  h2.parentNode.insertBefore ( newdiv , h2 ) ;

  newdiv = h2.previousSibling ; // Unneccessary?

 

  var x = h2 ;

  do {

    var y = x ;

    x = x.nextSibling ;

    newdiv.appendChild ( y ) ;

  } while ( x && !extendededitlinks_is_relevant_heading ( x , h2 ) ) ;

 

}

 

function extendededitlinks_onmouseout ( e ) {

  var target = extendededitlinks_get_event_target ( e ) ;

 

  var h2 = target ;

  while ( h2.nodeType != 1 || h2.tagName.substr(0,1) != "H" ) h2 = h2.parentNode;

 

  var newdiv = h2 ;

  while ( newdiv.nodeType != 1 || newdiv.tagName != "DIV" ) newdiv = newdiv.parentNode;

 

  for ( var y = newdiv.firstChild ; y ; y = z ) {

    z = y.nextSibling ;

    newdiv.parentNode.insertBefore ( y , newdiv ) ;

  }

  newdiv.parentNode.removeChild ( newdiv ) ;

}

 

function extendededitlinks () {

  var spans = document.getElementsByTagName( "span" );

  for ( var i = 0 ; i < spans.length ; i++ ) {

    if ( spansi].className != "editsection" ) continue ;

    var a = spansi].getElementsByTagName("a")[0 ;

    a.onmouseover = extendededitlinks_onmouseover ;

    a.onmouseout = extendededitlinks_onmouseout ;

  }

}
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// ====================================

// Twinkle anti-vandalism

// Wikipedia:WikiProject User scripts/Scripts/Twinkle

// ====================================



importScript('User:AzaToth/twinkle.js');



// ====================================

// Adds a drop-down menu to the search box to choose the namespace to search in.

// Wikipedia:WikiProject User scripts/Scripts/Multi-NS search

// ====================================



addOnloadHook(function () {

    var searchGoButton = document.getElementById('searchGoButton');

    if (!searchGoButton) return;



    var searchNsHidden = document.createElement('input');

    searchNsHidden.id = 'searchNsHidden';

    searchNsHidden.type = 'hidden';

    searchNsHidden.name = 'ns0';

    searchNsHidden.value = '1';



    var searchNsMenu = document.createElement('select');

    searchNsMenu.id = 'searchNsMenu';

    searchNsMenu.name = 'ns';

    searchNsMenu.optionssearchNsMenu.options.length = new Option('(Main)', 0);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Talk', 1);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('User', 2);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('User talk', 3);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Wikipedia', 4);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Wikipedia talk', 5);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Image', 6);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Image talk', 7);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('MediaWiki', 8);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('MediaWiki talk', 9);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Template', 10);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Template talk', 11);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Help', 12);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Help talk', 13);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Category', 14);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Category talk', 15);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Portal', 100);

    searchNsMenu.optionssearchNsMenu.options.length = new Option('Portal talk', 101);

    searchNsMenu.onchange = function () {

        searchNsHidden.name = 'ns' + (this.selectedIndex < 0 ? '0' : 

this.optionsthis.selectedIndex].value);

    };

    // From /skins-1.5/monobook/main.css?5:

    searchNsMenu.style.width = '10.9em';

    searchNsMenu.style.margin = '0';

    searchNsMenu.style.fontSize = '95%';

    searchGoButton.parentNode.insertBefore(searchNsHidden, searchGoButton);

    searchGoButton.parentNode.insertBefore(searchNsMenu, searchGoButton);

});



// ====================================

// Duplicates tabs at bottom

// Wikipedia:WikiProject User scripts/Scripts/Duplicate tabs at bottom

// ====================================



addOnloadHook(function () {

    var tabs = document.getElementById('p-cactions').cloneNode(true);

    tabs.id = 'mytabs';

    var listitems = tabs.getElementsByTagName('LI');

    for (i=0;i<listitems.length;i++) {

        if(listitemsi].id) listitemsi].id = 'mytabs-' + listitemsi].id;

    }



    content = document.getElementById("content");    // Find the content div

    content.parentNode.insertBefore(tabs, content.nextSibling);    // Place tab list right after content div

});





// ====================================

// Unwatch button on watchlist

// http://en.wikipedia.org/wiki/User_talk:Alex_Smotrov/wlunwatch.js

// ====================================



importScript('User:Alex Smotrov/wlunwatch.js');



// ====================================

// Shows version differences in body text form

// User:Cacycle/wikEdDiff

// ====================================



// install [[User:Cacycle/wikEdDiff]] enhanced diff view using ajax

document.write('<script type="text/javascript" src="'

+ 'http://en.wikipedia.org/?title=User:Cacycle/wikEdDiff.js'

+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');



// ====================================

// Edit top section

// User:Ais523/editsection0tab.js

// ====================================



// Simplified edit section 0 ([[User:ais523/editsection0tab.js]])

// <source lang="javascript">

addOnloadHook(function()

{

  var x=document.getElementById('ca-history');

  if(x!=null)

    mw.util.addPortletLink('p-cactions', mw.config.get('wgServer')+mw.config.get('wgScript')+"?title="+encodeURIComponent(mw.config.get('wgPageName'))+

                                 "&action=edit&section=0", '0', 'ca-edit-0',

                                 'Edit the lead section of this page', '0', x);

});

// </source>

// [[Category:Wikipedia scripts]]



// ====================================

// History script

// http://en.wikipedia.org/wiki/User_talk:Alex_Smotrov/histcomb.js

// ====================================



importScript('User:Alex Smotrov/histcomb.js')



addOnloadHook ( extendededitlinks ) ;

 

function extendededitlinks_get_event_target ( e ) {

  var targ ;

  if (!e) var e = window.event;

  if (e.target) targ = e.target;

  else if (e.srcElement) targ = e.srcElement;

  if (targ.nodeType == 3) targ = targ.parentNode; // defeat Safari bug

  while ( targ.nodeType != 1 || targ.className != "editsection" ) targ = targ.parentNode ;

  return targ ;

}

 

function extendededitlinks_is_relevant_heading ( current , compare ) {

  if ( current.nodeType != 1 ) return false ;

  if ( current.tagName.length != 2 ) return false ;

  if ( current.tagName.substr ( 0 , 1 ) != "H" ) return false ;

  if ( current.tagName> compare.tagName) return false ;

  return true ;

}

 

function extendededitlinks_onmouseover ( e ) {

  var target = extendededitlinks_get_event_target ( e ) ;

 

  var h2 = target ;

  while ( h2.nodeType != 1 || h2.tagName.substr(0,1) != "H" ) h2 = h2.parentNode;

 

  var newdiv = document.createElement ( "div" ) ;

  newdiv.style.backgroundColor = "#DDDDDD" ;

//  newdiv.style.border = "1px solid black" ;

//  newdiv.style.padding = "2px" ;

 

  h2.parentNode.insertBefore ( newdiv , h2 ) ;

  newdiv = h2.previousSibling ; // Unneccessary?

 

  var x = h2 ;

  do {

    var y = x ;

    x = x.nextSibling ;

    newdiv.appendChild ( y ) ;

  } while ( x && !extendededitlinks_is_relevant_heading ( x , h2 ) ) ;

 

}

 

function extendededitlinks_onmouseout ( e ) {

  var target = extendededitlinks_get_event_target ( e ) ;

 

  var h2 = target ;

  while ( h2.nodeType != 1 || h2.tagName.substr(0,1) != "H" ) h2 = h2.parentNode;

 

  var newdiv = h2 ;

  while ( newdiv.nodeType != 1 || newdiv.tagName != "DIV" ) newdiv = newdiv.parentNode;

 

  for ( var y = newdiv.firstChild ; y ; y = z ) {

    z = y.nextSibling ;

    newdiv.parentNode.insertBefore ( y , newdiv ) ;

  }

  newdiv.parentNode.removeChild ( newdiv ) ;

}

 

function extendededitlinks () {

  var spans = document.getElementsByTagName( "span" );

  for ( var i = 0 ; i < spans.length ; i++ ) {

    if ( spansi].className != "editsection" ) continue ;

    var a = spansi].getElementsByTagName("a")[0 ;

    a.onmouseover = extendededitlinks_onmouseover ;

    a.onmouseout = extendededitlinks_onmouseout ;

  }

}

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook