From b8fd3caf8306e8616fcb2f2c0add95b74c2ec024 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 14 Feb 2015 11:00:26 -0500 Subject: Harmonize share configuration view. Before, for shares that don't need options, only a button to remove it was visible. It was source of confusion for users. I changed the look of those shares by using the same layout as others (minus the help). As there is no configuration possible for the url, the field is disabled but it is possible to change the name of the share. See #787 --- 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 1be75bb12..7fb583d39 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1097,7 +1097,7 @@ function init_share_observers() { $('.share.add').on('click', function(e) { var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); - row = row.replace('##label##', opt.html(), 'g'); + row = row.replace('##label##', opt.html().trim(), 'g'); row = row.replace('##type##', opt.val(), 'g'); row = row.replace('##help##', opt.data('help'), 'g'); row = row.replace('##key##', shares, 'g'); -- cgit v1.2.3 From 6e7bdb1709deaa0a1e6e5f4de10139a1e653e500 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sun, 15 Feb 2015 18:18:28 -0500 Subject: Add a cleaning process in the auto-remove feature. Before, when the status change was too quick, sometimes, articles weren't removed from the view. Now they are removed by adding a statement that grabs past articles with specific properties and remove them. See #738 --- p/scripts/main.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 1be75bb12..b58d4de81 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -238,12 +238,7 @@ function toggleContent(new_active, old_active) { old_active.removeClass("active current"); new_active.addClass("current"); if (context['auto_remove_article'] && !old_active.hasClass('not_read')) { - var p = old_active.prev(); - var n = old_active.next(); - if (p.hasClass('day') && n.hasClass('day')) { - p.remove(); - } - old_active.remove(); + auto_remove(old_active); } } else { new_active.toggleClass('active'); @@ -258,7 +253,7 @@ function toggleContent(new_active, old_active) { if (context['sticky_post']) { var prev_article = new_active.prevAll('.flux'), - new_pos = new_active.position().top, + new_pos = new_active.position().top, old_scroll = $(box_to_move).scrollTop(); if (prev_article.length > 0 && new_pos - prev_article.position().top <= 150) { @@ -289,6 +284,16 @@ function toggleContent(new_active, old_active) { } } +function auto_remove(element) { + var p = element.prev(); + var n = element.next(); + if (p.hasClass('day') && n.hasClass('day')) { + p.remove(); + } + element.remove(); + $('#stream > .flux:not(.not_read):not(.active)').remove(); +} + function prev_entry() { var old_active = $(".flux.current"), new_active = old_active.length === 0 ? $(".flux:last") : old_active.prevAll(".flux:first"); @@ -683,7 +688,7 @@ function init_stream(divStream) { } var old_active = $(".flux.current"), new_active = $(this).parent(); - isCollapsed = true; + isCollapsed = true; if (e.target.tagName.toUpperCase() === 'A') { //Leave real links alone if (context['auto_mark_article']) { mark_read(new_active, true); @@ -696,12 +701,7 @@ function init_stream(divStream) { divStream.on('click', '.flux a.read', function () { var active = $(this).parents(".flux"); if (context['auto_remove_article'] && active.hasClass('not_read')) { - var p = active.prev(); - var n = active.next(); - if (p.hasClass('day') && n.hasClass('day')) { - p.remove(); - } - active.remove(); + auto_remove(active); } mark_read(active, false); return false; @@ -882,8 +882,8 @@ function notifs_html5_show(nb) { if (context['html5_notif_timeout'] !== 0){ setTimeout(function() { - notification.close(); - }, context['html5_notif_timeout'] * 1000); + notification.close(); + }, context['html5_notif_timeout'] * 1000); } } @@ -899,7 +899,7 @@ function init_notifs_html5() { function refreshUnreads() { $.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) { var isAll = $('.category.all.active').length > 0, - new_articles = false; + new_articles = false; $.each(data, function(feed_id, nbUnreads) { feed_id = 'f_' + feed_id; @@ -1195,7 +1195,7 @@ function faviconNbUnread(n) { function init_slider_observers() { var slider = $('#slider'), - closer = $('#close-slider'); + closer = $('#close-slider'); if (slider.length < 1) { return; } -- cgit v1.2.3 From dd4fb519be801254a8aa9baedb2a7f87dd608f2b Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 14 Mar 2015 09:43:08 -0400 Subject: Add an unsaved changes alert on config pages Before, you could leave a configuration page without knowing if you saved your changes or not. Now, there is an alert poping up if you have unsaved changes. It will ask you if you want to stay on the page and save your changes or leave the page and loose your changes. See #739 --- app/views/auth/index.phtml | 12 ++++++------ app/views/configure/archiving.phtml | 6 +++--- app/views/configure/display.phtml | 28 ++++++++++++++-------------- app/views/configure/queries.phtml | 1 + app/views/configure/reading.phtml | 34 +++++++++++++++++----------------- app/views/configure/sharing.phtml | 4 ++-- app/views/configure/shortcut.phtml | 28 ++++++++++++++-------------- p/scripts/main.js | 28 ++++++++++++++++++++++++++++ 8 files changed, 85 insertions(+), 56 deletions(-) (limited to 'p/scripts/main.js') diff --git a/app/views/auth/index.phtml b/app/views/auth/index.phtml index f7a862ac9..8e4df8c2c 100644 --- a/app/views/auth/index.phtml +++ b/app/views/auth/index.phtml @@ -9,7 +9,7 @@
- auth_type, array('form', 'persona', 'http_auth', 'none'))) { ?> @@ -25,7 +25,7 @@
@@ -35,7 +35,7 @@
@@ -45,7 +45,7 @@
@@ -58,7 +58,7 @@ token; ?>
/> + echo FreshRSS_Auth::accessNeedsAction() ? '' : ' disabled="disabled"'; ?> data-leave-validation=""/> array('output' => 'rss', 'token' => $token)), 'html', true); ?>
@@ -69,7 +69,7 @@
diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 875463137..52ee98a48 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -10,14 +10,14 @@
- +  
- ttl_default; ?>"> '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min', 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 02249bc55..91b0b8189 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -9,7 +9,7 @@
- @@ -24,7 +24,7 @@