From eea4ed14dc17ee3e09b4e08d606b2892da8fa493 Mon Sep 17 00:00:00 2001 From: Danial Haddadi Date: Mon, 4 Oct 2021 02:08:25 +0200 Subject: [PATCH] Add hide recommendations button on mobile (#494) --- src/components/WatchVideo.vue | 12 ++++++++++++ src/locales/bn.json | 4 +++- src/locales/de.json | 2 ++ src/locales/el.json | 2 ++ src/locales/en.json | 2 ++ src/locales/es.json | 4 +++- src/locales/eu.json | 4 +++- src/locales/fa.json | 4 +++- src/locales/fi.json | 4 +++- src/locales/fr.json | 2 ++ src/locales/hr.json | 2 ++ src/locales/it.json | 2 ++ src/locales/lt.json | 2 ++ src/locales/ml.json | 2 ++ src/locales/nb_NO.json | 2 ++ src/locales/pl.json | 2 ++ src/locales/sk.json | 4 +++- src/locales/tr.json | 4 +++- src/locales/zh_Hans.json | 4 +++- 19 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index cc30a01f..07e695a6 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -122,7 +122,11 @@
+ + {{ showRecs ? $t("actions.minimize_recommendations") : $t("actions.show_recommendations") }} +
+
@@ -144,6 +149,7 @@ import Comment from "@/components/Comment.vue"; export default { name: "App", data() { + const smallViewQuery = window.matchMedia("(max-width: 640px)"); return { video: { title: "Loading...", @@ -152,10 +158,13 @@ export default { selectedAutoLoop: false, selectedAutoPlay: null, showDesc: true, + showRecs: true, comments: null, subscribed: false, channelId: null, active: true, + smallViewQuery: smallViewQuery, + smallView: smallViewQuery.matches, }; }, mounted() { @@ -180,6 +189,9 @@ export default { }); this.getSponsors(); if (!this.isEmbed && this.getPreferenceBoolean("comments", true)) this.getComments(); + window.addEventListener("resize", () => { + this.smallView = this.smallViewQuery.matches; + }); }, activated() { this.active = true; diff --git a/src/locales/bn.json b/src/locales/bn.json index 26de41b9..a8d99074 100644 --- a/src/locales/bn.json +++ b/src/locales/bn.json @@ -44,6 +44,8 @@ "store_watch_history": "আপনি কি দেখার ইতিহাস মজুত রাখতে চান?", "language_selection": "আপনি কোন ভাষায় দেখতে চান ?", "instances_list": "Instances List", - "enabled_codecs": "Enabled Codecs (Multiple)" + "enabled_codecs": "Enabled Codecs (Multiple)", + "minimize_recommendations": "সুপারিশগুলি ছোট করুন", + "show_recommendations": "সুপারিশ দেখান" } } diff --git a/src/locales/de.json b/src/locales/de.json index 436dd2af..60dddf78 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -39,6 +39,8 @@ "instance_selection": "Instanzauswahl", "show_description": "Beschreibung anzeigen", "minimize_description": "Beschreibung minimieren", + "show_recommendations": "Empfehlungen anzeigen", + "minimize_recommendations": "Empfehlungen minimieren", "donations": "Spenden", "auto_play_next_video": "Nächstes Video automatisch abspielen", "loop_this_video": "Dieses Video wiederholen", diff --git a/src/locales/el.json b/src/locales/el.json index 54a0a3a9..b800e330 100644 --- a/src/locales/el.json +++ b/src/locales/el.json @@ -40,6 +40,8 @@ "enable_lbry_proxy": "Ενεργοποίηση Proxy για το LBRY", "minimize_description": "Απόκρυψη περιγραφής", "show_description": "Εμφάνιση περιγραφής", + "minimize_recommendations": "Απόκρυψη συστάσεις", + "show_recommendations": "Εμφάνιση συστάσεις", "donations": "Δωρεές", "auto_play_next_video": "Αυτόματη αναπαραγωγή επόμενου βίντεο", "import_from_json": "Εισαγωγή από JSON", diff --git a/src/locales/en.json b/src/locales/en.json index 43fd9c89..9257147b 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -57,6 +57,8 @@ "donations": "Donations", "minimize_description": "Minimize Description", "show_description": "Show Description", + "minimize_recommendations": "Minimize Recommendations", + "show_recommendations": "Show Recommendations", "disable_lbry": "Disable LBRY for Streaming", "enable_lbry_proxy": "Enable Proxy for LBRY", "view_ssl_score": "View SSL Score", diff --git a/src/locales/es.json b/src/locales/es.json index af5759fa..71301011 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -65,7 +65,9 @@ "loading": "Cargando…", "filter": "Filtrar", "search": "Buscar", - "view_ssl_score": "Ver la puntuación SSL" + "view_ssl_score": "Ver la puntuación SSL", + "minimize_recommendations": "Minimizar recomendaciones", + "show_recommendations": "Mostrar recomendaciones" }, "titles": { "feed": "Feed", diff --git a/src/locales/eu.json b/src/locales/eu.json index ac03e1e9..458e8cfb 100644 --- a/src/locales/eu.json +++ b/src/locales/eu.json @@ -65,7 +65,9 @@ "loading": "Kargatzen...", "filter": "Iragazi", "search": "Bilatu", - "view_ssl_score": "Ikusi SSL puntuazioa" + "view_ssl_score": "Ikusi SSL puntuazioa", + "minimize_recommendations": "Gomendioak minimizatu", + "show_recommendations": "Erakutsi gomendioak" }, "player": { "watch_on": "Ikusi hemen" diff --git a/src/locales/fa.json b/src/locales/fa.json index cc1bb40c..70845e29 100644 --- a/src/locales/fa.json +++ b/src/locales/fa.json @@ -25,7 +25,9 @@ "sort_by": "مرتب سازی بر اساس:", "view_subscriptions": "مشاهده اشتراک‌ها", "unsubscribe": "لغو اشتراک", - "subscribe": "مشترک شدن" + "subscribe": "مشترک شدن", + "minimize_recommendations": "توصیه ها را کم کنید", + "show_recommendations": "نمایش توصیه ها" }, "titles": { "history": "سابقه", diff --git a/src/locales/fi.json b/src/locales/fi.json index d0a96508..1486c45b 100644 --- a/src/locales/fi.json +++ b/src/locales/fi.json @@ -49,7 +49,9 @@ "sort_by": "Järjestä:", "view_subscriptions": "Näytä tilaukset", "unsubscribe": "Poistu tilauksesta", - "subscribe": "Tilaa" + "subscribe": "Tilaa", + "minimize_recommendations": "Minimoi suositukset", + "show_recommendations": "Näytä suositukset" }, "player": { "watch_on": "Katso sivustolla" diff --git a/src/locales/fr.json b/src/locales/fr.json index d2a2007d..e2b19c6e 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -54,6 +54,8 @@ "show_more": "Afficher plus", "instance_selection": "Sélection de l'instance", "minimize_description": "Minimiser la description", + "minimize_recommendations": "Minimiser les recommandations", + "show_recommendations": "Afficher les recommandations", "no": "Non", "yes": "Oui", "loading": "Chargement…", diff --git a/src/locales/hr.json b/src/locales/hr.json index e523b20b..eb15bfe9 100644 --- a/src/locales/hr.json +++ b/src/locales/hr.json @@ -20,6 +20,8 @@ "minimize_description_default": "Uvijek sakrij prikaz opisa", "minimize_description": "Sakrij opis", "show_description": "Prikaži opis", + "minimize_recommendations": "Sakrij preporuke", + "show_recommendations": "Prikaži preporuke", "donations": "Donacije", "auto_play_next_video": "Automatski reproduciraj idući videozapis", "loop_this_video": "Ponavljanje videozapisa", diff --git a/src/locales/it.json b/src/locales/it.json index a278704b..189314aa 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -38,6 +38,8 @@ "disable_lbry": "Disabilita LBRY per lo streaming", "show_description": "Mostra la descrizione", "minimize_description": "Minimizza la descrizione per impostazione predefinita", + "minimize_recommendations": "Minimizza consigli", + "show_recommendations": "Mostra consigli", "donations": "Donazioni", "auto_play_next_video": "Riproduci automaticamente il prossimo video", "loop_this_video": "Ripeti questo video", diff --git a/src/locales/lt.json b/src/locales/lt.json index 139970b1..6b1866cb 100644 --- a/src/locales/lt.json +++ b/src/locales/lt.json @@ -42,6 +42,8 @@ "loop_this_video": "Sukti ratu šį vaizdo įrašą", "show_description": "Rodyti aprašymą", "minimize_description": "Suskleisti aprašymą", + "minimize_recommendations": "Suskleisti rekomendacijas", + "show_recommendations": "Rodyti rekomendacijas", "import_from_json": "Importuoti iš JSON", "export_to_json": "Eksportuoti į JSON", "no": "Ne", diff --git a/src/locales/ml.json b/src/locales/ml.json index d1c9aaed..8818212f 100644 --- a/src/locales/ml.json +++ b/src/locales/ml.json @@ -48,6 +48,8 @@ "auto_play_next_video": "അടുത്ത വിഡിയോ സ്വയം പ്ലേ ചെയ്യുക", "loop_this_video": "വിഡിയോ ലൂപ്പ് ചെയ്യുക", "minimize_description": "വിവരണം ചെറുതാക്കുക", + "minimize_recommendations": "ശുപാർശകൾ ചുരുക്കുക", + "show_recommendations": "ശുപാർശകൾ കാണിക്കുക", "yes": "അതെ", "show_more": "കൂടുതൽ കാണിക്കുക", "buffering_goal": "ബഫറിംഗ് ലക്ഷ്യം(സെക്കൻഡുകളിൽ)", diff --git a/src/locales/nb_NO.json b/src/locales/nb_NO.json index ae2154d2..c33e9c84 100644 --- a/src/locales/nb_NO.json +++ b/src/locales/nb_NO.json @@ -37,6 +37,8 @@ "disable_lbry": "Skru av LBRY-strømming", "enabled_codecs": "Aktiverte forskjellige kodek", "show_description": "Vis beskrivelse", + "minimize_recommendations": "Minimere anbefalinger", + "show_recommendations": "Vis anbefalinger", "donations": "Donasjoner", "auto_play_next_video": "Autospill neste video", "loop_this_video": "Gjenta denne videoen", diff --git a/src/locales/pl.json b/src/locales/pl.json index 29499e2f..0c3b57fd 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -57,6 +57,8 @@ "donations": "Darowizny", "minimize_description": "Minimalizuj opis", "show_description": "Pokaż opis", + "minimize_recommendations": "Minimalizuj rekomendacje", + "show_recommendations": "Pokaż rekomendacje", "disable_lbry": "Wyłącz LBRY dla streaming-u", "enable_lbry_proxy": "Włącz proxy dla LBRY" }, diff --git a/src/locales/sk.json b/src/locales/sk.json index fa7a85b6..afbe1801 100644 --- a/src/locales/sk.json +++ b/src/locales/sk.json @@ -35,7 +35,9 @@ "sort_by": "Zoradiť podľa:", "view_subscriptions": "Zobraziť odbery", "unsubscribe": "Zrušiť odber", - "subscribe": "Odberať" + "subscribe": "Odberať", + "minimize_recommendations": "Minimalizujte odporúčania", + "show_recommendations": "Zobraziť odporúčania" }, "player": { "watch_on": "Pozerať na" diff --git a/src/locales/tr.json b/src/locales/tr.json index efb497d2..3d5f7e22 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -50,7 +50,9 @@ "loading": "Yükleniyor...", "filter": "Filtrele", "search": "Ara", - "view_ssl_score": "SSL Puanını Görüntüle" + "view_ssl_score": "SSL Puanını Görüntüle", + "minimize_recommendations": "Önerileri en aza indirin", + "show_recommendations": "Önerileri göster" }, "player": { "watch_on": "İzle" diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 3aa0c017..8ea4de68 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -50,7 +50,9 @@ "loading": "正在加载...", "filter": "筛选", "search": "搜索", - "view_ssl_score": "查看 SSL 得分" + "view_ssl_score": "查看 SSL 得分", + "minimize_recommendations": "最小化建议", + "show_recommendations": "显示推荐" }, "video": { "sponsor_segments": "赞助商部分",