From 40df0eb4524546f4e0561b4b6548dffa4b987299 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 6 Apr 2014 16:20:10 +0200 Subject: UI: Align article one entry lower https://github.com/marienfressinaud/FreshRSS/issues/470 --- p/scripts/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 818d459b3..03870da25 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -236,14 +236,11 @@ function toggleContent(new_active, old_active) { relative_move = true; } - var new_pos = new_active.position().top, - old_scroll = $(box_to_move).scrollTop(); if (sticky_post) { - if (hide_posts) { - - new_pos = new_active.position().top; + var new_pos = new_active.position().top - new_active.children('.flux_header').outerHeight(), old_scroll = $(box_to_move).scrollTop(); + if (hide_posts) { if (relative_move) { new_pos += old_scroll; } -- cgit v1.2.3 From 117396f75126ad966390c367bbdd8e9e17790d66 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Mon, 7 Apr 2014 19:07:01 -0400 Subject: Change click behavior on articles Before, when the user click on an article it closes even if he want to select text. This behavior was not acceptable, so I changed it to close the article when cliking on the article footer or in the article margins. See #473 --- p/scripts/main.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 03870da25..c3069b734 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -604,6 +604,9 @@ function init_shortcuts() { function init_stream(divStream) { divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle + if ($(e.target).parents('.content').length > 0) { + return; + } if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } -- cgit v1.2.3 From 60f73f53c4da215a6a60d21e809960c9cf6078fe Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 8 Apr 2014 21:04:23 +0200 Subject: Change click behaviour on articles #2 https://github.com/marienfressinaud/FreshRSS/issues/473 https://github.com/marienfressinaud/FreshRSS/pull/474/files --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index c3069b734..7d828c585 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -604,7 +604,7 @@ function init_shortcuts() { function init_stream(divStream) { divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle - if ($(e.target).parents('.content').length > 0) { + if ($(e.target).closest('.content').length > 0) { return; } if ($(e.target).closest('.item.website, .item.link').length > 0) { -- cgit v1.2.3 From f6049f3be7b311a78e80d08b2cf01b1eed076db9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 8 Apr 2014 21:17:59 +0200 Subject: Change click behaviour on articles #3 Code simplification https://github.com/marienfressinaud/FreshRSS/issues/473 https://github.com/marienfressinaud/FreshRSS/commit/60f73f53c4da215a6a60d21e809960c9cf6078fe --- p/scripts/main.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 7d828c585..f73ca334f 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -604,10 +604,7 @@ function init_shortcuts() { function init_stream(divStream) { divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle - if ($(e.target).closest('.content').length > 0) { - return; - } - if ($(e.target).closest('.item.website, .item.link').length > 0) { + if ($(e.target).closest('.content, .item.website, .item.link').length > 0) { return; } var old_active = $(".flux.current"), -- cgit v1.2.3 From 65bde8b6cfd9c22e87514cbd109ac475d380c096 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 9 Apr 2014 20:20:32 -0400 Subject: Fix unexpected behavior during navigation When the navigation is done with the mouse and shortcuts, the focus on the current article is lost when the article is collapsed with the mouse. So when navigating with the shortcut does not open the intended article. See #473 and #478 --- p/scripts/main.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index f73ca334f..18e1573cf 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -227,6 +227,8 @@ function toggleContent(new_active, old_active) { new_active.addClass("active"); } new_active.addClass("current"); + } else { + new_active.toggleClass("current"); } var box_to_move = "html,body", -- cgit v1.2.3 From 7e0566b0a183208e020ff31d5c92ef794de19a1e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 10 Apr 2014 23:39:41 -0400 Subject: Fix click action on article Before, when the user clicks on an article header one, it expands. When it clicks a second time, it collapses. When it clicks a third time it stays collapsed instead of expand. Now it toggles the article between expanded and collapsed state. --- p/scripts/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 18e1573cf..a7cccc871 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -207,14 +207,10 @@ function mark_favorite(active) { } function toggleContent(new_active, old_active) { - old_active.removeClass("active"); - if (new_active.length === 0) { return; } - old_active.removeClass("current"); - if (does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.setAttribute('src', this.getAttribute('data-original')); @@ -226,9 +222,10 @@ function toggleContent(new_active, old_active) { if (isCollapsed) { new_active.addClass("active"); } + old_active.removeClass("active current"); new_active.addClass("current"); } else { - new_active.toggleClass("current"); + new_active.toggleClass('active'); } var box_to_move = "html,body", -- cgit v1.2.3 From c94e893dbb7f5e4fcc58311c563f1b33f3681823 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 11 Apr 2014 08:41:51 +0200 Subject: Revert "Fix click action on article" This reverts commit 7e0566b0a183208e020ff31d5c92ef794de19a1e. --- p/scripts/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index a7cccc871..18e1573cf 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -207,10 +207,14 @@ function mark_favorite(active) { } function toggleContent(new_active, old_active) { + old_active.removeClass("active"); + if (new_active.length === 0) { return; } + old_active.removeClass("current"); + if (does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.setAttribute('src', this.getAttribute('data-original')); @@ -222,10 +226,9 @@ function toggleContent(new_active, old_active) { if (isCollapsed) { new_active.addClass("active"); } - old_active.removeClass("active current"); new_active.addClass("current"); } else { - new_active.toggleClass('active'); + new_active.toggleClass("current"); } var box_to_move = "html,body", -- cgit v1.2.3 From 6a04683171ecee8fdc5e601b88a1e5c16f8210c4 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 11 Apr 2014 09:05:31 +0200 Subject: Revert "Revert "Fix click action on article"" This reverts commit c94e893dbb7f5e4fcc58311c563f1b33f3681823. --- p/scripts/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 18e1573cf..a7cccc871 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -207,14 +207,10 @@ function mark_favorite(active) { } function toggleContent(new_active, old_active) { - old_active.removeClass("active"); - if (new_active.length === 0) { return; } - old_active.removeClass("current"); - if (does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.setAttribute('src', this.getAttribute('data-original')); @@ -226,9 +222,10 @@ function toggleContent(new_active, old_active) { if (isCollapsed) { new_active.addClass("active"); } + old_active.removeClass("active current"); new_active.addClass("current"); } else { - new_active.toggleClass("current"); + new_active.toggleClass('active'); } var box_to_move = "html,body", -- cgit v1.2.3 From 7b57ecc9f06f7ccea097e2f72487260c6618ba89 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 17 Apr 2014 18:15:53 +0200 Subject: Fix: Cannot open link from article header https://github.com/marienfressinaud/FreshRSS/issues/490 --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index a7cccc871..7d1864b42 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -581,7 +581,7 @@ function init_shortcuts() { }); shortcut.add(shortcuts.go_website, function () { - var url_website = $(".flux.current .link a").attr("href"); + var url_website = $('.flux.current > .flux_header > .title > a').attr("href"); if (auto_mark_site) { $(".flux.current").each(function () { -- 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 'p/scripts/main.js') 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