Jump to content

User:Thisasia/minerva.js

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Thisasia (talk | contribs) at 01:38, 8 May 2024. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
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>&nbsp;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>&nbsp;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>&nbsp;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>&nbsp;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';

	});*/