From 3431a1b1def2408a8b4ad26a831e6606b8db11f9 Mon Sep 17 00:00:00 2001 From: meow Date: Wed, 20 Apr 2022 16:36:03 +0300 Subject: [PATCH] `console.warn` and `info` instead of `log` --- assets/js/community.js | 2 +- assets/js/embed.js | 6 +++--- assets/js/notifications.js | 8 ++++---- assets/js/player.js | 6 +++--- assets/js/subscribe_widget.js | 12 ++++++------ assets/js/watch.js | 22 +++++++++++----------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/assets/js/community.js b/assets/js/community.js index 58caa71e..44066a58 100644 --- a/assets/js/community.js +++ b/assets/js/community.js @@ -96,7 +96,7 @@ function get_youtube_replies(target, load_more) { }; xhr.ontimeout = function () { - console.log('Pulling comments failed.'); + console.warn('Pulling comments failed.'); body.innerHTML = fallback; }; diff --git a/assets/js/embed.js b/assets/js/embed.js index 492f546b..7e9ac605 100644 --- a/assets/js/embed.js +++ b/assets/js/embed.js @@ -5,7 +5,7 @@ function get_playlist(plid, retries) { if (retries === undefined) retries = 5; if (retries <= 0) { - console.log('Failed to pull playlist'); + console.warn('Failed to pull playlist'); return; } @@ -62,12 +62,12 @@ function get_playlist(plid, retries) { }; xhr.onerror = function () { - console.log('Pulling playlist failed... ' + retries + '/5'); + console.warn('Pulling playlist failed... ' + retries + '/5'); setTimeout(function () { get_playlist(plid, retries - 1); }, 1000); }; xhr.ontimeout = function () { - console.log('Pulling playlist failed... ' + retries + '/5'); + console.warn('Pulling playlist failed... ' + retries + '/5'); get_playlist(plid, retries - 1); }; diff --git a/assets/js/notifications.js b/assets/js/notifications.js index 5f431a69..ec5f6dd3 100644 --- a/assets/js/notifications.js +++ b/assets/js/notifications.js @@ -25,12 +25,12 @@ function get_subscriptions(callback, retries) { }; xhr.onerror = function () { - console.log('Pulling subscriptions failed... ' + retries + '/5'); + console.warn('Pulling subscriptions failed... ' + retries + '/5'); setTimeout(function () { get_subscriptions(callback, retries - 1); }, 1000); }; xhr.ontimeout = function () { - console.log('Pulling subscriptions failed... ' + retries + '/5'); + console.warn('Pulling subscriptions failed... ' + retries + '/5'); get_subscriptions(callback, retries - 1); }; @@ -54,7 +54,7 @@ function create_notification_stream(subscriptions) { } var notification = JSON.parse(event.data); - console.log('Got notification:', notification); + console.info('Got notification:', notification); if (start_time < notification.published && !delivered.includes(notification.videoId)) { if (Notification.permission === 'granted') { @@ -90,7 +90,7 @@ function create_notification_stream(subscriptions) { } function handle_notification_error(event) { - console.log('Something went wrong with notifications, trying to reconnect...'); + console.warn('Something went wrong with notifications, trying to reconnect...'); notifications = { close: function () { } }; setTimeout(function () { get_subscriptions(create_notification_stream); }, 1000); } diff --git a/assets/js/player.js b/assets/js/player.js index 3c8cf219..f07031ac 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -280,7 +280,7 @@ player.on('volumechange', function () { player.on('waiting', function () { if (player.playbackRate() > 1 && player.liveTracker.isLive() && player.liveTracker.atLiveEdge()) { - console.log('Player has caught up to source, resetting playbackRate.'); + console.info('Player has caught up to source, resetting playbackRate.'); player.playbackRate(1); } }); @@ -477,7 +477,7 @@ function set_all_video_times(times) { try { storage.setItem(save_player_pos_key, JSON.stringify(times)); } catch (e) { - console.debug('set_all_video_times: ' + e); + console.warn('set_all_video_times: ' + e); } } else { storage.removeItem(save_player_pos_key); @@ -492,7 +492,7 @@ function get_all_video_times() { try { return JSON.parse(raw); } catch (e) { - console.debug('get_all_video_times: ' + e); + console.warn('get_all_video_times: ' + e); } } } diff --git a/assets/js/subscribe_widget.js b/assets/js/subscribe_widget.js index 771235c1..45ff5706 100644 --- a/assets/js/subscribe_widget.js +++ b/assets/js/subscribe_widget.js @@ -14,7 +14,7 @@ function subscribe(retries) { if (retries === undefined) retries = 5; if (retries <= 0) { - console.log('Failed to subscribe.'); + console.warn('Failed to subscribe.'); return; } @@ -40,12 +40,12 @@ function subscribe(retries) { }; xhr.onerror = function () { - console.log('Subscribing failed... ' + retries + '/5'); + console.warn('Subscribing failed... ' + retries + '/5'); setTimeout(function () { subscribe(retries - 1); }, 1000); }; xhr.ontimeout = function () { - console.log('Subscribing failed... ' + retries + '/5'); + console.warn('Subscribing failed... ' + retries + '/5'); subscribe(retries - 1); }; @@ -57,7 +57,7 @@ function unsubscribe(retries) { retries = 5; if (retries <= 0) { - console.log('Failed to subscribe'); + console.warn('Failed to subscribe'); return; } @@ -83,12 +83,12 @@ function unsubscribe(retries) { }; xhr.onerror = function () { - console.log('Unsubscribing failed... ' + retries + '/5'); + console.warn('Unsubscribing failed... ' + retries + '/5'); setTimeout(function () { unsubscribe(retries - 1); }, 1000); }; xhr.ontimeout = function () { - console.log('Unsubscribing failed... ' + retries + '/5'); + console.warn('Unsubscribing failed... ' + retries + '/5'); unsubscribe(retries - 1); }; diff --git a/assets/js/watch.js b/assets/js/watch.js index 5153f1c1..29d58be5 100644 --- a/assets/js/watch.js +++ b/assets/js/watch.js @@ -121,7 +121,7 @@ function get_playlist(plid, retries) { var playlist = document.getElementById('playlist'); if (retries <= 0) { - console.log('Failed to pull playlist'); + console.warn('Failed to pull playlist'); playlist.innerHTML = ''; return; } @@ -194,7 +194,7 @@ function get_playlist(plid, retries) { playlist.innerHTML = '


'; - console.log('Pulling playlist timed out... ' + retries + '/5'); + console.warn('Pulling playlist timed out... ' + retries + '/5'); setTimeout(function () { get_playlist(plid, retries - 1); }, 1000); }; @@ -203,7 +203,7 @@ function get_playlist(plid, retries) { playlist.innerHTML = '


'; - console.log('Pulling playlist timed out... ' + retries + '/5'); + console.warn('Pulling playlist timed out... ' + retries + '/5'); get_playlist(plid, retries - 1); }; @@ -215,7 +215,7 @@ function get_reddit_comments(retries) { var comments = document.getElementById('comments'); if (retries <= 0) { - console.log('Failed to pull comments'); + console.warn('Failed to pull comments'); comments.innerHTML = ''; return; } @@ -265,7 +265,7 @@ function get_reddit_comments(retries) { comments.children[0].children[1].children[0].onclick = swap_comments; } else { if (video_data.params.comments[1] === 'youtube') { - console.log('Pulling comments failed... ' + retries + '/5'); + console.warn('Pulling comments failed... ' + retries + '/5'); setTimeout(function () { get_youtube_comments(retries - 1); }, 1000); } else { comments.innerHTML = fallback; @@ -275,12 +275,12 @@ function get_reddit_comments(retries) { }; xhr.onerror = function () { - console.log('Pulling comments failed... ' + retries + '/5'); + console.warn('Pulling comments failed... ' + retries + '/5'); setTimeout(function () { get_reddit_comments(retries - 1); }, 1000); }; xhr.ontimeout = function () { - console.log('Pulling comments failed... ' + retries + '/5'); + console.warn('Pulling comments failed... ' + retries + '/5'); get_reddit_comments(retries - 1); }; @@ -292,7 +292,7 @@ function get_youtube_comments(retries) { var comments = document.getElementById('comments'); if (retries <= 0) { - console.log('Failed to pull comments'); + console.warn('Failed to pull comments'); comments.innerHTML = ''; return; } @@ -349,14 +349,14 @@ function get_youtube_comments(retries) { xhr.onerror = function () { comments.innerHTML = '

'; - console.log('Pulling comments failed... ' + retries + '/5'); + console.warn('Pulling comments failed... ' + retries + '/5'); setTimeout(function () { get_youtube_comments(retries - 1); }, 1000); }; xhr.ontimeout = function () { comments.innerHTML = '

'; - console.log('Pulling comments failed... ' + retries + '/5'); + console.warn('Pulling comments failed... ' + retries + '/5'); get_youtube_comments(retries - 1); }; @@ -417,7 +417,7 @@ function get_youtube_replies(target, load_more, load_replies) { }; xhr.ontimeout = function () { - console.log('Pulling comments failed.'); + console.warn('Pulling comments failed.'); body.innerHTML = fallback; };