diff options
author | Richard Schneider <richard@schneiderbox.net> | 2020-01-07 00:02:02 -0600 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2020-01-06 22:02:02 -0800 |
commit | 6ebb29cd22f864842bd763828e914d172ce6f46b (patch) | |
tree | f463aa6757583c0cd61793565f14a4788f0ae952 | |
parent | e2315e6a54c93ff44f99482fae6a0931444dc27a (diff) |
Add comments link keyboard shortcut
-rw-r--r-- | locale/translations.go | 36 | ||||
-rw-r--r-- | locale/translations/de_DE.json | 2 | ||||
-rw-r--r-- | locale/translations/en_US.json | 2 | ||||
-rw-r--r-- | locale/translations/es_ES.json | 2 | ||||
-rw-r--r-- | locale/translations/fr_FR.json | 2 | ||||
-rw-r--r-- | locale/translations/it_IT.json | 2 | ||||
-rw-r--r-- | locale/translations/nl_NL.json | 2 | ||||
-rw-r--r-- | locale/translations/pl_PL.json | 2 | ||||
-rw-r--r-- | locale/translations/ru_RU.json | 2 | ||||
-rw-r--r-- | locale/translations/zh_CN.json | 2 | ||||
-rw-r--r-- | template/common.go | 11 | ||||
-rw-r--r-- | template/html/common/item_meta.html | 4 | ||||
-rw-r--r-- | template/html/common/layout.html | 2 | ||||
-rw-r--r-- | template/html/entry.html | 2 | ||||
-rw-r--r-- | template/views.go | 4 | ||||
-rw-r--r-- | ui/static/js.go | 6 | ||||
-rw-r--r-- | ui/static/js/app.js | 19 | ||||
-rw-r--r-- | ui/static/js/bootstrap.js | 2 |
18 files changed, 84 insertions, 20 deletions
diff --git a/locale/translations.go b/locale/translations.go index cd51330..4714097 100644 --- a/locale/translations.go +++ b/locale/translations.go @@ -136,6 +136,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Gewählten Artikel öffnen", "page.keyboard_shortcuts.open_original": "Original-Artikel öffnen", "page.keyboard_shortcuts.open_original_same_window": "Öffne den Original-Link in der aktuellen Registerkarte", + "page.keyboard_shortcuts.open_comments": "Kommentare öffnen", + "page.keyboard_shortcuts.open_comments_same_window": "Öffne den Kommentare-Link in der aktuellen Registerkarte", "page.keyboard_shortcuts.toggle_read_status": "Gewählten Artikel als gelesen/ungelesen markieren", "page.keyboard_shortcuts.mark_page_as_read": "Aktuelle Seite als gelesen markieren", "page.keyboard_shortcuts.download_content": "Vollständigen Inhalt herunterladen", @@ -443,6 +445,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Open selected item", "page.keyboard_shortcuts.open_original": "Open original link", "page.keyboard_shortcuts.open_original_same_window": "Open original link in current tab", + "page.keyboard_shortcuts.open_comments": "Open comments link", + "page.keyboard_shortcuts.open_comments_same_window": "Open comments link in current tab", "page.keyboard_shortcuts.toggle_read_status": "Toggle read/unread", "page.keyboard_shortcuts.mark_page_as_read": "Mark current page as read", "page.keyboard_shortcuts.download_content": "Download original content", @@ -730,6 +734,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Abrir el elemento seleccionado", "page.keyboard_shortcuts.open_original": "Abrir el enlace original", "page.keyboard_shortcuts.open_original_same_window": "Abrir enlace original en la pestaña actual", + "page.keyboard_shortcuts.open_comments": "Abrir el enlace de comentarios", + "page.keyboard_shortcuts.open_comments_same_window": "Abrir enlace de comentarios en la pestaña actual", "page.keyboard_shortcuts.toggle_read_status": "Marcar como leído o no leído", "page.keyboard_shortcuts.mark_page_as_read": "Marcar pagína actual como leída", "page.keyboard_shortcuts.download_content": "Descargar el contento original", @@ -1017,6 +1023,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Ouvrir élément sélectionné", "page.keyboard_shortcuts.open_original": "Ouvrir le lien original", "page.keyboard_shortcuts.open_original_same_window": "Ouvrir le lien original dans l'onglet en cours", + "page.keyboard_shortcuts.open_comments": "Ouvrir le lien des commentaires", + "page.keyboard_shortcuts.open_comments_same_window": "Ouvrir le lien des commentaires dans l'onglet en cours", "page.keyboard_shortcuts.toggle_read_status": "Basculer entre lu/non lu", "page.keyboard_shortcuts.mark_page_as_read": "Marquer la page actuelle comme lu", "page.keyboard_shortcuts.download_content": "Télécharger le contenu original", @@ -1324,6 +1332,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Apri l'articolo selezionato", "page.keyboard_shortcuts.open_original": "Apri la pagina web originale", "page.keyboard_shortcuts.open_original_same_window": "Apri il link originale nella scheda corrente", + "page.keyboard_shortcuts.open_comments": "Apri la pagina web dei commenti", + "page.keyboard_shortcuts.open_comments_same_window": "Apri il link dei commenti nella scheda corrente", "page.keyboard_shortcuts.toggle_read_status": "Cambia lo stato di lettura (letto/da leggere)", "page.keyboard_shortcuts.mark_page_as_read": "Segna la pagina attuale come letta", "page.keyboard_shortcuts.download_content": "Scarica il contenuto integrale", @@ -1612,6 +1622,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Open geselecteerde link", "page.keyboard_shortcuts.open_original": "Open originele link", "page.keyboard_shortcuts.open_original_same_window": "Oorspronkelijke koppeling op huidig tabblad openen", + "page.keyboard_shortcuts.open_comments": "Open opmerkingen link", + "page.keyboard_shortcuts.open_comments_same_window": "Open de reactiekoppeling op het huidige tabblad", "page.keyboard_shortcuts.toggle_read_status": "Markeer gelezen/ongelezen", "page.keyboard_shortcuts.mark_page_as_read": "Markeer deze pagina als gelezen", "page.keyboard_shortcuts.download_content": "Download originele content", @@ -1918,6 +1930,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Otwórz zaznaczony artykuł", "page.keyboard_shortcuts.open_original": "Otwórz oryginalny artykuł", "page.keyboard_shortcuts.open_original_same_window": "Otwórz oryginalny link w bieżącej karcie", + "page.keyboard_shortcuts.open_comments": "Otwórz link do komentarzy", + "page.keyboard_shortcuts.open_comments_same_window": "Otwórz link do komentarzy w bieżącej karcie", "page.keyboard_shortcuts.toggle_read_status": "Oznacz jako przeczytane/nieprzeczytane", "page.keyboard_shortcuts.mark_page_as_read": "Zaznacz aktualną stronę jako przeczytaną", "page.keyboard_shortcuts.download_content": "Pobierz oryginalną zawartość", @@ -2231,6 +2245,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "Открыть выбранный элемент", "page.keyboard_shortcuts.open_original_same_window": "Открыть оригинальную ссылку в текущей вкладке", "page.keyboard_shortcuts.open_original": "Открыть оригинальную ссылку", + "page.keyboard_shortcuts.open_comments_same_window": "Открыть ссылку на комментарии в текущей вкладке", + "page.keyboard_shortcuts.open_comments": "Открыть ссылку для комментариев", "page.keyboard_shortcuts.toggle_read_status": "Переключатель прочитанного", "page.keyboard_shortcuts.mark_page_as_read": "Отметить текущую страницу прочитанной", "page.keyboard_shortcuts.download_content": "Загрузить оригинальное содержимое", @@ -2522,6 +2538,8 @@ var translations = map[string]string{ "page.keyboard_shortcuts.open_item": "打开选定的条目", "page.keyboard_shortcuts.open_original": "打开原始链接", "page.keyboard_shortcuts.open_original_same_window": "在当前标签页中打开原始链接", + "page.keyboard_shortcuts.open_comments": "打开评论链接", + "page.keyboard_shortcuts.open_comments_same_window": "在当前标签页中打开评论链接", "page.keyboard_shortcuts.toggle_read_status": "切换已读/未读状态", "page.keyboard_shortcuts.mark_page_as_read": "标记当前页已读", "page.keyboard_shortcuts.download_content": "下载原始内容", @@ -2692,13 +2710,13 @@ var translations = map[string]string{ } var translationsChecksums = map[string]string{ - "de_DE": "b02e4b146458b740ef59978b47db321bf7fcf47f3eda79fc763560e80123ca2e", - "en_US": "91000303814fb62060f6605b2b6481550f3686f1e293f30ca3c5d77cc60ac467", - "es_ES": "01c0b685ed7e90852deca665a652eb426751be1af1e431fac66df8d3f6ab083c", - "fr_FR": "3f2394d5c3e3a3e849f3fdf64ae519409d73cf27094cf06cb8ab1e4090d31b2a", - "it_IT": "17563329ba60a365351155492ebe120ff6942e8cf7dd9a56304027bc0957008e", - "nl_NL": "bd0a01c49b7fa34cdcbda9b9743c292178afdd024f2acb97ce863617faddbea2", - "pl_PL": "d5f75a944522d03c64e95d21f1c80004464c8b2de75dae649d7216154467b511", - "ru_RU": "2716429c2bdb6a417d464d313e5b4a1820884129c5d85d75bf1884945decfbcb", - "zh_CN": "9c6cc04f821c7570a738f81b57c4b98ae58151affff31476dd150a01111f94f3", + "de_DE": "48a150c0d6c13f1d75e51f9c68c04c70c272674c6acdfed2d6667cfaca2b01db", + "en_US": "84eb60749bf7d5ce8e9f51af573584f66faf79af98f43f422515d34a963a9f68", + "es_ES": "186adde92917b7ebedea6cb0e8532f3e548ca47931270fb8fb3d84f832854657", + "fr_FR": "679abce075ab70ccb61f17be8f3e75a6bbb68cd20afb945cb238d97e483bedde", + "it_IT": "fcc5285b1e2866219e6de1aba59f37426ddaa48ebe83a880bb23dd92e52358c6", + "nl_NL": "11b80c1461d3d089c864748e738422552c878ffcb2b1e95b9e9abe238c42a85b", + "pl_PL": "2cb075ac066add7ec59c25970a91e78fc0cb940ffb47995cc4faafc0123ffed6", + "ru_RU": "b88acde2af7fbf76259b700f5a0bac7b5500db71add53b8b7ae638f7127c2dff", + "zh_CN": "0400139a88fce1650863e4ddcdfe9bf6c7cf11e5c16a74936ce3529b3e7ef681", } diff --git a/locale/translations/de_DE.json b/locale/translations/de_DE.json index e316436..b3bc3a4 100644 --- a/locale/translations/de_DE.json +++ b/locale/translations/de_DE.json @@ -131,6 +131,8 @@ "page.keyboard_shortcuts.open_item": "Gewählten Artikel öffnen", "page.keyboard_shortcuts.open_original": "Original-Artikel öffnen", "page.keyboard_shortcuts.open_original_same_window": "Öffne den Original-Link in der aktuellen Registerkarte", + "page.keyboard_shortcuts.open_comments": "Kommentare öffnen", + "page.keyboard_shortcuts.open_comments_same_window": "Öffne den Kommentare-Link in der aktuellen Registerkarte", "page.keyboard_shortcuts.toggle_read_status": "Gewählten Artikel als gelesen/ungelesen markieren", "page.keyboard_shortcuts.mark_page_as_read": "Aktuelle Seite als gelesen markieren", "page.keyboard_shortcuts.download_content": "Vollständigen Inhalt herunterladen", diff --git a/locale/translations/en_US.json b/locale/translations/en_US.json index 5e20a2f..7f7aaee 100644 --- a/locale/translations/en_US.json +++ b/locale/translations/en_US.json @@ -131,6 +131,8 @@ "page.keyboard_shortcuts.open_item": "Open selected item", "page.keyboard_shortcuts.open_original": "Open original link", "page.keyboard_shortcuts.open_original_same_window": "Open original link in current tab", + "page.keyboard_shortcuts.open_comments": "Open comments link", + "page.keyboard_shortcuts.open_comments_same_window": "Open comments link in current tab", "page.keyboard_shortcuts.toggle_read_status": "Toggle read/unread", "page.keyboard_shortcuts.mark_page_as_read": "Mark current page as read", "page.keyboard_shortcuts.download_content": "Download original content", diff --git a/locale/translations/es_ES.json b/locale/translations/es_ES.json index 422a785..ffb27e6 100644 --- a/locale/translations/es_ES.json +++ b/locale/translations/es_ES.json @@ -131,6 +131,8 @@ "page.keyboard_shortcuts.open_item": "Abrir el elemento seleccionado", "page.keyboard_shortcuts.open_original": "Abrir el enlace original", "page.keyboard_shortcuts.open_original_same_window": "Abrir enlace original en la pestaña actual", + "page.keyboard_shortcuts.open_comments": "Abrir el enlace de comentarios", + "page.keyboard_shortcuts.open_comments_same_window": "Abrir enlace de comentarios en la pestaña actual", "page.keyboard_shortcuts.toggle_read_status": "Marcar como leído o no leído", "page.keyboard_shortcuts.mark_page_as_read": "Marcar pagína actual como leída", "page.keyboard_shortcuts.download_content": "Descargar el contento original", diff --git a/locale/translations/fr_FR.json b/locale/translations/fr_FR.json index ecfac52..18e1ea1 100644 --- a/locale/translations/fr_FR.json +++ b/locale/translations/fr_FR.json @@ -131,6 +131,8 @@ "page.keyboard_shortcuts.open_item": "Ouvrir élément sélectionné", "page.keyboard_shortcuts.open_original": "Ouvrir le lien original", "page.keyboard_shortcuts.open_original_same_window": "Ouvrir le lien original dans l'onglet en cours", + "page.keyboard_shortcuts.open_comments": "Ouvrir le lien des commentaires", + "page.keyboard_shortcuts.open_comments_same_window": "Ouvrir le lien des commentaires dans l'onglet en cours", "page.keyboard_shortcuts.toggle_read_status": "Basculer entre lu/non lu", "page.keyboard_shortcuts.mark_page_as_read": "Marquer la page actuelle comme lu", "page.keyboard_shortcuts.download_content": "Télécharger le contenu original", diff --git a/locale/translations/it_IT.json b/locale/translations/it_IT.json index 9b3f69c..9597717 100644 --- a/locale/translations/it_IT.json +++ b/locale/translations/it_IT.json @@ -131,6 +131,8 @@ "page.keyboard_shortcuts.open_item": "Apri l'articolo selezionato", "page.keyboard_shortcuts.open_original": "Apri la pagina web originale", "page.keyboard_shortcuts.open_original_same_window": "Apri il link originale nella scheda corrente", + "page.keyboard_shortcuts.open_comments": "Apri la pagina web dei commenti", + "page.keyboard_shortcuts.open_comments_same_window": "Apri il link dei commenti nella scheda corrente", "page.keyboard_shortcuts.toggle_read_status": "Cambia lo stato di lettura (letto/da leggere)", "page.keyboard_shortcuts.mark_page_as_read": "Segna la pagina attuale come letta", "page.keyboard_shortcuts.download_content": "Scarica il contenuto integrale", diff --git a/locale/translations/nl_NL.json b/locale/translations/nl_NL.json index d071b4b..f8add75 100644 --- a/locale/translations/nl_NL.json +++ b/locale/translations/nl_NL.json @@ -132,6 +132,8 @@ "page.keyboard_shortcuts.open_item": "Open geselecteerde link", "page.keyboard_shortcuts.open_original": "Open originele link", "page.keyboard_shortcuts.open_original_same_window": "Oorspronkelijke koppeling op huidig tabblad openen", + "page.keyboard_shortcuts.open_comments": "Open opmerkingen link", + "page.keyboard_shortcuts.open_comments_same_window": "Open de reactiekoppeling op het huidige tabblad", "page.keyboard_shortcuts.toggle_read_status": "Markeer gelezen/ongelezen", "page.keyboard_shortcuts.mark_page_as_read": "Markeer deze pagina als gelezen", "page.keyboard_shortcuts.download_content": "Download originele content", diff --git a/locale/translations/pl_PL.json b/locale/translations/pl_PL.json index 99c72ba..b3dcfde 100644 --- a/locale/translations/pl_PL.json +++ b/locale/translations/pl_PL.json @@ -133,6 +133,8 @@ "page.keyboard_shortcuts.open_item": "Otwórz zaznaczony artykuł", "page.keyboard_shortcuts.open_original": "Otwórz oryginalny artykuł", "page.keyboard_shortcuts.open_original_same_window": "Otwórz oryginalny link w bieżącej karcie", + "page.keyboard_shortcuts.open_comments": "Otwórz link do komentarzy", + "page.keyboard_shortcuts.open_comments_same_window": "Otwórz link do komentarzy w bieżącej karcie", "page.keyboard_shortcuts.toggle_read_status": "Oznacz jako przeczytane/nieprzeczytane", "page.keyboard_shortcuts.mark_page_as_read": "Zaznacz aktualną stronę jako przeczytaną", "page.keyboard_shortcuts.download_content": "Pobierz oryginalną zawartość", diff --git a/locale/translations/ru_RU.json b/locale/translations/ru_RU.json index a8fb430..6c8ef3a 100644 --- a/locale/translations/ru_RU.json +++ b/locale/translations/ru_RU.json @@ -133,6 +133,8 @@ "page.keyboard_shortcuts.open_item": "Открыть выбранный элемент", "page.keyboard_shortcuts.open_original_same_window": "Открыть оригинальную ссылку в текущей вкладке", "page.keyboard_shortcuts.open_original": "Открыть оригинальную ссылку", + "page.keyboard_shortcuts.open_comments_same_window": "Открыть ссылку на комментарии в текущей вкладке", + "page.keyboard_shortcuts.open_comments": "Открыть ссылку для комментариев", "page.keyboard_shortcuts.toggle_read_status": "Переключатель прочитанного", "page.keyboard_shortcuts.mark_page_as_read": "Отметить текущую страницу прочитанной", "page.keyboard_shortcuts.download_content": "Загрузить оригинальное содержимое", diff --git a/locale/translations/zh_CN.json b/locale/translations/zh_CN.json index fddaf85..d0a6fb5 100644 --- a/locale/translations/zh_CN.json +++ b/locale/translations/zh_CN.json @@ -129,6 +129,8 @@ "page.keyboard_shortcuts.open_item": "打开选定的条目", "page.keyboard_shortcuts.open_original": "打开原始链接", "page.keyboard_shortcuts.open_original_same_window": "在当前标签页中打开原始链接", + "page.keyboard_shortcuts.open_comments": "打开评论链接", + "page.keyboard_shortcuts.open_comments_same_window": "在当前标签页中打开评论链接", "page.keyboard_shortcuts.toggle_read_status": "切换已读/未读状态", "page.keyboard_shortcuts.mark_page_as_read": "标记当前页已读", "page.keyboard_shortcuts.download_content": "下载原始内容", diff --git a/template/common.go b/template/common.go index ffd1329..4fae391 100644 --- a/template/common.go +++ b/template/common.go @@ -122,7 +122,7 @@ var templateCommonMap = map[string]string{ </li> {{ if .entry.CommentsURL }} <li> - <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "entry.comments.label" }}</a> + <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-comments-link="true">{{ t "entry.comments.label" }}</a> </li> {{ end }} <li> @@ -146,7 +146,8 @@ var templateCommonMap = map[string]string{ </li> </ul> </div> -{{ end }}`, +{{ end }} +`, "layout": `{{ define "base" }} <!DOCTYPE html> <html> @@ -286,6 +287,8 @@ var templateCommonMap = map[string]string{ <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong></li> <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li> <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li> + <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li> + <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li> <li>{{ t "page.keyboard_shortcuts.toggle_read_status" }} = <strong>m</strong></li> <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li> <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li> @@ -352,8 +355,8 @@ var templateCommonMapChecksums = map[string]string{ "entry_pagination": "4faa91e2eae150c5e4eab4d258e039dfdd413bab7602f0009360e6d52898e353", "feed_list": "db406e7cb81292ce1d974d63f63270384a286848b2e74fe36bf711b4eb5717dd", "feed_menu": "318d8662dda5ca9dfc75b909c8461e79c86fb5082df1428f67aaf856f19f4b50", - "item_meta": "285daae854456d0156967fdbe2834c954f2c772239bb736c88041d49a4a21219", - "layout": "f19597d8cd74e17b33826c25b8421f46fef87276f0d95c695bba8f53bb4f95e6", + "item_meta": "061107d7adf9b7430b5f28a0f452a294df73c3b16c19274e9ce6f7cdf71064a4", + "layout": "a1f67b8908745ee4f9cee6f7bbbb0b242d4dcc101207ad4a9d67242b45683299", "pagination": "3386e90c6e1230311459e9a484629bc5d5bf39514a75ef2e73bbbc61142f7abb", "settings_menu": "78e5a487ede18610b23db74184dab023170f9e083cc0625bc2c874d1eea1a4ce", } diff --git a/template/html/common/item_meta.html b/template/html/common/item_meta.html index 1797700..8b16337 100644 --- a/template/html/common/item_meta.html +++ b/template/html/common/item_meta.html @@ -23,7 +23,7 @@ </li> {{ if .entry.CommentsURL }} <li> - <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "entry.comments.label" }}</a> + <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-comments-link="true">{{ t "entry.comments.label" }}</a> </li> {{ end }} <li> @@ -47,4 +47,4 @@ </li> </ul> </div> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/template/html/common/layout.html b/template/html/common/layout.html index 7b77878..4afa6ff 100644 --- a/template/html/common/layout.html +++ b/template/html/common/layout.html @@ -137,6 +137,8 @@ <li>{{ t "page.keyboard_shortcuts.open_item" }} = <strong>o</strong></li> <li>{{ t "page.keyboard_shortcuts.open_original" }} = <strong>v</strong></li> <li>{{ t "page.keyboard_shortcuts.open_original_same_window" }} = <strong>V</strong></li> + <li>{{ t "page.keyboard_shortcuts.open_comments" }} = <strong>c</strong></li> + <li>{{ t "page.keyboard_shortcuts.open_comments_same_window" }} = <strong>C</strong></li> <li>{{ t "page.keyboard_shortcuts.toggle_read_status" }} = <strong>m</strong></li> <li>{{ t "page.keyboard_shortcuts.mark_page_as_read" }} = <strong>A</strong></li> <li>{{ t "page.keyboard_shortcuts.download_content" }} = <strong>d</strong></li> diff --git a/template/html/entry.html b/template/html/entry.html index cbf85f6..83215b5 100644 --- a/template/html/entry.html +++ b/template/html/entry.html @@ -54,7 +54,7 @@ </li> {{ if .entry.CommentsURL }} <li> - <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "entry.comments.label" }}</a> + <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-comments-link="true">{{ t "entry.comments.label" }}</a> </li> {{ end }} </ul> diff --git a/template/views.go b/template/views.go index 4e87b57..b19da6c 100644 --- a/template/views.go +++ b/template/views.go @@ -604,7 +604,7 @@ var templateViewsMap = map[string]string{ </li> {{ if .entry.CommentsURL }} <li> - <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "entry.comments.label" }}</a> + <a href="{{ .entry.CommentsURL | safeURL }}" title="{{ t "entry.comments.title" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-comments-link="true">{{ t "entry.comments.label" }}</a> </li> {{ end }} </ul> @@ -1316,7 +1316,7 @@ var templateViewsMapChecksums = map[string]string{ "edit_category": "b1c0b38f1b714c5d884edcd61e5b5295a5f1c8b71c469b35391e4dcc97cc6d36", "edit_feed": "cc0b5dbb73f81398410958b41771ed38246bc7ae4bd548228f0d48c49a598c2a", "edit_user": "c692db9de1a084c57b93e95a14b041d39bf489846cbb91fc982a62b72b77062a", - "entry": "4258936829a5baf9d5b95d3884add13034105a931ee844ee4c4d3a6f1928f61a", + "entry": "9aac76b1cfa80428f136edf292f8610b14289ca9595d725c1365bc0a2847a21d", "feed_entries": "9c70b82f55e4b311eff20be1641733612e3c1b406ce8010861e4c417d97b6dcc", "feeds": "ec7d3fa96735bd8422ba69ef0927dcccddc1cc51327e0271f0312d3f881c64fd", "history_entries": "87e17d39de70eb3fdbc4000326283be610928758eae7924e4b08dcb446f3b6a9", diff --git a/ui/static/js.go b/ui/static/js.go index 5fe3667..85eb408 100644 --- a/ui/static/js.go +++ b/ui/static/js.go @@ -78,6 +78,8 @@ element.innerHTML=element.dataset.labelLoading;let request=new RequestBuilder(el function openOriginalLink(openLinkInCurrentTab){let entryLink=document.querySelector(".entry h1 a");if(entryLink!==null){if(openLinkInCurrentTab){window.location.href=entryLink.getAttribute("href");}else{DomHelper.openNewTab(entryLink.getAttribute("href"));} return;} let currentItemOriginalLink=document.querySelector(".current-item a[data-original-link]");if(currentItemOriginalLink!==null){DomHelper.openNewTab(currentItemOriginalLink.getAttribute("href"));let currentItem=document.querySelector(".current-item");goToNextListItem();markEntryAsRead(currentItem);}} +function openCommentLink(openLinkInCurrentTab){if(!isListView()){let entryLink=document.querySelector("a[data-comments-link]");if(entryLink!==null){if(openLinkInCurrentTab){window.location.href=entryLink.getAttribute("href");}else{DomHelper.openNewTab(entryLink.getAttribute("href"));} +return;}}else{let currentItemCommentsLink=document.querySelector(".current-item a[data-comments-link]");if(currentItemCommentsLink!==null){DomHelper.openNewTab(currentItemCommentsLink.getAttribute("href"));}}} function openSelectedItem(){let currentItemLink=document.querySelector(".current-item .item-title a");if(currentItemLink!==null){window.location.href=currentItemLink.getAttribute("href");}} function unsubscribeFromFeed(){let unsubscribeLinks=document.querySelectorAll("[data-action=remove-feed]");if(unsubscribeLinks.length===1){let unsubscribeLink=unsubscribeLinks[0];let request=new RequestBuilder(unsubscribeLink.dataset.url);request.withCallback(()=>{if(unsubscribeLink.dataset.redirectUrl){window.location.href=unsubscribeLink.dataset.redirectUrl;}else{window.location.reload();}});request.execute();}} function goToPage(page,fallbackSelf){let element=document.querySelector("a[data-page="+page+"]");if(element){document.location.href=element.href;}else if(fallbackSelf){window.location.reload();}} @@ -100,13 +102,13 @@ function isListView(){return document.querySelector(".items")!==null;} function findEntry(element){if(isListView()){if(element){return DomHelper.findParent(element,"item");}else{return document.querySelector(".current-item");}}else{return document.querySelector(".entry");}} function handleConfirmationMessage(linkElement,callback){linkElement.style.display="none";let containerElement=linkElement.parentNode;let questionElement=document.createElement("span");let yesElement=document.createElement("a");yesElement.href="#";yesElement.appendChild(document.createTextNode(linkElement.dataset.labelYes));yesElement.onclick=(event)=>{event.preventDefault();let loadingElement=document.createElement("span");loadingElement.className="loading";loadingElement.appendChild(document.createTextNode(linkElement.dataset.labelLoading));questionElement.remove();containerElement.appendChild(loadingElement);callback(linkElement.dataset.url,linkElement.dataset.redirectUrl);};let noElement=document.createElement("a");noElement.href="#";noElement.appendChild(document.createTextNode(linkElement.dataset.labelNo));noElement.onclick=(event)=>{event.preventDefault();linkElement.style.display="inline";questionElement.remove();};questionElement.className="confirm";questionElement.appendChild(document.createTextNode(linkElement.dataset.labelQuestion+" "));questionElement.appendChild(yesElement);questionElement.appendChild(document.createTextNode(", "));questionElement.appendChild(noElement);containerElement.appendChild(questionElement);} function toast(msg){if(!msg)return;document.querySelector('.toast-wrap .toast-msg').innerHTML=msg;let toastWrapper=document.querySelector('.toast-wrap');toastWrapper.classList.remove('toastAnimate');setTimeout(function(){toastWrapper.classList.add('toastAnimate');},100);} -document.addEventListener("DOMContentLoaded",function(){handleSubmitButtons();if(!document.querySelector("body[data-disable-keyboard-shortcuts=true]")){let keyboardHandler=new KeyboardHandler();keyboardHandler.on("g u",()=>goToPage("unread"));keyboardHandler.on("g b",()=>goToPage("starred"));keyboardHandler.on("g h",()=>goToPage("history"));keyboardHandler.on("g f",()=>goToFeedOrFeeds());keyboardHandler.on("g c",()=>goToPage("categories"));keyboardHandler.on("g s",()=>goToPage("settings"));keyboardHandler.on("ArrowLeft",()=>goToPrevious());keyboardHandler.on("ArrowRight",()=>goToNext());keyboardHandler.on("k",()=>goToPrevious());keyboardHandler.on("p",()=>goToPrevious());keyboardHandler.on("j",()=>goToNext());keyboardHandler.on("n",()=>goToNext());keyboardHandler.on("h",()=>goToPage("previous"));keyboardHandler.on("l",()=>goToPage("next"));keyboardHandler.on("o",()=>openSelectedItem());keyboardHandler.on("v",()=>openOriginalLink());keyboardHandler.on("V",()=>openOriginalLink(true));keyboardHandler.on("m",()=>handleEntryStatus());keyboardHandler.on("A",()=>markPageAsRead());keyboardHandler.on("s",()=>handleSaveEntry());keyboardHandler.on("d",()=>handleFetchOriginalContent());keyboardHandler.on("f",()=>handleBookmark());keyboardHandler.on("?",()=>showKeyboardShortcuts());keyboardHandler.on("#",()=>unsubscribeFromFeed());keyboardHandler.on("/",(e)=>setFocusToSearchInput(e));keyboardHandler.on("Escape",()=>ModalHandler.close());keyboardHandler.listen();} +document.addEventListener("DOMContentLoaded",function(){handleSubmitButtons();if(!document.querySelector("body[data-disable-keyboard-shortcuts=true]")){let keyboardHandler=new KeyboardHandler();keyboardHandler.on("g u",()=>goToPage("unread"));keyboardHandler.on("g b",()=>goToPage("starred"));keyboardHandler.on("g h",()=>goToPage("history"));keyboardHandler.on("g f",()=>goToFeedOrFeeds());keyboardHandler.on("g c",()=>goToPage("categories"));keyboardHandler.on("g s",()=>goToPage("settings"));keyboardHandler.on("ArrowLeft",()=>goToPrevious());keyboardHandler.on("ArrowRight",()=>goToNext());keyboardHandler.on("k",()=>goToPrevious());keyboardHandler.on("p",()=>goToPrevious());keyboardHandler.on("j",()=>goToNext());keyboardHandler.on("n",()=>goToNext());keyboardHandler.on("h",()=>goToPage("previous"));keyboardHandler.on("l",()=>goToPage("next"));keyboardHandler.on("o",()=>openSelectedItem());keyboardHandler.on("v",()=>openOriginalLink());keyboardHandler.on("V",()=>openOriginalLink(true));keyboardHandler.on("c",()=>openCommentLink());keyboardHandler.on("C",()=>openCommentLink(true));keyboardHandler.on("m",()=>handleEntryStatus());keyboardHandler.on("A",()=>markPageAsRead());keyboardHandler.on("s",()=>handleSaveEntry());keyboardHandler.on("d",()=>handleFetchOriginalContent());keyboardHandler.on("f",()=>handleBookmark());keyboardHandler.on("?",()=>showKeyboardShortcuts());keyboardHandler.on("#",()=>unsubscribeFromFeed());keyboardHandler.on("/",(e)=>setFocusToSearchInput(e));keyboardHandler.on("Escape",()=>ModalHandler.close());keyboardHandler.listen();} let touchHandler=new TouchHandler();touchHandler.listen();onClick("a[data-save-entry]",(event)=>handleSaveEntry(event.target));onClick("a[data-toggle-bookmark]",(event)=>handleBookmark(event.target));onClick("a[data-fetch-content-entry]",()=>handleFetchOriginalContent());onClick("a[data-action=search]",(event)=>setFocusToSearchInput(event));onClick("a[data-action=markPageAsRead]",()=>handleConfirmationMessage(event.target,()=>markPageAsRead()));onClick("a[data-toggle-status]",(event)=>handleEntryStatus(event.target));onClick("a[data-confirm]",(event)=>handleConfirmationMessage(event.target,(url,redirectURL)=>{let request=new RequestBuilder(url);request.withCallback(()=>{if(redirectURL){window.location.href=redirectURL;}else{window.location.reload();}});request.execute();}));if(document.documentElement.clientWidth<600){onClick(".logo",()=>toggleMainMenu());onClick(".header nav li",(event)=>onClickMainMenuListItem(event));} if("serviceWorker"in navigator){let scriptElement=document.getElementById("service-worker-script");if(scriptElement){navigator.serviceWorker.register(scriptElement.src);}}});})();`, "sw": `'use strict';self.addEventListener("fetch",(event)=>{if(event.request.url.includes("/feed/icon/")){event.respondWith(caches.open("feed_icons").then((cache)=>{return cache.match(event.request).then((response)=>{return response||fetch(event.request).then((response)=>{cache.put(event.request,response.clone());return response;});});}));}});`, } var JavascriptsChecksums = map[string]string{ - "app": "436115885ff836169580616ff9bd10341522b7702444771f5005067b61b0be6c", + "app": "f33c45750b6bcc73a33fa39a6ae5d879a53e6edfc99e3eec15c258e18d1d3c35", "sw": "55fffa223919cc18572788fb9c62fccf92166c0eb5d3a1d6f91c31f24d020be9", } diff --git a/ui/static/js/app.js b/ui/static/js/app.js index 2b32e63..968045e 100644 --- a/ui/static/js/app.js +++ b/ui/static/js/app.js @@ -304,6 +304,25 @@ function openOriginalLink(openLinkInCurrentTab) { } } +function openCommentLink(openLinkInCurrentTab) { + if (!isListView()) { + let entryLink = document.querySelector("a[data-comments-link]"); + if (entryLink !== null) { + if (openLinkInCurrentTab) { + window.location.href = entryLink.getAttribute("href"); + } else { + DomHelper.openNewTab(entryLink.getAttribute("href")); + } + return; + } + } else { + let currentItemCommentsLink = document.querySelector(".current-item a[data-comments-link]"); + if (currentItemCommentsLink !== null) { + DomHelper.openNewTab(currentItemCommentsLink.getAttribute("href")); + } + } +} + function openSelectedItem() { let currentItemLink = document.querySelector(".current-item .item-title a"); if (currentItemLink !== null) { diff --git a/ui/static/js/bootstrap.js b/ui/static/js/bootstrap.js index dd394f0..7b9e94d 100644 --- a/ui/static/js/bootstrap.js +++ b/ui/static/js/bootstrap.js @@ -20,6 +20,8 @@ document.addEventListener("DOMContentLoaded", function () { keyboardHandler.on("o", () => openSelectedItem()); keyboardHandler.on("v", () => openOriginalLink()); keyboardHandler.on("V", () => openOriginalLink(true)); + keyboardHandler.on("c", () => openCommentLink()); + keyboardHandler.on("C", () => openCommentLink(true)); keyboardHandler.on("m", () => handleEntryStatus()); keyboardHandler.on("A", () => markPageAsRead()); keyboardHandler.on("s", () => handleSaveEntry()); |