Spaces:
Running
Running
Sign-in opens in a new tab when the page runs inside the HF frame
Browse files- challenge.html +7 -1
challenge.html
CHANGED
|
@@ -360,4 +360,10 @@ document.getElementById('f').onsubmit=async e=>{e.preventDefault();const d=Objec
|
|
| 360 |
try{const r=await fetch('/api/rt/submit',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json'},body:JSON.stringify(d)});const j=await r.json();
|
| 361 |
if(j.relogin){m.innerHTML=T('Please sign in again before submitting. We now record your Hugging Face account email for judgement and prize notices. ','์ ์ถ ์ ์ ๋ค์ ๋ก๊ทธ์ธํด ์ฃผ์ธ์. ํ์ ๊ณผ ์๊ธ ์๋ด๋ฅผ ์ํด Hugging Face ๊ณ์ ์ด๋ฉ์ผ์ ๊ธฐ๋กํฉ๋๋ค. ')+'<a href="/login" target="_top">'+T('Sign in again','๋ค์ ๋ก๊ทธ์ธ')+'</a>';return}m.textContent=r.ok?(T('Received: ','์ ์๋จ: ')+j.id+T(' ยท left today ',' ยท ์ค๋ ๋จ์ ์ ์ถ ')+j.left_today):(j.error||'error');if(r.ok)e.target.reset()}catch(x){m.textContent='error'}};
|
| 362 |
render();
|
| 363 |
-
</script><
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
try{const r=await fetch('/api/rt/submit',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json'},body:JSON.stringify(d)});const j=await r.json();
|
| 361 |
if(j.relogin){m.innerHTML=T('Please sign in again before submitting. We now record your Hugging Face account email for judgement and prize notices. ','์ ์ถ ์ ์ ๋ค์ ๋ก๊ทธ์ธํด ์ฃผ์ธ์. ํ์ ๊ณผ ์๊ธ ์๋ด๋ฅผ ์ํด Hugging Face ๊ณ์ ์ด๋ฉ์ผ์ ๊ธฐ๋กํฉ๋๋ค. ')+'<a href="/login" target="_top">'+T('Sign in again','๋ค์ ๋ก๊ทธ์ธ')+'</a>';return}m.textContent=r.ok?(T('Received: ','์ ์๋จ: ')+j.id+T(' ยท left today ',' ยท ์ค๋ ๋จ์ ์ ์ถ ')+j.left_today):(j.error||'error');if(r.ok)e.target.reset()}catch(x){m.textContent='error'}};
|
| 362 |
render();
|
| 363 |
+
</script><script>/* HF shows this Space inside a frame that cannot navigate the whole page. Sign-in then opens in a new tab. */
|
| 364 |
+
(function(){var inF;try{inF=window.self!==window.top}catch(e){inF=true}if(!inF)return;
|
| 365 |
+
document.addEventListener("click",function(e){var a=e.target.closest&&e.target.closest('a[href="/login"],a[href="/logout"]');if(!a)return;
|
| 366 |
+
e.preventDefault();window.open(location.origin+a.getAttribute("href"),"_blank");
|
| 367 |
+
var n=document.getElementById("loginNewTab");if(!n){n=document.createElement("div");n.id="loginNewTab";n.style.cssText="position:fixed;left:50%;top:14px;transform:translateX(-50%);z-index:99;background:#111827;color:#fff;padding:9px 14px;border-radius:10px;font:600 13px system-ui,sans-serif";document.body.appendChild(n)}
|
| 368 |
+
n.textContent=(document.documentElement.lang==="ko")?"๋ก๊ทธ์ธ ์ฐฝ์ด ์ ํญ์์ ์ด๋ ธ์ต๋๋ค. ๊ทธ ํญ์์ ์ด์ด ํ์ธ์.":"Sign-in opened in a new tab. Continue there.";},true);})();</script>
|
| 369 |
+
</body></html>
|