]> git.wh0rd.org Git - tt-rss.git/commitdiff
enable triple-pane theme; fix theme system not working
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Nov 2010 10:39:30 +0000 (13:39 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Nov 2010 10:40:38 +0000 (13:40 +0300)
functions.php
prefs.php
themes/triple-pane/theme.css
themes/triple-pane/theme.ini
themes/triple-pane/theme.js [new file with mode: 0644]
tt-rss.js
tt-rss.php

index 6d72c687399cd355e5b443062ae774283150afbe..a6977b2a21b7f93374d34a231a242a398a1ccf45 100644 (file)
                }
 
                if ($theme_path) {
-                       if (is_file("$t/theme.ini")) {
-                               $ini = parse_ini_file("$t/theme.ini", true);
-                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED) {
+                       if (is_file("$theme_path/theme.ini")) {
+                               $ini = parse_ini_file("$theme_path/theme.ini", true);
+                               if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED) {
                                        return $theme_path;
                                }
                        }
                return '';
        }
 
+       function print_theme_includes($link) {
+
+               $t = get_user_theme_path($link);
+               $time = time();
+
+               if ($t) {
+                       print "<link rel=\"stylesheet\" type=\"text/css\" 
+                               href=\"$t/theme.css?$time \">";
+                       if (file_exists("$t/theme.js")) {
+                               print "<script type=\"text/javascript\" src=\"$t/theme.js?$time\">
+                                       </script>";
+                       }
+               }
+       }
 
        function get_all_themes() {
                $themes = glob("themes/*");
                foreach ($themes as $t) {
                        if (is_file("$t/theme.ini")) {
                                $ini = parse_ini_file("$t/theme.ini", true);
-                               if ($ini['theme']['version'] > THEME_VERSION_REQUIRED && 
+                               if ($ini['theme']['version'] >= THEME_VERSION_REQUIRED && 
                                                        !$ini['theme']['disabled']) {
                                        $entry = array();
                                        $entry["path"] = $t;
index 5bedfb8a33a7ea677e53e47e0a21543088068b8d..eda3cd0f9c1aae098c135f3bc80007fe71103c18 100644 (file)
--- a/prefs.php
+++ b/prefs.php
        <link rel="stylesheet" type="text/css" href="tt-rss.css?<?php echo $dt_add ?>"/>
        <link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
 
-       <?php   $user_theme = get_user_theme_path($link);
-               if ($user_theme) { ?>
-               <link rel="stylesheet" type="text/css" href="<?php echo $user_theme ?>/theme.css"/>
-       <?php } ?>
+       <?php print_theme_includes($link) ?>
        
        <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
        <?php if ($user_css_url) { ?>
index 4a188a57f4260ac750ca33001d33d081ef67e30a..593ff955ae586e8059a6d66a7980a1e71df016c4 100644 (file)
@@ -1,4 +1,13 @@
-div.headlines_normal {
+#content-insert {
+       border-left-width : 1px;
+       border-bottom-width : 0px;
+}
+
+#headlines-frame {
+       border-right-width : 1px;
+}
+
+/* div.headlines_normal {
        position : absolute;
        border-width : 1px 1px 0px 0px;
        right : 400px;
@@ -66,7 +75,7 @@ span.headlineInnerTitle {
        bottom : 0px;
        top : 0px; 
 
-}
+} */
 
 
 /*#footer, #prefFooter {
index 5e9feb9c3c48ddfb6306191ae09d5ca5f57a4fad..5aae724423c6c3ba18062d55c79ed7521d5fa78f 100644 (file)
@@ -1,5 +1,5 @@
 [theme]
 name=Triple-Pane
 author=seeker
-version=1.0
-options=horiz_resize,hide_footer
+version=1.1
+options=
diff --git a/themes/triple-pane/theme.js b/themes/triple-pane/theme.js
new file mode 100644 (file)
index 0000000..0880553
--- /dev/null
@@ -0,0 +1,14 @@
+function themeBeforeLayout() {
+       $("headlines-wrap-inner").setAttribute("design", 'sidebar');
+       $("content-insert").setAttribute("region", "trailing");
+       $("content-insert").setStyle({
+               width: '50%',
+               height: 'auto'});
+}
+
+function themeAfterLayout() {
+       $("headlines-toolbar").setStyle({
+               'border-right-width': '1px',
+               'border-color': '#88b0f0',
+               });
+}
index 8121e94bc6759450e17ce68cb390b02468fd8818..f408197d2a478e827db5b1261e4712cdb32fc8ce 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -282,9 +282,18 @@ function init() {
                dojo.require("dijit.form.Select");
                dojo.require("dojo.parser");
 
+               if (typeof themeBeforeLayout == 'function') {
+                       themeBeforeLayout();
+               }
+
                dojo.addOnLoad(function() {
                        updateFeedList();
                        closeArticlePanel();
+
+                       if (typeof themeAfterLayout == 'function') {
+                               themeAfterLayout();
+                       }
+
                });
 
                if (!genericSanityCheck()) 
index 5791bd76c6c80cec0c0ed9863781fba639f7ebfd..b1f43506fdbf9ba1cc5a7ae3f569589525dfcec4 100644 (file)
 
        <link rel="stylesheet" type="text/css" href="lib/dijit/themes/claro/claro.css"/>
 
-       <?php   $user_theme = get_user_theme_path($link);
-               if ($user_theme) { ?>
-                       <link rel="stylesheet" type="text/css" href="<?php echo $user_theme ?>/theme.css?<?php echo $dt_add ?>">
-       <?php } ?>
+       <?php print_theme_includes($link) ?>
 
        <?php $user_css_url = get_pref($link, 'USER_STYLESHEET_URL'); ?>
        <?php if ($user_css_url) { ?>