mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	alt properties and fix linting
This commit is contained in:
		
							parent
							
								
									408294502f
								
							
						
					
					
						commit
						77268242f6
					
				
					 5 changed files with 30 additions and 26 deletions
				
			
		
							
								
								
									
										11
									
								
								src/App.vue
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/App.vue
									
										
									
									
									
								
							| 
						 | 
					@ -1,13 +1,10 @@
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
    <div
 | 
					    <div class="uk-container uk-container-expand uk-light uk-height-viewport" style="background: #0b0e0f">
 | 
				
			||||||
        class="uk-container uk-container-expand uk-light uk-height-viewport"
 | 
					 | 
				
			||||||
        style="background: #0b0e0f"
 | 
					 | 
				
			||||||
    >
 | 
					 | 
				
			||||||
        <Navigation />
 | 
					        <Navigation />
 | 
				
			||||||
        <router-view />
 | 
					        <router-view />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div style="text-align: center">
 | 
					        <div style="text-align: center">
 | 
				
			||||||
            <a href="https://github.com/TeamPiped/Piped">
 | 
					            <a aria-label="GitHub" href="https://github.com/TeamPiped/Piped">
 | 
				
			||||||
                <font-awesome-icon :icon="['fab', 'github']"></font-awesome-icon>
 | 
					                <font-awesome-icon :icon="['fab', 'github']"></font-awesome-icon>
 | 
				
			||||||
            </a>
 | 
					            </a>
 | 
				
			||||||
             
 | 
					             
 | 
				
			||||||
| 
						 | 
					@ -23,8 +20,8 @@
 | 
				
			||||||
