From a201450b5817af23a57e8c68569c24ed5451b7ef Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 2 Feb 2014 10:02:45 -0500 Subject: Modification des raccourcis de navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modification du raccourci pour naviguer au premier article (Home au lieu de Shift+j) Modification du raccourci pour naviguer au dernier article (End au lieu de Shift+k) Ajout de modificateurs pour utiliser les touches de navigation dans d'autres contextes (Shift pour les flux, Ctrl pour les catégories) Voir issue#256 --- app/views/helpers/javascript_vars.phtml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 0ecdc1bca..42312bc97 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -19,6 +19,8 @@ echo ',shortcuts={', 'go_website:"', $s['go_website'], '",', 'prev_entry:"', $s['prev_entry'], '",', 'next_entry:"', $s['next_entry'], '",', + 'first_entry:"', $s['first_entry'], '",', + 'last_entry:"', $s['last_entry'], '",', 'collapse_entry:"', $s['collapse_entry'], '",', 'load_more:"', $s['load_more'], '",', 'auto_share:"', $s['auto_share'], '"', -- cgit v1.2.3 From 4419df1da4f5b7199ece4f51f2e4da66f976616e Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 11 Feb 2014 22:35:54 +0100 Subject: Fix Persona reloaded When user is disconnected, current_user_mail must be null and not an empty string See #418 --- app/views/helpers/javascript_vars.phtml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 42312bc97..3d7c8a98f 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -32,7 +32,13 @@ if (Minz_Request::param ('output') === 'global') { $authType = Minz_Configuration::authType(); if ($authType === 'persona') { - echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",'; + // If user is disconnected, current_user_mail MUST be null + $mail = Minz_Session::param ('mail', false); + if ($mail) { + echo 'current_user_mail="' . $mail . '",'; + } else { + echo 'current_user_mail=null,'; + } } echo 'authType="', $authType, '",', -- cgit v1.2.3 From 7afd9e398a505aebf540ab32c3c6a29bb94a9514 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 21 Feb 2014 20:48:43 +0100 Subject: Bug "mark all as read" when using DESC and pagination https://github.com/marienfressinaud/FreshRSS/issues/431#issuecomment-35710258 --- app/views/helpers/javascript_vars.phtml | 1 + p/scripts/main.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 3d7c8a98f..afe0ab258 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -5,6 +5,7 @@ echo '"use strict";', "\n"; $mark = $this->conf->mark_when; echo 'var ', 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', ',auto_mark_article=', $mark['article'] ? 'true' : 'false', ',auto_mark_site=', $mark['site'] ? 'true' : 'false', ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', diff --git a/p/scripts/main.js b/p/scripts/main.js index 34042c945..beb77a19c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -774,7 +774,11 @@ function load_more_posts() { $.get(url_load_more, function (data) { box_load_more.children('.flux:last').after($('#stream', data).children('.flux, .day')); $('.pagination').replaceWith($('.pagination', data)); - $('#bigMarkAsRead').attr('href', $('#nav_menu_read_all>a').attr('href')); + if (display_order === 'ASC') { + $('#nav_menu_read_all>a').attr('href', $('#bigMarkAsRead').attr('href')); + } else { + $('#bigMarkAsRead').attr('href', $('#nav_menu_read_all>a').attr('href')); + } $('[id^=day_]').each(function (i) { var ids = $('[id="' + this.id + '"]'); -- cgit v1.2.3 From 1e105a64ab12b37f55b605a89e869f7bbb520e95 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 24 Feb 2014 19:51:57 -0500 Subject: Add a configuration option to get sticky articles Now the user can choose if an opened article will be repositioned to the top or not See #338 --- app/Controllers/configureController.php | 1 + app/Models/Configuration.php | 4 ++++ app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/configure/display.phtml | 10 ++++++++++ app/views/helpers/javascript_vars.phtml | 3 ++- p/scripts/main.js | 34 +++++++++++++++++---------------- 7 files changed, 37 insertions(+), 17 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 104fa8900..f831f25d0 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -148,6 +148,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $this->view->conf->_display_posts(Minz_Request::param('display_posts', false)); $this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false)); $this->view->conf->_lazyload (Minz_Request::param('lazyload', false)); + $this->view->conf->_sticky_post (Minz_Request::param('sticky_post', false)); $this->view->conf->_sort_order(Minz_Request::param('sort_order', 'DESC')); $this->view->conf->_mark_when (array( 'article' => Minz_Request::param('mark_open_article', false), diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index bacb79510..48efe3bf6 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -17,6 +17,7 @@ class FreshRSS_Configuration { 'display_posts' => false, 'onread_jump_next' => true, 'lazyload' => true, + 'sticky_post' => true, 'sort_order' => 'DESC', 'anon_access' => false, 'mark_when' => array( @@ -140,6 +141,9 @@ class FreshRSS_Configuration { public function _lazyload ($value) { $this->data['lazyload'] = ((bool)$value) && $value !== 'no'; } + public function _sticky_post($value) { + $this->data['sticky_post'] = ((bool)$value) && $value !== 'no'; + } public function _sort_order ($value) { $this->data['sort_order'] = $value === 'ASC' ? 'ASC' : 'DESC'; } diff --git a/app/i18n/en.php b/app/i18n/en.php index 69c2fd310..e67447520 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -215,6 +215,7 @@ return array ( 'top_line' => 'Top line', 'bottom_line' => 'Bottom line', 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', + 'sticky_post' => 'Stick the article to the top when opened', 'auto_read_when' => 'Mark article as read…', 'article_selected' => 'when article is selected', 'article_open_on_website' => 'when article is opened on its original website', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 452c560a7..2bd4fabab 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -215,6 +215,7 @@ return array ( 'top_line' => 'Ligne du haut', 'bottom_line' => 'Ligne du bas', 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', + 'sticky_post' => 'Aligner l’article en haut quand il est ouvert', 'auto_read_when' => 'Marquer un article comme lu…', 'article_selected' => 'lorsque l’article est sélectionné', 'article_open_on_website' => 'lorsque l’article est ouvert sur le site d’origine', diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 9104e4ef1..846db4b4c 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -110,6 +110,16 @@ +
+
+ +
+
+
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index afe0ab258..2ce11d7d7 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -11,7 +11,8 @@ echo 'var ', ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; + ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false', + ',sticky_post=', $this->conf->sticky_post ? 'true' : 'false'; $s = $this->conf->shortcuts; echo ',shortcuts={', diff --git a/p/scripts/main.js b/p/scripts/main.js index ec27bd50c..6cc992379 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -238,26 +238,28 @@ function toggleContent(new_active, old_active) { var new_pos = new_active.position().top, old_scroll = $(box_to_move).scrollTop(); - if (hide_posts) { + if (sticky_post) { + if (hide_posts) { - new_pos = new_active.position().top; - old_scroll = $(box_to_move).scrollTop(); + new_pos = new_active.position().top; + old_scroll = $(box_to_move).scrollTop(); - if (relative_move) { - new_pos += old_scroll; - } + if (relative_move) { + new_pos += old_scroll; + } - if (old_active[0] !== new_active[0]) { - new_active.children(".flux_content").first().each(function () { - $(box_to_move).scrollTop(new_pos).scrollTop(); - }); - } - } else { - if (relative_move) { - new_pos += old_scroll; - } + if (old_active[0] !== new_active[0]) { + new_active.children(".flux_content").first().each(function () { + $(box_to_move).scrollTop(new_pos).scrollTop(); + }); + } + } else { + if (relative_move) { + new_pos += old_scroll; + } - $(box_to_move).scrollTop(new_pos).scrollTop(); + $(box_to_move).scrollTop(new_pos).scrollTop(); + } } if (auto_mark_article) { -- cgit v1.2.3 From f820f428ef92a87c2d2083fa3a239b10f5c31129 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 27 Apr 2014 11:00:25 -0400 Subject: Add a shortcut to access the search field --- app/Models/Configuration.php | 1 + app/i18n/en.php | 1 + app/i18n/fr.php | 1 + app/views/configure/shortcut.phtml | 7 +++++++ app/views/helpers/javascript_vars.phtml | 3 ++- p/scripts/main.js | 10 ++++++++++ 6 files changed, 22 insertions(+), 1 deletion(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 4b52fa05b..8d3e69a1c 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -39,6 +39,7 @@ class FreshRSS_Configuration { 'collapse_entry' => 'c', 'load_more' => 'm', 'auto_share' => 's', + 'focus_search' => 'a', ), 'topline_read' => true, 'topline_favorite' => true, diff --git a/app/i18n/en.php b/app/i18n/en.php index f9be04549..21d37f475 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -137,6 +137,7 @@ return array ( 'collapse_article' => 'Collapse', 'auto_share' => 'Share', 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', + 'focus_search' => 'Access search box', 'file_to_import' => 'File to import
(OPML, Json or Zip)', 'import' => 'Import', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index f40750b92..f42115fcd 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -137,6 +137,7 @@ return array ( 'collapse_article' => 'Refermer', 'auto_share' => 'Partager', 'auto_share_help' => 'Si il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', + 'focus_search' => 'Accéder à la recherche', 'file_to_import' => 'Fichier à importer
(OPML, Json ou Zip)', 'import' => 'Importer', diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 7ba14c1d8..bfb13f003 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -96,6 +96,13 @@
+
+ +
+ +
+
+
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 2ce11d7d7..6e0a20de3 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -25,7 +25,8 @@ echo ',shortcuts={', 'last_entry:"', $s['last_entry'], '",', 'collapse_entry:"', $s['collapse_entry'], '",', 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '"', + 'auto_share:"', $s['auto_share'], '",', + 'focus_search:"', $s['focus_search'], '"', "},\n"; if (Minz_Request::param ('output') === 'global') { diff --git a/p/scripts/main.js b/p/scripts/main.js index 7d1864b42..aeb044e88 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -599,6 +599,12 @@ function init_shortcuts() { }, { 'disable_in_input': true }); + + shortcut.add(shortcuts.focus_search, function () { + focus_search(); + }, { + 'disable_in_input': true + }); } function init_stream(divStream) { @@ -791,6 +797,10 @@ function load_more_posts() { }); } +function focus_search() { + $('#search').focus(); +} + function init_load_more(box) { box_load_more = box; -- cgit v1.2.3