본문으로 이동

미디어위키:Common.js: 두 판 사이의 차이

김준호위키
새 문서: 이 자바스크립트 설정은 모든 문서, 모든 사용자에게 적용됩니다.: $(document).ready(function() { // 광고를 넣을 컨테이너 생성 var adCont...
 
편집 요약 없음
19번째 줄: 19번째 줄:
         (adsbygoogle = window.adsbygoogle || []).push({});
         (adsbygoogle = window.adsbygoogle || []).push({});
     }
     }
});
$(document).ready(function() {
    // 광고를 넣을 컨테이너 생성
    var adSidebarContainer = '<div id="adsense-sidebar-container" style="padding: 10px;">' +
                            '<ins class="adsbygoogle" ' +
                            'style="display:block" ' +
                            'data-ad-client="ca-pub-8756229796915320" ' +
                            'data-ad-slot="6238396570" ' +
                            'data-ad-format="auto" ' +
                            'data-full-width-responsive="true"></ins>' +
                            '</div>';
    // 사이드바의 '도구' 메뉴(#p-tb) 아래에 광고 컨테이너 삽입
    $('#p-tb').after(adSidebarContainer);
    // 애드센스 스크립트 실행
    (adsbygoogle = window.adsbygoogle || []).push({});
});
});

2025년 6월 21일 (토) 21:41 판

/* 이 자바스크립트 설정은 모든 문서, 모든 사용자에게 적용됩니다. */
$(document).ready(function() {
    // 광고를 넣을 컨테이너 생성
    var adContainer = '<div id="adsense-top-container" style="margin-bottom: 15px; text-align: center;">' +
                      '<ins class="adsbygoogle" ' +
                      'style="display:block" ' +
                      'data-ad-client="ca-pub-8756229796915320" ' +
                      'data-ad-slot="6238396570" ' +
                      'data-ad-format="auto" ' +
                      'data-full-width-responsive="true"></ins>' +
                      '</div>';

    // 메인 네임스페이스(일반 문서)에만 광고를 표시하고 싶을 때
    if (mw.config.get('wgNamespaceNumber') === 0) {
        // 본문 내용 최상단(#mw-content-text .mw-parser-output 바로 위)에 광고 컨테이너 삽입
        $('#mw-content-text').prepend(adContainer);

        // 애드센스 스크립트 실행
        (adsbygoogle = window.adsbygoogle || []).push({});
    }
});

$(document).ready(function() {
    // 광고를 넣을 컨테이너 생성
    var adSidebarContainer = '<div id="adsense-sidebar-container" style="padding: 10px;">' +
                             '<ins class="adsbygoogle" ' +
                             'style="display:block" ' +
                             'data-ad-client="ca-pub-8756229796915320" ' +
                             'data-ad-slot="6238396570" ' +
                             'data-ad-format="auto" ' +
                             'data-full-width-responsive="true"></ins>' +
                             '</div>';

    // 사이드바의 '도구' 메뉴(#p-tb) 아래에 광고 컨테이너 삽입
    $('#p-tb').after(adSidebarContainer);

    // 애드센스 스크립트 실행
    (adsbygoogle = window.adsbygoogle || []).push({});
});