MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
Shaseer (обсуждение | вклад) |
Shaseer (обсуждение | вклад) |
||
| Строка 38: | Строка 38: | ||
/*Export to EPUB Button*/ | /*Export to EPUB Button*/ | ||
| − | + | var conf = mw.config.get([ | |
| + | 'wgCanonicalNamespace', | ||
| + | 'wgPageName' | ||
| + | ]); | ||
| + | // Only do the following in the Main namespace. | ||
| + | if ( conf.wgCanonicalNamespace === '(Main)' ) { | ||
| + | // Add a link to the actions menu. | ||
| + | mw.loader.using( 'mediawiki.util', function () { | ||
| + | mw.util.addPortletLink( | ||
| + | 'p-cactions', | ||
| + | 'https://wiki.warpfrog.wtf/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9D%D0%B5%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BD%D0%BE', | ||
| + | 'Экспорт в EPUB', | ||
| + | 'Данная функция временно недоступна' | ||
| + | ); | ||
| + | } ); | ||
| + | } | ||
/*Export to EPUB Button*/ | /*Export to EPUB Button*/ | ||
Версия 11:38, 23 января 2020
/* Размещённый здесь код JavaScript будет загружаться пользователям при обращении к каждой странице */
/* Yandex Metrika */
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(56096482, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
/* Yandex Metrika */
/* Google Analytics */
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-100709782-2');
/* Google Analytics */
/* Back to Top Button */
var btn = $('#button');
$(window).scroll(function() {
if ($(window).scrollTop() > 300) {
btn.addClass('show');
} else {
btn.removeClass('show');
}
});
btn.on('click', function(e) {
e.preventDefault();
$('html, body').animate({scrollTop:0}, '300');
});
/* Back to Top Button */
/*Export to EPUB Button*/
var conf = mw.config.get([
'wgCanonicalNamespace',
'wgPageName'
]);
// Only do the following in the Main namespace.
if ( conf.wgCanonicalNamespace === '(Main)' ) {
// Add a link to the actions menu.
mw.loader.using( 'mediawiki.util', function () {
mw.util.addPortletLink(
'p-cactions',
'https://wiki.warpfrog.wtf/index.php?title=%D0%A8%D0%B0%D0%B1%D0%BB%D0%BE%D0%BD:%D0%9D%D0%B5%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF%D0%BD%D0%BE',
'Экспорт в EPUB',
'Данная функция временно недоступна'
);
} );
}
/*Export to EPUB Button*/