User:Frisk/common.js

// Кнопки для описания правки // translate to Polish: // Ivan-r http://minecraft-ru.gamepedia.com/User:Ivan-r // piotrex43 http://minecraft-pl.gamepedia.com/User:Piotrex43 // NTBG http://minecraft-pl.gamepedia.com/User:NTBG

function insertSummary ( txt ) { if ( typeof txt !== 'string' ) { txt = this.title; }	var vv = $( 'input[name="wpSummary"]' ).val; if ( vv.indexOf( txt ) !== -1 ) { return; }	if ( /[^,; \/]$/.test( vv ) ) { vv += ','; }	if ( /[^ ]$/.test( vv ) ) { vv += ' '; }	$( 'input[name="wpSummary"]' ).val( vv + txt ); } function addSumButton ( btn, txt ) { $( '' + btn + '' ) .appendTo( '#userSummaryButtonsA' ) .click( insertSummary ); } $( function {	var frm = document.getElementById( 'editform' );	if ( !mw.config.get( 'wgArticleId' ) || !frm || $( frm.wpSection ).val === 'new' ) {		return;	}	mw.util.addCSS( '\ #wpSummary { margin-bottom: 0 }\ #userSummaryButtonsA a { background:#cef; border:1px solid #adf; padding:0 2px;\ margin:0 2px;cursor:pointer; font-size:86%; color:#666 }\ #userSummaryButtonsA a:hover { background:#bdf; color:black; text-decoration:none }' );	$( ' ' ).insertAfter( '#wpSummary' );	$.each( [		'vandalism', 'spam', 'unexplained change', 'updated pl interwiki', 'added pl interwiki' ],		function ( i, s ) { addSumButton( s.replace( /\|.*/,  ), s.replace( /\|/,  ) ); }	); } );

// Ukrywa przyciski jeśli brakuje na nie miejsca $("li[id*='ca-watch']").addClass('collapsible'); $("li[id*='ca-unwatch']").addClass('collapsible'); $("li[id*='ca-edit']").addClass('collapsible'); $("li[id*='ca-view']").addClass('collapsible'); $("li[id*='ca-ve-edit']").addClass('collapsible'); $("li[id*='ca-viewsource']").addClass('collapsible'); var elements = document.getElementsByClassName('mw-userlink'); for (var i = 0; i < elements.length; i++) { if (elements[i].title==="User:User-12316399") { elements[i].children[0].textContent = "MinecraftPhotos4U" } }