]> git.wh0rd.org Git - tt-rss.git/commitdiff
replace some theme-specific frontend hooks with theme options
authorAndrew Dolgov <fox@bah.org.ru>
Fri, 15 Jan 2010 08:46:20 +0000 (11:46 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Fri, 15 Jan 2010 08:46:20 +0000 (11:46 +0300)
feedlist.js
functions.js
functions.php
themes/graycube/theme.ini
themes/triple-pane/theme.ini
tt-rss.css
tt-rss.js

index 927b6b8a4ce52aa71a6b058fa762b024fe9ceba5..bb3f3bf75be4c0b814f2000d9eb2750287371267 100644 (file)
@@ -467,8 +467,8 @@ function feedlist_init() {
                        }
                }
 
-               if (getInitParam("theme") == "" || getInitParam("theme") == "lejla" || 
-                               getInitParam("theme") == "neon") {
+               if (getInitParam("theme") == "" || 
+                               getInitParam("theme_options").match("hide_footer")) {
                        setTimeout("hide_footer()", 5000);
                }
 
index 7a43212dce3c76dad0fe1765b723453fd913ff40..0c4eaf353760d89990a956cc4b3665819fcf14a0 100644 (file)
@@ -526,8 +526,8 @@ function parse_counters(reply, scheduled_call) {
                                                
                                        }
 
-                                       if (row_needs_hl && getInitParam("theme") != 'neon' &&
-                                                       getInitParam("theme") != 'lejla') { 
+                                       if (row_needs_hl && 
+                                                       !getInitParam("theme_option").match('no_highlights')) { 
                                                new Effect.Highlight(feedr, {duration: 1, startcolor: "#fff7d5",
                                                        queue: { position:'end', scope: 'EFQ-' + id, limit: 1 } } );
 
index f32ff8c982f656581f203566f6a08ae8c848bd58..781074569a16b1c325c45f15b9b03b63a52f1308 100644 (file)
                return $theme_path;
        }
 
+       function get_user_theme_options($link) {
+               $t = get_user_theme_path($link);
+
+               if ($t) {
+                       if (is_file("$t/theme.ini")) {
+                               $ini = parse_ini_file("$t/theme.ini", true);
+                               if ($ini['theme']['version']) {
+                                       return $ini['theme']['options'];
+                               }
+                       }
+               }
+               return false;
+       }
+
+
        function get_all_themes() {
                $themes = glob("themes/*");
 
                                        $entry["name"] = $ini['theme']['name'];
                                        $entry["version"] = $ini['theme']['version'];
                                        $entry["author"] = $ini['theme']['author'];
+                                       $entry["options"] = $ini['theme']['options'];
                                        array_push($rv, $entry);
                                }
                        }
                }
 
                print "<param key=\"theme\" value=\"".get_user_theme($link)."\"/>";
+               print "<param key=\"theme_options\" value=\"".get_user_theme_options($link)."\"/>";
                print "<param key=\"daemon_enabled\" value=\"" . ENABLE_UPDATE_DAEMON . "\"/>";
                print "<param key=\"feeds_frame_refresh\" value=\"" . FEEDS_FRAME_REFRESH . "\"/>";
                print "<param key=\"daemon_refresh_only\" value=\"true\"/>";
index 4a6eda0c603f56f50e45694c547d3a366d09927e..8c3863f595d6672b226ec351838e8804b2451315 100644 (file)
@@ -1,3 +1,4 @@
 [theme]
 name=Graycube
 version=1.0
+options=hide_footer
index 4be8589abe86f50b3c12e9bd4efd52c2adffb006..a66e71712b6c60065119cb7f467ba43a21e35851 100644 (file)
@@ -1,3 +1,4 @@
 [theme]
 name=Triple Pane
 version=1.0
+options=horiz_resize
index 8ed4187624724f8d116b5159bebc637eab63599f..23ff92d117599f5df9aad3c10d7e02531ff1f0bf 100644 (file)
@@ -1577,12 +1577,6 @@ div.return a:hover {
        right : 2px;
 }
 
-a.feedUpdErrLink {
-       color : #ff0000;
-       display : block;
-       margin-bottom : 0.5em;
-}
-
 .catCtrHasUnread, .feedCtrHasUnread {
        font-weight : bold;
        color : #707070;
index 2782cc7264e398f280442d4f6e9bb6c3af5ed49f..8b04eae617f670b0752060f77f46c95a553a2ab0 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -409,11 +409,11 @@ function resize_headlines(delta_x, delta_y) {
 
                if (!c_frame || !h_frame) return;
        
-               if (feeds_frame && getInitParam("theme") == "compat") {
+               if (feeds_frame && getInitParam("theme") == "old-skool") {
                                feeds_frame.style.bottom = f_frame.offsetHeight + "px";         
                }
        
-               if (getInitParam("theme") == "triple-pane") {
+               if (getInitParam("theme_options").match("horiz_resize")) {
        
                        if (delta_x != undefined) {
                                if (c_frame.offsetLeft - delta_x > feeds_frame.offsetWidth + feeds_frame.offsetLeft + 100 && c_frame.offsetWidth + delta_x > 100) {
@@ -431,7 +431,7 @@ function resize_headlines(delta_x, delta_y) {
                                4) + "px";
                        resize_grab.style.display = "block";
 
-                       resize_handle.src = "themes/triple-pane/images/resize_handle_vert.png";
+                       resize_handle.src = "themes/"+getInitParam('theme')+"/images/resize_handle_vert.png";
                        resize_handle.style.paddingTop = (resize_grab.offsetHeight / 2 - 7) + "px";
        
                } else {
@@ -448,21 +448,7 @@ function resize_headlines(delta_x, delta_y) {
        
                        c_frame.style.top = (h_frame.offsetTop + h_frame.offsetHeight + 0) + "px";
                        h_frame.style.height = h_frame.offsetHeight + "px";
-       
-                       var theme_c = 0;
-       
-                       if (getInitParam("theme") == "graycube") {
-                               theme_c = 1;
-                       }
 
-                       if (getInitParam("theme") == "graycube" || getInitParam("theme") == "compat") {
-                               resize_handle.src = "themes/graycube/images/resize_handle_horiz.png";
-                       }
-       
-/*                     resize_grab.style.top = (h_frame.offsetTop + h_frame.offsetHeight - 
-                               4 - theme_c) + "px";
-                       resize_grab.style.display = "block"; */
-       
                }
        
                if (getInitParam("cookie_lifetime") != 0) {
@@ -903,7 +889,7 @@ function collapse_feedlist() {
                
                var theme = getInitParam("theme");
                if (theme != "" && theme != "compact" && theme != "graycube" &&
-                               theme != "compat") return;
+                               theme != "old-skool") return;
 
                var fl = $("feeds-holder");
                var fh = $("headlines-frame");