A free, self-hostable news aggregator…
Ajout d'un flag pour se souvenir de l'état ouvert ou fermé d'un article.
Alexis Degrugillier9fee917c6102
diff --git a/public/scripts/main.js b/public/scripts/main.jsindex e21483f28..81538f4c4 100644--- a/public/scripts/main.js+++ b/public/scripts/main.js@@ -1,6 +1,19 @@"use strict";var $stream = null;+// Create a new object to store FreshRSS methods and variables.+// It will prevent over-riding other libraries methods and variables.+var FreshRSS = {};+FreshRSS.isCollapsed = true;++FreshRSS.Entry = {};++// Toggle the collapse flag+FreshRSS.Entry.toggleCollapse = function() {+ FreshRSS.isCollapsed = !FreshRSS.isCollapsed;+ $(".flux.current").toggleClass("active");+};+function is_normal_mode() {return $stream.hasClass('normal');}@@ -143,9 +156,12 @@ function toggleContent(new_active, old_active) {});}- old_active.removeClass("active");+ old_active.removeClass("active").removeClass("current");if (old_active[0] !== new_active[0]) {- new_active.addClass("active");+ if (FreshRSS.isCollapsed) {+ new_active.addClass("active");+ };+ new_active.addClass("current");}var box_to_move = "html,body",@@ -185,7 +201,7 @@ function toggleContent(new_active, old_active) {}function prev_entry() {- var old_active = $(".flux.active"),+ var old_active = $(".flux.current"),last_active = $(".flux:last"),new_active = old_active.prevAll(".flux:first");@@ -197,7 +213,7 @@ function prev_entry() {}function next_entry() {- var old_active = $(".flux.active"),+ var old_active = $(".flux.current"),first_active = $(".flux:first"),last_active = $(".flux:last"),new_active = old_active.nextAll(".flux:first");@@ -213,10 +229,6 @@ function next_entry() {}}-function collapse_entry() {- $(".flux.active").removeClass("active");-}-function inMarkViewport(flux, box_to_follow, relative_follow) {var top = flux.position().top;if (relative_follow) {@@ -303,7 +315,7 @@ function init_shortcuts() {// Touches de manipulationshortcut.add(shortcuts.mark_read, function () {// on marque comme lu ou non lu- var active = $(".flux.active");+ var active = $(".flux.current");mark_read(active, false);}, {'disable_in_input': true@@ -317,13 +329,13 @@ function init_shortcuts() {});shortcut.add(shortcuts.mark_favorite, function () {// on marque comme favori ou non favori- var active = $(".flux.active");+ var active = $(".flux.current");mark_favorite(active);}, {'disable_in_input': true});shortcut.add(shortcuts.collapse_entry, function () {- collapse_entry();+ FreshRSS.Entry.toggleCollapse();}, {'disable_in_input': true});@@ -333,7 +345,7 @@ function init_shortcuts() {'disable_in_input': true});shortcut.add("shift+" + shortcuts.prev_entry, function () {- var old_active = $(".flux.active"),+ var old_active = $(".flux.current"),first = $(".flux:first");if (first.hasClass("flux")) {@@ -346,7 +358,7 @@ function init_shortcuts() {'disable_in_input': true});shortcut.add("shift+" + shortcuts.next_entry, function () {- var old_active = $(".flux.active"),+ var old_active = $(".flux.current"),last = $(".flux:last");if (last.hasClass("flux")) {@@ -359,7 +371,7 @@ function init_shortcuts() {var url_website = $(".flux.active .link a").attr("href");if (auto_mark_site) {- $(".flux.active").each(function () {+ $(".flux.current").each(function () {mark_read($(this), true);});}@@ -372,7 +384,7 @@ function init_shortcuts() {function init_stream_delegates(divStream) {divStream.on('click', '.flux_header>.item.title, .flux_header>.item.date', function (e) { //flux_header_toggle- var old_active = $(".flux.active"),+ var old_active = $(".flux.current"),new_active = $(this).parent().parent();if (e.target.tagName.toUpperCase() === 'A') { //Leave real links aloneif (auto_mark_article) {@@ -427,7 +439,7 @@ function init_nav_entries() {return false;});$nav_entries.find('.up').click(function () {- var active_item = $(".flux.active"),+ var active_item = $(".flux.current"),windowTop = $(window).scrollTop(),item_top = active_item.position().top;diff --git a/public/themes/default/freshrss.css b/public/themes/default/freshrss.cssindex 78f76dd83..c0581bae5 100644--- a/public/themes/default/freshrss.css+++ b/public/themes/default/freshrss.css@@ -280,6 +280,9 @@color: #000;outline: none;}+ .flux.current .item.title a {+ text-decoration: underline;+ }.flux.not_read .flux_header .item.title {font-weight: bold;}diff --git a/public/themes/flat-design/freshrss.css b/public/themes/flat-design/freshrss.cssindex 602845ef1..af6f55060 100644--- a/public/themes/flat-design/freshrss.css+++ b/public/themes/flat-design/freshrss.css@@ -259,6 +259,9 @@ body {color: #333;outline: none;}+ .flux.current .item.title a {+ text-decoration: underline;+ }.flux.not_read .flux_header .item.title {font-weight: bold;}