Spaces:
Configuration error
Configuration error
Download Account.js from sldshr/client_less_web: direct link, hf CLI and curl.
- Browser
- Download file 871 Bytes
-
https://huggingface.co/spaces/sldshr/client_less_web/resolve/main/Account.js
- Command line
-
hf download hf://spaces/sldshr/client_less_web/Account.js
-
curl -L -o Account.js https://huggingface.co/spaces/sldshr/client_less_web/resolve/main/Account.js
871 Bytes
| import Host from './Host.js' | |
| import { a, em, img } from 'https://unpkg.com/ez-html-elements' | |
| /** Create an account object from the JSON returned from the server. */ | |
| export default (account) => { | |
| // Account PUBLIC: | |
| return Object.freeze({ | |
| /** Is the given id the same as this account's id? */ | |
| sameId: (id) => id === account.id, | |
| /** Generate HTML text */ | |
| html: () => { | |
| const accountServer = account.url.match(/https:\/\/([^/]+)\//)[1] | |
| return a( | |
| { href: `#accounts/${account.id}` }, | |
| img(['inline'], { | |
| src: account.avatar, | |
| width: 48, | |
| height: 48, | |
| alt: `@${account.username}` | |
| }) + | |
| Host(accountServer).faviconHtml() + | |
| '@' + | |
| account.username + | |
| '@' + | |
| accountServer, | |
| em('(' + account.display_name + ')') | |
| ) | |
| } | |
| }) | |
| } | |