diff options
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/tubo/components/audio_player.cljs | 8 | ||||
-rw-r--r-- | src/frontend/tubo/components/comments.cljs | 6 | ||||
-rw-r--r-- | src/frontend/tubo/components/items.cljs | 12 | ||||
-rw-r--r-- | src/frontend/tubo/components/layout.cljs | 4 | ||||
-rw-r--r-- | src/frontend/tubo/components/play_queue.cljs | 10 | ||||
-rw-r--r-- | src/frontend/tubo/subs.cljs | 6 | ||||
-rw-r--r-- | src/frontend/tubo/utils.cljs (renamed from src/frontend/tubo/util.cljs) | 2 | ||||
-rw-r--r-- | src/frontend/tubo/views/stream.cljs | 8 |
8 files changed, 28 insertions, 28 deletions
diff --git a/src/frontend/tubo/components/audio_player.cljs b/src/frontend/tubo/components/audio_player.cljs index 337d4d6..b97ed23 100644 --- a/src/frontend/tubo/components/audio_player.cljs +++ b/src/frontend/tubo/components/audio_player.cljs @@ -9,7 +9,7 @@ [tubo.components.modals.bookmarks :as bookmarks] [tubo.components.player :as player] [tubo.events :as events] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn audio-source [!player] @@ -76,11 +76,11 @@ :disabled? (not (and media-queue (< (+ media-queue-pos 1) (count media-queue))))]] [:div.hidden.lg:flex.items-center [:span.mx-2.text-sm - (if @!elapsed-time (util/format-duration @!elapsed-time) "00:00")] + (if @!elapsed-time (utils/format-duration @!elapsed-time) "00:00")] [:div.w-20.lg:w-64.mx-2.flex.items-center [player/time-slider !player !elapsed-time service-color]] [:span.mx-2.text-sm - (if player-ready? (util/format-duration (.-duration @!player)) "00:00")]]])) + (if player-ready? (utils/format-duration (.-duration @!player)) "00:00")]]])) (defn player [] @@ -97,7 +97,7 @@ bookmarks @(rf/subscribe [:bookmarks]) !player @(rf/subscribe [:player]) {:keys [theme]} @(rf/subscribe [:settings]) - service-color (and service-id (util/get-service-color service-id)) + service-color (and service-id (utils/get-service-color service-id)) bg-color (str "rgba(" (if (= theme "dark") "23, 23, 23" "255, 255, 255") ", 0.95)") liked? (some #(= (:url %) url) (-> bookmarks first :items))] (when show-audio-player? diff --git a/src/frontend/tubo/components/comments.cljs b/src/frontend/tubo/components/comments.cljs index 4f3a93a..001fdee 100644 --- a/src/frontend/tubo/components/comments.cljs +++ b/src/frontend/tubo/components/comments.cljs @@ -4,7 +4,7 @@ [reitit.frontend.easy :as rfe] [tubo.components.layout :as layout] [tubo.events :as events] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn comment-item [{:keys [id text uploader-name uploader-avatar uploader-url stream-position @@ -27,14 +27,14 @@ [:h1.text-neutral-800.dark:text-gray-300.font-bold.line-clamp-1 uploader-name]] (when stream-position [:div.text-neutral-600.dark:text-neutral-300 - [:span.mx-2.text-xs.whitespace-nowrap (util/format-duration stream-position)]])]) + [:span.mx-2.text-xs.whitespace-nowrap (utils/format-duration stream-position)]])]) (when uploader-verified? [:i.fa-solid.fa-circle-check.ml-2])] [:div.my-2 [:p {:dangerouslySetInnerHTML {:__html text} :class "[overflow-wrap:anywhere]"}]] [:div..flex.items-center.my-2 [:div.mr-4 - [:p (util/format-date-ago upload-date)]] + [:p (utils/format-date-ago upload-date)]] (when (and like-count (> like-count 0)) [:div.flex.items-center.my-2 [:i.fa-solid.fa-thumbs-up.text-xs] diff --git a/src/frontend/tubo/components/items.cljs b/src/frontend/tubo/components/items.cljs index fa17000..cf34911 100644 --- a/src/frontend/tubo/components/items.cljs +++ b/src/frontend/tubo/components/items.cljs @@ -7,7 +7,7 @@ [tubo.components.modal :as modal] [tubo.components.modals.bookmarks :as bookmarks] [tubo.events :as events] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn item-content [{:keys [audio-streams video-streams type service-id bookmark-id url] :as item} item-route bookmarks] @@ -24,7 +24,7 @@ :on-click #(rf/dispatch [::events/switch-to-audio-player item])} {:label (if liked? "Remove favorite" "Favorite") :icon (if liked? - [:i.fa-solid.fa-heart {:style {:color (util/get-service-color service-id)}}] + [:i.fa-solid.fa-heart {:style {:color (utils/get-service-color service-id)}}] [:i.fa-solid.fa-heart]) :on-click #(rf/dispatch [(if liked? ::events/remove-from-likes ::events/add-to-likes) item])} (if (some #(= (:url %) url) (:items (first (filter #(= (:id %) bookmark-id) bookmarks)))) @@ -61,17 +61,17 @@ (when (and subscriber-count (not stream?)) [:div.flex.items-center [:i.fa-solid.fa-users.text-xs] - [:p.mx-2 (util/format-quantity subscriber-count)]]) + [:p.mx-2 (utils/format-quantity subscriber-count)]]) (when stream-count [:div.flex.items-center [:i.fa-solid.fa-video.text-xs] - [:p.mx-2 (util/format-quantity stream-count)]]) + [:p.mx-2 (utils/format-quantity stream-count)]]) [:div.flex.my-1.justify-between - [:p (util/format-date-ago upload-date)] + [:p (utils/format-date-ago upload-date)] (when view-count [:div.flex.items-center.h-full.pl-2 [:i.fa-solid.fa-eye.text-xs] - [:p.pl-1.5 (util/format-quantity view-count)]])]])))) + [:p.pl-1.5 (utils/format-quantity view-count)]])]])))) (defn generic-item [{:keys [url name thumbnail-url duration] :as item} bookmarks] diff --git a/src/frontend/tubo/components/layout.cljs b/src/frontend/tubo/components/layout.cljs index ae6f5ab..910d9fd 100644 --- a/src/frontend/tubo/components/layout.cljs +++ b/src/frontend/tubo/components/layout.cljs @@ -2,7 +2,7 @@ (:require [reagent.core :as r] [re-frame.core :as rf] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn thumbnail [thumbnail-url route name duration & {:keys [classes] :or {classes "h-44 xs:h-28"}}] @@ -18,7 +18,7 @@ [:p.text-white {:style {:fontSize "14px"}} (if (= duration 0) "LIVE" - (util/format-duration duration))]])]]) + (utils/format-duration duration))]])]]) (defn logo [] [:img.mb-1 diff --git a/src/frontend/tubo/components/play_queue.cljs b/src/frontend/tubo/components/play_queue.cljs index f4d7d4d..4b93ce4 100644 --- a/src/frontend/tubo/components/play_queue.cljs +++ b/src/frontend/tubo/components/play_queue.cljs @@ -6,7 +6,7 @@ [tubo.components.layout :as layout] [tubo.components.player :as player] [tubo.events :as events] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn play-queue-item [{:keys [service-id uploader-name uploader-url name duration @@ -21,7 +21,7 @@ [:div.text-neutral-600.dark:text-neutral-300.text-sm.flex.flex-col.xs:flex-row [:span.line-clamp-1 uploader-name] [:span.px-2.hidden.xs:inline-block {:dangerouslySetInnerHTML {:__html "•"}}] - [:span (util/get-service-name service-id)]]]]) + [:span (utils/get-service-name service-id)]]]]) (defn queue [] @@ -32,7 +32,7 @@ media-queue-pos @(rf/subscribe [:media-queue-pos]) {:keys [uploader-name uploader-url name stream url service-id] :as current-stream} @(rf/subscribe [:media-queue-stream]) - service-color (and service-id (util/get-service-color service-id)) + service-color (and service-id (utils/get-service-color service-id)) !elapsed-time @(rf/subscribe [:elapsed-time]) !player @(rf/subscribe [:player]) loop-playback @(rf/subscribe [:loop-playback]) @@ -59,9 +59,9 @@ [:a.text-sm.pt-2.text-neutral-600.dark:text-neutral-300.line-clamp-1 {:href (rfe/href :tubo.routes/channel nil {:url uploader-url})} uploader-name]] [:div.flex.flex-auto.py-2.w-full.items-center - [:span.mr-2 (if @!elapsed-time (util/format-duration @!elapsed-time) "00:00")] + [:span.mr-2 (if @!elapsed-time (utils/format-duration @!elapsed-time) "00:00")] [player/time-slider !player !elapsed-time service-color] - [:span.ml-2 (if player-ready? (util/format-duration (.-duration @!player)) "00:00")]] + [:span.ml-2 (if player-ready? (utils/format-duration (.-duration @!player)) "00:00")]] [:div.flex.justify-center.items-center [player/loop-button loop-playback service-color true] [player/button diff --git a/src/frontend/tubo/subs.cljs b/src/frontend/tubo/subs.cljs index a4f84f2..5b421fe 100644 --- a/src/frontend/tubo/subs.cljs +++ b/src/frontend/tubo/subs.cljs @@ -2,7 +2,7 @@ (:require [reagent.core :as r] [re-frame.core :as rf] - [tubo.util :as util])) + [tubo.utils :as utils])) (defonce !is-window-visible (let [a (r/atom true)] @@ -101,14 +101,14 @@ (fn [_] (rf/subscribe [:service-id])) (fn [id _] - (util/get-service-color id))) + (utils/get-service-color id))) (rf/reg-sub :service-name (fn [_] (rf/subscribe [:service-id])) (fn [id _] - (util/get-service-name id))) + (utils/get-service-name id))) (rf/reg-sub :services diff --git a/src/frontend/tubo/util.cljs b/src/frontend/tubo/utils.cljs index 7244106..58d6172 100644 --- a/src/frontend/tubo/util.cljs +++ b/src/frontend/tubo/utils.cljs @@ -1,4 +1,4 @@ -(ns tubo.util +(ns tubo.utils (:require ["timeago.js" :as timeago])) diff --git a/src/frontend/tubo/views/stream.cljs b/src/frontend/tubo/views/stream.cljs index 147686f..77ed51a 100644 --- a/src/frontend/tubo/views/stream.cljs +++ b/src/frontend/tubo/views/stream.cljs @@ -9,7 +9,7 @@ [tubo.components.comments :as comments] [tubo.components.modals.bookmarks :as bookmarks] [tubo.components.video-player :as player] - [tubo.util :as util])) + [tubo.utils :as utils])) (defn stream [match] @@ -68,7 +68,7 @@ :on-click #(rf/dispatch [::events/switch-to-audio-player stream])} {:label (if liked? "Remove favorite" "Favorite") :icon (if liked? - [:i.fa-solid.fa-heart {:style {:color (util/get-service-color service-id)}}] + [:i.fa-solid.fa-heart {:style {:color (utils/get-service-color service-id)}}] [:i.fa-solid.fa-heart]) :on-click #(rf/dispatch [(if liked? ::events/remove-from-likes ::events/add-to-likes) stream])} {:label "Original" @@ -89,7 +89,7 @@ (when subscriber-count [:div.flex.my-2.items-center [:i.fa-solid.fa-users.text-xs] - [:p.mx-2 (util/format-quantity subscriber-count)]])]] + [:p.mx-2 (utils/format-quantity subscriber-count)]])]] [:div.flex.flex-col.items-end.flex-auto.justify-center (when view-count [:div.sm:text-base.text-sm.mb-1 @@ -107,7 +107,7 @@ (when upload-date [:div.sm:text-base.text-sm.mt-1.whitespace-nowrap [:i.fa-solid.fa-calendar] - [:span.ml-2 (util/format-date-string upload-date)]])]] + [:span.ml-2 (utils/format-date-string upload-date)]])]] (when (and show-description? (not (empty? description))) [layout/show-more-container show-description description #(rf/dispatch [::events/toggle-stream-layout :show-description])]) |