사용자:낙엽1124/common.js

최근 편집: 2017년 7월 26일 (수) 20:48

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다.

  • 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
  • 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
  • 인터넷 익스플로러 / 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
  • 오페라: Ctrl-F5를 입력.
//존재/가상에 있는 링크 기울이기
//mw.loader.load("/index.php?title=사용자:렌즈/categoryCheck.js&action=raw&ctype=text/javascript");

//메뉴에 Purge 링크 추가
$(document).ready( function () {
	try {
		var menu = document.getElementById("p-actions").
				getElementsByTagName('ul')[0],
			purge = document.createElement('li'),
			a = document.createElement('a');
		menu.append(purge);
		purge.append(a);
		a.innerHTML='새로고침';
		a.href = "#";
		a.accesskey = "r";
		a.onclick = function() {
			$.ajax(
				{ 
					url: window.location.protocol
						+'//'
						+window.location.hostname
						+"/api.php?action=purge&forcelinkupdate=1&titles="
						+mw.config.get('wgPageName') 
				});
//			location.reload();
			return false; 
		};
	} catch (err) {;}
});

MathJax.Hub.Queue(function () {
	$('#content p > span:only-child > span.MathJax,'
	+'#content p > span.mathjax-wrapper:only-child > div').each(function(){
		$(this).parent().css('background-color','red');
		if(!$(this).parent().parent().clone().children().remove().end().text().trim().length) {
			$(this).parent().css('background-color','greenyellow');
			$(this).parent().css('display','block');
			$(this).parent().css('text-align','center');
		}
	});
});