From 38e3f792a4e7702b6a479470c9f61f460309c981 Mon Sep 17 00:00:00 2001 From: Patrick Crandol Date: Tue, 30 Oct 2018 14:15:50 -0400 Subject: reallow items kept unread to be interactive (#2085) Remove .keep_unread from classes that do nothing. --- 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 f96828048..92fa8db4c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -752,7 +752,7 @@ function init_shortcuts() { function init_stream(divStream) { divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle - if ($(e.target).closest('.keep_unread, .content, .item.website, .item.link, .dropdown-menu').length > 0) { + if ($(e.target).closest('.content, .item.website, .item.link, .dropdown-menu').length > 0) { return; } if (!context.sides_close_article && $(e.target).is('div.flux_content')) { -- cgit v1.2.3 From f3a88614ef4a2541ee29054124d62c0cdc78f485 Mon Sep 17 00:00:00 2001 From: Matt DeMoss Date: Sun, 18 Nov 2018 08:08:27 -0500 Subject: Add shortcuts for focusing next and previous without opening articles. (#1767) * add skipping option to toggleContent to use later for 'i' and 'o' hotkeys * in English config j,k are now 'open' and not 'skip', i,o are called 'focus .. without opening' --- app/i18n/en/conf.php | 13 +++++++--- app/views/configure/shortcut.phtml | 14 +++++++++++ app/views/helpers/javascript_vars.phtml | 2 ++ config-user.default.php | 2 ++ p/scripts/main.js | 43 +++++++++++++++++++++++++++------ 5 files changed, 62 insertions(+), 12 deletions(-) (limited to 'p/scripts/main.js') diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index bf494162d..5894c12b7 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -151,25 +151,30 @@ return array( 'auto_share_help' => 'If there is only one sharing mode, it is used. Otherwise, modes are accessible by their number.', 'close_dropdown' => 'Close menus', 'collapse_article' => 'Collapse', - 'first_article' => 'Skip to the first article', + 'first_article' => 'Open the first article', 'focus_search' => 'Access search box', 'global_view' => 'Switch to global view', 'help' => 'Display documentation', 'javascript' => 'JavaScript must be enabled in order to use shortcuts', - 'last_article' => 'Skip to the last article', + 'last_article' => 'Open the last article', 'load_more' => 'Load more articles', 'mark_favorite' => 'Mark as favourite', 'mark_read' => 'Mark as read', 'navigation' => 'Navigation', 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
With the "Alt" modifier, navigation shortcuts apply on categories.', - 'next_article' => 'Skip to the next article', + 'next_article' => 'Open the next article', + 'other_action' => 'Other actions', + 'previous_article' => 'Open the previous article', + 'next_article' => 'Open the next article', 'normal_view' => 'Switch to normal view', 'other_action' => 'Other actions', - 'previous_article' => 'Skip to the previous article', + 'previous_article' => 'Open the previous article', 'reading_view' => 'Switch to reading view', 'rss_view' => 'Open RSS view in a new tab', 'see_on_website' => 'See on original website', 'shift_for_all_read' => '+ shift to mark all articles as read', + 'skip_next_article' => 'Focus next without opening', + 'skip_previous_article' => 'Focus previous without opening', 'title' => 'Shortcuts', 'user_filter' => 'Access user queries', 'user_filter_help' => 'If there is only one user query, it is used. Otherwise, queries are accessible by their number.', diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 66db6a5d4..650c84df1 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -64,6 +64,20 @@ + +
+ +
+ +
+
+ +
+ +
+ +
+
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index d7b3e4360..a434a04a3 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -26,6 +26,8 @@ echo htmlspecialchars(json_encode(array( 'go_website' => @$s['go_website'], 'prev_entry' => @$s['prev_entry'], 'next_entry' => @$s['next_entry'], + 'skip_prev_entry' => @$s['skip_prev_entry'], + 'skip_next_entry' => @$s['skip_next_entry'], 'first_entry' => @$s['first_entry'], 'last_entry' => @$s['last_entry'], 'collapse_entry' => @$s['collapse_entry'], diff --git a/config-user.default.php b/config-user.default.php index 6aef0dc49..08f3af720 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -49,6 +49,8 @@ return array ( 'go_website' => 'space', 'next_entry' => 'j', 'prev_entry' => 'k', + 'skip_next_entry' => 'n', + 'skip_prev_entry' => 'p', 'first_entry' => 'home', 'last_entry' => 'end', 'collapse_entry' => 'c', diff --git a/p/scripts/main.js b/p/scripts/main.js index 92fa8db4c..43753417c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -237,12 +237,13 @@ function mark_favorite(active) { }); } -function toggleContent(new_active, old_active) { +function toggleContent(new_active, old_active, skipping = false) { + // If skipping, move current without activating or marking as read if (new_active.length === 0) { return; } - if (context.does_lazyload) { + if (context.does_lazyload && !skipping) { new_active.find('img[data-original], iframe[data-original]').each(function () { this.onload = function () { $(document.body).trigger("sticky_kit:recalc"); }; this.setAttribute('src', this.getAttribute('data-original')); @@ -251,15 +252,15 @@ function toggleContent(new_active, old_active) { } if (old_active[0] !== new_active[0]) { - if (isCollapsed) { + if (isCollapsed && !skipping) { // BUG?: isCollapsed can only ever be true new_active.addClass("active"); } old_active.removeClass("active current"); new_active.addClass("current"); - if (context.auto_remove_article && !old_active.hasClass('not_read')) { + if (context.auto_remove_article && !old_active.hasClass('not_read') && !skipping) { auto_remove(old_active); } - } else { + } else { // collapse_entry calls toggleContent(flux_current, flux_current) new_active.toggleClass('active'); } @@ -278,6 +279,10 @@ function toggleContent(new_active, old_active) { } } + if (skipping){ + // when skipping, this feels more natural if it's not so near the top + new_pos -= $(window).height()/4 + } if (context.hide_posts) { if (relative_move) { new_pos += old_scroll; @@ -295,7 +300,7 @@ function toggleContent(new_active, old_active) { } } - if (context.auto_mark_article && new_active.hasClass('active')) { + if (context.auto_mark_article && new_active.hasClass('active') && !skipping) { mark_read(new_active, true); } } @@ -313,13 +318,29 @@ function auto_remove(element) { function prev_entry() { var old_active = $(".flux.current"), new_active = old_active.length === 0 ? $(".flux:last") : old_active.prevAll(".flux:first"); - toggleContent(new_active, old_active); + toggleContent(new_active, old_active, false); } function next_entry() { var old_active = $(".flux.current"), new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); - toggleContent(new_active, old_active); + toggleContent(new_active, old_active, false); + + if (new_active.nextAll().length < 3) { + load_more_posts(); + } +} + +function skip_prev_entry() { + var old_active = $(".flux.current"), + new_active = old_active.length === 0 ? $(".flux:last") : old_active.prevAll(".flux:first"); + toggleContent(new_active, old_active, true); +} + +function skip_next_entry() { + var old_active = $(".flux.current"), + new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); + toggleContent(new_active, old_active, true); if (new_active.nextAll().length < 3) { load_more_posts(); @@ -637,6 +658,9 @@ function init_shortcuts() { shortcut.add(shortcuts.prev_entry, prev_entry, { 'disable_in_input': true }); + shortcut.add(shortcuts.skip_prev_entry, skip_prev_entry, { + 'disable_in_input': true + }); shortcut.add(shortcuts.first_entry, function () { var old_active = $(".flux.current"), first = $(".flux:first"); @@ -650,6 +674,9 @@ function init_shortcuts() { shortcut.add(shortcuts.next_entry, next_entry, { 'disable_in_input': true }); + shortcut.add(shortcuts.skip_next_entry, skip_next_entry, { + 'disable_in_input': true + }); shortcut.add(shortcuts.last_entry, function () { var old_active = $(".flux.current"), last = $(".flux:last"); -- cgit v1.2.3 From e20c7ef1b020df492923ca9a445fb8fa172a11dd Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Sun, 18 Nov 2018 19:31:36 +0100 Subject: [fix] Finishing touches for next/previous without focus (#2140) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [fix] Finishing touches for next/previous without focus Cf. #1767. * Avoid single quote Alternative: use `’` * Minor whitespace * Minor whitespace * be explicit about skipping * add todos * overshot by one --- app/i18n/cz/conf.php | 1 + app/i18n/de/conf.php | 1 + app/i18n/en/conf.php | 1 + app/i18n/es/conf.php | 1 + app/i18n/fr/conf.php | 1 + app/i18n/he/conf.php | 1 + app/i18n/it/conf.php | 1 + app/i18n/kr/conf.php | 1 + app/i18n/nl/conf.php | 1 + app/i18n/oc/conf.php | 1 + app/i18n/pt-br/conf.php | 1 + app/i18n/ru/conf.php | 1 + app/i18n/tr/conf.php | 1 + app/i18n/zh-cn/conf.php | 1 + app/views/configure/shortcut.phtml | 4 +++- p/scripts/main.js | 18 +++++++++--------- 16 files changed, 26 insertions(+), 10 deletions(-) (limited to 'p/scripts/main.js') diff --git a/app/i18n/cz/conf.php b/app/i18n/cz/conf.php index 0da2af39a..8df9d9f35 100644 --- a/app/i18n/cz/conf.php +++ b/app/i18n/cz/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Označit jako přečtené', 'navigation' => 'Navigace', 'navigation_help' => 'Pomocí přepínače "Shift" fungují navigační zkratky v rámci kanálů.
Pomocí přepínače "Alt" fungují v rámci kategorií.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Skočit na další článek', 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'Ostatní akce', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 01dddacfc..2f3122a8e 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Als gelesen markieren', 'navigation' => 'Navigation', 'navigation_help' => 'Mit der "Umschalttaste" finden die Tastenkombination auf Feeds Anwendung.
Mit der "Alt-Taste" finden die Tastenkombination auf Kategorien Anwendung.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Zum nächsten Artikel springen', 'normal_view' => 'Wechsle zur normalen Ansicht', 'other_action' => 'Andere Aktionen', diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 5894c12b7..c6471426f 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Mark as read', 'navigation' => 'Navigation', 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
With the "Alt" modifier, navigation shortcuts apply on categories.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', 'next_article' => 'Open the next article', 'other_action' => 'Other actions', 'previous_article' => 'Open the previous article', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 4585e4d60..a79bac555 100755 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Marcar como leído', 'navigation' => 'Navegación', 'navigation_help' => 'Con el modificador "Mayúsculas" es posible usar los atajos de teclado en las fuentes.
Con el modificador "Alt" es posible aplicar los atajos de teclado en las categorías.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Saltar al siguiente artículo', 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'Otras acciones', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 23000c3cf..f24bcab98 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Marquer comme lu', 'navigation' => 'Navigation', 'navigation_help' => 'Avec le modificateur "Shift", les raccourcis de navigation s’appliquent aux flux.
Avec le modificateur "Alt", les raccourcis de navigation s’appliquent aux catégories.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Passer à l’article suivant', 'normal_view' => 'Basculer vers la vue normale', 'other_action' => 'Autres actions', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index 83ba5cd04..c0ca06000 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'סימון כנקרא', 'navigation' => 'ניווט', 'navigation_help' => 'בעזרת מקש השיפט קיצורי דרך חלים על הזנות .
עם מקש האלט הם חלים על קטגוריות.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'דילוג למאמר הבא', 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'פעולות אחרות', diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index ef892cc8a..64bd50dfe 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Segna come letto', 'navigation' => 'Navigazione', 'navigation_help' => 'Con il tasto "Shift" i comandi di navigazione verranno applicati ai feeds.
Con il tasto "Alt" i comandi di navigazione verranno applicati alle categorie.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Salta al contenuto successivo', 'normal_view' => 'Switch to normal view', // TODO 'other_action' => 'Altre azioni', diff --git a/app/i18n/kr/conf.php b/app/i18n/kr/conf.php index ae34795ef..70996945d 100644 --- a/app/i18n/kr/conf.php +++ b/app/i18n/kr/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => '읽음으로 표시', 'navigation' => '탐색', 'navigation_help' => '"Shift" 키를 누른 상태에선 탐색 단축키가 피드에 적용됩니다.
"Alt" 키를 누른 상태에선 탐색 단축키가 카테고리에 적용됩니다.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => '다음 글 보기', 'normal_view' => '일반 모드로 전환', 'other_action' => '다른 동작', diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index f6f6f4bba..76fccfeaf 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Markeer als gelezen', 'navigation' => 'Navigatie', 'navigation_help' => 'Met de "Shift" toets, kunt u navigatie verwijzingen voor feeds gebruiken.
Met de "Alt" toets, kunt u navigatie verwijzingen voor categoriën gebruiken.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Spring naar volgende artikel', 'normal_view' => 'Schakel naar gewoon aanzicht', 'other_action' => 'Andere acties', diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index fff8689e0..7dc166a6d 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Marcar coma legit', 'navigation' => 'Navigacion', 'navigation_help' => 'Amb lo modificador «Shift», los acorchis de navigacion s’aplican als fluxes.
Amb lo modificador «Alt», los acorchis de navigacion s’aplican a las categorias.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Passar a l’article seguent', 'normal_view' => 'Passar a la vista normala', 'other_action' => 'Autras accions', diff --git a/app/i18n/pt-br/conf.php b/app/i18n/pt-br/conf.php index ae32bef72..6f908d251 100644 --- a/app/i18n/pt-br/conf.php +++ b/app/i18n/pt-br/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Marcar como lido', 'navigation' => 'Navegação', 'navigation_help' => 'Com o modificador "Shift", atalhos de navegação aplicam aos feeds.
Com o "Alt" modificador, atalhos de navegação aplicam as categorias.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Pule para o próximo artigo', 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'Outras ações', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 3fe0ded2d..a33e7e6d0 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -162,6 +162,7 @@ return array( 'mark_favorite' => 'Mark as favourite', //TODO - Translation 'navigation' => 'Navigation', //TODO - Translation 'navigation_help' => 'With the "Shift" modifier, navigation shortcuts apply on feeds.
With the "Alt" modifier, navigation shortcuts apply on categories.', //TODO - Translation + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Skip to the next article', //TODO - Translation 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'Other actions', //TODO - Translation diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index 526a28ba6..f3837ca97 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => 'Okundu olarak işaretle', 'navigation' => 'Genel eylemler', 'navigation_help' => '"Shift" tuşu ile kısayollar akışlar için geçerli olur.
"Alt" tuşu ile kısayollar kategoriler için geçerli olur.', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => 'Sonraki makaleye geç', 'normal_view' => 'Switch to normal view', //TODO - Translation 'other_action' => 'Diğer eylemler', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index 5b58e3626..c180443ac 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -162,6 +162,7 @@ return array( 'mark_read' => '设为已读', 'navigation' => '浏览', 'navigation_help' => '搭配 "Shift" 键,浏览快捷键将生效于 RSS 源。
搭配 "Alt" 键,浏览快捷键将生效于分类。', + 'navigation_no_mod_help' => 'The following navigation shortcuts do not support modifiers.', //TODO - Translation 'next_article' => '跳转到下一篇文章', 'normal_view' => '切换到普通视图', 'other_action' => '其他操作', diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index 650c84df1..70a274edd 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -64,7 +64,9 @@
- + +

+
diff --git a/p/scripts/main.js b/p/scripts/main.js index 43753417c..3f1fdf20e 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -237,7 +237,7 @@ function mark_favorite(active) { }); } -function toggleContent(new_active, old_active, skipping = false) { +function toggleContent(new_active, old_active, skipping) { // If skipping, move current without activating or marking as read if (new_active.length === 0) { return; @@ -252,7 +252,7 @@ function toggleContent(new_active, old_active, skipping = false) { } if (old_active[0] !== new_active[0]) { - if (isCollapsed && !skipping) { // BUG?: isCollapsed can only ever be true + if (isCollapsed && !skipping) { // BUG?: isCollapsed can only ever be true new_active.addClass("active"); } old_active.removeClass("active current"); @@ -260,7 +260,7 @@ function toggleContent(new_active, old_active, skipping = false) { if (context.auto_remove_article && !old_active.hasClass('not_read') && !skipping) { auto_remove(old_active); } - } else { // collapse_entry calls toggleContent(flux_current, flux_current) + } else { // collapse_entry calls toggleContent(flux_current, flux_current, false) new_active.toggleClass('active'); } @@ -279,9 +279,9 @@ function toggleContent(new_active, old_active, skipping = false) { } } - if (skipping){ + if (skipping) { // when skipping, this feels more natural if it's not so near the top - new_pos -= $(window).height()/4 + new_pos -= $(window).height() / 4; } if (context.hide_posts) { if (relative_move) { @@ -423,7 +423,7 @@ function last_category() { function collapse_entry() { var flux_current = $(".flux.current"); - toggleContent(flux_current, flux_current); + toggleContent(flux_current, flux_current, false); } function user_filter(key) { @@ -666,7 +666,7 @@ function init_shortcuts() { first = $(".flux:first"); if (first.hasClass("flux")) { - toggleContent(first, old_active); + toggleContent(first, old_active, false); } }, { 'disable_in_input': true @@ -682,7 +682,7 @@ function init_shortcuts() { last = $(".flux:last"); if (last.hasClass("flux")) { - toggleContent(last, old_active); + toggleContent(last, old_active, false); } }, { 'disable_in_input': true @@ -795,7 +795,7 @@ function init_stream(divStream) { } return true; } - toggleContent(new_active, old_active); + toggleContent(new_active, old_active, false); }); divStream.on('click', '.flux a.read', function () { -- cgit v1.2.3 From 5c8eb1e86498af03c73a0320bd3213c509e1c743 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 26 Nov 2018 08:32:04 +0100 Subject: Fix print for unfolded articles (#2148) Fix https://github.com/FreshRSS/FreshRSS/issues/2130 `.current` might not exist in views for which all articles are already expanded --- p/scripts/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 3f1fdf20e..343534826 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1301,13 +1301,13 @@ function init_confirm_action() { } function init_print_action() { - $('.item.share > a[href="#"]').click(function () { + $('.item.share > a[href="#"]').click(function (e) { var content = "" + - $(".flux.current .content").html() + + $(e.target).closest('.flux_content').find('.content').html() + ""; var tmp_window = window.open(); -- cgit v1.2.3 From 478d3e6611e73974bd3b917c625bf0d099cbf123 Mon Sep 17 00:00:00 2001 From: Patrick Crandol Date: Wed, 12 Dec 2018 06:04:31 -0500 Subject: Decouple scrolling of feeds and articles (#2117) * Remove Sticky Kit Remove sticky-kit, as functionality is unsuitable for separate scrolling. * Remove sticky-kit load in main.js Further removing the sticky-kit kruft * Finish removal of references to Sticky-kit * CSS Changes to template for Independent Scrolling * Addition of JS and supporting CSS and html * More CSS fixes to establish expected behavior Should be able to scroll navbar without it being in sticky mode now. * Fix typo in main.js sortcut.js -> shortcut.js * Fix unexpected tree scrolling behavior * Change name of generic JS function * Improve sticky-aside * CSS changes in themes to accommodate independent Scroll In themes where .aside's width is not the standard 300px, .tree's width must be specified to be equal to .aside * Remove Sticky-Kit from README files * Updates to Sticky-Aside * Update Template to fix screwup * Make Recalculating height actually work * Let sidebar fill height if nav buttons aren't visible * Make accommodating for nav buttons actually work * update Swage theme for Independent Scroll feature * Integrate sticky_aside into main.js * Add Simple Scrollbar * Patch scrollbar color for themes with dark colored asides * Increase Visibility of scrollbar on Dark Themes * Improve async loading, events, and performance * CSS typo * Fix double scrollbar on mobile * Fix regression causing sticky to not be removed * No $ for non-jQuery variables * Fix strange condition + option for nice scrollbar * Initial attempt to use css sticky * Add stickyfill * make the correct element sticky * re-add incorrectly removed sidebar code * Continue fixing mistaken deletions * decrease frequency of recalc * use minified version of simple-scrollbar. * Load stickyfill instead of injecting * put recalc back where it belongs * re-remove script injector * remove padding bottom padding was causing the last item in the feed to be hidden under the nav buttons * Manual merge of css_scrollbar Add auto-detection of -webkit-scrollbar-thumb, otherwise fall back to simple-scrollbar.js * Fix Regression Sticky recalc is still needed when using css scrollbars * Replace method of closing dropdowns Changed from an overlay href to a javascript solution, for better compatibility * Remove Treepadding Treepadding was causing dropdown menus at the bottom of the tree to be obscured. * Undo unnecessary move of dropdown-target * Move Dropdown Handler to a sensibleish place * Fix light Scrollbar color not picking up on Firefox * Minor syntax * Minor Clarification of CSS/ patch BlueLagoon * Change logic for native WebKit scrollbar detection Fix https://github.com/FreshRSS/FreshRSS/pull/2117#issuecomment-444251419 Tested with Firefox 63, Firefox 65, Chrome 71, IE11, Edge 42 * Fixes for other views E.g. reader view * Cleaner way of generating hash for dropdowns * Make dropdown-toggle an actual toggle * Prepare for CSS Scrollbars Module Level 1 * Fix regression causing my labels dropdown not to appear * remove unneeded dropdown-close css rule * Re-apply some lost changes https://github.com/FreshRSS/FreshRSS/pull/2117/commits/3c509989e890b88852e52c67c1c5507d1e0bf28c * Add standard scrollbar compatibility E.g. Firefox 64+ * Make All dropdowns click-to-close * Remove BlueLagoon template * Try to fix Firefox https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r239539984 * Add CSS rules necessary for consistent function of scrollbar in Firefox * Use inheritance to determine width * Use overlay scrollbar where possible * Test Reduced Listener * Fix Firefox 62 And show subtle scrollbar even when not hovering * Add margin at bottom To allow opening the menus https://github.com/FreshRSS/FreshRSS/pull/2117#issuecomment-444571218 * Minor - tab correction * Spaces -> tabs * Remove unneeded inheritance * Fix indenting * Revert bad merge * Messy WIP to make dropdowns work * Style Cleanup * Break it down * Lets try a move-it move-it * Update p/scripts/main.js Co-Authored-By: pattems * Update p/themes/BlueLagoon/BlueLagoon.css Co-Authored-By: pattems * separate ALL THE THINGS * erroneous commas * and to or * removing double condition that doesn't do what I want * More breaking down * fix var * Fix variable name again * Remove magic number https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240052598 * Suuuuper inelegant solution for dropdowns * lets try that again * Inelegant Fix For Dropdowns Now with 100% more working dropdowns * Make sidebar dropdowns work correctly? * Fix reversion * Make JS scrollbar always visible * Remove unneeded CSS Added early in this pull request, didn't get pulled out when it was obsolete * Fix CSS removal I missed * CSS comment update/consistency for dark themes * Clean Up Duplicate code * Make dropdowns properly hide Downside: Can no longer click on header/nav buttons to close * Strip unneeded if statement * jshint -W018 https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240392851 * Half-reversion to old dropdown * make overlay href scale to sidebar width * remove init of nonexistent method * remove trailing tabs * move #close href where it belongs in index.phtml * Revert all changes to index.phtml * remove whitespace accidentally added in last commit * Move var's in init_column categories * Finish putting old style dropdowns back * Make CSS changes to use support statements * Cleanup Whitespace * re-add missing class * spaces -> tabs in main.js * tabs -> spaces css * Minor whitespace * Cleanup per @Alkarex * Second attempt to add bottom margin https://github.com/FreshRSS/FreshRSS/pull/2117#discussion_r240820901 * Fix error in IE11 * Simple-scrollbar color match for dark themes --- README.fr.md | 4 +- README.md | 6 +- app/layout/aside_feed.phtml | 3 +- p/scripts/jquery.sticky-kit.min.js | 9 --- p/scripts/main.js | 116 +++++++++++++++++++++++------------ p/scripts/simple-scrollbar.min.js | 2 + p/themes/BlueLagoon/BlueLagoon.css | 26 ++++++++ p/themes/Dark/dark.css | 25 ++++++++ p/themes/Flat/flat.css | 25 ++++++++ p/themes/Screwdriver/screwdriver.css | 25 ++++++++ p/themes/Swage/swage.css | 26 ++++++++ p/themes/Swage/swage.scss | 38 ++++++++++-- p/themes/base-theme/template.css | 99 +++++++++++++++++++++++++++--- 13 files changed, 338 insertions(+), 66 deletions(-) delete mode 100644 p/scripts/jquery.sticky-kit.min.js create mode 100644 p/scripts/simple-scrollbar.min.js (limited to 'p/scripts/main.js') diff --git a/README.fr.md b/README.fr.md index 312fbac45..a8a8f87ff 100644 --- a/README.fr.md +++ b/README.fr.md @@ -192,13 +192,13 @@ Tout client supportant une API de type Fever ; Sélection : * [php-http-304](https://alexandre.alapetite.fr/doc-alex/php-http-304/) * [jQuery](https://jquery.com/) * [lib_opml](https://github.com/marienfressinaud/lib_opml) -* [jQuery Plugin Sticky-Kit](https://leafo.net/sticky-kit/) * [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) * [flotr2](http://www.humblesoftware.com/flotr2) -## Uniquement pour certaines options +## Uniquement pour certaines options ou configurations * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](https://github.com/phpquery/phpquery) +* [simple-scrollbar](https://github.com/buzinas/simple-scrollbar) ## Si les fonctions natives ne sont pas disponibles * [Services_JSON](https://pear.php.net/pepr/pepr-proposal-show.php?id=198) diff --git a/README.md b/README.md index 1e86d9f57..d6e13851e 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ FreshRSS comes with absolutely no warranty. More detailed information about installation and server configuration can be found in [our documentation](https://freshrss.github.io/FreshRSS/en/admins/02_Installation.html). -## Automated install +## Automated install * [![Docker](https://www.docker.com/sites/default/files/horizontal.png)](./Docker/) * [![YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=freshrss) * [![Cloudron](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.freshrss.cloudronapp) @@ -199,13 +199,13 @@ Supported clients are: * [php-http-304](https://alexandre.alapetite.fr/doc-alex/php-http-304/) * [jQuery](https://jquery.com/) * [lib_opml](https://github.com/marienfressinaud/lib_opml) -* [jQuery Plugin Sticky-Kit](https://leafo.net/sticky-kit/) * [keyboard_shortcuts](http://www.openjs.com/scripts/events/keyboard_shortcuts/) * [flotr2](http://www.humblesoftware.com/flotr2) -## Only for some options +## Only for some options or configurations * [bcrypt.js](https://github.com/dcodeIO/bcrypt.js) * [phpQuery](https://github.com/phpquery/phpquery) +* [simple-scrollbar](https://github.com/buzinas/simple-scrollbar) ## If native functions are not available * [Services_JSON](https://pear.php.net/pepr/pepr-proposal-show.php?id=198) diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 7b1645ebd..73b200686 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -21,7 +21,7 @@
-
    +
diff --git a/p/scripts/jquery.sticky-kit.min.js b/p/scripts/jquery.sticky-kit.min.js deleted file mode 100644 index e2a3c6de9..000000000 --- a/p/scripts/jquery.sticky-kit.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* - Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net -*/ -(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); -if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, -u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), -a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", -y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n +var sidebar = document.getElementById('sidebar'); +var useJsScrollbar = true; +try { + /*jshint -W018 */ + useJsScrollbar = sidebar && !CSS.supports('scrollbar-color: auto') && + !(parseInt(getComputedStyle(sidebar, '::-webkit-scrollbar').width) < sidebar.offsetWidth); + /*jshint +W018 */ +} catch (ex) { +} +if (useJsScrollbar) { + inject_script('simple-scrollbar.min.js'); +} + +function sticky_recalc() { + var h = 0; + if ($nav_entries && $nav_entries.length > 0) { + h = $(window).height() - sidebar.getBoundingClientRect().top - $nav_entries.height(); + } else { + h = $(window).height() - sidebar.getBoundingClientRect().top; + } + if (h > 0) { + $(sidebar).height(h); + } +} + +function init_simple_scrollbar() { + if (!window.SimpleScrollbar) { + if (window.console) { + console.log('FreshRSS waiting for simple-scrollbar…'); + } + window.setTimeout(init_simple_scrollbar, 100); + } else { + SimpleScrollbar.initEl(sidebar); + } +} +var scrollTimeout; +function init_sticky_sidebar(){ + if (!sidebar) { + return; + } + if (useJsScrollbar) { + init_simple_scrollbar(); + } + $(window).scroll(function () { + if (scrollTimeout) { + clearTimeout(scrollTimeout); + scrollTimeout = null; + } + scrollTimeout = setTimeout(sticky_recalc, 200); + }); + window.onresize = sticky_recalc; +} function init_confirm_action() { $('body').on('click', '.confirm', function () { @@ -1536,7 +1576,6 @@ function init_beforeDOM() { return; } if (['normal', 'reader', 'global'].indexOf(context.current_view) >= 0) { - inject_script('jquery.sticky-kit.min.js'); init_normal(); } } @@ -1554,6 +1593,7 @@ function init_afterDOM() { $stream = $('#stream'); if ($stream.length > 0) { init_load_more($stream); + init_sticky_sidebar(); init_posts(); init_nav_entries(); init_dynamic_tags(); diff --git a/p/scripts/simple-scrollbar.min.js b/p/scripts/simple-scrollbar.min.js new file mode 100644 index 000000000..36b7df0b8 --- /dev/null +++ b/p/scripts/simple-scrollbar.min.js @@ -0,0 +1,2 @@ +// https://github.com/buzinas/simple-scrollbar +!function(t,e){"object"==typeof exports?module.exports=e(window,document):t.SimpleScrollbar=e(window,document)}(this,function(t,e){function s(t){Object.prototype.hasOwnProperty.call(t,"data-simple-scrollbar")||Object.defineProperty(t,"data-simple-scrollbar",{value:new o(t)})}function i(t,s){function i(t){var e=t.pageY-a;a=t.pageY,n(function(){s.el.scrollTop+=e/s.scrollRatio})}function r(){t.classList.remove("ss-grabbed"),e.body.classList.remove("ss-grabbed"),e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",r)}var a;t.addEventListener("mousedown",function(s){return a=s.pageY,t.classList.add("ss-grabbed"),e.body.classList.add("ss-grabbed"),e.addEventListener("mousemove",i),e.addEventListener("mouseup",r),!1})}function r(t){for(this.target=t,this.direction=window.getComputedStyle(this.target).direction,this.bar='
',this.wrapper=e.createElement("div"),this.wrapper.setAttribute("class","ss-wrapper"),this.el=e.createElement("div"),this.el.setAttribute("class","ss-content"),"rtl"===this.direction&&this.el.classList.add("rtl"),this.wrapper.appendChild(this.el);this.target.firstChild;)this.el.appendChild(this.target.firstChild);this.target.appendChild(this.wrapper),this.target.insertAdjacentHTML("beforeend",this.bar),this.bar=this.target.lastChild,i(this.bar,this),this.moveBar(),this.el.addEventListener("scroll",this.moveBar.bind(this)),this.el.addEventListener("mouseenter",this.moveBar.bind(this)),this.target.classList.add("ss-container");var s=window.getComputedStyle(t);"0px"===s.height&&"0px"!==s["max-height"]&&(t.style.height=s["max-height"])}function a(){for(var t=e.querySelectorAll("*[ss-container]"),i=0;i=1?i.bar.classList.add("ss-hidden"):(i.bar.classList.remove("ss-hidden"),i.bar.style.cssText="height:"+Math.max(100*i.scrollRatio,10)+"%; top:"+i.el.scrollTop/e*100+"%;right:"+a+"px;")})}},e.addEventListener("DOMContentLoaded",a),r.initEl=s,r.initAll=a;var o=r;return o}); \ No newline at end of file diff --git a/p/themes/BlueLagoon/BlueLagoon.css b/p/themes/BlueLagoon/BlueLagoon.css index f167f2051..263764a9c 100644 --- a/p/themes/BlueLagoon/BlueLagoon.css +++ b/p/themes/BlueLagoon/BlueLagoon.css @@ -564,6 +564,32 @@ a.btn { color: #0090FF } +/*=== Scrollbar */ + +@supports (scrollbar-width: thin) { + #sidebar { + scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); + } + #sidebar:hover { + scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); + } +} +.ss-scroll { + background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(255, 255, 255, 0.3); +} +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } +} + /*=== STRUCTURE */ /*===============*/ /*=== Header */ diff --git a/p/themes/Dark/dark.css b/p/themes/Dark/dark.css index 31ff514a2..b8366caeb 100644 --- a/p/themes/Dark/dark.css +++ b/p/themes/Dark/dark.css @@ -502,6 +502,31 @@ a.btn { color: #888; } +/*=== Scrollbar */ +@supports (scrollbar-width: thin) { + #sidebar { + scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); + } + #sidebar:hover { + scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); + } +} +.ss-scroll { + background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(255, 255, 255, 0.3); +} +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } +} + /*=== STRUCTURE */ /*===============*/ /*=== Header */ diff --git a/p/themes/Flat/flat.css b/p/themes/Flat/flat.css index be047a394..176a541f7 100644 --- a/p/themes/Flat/flat.css +++ b/p/themes/Flat/flat.css @@ -505,6 +505,31 @@ a.btn { color: #fff; } +/*=== Scrollbar */ +@supports (scrollbar-width: thin) { + #sidebar { + scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); + } + #sidebar:hover { + scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); + } +} +.ss-scroll { + background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(255, 255, 255, 0.3); +} +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } +} + /*=== STRUCTURE */ /*===============*/ /*=== Header */ diff --git a/p/themes/Screwdriver/screwdriver.css b/p/themes/Screwdriver/screwdriver.css index 1bc49c2db..b92dbac3e 100644 --- a/p/themes/Screwdriver/screwdriver.css +++ b/p/themes/Screwdriver/screwdriver.css @@ -559,6 +559,31 @@ a.btn { .tree-folder-items > .item.active > a { } +/*=== Scrollbar */ +@supports (scrollbar-width: thin) { + #sidebar { + scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); + } + #sidebar:hover { + scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); + } +} +.ss-scroll { + background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(255, 255, 255, 0.3); +} +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } +} + /*=== STRUCTURE */ /*===============*/ /*=== Header */ diff --git a/p/themes/Swage/swage.css b/p/themes/Swage/swage.css index 8f262da8c..a8ff0bdd5 100644 --- a/p/themes/Swage/swage.css +++ b/p/themes/Swage/swage.css @@ -529,6 +529,32 @@ text-decoration: none; color: #FCFCFC; } +@supports (scrollbar-width: thin) { + #sidebar { +scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); +} +#sidebar:hover { +scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); +} +} + +.ss-scroll { +background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { +background: rgba(255, 255, 255, 0.3); +} + +@supports not (scrollbar-width: thin) { +#sidebar::-webkit-scrollbar-thumb { +background: rgba(255, 255, 255, 0.1); +} +#sidebar:hover::-webkit-scrollbar-thumb { +background: rgba(255, 255, 255, 0.3); +} +} + .header > .item { vertical-align: middle; } diff --git a/p/themes/Swage/swage.scss b/p/themes/Swage/swage.scss index c0c76cf14..8ddac14db 100644 --- a/p/themes/Swage/swage.scss +++ b/p/themes/Swage/swage.scss @@ -351,7 +351,7 @@ form { > a { min-width: initial; white-space: nowrap; - } + } &:hover { background: $color_nav; color: $color_light; @@ -603,6 +603,32 @@ form { } } +@supports (scrollbar-width: thin) { + #sidebar { + scrollbar-color: rgba(255, 255, 255, 0.05) rgba(0, 0, 0, 0.0); + } + #sidebar:hover { + scrollbar-color: rgba(255, 255, 255, 0.3) rgba(0, 0, 0, 0.0); + } +} + +.ss-scroll { + background: rgba(255, 255, 255, 0.1); +} +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(255, 255, 255, 0.3); +} + +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.3); + } +} + .header { > .item { vertical-align: middle; @@ -918,7 +944,7 @@ form { #global { height: 0; } - + .header { height: 55px; background: $color_aside; @@ -936,7 +962,7 @@ form { color: $color_light; padding-left: 5px; } - + input { border-left: 5px solid; border-right: 1px darken( $color_light, 10%); @@ -984,7 +1010,7 @@ form { .dropdown-header, .dropdown-menu > .item { padding: 12px; } - + #new-article { width: 100%; bottom: initial; @@ -1207,5 +1233,5 @@ button.as-link { background: inital; } } - -} \ No newline at end of file + +} diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index fdc2f884e..60c4822ef 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -109,7 +109,7 @@ input[type="checkbox"] { min-height: 15px !important; } .dropdown-menu label > input[type="text"] { - with: 150px; + width: 150px; width: calc(99% - 5em); } .dropdown-menu input[type="checkbox"] { @@ -168,6 +168,13 @@ td.numeric { display: block; } +@supports (position: sticky) { + #mark-read-aside { + position: sticky; + top: 0; + } +} + /*=== Buttons */ .stick { display: inline-block; @@ -273,6 +280,7 @@ a.btn { left: 0; right: 0; display: block; z-index: -10; + cursor: default; } .separator { display: block; @@ -373,16 +381,90 @@ a.btn { cursor: grab; } +/*=== Scrollbar */ +.ss-wrapper { + overflow: hidden; + width: 100%; + height: 100%; + position: relative; + z-index: 1; + float: left; +} + +.ss-content { + height: 100%; + width: calc(100% + 18px); + padding: 0 0 0 0; + position: relative; + overflow-y: scroll; + box-sizing: border-box; +} + +.ss-content.rtl { + width: calc(100% + 18px); + right: auto; +} + +.ss-scroll { + position: relative; + background: rgba(0, 0, 0, 0.1); + width: 9px; + border-radius: 4px; + top: 0; + z-index: 2; + cursor: pointer; + transition: opacity 0.25s linear; +} + +.ss-hidden { + display: none; +} + +.ss-container:hover .ss-scroll, +.ss-container:active .ss-scroll { + background: rgba(0, 0, 0, 0.3); +} + +.ss-grabbed { + -o-user-select: none; + -ms-user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +@supports (scrollbar-width: thin) { + #sidebar { + overflow-y: scroll; + scrollbar-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.05); + scrollbar-width: thin; + } + #sidebar:hover { + scrollbar-color: rgba(0, 0, 0, 0.3) rgba(0, 0, 0, 0.05); + } +} + +@supports not (scrollbar-width: thin) { + #sidebar::-webkit-scrollbar { + background: rgba(0, 0, 0, 0.05); + width: 8px; + } + #sidebar::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.1); + border-radius: 5px; + display: unset; + } + #sidebar:hover::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.3); + } +} + /*=== Tree */ .tree { margin: 0; - padding: 0 0 2em 0; list-style: none; text-align: left; -} - -.treepadding { - padding: 0 0 15em 0; + overflow-x: hidden; } .tree-folder-items { @@ -412,6 +494,10 @@ a.btn { white-space: nowrap; text-overflow: ellipsis; } +.tree-bottom { + visibility: hidden; + margin-bottom: 15em; +} /*=== STRUCTURE */ /*===============*/ @@ -914,7 +1000,6 @@ pre.enclosure-description { } .aside:target { width: 90%; - overflow: auto; } .flux_header .item.website { -- cgit v1.2.3 From 983aa587ee71a83d21b17de29d2a26763b18292e Mon Sep 17 00:00:00 2001 From: Patrick Crandol Date: Sat, 15 Dec 2018 04:56:38 -0500 Subject: Add aside_feed to reader view (#2180) * Add Nav menu to reader mode At this point, it appears to be non-functional in reader mode. * Add aside_feed toggle to reader view * make init_column_categories work in reader view * Make sidebar links redirect to proper view * CSS to support toggleable sidebar in reader view * remove unneeded !important --- app/layout/aside_feed.phtml | 15 ++++++++------- app/layout/nav_menu.phtml | 2 +- app/views/index/reader.phtml | 1 + p/scripts/main.js | 2 +- p/themes/base-theme/template.css | 23 +++++++++++++++++++++++ 5 files changed, 34 insertions(+), 9 deletions(-) (limited to 'p/scripts/main.js') diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 73b200686..5efaa54d1 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -1,4 +1,5 @@ hide_read_feeds && FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && @@ -24,13 +25,13 @@
- name(); ?> + name(); ?> @@ -69,7 +70,7 @@
    • @@ -83,7 +84,7 @@
  • - ✇ name(); ?> + ✇ name(); ?> @@ -111,7 +112,7 @@