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