add style from silvermone chromecast plugin
This commit is contained in:
@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
virtualenv --python=$(which python3) /app/venv
|
||||
source /app/venv/bin/activate
|
||||
pip install --upgrade pip
|
||||
pip install --upgrade streamlink youtube-dl tornado aiohttp aiohttp-socks
|
26
backend/style.js
Normal file
26
backend/style.js
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require("fs");
|
||||
const css = require("css");
|
||||
|
||||
fs.readFile("/app/chromecast.css", "utf-8", (err, data) => {
|
||||
const ast = css.parse(data);
|
||||
for(const rule of ast.stylesheet.rules) {
|
||||
const decls = [];
|
||||
if(Symbol.iterator in Object(rule.declarations)) {
|
||||
for(const decl of rule.declarations) {
|
||||
const isNotUrl = !(decl.value.toLowerCase().startsWith("url"));
|
||||
const isNotContent = !(decl.property.toLowerCase() == "content");
|
||||
if(isNotContent && isNotUrl) {
|
||||
decls.push(decl);
|
||||
}
|
||||
}
|
||||
rule.declarations = decls;
|
||||
}
|
||||
}
|
||||
fs.appendFile("/app/style.css", css.stringify(ast, {"compress": true}), (err) => {
|
||||
if(err !== null) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user