User:Manishearth/Scripts/Snippets: Difference between revisions

Content deleted Content added
No edit summary
Line 5:
<source lang=javascript>
addOnloadHook(function(){
document.getElementById((skin=="vector")?"panel":"content").innerHTML+='<div id="p-search" style="display:block;position:fixed;bottomtop:295px;left:0px;z-index:2"><h5span langid="enfloatcont"><span><a xml:langonclick="entoggle(\'xtrasearch\');this.innerHTML=(this.innerHTML==\'+\')?\'-\':\'+\';"><label forstyle="searchInputcursor:pointer">Search-</labela></h5span><span id="xtrasearch"><form action="/w/index.php" id="searchform2"><input type="hidden" name="title" value="Special:Search"><input type="submit" name="go" class="searchButton" id="searchGoButton" value="Go" title="Go to a page with this exact name if one exists"><input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search Wikipedia for this text"><button type="button" ONCLICK="window.open(wgServer+\'/wiki/\'+document.getElementById(\'searchInput2\').value)"><img src="http://bits.wikimedia.org/skins-1.5/vector/images/external-link-ltr-icon.png"> </button><BR><input id="searchInput2" name="search" type="text" title="Search Wikipedia [alt-f]" accesskey="f" value="" autocomplete="off" size=19></form></span></span></div>';
document.getElementById("searchInput2").onkeyup=function (){document.getElementById("searchInput2Suggest").style.position="fixed"}
//And some nice little links (requires [[User:Manishearth/toolbox.js]] -- specifically the toggle() function)
document.getElementById('floatcont').innerHTML+='<div id="p-personal2"><span><a onclick="toggle(\'xtraportlet\');this.innerHTML=(this.innerHTML==\'+\')?\'-\':\'+\';" style="cursor:pointer">+</a></span><ul lang="en" xml:lang="en" id="xtraportlet" style="display:none"></ul></div>'
addPortletLink("p-personal2",wgServer+"/wiki/User:"+wgUserName,wgUserName);
addPortletLink("p-personal2",wgServer+"/wiki/User_talk:"+wgUserName,"Talk");
addPortletLink("p-personal2",wgServer+"/wiki/Special:Watchlist","Watchlist");
addPortletLink("p-personal2",wgServer+"/wiki/Special:Preferences","Preferences");
addPortletLink("p-personal2",wgServer+"/wiki/Special:Contributions/"+wgUserName,"My contribs");
addPortletLink("p-personal2",wgServer+"/wiki/User:Manishearth/Mylinks","My links");
});
 
function toggle(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
</source>
One bug (minor) If you have already scrolled down, the first letter typed into the box will cause the suggestion menu to pop up elsewhere, but this is fixed by typing another letter.
 
==FlexiDiff==
<source lang=javascript>