Verified Commit 569207de authored by Raphael Fetzer's avatar Raphael Fetzer 👷
Browse files

Dateinamen auf Basis der Themeeinstellungen

parent 58badbe5
This diff is collapsed.
......@@ -69,15 +69,24 @@ function BuildCSS() {
if (document.getElementById("kacheldesign").checked) {
theme += kacheldesign;
}
var BodyFont = $('#bodyfont option:selected').text();
var HeaderFont = $('#headerfont option:selected').text();
var MainColor = $('#maincolor').colorpicker('getValue');
// Construct a filename from the theme settings (transcribed color name + header font)
var FileName = HeaderFont.substr(0, HeaderFont.indexOf(',')) + "_" + ntc.name(MainColor)[3].replace(/ü/g, "ue");
FileName = "openolat_theme_" + FileName.replace(/\s/g, "_").toLowerCase() + ".css";
theme = theme.replace(/\$VERSION/, version);
theme = theme.replace(/\$MAINCOLORHIGHLIGHT/g, $('#maincolor').colorpicker('getValue') + "c2");
theme = theme.replace(/\$HEADERFONTFAMILY/g, $('#headerfont option:selected').text());
theme = theme.replace(/\$BODYFONTFAMILY/g, $('#bodyfont option:selected').text());
theme = theme.replace(/\$MAINCOLOR/g, $('#maincolor').colorpicker('getValue'));
theme = theme.replace(/\$MAINCOLORHIGHLIGHT/g, MainColor + "c2");
theme = theme.replace(/\$HEADERFONTFAMILY/g, HeaderFont);
theme = theme.replace(/\$BODYFONTFAMILY/g, BodyFont);
theme = theme.replace(/\$MAINCOLOR/g, MainColor);
var blob = new Blob([theme], {type: "text/plain;charset=utf-8"});
saveAs(blob, "theme.css");
saveAs(blob, FileName);
}
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment