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

(새 문서: $(function() { $('body').prepend('<div class="WW-bg" style="position:fixed;top:0px;left:0px;width:100%;height:100vh;"></div>'); });)
 
편집 요약 없음
1번째 줄: 1번째 줄:
$(function() {
$(function() {
     $('body').prepend('<div class="WW-bg" style="position:fixed;top:0px;left:0px;width:100%;height:100vh;"></div>');
     $('body').prepend('<div class="WW-bg" style="position:fixed;top:0px;left:0px;width:100%;height:100vh;"></div>');
});
// 오른쪽 사이드바
$(function() {
    var username = mw.config.get('wgUserName');
    var isLoggedIn = username !== null;
   
    var sidebar = '<div id="clbi-right-sidebar">' +
        // 회원정보
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">👤 ' + (isLoggedIn ? username : '로그인') + '</div>' +
        '<div class="clbi-right-content">' +
        (isLoggedIn ?
            '<a href="/index.php/특수:내_사용자_문서">내 문서</a><br>' +
            '<a href="/index.php/특수:환경_설정">환경설정</a><br>' +
            '<a href="/index.php?title=특수:사용자_로그아웃&returnto=대문">로그아웃</a>' :
            '<a href="/index.php?title=특수:로그인&returnto=대문">로그인</a>') +
        '</div></div>' +
        // 검색
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">🔍 검색</div>' +
        '<div class="clbi-right-content">' +
        '<input id="clbi-search-input" type="text" placeholder="검색...">' +
        '<button id="clbi-search-btn">GO</button>' +
        '</div></div>' +
        // 최근 변경
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">📋 최근 변경</div>' +
        '<div class="clbi-right-content">' +
        '<a href="/index.php/특수:최근_바뀜">최근 바뀜 보기</a>' +
        '</div></div>' +
        // 가이드
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">📖 가이드</div>' +
        '<div class="clbi-right-content">' +
        '<a href="/index.php/CLBI_Wiki/KR_시작하기_(CLBI)">시작하기</a>' +
        '</div></div>' +
        '</div>';
   
    $('body').append(sidebar);
   
    // 검색 기능
    $('#clbi-search-btn').click(function() {
        var query = $('#clbi-search-input').val();
        if(query) window.location.href = '/index.php?search=' + encodeURIComponent(query);
    });
    $('#clbi-search-input').keypress(function(e) {
        if(e.which == 13) $('#clbi-search-btn').click();
    });
});
});

2026년 4월 17일 (금) 05:09 판

$(function() {
    $('body').prepend('<div class="WW-bg" style="position:fixed;top:0px;left:0px;width:100%;height:100vh;"></div>');
});

// 오른쪽 사이드바
$(function() {
    var username = mw.config.get('wgUserName');
    var isLoggedIn = username !== null;
    
    var sidebar = '<div id="clbi-right-sidebar">' +
        // 회원정보
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">👤 ' + (isLoggedIn ? username : '로그인') + '</div>' +
        '<div class="clbi-right-content">' +
        (isLoggedIn ? 
            '<a href="/index.php/특수:내_사용자_문서">내 문서</a><br>' +
            '<a href="/index.php/특수:환경_설정">환경설정</a><br>' +
            '<a href="/index.php?title=특수:사용자_로그아웃&returnto=대문">로그아웃</a>' :
            '<a href="/index.php?title=특수:로그인&returnto=대문">로그인</a>') +
        '</div></div>' +
        // 검색
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">🔍 검색</div>' +
        '<div class="clbi-right-content">' +
        '<input id="clbi-search-input" type="text" placeholder="검색...">' +
        '<button id="clbi-search-btn">GO</button>' +
        '</div></div>' +
        // 최근 변경
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">📋 최근 변경</div>' +
        '<div class="clbi-right-content">' +
        '<a href="/index.php/특수:최근_바뀜">최근 바뀜 보기</a>' +
        '</div></div>' +
        // 가이드
        '<div class="clbi-right-box">' +
        '<div class="clbi-right-title">📖 가이드</div>' +
        '<div class="clbi-right-content">' +
        '<a href="/index.php/CLBI_Wiki/KR_시작하기_(CLBI)">시작하기</a>' +
        '</div></div>' +
        '</div>';
    
    $('body').append(sidebar);
    
    // 검색 기능
    $('#clbi-search-btn').click(function() {
        var query = $('#clbi-search-input').val();
        if(query) window.location.href = '/index.php?search=' + encodeURIComponent(query);
    });
    $('#clbi-search-input').keypress(function(e) {
        if(e.which == 13) $('#clbi-search-btn').click();
    });
});