MediaWiki:Mobile.js: відмінності між версіями
Матеріал з WikiLegalAid
Alexb (обговорення | внесок) Немає опису редагування |
Alexb (обговорення | внесок) Немає опису редагування |
||
| Рядок 2: | Рядок 2: | ||
mw.loader.using('mobile.startup', function () { | mw.loader.using('mobile.startup', function () { | ||
mw.hook('wikipage.content').add(function ($content) { | mw.hook('wikipage.content').add(function ($content) { | ||
// | // HTML вміст рекламного блоку (заміни на свій код) | ||
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-heading').each(function () { | $content.find('.section-heading').each(function () { | ||
const $section = $(this).closest('section'); | const $section = $(this).closest('section'); | ||
$section.removeClass('collapsed'); | $section.removeClass('collapsed'); | ||
$section.addClass('expanded'); | $section.addClass('expanded'); | ||
$section.find('.content-block').show() | $section.find('.content-block').show(); | ||
$section.after(adHtml); | |||
}); | }); | ||
}); | }); | ||
}); | }); | ||
