편집 요약 없음 |
편집 요약 없음 |
||
| 1번째 줄: | 1번째 줄: | ||
// 디버깅용 임시 조치 | // // 디버깅용 임시 조치 | ||
// 미디어위키:Vector.js 적용시 지워주세요 | // // 미디어위키:Vector.js 적용시 지워주세요 | ||
$(function() { | // $(function() { | ||
setTimeout(function() { | // setTimeout(function() { | ||
$('span#buttons').children().appendTo('div#buttons'); | // $('span#buttons').children().appendTo('div#buttons'); | ||
$('span#buttons, #buttons span').remove(); | // $('span#buttons, #buttons span').remove(); | ||
$('div#buttons, #buttons button').attr('style', null); | // $('div#buttons, #buttons button').attr('style', null); | ||
},0); | // },0); | ||
}); | // }); | ||
// 디버깅용 임시 조치 끝 | // // 디버깅용 임시 조치 끝 | ||
// 여기까지 지워주세요 | // // 여기까지 지워주세요 | ||
/* [[Category:Wikipedia scripts]] | // /* [[Category:Wikipedia scripts]] | ||
이 스크립트는 Minecraft Wiki의 Majr의 goToTop.js를 | // 이 스크립트는 Minecraft Wiki의 Majr의 goToTop.js를 | ||
(http://minecraftwiki.net/wiki/User:Majr/goToTop.js/) | // (http://minecraftwiki.net/wiki/User:Majr/goToTop.js/) | ||
리브레 위키의 사용자 Utolee90이 자유위키에서 재가공해서 만들었습니다. 이를 큰숲백과에서 큰숲식으로 다시 재가공 하였습니다. | // 리브레 위키의 사용자 Utolee90이 자유위키에서 재가공해서 만들었습니다. 이를 큰숲백과에서 큰숲식으로 다시 재가공 하였습니다. | ||
*/ | // */ | ||
// // toggleFunc | // // // toggleFunc | ||
// function toggleFunc() { | // // function toggleFunc() { | ||
// $("#mw-panel, #p-personal ul.vector-menu-content-list, .mw-body, #left-navigation, #folded-link, #footer") | // // $("#mw-panel, #p-personal ul.vector-menu-content-list, .mw-body, #left-navigation, #folded-link, #footer") | ||
// .css('transition', 'all 0.4s cubic-bezier(0,0,0.2,1) 0s'); | // // .css('transition', 'all 0.4s cubic-bezier(0,0,0.2,1) 0s'); | ||
// $("#mw-panel, #p-personal ul.vector-menu-content-list, .mw-body, #left-navigation, #folded-link, #footer").toggleClass('folded'); | // // $("#mw-panel, #p-personal ul.vector-menu-content-list, .mw-body, #left-navigation, #folded-link, #footer").toggleClass('folded'); | ||
// $("a#folded-link")[0].innerText = $("a#folded-link").is(".folded") ? "[사이드바]" : "[화면 확장]"; | // // $("a#folded-link")[0].innerText = $("a#folded-link").is(".folded") ? "[사이드바]" : "[화면 확장]"; | ||
// } | // // } | ||
// // //toggleNotice | |||
// // function toggleNotice() { | |||
// // if ($(".mw-dismissable-notice")[0].style.display !== "block") { | |||
// // $("#ctrl-dismissable-notice-link")[0].innerText = "[공지 숨기기]" | |||
// // $(".mw-dismissable-notice")[0].style.display = "block"; | |||
// // } | |||
// // else { | |||
// // $("#ctrl-dismissable-notice-link")[0].innerText = "[공지 보기]" | |||
// // $(".mw-dismissable-notice")[0].style.display = ""; | |||
// | // // } | ||
// // } | |||
// | |||
// | |||
// | |||
// | // function createButton(id, content, action) { | ||
// 'use strict'; | |||
// $('#buttons').append($('<button />', { | |||
// id: id | |||
// }).html(content).click(action)); | |||
// } | // } | ||
// $('body').append('<div id="buttons"></div>'); | |||
// $(function () { | |||
// 'use strict'; | |||
// var height = document.body.scrollHeight; | |||
// /* 위로 올라가는 버튼을 만듭니다. */ | |||
// createButton('to-top', '▲', function () { | |||
// $('html, body').animate({ scrollTop: 0 }, 'slow'); | |||
$('body').append('<div id="buttons"></div>'); | // }); | ||
$(function () { | |||
'use strict'; | |||
var height = document.body.scrollHeight; | |||
/* 위로 올라가는 버튼을 만듭니다. */ | |||
createButton('to-top', '▲', function () { | |||
$('html, body').animate({ scrollTop: 0 }, 'slow'); | |||
}); | |||
/* 아래 버튼을 만듭니다. */ | // /* 아래 버튼을 만듭니다. */ | ||
createButton('to-bottom', '▼', function () { | // createButton('to-bottom', '▼', function () { | ||
$('html, body').animate({ scrollTop: height }, 'slow'); | // $('html, body').animate({ scrollTop: height }, 'slow'); | ||
}); | // }); | ||
/* 랜덤문서 보내기 버튼을 만듭니다. */ | // /* 랜덤문서 보내기 버튼을 만듭니다. */ | ||
createButton('to-random', '?', function () { | // createButton('to-random', '?', function () { | ||
location.href = mw.util.getUrl('Special:Random'); | // location.href = mw.util.getUrl('Special:Random'); | ||
}); | // }); | ||
// 특수 이름공간에서 만들지 않는 버튼 | // // 특수 이름공간에서 만들지 않는 버튼 | ||
if (mw.config.get('wgNamespaceNumber') >= 0) { | // if (mw.config.get('wgNamespaceNumber') >= 0) { | ||
/* 편집 버튼을 만듭니다. */ | // /* 편집 버튼을 만듭니다. */ | ||
createButton('to-editpage', 'E', function () { | // createButton('to-editpage', 'E', function () { | ||
if (mw.config.get('wgAction') != 'edit') | // if (mw.config.get('wgAction') != 'edit') | ||
location.href = mw.util.getUrl(mw.config.get('wgRelevantPageName'), {action: 'edit'}); | // location.href = mw.util.getUrl(mw.config.get('wgRelevantPageName'), {action: 'edit'}); | ||
}); | // }); | ||
/* 문서 역사 버튼을 만듭니다. */ | // /* 문서 역사 버튼을 만듭니다. */ | ||
createButton('to-history', 'H', function () { | // createButton('to-history', 'H', function () { | ||
location.href = mw.util.getUrl(mw.config.get('wgRelevantPageName'), {action: 'history'}); | // location.href = mw.util.getUrl(mw.config.get('wgRelevantPageName'), {action: 'history'}); | ||
}); | // }); | ||
} | // } | ||
}); | // }); | ||