로그인하고 있지 않습니다. 편집하면 당신의 IP 주소가 공개적으로 기록됩니다. 계정을 만들고 로그인하면 편집 시 사용자 이름만 보이며, 위키 이용에 여러 가지 편의가 주어집니다.스팸 방지 검사입니다. 이것을 입력하지 마세요!=== Vector 스킨에서 우측 최근 바뀐 문서 보여주는 상자 만들기 === [[특수:내사용자문서/vector.js]]에 아래 코드를 삽입할 경우 Vector(벡터) 스킨을 사용할 때 Liberty 스킨의 최근 바뀐 문서를 한눈에 보여주는 상자를 삽입하실 수 있습니다.[https://github.com/librewiki/liberty-skin/blob/master/js/live-recent.js 참조]. Liberty 스킨의 최근 바뀜 상자를 만들어주는 live-recent.js 코드를 이용해서 재구성했습니다. [[특수:내사용자문서/vector.js]]에 직접 아래 소스를 복사하거나 아니면 아래 코드를 [[특수:내사용자문서/vector.js]]에 붙여넣으시면 됩니다. 그러면 벡터 스킨을 기본 스킨으로 지정할 경우 최근에 편집한 문서를 보여주는 상자를 띄울 수 있습니다. <pre>mw.loader.load('https://librewiki.net/index.php?title=사용자:Utolee90/recentchange.js&action=raw&ctype=text/javascript');</pre> {{숨김 시작|title=Vector 스킨에서 최근 바뀐 문서 한눈에 확인하는 상자 만들기|bg=#eee}} <syntaxhighlight lang="javascript"> // 1280픽셀 이상에서만 상자가 나타나게 설정함. var mediaViewContent = window.matchMedia('(min-width: 1280px)') //최근 바뀜 목록 보이기 - 출처 : https://github.com/librewiki/liberty-skin/blob/master/js/live-recent.js if (mediaViewContent.matches) { $( function () { $('body').append('<div id="libre-recent-vector"></div>'); // 최근 바뀜 상자 $('#libre-recent-vector').append('<div id="libre-recent-tabs"></div>'); // 최근 바뀜 상자 탭 버튼 $('#libre-recent-vector').append('<div id="recent-list-div"></div>'); // 최근 바뀜 상자 내용 $('#libre-recent-tabs').append('<div id="recent-text" class="selected">최근 문서</div>'); // 최근 문서 버튼 $('#libre-recent-tabs').append('<div id="recent-talk">최근 토론</div>'); // 최근 토론 버튼 $('#recent-list-div').append('<div class="live-recent-content"></div>'); // 최근 바뀜 내용 $('#recent-list-div').append('<div class="recent-more" title="최근 바뀜 문서">최근 바뀜 더 보기</div>'); // 더 알아보기 $('.live-recent-content').append('<ul id="live-recent-list" class="live-recent-list docupage"></div>'); // 리스트 var listNum = 10; // 목록 갯수 // 목록 갯수에 따라 오브젝트 추가 for (var j = 0; j<listNum; j++) { $('#live-recent-list').append('<li class="recent-item-background"><span class="recent-item">'+j.toString()+'</span></li>'); $('.recent-item-background')[j].style.background= j%2 ==0 ? '#eee' : '#c1d8e1'; } //기초 css 지정 $('#libre-recent-vector').css({"position":"fixed","top":"15%","right":"10px"}); $('#libre-recent-tabs').css({"display":"flex", "padding":"3px", "border":"1px solid grey", "background":"#ddf"}); $('#recent-text').css({"padding":"3px", "flex":"1", "background":"#417ff3", "color":"white", "font-weight":"bold", "cursor":"pointer", "textAlign":"center"}); $('#recent-talk').css({"padding":"3px", "flex":"1", "background":"white", "font-weight":"bold", "cursor":"pointer", "textAlign":"center"}); $('#recent-list-div').css({"width":"180px", "top":"auto", "right":"10px"}); $('.live-recent-list.docupage').css({"display":"block", "list-style-type": "none", "padding": "0", "margin": "0"}); $('.live-recent-content').css({"border":"1px solid grey", 'background':'#eee', 'fontSize':'0.8em'}); $('.live-recent-list.docupage>li').css({"border-collapse":"collapse"}); $('.recent-more').css({"border":"1px solid grey", "background":"#c1d8e1", "color":"#417ff3", "textAlign":"center", "cursor":"pointer", "fontWeight":"bold"}); // 더 보기 버튼 $('.recent-more').click(function(){window.location.href='//librewiki.net/wiki/특수:최근바뀜';}); //가로폭이 좁으면 content 내용 좁히기. 'use strict'; var articleNamespaces, talkNamespaces, isArticleTab, limit; //변수 지정 articleNamespaces = '0|4|10|12|14|1600|1602'; // 문서 페이지 네임스페이스 번호 지정 가능 talkNamespaces = '1|5|7|9|11|13|15|829|1601|1603|2600'; //토론 페이지 네임스페이스 번호 지정가능 isArticleTab = true; //문서 탭이 초기일 때 limit = $( '#live-recent-list' )[ 0 ].childElementCount; // id가 live-recent-list인 ul의 자식 원소인 li 갯수만큼 추출 function timeFormat( time ) { //시간 출력형태 결정 var aDayAgo, hour, minute, second; aDayAgo = new Date(); aDayAgo.setDate( aDayAgo.getDate() - 1 ); //하루 전의 같은 시간 표시 if ( time < aDayAgo ) { //만일 하루전보다 시간이 지날 경우 return ( time.getFullYear() ) + '/' + ( time.getMonth() + 1 ) + '/' + time.getDate(); } //시간 대신 날짜로 표시 hour = time.getHours(); minute = time.getMinutes(); second = time.getSeconds(); if ( hour < 10 ) { //10보다 작으면 강제로 십의 자리에 0을 끼운다. hour = '0' + hour; } if ( minute < 10 ) { minute = '0' + minute; } if ( second < 10 ) { second = '0' + second; } return hour + ':' + minute + ':' + second; } function refreshLiveRecent() { var getParameter; if ( !$( '#live-recent-list' ).length || $( '#live-recent-list' ).is( ':hidden' ) ) { return; //길이가 정의 불가능이거나 내용이 숨겨져 있을 경우 내용을 출력 안 함. } getParameter = { //쿼리 지정할 수 있습니다. action: 'query', list: 'recentchanges', rcprop: 'title|timestamp', //긁어오는 정보 - 제목, 편집시간 rcshow: '!bot|!redirect', //봇 편집, 넘겨주기는 제외 rctype: 'edit|new', //편집, 새문서 rclimit: limit, //긁어오는 문서 숫자 - limit으로 지정 format: 'json', //json으로 api 긁어오기 rcnamespace: isArticleTab ? articleNamespaces : talkNamespaces, //보여줄 이름공간 지정 rctoponly: true }; var api = new mw.Api(); api.get( getParameter ) .then( function ( data ) { var recentChanges, html, time, line, text; recentChanges = data.query.recentchanges; for (var j= 0; j<limit; j++) { $('.recent-item-background')[j].innerHTML = ''; if (j < recentChanges.length) { var item = recentChanges[j]; var time = new Date( item.timestamp ); var newA = document.createElement('a'); // 하이퍼링크 텍스트 newA.setAttribute('href', mw.util.getUrl(item.title)); newA.setAttribute('title', item.title); newA.classList.add('recent-item'); var titletext = item.title.length > 13 ? item.title.slice(0,13)+'..' : item.title; newA.innerText = '[' + timeFormat( time ) + '] ' + titletext; // 새문서일 때 if (item.type == 'new') { newA.style.color = '#d45'; newA.setAttribute('title', item.title+ " (NEW)"); // newA.innerHTML += ' <span class="new">' + mw.msg( 'liberty-feed-new' ) + ' </span>'; 미작동되기에 일단 지우기 } $('.recent-item-background')[j].appendChild(newA); } } }) .catch( function () {} ); } //isArticleTab 바꿔주기 //클릭 시 표시되는 내용 지정 var rtext=$('#recent-text'); var rtalk=$('#recent-talk'); rtext.click(function(){rtext.css({"background":"#417ff3", "color":"white"}); rtalk.css({"background":"white", "color":"black"}); isArticleTab = true; refreshLiveRecent(); }); //최근문서 배경색 파랗게, 최근문서 내용 보이고 최근토론 내용 숨김 rtalk.click(function(){rtext.css({"background":"white", "color":"black"}); rtalk.css({"background":"#417ff3", "color":"white"}); isArticleTab = false; refreshLiveRecent(); } ); //최근토론 배경색 파랗게, 최근문서 내용 숨기고 최근토론 내용 보임 setInterval( refreshLiveRecent, 5 * 60 * 1000 ); refreshLiveRecent(); } ); } </syntaxhighlight> {{숨김 끝}} 요약: 리브레 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0 라이선스로 배포됩니다(자세한 내용에 대해서는 리브레 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요. 글이 직접 작성되었거나 호환되는 라이선스인지 확인해주세요. 리그베다 위키, 나무위키, 오리위키, 구스위키, 디시위키 및 CCL 미적용 사이트 등에서 글을 가져오실 때는 본인이 문서의 유일한 기여자여야 하고, 만약 본인이 문서의 유일한 기여자라는 증거가 없다면 그 문서는 불시에 삭제될 수 있습니다. 취소 편집 도움말 (새 창에서 열림) | () [] [[]] {{}} {{{}}} · <!-- --> · [[분류:]] · [[파일:]] · [[미디어:]] · #넘겨주기 [[]] · {{ㅊ|}} · <onlyinclude></onlyinclude> · <includeonly></includeonly> · <noinclude></noinclude> · <br /> · <ref></ref> · {{각주}} · {|class="wikitable" · |- · rowspan=""| · colspan=""| · |} {{lang|}} · {{llang||}} · {{인용문|}} · {{인용문2|}} · {{유튜브|}} · {{다음팟|}} · {{니코|}} · {{토막글}} {{삭제|}} · {{특정판삭제|}}(이유를 적지 않을 경우 기각될 가능성이 높습니다. 반드시 이유를 적어주세요.) {{#expr:}} · {{#if:}} · {{#ifeq:}} · {{#iferror:}} · {{#ifexist:}} · {{#switch:}} · {{#time:}} · {{#timel:}} · {{#titleparts:}} __NOTOC__ · __FORCETOC__ · __TOC__ · {{PAGENAME}} · {{SITENAME}} · {{localurl:}} · {{fullurl:}} · {{ns:}} –(대시) ‘’(작은따옴표) “”(큰따옴표) ·(가운뎃점) …(말줄임표) ‽(물음느낌표) 〈〉(홑화살괄호) 《》(겹화살괄호) ± − × ÷ ≈ ≠ ∓ ≤ ≥ ∞ ¬ ¹ ² ³ ⁿ ¼ ½ ¾ § € £ ₩ ¥ ¢ † ‡ • ← → ↔ ‰ °C µ(마이크로) Å °(도) ′(분) ″(초) Α α Β β Γ γ Δ δ Ε ε Ζ ζ Η η Θ θ Ι ι Κ κ Λ λ Μ μ(뮤) Ν ν Ξ ξ Ο ο Π π Ρ ρ Σ σ ς Τ τ Υ υ Φ φ Χ χ Ψ ψ Ω ω · Ά ά Έ έ Ή ή Ί ί Ό ό Ύ ύ Ώ ώ · Ϊ ϊ Ϋ ϋ · ΐ ΰ Æ æ Đ(D with stroke) đ Ð(eth) ð ı Ł ł Ø ø Œ œ ß Þ þ · Á á Ć ć É é Í í Ĺ ĺ Ḿ ḿ Ń ń Ó ó Ŕ ŕ Ś ś Ú ú Ý ý Ź ź · À à È è Ì ì Ǹ ǹ Ò ò Ù ù · İ Ż ż ·  â Ĉ ĉ Ê ê Ĝ ĝ Ĥ ĥ Î î Ĵ ĵ Ô ô Ŝ ŝ Û û · Ä ä Ë ë Ï ï Ö ö Ü ü Ÿ ÿ · ǘ ǜ ǚ ǖ · caron/háček: Ǎ ǎ Č č Ď ď Ě ě Ǐ ǐ Ľ ľ Ň ň Ǒ ǒ Ř ř Š š Ť ť Ǔ ǔ Ž ž · breve: Ă ă Ğ ğ Ŏ ŏ Ŭ ŭ · Ā ā Ē ē Ī ī Ō ō Ū ū · à ã Ñ ñ Õ õ · Å å Ů ů · Ą ą Ę ę · Ç ç Ş ş Ţ ţ · Ő ő Ű ű · Ș ș Ț ț