summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.php5
-rw-r--r--feedlist.js6
-rw-r--r--functions.js62
-rw-r--r--functions.php6
-rw-r--r--modules/pref-prefs.php1
-rw-r--r--prefs.js4
-rw-r--r--schema/ttrss_schema_mysql.sql6
-rw-r--r--schema/ttrss_schema_pgsql.sql6
-rw-r--r--schema/versions/mysql/15.sql5
-rw-r--r--schema/versions/pgsql/15.sql5
-rw-r--r--tt-rss.js6
-rw-r--r--update.php2
12 files changed, 37 insertions, 77 deletions
diff --git a/backend.php b/backend.php
index b15101fdd..45c978023 100644
--- a/backend.php
+++ b/backend.php
@@ -12,7 +12,7 @@
error_reporting(DEFAULT_ERROR_LEVEL); */
- define('SCHEMA_VERSION', 14);
+ define('SCHEMA_VERSION', 15);
require_once "sanity_check.php";
require_once "config.php";
@@ -305,6 +305,9 @@
if (!$offset) $offset = 0;
+ set_pref($link, "_DEFAULT_VIEW_MODE", $view_mode);
+ set_pref($link, "_DEFAULT_VIEW_LIMIT", $limit);
+
if ($subop == "undefined") $subop = "";
if ($subop == "CatchupSelected") {
diff --git a/feedlist.js b/feedlist.js
index ddf12f291..9d6be547c 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -57,12 +57,6 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
toolbar_form.query.value = "";
}
- storeInitParam("toolbar_limit",
- toolbar_form.limit[toolbar_form.limit.selectedIndex].value);
-
- storeInitParam("toolbar_view_mode",
- toolbar_form.view_mode[toolbar_form.view_mode.selectedIndex].value);
-
var query = "backend.php?op=viewfeed&feed=" + feed + "&" +
toolbar_query + "&subop=" + param_escape(subop);
diff --git a/functions.js b/functions.js
index 1172a49f7..608284dc4 100644
--- a/functions.js
+++ b/functions.js
@@ -1502,71 +1502,13 @@ function debug(msg) {
}
function getInitParam(key) {
- var c = getCookie("TTIP:" + key);
- if (c) {
- return c;
- } else {
- return getMainContext().init_params[key];
- }
+ return init_params[key];
}
function storeInitParam(key, value) {
- try {
- init_params[key] = value;
- debug("storeInitParam: " + key + " => " + value +
- " (" + getInitParam("cookie_lifetime") + ")");
- if (getInitParam("cookie_lifetime") > 0) {
- setCookie("TTIP:" + key, value, getInitParam("cookie_lifetime"));
- } else {
- setCookie("TTIP:" + key, value);
- }
- } catch (e) {
- exception_error("storeInitParam", e);
- }
+ debug("<b>storeInitParam is OBSOLETE: " + key + " => " + value + "</b>");
}
-
-/*
-function storeInitParam(key, value, is_client) {
- try {
- if (!is_client) {
- if (getMainContext().init_params[key] != value) {
- debug("storeInitParam: " + key + " => " + value);
- //new Ajax.Request("backend.php?op=rpc&subop=storeParam&key=" +
- // param_escape(key) + "&value=" + param_escape(value));
- var f = getMainContext().document.getElementById("backReqBox");
- f.src = "backend.php?op=rpc&subop=storeParam&key=" +
- param_escape(key) + "&value=" + param_escape(value);
- }
- }
- getMainContext().init_params[key] = value;
- } catch (e) {
- exception_error("storeInitParam", e);
- }
-} */
-
-/*
-function storeInitParams(params, is_client) {
- try {
- var s = "";
-
- for (k in params) {
- if (getMainContext().init_params[k] != params[k]) {
- s += k + "=" + params[k] + ";";
- getMainContext().init_params[k] = params[k];
- }
- }
-
- debug("storeInitParams: " + s);
-
- if (!is_client) {
- new Ajax.Request("backend.php?op=rpc&subop=storeParams&str=" + s);
- }
- } catch (e) {
- exception_error("storeInitParams", e);
- }
-}*/
-
function fatalError(code, message) {
try {
diff --git a/functions.php b/functions.php
index 05ac12dd3..e98f36f69 100644
--- a/functions.php
+++ b/functions.php
@@ -2205,6 +2205,12 @@
print "<param key=\"cookie_lifetime\" value=\"" . SESSION_COOKIE_LIFETIME . "\"/>";
+ print "<param key=\"default_view_mode\" value=\"" .
+ get_pref($link, "_DEFAULT_VIEW_MODE") . "\"/>";
+
+ print "<param key=\"default_view_limit\" value=\"" .
+ sprintf("%d", get_pref($link, "_DEFAULT_VIEW_LIMIT")) . "\"/>";
+
print "</init-params>";
}
diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php
index e9ebc183f..37c6c9b5f 100644
--- a/modules/pref-prefs.php
+++ b/modules/pref-prefs.php
@@ -308,6 +308,7 @@
WHERE type_id = ttrss_prefs_types.id AND
section_id = ttrss_prefs_sections.id AND
ttrss_user_prefs.pref_name = ttrss_prefs.pref_name AND
+ short_desc != '' AND
owner_uid = ".$_SESSION["uid"]."
ORDER BY section_id,short_desc");
diff --git a/prefs.js b/prefs.js
index a6e5d084c..c8cb35589 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1219,10 +1219,6 @@ function selectTab(id, noupdate, subop) {
}
}
- if (active_tab != id) {
- storeInitParam("prefs_active_tab", id);
- }
-
active_tab = id;
} catch (e) {
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql
index 1097a4e19..0afcac5d7 100644
--- a/schema/ttrss_schema_mysql.sql
+++ b/schema/ttrss_schema_mysql.sql
@@ -188,7 +188,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 (14);
+insert into ttrss_version values (15);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null) TYPE=InnoDB;
@@ -267,6 +267,10 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Mark articles as read automatically',2,
'This option enables marking articles as read automatically in combined mode while you scroll article list.');
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
create table ttrss_user_prefs (
owner_uid integer not null,
pref_name varchar(250),
diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql
index 24436b3af..4501ef1c0 100644
--- a/schema/ttrss_schema_pgsql.sql
+++ b/schema/ttrss_schema_pgsql.sql
@@ -172,7 +172,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 (14);
+insert into ttrss_version values (15);
create table ttrss_prefs_types (id integer not null primary key,
type_name varchar(100) not null);
@@ -247,6 +247,10 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Mark articles as read automatically',2,
'This option enables marking articles as read automatically in combined mode while you scroll article list.');
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
create table ttrss_user_prefs (
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,
diff --git a/schema/versions/mysql/15.sql b/schema/versions/mysql/15.sql
new file mode 100644
index 000000000..9fa183a09
--- /dev/null
+++ b/schema/versions/mysql/15.sql
@@ -0,0 +1,5 @@
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
+update ttrss_version set schema_version = 15;
diff --git a/schema/versions/pgsql/15.sql b/schema/versions/pgsql/15.sql
new file mode 100644
index 000000000..9fa183a09
--- /dev/null
+++ b/schema/versions/pgsql/15.sql
@@ -0,0 +1,5 @@
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_LIMIT', 3, '30', '', 1);
+
+update ttrss_version set schema_version = 15;
diff --git a/tt-rss.js b/tt-rss.js
index bc5bc8205..5f913f86f 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -386,10 +386,10 @@ function init_second_stage() {
document.onkeydown = hotkey_handler;
- var tb = parent.document.forms["main_toolbar_form"];
+ var toolbar = document.forms["main_toolbar_form"];
- dropboxSelect(tb.view_mode, getInitParam("toolbar_view_mode"));
- dropboxSelect(tb.limit, getInitParam("toolbar_limit"));
+ dropboxSelect(toolbar.view_mode, getInitParam("default_view_mode"));
+ dropboxSelect(toolbar.limit, getInitParam("default_view_limit"));
daemon_enabled = getInitParam("daemon_enabled") == 1;
daemon_refresh_only = getInitParam("daemon_refresh_only") == 1;
diff --git a/update.php b/update.php
index 3851679ac..bab0543df 100644
--- a/update.php
+++ b/update.php
@@ -25,7 +25,7 @@
exit;
}
- define('SCHEMA_VERSION', 14);
+ define('SCHEMA_VERSION', 15);
?>