User:Seqsea/vector.js

Source: 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.
// [[User:Lupin/popups.js]] - please include this line 

mw.loader.load(
             'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
             + '&action=raw&ctype=text/javascript&dontcountme=s');

simplePopups=true;
popupStructure='original';
popupAdminLinks=false;
popupActionsMenu=false;
popupNavLinkSeparator=' ⋅ ';
popupRevertSummary="Revert (vandalism) to revision %s using [[Wikipedia:Tools/Navigation_popups|popups]]";
popupQueriedRevertSummary="Revert (vandalism) to revision $1 dated $2 by $3 using [[Wikipedia:Tools/Navigation_popups|popups]]";

popupShortcutKeys=true;



// // This will add an [edit top] link at the top of all pages except preview pages
// by User:Pile0nades

// From http://en.wikipedia.org/wiki/Wikipedia:WikiProject_User_scripts/Scripts/Edit_Top
// Add an [edit top] link to pages
$(function () {
  // if this is preview page or generated page, stop
  if(document.getElementById("wikiPreview") || window.location.href.indexOf("/wiki/Special:") != -1) return;

  // get the page title
  var pageTitle = document.title.split(" - ")[0].replace(" ", "_"); 

  // create div and set innerHTML to link
  var divContainer = document.createElement("div");
  divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-right:15px;margin-top:3px;">[<a href="/w/index.php?title='+pageTitle+'&action=edit&section=0" title="'+document.title.split(" - ")[0]+'">edit top</a>]</div>';

  // insert divContainer into the DOM before the h1
  if(window.location.href.indexOf("&action=edit") == -1)
    document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")[0]);

  if(window.location.href.indexOf("&action=edit&section=0") != -1)
    document.getElementById("wpSummary").value = "/* Intro */ ";
});

// Stolen lovingly (User:Henrik/sandbox/google-search) from User:Henrik
 function install_search()
 {
 document.getElementById('searchBody').innerHTML='<div>'+
 '<FORM method=get action="http://www.google.com/search">'+
 '<input type=hidden name="ie" value="UTF-8" /><input type=hidden name="oe" value="UTF-8" />'+
 '<INPUT id="searchInput" name="q" type="text" accesskey="f" value="" />'+
 '<input type="hidden" name="domains" value="en.wikipedia.org" />'+
 '<input type=radio name=sitesearch value="">Web'+
 '<input type=radio name=sitesearch value="en.wikipedia.org" checked />WP'+
 '<INPUT type="submit" name="btnG" VALUE="Google Search"  /></FORM></div>';
 }
 addOnloadHook(install_search);