Spaces:
Running
Running
Download webui/js/initializer.js from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 562 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/webui/js/initializer.js
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/webui/js/initializer.js
-
curl -L -o initializer.js https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/webui/js/initializer.js
562 Bytes
| import * as device from "./device.js"; | |
| export async function initialize(){ | |
| // set device class to body tag | |
| setDeviceClass(); | |
| } | |
| function setDeviceClass(){ | |
| device.determineInputType().then((type) => { | |
| // Remove any class starting with 'device-' from <body> | |
| const body = document.body; | |
| body.classList.forEach(cls => { | |
| if (cls.startsWith('device-')) { | |
| body.classList.remove(cls); | |
| } | |
| }); | |
| // Add the new device class | |
| body.classList.add(`device-${type}`); | |
| }); | |
| } | |