(Undo revision 442580 by SayuriDarling (talk) that's not it) Tag: sourceedit |
mNo edit summary Tag: sourceedit |
||
Line 72: | Line 72: | ||
'HyperBOT': ['bot'], |
'HyperBOT': ['bot'], |
||
'SayuriDarling': ['bureaucrat'], |
'SayuriDarling': ['bureaucrat'], |
||
− | ' |
+ | 'ArchieScotts ': ['featured'], |
}; |
}; |
||
UserTagsJS.modules.userfilter = { |
UserTagsJS.modules.userfilter = { |
Revision as of 14:49, 1 January 2016
// Any JavaScript here will be loaded for all users on every page load.
// If you do not know what you are doing, do not edit this page.
// <source lang="JavaScript">
/* Ask the Oracle */
AskTheOracle = function(){
if (document.getElementById('asktheoracle'))
{
var div_asktheoracle = document.getElementById('asktheoracle');
div_asktheoracle.innerHTML = "<object width='600' height='470'><param name='movie' value='http://images2.wikia.nocookie.net/olympians/images/4/47/Asktheoracle.swf'><embed src='http://images2.wikia.nocookie.net/olympians/images/4/47/Asktheoracle.swf' width='600' height='470'></embed></object>";
}
}
jQuery(document).ready(AskTheOracle);
// Dev Wiki imports
importArticles({
type: "script",
articles: [
"w:dev:BackToTopButton/code.js",
"w:dev:DisplayClock/code.js",
"w:dev:VisualSpellCheck/code.js",
"w:dev:SignatureCheck/code.js",
"w:dev:AntiUnicruft/code.js",
"w:dev:EditIntroButton/code.js",
"w:dev:PurgeButton/code.js",
"w:dev:AjaxBatchDelete/code.js",
"w:dev:YoutubePlayer/code.js",
"w:dev:PurgeBlogs/code.js",
"w:dev:Standard_Edit_Summary/code.js",
"w:dev:ReferencePopups/code.js",
"w:dev:ChatReload/code.js",
"w:dev:ChatModHover/code.js"
]
});
// Blogs
window.LockOldBlogs = {
expiryDays: 90
};
importArticles({
type: "script",
articles: [
"w:c:dev:LockOldBlogs/code.js"
]
});
// User Tags
window.UserTagsJS = {
modules: {
inactive: 61,
mwGroups: ['bureaucrat', 'chatmoderator', 'rollback', 'sysop', 'threadmoderator', 'bannedfromchat', 'bot', 'bot-global'],
autoconfirmed: false,
metafilter: {
sysop: ['bureaucrat'],
chatmoderator: ['sysop'],
rollback: ['sysop'],
},
newuser: true,},
tags: {
bureaucrat: { link:'Project:Bureaucrats' },
sysop: { link:'Project:Administrators' },
chatmoderator: { link:'Project:Chat Moderators' },
rollback: { u:'Rollback', link:'Project:Rollbacks' },
featured: { u:'Featured Wikian', link:'Project:Featured Wikian' },
threadmoderator: { link:'Project:Forum Moderators' },
bot: { u:'Bot', link:'Help:Bots' }
}
};
UserTagsJS.modules.custom = {
'Hyperborean': ['bureaucrat'],
'HyperBOT': ['bot'],
'SayuriDarling': ['bureaucrat'],
'ArchieScotts ': ['featured'],
};
UserTagsJS.modules.userfilter = {
'HyperBOT': ['sysop', 'inactive', 'rollback', 'chatmoderator']
};
UserTagsJS.modules.mwGroups = ['bureaucrat'];
UserTagsJS.modules.mwGroups = ['rollback'];
importArticle({type:'script', article:'w:c:dev:UserTags/code.js'});
// Open chat in new window
$(".openchat a").click(function () {
window.open('/wiki/Special:Chat', 'wikiachat', 'width=600,height=600,menubar=no,status=no,location=no,toolbar=no,scrollbars=no,resizable=yes');
return false;
});
// LockForums
window.LockForums = {
expiryDays: 90,
expiryMessage: "This forum is considered archived because it hasn\'t been commented on in over <expiryDays> days, please don\'t bump this forum!",
forumName: "Forum",
banners: true,
ignoreDeletes: true,
warningPopup: true,
};
importArticles({
type: "script",
articles: [
"w:c:dev:LockForums/code.js"
]
});
// Forum stuff
importScriptPage('MediaWiki:Common.js/Forum.js');
// *************************************************
// Experimental javascript countdown timer (Splarka)
// Version 0.0.3
// *************************************************
//
// Usage example:
// <span class="countdown" style="display:none;">
// Only <span class="countdowndate">January 01 2007 00:00:00 PST</span> until New years.
// </span>
// <span class="nocountdown">Javascript disabled.</span>
function updatetimer(i) {
var now = new Date();
var then = timers[i].eventdate;
var diff = count = Math.floor((then.getTime() - now.getTime()) / 1000);
// catch bad date strings
if (isNaN(diff)) {
timers[i].firstChild.nodeValue = '** ' + timers[i].eventdate + ' **';
return;
}
// determine plus/minus
if (diff < 0) {
diff = -diff;
var tpm = ' ';
} else {
var tpm = ' ';
}
// calcuate the diff
var left = (diff % 60) + ' seconds';
diff = Math.floor(diff / 60);
if (diff > 0) left = (diff % 60) + ' minutes ' + left;
diff = Math.floor(diff / 60);
if (diff > 0) left = (diff % 24) + ' hours ' + left;
diff = Math.floor(diff / 24);
if (diff > 0) left = diff + ' days ' + left
timers[i].firstChild.nodeValue = tpm + left;
// a setInterval() is more efficient, but calling setTimeout()
// makes errors break the script rather than infinitely recurse
timeouts[i] = setTimeout('updatetimer(' + i + ')', 1000);
}
function checktimers() {
try {
//hide 'nocountdown' and show 'countdown'
var nocountdowns = getElementsByClassName(document, 'span', 'nocountdown');
for (var i in nocountdowns) nocountdowns[i].style.display = 'none'
var countdowns = getElementsByClassName(document, 'span', 'countdown');
for (var i in countdowns) countdowns[i].style.display = 'inline'
//set up global objects timers and timeouts.
timers = getElementsByClassName(document, 'span', 'countdowndate'); //global
timeouts = new Array(); // generic holder for the timeouts, global
if (timers.length == 0) return;
for (var i in timers) {
timers[i].eventdate = new Date(timers[i].firstChild.nodeValue);
updatetimer(i); //start it up
}
} catch (err) {
console.log(err.name + " caught in MediaWiki:Common.js!");
console.log(err.stack);
}
}
addOnloadHook(checktimers);
/** Archive edit tab disabling *************************************
* Disables the edit tab on old forum topic pages to stop new people bumping old topics.
* Page can still be edited by going via the edit tab on the history etc, or by
* typing the edit address manually.
* By [[User:Spang|Spang]]
* Monaco support by [[User:Uberfuzzy|Uberfuzzy]]
* Oasis support by [[User:Uberfuzzy|Uberfuzzy]]
*/
if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {
function disableOldForumEdit() {
if( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {
return;
}
if( !document.getElementById('old-forum-warning') ) {
return;
}
if(skin == 'oasis') {
$('#WikiaPageHeader .wikia-menu-button > a').html('Archived').removeAttr('href');
return;
}
if( !document.getElementById('ca-edit') ) {
return;
}
var editLink = null;
if( skin == 'monaco' )
{
editLink = document.getElementById('ca-edit');
}
else if( skin == 'monobook' )
{
editLink = document.getElementById('ca-edit').firstChild;
}
else
{
return;
}
editLink.removeAttribute('href', 0);
editLink.removeAttribute('title', 0);
editLink.style.color = 'gray';
editLink.innerHTML = 'Archived';
$('span.editsection-upper').remove();
}
addOnloadHook( disableOldForumEdit );
}
// Facebook thing
function fBox() {
$('#fbox').append('<iframe marginheight="0" marginwidth="0" src="http://www.facebook.com/connect/connect.php?id=202082182029&connections=10&stream=1" align="top" frameborder="0" width="300" height="250" scrolling="no" />');
}
$(fBox);
function fBox2() {
$('#fbox2').append('<iframe marginheight="0" marginwidth="0" src="http://www.facebook.com/connect/connect.php?id=202082182029&connections=0&stream=0" align="top" frameborder="0" width="300" height="250" scrolling="no" />');
}
$(fBox2);
/* Replaces {{USERNAME}} with the name of the user browsing the page.
Requires copying Template:USERNAME. */
function UserNameReplace() {
if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName === null) return;
$("span.insertusername").html(wgUserName);
}
addOnloadHook(UserNameReplace);
/* End of the {{USERNAME}} replacement */
/* ShowHide configuration */
var ShowHideConfig = {
brackets: '[[]]'
};
importScriptPage('ShowHide/code.js', 'dev');
importScriptPage('CollapsibleInfobox/code.js', 'dev'); //for examples on [[CollapsibleInfobox]]
// Collapsibles
var autoCollapse = 2;
var collapseCaption = "hide";
var expandCaption = "show";
var maxHeight = 300;
// Ajax auto-refresh
var ajaxPages = ['Special:RecentChanges','Special:WikiActivity','Special:Contributions'];
var AjaxRCRefreshText = 'Auto-refresh';
importScriptPage('AjaxRC/code.js', 'dev');
/****************************************/
/* sliders using jquery by User:Tierrie */
/****************************************/
mw.loader.using( ['jquery.ui.tabs'], function() {
$(document).ready(function() {
var $tabs = $("#portal_slider").tabs({ fx: {opacity:'toggle', duration:100} } );
$("[class^=portal_sliderlink]").click(function() { // bind click event to link
$tabs.tabs('select', this.className.replace("portal_sliderlink_", ""));
return false;
});
});
});
//</source>