From c3cac60b319189017c38b7d5e1d09f51ded96d0e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 9 Mar 2014 21:30:20 +0100 Subject: Autoload when less than 2 remaining articles https://github.com/marienfressinaud/FreshRSS/issues/388 + Simplify code --- p/scripts/main.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 6cc992379..b69ac0a2a 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -278,11 +278,8 @@ function next_entry() { new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); toggleContent(new_active, old_active); - if (!auto_load_more) { - var last_active = $(".flux:last"); - if (last_active.attr("id") === new_active.attr("id")) { - load_more_posts(); - } + if (new_active.nextAll().length < 3) { + load_more_posts(); } } -- cgit v1.2.3 From 3083af6288f23ba6986232798fde67b91517f287 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 9 Mar 2014 21:45:25 -0400 Subject: Enhance feed adding popup I added a new option in the category select. It allows the user to add dynamically a new category and add the feed to the newly created category. See #356 --- app/Controllers/feedController.php | 8 ++++++++ app/layout/aside_feed.phtml | 5 +++++ p/scripts/main.js | 13 +++++++++++++ 3 files changed, 26 insertions(+) (limited to 'p/scripts') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index c718fcd5c..9996725e4 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -30,6 +30,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $url = Minz_Request::param ('url_rss'); $cat = Minz_Request::param ('category', false); + if ($cat === 'nc') { + $new_cat = Minz_Request::param ('new_category'); + if (empty($new_cat['name'])) { + $cat = false; + } else { + $cat = $this->catDAO->addCategory($new_cat); + } + } if ($cat === false) { $def_cat = $this->catDAO->getDefault (); $cat = $def_cat->id (); diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index e324b15bd..6f3cdafb2 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -20,9 +20,14 @@ name (); ?> + + +
  • diff --git a/p/scripts/main.js b/p/scripts/main.js index b69ac0a2a..3a4d4e4fb 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -986,6 +986,18 @@ function init_share_observers() { }); }; +function init_feed_observers() { + $('select[id="category"]').on('change', function(){ + var detail = $(this).parent('li').next('li'); + if ($(this).val() === 'nc') { + detail.show(); + detail.find('input').focus(); + } else { + detail.hide(); + } + }); +}; + function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { if (window.console) { @@ -1017,6 +1029,7 @@ function init_all() { window.setInterval(refreshUnreads, 120000); } else { init_share_observers(); + init_feed_observers(); } if (window.console) { -- cgit v1.2.3 From 6863ad663f50425db76b64b638805821f3419874 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 12 Mar 2014 22:40:20 -0400 Subject: Add an observer to close an article when clicking on its footer See #449 --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 3a4d4e4fb..799d46625 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -606,7 +606,7 @@ function init_shortcuts() { } function init_stream(divStream) { - divStream.on('click', '.flux_header', function (e) { //flux_header_toggle + divStream.on('click', '.flux_header,.flux_content > .bottom', function (e) { //flux_header_toggle, flux_footer_toggle if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } -- cgit v1.2.3 From be46819f517a105ad32ddbfcd22b9824b4446ea1 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Fri, 14 Mar 2014 20:46:50 -0400 Subject: Change article observer Instead of observe only the bottom of the article to collapse the article, the whole article is observed. Now if you want to close an article in the middle of your reading, you can. --- p/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 799d46625..898ec8c69 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -606,7 +606,7 @@ function init_shortcuts() { } function init_stream(divStream) { - divStream.on('click', '.flux_header,.flux_content > .bottom', function (e) { //flux_header_toggle, flux_footer_toggle + divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } -- cgit v1.2.3 From 1af723ca68e2558232ef4c4eb5a7c8f41a07bd0c Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 15 Mar 2014 07:08:58 -0400 Subject: Add a button to reveal/hide password I add a button on the configure user interface to reveal the password for 2 seconds and hide it after that period. See #442 I am not sure if the fallback unicode text for the icon is correct. I can not make it work. --- app/Models/Themes.php | 1 + app/views/configure/users.phtml | 2 ++ p/scripts/main.js | 12 ++++++++++++ p/themes/icons/key.svg | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 p/themes/icons/key.svg (limited to 'p/scripts') diff --git a/app/Models/Themes.php b/app/Models/Themes.php index c7099a1df..ed746b7e9 100644 --- a/app/Models/Themes.php +++ b/app/Models/Themes.php @@ -77,6 +77,7 @@ class FreshRSS_Themes extends Minz_Model { 'down' => '▽', 'favorite' => '★', 'help' => 'ⓘ', + 'key' => '⚿', 'link' => '↗', 'login' => '🔒', 'logout' => '🔓', diff --git a/app/views/configure/users.phtml b/app/views/configure/users.phtml index 1a02b0e90..fdc94cd18 100644 --- a/app/views/configure/users.phtml +++ b/app/views/configure/users.phtml @@ -21,6 +21,7 @@
    /> +
    @@ -178,6 +179,7 @@
    +
    diff --git a/p/scripts/main.js b/p/scripts/main.js index 799d46625..57618c29b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -998,6 +998,17 @@ function init_feed_observers() { }); }; +function init_password_observers() { + $('input[type="password"] + a.btn.toggle-password').on('click', function(e){ + e.preventDefault(); + var passwordField = $(this).siblings('input[type="password"]'); + passwordField.attr('type','text'); + setTimeout(function(){ + passwordField.attr('type','password'); + },2000); + }); +}; + function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { if (window.console) { @@ -1030,6 +1041,7 @@ function init_all() { } else { init_share_observers(); init_feed_observers(); + init_password_observers(); } if (window.console) { diff --git a/p/themes/icons/key.svg b/p/themes/icons/key.svg new file mode 100644 index 000000000..9193f4552 --- /dev/null +++ b/p/themes/icons/key.svg @@ -0,0 +1,7 @@ + + + + + + + -- cgit v1.2.3 From 19fb901cb417c13be0ac3019d1bb1e7b09d08b37 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 15 Mar 2014 15:08:44 +0100 Subject: Small corrections previous pull requests https://github.com/marienfressinaud/FreshRSS/issues/457 https://github.com/marienfressinaud/FreshRSS/pull/459 https://github.com/marienfressinaud/FreshRSS/issues/422 https://github.com/marienfressinaud/FreshRSS/pull/461 --- app/layout/layout.phtml | 8 ++++++-- app/views/helpers/view/rss_view.phtml | 2 +- p/scripts/main.js | 22 +++++++++++----------- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'p/scripts') diff --git a/app/layout/layout.phtml b/app/layout/layout.phtml index 1501df3c3..63255b54f 100644 --- a/app/layout/layout.phtml +++ b/app/layout/layout.phtml @@ -18,8 +18,12 @@ -rss_url)) { ?> - +url)) { + $rss_url = $this->url; + $rss_url['params']['output'] = 'rss'; +?> + diff --git a/app/views/helpers/view/rss_view.phtml b/app/views/helpers/view/rss_view.phtml index 620bf1388..2c6ca610b 100755 --- a/app/views/helpers/view/rss_view.phtml +++ b/app/views/helpers/view/rss_view.phtml @@ -6,7 +6,7 @@ rss_title); ?> GMT - + entries as $item) { ?> diff --git a/p/scripts/main.js b/p/scripts/main.js index bee56d1b3..a03be85eb 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -968,12 +968,12 @@ function init_print_action() { function init_share_observers() { shares = $('.form-group:not(".form-actions")').length; - $('.post').on('click', '.share.remove', function(e){ + $('.post').on('click', '.share.remove', function(e) { e.preventDefault(); $(this).parents('.form-group').remove(); }); - $('.share.add').on('click',function(e){ + $('.share.add').on('click', function(e) { e.preventDefault(); var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); @@ -984,10 +984,10 @@ function init_share_observers() { $(this).parents('.form-actions').before(row); shares++; }); -}; +} function init_feed_observers() { - $('select[id="category"]').on('change', function(){ + $('select[id="category"]').on('change', function() { var detail = $(this).parent('li').next('li'); if ($(this).val() === 'nc') { detail.show(); @@ -996,18 +996,18 @@ function init_feed_observers() { detail.hide(); } }); -}; +} function init_password_observers() { - $('input[type="password"] + a.btn.toggle-password').on('click', function(e){ + $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { e.preventDefault(); var passwordField = $(this).siblings('input[type="password"]'); - passwordField.attr('type','text'); - setTimeout(function(){ - passwordField.attr('type','password'); - },2000); + passwordField.attr('type', 'text'); + setTimeout(function() { + passwordField.attr('type', 'password'); + }, 2000); }); -}; +} function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { -- cgit v1.2.3