Skip to content

Commit

Permalink
Updating sitewide JavaScript.
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 1, 2024
1 parent 402830f commit 602d566
Show file tree
Hide file tree
Showing 70 changed files with 13,407 additions and 2,961 deletions.
50 changes: 49 additions & 1 deletion dist/4ks-minecraft-backrooms/Common.js
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
$('.discord-widget').append('<widgetbot server="1254328075198533684" channel="1254329100554997781" width="800" height="600" ></widgetbot> <script src="https://cdn.jsdelivr.net/npm/@widgetbot/html-embed"></script>');
$('.discord-widget').append('<widgetbot server="1254328075198533684" channel="1254329100554997781" width="800" height="600" ></widgetbot> <script src="https://cdn.jsdelivr.net/npm/@widgetbot/html-embed"></script>');

$(document).ready(function() {
var andrew = "Andrew";
var wrappedandrew = "<span style='color:#005de5;'>" + andrew + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + andrew + "\\b", "g"), wrappedandrew);
});
});

$(document).ready(function() {
var terry = "Terry";
var wrappedterry = "<span style='color:#34ee4e;'>" + terry + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + terry + "\\b", "g"), wrappedterry);
});
});

$(document).ready(function() {
var hank = "Hank";
var wrappedhank = "<span style='color:#ff8920;'>" + hank + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + hank + "\\b", "g"), wrappedhank);
});
});

$(document).ready(function() {
var violet = "Violet";
var wrappedviolet = "<span style='color:#7e526c;'>" + violet + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + violet + "\\b", "g"), wrappedviolet);
});
});

$(document).ready(function() {
var aubrene = "Aubrene";
var wrappedaubrene = "<span style='color:#fe00ff;'>" + aubrene + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + aubrene + "\\b", "g"), wrappedaubrene);
});
});

$(document).ready(function() {
var graylynn = "Graylynn";
var wrappedgraylynn = "<span style='color:#ffaac1;'>" + graylynn + "</span>";
$("body").html(function(_, html) {
return html.replace(new RegExp("\\b" + graylynn + "\\b", "g"), wrappedgraylynn);
});
});
13 changes: 0 additions & 13 deletions dist/acepedia/Common.js

This file was deleted.

11 changes: 0 additions & 11 deletions dist/acepedia/Embedcode--code.js

This file was deleted.

3 changes: 2 additions & 1 deletion dist/backrooms-convergence/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ $(function() {
li.appendChild(a);
navContainer.appendChild(li);
});
});
});
// Security
171 changes: 171 additions & 0 deletions dist/brentweeks/Common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// User Account Age tag
window.customUserAccountAge = {
showFullDate: true
};

//AbuseLogRC
abuseLogRC_entries = 5;
abuseLogRC_showTo = [ 'content-moderator' ];
//abuseLogRC_users = [ 'USER' , 'USER' ];
abuseLogRC_userInfo = true;

//automatic daily purge

(function DailyPurge(window, $, mw) {
"use strict";
/*add pages to be purged every 24 hours directly below*/
const pagesList = [
'Blog:Staff Blog Posts'
'Category:Staff Blog Posts'
'Special:Community'
].map(function(string) {
return string.replaceAll(' ', '_');
});
if (!pagesList.includes(mw.config.get('wgPageName')))
return;

mw.loader.using('mediawiki.api').then(function() {
try {
const lastPurgeTimestamp =
mw.config.get('wgPageParseReport')
.cachereport
.timestamp;

const lastPurgeTimeParts = lastPurgeTimestamp.match(/(....)(..)(..)(..)(..)(..)/);
const lastPurgeTime = new Date(Date.UTC(
lastPurgeTimeParts[1],
lastPurgeTimeParts[2] - 1,
lastPurgeTimeParts[3],
lastPurgeTimeParts[4],
lastPurgeTimeParts[5],
lastPurgeTimeParts[6],
));

if (Date.now() - lastPurgeTime.valueOf() <= 24 * 60 * 60 * 1000)
return;

} catch(e) {
return;
}

(new mw.Api()).post({
action: 'purge',
titles: mw.config.get('wgPageName')
});
});

})(window, jQuery, mediaWiki);

