added global alias for js folders, removed modules folder in js

This commit is contained in:
Roberto Tonino 2020-06-24 19:10:10 +02:00
parent e32b7b7959
commit 2cb0986928
23 changed files with 117 additions and 100 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ __pycache__
.DS_Store
node_modules
jsconfig.json
# pyinstaller build dirs
/dist

File diff suppressed because one or more lines are too long

View File

@ -25,6 +25,14 @@ export default {
{
find: 'vue',
replacement: 'vue/dist/vue.esm'
},
{
find: '@',
replacement: __dirname + '/src'
},
{
find: '@components',
replacement: __dirname + '/src/js/components'
}
]
}),

View File

@ -1,25 +1,27 @@
// Global Vue components
import './modules/components/LoadingPlaceholder.js'
import '@components/LoadingPlaceholder.js'
// Vue views components
import './modules/components/artist-tab.js'
import './modules/components/charts-tab.js'
import './modules/components/errors-tab.js'
import './modules/components/favorites-tab.js'
import './modules/components/home-tab.js'
import './modules/components/link-analyzer-tab.js'
import './modules/components/main-search.js'
import './modules/components/settings-tab.js'
import './modules/components/tracklist-tab.js'
import '@components/artist-tab.js'
import '@components/charts-tab.js'
import '@components/errors-tab.js'
import '@components/favorites-tab.js'
import '@components/home-tab.js'
import '@components/link-analyzer-tab.js'
import '@components/main-search.js'
import '@components/settings-tab.js'
import '@components/tracklist-tab.js'
import '@components/TestComponent.vue'
import $ from 'jquery'
import { socket } from './modules/socket.js'
import { toast } from './modules/toasts.js'
import Downloads from './modules/downloads.js'
import QualityModal from './modules/quality-modal.js'
import Tabs from './modules/tabs.js'
import Search from './modules/search.js'
import TrackPreview from './modules/track-preview.js'
import { socket } from '@/js/socket.js'
import { toast } from '@/js/toasts.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import Tabs from '@/js/tabs.js'
import Search from '@/js/search.js'
import TrackPreview from '@/js/track-preview.js'
/* ===== App initialization ===== */

View File

