mobile: allow showing category content inline (closes #315)
This commit is contained in:
parent
a3ef7d106a
commit
cfad9259a6
|
@ -24,7 +24,8 @@
|
||||||
$cat_id = db_escape_string($_REQUEST["cat"]);
|
$cat_id = db_escape_string($_REQUEST["cat"]);
|
||||||
$offset = (int) db_escape_string($_REQUEST["skip"]);
|
$offset = (int) db_escape_string($_REQUEST["skip"]);
|
||||||
$search = db_escape_string($_REQUEST["search"]);
|
$search = db_escape_string($_REQUEST["search"]);
|
||||||
|
$is_cat = (bool) db_escape_string($_REQUEST["is_cat"]);
|
||||||
|
|
||||||
render_headlines_list($link, $feed_id, $cat_id, $offset, $search);
|
render_headlines_list($link, $feed_id, $cat_id, $offset, $search, $is_cat);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
|
@ -100,9 +100,9 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_category($link, $cat_id) {
|
function render_category($link, $cat_id, $offset) {
|
||||||
$owner_uid = $_SESSION["uid"];
|
$owner_uid = $_SESSION["uid"];
|
||||||
|
|
||||||
if ($cat_id >= 0) {
|
if ($cat_id >= 0) {
|
||||||
|
|
||||||
if ($cat_id != 0) {
|
if ($cat_id != 0) {
|
||||||
|
@ -227,10 +227,11 @@
|
||||||
|
|
||||||
function render_categories_list($link) {
|
function render_categories_list($link) {
|
||||||
$owner_uid = $_SESSION["uid"];
|
$owner_uid = $_SESSION["uid"];
|
||||||
|
|
||||||
|
$cat_browse = mobile_get_pref($link, "BROWSE_CATS");
|
||||||
|
|
||||||
print '<ul id="home" title="'.__('Home').'" selected="true"
|
print '<ul id="home" title="'.__('Home').'" selected="true"
|
||||||
myBackLabel="'.__('Logout').'" myBackHref="logout.php" myBackTarget="_self">';
|
myBackLabel="'.__('Logout').'" myBackHref="logout.php" myBackTarget="_self">';
|
||||||
|
|
||||||
|
|
||||||
// print "<li><a href='#searchForm'>Search...</a></li>";
|
// print "<li><a href='#searchForm'>Search...</a></li>";
|
||||||
|
|
||||||
|
@ -244,7 +245,10 @@
|
||||||
$class = 'oldItem';
|
$class = 'oldItem';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<li class='$class'><a href='cat.php?id=$id'>$title</a></li>";
|
if ($cat_browse)
|
||||||
|
print "<li class='$class'><a href='cat.php?id=$id'>$title</a></li>";
|
||||||
|
else
|
||||||
|
print "<li class='$class'><a href='feed.php?id=$id&is_cat=true'>$title</a></li>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = db_query($link, "SELECT
|
$result = db_query($link, "SELECT
|
||||||
|
@ -273,8 +277,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
if ($unread > 0 || !mobile_get_pref($link, "HIDE_READ")) {
|
||||||
print "<li class='$class'><a href='cat.php?id=$id'>" .
|
|
||||||
$line["title"] . "</a></li>";
|
if ($cat_browse)
|
||||||
|
print "<li class='$class'><a href='cat.php?id=$id'>" .
|
||||||
|
$line["title"] . "</a></li>";
|
||||||
|
else
|
||||||
|
print "<li class='$class'><a href='feed.php?id=$id&is_cat=true'>".
|
||||||
|
$line["title"] . "</a></li>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -304,12 +313,12 @@
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function render_headlines_list($link, $feed_id, $cat_id, $offset, $search) {
|
function render_headlines_list($link, $feed_id, $cat_id, $offset, $search,
|
||||||
|
$is_cat = false) {
|
||||||
|
|
||||||
$feed_id = $feed_id;
|
$feed_id = $feed_id;
|
||||||
$limit = 15;
|
$limit = 15;
|
||||||
$filter = '';
|
$filter = '';
|
||||||
$is_cat = false;
|
|
||||||
$view_mode = 'adaptive';
|
$view_mode = 'adaptive';
|
||||||
|
|
||||||
if ($search) {
|
if ($search) {
|
||||||
|
|
|
@ -30,3 +30,9 @@ div.nav .button.right {
|
||||||
ul li a.read {
|
ul li a.read {
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul li span.browse {
|
||||||
|
color : #909090;
|
||||||
|
text-align : right;
|
||||||
|
float : right;
|
||||||
|
}
|
||||||
|
|
|
@ -140,3 +140,4 @@ function showRestOfFeed(feed_id) {
|
||||||
iui.showPage($("home"), true);
|
iui.showPage($("home"), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
<div class="toggle" id="ENABLE_CATS" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "ENABLE_CATS") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
|
<div class="toggle" id="ENABLE_CATS" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "ENABLE_CATS") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<label><?php echo __('Browse categories like folders') ?></label>
|
||||||
|
<div class="toggle" id="BROWSE_CATS" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "BROWSE_CATS") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<label><?php echo __('Show images in posts') ?></label>
|
<label><?php echo __('Show images in posts') ?></label>
|
||||||
<div class="toggle" id="SHOW_IMAGES" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "SHOW_IMAGES") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
|
<div class="toggle" id="SHOW_IMAGES" onclick="setPref(this)" toggled="<?php echo mobile_pref_toggled($link, "SHOW_IMAGES") ?>"><span class="thumb"></span><span class="toggleOn"><?php echo __('ON') ?></span><span class="toggleOff"><?php echo __('OFF') ?></span></div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require_once "functions.php";
|
require_once "functions.php";
|
||||||
|
|
||||||
define('EXPECTED_CONFIG_VERSION', 21);
|
define('EXPECTED_CONFIG_VERSION', 21);
|
||||||
define('SCHEMA_VERSION', 78);
|
define('SCHEMA_VERSION', 79);
|
||||||
|
|
||||||
if (!file_exists("config.php")) {
|
if (!file_exists("config.php")) {
|
||||||
print "<b>Fatal Error</b>: You forgot to copy
|
print "<b>Fatal Error</b>: You forgot to copy
|
||||||
|
|
|
@ -258,7 +258,7 @@ create table ttrss_tags (id integer primary key auto_increment,
|
||||||
|
|
||||||
create table ttrss_version (schema_version int not null) TYPE=InnoDB DEFAULT CHARSET=UTF8;
|
create table ttrss_version (schema_version int not null) TYPE=InnoDB DEFAULT CHARSET=UTF8;
|
||||||
|
|
||||||
insert into ttrss_version values (78);
|
insert into ttrss_version values (79);
|
||||||
|
|
||||||
create table ttrss_enclosures (id integer primary key auto_increment,
|
create table ttrss_enclosures (id integer primary key auto_increment,
|
||||||
content_url text not null,
|
content_url text not null,
|
||||||
|
@ -389,6 +389,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
|
||||||
|
|
||||||
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'true', 'Sort headlines by feed date',3, 'Use feed-specified date to sort headlines instead of local import date.');
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('SORT_HEADLINES_BY_FEED_DATE', 1, 'true', 'Sort headlines by feed date',3, 'Use feed-specified date to sort headlines instead of local import date.');
|
||||||
|
|
||||||
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1);
|
||||||
|
|
||||||
create table ttrss_user_prefs (
|
create table ttrss_user_prefs (
|
||||||
owner_uid integer not null,
|
owner_uid integer not null,
|
||||||
pref_name varchar(250),
|
pref_name varchar(250),
|
||||||
|
|
|
@ -229,7 +229,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id);
|
||||||
|
|
||||||
create table ttrss_version (schema_version int not null);
|
create table ttrss_version (schema_version int not null);
|
||||||
|
|
||||||
insert into ttrss_version values (78);
|
insert into ttrss_version values (79);
|
||||||
|
|
||||||
create table ttrss_enclosures (id serial not null primary key,
|
create table ttrss_enclosures (id serial not null primary key,
|
||||||
content_url text not null,
|
content_url text not null,
|
||||||
|
@ -353,6 +353,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
|
||||||
|
|
||||||
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('USER_STYLESHEET', 2, '', 'Customize stylesheet', 2, 'Customize CSS stylesheet to your liking');
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('USER_STYLESHEET', 2, '', 'Customize stylesheet', 2, 'Customize CSS stylesheet to your liking');
|
||||||
|
|
||||||
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1);
|
||||||
|
|
||||||
create table ttrss_user_prefs (
|
create table ttrss_user_prefs (
|
||||||
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
|
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
|
||||||
pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
|
pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
begin;
|
||||||
|
|
||||||
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1);
|
||||||
|
|
||||||
|
update ttrss_version set schema_version = 79;
|
||||||
|
|
||||||
|
commit;
|
|
@ -0,0 +1,7 @@
|
||||||
|
begin;
|
||||||
|
|
||||||
|
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_BROWSE_CATS', 1, 'true', '', 1);
|
||||||
|
|
||||||
|
update ttrss_version set schema_version = 79;
|
||||||
|
|
||||||
|
commit;
|
Loading…
Reference in New Issue