User:Starfleet Academy/global.js

//IMPORTS //Importing 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") { $('.WikiaHeader .GlobalNavigation').append('RC  ');} else {  $('.WikiaHeader .GlobalNavigation').append('RC  ');} }); //END adding recent changes button

//Adds links to my contribs & watchlist //under talkpage link in account nav (drop-down) -- by Starfleet Academy $(function accnavLinks { $('.WikiaHeader .AccountNavigation .subnav > li:first-child').after('<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 { $('.WikiaPageHeader .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 .module_content').append('<a href="'+ wgServer +'/wiki/'+ wgPageName +'" class="wikia-button secondary c-button" style="width: 90px; text-align: center; border-color: red; margin-top: 10px;" tabindex="2">Cancel</a>'); }); //END cancel button

//Changes the contribute button to a random page button -- by multiple users, with different outputs $(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>'); }); //END random page button.