Download Undex.html from Pezh/Login: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/spaces/Pezh/Login/resolve/main/Undex.html
- Command line
-
hf download hf://spaces/Pezh/Login/Undex.html
-
curl -L -o Undex.html https://huggingface.co/spaces/Pezh/Login/resolve/main/Undex.html
1.99 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Checkbox List Flask App with Similarity Check</title> | |
| <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | |
| </head> | |
| <body> | |
| <input type="text" id="inputItem"/> | |
| <input type="text" id="similarityResult" readonly /> | |
| <button onclick="addItem()">Send</button> | |
| <button onclick="listItems()">Check</button> | |
| <button onclick="checkSimilarity()">Similarity</button> | |
| <div id="checkboxList" style="display:none;"></div> | |
| <script> | |
| function addItem() { | |
| const item = $('#inputItem').val(); | |
| $.ajax({ | |
| url: '/add_item', | |
| type: 'POST', | |
| contentType: 'application/json', | |
| data: JSON.stringify({ 'item': item }), | |
| success: function(response) { | |
| if (response.success) { | |
| alert(`Added: ${response.item}`); | |
| $('#inputItem').val(''); // Clear the input after adding the item | |
| } else { | |
| alert('Failed to add item.'); | |
| } | |
| } | |
| }); | |
| } | |
| function listItems() { | |
| // Only toggles visibility here, does not clear or repopulate the list | |
| $('#checkboxList').toggle(); | |
| } | |
| function checkSimilarity() { | |
| const item = $('#inputItem').val(); | |
| $.ajax({ | |
| url: '/check_similarity', | |
| type: 'POST', | |
| contentType: 'application/json', | |
| data: JSON.stringify({ 'item': item }), | |
| success: function(response) { | |
| if (response.similar) { | |
| $('#similarityResult').val('Yes!'); | |
| } else { | |
| $('#similarityResult').val('No match found.'); | |
| } | |
| } | |
| }); | |
| } | |
| </script> | |
| </body> | |
| </html> |