Участник:Ivan-r/common.js: различия между версиями

Материал из Википедии — свободной энциклопедии
Перейти к навигации Перейти к поиску
Содержимое удалено Содержимое добавлено
Нет описания правки
мНет описания правки
 
Строка 1: Строка 1:
var summaryItemsSeparator = ';';
var summaryItemsSeparator = ';';


importScript('User:Absconditus/is.js');
/* importScript('User:Absconditus/is.js'); */
importScript('Участник:Dhārmikatva/hate.js');
importScript('Участник:Dhārmikatva/hate.js');
// Гаджет для замены звёздочек на отступы
/*
function addTemplatesList(){
var block = document.getElementById('editpage-specialchars');
if (!block) return;
block.innerHTML =
'<select onchange=insertSel(this)>'
+'<option>Шаблоны</option>'
+'<option value="subst:welcome">Welcome</option>'
+'<option value="subst:anon">Anon</option>'
+'<option value="stub">Stub</option>' // и т.д. — дополняйте сами
+'</select>' + block.innerHTML;
}
function insertSel(sel){
if (sel.selectedIndex <= 0) return;
var insertion = sel.options[sel.selectedIndex].value;
document.editform.wpTextbox1.value += '{'+'{' + insertion + '}}\n';
document.editform.wpSummary.value += insertion;
}
addOnloadHook(addTemplatesList);
*/
// Гаджет для замены звёздочек на отступы + гаджет на остаток символов для описания
if (mw.config.get( 'wgAction' ) == 'edit' || mw.config.get( 'wgAction' ) == 'submit') {
if (mw.config.get( 'wgAction' ) == 'edit' || mw.config.get( 'wgAction' ) == 'submit') {
mw.loader.load('https://minecraft-ru.gamepedia.com/MediaWiki:Gadget-legacyToolbar.js?action=raw&ctype=text/javascript');
importScript('Участник:Alex Great/discussion.js');
importScript('Участник:Alex Great/discussion.js');
importScript('Участник:Jack_who_built_the_house/summaryBytesLeft.js');
}
}

( function() {
'use strict';

/**
* Instead of cluttering up the global scope with
* variables, they should instead be set as a
* property of this global variable
*
* E.g: Instead of
* myVar = 'blah';
* use
* mcw.myVar = 'blah';
*/
var mcw = window.mcw = {};
mw.hook( 'wikipage.content' ).add( function( $wikipageContent ) {
/**
* Element animator
*
* Will cycle the active class on any child elements
* within an element with the animated class.
*/
( function() {
if ( !mcw.animate ) {
mcw.animate = setInterval( function() {
$( '.animated' ).each( function() {
var $elem = $( this );
var $current = $elem.children( '.active' );
var $next = $current.nextAll( ':not(.skip):first' );
// Loop back to the start
if ( !$next.length ) {
$next = $elem.children( ':not(.skip):first' );
}
$current.removeClass( 'active' );
$next.addClass( 'active' );
} );
}, 2000 );
}
}() );
}() );
}() );

Текущая версия от 10:34, 25 октября 2020

var summaryItemsSeparator = ';';

/* importScript('User:Absconditus/is.js'); */
importScript('Участник:Dhārmikatva/hate.js');
// Гаджет для замены звёздочек на отступы
if (mw.config.get( 'wgAction' ) == 'edit' || mw.config.get( 'wgAction' ) == 'submit') {
mw.loader.load('https://minecraft-ru.gamepedia.com/MediaWiki:Gadget-legacyToolbar.js?action=raw&ctype=text/javascript');
importScript('Участник:Alex Great/discussion.js');
}