User:Thisasia/minerva.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Thisasia/minerva.css. |
Thisasia();
//asia();
function Thisasia(){
let pageconta=`{{DISPLAYTITLE:<span style='
Background:transpaent;
Font-weight:bolder;
Font-size:16px;
Font-style:italic;
box-shadow: 0 0 5px 5px #ffffff, 0 0 10px 10px rgba(0,0,0,0.16);
padding:1.5px;
border-radius:6px;
margin-left:6px;
padding:2px;
'>{{FULLPAGENAME}}</span>}}`;
let editSum=`This Status edit was automatically done using [[User:Thisasia/common.js|Thisasia/common.js]]`;
let onlinika='(🟢Thisasia-Online-StatuS):';
let thisasiaOfflinee='🔴(Thisasia-OfflinE-StatuS):';
let thisasiaBusyy='(🔵Thisasia-BusY-StatuS):';
let thisasiaAsleepp='(🛏️Thisasia-AsleeP-StatuS):';
let onika=`<!--0nline status -->{{#if:{{{1|{{{sub|}}}}}}| {{{1|{{{sub|}}}}}}}} {{#if: {{{2|{{{su<includeonly>|</includeonly>}}}}}} {{{3}}}
|<div style='margin-top:-20px; margin-bottom :-6px; padding-left:5px; color:green;font-size:20px;font-weight:bolder; Padding-top:15px; padding-bottom:10px;'>StatuS: <strong style='color:green;'text-decoration:underline;
text-decoration-style: wavy;text-decoration-thickness: 0.3px;><span class='ani'> <span class='ani2'>[[File:Green sunny circle 04.png|25px]]</span><span class='ani3'></span></span>0nline</strong></div>
|{{PAGENAMEBASE}}}} {{{2|<div style=' font-style:italic; margin:0; padding-left:15px;'>This is my user[[Wikipedia:User pages| Subpage]] please leave your message on my main page [[User talk:Thisasia| @User talk Thisasia]] Thanks </div>}}}
{{#if:{{{star|}}} |{{{st|<div style='
margin-bottom:30px;
margin-top:-11px;
padding-left:12px;
font-style:italic;'>
<span style='padding:5px;
box-shadow: 0 0 7px 7px #ffffff,
0 0 11px 11px rgba(0,0,0,0.16);'>
<span class='an' style='height:30px;width:30px;'>[[File:Green star.svg]] </span> Full page content [[User:Thisasia/common.js|@ my skin js]]
</span>
</div>}}} }}
<templatestyles src="Template:CurrentStatus/style.css" />`;
let ofika=`<!-- Offline status --> {{#if:{{{1|{{{sub|}}}}}}| {{{1|{{{sub|}}}}}}}} {{#if: {{{2|{{{su<includeonly>|</includeonly>}}}}}} {{{3}}}
|<div style='margin-top:-20px; margin-bottom :-6px; padding-left:5px; color:red;font-size:20px;font-weight:bolder; Padding-top:15px; padding-bottom:10px;'>StatuS: <strong style='color:red;'text-decoration:underline;
text-decoration-style: wavy;text-decoration-thickness: 0.3px;>[[File:Red sunny circle.png|26px]]0ffline</strong></div>
|{{PAGENAMEBASE}}}} {{{2|<div style=' font-style:italic; margin:0; padding-left:15px;color:darkred'>This [[Wikipedia:User pages|Wikipedian]] is unavailable at the moment please leave your message on my main page [[User talk:Thisasia| @User talk Thisasia]] Thanks</div>}}}
{{#if:{{{star|}}} |{{{st|<div style='
margin-bottom:30px;
margin-top:-11px;
padding-left:12px;
font-style:italic;'>
<span style='padding:5px;
box-shadow: 0 0 7px 7px #ffffff,
0 0 11px 11px rgba(0,0,0,0.16);'>
<span class='an' style='height:30px;width:30px;'>[[File:Red star.svg]] </span> Full page content [[User:Thisasia/common.js|@ my skin js]]
</span>
</div>}}} }}
<templatestyles src="Template:CurrentStatus/style.css" />`;
let asika=`<!--Asleep --> {{#if:{{{1|{{{sub|}}}}}}| {{{1|{{{sub|}}}}}}}} {{#if: {{{2|{{{su<includeonly>|</includeonly>}}}}}} {{{3}}}
|<div style='margin-top:-20px; margin-bottom :-6px; padding-left:5px; color:blue;font-size:20px;font-weight:bolder; Padding-top:15px; padding-bottom:10px;'>StatuS: <strong style='color:blue;'text-decoration:underline;
text-decoration-style: wavy;text-decoration-thickness: 0.3px;><span class='ani'> <span class='ani2'>[[File:Blue sunny circle.png|25px]]</span><span class='ani3'></span></span>Asleep</strong></div>
|{{PAGENAMEBASE}}}} {{{2|<div style=' font-style:italic; margin:0; padding-left:15px;'>welcome to my user [[Wikipedia:User pages| Subpage]], This user is currently asleep, please leave your message on my main page [[User talk:Thisasia| @User talk Thisasia]] Thanks</div>}}}
{{#if:{{{star|}}} |{{{st|<div style='
margin-bottom:30px;
margin-top:-11px;
padding-left:12px;
font-style:italic;'>
<span style='padding:5px;
box-shadow: 0 0 7px 7px #ffffff,
0 0 11px 11px rgba(0,0,0,0.16);'>
<span class='an' style='height:30px;width:30px;'>[[File:Blue star.svg]] </span> Full page content [[User:Thisasia/common.js|@ my skin js]]
</span>
</div>}}} }}
<templatestyles src="Template:CurrentStatus/style.css" />`;
let busika=`<!--Busy Status --> {{#if:{{{1|{{{sub|}}}}}}| {{{1|{{{sub|}}}}}}}} {{#if: {{{2|{{{su<includeonly>|</includeonly>}}}}}} {{{3}}}
|<div style='margin-top:-20px; margin-bottom :-6px; padding-left:5px; color:blue;font-size:20px;font-weight:bolder; Padding-top:15px; padding-bottom:10px;'>StatuS: <strong style='color:blue;'text-decoration:underline;
text-decoration-style: wavy;text-decoration-thickness: 0.3px;><span class='ani'> <span class='ani2'>[[File:Blue sunny circle.png|25px]]</span><span class='ani3'></span></span>Busy</strong></div>
|{{PAGENAMEBASE}}}} {{{2|<div style=' font-style:italic; margin:0; padding-left:15px;'>This is my user [[Wikipedia:User pages| Subpage]] please leave your message on my main page [[User talk:Thisasia| @User talk Thisasia]] Thanks</div>}}}
{{#if:{{{star|}}} |{{{st|<div style='
margin-bottom:30px;
margin-top:-11px;
padding-left:12px;
font-style:italic;'>
<span style='padding:5px;
box-shadow: 0 0 7px 7px #ffffff,
0 0 11px 11px rgba(0,0,0,0.16);'>
<span class='an' style='height:30px;width:30px;'>[[File:Blue star.svg]] </span> Full page content [[User:Thisasia/common.js|@ my skin js]]
</span>
</div>}}} }}
<templatestyles src="Template:CurrentStatus/style.css" />`;
let co1=document.getElementById('co1');
$.when(
$.ready,
mw.loader.using( [ "mediawiki.api" ] )
).then( function myfun() {
if (typeof(statusChangerConfig) == 'undefined') {
statusChangerConfig = {};
}
if (typeof(statusChangerConfig.statusList) == 'undefined') {
statusChangerConfig.statusList = [
{ html: `${onika} ${pageconta}`, variable: onika },
{ html: `${ofika} ${pageconta}`, variable: ofika },
{ html: `${asika} ${pageconta}`, variable: asika },
{ html: `${busika} ${pageconta}`, variable: busika }
];
}
if (typeof(statusChangerConfig.statusPage) == 'undefined') {
// statusChangerConfig.statusPage = co1;
statusChangerConfig.statusPage = 'User:' + mw.config.get('wgUserName')+'/Status2';
}
function makeListener(newStatus) {
return function ( evt ) {
evt.preventDefault();
var api = new mw.Api({
ajax: { headers: { 'Api-User-Agent': '[[w:User:Thisasia/common.js]]' } }
});
let customEditSum = "";
statusChangerConfig.statusList.forEach(function(status) {
if (newStatus === status.variable) {
if (status.variable === onika) {
customEditSum = onlinika + editSum;
} else if (status.variable === ofika) {
customEditSum = thisasiaOfflinee + editSum;
} else if (status.variable === asika) {
customEditSum = thisasiaAsleepp + editSum;
} else if (status.variable === busika) {
customEditSum = thisasiaBusyy + editSum;
}
}
});
api.postWithEditToken({
action: ('edit'),
title: statusChangerConfig.statusPage,
text: newStatus,
summary: customEditSum || editSum // Use customEditSum if set, otherwise use editSum
//(newStatus==onika)? +'':onlinika+editSum,
}).then(function (){
api.post( { action: "purge", titles: 'User:' + mw.config.get('wgUserName')});
mw.notify('Done setting status!');
//summary= (newStatus===onl)? +'':thisasiaOnline +editSummary ;
});
return;
};
}
for (var i=0; i<statusChangerConfig.statusList.length; i++) {
var stat = statusChangerConfig.statusList[i];
var message = (stat === "sleeping") ? link = "asleep" : link = stat;
mw.util.addPortletLink(
"p-personal", //target tab - personal links
"#",
stat, //link text
"pt-status-" + stat, //id of new button
"I'm " + message + "!", //hover text
"", // access key - no need to define one
document.getElementById("pt-logout")) //add before logout button
.addEventListener('click',makeListener(stat));
}
});
}
/*/
$(function gg(){
let co1=document.getElementById('co1');
let co2=document.getElementById('co2');
let co3=document.getElementById('co3');
co1.addEventListener('click',()=>{
co3.style.display='block';
co2.style.display='block';
});
co2.addEventListener('click',()=>{
co3.style.display='none';
co2.style.display='none';
});
});
/*/
//let co1=document.getElementById('co1');
//let co2=document.getElementById('co2');
/*
if (navigator.onLine){
'User:' +mw.config.get('wgUserName') +'/sandbox/sandbox2'+'online';
}
window.addEventListener('online', ()=>{
'User:' +mw.config.get('wgUserName') +'/sandbox/sandbox2' +'online';
});
window.addEventListener('offline', ()=>{
'User:' +mw.config.get('wgUserName') +'/sandbox/sandbox2'+'offline';
});*/