본문으로 이동
  • 이 서버는 리버티게임의 개발용 베타 서버로, 게임 플레이 용도로 제작된 사이트가 아닙니다.
  • 리버티게임의 자동 인증된 사용자라면 개발에 필요한 관리자 권한을 신청할 수 있습니다.
  • 틀 및 기능별 소도구를 필요한 문서에만 선택적으로 로딩하는 테스트를 진행하고 있습니다. 작동하지 않는 문서가 있다면 담당자에게 알려주세요.

미디어위키:Gadget-OWLink.js: 두 판 사이의 차이

리버티게임(개발), 모두가 만들어가는 자유로운 게임
imported>Senouis
Secure CGI 소도구 분할
 
imported>Senouis
편집 요약 없음
15번째 줄: 15번째 줄:
location.pathname.startsWith('/wiki/') && location.pathname.replace('/wiki/', '')
location.pathname.startsWith('/wiki/') && location.pathname.replace('/wiki/', '')
) === (
) === (
href.pathname === '/w/index.php' && params.searchParams.get('title') ||
href.pathname === '/w/index.php' && href.searchParams.get('title') ||
href.pathname.startsWith('/wiki/') && href.pathname.replace('/wiki/', '')
href.pathname.startsWith('/wiki/') && href.pathname.replace('/wiki/', '')
) && params.get('action') === href.searchParams.get('action')
) && params.get('action') === href.searchParams.get('action')

2020년 12월 29일 (화) 14:50 판

/** [[틀:SCGI]]에서 사용하는 링크 리다이렉트 함수
 * class="scgi-use"
 * 작성자: [[사용자:Gustmd7410|Gustmd7410]]
**/
$(function useSCGI() {
	if(!URLSearchParams) return;
	
	$('.scgi-use a').each(function() {
		var href = new URL(this.href);
		var params = new URLSearchParams(location.search);
		
		if(
			location.host === href.host && (
				location.pathname === '/w/index.php' && params.get('title') ||
				location.pathname.startsWith('/wiki/') && location.pathname.replace('/wiki/', '')
			) === (
				href.pathname === '/w/index.php' && href.searchParams.get('title') ||
				href.pathname.startsWith('/wiki/') && href.pathname.replace('/wiki/', '')
			) && params.get('action') === href.searchParams.get('action')
		) $(this).click(function(event) {
			event.preventDefault();
			location.replace(event.currentTarget.href);
		});
	});
});

/* [[틀:SCGI]]에서 사용하는 링크 리다이렉트 함수 끝 */