]> git.wh0rd.org - tt-rss.git/commitdiff
implement cache-busting for default theme.css
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 25 Jan 2017 09:17:41 +0000 (12:17 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 25 Jan 2017 09:17:41 +0000 (12:17 +0300)
night theme: small fixes

classes/pref/prefs.php
include/functions2.php
index.php
prefs.php
themes/default.php [new file with mode: 0644]
themes/night.css

index 1988649a5a0e7d6c74a5f13f71e49e609b3a3732..bf4d6e42e7d430d4d0618b6e1047a11749c7c16a 100644 (file)
@@ -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);
index 04e3c5140bc66ec5615f767a00652c06695141b8..d06a7a71003db30a945380519373c60d3b5bf285 100644 (file)
        }
 
        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);
index 66314ad17d2271b653e7822989529a6c8234d9b8..6e81bd619a9aa7ff94738aedf6f9da2c84f55fed 100644 (file)
--- 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");
                }
        }
        ?>
index 4298c38a2be7efd4fd4e00527838c0464834ab46..b1cdb0b49ab4808833911209d620ac0b5567060c 100644 (file)
--- 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 (file)
index 0000000..db131e3
--- /dev/null
@@ -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";
+       }
+?>
+
index 7f381b9c19fe21e14b48eeabb0f24b24117e30ea..9d4cbb3923f215d80c8079cd620716efa2e3c14d 100644 (file)
@@ -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 {