User:Starfleet Academy/global.js

//IMPORTS //Importing 'Wikimarks' gadget by Pecoes importScriptPage('Client.js', 'wikimarks'); //END importing gadget //END Imports

//Adds recent changes button to Main header -- by Starfleet Academy $(function navRC { if (wgAction == "edit" || wgPageName == "User:Starfleet_Academy/Wikimarks") { $('.WikiaHeader .GlobalNavigation').append('RC  ');} else {  $('.WikiaHeader .GlobalNavigation').append('RC  ');} }); //END adding recent changes button

//Adds links to my blog, contribs & watchlist //under talkpage link in account nav (drop-down) -- by Starfleet Academy $(function accnavLinks { $('.WikiaHeader .AccountNavigation .subnav > li:first-child').after('My blog<a data-id="mycontribs" href="/wiki/Special:Contributions/Starfleet_Academy">Contributions</a></li><a data-id="mywatchlist" href="/wiki/Special:Following">Followed pages</a></li>'); }); //END adding links to Account nav

//Adds purge link to edit menu -- by Starfleet Academy $(function purgeLink { if (wgPageName != "User:Starfleet_Academy/Wikimarks") { $('.WikiaPageHeader .wikia-menu-button .WikiaMenuElement > li:first-child').before('<a href="/index.php?title='+ wgPageName +'&action=purge" data-id="purge">Purge</a></li>'); }; if (wgCanonicalNamespace == "User", "User_talk") { $('.UserProfileActionButton .wikia-menu-button .WikiaMenuElement > li:first-child').before('<a href="/index.php?title='+ wgPageName +'&action=purge" data-id="purge">Purge</a></li>');} }); //END adding purge button

//Adds a "return to page top" link on the toolbar -- by Starfleet Academy $(function backToTheTop { if (wgAction == "view" || wgCanonicalNamespace == "Message_Wall" || wgCanonicalNamespace == "Thread") { $('.skin-oasis .WikiaFooter .toolbar .tools').append('<a href="'+ wgServer +'/wiki/'+ wgPageName +'#" class="to-top-link" title="Return to page home">Top</a></li>');} }); //END top-returning link

//Adds a cancel button to the editor -- by Starfleet Academy $(function { $('body.editor .editpage-rail .module_page_controls .buttons').after('<a href="'+ wgServer +'/wiki/'+ wgPageName +'" class="wikia-button secondary c-button" style="width: 90px; text-align: center; border-color: red; margin-top: 20px;" tabindex="2">Cancel</a>'); $('#EditPageToolbar').css("height","50px"); }); //END cancel button

//Changes the contribute button to a random page button //And adds a random in cat button on category pages -- by Starfleet Academy $(function { $('.WikiHeaderRestyle .buttons .contribute').replaceWith('<a href="'+ wgServer +'/wiki/Special:Random" title="Random Page" class="wikia-button secondary" data-id="randompage"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" height="0" width="0" class="sprite random" /> Random Page</a>'); if (wgCanonicalNamespace == "Category") { $('.WikiHeaderRestyle .buttons').append('<a href="'+ wgServer +'/wiki/Special:RandomInCategory/'+ wgTitle +'" title="Random Page" class="wikia-button secondary" data-id="randompage"><img src="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D" height="0" width="0" class="sprite random" /> RIC</a>');} }); //END random page button.