MediaWiki:Common.js: відмінності між версіями
Матеріал з WikiLegalAid
Alexb (обговорення | внесок) Немає опису редагування Мітка: Ручний відкіт |
Alexb (обговорення | внесок) Немає опису редагування Мітка: Скасовано |
||
| Рядок 69: | Рядок 69: | ||
document.getElementById("consent-banner").style.display = "none"; | document.getElementById("consent-banner").style.display = "none"; | ||
} | } | ||
}); | |||
mw.loader.using('mobile.startup', function () { | |||
mw.hook('wikipage.content').add(function ($content) { | |||
const adHtml = '<div class="ad-block" style="margin: 20px 0; text-align: center;">' + | |||
'<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-9946719691242357" data-ad-format="auto"></ins>' + | |||
'<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>' + | |||
'</div>'; | |||
$content.find('section').each(function () { | |||
const $section = $(this); | |||
const $heading = $section.find('h2, h3').first(); | |||
const $contentBlock = $section.find('.content').first(); | |||
$section.removeClass('collapsed'); | |||
$section.addClass('expanded'); | |||
$contentBlock.show(); | |||
$section.after(adHtml); | |||
}); | |||
}); | |||
}); | }); | ||
