<tr><td class='n'>f w</td><td><?php echo __("Sort by name or unread count") ?></td></tr>
<tr><td class='n'>f h</td><td><?php echo __("Hide visible read articles") ?></td></tr>
<tr><td class='n'>f q</td><td><?php echo __("Mark feed as read") ?></td></tr>
+ <tr><td class='n'>f x</td><td><?php echo __("Reverse headlines order") ?></td></tr>
<tr><td class='n'>Q</td><td><?php echo __("Mark all feeds as read") ?></td></tr>
<tr><td class='n'>x</td><td><?php echo __("If viewing category, (un)collapse it") ?></td></tr>
</table>
}
- if ($subop == "setpref") {
- if (WEB_DEMO_MODE) {
- return;
- }
+ if ($subop == "togglepref") {
+ print "<rpc-reply>";
+
+ $key = db_escape_string($_REQUEST["key"]);
+
+ set_pref($link, $key, !get_pref($link, $key));
+
+ $value = get_pref($link, $key);
+ print "<param-set key=\"$key\" value=\"$value\"/>";
+
+ print "</rpc-reply>";
+
+ return;
+ }
+
+ if ($subop == "setpref") {
print "<rpc-reply>";
$key = db_escape_string($_REQUEST["key"]);
return;
}
+ if (keycode == 88) { // x
+ reverseHeadlineOrder();
+ return;
+ }
}
/* Prefix c */
function inPreferences() {
return false;
}
+
+function reverseHeadlineOrder() {
+ try {
+
+ var query_str = "?op=rpc&subop=togglepref&key=REVERSE_HEADLINES";
+
+ new Ajax.Request("backend.php", {
+ parameters: query_str,
+ onComplete: function(transport) {
+ viewCurrentFeed();
+ } });
+
+ } catch (e) {
+ exception_error("reverseHeadlineOrder", e);
+ }
+}