From 8cdfc27d309e982c96244b5db5ab409c725ba7f0 Mon Sep 17 00:00:00 2001 From: p0psicles Date: Wed, 6 Apr 2022 10:56:50 +0200 Subject: [PATCH 1/3] Cleanup js --- themes-default/slim/src/app.js | 5 + .../slim/static/js/add-show-options.js | 37 -- themes-default/slim/static/js/blackwhite.js | 43 -- themes-default/slim/static/js/common/init.js | 157 -------- themes-default/slim/static/js/config/init.js | 60 --- .../slim/static/js/lib/formwizard.js | 201 ---------- themes-default/slim/static/js/lib/lazyload.js | 368 ------------------ themes-default/slim/static/js/parsers.js | 92 ----- .../slim/static/js/rating-tooltip.js | 29 -- .../static/js/scene-exceptions-tooltip.js | 40 -- themes-default/slim/views/index.mako | 19 +- themes/dark/assets/js/add-show-options.js | 37 -- themes/dark/assets/js/add-shows/init.js | 196 ---------- .../dark/assets/js/add-shows/popular-shows.js | 4 - .../assets/js/add-shows/recommended-shows.js | 14 - .../assets/js/add-shows/trending-shows.js | 27 -- themes/dark/assets/js/app.js | 2 +- themes/dark/assets/js/app.js.map | 1 - themes/dark/assets/js/blackwhite.js | 43 -- themes/dark/assets/js/common/init.js | 157 -------- themes/dark/assets/js/config/init.js | 60 --- themes/dark/assets/js/index.js.map | 1 - themes/dark/assets/js/lib/formwizard.js | 201 ---------- themes/dark/assets/js/lib/lazyload.js | 368 ------------------ themes/dark/assets/js/medusa-runtime.js.map | 1 - themes/dark/assets/js/parsers.js | 92 ----- themes/dark/assets/js/rating-tooltip.js | 29 -- .../assets/js/scene-exceptions-tooltip.js | 40 -- ...rc_components_config-backup-restore_vue.js | 66 ---- .../js/src_components_config-subtitles_vue.js | 66 ---- .../src_components_current-downloads_vue.js | 97 ----- .../js/src_components_log-reporter_vue.js | 66 ---- ..._components_manage-failed-downloads_vue.js | 97 ----- .../src_components_manage-mass-update_vue.js | 65 ---- ...components_manage-missing-subtitles_vue.js | 97 ----- ...rc_components_manage_change-indexer_vue.js | 66 ---- .../js/src_components_test-rename_vue.js | 66 ---- themes/dark/assets/js/vender.js.LICENSE.txt | 265 ------------- themes/dark/assets/js/vender.js.map | 1 - themes/dark/assets/js/vendors.js.LICENSE.txt | 177 --------- themes/dark/assets/js/vendors.js.map | 1 - themes/dark/assets/js/vendors~date-fns.js.map | 1 - themes/dark/templates/index.mako | 19 +- themes/light/assets/js/add-show-options.js | 37 -- themes/light/assets/js/add-shows/init.js | 196 ---------- .../assets/js/add-shows/popular-shows.js | 4 - .../assets/js/add-shows/recommended-shows.js | 14 - .../assets/js/add-shows/trending-shows.js | 27 -- themes/light/assets/js/app.js | 2 +- themes/light/assets/js/app.js.map | 1 - themes/light/assets/js/blackwhite.js | 43 -- themes/light/assets/js/common/init.js | 157 -------- themes/light/assets/js/config/init.js | 60 --- themes/light/assets/js/index.js.map | 1 - themes/light/assets/js/lib/formwizard.js | 201 ---------- themes/light/assets/js/lib/lazyload.js | 368 ------------------ themes/light/assets/js/medusa-runtime.js.map | 1 - themes/light/assets/js/parsers.js | 92 ----- themes/light/assets/js/rating-tooltip.js | 29 -- .../assets/js/scene-exceptions-tooltip.js | 40 -- ...rc_components_config-backup-restore_vue.js | 66 ---- .../js/src_components_config-subtitles_vue.js | 66 ---- .../src_components_current-downloads_vue.js | 97 ----- .../js/src_components_log-reporter_vue.js | 66 ---- ..._components_manage-failed-downloads_vue.js | 97 ----- .../src_components_manage-mass-update_vue.js | 65 ---- ...components_manage-missing-subtitles_vue.js | 97 ----- ...rc_components_manage_change-indexer_vue.js | 66 ---- .../js/src_components_test-rename_vue.js | 66 ---- themes/light/assets/js/vender.js.LICENSE.txt | 265 ------------- themes/light/assets/js/vender.js.map | 1 - themes/light/assets/js/vendors.js.LICENSE.txt | 177 --------- themes/light/assets/js/vendors.js.map | 1 - .../light/assets/js/vendors~date-fns.js.map | 1 - themes/light/templates/index.mako | 19 +- 75 files changed, 13 insertions(+), 5884 deletions(-) delete mode 100644 themes-default/slim/static/js/add-show-options.js delete mode 100644 themes-default/slim/static/js/blackwhite.js delete mode 100644 themes-default/slim/static/js/common/init.js delete mode 100644 themes-default/slim/static/js/config/init.js delete mode 100644 themes-default/slim/static/js/lib/formwizard.js delete mode 100644 themes-default/slim/static/js/lib/lazyload.js delete mode 100644 themes-default/slim/static/js/parsers.js delete mode 100644 themes-default/slim/static/js/rating-tooltip.js delete mode 100644 themes-default/slim/static/js/scene-exceptions-tooltip.js delete mode 100644 themes/dark/assets/js/add-show-options.js delete mode 100644 themes/dark/assets/js/add-shows/init.js delete mode 100644 themes/dark/assets/js/add-shows/popular-shows.js delete mode 100644 themes/dark/assets/js/add-shows/recommended-shows.js delete mode 100644 themes/dark/assets/js/add-shows/trending-shows.js delete mode 100644 themes/dark/assets/js/app.js.map delete mode 100644 themes/dark/assets/js/blackwhite.js delete mode 100644 themes/dark/assets/js/common/init.js delete mode 100644 themes/dark/assets/js/config/init.js delete mode 100644 themes/dark/assets/js/index.js.map delete mode 100644 themes/dark/assets/js/lib/formwizard.js delete mode 100644 themes/dark/assets/js/lib/lazyload.js delete mode 100644 themes/dark/assets/js/medusa-runtime.js.map delete mode 100644 themes/dark/assets/js/parsers.js delete mode 100644 themes/dark/assets/js/rating-tooltip.js delete mode 100644 themes/dark/assets/js/scene-exceptions-tooltip.js delete mode 100644 themes/dark/assets/js/src_components_config-backup-restore_vue.js delete mode 100644 themes/dark/assets/js/src_components_config-subtitles_vue.js delete mode 100644 themes/dark/assets/js/src_components_current-downloads_vue.js delete mode 100644 themes/dark/assets/js/src_components_log-reporter_vue.js delete mode 100644 themes/dark/assets/js/src_components_manage-failed-downloads_vue.js delete mode 100644 themes/dark/assets/js/src_components_manage-mass-update_vue.js delete mode 100644 themes/dark/assets/js/src_components_manage-missing-subtitles_vue.js delete mode 100644 themes/dark/assets/js/src_components_manage_change-indexer_vue.js delete mode 100644 themes/dark/assets/js/src_components_test-rename_vue.js delete mode 100644 themes/dark/assets/js/vender.js.LICENSE.txt delete mode 100644 themes/dark/assets/js/vender.js.map delete mode 100644 themes/dark/assets/js/vendors.js.LICENSE.txt delete mode 100644 themes/dark/assets/js/vendors.js.map delete mode 100644 themes/dark/assets/js/vendors~date-fns.js.map delete mode 100644 themes/light/assets/js/add-show-options.js delete mode 100644 themes/light/assets/js/add-shows/init.js delete mode 100644 themes/light/assets/js/add-shows/popular-shows.js delete mode 100644 themes/light/assets/js/add-shows/recommended-shows.js delete mode 100644 themes/light/assets/js/add-shows/trending-shows.js delete mode 100644 themes/light/assets/js/app.js.map delete mode 100644 themes/light/assets/js/blackwhite.js delete mode 100644 themes/light/assets/js/common/init.js delete mode 100644 themes/light/assets/js/config/init.js delete mode 100644 themes/light/assets/js/index.js.map delete mode 100644 themes/light/assets/js/lib/formwizard.js delete mode 100644 themes/light/assets/js/lib/lazyload.js delete mode 100644 themes/light/assets/js/medusa-runtime.js.map delete mode 100644 themes/light/assets/js/parsers.js delete mode 100644 themes/light/assets/js/rating-tooltip.js delete mode 100644 themes/light/assets/js/scene-exceptions-tooltip.js delete mode 100644 themes/light/assets/js/src_components_config-backup-restore_vue.js delete mode 100644 themes/light/assets/js/src_components_config-subtitles_vue.js delete mode 100644 themes/light/assets/js/src_components_current-downloads_vue.js delete mode 100644 themes/light/assets/js/src_components_log-reporter_vue.js delete mode 100644 themes/light/assets/js/src_components_manage-failed-downloads_vue.js delete mode 100644 themes/light/assets/js/src_components_manage-mass-update_vue.js delete mode 100644 themes/light/assets/js/src_components_manage-missing-subtitles_vue.js delete mode 100644 themes/light/assets/js/src_components_manage_change-indexer_vue.js delete mode 100644 themes/light/assets/js/src_components_test-rename_vue.js delete mode 100644 themes/light/assets/js/vender.js.LICENSE.txt delete mode 100644 themes/light/assets/js/vender.js.map delete mode 100644 themes/light/assets/js/vendors.js.LICENSE.txt delete mode 100644 themes/light/assets/js/vendors.js.map delete mode 100644 themes/light/assets/js/vendors~date-fns.js.map diff --git a/themes-default/slim/src/app.js b/themes-default/slim/src/app.js index 1949353fa3..d050e9d734 100644 --- a/themes-default/slim/src/app.js +++ b/themes-default/slim/src/app.js @@ -10,6 +10,11 @@ import { App } from './components'; Vue.config.devtools = true; Vue.config.performance = true; +if (document.body.getAttribute('developer') === 'True') { + Vue.config.devtools = true; + Vue.config.performance = true; +} + registerPlugins(); // @TODO: Remove this before v1.0.0 diff --git a/themes-default/slim/static/js/add-show-options.js b/themes-default/slim/static/js/add-show-options.js deleted file mode 100644 index f010f0df92..0000000000 --- a/themes-default/slim/static/js/add-show-options.js +++ /dev/null @@ -1,37 +0,0 @@ -$(document).ready(() => { - $(document.body).on('click', '#saveDefaultsButton', event => { - const anyQualArray = []; - const bestQualArray = []; - $('select[name="allowed_qualities"] option:selected').each((i, d) => { - anyQualArray.push($(d).val()); - }); - $('select[name="preferred_qualities"] option:selected').each((i, d) => { - bestQualArray.push($(d).val()); - }); - - const data = { - default_status: $('#statusSelect').val(), // eslint-disable-line camelcase - allowed_qualities: anyQualArray.join(','), // eslint-disable-line camelcase - preferred_qualities: bestQualArray.join(','), // eslint-disable-line camelcase - default_season_folders: $('#season_folders').prop('checked'), // eslint-disable-line camelcase - subtitles: $('#subtitles').prop('checked'), - anime: $('#anime').prop('checked'), - scene: $('#scene').prop('checked'), - default_status_after: $('#statusSelectAfter').val() // eslint-disable-line camelcase - }; - - // @TODO: Move this to API - $.get('config/general/saveAddShowDefaults', data); - - $(event.currentTarget).prop('disabled', true); - new PNotify({ // eslint-disable-line no-new - title: 'Saved Defaults', - text: 'Your "add show" defaults have been set to your current selections.', - shadow: false - }); - }); - - $(document.body).on('change', '#statusSelect, select[name="quality_preset"], #season_folders, select[name="allowed_qualities"], select[name="preferred_qualities"], #subtitles, #scene, #anime, #statusSelectAfter', () => { - $('#saveDefaultsButton').prop('disabled', false); - }); -}); diff --git a/themes-default/slim/static/js/blackwhite.js b/themes-default/slim/static/js/blackwhite.js deleted file mode 100644 index e986815442..0000000000 --- a/themes-default/slim/static/js/blackwhite.js +++ /dev/null @@ -1,43 +0,0 @@ -$(document).ready(() => { - $('#removeW').on('click', () => { - !$('#white option:selected').remove().appendTo('#pool'); // eslint-disable-line no-unused-expressions - }); - - $('#addW').on('click', () => { - !$('#pool option:selected').remove().appendTo('#white'); // eslint-disable-line no-unused-expressions - }); - - $('#addB').on('click', () => { - !$('#pool option:selected').remove().appendTo('#black'); // eslint-disable-line no-unused-expressions - }); - - $('#removeP').on('click', () => { - !$('#pool option:selected').remove(); // eslint-disable-line no-unused-expressions - }); - - $('#removeB').on('click', () => { - !$('#black option:selected').remove().appendTo('#pool'); // eslint-disable-line no-unused-expressions - }); - - $('#addToWhite').on('click', () => { - const group = $('#addToPoolText').val(); - if (group !== '') { - const option = $('