From 203610630a5c2d077cbfb1d69e89c1e60d8b074e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 30 Oct 2007 09:22:01 +0100 Subject: add 3pane theme --- functions.php | 45 +++++++++++++++++++++++-------------- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 3 ++- schema/versions/mysql/25.sql | 3 +++ schema/versions/pgsql/25.sql | 3 +++ themes/3pane/images/ttrss_logo.png | Bin 0 -> 6234 bytes themes/3pane/theme.css | 29 ++++++++++++++++++++++++ tt-rss.js | 40 ++++++++++++++++++++------------- 9 files changed, 93 insertions(+), 35 deletions(-) create mode 100644 schema/versions/mysql/25.sql create mode 100644 schema/versions/pgsql/25.sql create mode 100644 themes/3pane/images/ttrss_logo.png create mode 100644 themes/3pane/theme.css diff --git a/functions.php b/functions.php index ab03832b0..53723273c 100644 --- a/functions.php +++ b/functions.php @@ -2664,6 +2664,7 @@ } } + print ""; print ""; print ""; print ""; @@ -2707,6 +2708,7 @@ function print_runtime_info($link) { print ""; + if (ENABLE_UPDATE_DAEMON) { print ""; @@ -3659,23 +3661,26 @@ } */ print ""; - - if ($feed_site_url) { - if (!$bottom) { - $target = "target=\"_new\""; - } - print "". - truncate_string($feed_title,30).""; - } else { - print $feed_title; - } - if ($search) { - $search_q = "&q=$search&m=$match_on&smode=$search_mode"; - } + if ($_SESSION["theme"] != "3pane") { - if ($user_page_offset > 1) { - print " [$user_page_offset] "; + if ($feed_site_url) { + if (!$bottom) { + $target = "target=\"_new\""; + } + print "". + truncate_string($feed_title,30).""; + } else { + print $feed_title; + } + + if ($search) { + $search_q = "&q=$search&m=$match_on&smode=$search_mode"; + } + + if ($user_page_offset > 1) { + print " [$user_page_offset] "; + } } if (!$bottom) { @@ -4287,16 +4292,22 @@ $num_tags = 0; + if ($_SESSION["theme"] == "3pane") { + $tag_limit = 3; + } else { + $tag_limit = 6; + } + foreach ($tags as $tag) { $num_tags++; $tag_escaped = str_replace("'", "\\'", $tag); $tag_str = "$tag, "; - if ($num_tags == 6) { + if ($num_tags == $tag_limit) { $tags_str .= "..."; - } else if ($num_tags < 6) { + } else if ($num_tags < $tag_limit) { $tags_str .= $tag_str; } $f_tags_str .= $tag_str; diff --git a/sanity_check.php b/sanity_check.php index b9290b50c..bff12e38c 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 11); - define('SCHEMA_VERSION', 24); + define('SCHEMA_VERSION', 25); if (!file_exists("config.php")) { print __("Fatal Error: You forgot to copy diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 88f1080f9..24041bb88 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -30,6 +30,7 @@ create table ttrss_themes(id integer not null primary key auto_increment, insert into ttrss_themes (theme_name, theme_path) values ('Old-skool', 'compat'); insert into ttrss_themes (theme_name, theme_path) values ('Graycube', 'graycube'); insert into ttrss_themes (theme_name, theme_path) values ('Default (Compact)', 'compact'); +insert into ttrss_themes (theme_name, theme_path) values ('Three-pane', '3pane'); create table ttrss_users (id integer primary key not null auto_increment, login varchar(120) not null unique, @@ -199,7 +200,7 @@ create table ttrss_tags (id integer primary key auto_increment, create table ttrss_version (schema_version int not null) TYPE=InnoDB; -insert into ttrss_version values (24); +insert into ttrss_version values (25); create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null) TYPE=InnoDB; diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index bb4c45375..c75e210f1 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -27,6 +27,7 @@ create table ttrss_themes(id serial not null primary key, insert into ttrss_themes (theme_name, theme_path) values ('Old-skool', 'compat'); insert into ttrss_themes (theme_name, theme_path) values ('Graycube', 'graycube'); insert into ttrss_themes (theme_name, theme_path) values ('Default (Compact)', 'compact'); +insert into ttrss_themes (theme_name, theme_path) values ('Three-pane', '3pane'); create table ttrss_users (id serial not null primary key, login varchar(120) not null unique, @@ -178,7 +179,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid); create table ttrss_version (schema_version int not null); -insert into ttrss_version values (24); +insert into ttrss_version values (25); create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null); diff --git a/schema/versions/mysql/25.sql b/schema/versions/mysql/25.sql new file mode 100644 index 000000000..c3f3d5ea4 --- /dev/null +++ b/schema/versions/mysql/25.sql @@ -0,0 +1,3 @@ +insert into ttrss_themes (theme_name, theme_path) values ('Three-pane', '3pane'); + +update ttrss_version set schema_version = 25; diff --git a/schema/versions/pgsql/25.sql b/schema/versions/pgsql/25.sql new file mode 100644 index 000000000..c3f3d5ea4 --- /dev/null +++ b/schema/versions/pgsql/25.sql @@ -0,0 +1,3 @@ +insert into ttrss_themes (theme_name, theme_path) values ('Three-pane', '3pane'); + +update ttrss_version set schema_version = 25; diff --git a/themes/3pane/images/ttrss_logo.png b/themes/3pane/images/ttrss_logo.png new file mode 100644 index 000000000..2cedc35ed Binary files /dev/null and b/themes/3pane/images/ttrss_logo.png differ diff --git a/themes/3pane/theme.css b/themes/3pane/theme.css new file mode 100644 index 000000000..0f2cada93 --- /dev/null +++ b/themes/3pane/theme.css @@ -0,0 +1,29 @@ +div.headlines_normal { + position : absolute; + border-width : 1px 1px 0px 0px; + right : 400px; + overflow : hidden; + bottom : 40px; + height : auto; +} + +#content-frame { + width : 400px; + right : 0px; + top : 85px; + left : auto; +} + +div.postHeader div.postDate { + text-align : left; + color : gray; + float : none; +} + +div.postHeader div.postDateRTL { + text-align : left; + color : gray; + float : none; +} + + diff --git a/tt-rss.js b/tt-rss.js index 1773e64af..617791ce0 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -357,27 +357,37 @@ function resize_headlines() { if (!c_frame || !h_frame) return; - debug("resize_headlines"); + if (getInitParam("theme") == "3pane") { + debug("resize_headlines: HOR-mode"); - if (!is_msie()) { - h_frame.style.height = 30 + "%"; - c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; - h_frame.style.height = h_frame.offsetHeight + "px"; - } else { - h_frame.style.height = document.documentElement.clientHeight * 0.3 + "px"; - c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; + c_frame.style.width = '30%'; + h_frame.style.right = c_frame.offsetWidth - 1 + "px"; - var c_bottom = document.documentElement.clientHeight; + } else { + debug("resize_headlines: VER-mode"); - if (f_frame) { - c_bottom = f_frame.offsetTop; + if (!is_msie()) { + h_frame.style.height = 30 + "%"; + c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; + h_frame.style.height = h_frame.offsetHeight + "px"; + } else { + h_frame.style.height = document.documentElement.clientHeight * 0.3 + "px"; + c_frame.style.top = h_frame.offsetTop + h_frame.offsetHeight + 1 + "px"; + + var c_bottom = document.documentElement.clientHeight; + + if (f_frame) { + c_bottom = f_frame.offsetTop; + } + + c_frame.style.height = c_bottom - (h_frame.offsetTop + + h_frame.offsetHeight + 1) + "px"; + h_frame.style.height = h_frame.offsetHeight + "px"; + } - c_frame.style.height = c_bottom - (h_frame.offsetTop + - h_frame.offsetHeight + 1) + "px"; - h_frame.style.height = h_frame.offsetHeight + "px"; - } + } function init_second_stage() { -- cgit v1.2.3