User:Thisasia/vector.js

Thisasia; asia; function Thisasia{ let pageconta=``;

let editSum=` Please note: this is not a manual edit. This was an automated edit, done using my 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=` `;

let ofika=` `;

let asika=` `;

let busika=` `;

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