Spaces:
Sleeping
Sleeping
Add browser autofill hints to login fields
Browse files1272 unmodified lines1273127412751276127712781 unmodified line1280128112821283128412851272 unmodified lineslogin_name = gr.Textbox(label="Your Name",placeholder="e.g. Alice Smith",)login_api_key = gr.Textbox(1 unmodified lineplaceholder="sk-proj-...",type="password",info="Get one at platform.openai.com/api-keys",)gr.Markdown(1272 unmodified lines12731274127512761277127812791 unmodified line128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121272 unmodified lineslogin_name = gr.Textbox(label="Your Name",placeholder="e.g. Alice Smith",elem_id="login-name",)login_api_key = gr.Textbox(1 unmodified lineplaceholder="sk-proj-...",type="password",info="Get one at platform.openai.com/api-keys",elem_id="login-api-key",)gr.HTML("""<script>(() => {const applyLoginAutocomplete = () => {const usernameInput = document.querySelector('#login-name input');const passwordInput = document.querySelector('#login-api-key input');if (usernameInput) {usernameInput.setAttribute('autocomplete', 'username');usernameInput.setAttribute('name', 'username');}if (passwordInput) {passwordInput.setAttribute('autocomplete', 'current-password');passwordInput.setAttribute('name', 'password');}};applyLoginAutocomplete();const observer = new MutationObserver(applyLoginAutocomplete);observer.observe(document.body, { childList: true, subtree: true });})();</script>""")gr.Markdown(
student_interface.py+27