Prettified Code!
This commit is contained in:
parent
ef6508d19b
commit
12fa15242c
13 changed files with 108 additions and 242 deletions
|
@ -9,35 +9,60 @@ export const i18nEditor = Vue.component("i18n-editor", {
|
|||
<h1>i18n Editor</h1>
|
||||
</div>
|
||||
<div class="col-auto nopadding selectCol">
|
||||
<select class="md-select" @change="$root.setLz('');$root.setLzManual()" v-model="$root.cfg.general.language">
|
||||
<optgroup :label="index" v-for="(categories, index) in getLanguages()">
|
||||
<option v-for="lang in categories" :value="lang.code">{{lang.nameNative}} ({{lang.nameEnglish }})</option>
|
||||
<select
|
||||
class="md-select"
|
||||
@change="$root.setLz('');$root.setLzManual()"
|
||||
v-model="$root.cfg.general.language">
|
||||
<optgroup
|
||||
:label="index"
|
||||
v-for="(categories, index) in getLanguages()">
|
||||
<option
|
||||
v-for="lang in categories"
|
||||
:value="lang.code">
|
||||
{{lang.nameNative}} ({{lang.nameEnglish }})
|
||||
</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
<button class="md-btn" @click="exportLz">Export</button>
|
||||
<button
|
||||
class="md-btn"
|
||||
@click="exportLz">
|
||||
Export
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="md-option-container">
|
||||
<template v-for="(val, key) in baseLz">
|
||||
<div class="md-option-line" v-if="$root.lz[key]">
|
||||
<div
|
||||
class="md-option-line"
|
||||
v-if="$root.lz[key]">
|
||||
<div class="md-option-segment">{{ key }}</div>
|
||||
<div class="md-option-segment">
|
||||
<template v-if='typeof $root.lz[key] == "object"'>
|
||||
<div v-for="(variant, vkey) in $root.lz[key]">
|
||||
{{variant}}
|
||||
<input type="text" v-model="$root.lz[key][vkey]" />
|
||||
<input
|
||||
type="text"
|
||||
v-model="$root.lz[key][vkey]" />
|
||||
</div>
|
||||
</template>
|
||||
<textarea type="text" v-model="$root.lz[key]" v-else></textarea>
|
||||
<textarea
|
||||
type="text"
|
||||
v-model="$root.lz[key]"
|
||||
v-else></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-option-line" v-else>
|
||||
<div
|
||||
class="md-option-line"
|
||||
v-else>
|
||||
<div class="md-option-segment">
|
||||
<b>{{ key }}</b>
|
||||
</div>
|
||||
<div class="md-option-segment">
|
||||
<textarea type="text" v-model="$root.lz[key]" :placeholder="val"></textarea>
|
||||
<textarea
|
||||
type="text"
|
||||
v-model="$root.lz[key]"
|
||||
:placeholder="val"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -2,8 +2,14 @@ import { html } from "../html.js";
|
|||
|
||||
export const sidebarLibraryItem = Vue.component("sidebar-library-item", {
|
||||
template: html`
|
||||
<button class="app-sidebar-item" :class="$root.getSidebarItemClass(page)" @click="$root.setWindowHash(page)">
|
||||
<svg-icon :url="svgIconData" :name="'sidebar-' + svgIconName" v-if="svgIconData != ''" />
|
||||
<button
|
||||
class="app-sidebar-item"
|
||||
:class="$root.getSidebarItemClass(page)"
|
||||
@click="$root.setWindowHash(page)">
|
||||
<svg-icon
|
||||
:url="svgIconData"
|
||||
:name="'sidebar-' + svgIconName"
|
||||
v-if="svgIconData != ''" />
|
||||
<span class="sidebar-item-text">{{ name }}</span>
|
||||
</button>
|
||||
`,
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
import { html } from "../html.js";
|
||||
|
||||
export const svgIcon = Vue.component("svg-icon", {
|
||||
template: html` <div class="_svg-icon" :class="classes" :svg-name="name" :style="{'--icon': 'url(' + url + ')'}"></div> `,
|
||||
template: html`
|
||||
<div
|
||||
class="_svg-icon"
|
||||
:class="classes"
|
||||
:svg-name="name"
|
||||
:style="{'--icon': 'url(' + url + ')'}"></div>
|
||||
`,
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
|
|
|
@ -3104,9 +3104,7 @@ const app = new Vue({
|
|||
return;
|
||||
}
|
||||
try {
|
||||
let mfu = await app.mk.api.v3.music(
|
||||
"/v1/me/library/playlists?platform=web&extend=editorialVideo&fields%5Bplaylists%5D=lastModifiedDate&filter%5Bfeatured%5D=made-for-you&include%5Blibrary-playlists%5D=catalog&fields%5Blibrary-playlists%5D=artwork%2Cname%2CplayParams%2CdateAdded"
|
||||
);
|
||||
let mfu = await app.mk.api.v3.music("/v1/me/library/playlists?platform=web&extend=editorialVideo&fields%5Bplaylists%5D=lastModifiedDate&filter%5Bfeatured%5D=made-for-you&include%5Blibrary-playlists%5D=catalog&fields%5Blibrary-playlists%5D=artwork%2Cname%2CplayParams%2CdateAdded");
|
||||
this.madeforyou = mfu.data;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
@ -3286,10 +3284,7 @@ const app = new Vue({
|
|||
let id,
|
||||
songLang = "";
|
||||
try {
|
||||
if (
|
||||
jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 &&
|
||||
jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200
|
||||
) {
|
||||
if (jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["header"]["status_code"] == 200 && jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["header"]["status_code"] == 200) {
|
||||
id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["track_id"] ?? "";
|
||||
lrcfile = jsonResponse["message"]["body"]["macro_calls"]["track.subtitles.get"]["message"]["body"]["subtitle_list"][0]["subtitle"]["subtitle_body"];
|
||||
vanity_id = jsonResponse["message"]["body"]["macro_calls"]["matcher.track.get"]["message"]["body"]["track"]["commontrack_vanity_id"];
|
||||
|
@ -4202,13 +4197,7 @@ const app = new Vue({
|
|||
}
|
||||
this.currentArtUrl = "";
|
||||
this.currentArtUrlRaw = "";
|
||||
if (
|
||||
app.mk.nowPlayingItem != null &&
|
||||
app.mk.nowPlayingItem.attributes != null &&
|
||||
app.mk.nowPlayingItem.attributes.artwork != null &&
|
||||
app.mk.nowPlayingItem.attributes.artwork.url != null &&
|
||||
app.mk.nowPlayingItem.attributes.artwork.url != ""
|
||||
) {
|
||||
if (app.mk.nowPlayingItem != null && app.mk.nowPlayingItem.attributes != null && app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url != "") {
|
||||
this.currentArtUrlRaw = this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? "";
|
||||
this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? "").replace("{w}", artworkSize).replace("{h}", artworkSize);
|
||||
if (this.mk.nowPlayingItem._assets[0].artworkURL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue