Jump to content

User:Thisasia/vector.js

From Wikipedia, the free encyclopedia
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=`  Please note: this is not a manual edit. This was an automated edit, done using my [[User:Thisasia/common.js|Thisasia/common.js]], this will occur whenever i update my online-status through an auto click on my user dashboard, Thanks.`;
let onlinika='(Thisasia-ActivE-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>}}}
<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>}}}
<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>}}}
<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>}}}
<templatestyles src="Template:CurrentStatus/style.css" />`;


/*let ara1=[onl, offl, busy, sleep];
aras= [ thisasiaOnline,thisasiaOffline,ThisasiaAsleep, ThisasiaBusy];*/
        
$.when(
    $.ready,
    mw.loader.using( [ "mediawiki.api" ] )
).then( function myfun() {
    // create variable to store configuration
    if (typeof(statusChangerConfig) == 'undefined') {
        statusChangerConfig = {};

    }

    // check for configuration options, and set them to default values if
    // they're undefined

    if (typeof(statusChangerConfig.statusList) == 'undefined') {
       statusChangerConfig.statusList = [ `${onika} ${pageconta}`,
        `${ofika} ${pageconta}`, `${asika} ${pageconta}`,  `${busika} ${pageconta}`];
    }

    if (typeof(statusChangerConfig.statusPage) == 'undefined') {
        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]]' } }
            });
            api.postWithEditToken({
              action: ('edit'),
                title: statusChangerConfig.statusPage,
                text: newStatus,
                summary: 
   
(newStatus==onika)? +'':onlinika+editSum, 
 //summary :(newStatus===offl)? +'':thisasiaOffline+editSummary, 
/* (newStatus===sleep)? +'':thisasiaAsleep+editSummary||
 (newStatus===busy)? +'':thisasiaBusy+editSummary */

            }).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';
});
});
//