User:KurwaAntics/common.js

// Admin highlights // highlight = { selectAll: true, 'content-moderator': '#080', sysop: '#03c' };

importArticles({	type: 'style',	articles: [		'u:dev:MediaWiki:TZclock.css'	] }, {	type: 'script',	articles: [		'u:dev:TZclock.js',		'u:dev:HighlightUsers/code.js'	] });

//$('Discussions 💬').insertAfter('.ns-0 .wikia-button.comments.secondary');

/*$('body').on('DOMNodeInserted', '#article-comments-minieditor-newpost .toolbar .cke_toolbar_insert', function {    if ($.inArray('autoconfirmed', wgUserGroups) >= 0) {        console.log('You are an eligible voter.')        //$('#article-comments-minieditor-newpost .toolbar').append('SUPPORT  OPPOSE ');        //$('#article-comments-minieditor-newpost .toolbar').append(' Select an option  Support  Oppose  Neutral  ');    } else {        console.log('You are NOT an eligible voter.')        //$('#article-comments-minieditor-newpost .toolbar').append('You are not an eligible voter, therefore you cannot vote.');    } });

/* if ($.inArray('autoconfirmed'&&'sysop', wgUserGroups) >= 0) { console.log('You are an autoconfirmed user and an admin.'); } else { console.log('You are either an autoconfirmed user or an admin.'); } if ($.inArray('autoconfirmed'&&'poweruser', wgUserGroups) >= 0) { console.log('You are an autoconfirmed user and a poweruser.'); } else { console.log('You are either an autoconfirmed user or a poweruser.'); } /* jQuery.fn.extend({ insertAtCaret: function(myValue){ return this.each(function(i) { if (document.selection) { //For browsers like Internet Explorer this.focus; var sel = document.selection.createRange; sel.text = myValue; this.focus; }   else if (this.selectionStart || this.selectionStart == '0') { //For browsers like Firefox and Webkit based var startPos = this.selectionStart; var endPos = this.selectionEnd; var scrollTop = this.scrollTop; this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length); this.focus; this.selectionStart = startPos + myValue.length; this.selectionEnd = startPos + myValue.length; this.scrollTop = scrollTop; } else { this.value += myValue; this.focus; } }); } });

function support{ if ($('.vote-support').hasClass('vote-selected')) { $('.vote-support').removeClass('vote-selected'); } else { $('.vote-support').addClass('vote-selected'); $('.vote-oppose').removeClass('vote-selected'); } } function oppose{ if ($('.vote-oppose').hasClass('vote-selected')) { $('.vote-oppose').removeClass('vote-selected'); } else { $('.vote-oppose').addClass('vote-selected'); $('.vote-support').removeClass('vote-selected'); } }*/ //mw.util.addCSS('.vote-support,.vote-support:hover,.vote-support:active{font-weight:bold;background:#4CAF50;border-color:transparent;}.vote-oppose,.vote-oppose:hover,.vote-oppose:active{font-weight:bold;background:#F44336;border-color:transparent;}.vote-support.vote-selected,.vote-support.vote-selected:hover,.vote-support.vote-selected:active{background:#43A047;box-shadow:0 0 0 3px #388E3C;}.vote-oppose.vote-selected,.vote-oppose.vote-selected:hover,.vote-oppose.vote-selected:active{background:#E53935;box-shadow:0 0 0 3px #D32F2F;}');

//mw.util.addCSS('.vote');

/*function votechangecolor{ var x = document.getElementById('vote-dropdown').value; if (x == 'support'){ $('#vote-dropdown').css({'background-color':'#4CAF50','color':'white','border-color':'#2E7D32','font-weight':'bold'}); } else if (x == 'oppose'){ $('#vote-dropdown').css({'background-color':'#F44336','color':'white','border-color':'#C62828','font-weight':'bold'}); } else if (x == 'neutral'){ $('#vote-dropdown').css({'background-color':'#9E9E9E','color':'white','border-color':'#424242','font-weight':'bold'}); } else { $('#vote-dropdown').css({'background-color':,'color':,'border-color':,'font-weight':}); } }

$('#article-comm-submit').on('click',function{   var x = document.getElementById('vote-dropdown').value;    var y = document.getElementById('article-comm').value;    y = '['+x+']' + y;    //$('#article-comm').val(function(index, old) { return '['+x+']' + old; }); });*/

/*function disablePoll{ $('.voting input').attr('disabled',true); $('.voting input[name="wpVote"]').attr('value','You are not an eligible voter, therefore you cannot vote.'); }

if ($.inArray('autoconfirmed', wgUserGroups) >= 0) { console.log('You are an autoconfirmed user.'); } else { disablePoll; }*/

/*if ($.inArray('autoconfirmed', wgUserGroups) < 0) { $('.voting input').attr('disabled',true); $('.voting input[name="wpVote"]').attr('value','You are not an eligible voter, therefore you cannot vote.'); $('.voting').show; } else { $('.voting').show; }*/

if ($.inArray('sysop', wgUserGroups) < 0) { $('.voting input').attr('disabled',true); $('.voting input[name="wpVote"]').attr('value','You are not an eligible voter, therefore you cannot vote.'); //$('.voting').show; } else { //$('.voting').show; }

$(document).ready(function{   $('.voting').delay(100).show; });