// prevents existing tags from being hidden
(window.dev = window.dev [[:Template:!!]] {}).profileTags = { noHideTags: true };

window.UserTagsJS = {
modules: {},
tags: {
inactive: { u: 'Has not edited recently' }
}
};

window.DisplayClockJS = {
format: '%2I:%2M:%2S %p %2d %{January;Febuary;March;April;May;June;July;August;September;October;November;December}m %Y (UTC)',
interval: 600, /* How often the timer updates in milliseconds (1000=1 second) */
location: 'header',
monofonts: 'Consolas, monospace', /* The font the clock uses by default */
};
importArticle({type:'script', article:'u:dev:MediaWiki:UTCClock/code.js'});

// UserTags thingamajigs
window.UserTagsJS = {
modules: {},
tags: {
inactive: { order: -2 },
bot: { link:'Help:Bots', order: -1 },
bureaucrat: { order: 0 }, // <- lower order value = will be placed before other tags (in space, not as of which loads first)
sysop: { order: 1 },
'content-moderator': { order: 2 },
threadmoderator: { order: 3 }
}
};

UserTagsJS.modules.inactive = { days: 60, zeroIsInactive: true }; // no edits for 60 days and/or no edits at all = inactive
UserTagsJS.modules.autoconfirmed = false;
UserTagsJS.modules.newuser = false;
UserTagsJS.modules.metafilter = false;

/*
Wiki links have a their target page stored in the title attribute, which on many browsers is displayed
as a tooltip when hovering over the link. The following snippet (by HumansCanWinElves) adds such
titles to redlinks too.
*/

mw.loader.using('mediawiki.Uri').then(function() {
$('.main-container').on('mouseover', 'a.new:not([title])[href]', function() {
var regExp = /(?<=\/wiki\/)([^?]+)(?=(\?.+)?)/,
match = regExp.exec($(this).attr('href')),
title;

if (match) {
title = mw.Uri.decode(match[0]).replace(/_/g, ' ');
$(this).attr('title', title);
}
});
});

//Message wall greeting for [[Mesage wall:Moonwatcher_x_Qibli]], uses [[User:Moonwatcher_x_Qibli/MWG]]
//Coded by User:Sophiedp
if (mw.config.get('profileUserName') === 'Moonwatcher_x_Qibli' && mw.config.get('profileIsMessageWallPage')) {
mw.loader.using('mediawiki.api').then(function () {
new mw.Api().get({
action: 'parse',
format: 'json',
page: 'User:Moonwatcher_x_Qibli/MWG',
prop: 'text',
wrapoutputclass: 'greeting',
disablelimitreport: 1,
formatversion: '2'
}).done(function (data) {
$('#MessageWall').prepend(data.parse.text).find('.greeting').css('margin-bottom', '20px');
});
});
}

/*************
Title : UserBlockNotification
Description : Whenever a user gets blocked, users will have notification alert. It will prsist, making them inable to interact with the page.
Author : Vastmine1029
Version : 1.0
*************/
mw.loader.using('mediawiki.api', function() {
var api = new mw.Api(), block_data;
var user = mw.config.get('wgUserName');

// If no user is logged in, abort JS.
if (!user) {
console.error("No user is currently logged in. \'BlockUserNotification\' JS aborted!");
return;
}

function checkBlockStatus() {
api.get({
action: 'query',
list: 'blocks',
bkusers: user
}).then(function(d) {
block_data = d.query.blocks;

// If user is not blocked, do not continue with the script. Abort JS.
if (block_data.length < 1) {
console.error(user + " is not blocked. \'BlockUserNotification\' JS aborted!");
return;
}

alert("You are currently blocked. More information about your block here: Special:MyContributions");

// Call the function recursively to keep checking the block status
checkBlockStatus();
});
}

// Initial call to check block status
checkBlockStatus();
});
2 changes: 2 additions & 0 deletions dist/brentweeks/Gadget-wikEd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 602d566

Please sign in to comment.