@ -1,9 +1,9 @@
import { isEmpty, orderBy } from 'lodash-es'
import Vue from 'vue'
import { socket } from '../socket.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import { showView } from '../tabs.js'
import { socket } from '@/js/socket.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import { showView } from '@/js/tabs.js'
const ArtistTab = new Vue({
data() {

View File

@ -1,10 +1,10 @@
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import TrackPreview from '../track-preview.js'
import Utils from '../utils.js'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import TrackPreview from '@/js/track-preview.js'
import Utils from '@/js/utils.js'
const ChartsTab = new Vue({
data() {

View File

@ -1,11 +1,11 @@
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import TrackPreview from '../track-preview.js'
import Utils from '../utils.js'
import { toast } from '../toasts'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import TrackPreview from '@/js/track-preview.js'
import Utils from '@/js/utils.js'
import { toast } from '@/js/toasts'
const FavoritesTab = new Vue({
data() {

View File

@ -1,10 +1,8 @@
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
// import TrackPreview from '../track-preview.js'
// import Utils from '../utils.js'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
const HomeTab = new Vue({
data() {

View File

@ -1,7 +1,7 @@
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Utils from '../utils.js'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Utils from '@/js/utils.js'
const LinkAnalyzerTab = new Vue({
data() {

View File

@ -1,10 +1,10 @@
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import TrackPreview from '../track-preview.js'
import Utils from '../utils.js'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import TrackPreview from '@/js/track-preview.js'
import Utils from '@/js/utils.js'
const MainSearch = new Vue({
data: {

View File

@ -1,7 +1,7 @@
import Vue from 'vue'
import { toast } from '../toasts.js'
import { socket } from '../socket.js'
import TestComponent from './TestComponent.vue'
import { toast } from '@/js/toasts.js'
import { socket } from '@/js/socket.js'
import TestComponent from '@components/TestComponent.vue'
const SettingsTab = new Vue({
components: {
@ -81,7 +81,9 @@ const SettingsTab = new Vue({
},
accountChanged(user, accountNum) {
this.$refs.username.innerText = user.name
this.$refs.userpicture.src = `https://e-cdns-images.dzcdn.net/images/user/${user.picture}/125x125-000000-80-0-0.jpg`
this.$refs.userpicture.src = `https://e-cdns-images.dzcdn.net/images/user/${
user.picture
}/125x125-000000-80-0-0.jpg`
this.accountNum = accountNum
localStorage.setItem('accountNum', this.accountNum)
},

View File

@ -1,11 +1,11 @@
import { isEmpty } from 'lodash-es'
import Vue from 'vue'
import { socket } from '../socket.js'
import { showView } from '../tabs.js'
import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import TrackPreview from '../track-preview.js'
import Utils from '../utils.js'
import { socket } from '@/js/socket.js'
import { showView } from '@/js/tabs.js'
import Downloads from '@/js/downloads.js'
import QualityModal from '@/js/quality-modal.js'
import TrackPreview from '@/js/track-preview.js'
import Utils from '@/js/utils.js'
const TracklistTab = new Vue({
data: () => ({

View File

@ -1,7 +1,7 @@
import $ from 'jquery'
import { socket } from './socket.js'
import { toast } from './toasts.js'
import { showErrors } from './tabs.js'
import { socket } from '@/js/socket.js'
import { toast } from '@/js/toasts.js'
import { showErrors } from '@/js/tabs.js'
/* ===== Locals ===== */
const tabMinWidth = 250
@ -141,7 +141,9 @@ function addToQueue(queueItem, current = false) {
$('#bar_' + queueItem.uuid).css('width', queueItem.progress + '%')
if (queueItem.failed >= 1 && $('#download_' + queueItem.uuid + ' .queue_failed').length == 0) {
$('#download_' + queueItem.uuid + ' .download_info_status').append(
`<span class="secondary-text inline-flex"><span class="download_slim_separator">(</span><span class="queue_failed_button inline-flex"><span class="queue_failed">${queueItem.failed}</span><i class="material-icons">error_outline</i></span><span class="download_slim_separator">)</span></span>`
`<span class="secondary-text inline-flex"><span class="download_slim_separator">(</span><span class="queue_failed_button inline-flex"><span class="queue_failed">${
queueItem.failed
}</span><i class="material-icons">error_outline</i></span><span class="download_slim_separator">)</span></span>`
)
}
if (queueItem.downloaded + queueItem.failed == queueItem.size) {

View File

@ -1,4 +1,4 @@
import Downloads from './downloads.js'
import Downloads from '@/js/downloads.js'
const QualityModal = {
// Defaults

View File

@ -1,9 +1,9 @@
import MainSearch from './components/main-search.js'
import Utils from './utils.js'
import QualityModal from './quality-modal.js'
import Downloads from './downloads.js'
import { socket } from './socket.js'
import Tabs from './tabs.js'
import MainSearch from '@components/main-search.js'
import Utils from '@/js/utils.js'
import QualityModal from '@/js/quality-modal.js'
import Downloads from '@/js/downloads.js'
import { socket } from '@/js/socket.js'
import Tabs from '@/js/tabs.js'
function linkListeners() {
document.getElementById('content').addEventListener('scroll', Utils.debounce(handleContentScroll, 100))

View File

@ -1,11 +1,11 @@
import ArtistTab from './components/artist-tab.js'
import TracklistTab from './components/tracklist-tab.js'
import LinkAnalyzerTab from './components/link-analyzer-tab.js'
import ErrorsTab from './components/errors-tab.js'
import { socket } from './socket.js'
import SettingsTab from './components/settings-tab.js'
import MainSearch from './components/main-search.js'
import TrackPreview from './track-preview.js'
import ArtistTab from '@components/artist-tab.js'
import TracklistTab from '@components/tracklist-tab.js'
import LinkAnalyzerTab from '@components/link-analyzer-tab.js'
import ErrorsTab from '@components/errors-tab.js'
import SettingsTab from '@components/settings-tab.js'
import MainSearch from '@components/main-search.js'
import { socket } from '@/js/socket.js'
import TrackPreview from '@/js/track-preview.js'
/* ===== Globals ====== */
window.search_selected = ''
@ -242,7 +242,10 @@ function showTab(type, id, back = false) {
if (windows_stack.length == 0) {
windows_stack.push({ tab: main_selected })
} else if (!back) {
if (currentStack.type === 'artist') currentStack.selected = ArtistTab.getCurrentTab()
if (currentStack.type === 'artist') {
currentStack.selected = ArtistTab.getCurrentTab()
}
windows_stack.push(currentStack)
}
@ -254,6 +257,7 @@ function showTab(type, id, back = false) {
for (let i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = 'none'
}
document.getElementById(tab).style.display = 'block'
TrackPreview.stopStackedTabsPreview()
}