import Navigation from "@/components/Navigation";
 | 
					import Navigation from "@/components/Navigation";
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    components: {
 | 
					    components: {
 | 
				
			||||||
        Navigation
 | 
					        Navigation,
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,12 @@
 | 
				
			||||||
<template
 | 
					<template>
 | 
				
			||||||
    ><nav
 | 
					    <nav
 | 
				
			||||||
        class="uk-navbar-container uk-container-expand uk-position-relative uk-light"
 | 
					        class="uk-navbar-container uk-container-expand uk-position-relative uk-light"
 | 
				
			||||||
        style="background: #0b0e0f"
 | 
					        style="background: #0b0e0f"
 | 
				
			||||||
        uk-navbar
 | 
					        uk-navbar
 | 
				
			||||||
    >
 | 
					    >
 | 
				
			||||||
        <div class="uk-navbar-left">
 | 
					        <div class="uk-navbar-left">
 | 
				
			||||||
            <router-link class="uk-navbar-item uk-logo uk-text-bold" to="/"
 | 
					            <router-link class="uk-navbar-item uk-logo uk-text-bold" to="/"
 | 
				
			||||||
                ><img src="/img/icons/logo.svg" height="32" width="32" />iped</router-link
 | 
					                ><img alt="logo" src="/img/icons/logo.svg" height="32" width="32" />iped</router-link
 | 
				
			||||||
            >
 | 
					            >
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <div class="uk-navbar-center uk-flex uk-visible@m">
 | 
					        <div class="uk-navbar-center uk-flex uk-visible@m">
 | 
				
			||||||
| 
						 | 
					@ -58,12 +58,12 @@ import SearchSuggestions from "@/components/SearchSuggestions";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    components: {
 | 
					    components: {
 | 
				
			||||||
        SearchSuggestions
 | 
					        SearchSuggestions,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            searchText: "",
 | 
					            searchText: "",
 | 
				
			||||||
            suggestionsVisible: false
 | 
					            suggestionsVisible: false,
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
| 
						 | 
					@ -71,7 +71,7 @@ export default {
 | 
				
			||||||
            if (e.key === "Enter") {
 | 
					            if (e.key === "Enter") {
 | 
				
			||||||
                this.$router.push({
 | 
					                this.$router.push({
 | 
				
			||||||
                    name: "SearchResults",
 | 
					                    name: "SearchResults",
 | 
				
			||||||
                    query: { search_query: this.searchText }
 | 
					                    query: { search_query: this.searchText },
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
 | 
					            } else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
 | 
				
			||||||
| 
						 | 
					@ -87,8 +87,8 @@ export default {
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        onSearchTextChange(searchText) {
 | 
					        onSearchTextChange(searchText) {
 | 
				
			||||||
            this.searchText = searchText;
 | 
					            this.searchText = searchText;
 | 
				
			||||||
        }
 | 
					        },
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -20,12 +20,12 @@ import Constants from "@/Constants.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
    props: {
 | 
					    props: {
 | 
				
			||||||
        searchText: String
 | 
					        searchText: String,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            selected: 0,
 | 
					            selected: 0,
 | 
				
			||||||
            searchSuggestions: []
 | 
					            searchSuggestions: [],
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,7 @@ export default {
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        async refreshSuggestions() {
 | 
					        async refreshSuggestions() {
 | 
				
			||||||
            this.searchSuggestions = await this.fetchJson(
 | 
					            this.searchSuggestions = await this.fetchJson(
 | 
				
			||||||
                Constants.BASE_URL + "/suggestions?query=" + encodeURI(this.searchText)
 | 
					                Constants.BASE_URL + "/suggestions?query=" + encodeURI(this.searchText),
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
            this.searchSuggestions.unshift(this.searchText);
 | 
					            this.searchSuggestions.unshift(this.searchText);
 | 
				
			||||||
            this.setSelected(0);
 | 
					            this.setSelected(0);
 | 
				
			||||||
| 
						 | 
					@ -64,14 +64,14 @@ export default {
 | 
				
			||||||
            this.setSelected(i);
 | 
					            this.setSelected(i);
 | 
				
			||||||
            this.$router.push({
 | 
					            this.$router.push({
 | 
				
			||||||
                name: "SearchResults",
 | 
					                name: "SearchResults",
 | 
				
			||||||
                query: { search_query: this.searchSuggestions[i] }
 | 
					                query: { search_query: this.searchSuggestions[i] },
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        setSelected(val) {
 | 
					        setSelected(val) {
 | 
				
			||||||
            this.selected = val;
 | 
					            this.selected = val;
 | 
				
			||||||
            this.$emit("searchchange", this.searchSuggestions[this.selected]);
 | 
					            this.$emit("searchchange", this.searchSuggestions[this.selected]);
 | 
				
			||||||
        }
 | 
					        },
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,14 @@
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
            <div class="uk-text-secondary" style="background: #0b0e0f">
 | 
					            <div class="uk-text-secondary" style="background: #0b0e0f">
 | 
				
			||||||
                <router-link class="uk-text-emphasis" v-bind:to="video.url || '/'">
 | 
					                <router-link class="uk-text-emphasis" v-bind:to="video.url || '/'">
 | 
				
			||||||
                    <img height="118" width="210" style="width: 100%" v-bind:src="video.thumbnail" loading="lazy" />
 | 
					                    <img
 | 
				
			||||||
 | 
					                        height="118"
 | 
				
			||||||
 | 
					                        width="210"
 | 
				
			||||||
 | 
					                        style="width: 100%"
 | 
				
			||||||
 | 
					                        v-bind:src="video.thumbnail"
 | 
				
			||||||
 | 
					                        alt="thumbnail"
 | 
				
			||||||
 | 
					                        loading="lazy"
 | 
				
			||||||
 | 
					                    />
 | 
				
			||||||
                    <p>{{ video.title }}</p>
 | 
					                    <p>{{ video.title }}</p>
 | 
				
			||||||
                </router-link>
 | 
					                </router-link>
 | 
				
			||||||
                <router-link class="uk-link-muted" v-bind:to="video.uploaderUrl || '/'">
 | 
					                <router-link class="uk-link-muted" v-bind:to="video.uploaderUrl || '/'">
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,12 +11,12 @@ import("uikit/dist/js/uikit-core.min");
 | 
				
			||||||
import router from "@/router/router";
 | 
					import router from "@/router/router";
 | 
				
			||||||
import App from "./App.vue";
 | 
					import App from "./App.vue";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "./registerServiceWorker";
 | 
					import("./registerServiceWorker");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const mixin = {
 | 
					const mixin = {
 | 
				
			||||||
    methods: {
 | 
					    methods: {
 | 
				
			||||||
        timeFormat: function(duration) {
 | 
					        timeFormat: function (duration) {
 | 
				
			||||||
            var pad = function(num, size) {
 | 
					            var pad = function (num, size) {
 | 
				
			||||||
                return ("000" + num).slice(size * -1);
 | 
					                return ("000" + num).slice(size * -1);
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@ const mixin = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return str;
 | 
					            return str;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        fetchJson: function(url, options) {
 | 
					        fetchJson: function (url, options) {
 | 
				
			||||||
            return fetch(url, options).then(response => {
 | 
					            return fetch(url, options).then(response => {
 | 
				
			||||||
                return response.json();
 | 
					                return response.json();
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue