Download tasks/eventbrite/solution/site/implementation/clone/static/js/event.js from TIGER-Lab/WebsiteBench: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/eventbrite/solution/site/implementation/clone/static/js/event.js
- Command line
-
hf download hf://datasets/TIGER-Lab/WebsiteBench/tasks/eventbrite/solution/site/implementation/clone/static/js/event.js
-
curl -L -o event.js https://huggingface.co/datasets/TIGER-Lab/WebsiteBench/resolve/main/tasks/eventbrite/solution/site/implementation/clone/static/js/event.js
1.99 kB
| // Source-shaped event sharing without production social-network effects. | |
| // The official page opens a "Share with friends" dialog; this protected | |
| // preview keeps that interaction local and only copies its own event URL. | |
| (function () { | |
| "use strict"; | |
| var trigger = document.querySelector("[data-share-trigger]"); | |
| var dialog = document.querySelector("#share-event-dialog"); | |
| if (!trigger || !dialog) return; | |
| var close = dialog.querySelector("[data-share-close]"); | |
| var copy = dialog.querySelector("[data-share-copy]"); | |
| var input = dialog.querySelector("[data-share-url]"); | |
| var status = dialog.querySelector("[data-share-status]"); | |
| function eventUrl() { | |
| return window.location.origin + window.location.pathname; | |
| } | |
| function openDialog() { | |
| input.value = eventUrl(); | |
| status.textContent = ""; | |
| trigger.setAttribute("aria-expanded", "true"); | |
| if (dialog.showModal) dialog.showModal(); | |
| else dialog.setAttribute("open", ""); | |
| copy.focus(); | |
| } | |
| function closeDialog() { | |
| trigger.setAttribute("aria-expanded", "false"); | |
| if (dialog.close) dialog.close(); | |
| else dialog.removeAttribute("open"); | |
| trigger.focus(); | |
| } | |
| function fallbackSelect() { | |
| input.focus(); | |
| input.select(); | |
| status.textContent = "Link selected. Press Ctrl+C or Command+C to copy."; | |
| } | |
| trigger.addEventListener("click", openDialog); | |
| close.addEventListener("click", closeDialog); | |
| dialog.addEventListener("close", function () { | |
| trigger.setAttribute("aria-expanded", "false"); | |
| }); | |
| dialog.addEventListener("click", function (event) { | |
| if (event.target === dialog) closeDialog(); | |
| }); | |
| copy.addEventListener("click", function () { | |
| var value = eventUrl(); | |
| input.value = value; | |
| if (!navigator.clipboard || !navigator.clipboard.writeText) { | |
| fallbackSelect(); | |
| return; | |
| } | |
| navigator.clipboard.writeText(value).then(function () { | |
| status.textContent = "Link copied!"; | |
| }).catch(fallbackSelect); | |
| }); | |
| })(); | |