mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-18 14:11:29 +00:00
Merge branch 'master' of github.com:gothfox/Tiny-Tiny-RSS
This commit is contained in:
@@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
startup_gettext();
|
startup_gettext();
|
||||||
|
|
||||||
$script_started = getmicrotime();
|
$script_started = microtime(true);
|
||||||
|
|
||||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||||
|
|
||||||
|
|||||||
@@ -23,16 +23,10 @@ class Backend extends Handler {
|
|||||||
$imap = get_hotkeys_map($this->link);
|
$imap = get_hotkeys_map($this->link);
|
||||||
$omap = array();
|
$omap = array();
|
||||||
|
|
||||||
// :(
|
|
||||||
$tinycharmap = array(
|
|
||||||
"(9)" => "{TAB}",
|
|
||||||
"(191)" => "?");
|
|
||||||
|
|
||||||
foreach ($imap[1] as $sequence => $action) {
|
foreach ($imap[1] as $sequence => $action) {
|
||||||
if (!isset($omap[$action])) {
|
if (!isset($omap[$action])) $omap[$action] = array();
|
||||||
$omap[$action] = isset($tinycharmap[$sequence]) ? $tinycharmap[$sequence] :
|
|
||||||
$sequence;
|
array_push($omap[$action], $sequence);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<ul class='helpKbList' id='helpKbList'>";
|
print "<ul class='helpKbList' id='helpKbList'>";
|
||||||
@@ -44,18 +38,21 @@ class Backend extends Handler {
|
|||||||
print "<li><h3>" . $section . "</h3></li>";
|
print "<li><h3>" . $section . "</h3></li>";
|
||||||
|
|
||||||
foreach ($hotkeys as $action => $description) {
|
foreach ($hotkeys as $action => $description) {
|
||||||
if (strpos($omap[$action], "|") !== FALSE) {
|
|
||||||
$omap[$action] = substr($omap[$action],
|
foreach ($omap[$action] as $sequence) {
|
||||||
strpos($omap[$action], "|")+1,
|
if (strpos($sequence, "|") !== FALSE) {
|
||||||
strlen($omap[$action]));
|
$sequence = substr($sequence,
|
||||||
|
strpos($sequence, "|")+1,
|
||||||
|
strlen($sequence));
|
||||||
|
}
|
||||||
|
|
||||||
|
print "<li>";
|
||||||
|
print "<span class='hksequence'>$sequence</span>";
|
||||||
|
print $description;
|
||||||
|
print "</li>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<li>";
|
|
||||||
print "<span class='hksequence'>" . $omap[$action] . "</span>";
|
|
||||||
print $description;
|
|
||||||
print "</li>";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</ul>";
|
print "</ul>";
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ class Feeds extends Handler_Protected {
|
|||||||
|
|
||||||
$reply = array();
|
$reply = array();
|
||||||
|
|
||||||
$timing_info = getmicrotime();
|
$timing_info = microtime(true);
|
||||||
|
|
||||||
$topmost_article_ids = array();
|
$topmost_article_ids = array();
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ class Feeds extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function view() {
|
function view() {
|
||||||
$timing_info = getmicrotime();
|
$timing_info = microtime(true);
|
||||||
|
|
||||||
$reply = array();
|
$reply = array();
|
||||||
|
|
||||||
|
|||||||
@@ -437,6 +437,8 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function uploadicon() {
|
function uploadicon() {
|
||||||
|
header("Content-type: text/html");
|
||||||
|
|
||||||
$icon_file = $_FILES['icon_file']['tmp_name'];
|
$icon_file = $_FILES['icon_file']['tmp_name'];
|
||||||
$feed_id = db_escape_string($_REQUEST["feed_id"]);
|
$feed_id = db_escape_string($_REQUEST["feed_id"]);
|
||||||
|
|
||||||
|
|||||||
@@ -824,7 +824,10 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setplugins() {
|
function setplugins() {
|
||||||
$plugins = join(",", $_REQUEST["plugins"]);
|
if (is_array($_REQUEST["plugins"]))
|
||||||
|
$plugins = join(",", $_REQUEST["plugins"]);
|
||||||
|
else
|
||||||
|
$plugins = "";
|
||||||
|
|
||||||
set_pref($this->link, "_ENABLED_PLUGINS", $plugins);
|
set_pref($this->link, "_ENABLED_PLUGINS", $plugins);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -478,11 +478,6 @@
|
|||||||
print "</select>";
|
print "</select>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getmicrotime() {
|
|
||||||
list($usec, $sec) = explode(" ",microtime());
|
|
||||||
return ((float)$usec + (float)$sec);
|
|
||||||
}
|
|
||||||
|
|
||||||
function print_radio($id, $default, $true_is, $values, $attributes = "") {
|
function print_radio($id, $default, $true_is, $values, $attributes = "") {
|
||||||
foreach ($values as $v) {
|
foreach ($values as $v) {
|
||||||
|
|
||||||
@@ -1864,6 +1859,8 @@
|
|||||||
"prev_feed" => __("Open previous feed"),
|
"prev_feed" => __("Open previous feed"),
|
||||||
"next_article" => __("Open next article"),
|
"next_article" => __("Open next article"),
|
||||||
"prev_article" => __("Open previous article"),
|
"prev_article" => __("Open previous article"),
|
||||||
|
"next_article_noscroll" => __("Open next article (don't scroll long articles)"),
|
||||||
|
"prev_article_noscroll" => __("Open previous article (don't scroll long articles)"),
|
||||||
"search_dialog" => __("Show search dialog")),
|
"search_dialog" => __("Show search dialog")),
|
||||||
__("Article") => array(
|
__("Article") => array(
|
||||||
"toggle_mark" => __("Toggle starred"),
|
"toggle_mark" => __("Toggle starred"),
|
||||||
@@ -1924,6 +1921,8 @@
|
|||||||
"p" => "prev_article",
|
"p" => "prev_article",
|
||||||
"(38)|up" => "prev_article",
|
"(38)|up" => "prev_article",
|
||||||
"(40)|down" => "next_article",
|
"(40)|down" => "next_article",
|
||||||
|
"^(38)|Ctrl-up" => "prev_article_noscroll",
|
||||||
|
"^(40)|Ctrl-down" => "next_article_noscroll",
|
||||||
"(191)|/" => "search_dialog",
|
"(191)|/" => "search_dialog",
|
||||||
// "article" => array(
|
// "article" => array(
|
||||||
"s" => "toggle_mark",
|
"s" => "toggle_mark",
|
||||||
@@ -2796,7 +2795,7 @@
|
|||||||
|
|
||||||
$id = 'AUDIO-' . uniqid();
|
$id = 'AUDIO-' . uniqid();
|
||||||
|
|
||||||
$entry .= "<audio id=\"$id\"\" controls>
|
$entry .= "<audio id=\"$id\"\" controls style='display : none'>
|
||||||
<source type=\"$ctype\" src=\"$url\"></source>
|
<source type=\"$ctype\" src=\"$url\"></source>
|
||||||
</audio>";
|
</audio>";
|
||||||
|
|
||||||
@@ -3065,7 +3064,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function print_checkpoint($n, $s) {
|
function print_checkpoint($n, $s) {
|
||||||
$ts = getmicrotime();
|
$ts = microtime(true);
|
||||||
echo sprintf("<!-- CP[$n] %.4f seconds -->", $ts - $s);
|
echo sprintf("<!-- CP[$n] %.4f seconds -->", $ts - $s);
|
||||||
return $ts;
|
return $ts;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ function request_counters(force) {
|
|||||||
var date = new Date();
|
var date = new Date();
|
||||||
var timestamp = Math.round(date.getTime() / 1000);
|
var timestamp = Math.round(date.getTime() / 1000);
|
||||||
|
|
||||||
if (force || timestamp - counters_last_request > 15) {
|
if (force || timestamp - counters_last_request > 5) {
|
||||||
console.log("scheduling request of counters...");
|
console.log("scheduling request of counters...");
|
||||||
|
|
||||||
counters_last_request = timestamp;
|
counters_last_request = timestamp;
|
||||||
|
|||||||
@@ -604,6 +604,12 @@ function hotkey_handler(e) {
|
|||||||
case "prev_article":
|
case "prev_article":
|
||||||
moveToPost('prev');
|
moveToPost('prev');
|
||||||
return false;
|
return false;
|
||||||
|
case "next_article_noscroll":
|
||||||
|
moveToPost('next', true);
|
||||||
|
return false;
|
||||||
|
case "prev_article_noscroll":
|
||||||
|
moveToPost('prev', true);
|
||||||
|
return false;
|
||||||
case "search_dialog":
|
case "search_dialog":
|
||||||
search();
|
search();
|
||||||
return ;
|
return ;
|
||||||
|
|||||||
@@ -325,7 +325,8 @@ function article_callback2(transport, id) {
|
|||||||
Element.show(dijit.byId("net-alert").domNode);
|
Element.show(dijit.byId("net-alert").domNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
request_counters();
|
var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length
|
||||||
|
request_counters(unread_in_buffer == 0);
|
||||||
|
|
||||||
headlines_scroll_handler($("headlines-frame"));
|
headlines_scroll_handler($("headlines-frame"));
|
||||||
|
|
||||||
@@ -513,7 +514,7 @@ function togglePub(id, client_only, no_effects, note) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveToPost(mode) {
|
function moveToPost(mode, noscroll) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -548,13 +549,23 @@ function moveToPost(mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode == "next") {
|
if (mode == "next") {
|
||||||
if (next_id) {
|
if (next_id || active_post_id) {
|
||||||
if (isCdmMode()) {
|
if (isCdmMode()) {
|
||||||
|
|
||||||
cdmExpandArticle(next_id);
|
var article = $("RROW-" + active_post_id);
|
||||||
cdmScrollToArticleId(next_id);
|
var ctr = $("headlines-frame");
|
||||||
|
|
||||||
} else {
|
if (!noscroll && article && article.offsetTop + article.offsetHeight >
|
||||||
|
ctr.scrollTop + ctr.offsetHeight) {
|
||||||
|
|
||||||
|
scrollArticle(ctr.offsetHeight/2);
|
||||||
|
|
||||||
|
} else if (next_id) {
|
||||||
|
cdmExpandArticle(next_id);
|
||||||
|
cdmScrollToArticleId(next_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (next_id) {
|
||||||
correctHeadlinesOffset(next_id);
|
correctHeadlinesOffset(next_id);
|
||||||
view(next_id, getActiveFeedId());
|
view(next_id, getActiveFeedId());
|
||||||
}
|
}
|
||||||
@@ -562,11 +573,24 @@ function moveToPost(mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode == "prev") {
|
if (mode == "prev") {
|
||||||
if (prev_id) {
|
if (prev_id || active_post_id) {
|
||||||
if (isCdmMode()) {
|
if (isCdmMode()) {
|
||||||
cdmExpandArticle(prev_id);
|
|
||||||
cdmScrollToArticleId(prev_id);
|
var article = $("RROW-" + active_post_id);
|
||||||
} else {
|
var prev_article = $("RROW-" + prev_id);
|
||||||
|
var ctr = $("headlines-frame");
|
||||||
|
|
||||||
|
if (!noscroll && article && article.offsetTop < ctr.scrollTop) {
|
||||||
|
scrollArticle(-ctr.offsetHeight/2);
|
||||||
|
} else if (!noscroll && prev_article &&
|
||||||
|
prev_article.offsetTop < ctr.scrollTop) {
|
||||||
|
cdmExpandArticle(prev_id);
|
||||||
|
scrollArticle(-ctr.offsetHeight/2);
|
||||||
|
} else if (prev_id) {
|
||||||
|
cdmExpandArticle(prev_id);
|
||||||
|
cdmScrollToArticleId(prev_id);
|
||||||
|
}
|
||||||
|
} else if (prev_id) {
|
||||||
correctHeadlinesOffset(prev_id);
|
correctHeadlinesOffset(prev_id);
|
||||||
view(prev_id, getActiveFeedId());
|
view(prev_id, getActiveFeedId());
|
||||||
}
|
}
|
||||||
@@ -1131,7 +1155,11 @@ function cdmScrollToArticleId(id) {
|
|||||||
|
|
||||||
if (!e || !ctr) return;
|
if (!e || !ctr) return;
|
||||||
|
|
||||||
ctr.scrollTop = e.offsetTop;
|
if (e.offsetTop+e.offsetHeight > (ctr.scrollTop+ctr.offsetHeight) ||
|
||||||
|
e.offsetTop < ctr.scrollTop) {
|
||||||
|
|
||||||
|
ctr.scrollTop = e.offsetTop;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("cdmScrollToArticleId", e);
|
exception_error("cdmScrollToArticleId", e);
|
||||||
@@ -1330,12 +1358,12 @@ function cdmExpandArticle(id) {
|
|||||||
Element.hide("CEXC-" + id);
|
Element.hide("CEXC-" + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
var new_offset = $("RROW-" + id).offsetTop;
|
/* var new_offset = $("RROW-" + id).offsetTop;
|
||||||
|
|
||||||
$("headlines-frame").scrollTop += (new_offset-old_offset);
|
$("headlines-frame").scrollTop += (new_offset-old_offset);
|
||||||
|
|
||||||
if ($("RROW-" + id).offsetTop != old_offset)
|
if ($("RROW-" + id).offsetTop != old_offset)
|
||||||
$("headlines-frame").scrollTop = new_offset;
|
$("headlines-frame").scrollTop = new_offset; */
|
||||||
|
|
||||||
toggleUnread(id, 0, true);
|
toggleUnread(id, 0, true);
|
||||||
toggleSelected(id);
|
toggleSelected(id);
|
||||||
@@ -1550,7 +1578,8 @@ function cdmClicked(event, id) {
|
|||||||
openArticleInNewWindow(id);
|
openArticleInNewWindow(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
request_counters();
|
var unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length
|
||||||
|
request_counters(unread_in_buffer == 0);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("cdmClicked");
|
exception_error("cdmClicked");
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
startup_gettext();
|
startup_gettext();
|
||||||
|
|
||||||
$script_started = getmicrotime();
|
$script_started = microtime(true);
|
||||||
|
|
||||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user