User:ArsenalBastion4093/global.js

$(function{	importArticles({ type: 'script', articles: [ 'u:dev:MediaWiki:MarkBlocked.js', 'u:dev:MediaWiki:InactiveUsers/code.js', 'u:dev:MediaWiki:UserAccountAge/code2.js', 'u:dev:MediaWiki:UserBlockNotification.js', 'u:dev:MediaWiki:SeeMoreActivityButton/code.js', 'u:dev:MediaWiki:BlockSummary.js', 'u:dev:MediaWiki:RelatedDiscussionsPosts.js', 'u:dev:MediaWiki:NewImages.js', 'u:dev:MediaWiki:DiscussionsRailModule/UCP.js', 'u:dev:MediaWiki:MastheadGender/code.js', 'u:dev:MediaWiki:DedicatedTalkButton.js', 'u:dev:MediaWiki:FirstEditDate.js', 'u:dev:MediaWiki:ImportJSPage/code.js', 'u:dev:MediaWiki:Bang.js', 'u:dev:MediaWiki:ProtectionIcons.js', 'u:dev:MediaWiki:WhatLinksHere/code.js', 'u:dev:MediaWiki:Status/code.js', 'u:dev:MediaWiki:CommunityPageRailModule.js', 'u:dev:MediaWiki:DisplayTimer/code.js', 'u:fridaynightfunking:MediaWiki:DedicatedHistoryButton.js', 'u:dev:MediaWiki:WikiActivity.js', 'u:dev:MediaWiki:DiscussionsFeed.js', ]	});	$(" @import \"/load.php?mode=articles&articles=u:dev:DiscussionsFeed/style-light.css&only=styles\"; ").appendTo("body.theme-fandomdesktop-light");	$(" @import \"/load.php?mode=articles&articles=u:dev:DiscussionsFeed/style-dark.css&only=styles\"; ").appendTo("body.theme-fandomdesktop-dark");	// [Code Name="UserContribution+RecentChanges+PageRevision Change"]	$(".mw-contributions-list li").queue(function{ $(this).find(".mw-changeslist-links").append(' Edit '); if ($(this).find(".mw-changeslist-diff").length==0) $(this).find(".mw-changeslist-links:not(.mw-usertoollinks) > span:first-child").html('Difference'); else $(this).find(".mw-changeslist-diff").html('Difference'); $(this).find(".mw-changeslist-history").html('History'); });	$("#pagehistory li:first-child").append("&lrm; ").find(".mw-changeslist-links:not(.mw-history-histlinks):not(.mw-usertoollinks)").append(' edit ').appendTo("#pagehistory li:first-child");	$("#pagehistory li:not(:first-child):not(:last-child)").queue(function{ $(this).append("&lrm; "); $(this).find(".mw-changeslist-links:not(.mw-history-histlinks):not(.mw-usertoollinks)").append(' edit ').appendTo($(this)); });	$("#pagehistory li:last-child").queue(function{ $(this).append("&lrm; edit  "); });	if ($("body").hasClass("mw-special-Contributions")) $(".mw-special-Contributions .mw-contributions-user-tools .mw-changeslist-links").append(" discussions see him/her at another wiki  personal CSS  personal JS ");	$("#see-at-another-wiki").click(function{ var code = prompt("Insert Wiki Name Code!","community"), language = prompt("Insert Wiki Language Code!","en"); open("http://" + (code==null||code==""?"community":code) + ".fandom.com" + (language=="en"||language==null||language==""?"":"/")+language + "/wiki/Special:Contributions/" + mw.config.values.profileUserName.split('"').join("&quot;"),"_self");	});	$(".mw-usertoollinks.mw-changeslist-links").queue(function{		var username = $(this).find(".mw-usertoollinks-contribs").html("Contributions").attr("title").split("/")[1];		$(this).append(" Posts Activity</a> ");	});	$(".mw-special-Recentchanges [data-mw-revid]").queue(function{		var revid = $(this).attr("data-mw-revid"),		pgname = $(this).find(".mw-enhanced-rc-time a, .mw-changeslist-title").attr("title");		if ($(this).find(".mw-changeslist-links:not(.mw-usertoollinks)").length>0) { $(this).find(".mw-changeslist-links:not(.mw-usertoollinks)").append(' Edit</a> ');			if ($(this).find(".mw-changeslist-diff").length==0) $(this).find(".mw-changeslist-links:not(.mw-usertoollinks) > span:first-child").html('Difference') ;			else $(this).find(".mw-changeslist-diff").html('Difference');			$(this).find(".mw-changeslist-history").html('History');		} else {			$(this).find(".mw-enhanced-rc-nested").append(' edit</a> ');		}	});	// [/Code]	/*/ [Code Name="ImportJS" Status="Deprecated"]	$(".page-MediaWiki_ImportJS pre").html("" + $(".page-MediaWiki_ImportJS pre").text.split("\n").join("</a>") + "</a>") $(".page-MediaWiki_ImportJS pre a").queue(function{		if ($(this).text.split(":").length>1){			$(this).attr("href",`http://${$(this).text.split(":")[0]}.fandom.com/wiki/MediaWiki:${$(this).text.split(":")[1]}`)		} else {			$(this).attr("href",`/wiki/MediaWiki:${$(this).text}`)		}	}) $(".page-MediaWiki_ImportCSS pre").html("" + $(".page-MediaWiki_ImportCSS pre").text.split("\n").join("</a> ") + "</a>") $(".page-MediaWiki_ImportCSS pre a").queue(function{		if ($(this).text.split(":").length>1){			$(this).attr("href",`http://${$(this).text.split(":")[0]}.fandom.com/wiki/MediaWiki:${$(this).text.split(":")[1]}`)		} else {			$(this).attr("href",`/wiki/MediaWiki:${$(this).text}`)		}	}) // [/Code] /*/ // [Code Name="Replacement In Fan Feed"] Object.defineProperties(Array.prototype,{		random_item: {			get: function{				return this[Math.floor(this.length*Math.random)];			},			set: function{				throw TypeError("youtu.be/dQw4w9WgXcQ");			}		}	}); var Contents = [ {img: "https://i.imgur.com/poCtNRk.gif", link: "//youtu.be/dQw4w9WgXcQ", title: "Rick Astley - Never Gonna Give You Up (Official Music Video)", subtitle: "YouTube"}, {img: "https://i.ytimg.com/vi/ErSmRD67pzo/hqdefault.jpg", link: "https://www.youtube.com/watch?v=ErSmRD67pzo", title: "Discord in 2045", subtitle: "Beluga YouTube"}, {img: "https://i.ytimg.com/vi/caFAItMHPhE/hqdefault.jpg", link: "https://www.youtube.com/watch?v=caFAItMHPhE", title: "Discord in 420 BC", subtitle: "Beluga YouTube"}, {img: "https://i.ytimg.com/vi/aZqA8h2TA-I/hqdefault.jpg", link: "https://www.youtube.com/watch?v=aZqA8h2TA-I", title: "When Your Instagram Gets Hacked", subtitle: "Beluga YouTube"}, {img: "https://i.ytimg.com/vi/ZqhEFk-zdEU/hqdefault.jpg", link: "https://www.youtube.com/watch?v=ZqhEFk-zdEU", title: "If Elon Musk owned Discord...", subtitle: "Beluga YouTube"}, {img: "https://i.ytimg.com/vi/JLSqhWue9BU/hqdefault.jpg", link: "https://www.youtube.com/watch?v=JLSqhWue9BU", title: "When a Discord Mod gets hacked...", subtitle: "Beluga YouTube"}, {img: "https://yt3.ggpht.com/ytc/AMLnZu_iIS6ZdSR284j0d23PTr7Hrd_S6pA6oaO9uVSAAw=s88-c-k-c0x00ffffff-no-rj", link: "https://www.youtube.com/c/Thatonefigoh/videos", title: "Thatonefigoh", subtitle: "YouTube"}, {img: "https://yt3.ggpht.com/A0J6Rt1YweNdTa3j9gEdrfjxlQrowJ-3H5oLrYY96T6jJI5vhI0FKeIG3hRL2sPMztKiRFXh9w=s88-c-k-c0x00ffffff-no-rj", link: "https://www.youtube.com/c/FlashinRahul/videos", title: "Flash in Rahul", subtitle: "YouTube"} ];	function b { $(".mcf-card-article__link").queue(function{			if ($(this).find("a").attr("href").split("sml.fandom.com").length>1) {				var item = Contents.random_item;				$(this).find("a").css("background-image",'linear-gradient(to bottom, rgba(0, 0, 0, 0), #000000), url("' + item.img + '")').attr("href",item.link).attr("title",item.title).html("<span class='mcf-card-article__title'>" + item.title + " <span class='mcf-card-article__subtitle'>"+item.subtitle+" ");			}		}); setTimeout(b,100); }	b; // [/Code] // [Code Name="Mark User Gender,Group"] function getJSON(url) { return new Promise(function(p_return,p_throw){			$.ajax({ type:"get", url:url, dataType:"json", success:function(d) { p_return(d); },				error:function(e) { p_throw(e); }			});		});	}	var GottenUsers = {}, g = function(str,t){ var username = $(t).attr("href").slice(str.length).split("?")[0].split("#")[0], element = t;		if (GottenUsers.hasOwnProperty(username)) { if (GottenUsers[username].invalid!=undefined) { return; } else if (GottenUsers[username].missing!=undefined) { $(element).addClass("user-unregistered"); }			else { $(element).addClass("user-gender-"+GottenUsers[username].gender); $(element).addClass(("user-right-"+GottenUsers[username].groups.join(" user-right-")).split("user-right-*").join("")); }		} else getJSON("/api.php?action=query&list=users&ususers="+username+"&usprop=groups%7Ceditcount%7Cgender%7Cblockinfo&format=json").then(function(query){			if (query.error) return;			GottenUsers[username] = query.query.users[0];			if (query.query.users[0].invalid!=undefined) {				return;			} else if (query.query.users[0].missing!=undefined) {				$(element).addClass("user-unregistered");			}			else {				$(element).addClass("user-gender-"+query.query.users[0].gender);				$(element).addClass(("user-right-"+query.query.users[0].groups.join(" user-right-")).split("user-right-*").join(""));			}		}); };	$("a[href^='/wiki/User:']").queue(function{		g("/wiki/User:",this);	}); $("a[href^='/wiki/Message_Wall:']").queue(function{		g("/wiki/Message_Wall:",this);	}); $("a[href^='/wiki/User_talk:']").queue(function{		g("/wiki/User_talk:",this);	}); $("a[href^='/wiki/User_Blog:']").queue(function{		g("/wiki/User_Blog:",this);	}); $("a[href^='/wiki/Special:Contributions/']").queue(function{		g("/wiki/Special:Contributions/",this);	}); $("a[href^='/wiki/Special:UserProfileActivity/']").queue(function{		g("/wiki/Special:UserProfileActivity/",this);	}); // [/Code] // [Code Name="Dedicated Move Button"] var move = $(".page-header__actions .wds-list").find("#ca-move"); if (!move.length) { } else { move.parent.remove; move.prepend('<svg class="wds-icon wds-icon-small"><use xlink:href="#wds-icons-arrow-small"> ').addClass("wds-button wds-is-text page-header__action-button has-label"); $(".page-header__actions .wds-list").parents(".wds-dropdown").before(move); }	// [/Code] // [Code Name="Insert Title To Page"] $(".page-header__title").attr("contentEditable","true").on("focus",function{		if ($(this).hasClass("edited")) {			return;		}		$(this).addClass("edited");		$(this).text(mw.config.values.wgPageName.split("_").join(" "));		$(this).on("keydown",function(e){ if (e.key == "Enter") { $(this).attr("contentEditable","false").text($(this).text.split("\n").join("")); location = location.origin + "/wiki/" + encodeURI($(this).text); }		});	});	if (mw.config.get('profileUserName')) { mw.loader.using(['mediawiki.api','mediawiki.util']).then(function{			console.log("1")			$(".user-identity-header__attributes h1").attr("contentEditable","true").on("focus",function{ if ($(this).hasClass("edited")) { return; }				$(this).addClass("edited"); $(this).text(mw.config.values.wgPageName.slice(5).split("_").join(" ")); $(this).on("keydown",function(e){					if (e.key == "Enter") {						$(this).attr("contentEditable","false").text($(this).text.split("\n").join(""));						location = location.origin + "/wiki/User:" + encodeURI($(this).text);					}				}); });		});	}	// [/Code] });