summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-01-25 12:17:41 +0300
committerAndrew Dolgov <[email protected]>2017-01-25 12:17:41 +0300
commite432b8fbe2a134e14b7e79960b17273c39795789 (patch)
tree310673ebcae3b79613df3beffbbc4669327fa221
parent7c04f8afebd9eec1114773a06ebffd9a827a3d98 (diff)
implement cache-busting for default theme.css
night theme: small fixes
-rw-r--r--classes/pref/prefs.php2
-rw-r--r--include/functions2.php2
-rw-r--r--index.php2
-rw-r--r--prefs.php2
-rw-r--r--themes/default.php14
-rw-r--r--themes/night.css6
6 files changed, 21 insertions, 7 deletions
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index 1988649a5..bf4d6e42e 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -565,7 +565,7 @@ class Pref_Prefs extends Handler_Protected {
} else if ($pref_name == "USER_CSS_THEME") {
- $themes = array_merge(glob("themes/*.css"), glob("themes.local/*.css"));
+ $themes = array_merge(glob("themes/*.php"), glob("themes/*.css"), glob("themes.local/*.css"));
$themes = array_map("basename", $themes);
$themes = array_filter($themes, "theme_valid");
asort($themes);
diff --git a/include/functions2.php b/include/functions2.php
index 04e3c5140..d06a7a710 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -2428,7 +2428,7 @@
}
function theme_valid($theme) {
- if ($theme == "default.css" || $theme == "night.css") return true; // needed for array_filter
+ if ($theme == "default.php" || $theme == "night.css") return true; // needed for array_filter
$file = "themes/" . basename($theme);
if (!file_exists($file)) $file = "themes.local/" . basename($theme);
diff --git a/index.php b/index.php
index 66314ad17..6e81bd619 100644
--- a/index.php
+++ b/index.php
@@ -68,7 +68,7 @@
if ($theme && theme_valid("$theme")) {
echo stylesheet_tag(get_theme_path($theme));
} else {
- echo stylesheet_tag("themes/default.css");
+ echo stylesheet_tag("themes/default.php");
}
}
?>
diff --git a/prefs.php b/prefs.php
index 4298c38a2..b1cdb0b49 100644
--- a/prefs.php
+++ b/prefs.php
@@ -44,7 +44,7 @@
if ($theme && theme_valid("$theme")) {
echo stylesheet_tag(get_theme_path($theme));
} else {
- echo stylesheet_tag("themes/default.css");
+ echo stylesheet_tag("themes/default.php");
}
}
?>
diff --git a/themes/default.php b/themes/default.php
new file mode 100644
index 000000000..db131e34c
--- /dev/null
+++ b/themes/default.php
@@ -0,0 +1,14 @@
+<?php
+ header("Content-type: text/css");
+
+ function import_tag($filename) {
+ return "@import \"$filename?".filemtime($filename)."\";";
+ }
+
+ $styles = [ "tt-rss.css", "dijit.css", "cdm.css", "prefs.css" ];
+
+ foreach ($styles as $style) {
+ print import_tag("../css/$style") . "\n";
+ }
+?>
+
diff --git a/themes/night.css b/themes/night.css
index 7f381b9c1..9d4cbb392 100644
--- a/themes/night.css
+++ b/themes/night.css
@@ -1,4 +1,4 @@
-@import "default.css";
+@import "default.php";
body#ttrssMain #feeds-holder {
background : #222;
@@ -19,7 +19,7 @@ body#ttrssMain #content-insert {
}
body#ttrssMain #feedTree .dijitTreeRow {
- color : #ccc;
+ color : #ccc ! important;
}
body#ttrssMain.claro .dijitTree .dijitTreeRowHover {
@@ -29,7 +29,7 @@ body#ttrssMain.claro .dijitTree .dijitTreeRowHover {
body#ttrssMain.claro .dijitTree .dijitTreeRowSelected {
background : #555;
- border-color : #666;
+ border-color : #666 ! important;
}
body#ttrssMain.claro .dijitTreeRowSelected .dijitTreeLabel {