diff options
| author | syeopite <syeopite@syeopite.dev> | 2025-01-22 11:33:51 -0800 |
|---|---|---|
| committer | syeopite <syeopite@syeopite.dev> | 2025-01-22 11:33:51 -0800 |
| commit | dca130ca6f329a474b0a8a072dd55a9b8e75b8f5 (patch) | |
| tree | 877f1b5df3a1736d95d2ce19a5a0d88c508b4d88 /assets | |
| parent | 086c6209ab7c2c28f8b67c4b02f9fff4ec1c2a39 (diff) | |
| parent | b0c7dd977151d30e85f0095f35de892624e87a35 (diff) | |
| download | invidious-dca130ca6f329a474b0a8a072dd55a9b8e75b8f5.tar.gz invidious-dca130ca6f329a474b0a8a072dd55a9b8e75b8f5.tar.bz2 invidious-dca130ca6f329a474b0a8a072dd55a9b8e75b8f5.zip | |
Routes: Clean ajax actions handlers (#5036)
Diffstat (limited to 'assets')
| -rw-r--r-- | assets/js/handlers.js | 4 | ||||
| -rw-r--r-- | assets/js/playlist_widget.js | 6 | ||||
| -rw-r--r-- | assets/js/subscribe_widget.js | 4 | ||||
| -rw-r--r-- | assets/js/watched_widget.js | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/assets/js/handlers.js b/assets/js/handlers.js index 539974fb..67cd9081 100644 --- a/assets/js/handlers.js +++ b/assets/js/handlers.js @@ -91,7 +91,7 @@ var count = document.getElementById('count'); count.textContent--; - var url = '/token_ajax?action_revoke_token=1&redirect=false' + + var url = '/token_ajax?action=revoke_token&redirect=false' + '&referer=' + encodeURIComponent(location.href) + '&session=' + target.getAttribute('data-session'); @@ -111,7 +111,7 @@ var count = document.getElementById('count'); count.textContent--; - var url = '/subscription_ajax?action_remove_subscriptions=1&redirect=false' + + var url = '/subscription_ajax?action=remove_subscriptions&redirect=false' + '&referer=' + encodeURIComponent(location.href) + '&c=' + target.getAttribute('data-ucid'); diff --git a/assets/js/playlist_widget.js b/assets/js/playlist_widget.js index c92592ac..96a51d70 100644 --- a/assets/js/playlist_widget.js +++ b/assets/js/playlist_widget.js @@ -6,7 +6,7 @@ function add_playlist_video(target) { var select = target.parentNode.children[0].children[1]; var option = select.children[select.selectedIndex]; - var url = '/playlist_ajax?action_add_video=1&redirect=false' + + var url = '/playlist_ajax?action=add_video&redirect=false' + '&video_id=' + target.getAttribute('data-id') + '&playlist_id=' + option.getAttribute('data-plid'); @@ -21,7 +21,7 @@ function add_playlist_item(target) { var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode; tile.style.display = 'none'; - var url = '/playlist_ajax?action_add_video=1&redirect=false' + + var url = '/playlist_ajax?action=add_video&redirect=false' + '&video_id=' + target.getAttribute('data-id') + '&playlist_id=' + target.getAttribute('data-plid'); @@ -36,7 +36,7 @@ function remove_playlist_item(target) { var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode; tile.style.display = 'none'; - var url = '/playlist_ajax?action_remove_video=1&redirect=false' + + var url = '/playlist_ajax?action=remove_video&redirect=false' + '&set_video_id=' + target.getAttribute('data-index') + '&playlist_id=' + target.getAttribute('data-plid'); diff --git a/assets/js/subscribe_widget.js b/assets/js/subscribe_widget.js index 7665a00b..d462e848 100644 --- a/assets/js/subscribe_widget.js +++ b/assets/js/subscribe_widget.js @@ -16,7 +16,7 @@ function subscribe() { subscribe_button.onclick = unsubscribe; subscribe_button.innerHTML = '<b>' + subscribe_data.unsubscribe_text + ' | ' + subscribe_data.sub_count_text + '</b>'; - var url = '/subscription_ajax?action_create_subscription_to_channel=1&redirect=false' + + var url = '/subscription_ajax?action=create_subscription_to_channel&redirect=false' + '&c=' + subscribe_data.ucid; helpers.xhr('POST', url, {payload: payload, retries: 5, entity_name: 'subscribe request'}, { @@ -32,7 +32,7 @@ function unsubscribe() { subscribe_button.onclick = subscribe; subscribe_button.innerHTML = '<b>' + subscribe_data.subscribe_text + ' | ' + subscribe_data.sub_count_text + '</b>'; - var url = '/subscription_ajax?action_remove_subscriptions=1&redirect=false' + + var url = '/subscription_ajax?action=remove_subscriptions&redirect=false' + '&c=' + subscribe_data.ucid; helpers.xhr('POST', url, {payload: payload, retries: 5, entity_name: 'unsubscribe request'}, { diff --git a/assets/js/watched_widget.js b/assets/js/watched_widget.js index f1ac9cb4..06af62cc 100644 --- a/assets/js/watched_widget.js +++ b/assets/js/watched_widget.js @@ -6,7 +6,7 @@ function mark_watched(target) { var tile = target.parentNode.parentNode.parentNode.parentNode.parentNode; tile.style.display = 'none'; - var url = '/watch_ajax?action_mark_watched=1&redirect=false' + + var url = '/watch_ajax?action=mark_watched&redirect=false' + '&id=' + target.getAttribute('data-id'); helpers.xhr('POST', url, {payload: payload}, { @@ -22,7 +22,7 @@ function mark_unwatched(target) { var count = document.getElementById('count'); count.textContent--; - var url = '/watch_ajax?action_mark_unwatched=1&redirect=false' + + var url = '/watch_ajax?action=mark_unwatched&redirect=false' + '&id=' + target.getAttribute('data-id'); helpers.xhr('POST', url, {payload: payload}, { |
