Last active
August 21, 2023 06:10
-
-
Save NaniteFactory/77ed3d61a7b0db2bbe98831734398a22 to your computer and use it in GitHub Desktop.
티스토리 로그인 로그아웃
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="tab_login"><a href="#" id="tab_login_toggle" onclick="fnLoginToggle();"></a> | |
<script> | |
function fnLoginToggle() {}; | |
$(function() { | |
if(window.T.config.USER.name) { | |
$('#tab_login_toggle').text('로그아웃'); | |
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/logout?redirectUrl=" + encodeURIComponent(window.location.href); }; | |
} else { | |
$('#tab_login_toggle').text('로그인'); | |
fnLoginToggle = function() { document.location.href = "https://www.tistory.com/auth/login?redirectUrl=" + encodeURIComponent(window.location.href); }; | |
} | |
}); | |
</script> | |
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class="tab_login" > | |
<script> | |
//로그아웃, 로그인 표시 | |
if($('script:contains("트랙백을 삭제하기 위해서는 로그인이 필요합니다")').length=='2'){ | |
//로그아웃상태. 로그인해야됨 | |
document.write('<a href="http://www.tistory.com/login">로그인</a>'); | |
}else{//로그아웃 | |
document.write('<a href="http://www.tistory.com/logout">로그아웃</a>'); | |
} | |
</script> | |
</li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment