user:psl85/Scripts

From Minecraft Wiki
Jump to: navigation, search


Iron Pickaxe.png
This page is a work in progress.
Please help in the creation of this article by expanding or improving this page.

Here is a list of my scripts I use to customize the page. If you want to use a script I have, copy the code on the script, paste it into Special:MyPage/common.js, click "Save changes" and bypass the browser cache. To use those scripts, you'll need the following:

  • A Curse account (create one here or sign in here if you already have one)
  • A Common.js subpage to store the scripts (create or edit it here)

Gadget list[edit]

  • Script name - the name of the script.
  • Author - the author's username.
  • Description - brief description of the script.
  • Installation - the code to copy and paste into your Special:MyPage/common.js
Script name Author Description Installation
Go To Top User:Majr Adds a "Go to top" link to the bottom left corner on pages, clicking it will scroll to the top of the page. Useful on mobiles. Copy mw.loader.load( '//minecraft.gamepedia.com/index.php?title=User:Majr/goToTop.js&action=raw&ctype=text/javascript' ); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
AJAX Recent Changes Unknown Adds a checkbox on Special:RecentChanges that while checked, will live update the page every minute, reloading is not necessary Copy this code: function setCookie(c_name, value, expiredays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + expiredays); document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); } function getCookie(c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "="); if (c_start != -1) { c_start = c_start + c_name.length + 1; c_end = document.cookie.indexOf(";", c_start); if (c_end == -1) c_end = document.cookie.length; return unescape(document.cookie.substring(c_start, c_end)); } } return ""; } var ajaxPages = new Array("Special:RecentChanges"); var ajaxRCOverride = false; var rcRefresh = 30000; function ajaxRC() { appTo = $(".firstHeading"); appTo.append(' <span style="position:absolute; right:75px;"><span style="position:relative; top:2px;"><span style="position:relative; top:-12px; right:-15px;" id="autoRefreshProgress"><img src="/images/loader.gif" border="0" alt="AJAX operation in progress" /></span><span style="font-size: xx-small; cursor:help;" title="Automatically refresh the current page every ' + Math.floor(rcRefresh / 1000) + ' seconds">AUTO-REFRESH:</span><input type="checkbox" id="autoRefreshToggle"></span></span>'); $("#autoRefreshToggle").click(function () { setCookie("ajaxRC", $("#autoRefreshToggle").is(":checked") ? "on" : "off") loadRCData() }); $("#autoRefreshProgress").hide(); if (getCookie("ajaxRC") == "on" || ajaxRCOverride) { $("#autoRefreshToggle").attr("checked", "checked"); setTimeout("loadRCData();", rcRefresh); } } function loadRCData() { if (!$("#autoRefreshToggle").is(":checked")) return; $('#autoRefreshProgress').show() $(article).load(location.href + " " + article + " > *", function (data) { $(article + " .mw-collapsible").makeCollapsible(); $('#autoRefreshProgress').hide() if ($("#autoRefreshToggle").is(":checked")) setTimeout("loadRCData();", rcRefresh); }); } $(function () { article = "#bodyContent"; for (x in ajaxPages) { if (mw.config.get('wgPageName') == ajaxPages[x] && $("#autoRefreshToggle").length == 0) ajaxRC(); } }); function setUpSynchTable () { var tables = document.getElementsByClassName("awardsSynchronisedTable"); for (var k = 0; k < tables.length; k++) { var rows = tables[k].rows; for (var i = 0; i < rows.length; i++) { var cells = rows[i].cells; for (var j = 0; j < cells.length; j++) { cells[j].style.verticalAlign = "top"; var synchDiv = document.createElement("DIV"); synchDiv.style.position = "relative"; synchDiv.className = "synchDiv"; var childs = cells[j].childNodes; while (childs.length > 0) { synchDiv.appendChild(childs[0]); } cells[j].appendChild(synchDiv); } } } if (tables.length > 0) { document.onscroll = synchTableOnScroll; } } function synchTableOnScroll() { var divs = document.getElementsByClassName("synchDiv"); for (var i = 0; i < divs.length; i++) { var parent = divs[i].parentNode; var parentRect = parent.getBoundingClientRect(); var offset; if (window.innerHeight > divs[i].offsetHeight) { offset = Math.min(Math.max(-1 * parentRect.top, 0), parent.clientHeight - divs[i].offsetHeight); } else { offset = Math.min(Math.max(-1 * parentRect.top / (parent.clientHeight - window.innerHeight) * (parent.clientHeight - divs[i].offsetHeight), 0), parent.clientHeight - divs[i].offsetHeight); } divs[i].style.top = offset + "px"; } } to your Special:MyPage/common.js, hit "Save changes" and bypass your cache. WARNING: This script is experimental and may not work if you not completely clear your cache
BlockIndicator Unknown Adds an image to the top right on blocked user's pages, to easily see which users who are blocked from editing. Copy mw.loader.load( '//sv.wikipedia.org/w/index.php?title=Mediawiki:Gadget-BlockIndicator.js&action=raw&ctype=text/javascript' ); (modified to use on this wiki) and paste it into your Special:Mypage/common.js, hit "Save changes, and bypass your cache.
HotCat Unknown Allows quick addition, modification, and removing of categories on wiki pages. Read this manual on Wikipedia for a guide how to use this gadget. Copy mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' ); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
Navigation Popups Unknown Gives a page preview, user information (if hovered over a userlink), file description (if hovered over a file) and some editing functions, including quickly editing talk page to add new section. Full guide on wp:Tools/Navigation popups Copy mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-popups.js&action=raw&ctype=text/javascript'); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
Edittop Unknown Adds an [edit] link to the intro section, which allows editing the intro. Copy mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-edittop.js&action=raw&ctype=text/javascript'); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
Safetyedit wikipedia:User:Epicgenius Adds a tickbox that MUST be ticked to allow saving while editing a page. If the tickbox is not ticked, edits cannot be saved - the save button is locked Copy mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Epicgenius/safetyedit.js&action=raw&ctype=text/javascript'); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
wikEd wikipedia:User:Cacycle A modern JavaScript wikitext editor that could be used as alternative to the classic wikitext editor. (full documentation on wikipedia:User:Cacycle/wikEd), manual can be found here Copy mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js&action=raw&ctype=text/javascript'); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.
New-section-plus Unknown Replaces the "Add topic" tab to instead show a +. Copy mw.loader.load('//en.wikipedia.org/w/index.php?title=Mediawiki:Gadget-addsection-plus.js&action=raw&ctype=text/javascript'); and paste it into your Special:MyPage/common.js, hit "Save changes" and bypass your cache.

All gadgets are copied from Wikipedia, and be careful for issues and errors. USE THIS GADGETS AT YOUR OWN RISK

Userboxes[edit]

Will shortly be created.


This is a user subpage of psl85, and should only be edited by psl85.