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