aboutsummaryrefslogtreecommitdiff
path: root/p
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-09-16 10:46:27 +0200
committerGravatar GitHub <noreply@github.com> 2018-09-16 10:46:27 +0200
commitb323ed084620cac2222fe1c93ec05b9773eb81e6 (patch)
treeec1057810fd3a1971f99d1ebb60b936e0c543094 /p
parent9fa2122d4a27de7d9a207cea3dee911541b63420 (diff)
Improve authors (#2025)
* Links for authors and multiple authors Favour ';' as a separator instead of ',' to better cope with multi-author scientific articles. Follow-up of https://github.com/FreshRSS/FreshRSS/pull/1997 , https://github.com/FreshRSS/FreshRSS/issues/1968, https://github.com/FreshRSS/FreshRSS/pull/2023 * Change i18n authors * Update layout * Unicode-compatible search Example for `author:Loïc` * author <em> styling * Final details * Minor spacing
Diffstat (limited to 'p')
-rw-r--r--p/api/fever.php9
-rw-r--r--p/api/greader.php7
-rw-r--r--p/scripts/main.js6
3 files changed, 14 insertions, 8 deletions
diff --git a/p/api/fever.php b/p/api/fever.php
index 55baa6d16..abbade768 100644
--- a/p/api/fever.php
+++ b/p/api/fever.php
@@ -3,6 +3,7 @@
* Fever API for FreshRSS
* Version 0.1
* Author: Kevin Papst / https://github.com/kevinpapst
+ * Documentation: https://feedafever.com/api
*
* Inspired by:
* TinyTinyRSS Fever API plugin @dasmurphy
@@ -63,7 +64,7 @@ class FeverDAO extends Minz_ModelPdo
$sql = 'SELECT id, guid, title, author, '
. ($entryDAO->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content')
- . ', link, date, is_read, is_favorite, id_feed, tags '
+ . ', link, date, is_read, is_favorite, id_feed '
. 'FROM `' . $this->prefix . 'entry` WHERE';
if (!empty($entry_ids)) {
@@ -495,17 +496,17 @@ class FeverAPI
// Load list of extensions and enable the "system" ones.
Minz_ExtensionManager::init();
- foreach($entries as $item) {
+ foreach ($entries as $item) {
/** @var FreshRSS_Entry $entry */
$entry = Minz_ExtensionManager::callHook('entry_before_display', $item);
- if (is_null($entry)) {
+ if ($entry == null) {
continue;
}
$items[] = array(
'id' => $entry->id(),
'feed_id' => $entry->feed(false),
'title' => $entry->title(),
- 'author' => $entry->author(),
+ 'author' => $entry->authors(true),
'html' => $entry->content(),
'url' => $entry->link(),
'is_saved' => $entry->isFavorite() ? 1 : 0,
diff --git a/p/api/greader.php b/p/api/greader.php
index 4affc2826..f5b84f7a1 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -18,6 +18,7 @@ Server-side API compatible with Google Reader API layer 2
* https://github.com/ericmann/gReader-Library/blob/master/greader.class.php
* https://github.com/devongovett/reader
* https://github.com/theoldreader/api
+* https://www.inoreader.com/developers/
*/
require(__DIR__ . '/../../constants.php');
@@ -471,6 +472,7 @@ function entriesToArray($entries) {
'categories' => array(
'user/-/state/com.google/reading-list',
'user/-/label/' . $c_name,
+ //TODO: Add other tags
),
'origin' => array(
'streamId' => 'feed/' . $f_id,
@@ -478,8 +480,9 @@ function entriesToArray($entries) {
//'htmlUrl' => $line['f_website'],
),
);
- if ($entry->author() != '') {
- $item['author'] = $entry->author();
+ $author = $entry->authors(true);
+ if ($author != '') {
+ $item['author'] = $author;
}
if ($entry->isRead()) {
$item['categories'][] = 'user/-/state/com.google/read';
diff --git a/p/scripts/main.js b/p/scripts/main.js
index f8d20767a..6ab256065 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -731,7 +731,7 @@ function init_shortcuts() {
function init_stream(divStream) {
divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle
- if ($(e.target).closest('.content, .item.website, .item.link').length > 0) {
+ if ($(e.target).closest('.keep_unread, .content, .item.website, .item.link, .dropdown-menu').length > 0) {
return;
}
if (!context.sides_close_article && $(e.target).is('div.flux_content')) {
@@ -788,7 +788,9 @@ function init_stream(divStream) {
});
divStream.on('click', '.flux .content a', function () {
- $(this).attr('target', '_blank').attr('rel', 'noreferrer');
+ if (!$(this).closest('div').hasClass('author')) {
+ $(this).attr('target', '_blank').attr('rel', 'noreferrer');
+ }
});
if (context.auto_mark_site) {