Skip to content

Instantly share code, notes, and snippets.

@codian
Created July 30, 2012 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codian/3203853 to your computer and use it in GitHub Desktop.
Save codian/3203853 to your computer and use it in GitHub Desktop.
clean-me2day-wiki bookmarklet
// 아래 코드를 복사해 북마크에 등록하세요
// 북마크의 제목은 적당히 정하시고 아래 코드는 주소 부분에 붙여 넣으시기 바랍니다.
javascript:(function() {var d=document;var s=d.createElement('script');s.setAttribute('src','https://raw.github.com/gist/3203853/clean-me2day-wiki.js');d.getElementsByTagName('head')[0].appendChild(s);})()
var CleanMe2dayWiki = {
init: function() {
// include jquery
var s = document.getElementById('clean-me2day-wiki-jquery');
if (!s) {
s = document.createElement('script');
s.type = "text/javascript";
s.setAttribute('id', 'clean-me2day-wiki-jquery');
s.setAttribute('src', 'http://me2day.net/javascripts/jquery/jquery-1.7.min.js');
s.onload = function () { CleanMe2dayWiki.start(); };
document.getElementsByTagName('head')[0].appendChild(s);
}
},
start: function() {
// 언어 툴박스 제거
$("div span:contains('To Japanese')").parent().hide();
$("div.page-metadata").hide();
// 신고 버튼 제거
$("div img[src='/images/ico_trouble.gif']").parent().hide();
// 번역 버튼 제거
$("div img[src='/images/btn_trans.gif']").parent().hide();
// 상단 메뉴 네비게이션 제거
$("#header-menu-bar").hide();
// 상단 검색 폼 제거
$("#quick-search").hide();
// 상단 네이비게이션 우정렬
$("#breadcrumbs").css('float', 'right');
// 상단 네비게이션 불필요 부분 제거
$("#breadcrumbs li.first").hide();
$("#breadcrumbs li span a[href='/display/lsus']").parent().parent().hide();
$("#breadcrumbs li:last").hide();
// ellipsis 네비게이션 펼치기
if ($("#ellipsis")) {
$("#breadcrumbs li.hidden-crumb").show();
$("#ellipsis").hide();
}
// 페이지 메뉴 제거
$("#navigation").hide();
// 라벨 제거
$("#labels-section").hide();
// 댓글 제거
$("#comments-section").hide();
// 자식 페이지 섹션 제거
$("#children-section").hide();
// 푸터 제거
$("#footer").hide();
// 제목 중앙 정렬
$("#title-heading").css('text-align', 'center');
// 상단 네비게이션이 영역을 넘는 경우 대비
$("#header").append($("<div style=\"clear: both\"></div>"));
// 폰트 스타일 변경. CSS 오버라이드 함.
$("head").append($("\
<style type=\"text/css\" id=\"e1_style\"> \
body { \
font-family: 나눔고딕, NanumGothic, NanumGothicOTF, 맑은고딕, 'Malgun Gothic'; \
} \
body, p, td, table, th, .bodytext, .stepfield, .wiki-content, \
.wiki-content p, .wiki-content table, .wiki-content tr, \
.wiki-content td, .wiki-content th, .wiki-content ol, .wiki-content ul, \
.wiki-content li, h4.author { \
line-height: 150% \
} \
.panel { \
margin: 0; \
} \
.wiki-content td.confluenceTd, .wiki-content th.confluenceTh { \
padding-left: 1px; \
padding-right: 1px; \
}; \
</style> \
"));
// 코드 패널의 패널 클래스 제거
$("div.code.panel").removeClass('panel').css("border", "none");
}
};
CleanMe2dayWiki.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment