User:SuperSajuuk/wikia.js

// // Personal JS: SuperSajuuk // Last Modified: 12th April 2015, 20:23 // // This is a personal testing ground for various // JS and jQuery enhancements coded by // SuperSajuuk. You may copy any code below to your // own wikia.js files. // // Any jQuery/JS requests should be posted on // my talkpage. // // Enjoy! //

// Config if people use importScriptPage on this page. // Only use for dynamically changing variables. window.SajuukJS = window.SajuukJS || {}; var SajuukJS = $.extend({

}, window.SajuukJS);

// Default options that won't change. var myUserName = mw.config.get('wgUserName');

(function (window, $, mw) {       "use strict";        // This adds an attribute to make linking the reply box easier...        $("li.new-reply").attr("id","replybox");

// Add an "Edit Page" link on archives. var page = wgTitle; var pieces = page.search("Archive"); if(pieces > -1) { $(".WikiaPageHeader h2 a").last.after(' |  Edit This Archive'); }       // Redirect the popup uploader to Special:Upload $(window).load(function {              $("a.wikia-button.upphotos").click(function { setTimeout(function {                           window.location.href = "/wiki/Special:Upload";                      },2500); });       });

// Add content above the forums to explain them. $("a.policies-link").clone(true).appendTo('a.policies'); $("section#Forum > a.policies-link").first.before("" + " Welcome to the Narutopedia Community Forums! This is where you can discuss the series and the wiki itself. " + "Before contributing to the forums, please read our forum policies: they are simple to understand. You can find them by clicking the button to the right. " + "Forum Policies / FAQ " + " Please note that the wiki's general policies apply at all times, such as the Image Policy. " + "Any moderator requests should be directed to the Requests page. " + " Failure to heed our policies will result in written warnings, followed by wiki blocks if repeatedly ignored. " + " "); $("a.policies-link").remove; // Menu links. mw.util.addPortletLink("AccountNavigation", "/wiki/User:"+myUserName+"/DPL", "DPL", "p-dpl"); mw.util.addPortletLink("AccountNavigation", "/wiki/Special:UserRights", "Manage Rights", "p-userrights"); }(window, jQuery, mediaWiki));