Browse Source

rollback to previous styling solution

master
Christian Müller 11 years ago
parent
commit
10a55121f4
  1. 26
      resources/public/js/themes.js
  2. 1
      src/notehub/views.clj

26
resources/public/js/themes.js

@ -75,13 +75,13 @@ if (location.search.length > 0) { @@ -75,13 +75,13 @@ if (location.search.length > 0) {
}
var vars = {
'background': themes[ui.theme].background.normal,
'background_halftone': themes[ui.theme].background.halftone,
'foreground': themes[ui.theme].foreground.normal,
'foreground_halftone': themes[ui.theme].foreground.halftone,
'link_fresh': themes[ui.theme].link.fresh,
'link_visited': themes[ui.theme].link.visited,
'link_hover': themes[ui.theme].link.hover
'@background': themes[ui.theme].background.normal,
'@background_halftone': themes[ui.theme].background.halftone,
'@foreground': themes[ui.theme].foreground.normal,
'@foreground_halftone': themes[ui.theme].foreground.halftone,
'@link_fresh': themes[ui.theme].link.fresh,
'@link_visited': themes[ui.theme].link.visited,
'@link_hover': themes[ui.theme].link.hover
};
var fontURL = "https://fonts.googleapis.com/" +
@ -92,7 +92,7 @@ var fontURL = "https://fonts.googleapis.com/" + @@ -92,7 +92,7 @@ var fontURL = "https://fonts.googleapis.com/" +
if(ui["header-font"] || ui["text-font"]) {
injection = ["header-font", "text-font"].reduce(function(acc, font){
if(ui[font]) {
vars[font.replace(/-/, "_")] = ui[font].replace(/\+/g," ");
vars["@" + font.replace(/-/, "_")] = ui[font].replace(/\+/g," ");
return acc + "|" + ui[font];
} else return acc;
}, "");
@ -108,10 +108,6 @@ fileref.setAttribute("type", "text/css") @@ -108,10 +108,6 @@ fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", fontURL)
document.getElementsByTagName("head")[0].appendChild(fileref)
var less = { modifyVars: vars };
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "//cdnjs.cloudflare.com/ajax/libs/less.js/2.1.2/less.min.js";
document.head.appendChild(script);
function onLoad () {}
function onLoad () {
if(ui.theme != "default") less.modifyVars(vars);
}

1
src/notehub/views.clj

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
[:meta {:name "viewport" :content "width=device-width, initial-scale=1.0"}]
[:link {:rel "stylesheet/less" :type "text/css" :href "/styles/main.less"}]
(html
(include-js "//cdnjs.cloudflare.com/ajax/libs/less.js/2.1.2/less.min.js")
(include-js "/js/themes.js"))
(when (= :js js?)
(html

Loading…
Cancel
Save