User:Manishearth/Scripts/Snippets: Difference between revisions

Content deleted Content added
m Remove legacy globals per phab:T72470 (via WP:JWB)
Line 19:
//Floating faithful search bar
addOnloadHook(function(){
document.getElementById("mw-page-base").innerHTML+='<div id="p-search" style="display:inline;position:fixed;top:295px;left:0px;z-index:2"><div id="notifications"></div><span id="floatcont"><span><a onclick="toggleM(\'xtrasearch\');this.innerHTML=(this.innerHTML==\'+\')?\'-\':\'+\';" style="cursor:pointer">-</a></span><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(mw.config.get("wgServer")+\'/wiki/\'+document.getElementById(\'searchInput2\').value)"><img src="http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png"> </button><BR><input id="searchInput2" name="search" type="text" title="Search Wikipedia" value="" autocomplete="off" size=10></form></span></span></div>';
document.getElementById("searchInput2").onkeyup=function (){document.getElementById("searchInput2Suggest").style.position="fixed"}
//And some nice little links
document.getElementById('floatcont').innerHTML+='<div id="p-personal2"><span><a onclick="toggleM(\'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",mw.config.get('wgServer')+"/wiki/Special:OldReviewedPages","Pending Changes");
addPortletLink("p-personal2",mw.config.get('wgServer')+"/wiki/Special:Watchlist","Watchlist");
addPortletLink("p-personal2",mw.config.get('wgServer')+"/wiki/User:"+mw.config.get('wgUserName'),mw.config.get('wgUserName'));
addPortletLink("p-personal2",mw.config.get('wgServer')+"/wiki/User_talk:"+mw.config.get('wgUserName'),"Talk");
addPortletLink("p-personal2",mw.config.get('wgServer')+"/wiki/Special:Preferences","Preferences");
addPortletLink("p-personal2",mw.config.get('wgServer')+"/wiki/Special:Contributions/"+mw.config.get('wgUserName'),"My contribs");
});
Line 62:
 
if(document.getElementById('mw-youhavenewmessages')){
addNotification("http://en.wikipedia.org/wiki/User_talk:"+mw.config.get('wgUserName'),"exclamation","You have new messages");
}
</source>