MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
Mixailo (обсуждение | вклад) (Содержимое страницы заменено на «$2 importScriptURI('//ru.wikiquote.org/wiki/User:Quqel/sandbox.js?ctype=text/javascript&action=raw'); $(function(){ $('a[title*…») |
Natural (обсуждение | вклад) (Реклама Яндекс Директ) |
||
| Строка 1: | Строка 1: | ||
/* | /*WikiEditor/Викификатор*/ | ||
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | |||
mw.loader.load( '//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-wikificator.js&action=raw&ctype=text/javascript' ); | |||
/ | |||
} | } | ||
var customizeToolbar = function() { | |||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'advanced', | |||
'group': 'format', | |||
function | 'tools': { | ||
'wikify': { | |||
label: 'Викификатор', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/0/06/Wikify-toolbutton.png', | |||
action: { | |||
type: 'callback', | |||
execute: function(context){ | |||
Wikify(); | |||
} | |||
} | |||
} | |||
function | |||
} | } | ||
} | } ); | ||
}; | |||
} | |||
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | |||
mw.loader.using( 'user.options', function () { | |||
if (wgAction == | if ( mw.user.options.get('usebetatoolbar') ) { | ||
mw.loader.using( 'ext.wikiEditor.toolbar', function () { | |||
if( ( | $(document).ready( customizeToolbar ); | ||
} ); | |||
} | |||
} | } | ||
} ); | |||
}); | |||
} | } | ||
| Строка 99: | Строка 39: | ||
/*************************/ | /*************************/ | ||
/* | /* Блок 1 */ | ||
console.log('test15'); | |||
(function() { | (function() { | ||
$('#top').after('<div id="yandex_rtb_R-A-446933-1"></div>'); | |||
})(); | })(); | ||
| Строка 138: | Строка 64: | ||
})(this, this.document, "yandexContextAsyncCallbacks"); | })(this, this.document, "yandexContextAsyncCallbacks"); | ||
/* | /* Блок 2 */ | ||
(function() { | (function() { | ||
$('#mw-content-text').after('<div id="yandex_rtb_R-A-446933-2"></div>'); | |||
})(); | })(); | ||
| Строка 162: | Строка 86: | ||
t.parentNode.insertBefore(s, t); | t.parentNode.insertBefore(s, t); | ||
})(this, this.document, "yandexContextAsyncCallbacks"); | })(this, this.document, "yandexContextAsyncCallbacks"); | ||
Версия от 16:53, 20 июня 2023
/*WikiEditor/Викификатор*/
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.load( '//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-wikificator.js&action=raw&ctype=text/javascript' );
}
var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'format',
'tools': {
'wikify': {
label: 'Викификатор',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/0/06/Wikify-toolbutton.png',
action: {
type: 'callback',
execute: function(context){
Wikify();
}
}
}
}
} );
};
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get('usebetatoolbar') ) {
mw.loader.using( 'ext.wikiEditor.toolbar', function () {
$(document).ready( customizeToolbar );
} );
}
} );
}
/*************************/
/* Реклама Яндекс Директ */
/*************************/
/* Блок 1 */
console.log('test15');
(function() {
$('#top').after('<div id="yandex_rtb_R-A-446933-1"></div>');
})();
(function(w, d, n, s, t) {
w[n] = w[n] || [];
w[n].push(function() {
Ya.Context.AdvManager.render({
blockId: "R-A-446933-1",
renderTo: "yandex_rtb_R-A-446933-1",
async: true
});
});
t = d.getElementsByTagName("script")[0];
s = d.createElement("script");
s.type = "text/javascript";
s.src = "//an.yandex.ru/system/context.js";
s.async = true;
t.parentNode.insertBefore(s, t);
})(this, this.document, "yandexContextAsyncCallbacks");
/* Блок 2 */
(function() {
$('#mw-content-text').after('<div id="yandex_rtb_R-A-446933-2"></div>');
})();
(function(w, d, n, s, t) {
w[n] = w[n] || [];
w[n].push(function() {
Ya.Context.AdvManager.render({
blockId: "R-A-446933-2",
renderTo: "yandex_rtb_R-A-446933-2",
async: true
});
});
t = d.getElementsByTagName("script")[0];
s = d.createElement("script");
s.type = "text/javascript";
s.src = "//an.yandex.ru/system/context.js";
s.async = true;
t.parentNode.insertBefore(s, t);
})(this, this.document, "yandexContextAsyncCallbacks");