Merge branch 'main' of https://github.com/ciderapp/Cider
This commit is contained in:
commit
b0f65224dd
11 changed files with 1151 additions and 783 deletions
BIN
src/renderer/assets/oobe/maverick.png
Normal file
BIN
src/renderer/assets/oobe/maverick.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 346 KiB |
BIN
src/renderer/assets/oobe/mojave.png
Normal file
BIN
src/renderer/assets/oobe/mojave.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 326 KiB |
Binary file not shown.
Before Width: | Height: | Size: 168 KiB |
Binary file not shown.
Before Width: | Height: | Size: 164 KiB |
|
@ -117,35 +117,35 @@ function fallbackinitMusicKit() {
|
|||
);
|
||||
request.send();
|
||||
}
|
||||
document.addEventListener("musickitloaded", function () {
|
||||
console.log("MusicKit loaded");
|
||||
// MusicKit global is now defined
|
||||
function initMusicKit() {
|
||||
let parsedJson = JSON.parse(this.responseText);
|
||||
MusicKit.configure({
|
||||
developerToken: parsedJson.token,
|
||||
app: {
|
||||
name: "Apple Music",
|
||||
build: "1978.4.1",
|
||||
version: "1.0",
|
||||
},
|
||||
sourceType: 24,
|
||||
suppressErrorDialog: true,
|
||||
}).then(() => {
|
||||
function waitForApp() {
|
||||
if (typeof app.init !== "undefined") {
|
||||
app.init();
|
||||
if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
app.spawnMica();
|
||||
}
|
||||
} else {
|
||||
setTimeout(waitForApp, 250);
|
||||
}
|
||||
}
|
||||
waitForApp();
|
||||
});
|
||||
}
|
||||
|
||||
function initMusicKit() {
|
||||
|
||||
let parsedJson = JSON.parse(this.responseText);
|
||||
MusicKit.configure({
|
||||
developerToken: parsedJson.token,
|
||||
app: {
|
||||
name: "Apple Music",
|
||||
build: "1978.4.1",
|
||||
version: "1.0",
|
||||
},
|
||||
sourceType: 24,
|
||||
suppressErrorDialog: true,
|
||||
}).then(() => {
|
||||
function waitForApp() {
|
||||
if (typeof app.init !== "undefined") {
|
||||
app.init();
|
||||
if (app.cfg.visual.window_background_style == "mica" && !app.isDev) {
|
||||
app.spawnMica();
|
||||
}
|
||||
} else {
|
||||
setTimeout(waitForApp, 250);
|
||||
}
|
||||
}
|
||||
waitForApp();
|
||||
});
|
||||
}
|
||||
|
||||
function capiInit() {
|
||||
const request = new XMLHttpRequest();
|
||||
request.timeout = 5000;
|
||||
request.addEventListener("load", initMusicKit);
|
||||
|
@ -156,13 +156,17 @@ document.addEventListener("musickitloaded", function () {
|
|||
};
|
||||
request.open("GET", "https://api.cider.sh/v1/");
|
||||
request.send();
|
||||
}
|
||||
|
||||
// check for widevine failure and reconfigure the instance.
|
||||
window.addEventListener("drmUnsupported", function () {
|
||||
initMusicKit();
|
||||
});
|
||||
document.addEventListener("musickitloaded", function () {
|
||||
if (showOobe()) return;
|
||||
console.log("MusicKit loaded");
|
||||
// MusicKit global is now defined
|
||||
capiInit()
|
||||
});
|
||||
window.addEventListener("drmUnsupported", function () {
|
||||
initMusicKit();
|
||||
});
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
// Use the window load event to keep the page load performant
|
||||
window.addEventListener("load", () => {
|
||||
|
@ -251,7 +255,7 @@ var checkIfScrollIsStatic = setInterval(() => {
|
|||
// do something
|
||||
}
|
||||
position = document.getElementsByClassName("lyric-body")[0].scrollTop;
|
||||
} catch (e) {}
|
||||
} catch (e) { }
|
||||
}, 50);
|
||||
|
||||
// WebGPU Console Notification
|
||||
|
@ -287,6 +291,22 @@ function isJson(item) {
|
|||
|
||||
webGPU().then();
|
||||
|
||||
function showOobe() {
|
||||
if (localStorage.getItem("music.ampwebplay.media-user-token") && localStorage.getItem("seenOOBE")) {
|
||||
return false
|
||||
} else {
|
||||
function waitForApp() {
|
||||
if (typeof app.init !== "undefined") {
|
||||
app.oobeInit();
|
||||
} else {
|
||||
setTimeout(waitForApp, 250);
|
||||
}
|
||||
}
|
||||
waitForApp();
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
let screenWidth = screen.width;
|
||||
let screenHeight = screen.height;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -629,7 +629,9 @@ const app = new Vue({
|
|||
},
|
||||
async init() {
|
||||
let self = this
|
||||
|
||||
if(!localStorage.getItem("seenOOBE")) {
|
||||
localStorage.setItem("seenOOBE", 1)
|
||||
}
|
||||
if (this.cfg.visual.styles.length != 0) {
|
||||
await this.reloadStyles()
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<%- include('../svg/chevron-right.svg') %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="app-chrome-item" v-if="cfg.advanced.experiments.includes('collapseSidebar')">
|
||||
<div class="app-chrome-item" v-if="getThemeDirective('windowLayout') == 'twopanel'">
|
||||
<button
|
||||
class="playback-button collapseLibrary"
|
||||
v-b-tooltip.hover
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script type="text/x-template" id="cider-oobe">
|
||||
<div class="content-inner oobe">
|
||||
<!-- before_we_start-->
|
||||
<transition name="wpfade">
|
||||
<!-- <transition name=""> -->
|
||||
<div class="oobe-view" v-if="screen == 'before_we_start'">
|
||||
<div class="oobe-header">
|
||||
{{ getLz("oobe.amupsell.title") }}
|
||||
|
@ -13,10 +13,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
|
||||
<!-- Welcome -->
|
||||
<transition name="wpfade">
|
||||
<!-- <transition name=""> -->
|
||||
<div class="oobe-view" v-if="screen == 'welcome'">
|
||||
<div class="oobe-header">
|
||||
{{ getLz("oobe.intro.title") }}
|
||||
|
@ -29,10 +29,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
|
||||
<!-- General -->
|
||||
<transition name="wpfade">
|
||||
<!-- <transition name=""> -->
|
||||
<div class="oobe-view" v-if="screen == 'general'">
|
||||
<div class="oobe-header">
|
||||
{{ getLz("oobe.general.title") }}
|
||||
|
@ -45,10 +45,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
|
||||
<!-- Visual -->
|
||||
<transition name="wpfade">
|
||||
<!-- <transition name=""> -->
|
||||
<div class="oobe-view" v-if="screen == 'visual'">
|
||||
<div class="oobe-header">
|
||||
{{ getLz("oobe.visual.title") }}
|
||||
|
@ -56,9 +56,9 @@
|
|||
<div class="oobe-body visual">
|
||||
<b-row>
|
||||
<b-col>
|
||||
<div class="card bg-dark text-white stylePicker">
|
||||
<div class="card bg-dark text-white stylePicker" @click="$root.cfg.visual.directives.windowLayout = 'twopanel'" :class="{'style-active': ($root.cfg.visual.directives.windowLayout == 'twopanel')}">
|
||||
<div class="card-body">
|
||||
<img class="visualPreview" src="./assets/oobe/ss1.png" alt="TEMP">
|
||||
<img class="visualPreview" src="./assets/oobe/mojave.png" alt="TEMP">
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
Mojave
|
||||
|
@ -66,9 +66,9 @@
|
|||
</div>
|
||||
</b-col>
|
||||
<b-col>
|
||||
<div class="card bg-dark text-white stylePicker">
|
||||
<div class="card bg-dark text-white stylePicker" @click="$root.cfg.visual.directives.windowLayout = 'default'" :class="{'style-active': ($root.cfg.visual.directives.windowLayout == 'default')}">
|
||||
<div class="card-body">
|
||||
<img class="visualPreview" src="./assets/oobe/ss2.png" alt="TEMP">
|
||||
<img class="visualPreview" src="./assets/oobe/maverick.png" alt="TEMP">
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
Maverick
|
||||
|
@ -85,10 +85,10 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
|
||||
<!-- Audio -->
|
||||
<transition name="wpfade">
|
||||
<!-- <transition name=""> -->
|
||||
<div class="oobe-view" v-if="screen == 'audio'">
|
||||
<div class="oobe-header">
|
||||
{{ getLz("oobe.audio.title") }}
|
||||
|
@ -110,17 +110,39 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-option-line" v-show="$root.cfg.advanced.AudioContext === true">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.audio.enableAdvancedFunctionality.ciderPPE')}}
|
||||
<br>
|
||||
<small>{{$root.getLz('settings.option.audio.enableAdvancedFunctionality.ciderPPE.description')}}</small>
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<input type="checkbox" v-model="$root.cfg.audio.maikiwiAudio.ciderPPE"
|
||||
switch/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oobe-footer">
|
||||
<div class="btn-group">
|
||||
<div class="md-btn" @click="screen = 'visual'">{{ getLz("oobe.previous") }}</div>
|
||||
<div class="md-btn">{{ getLz("oobe.next") }}</div>
|
||||
<div class="md-btn" @click="signIn()">{{ getLz("oobe.next") }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
<!-- </transition> -->
|
||||
<div class="oobe-view" v-if="screen == 'signin'">
|
||||
<div class="oobe-header">
|
||||
Sign in with Apple Music
|
||||
</div>
|
||||
<div class="oobe-body">
|
||||
<div class="blurb"></div>
|
||||
</div>
|
||||
<div class="oobe-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script>
|
||||
|
@ -135,6 +157,14 @@
|
|||
|
||||
},
|
||||
methods: {
|
||||
signIn() {
|
||||
if(localStorage.getItem("music.ampwebplay.media-user-token")) {
|
||||
localStorage.setItem("seenOOBE", 1)
|
||||
window.location.reload()
|
||||
}
|
||||
this.screen = "signin"
|
||||
capiInit()
|
||||
},
|
||||
getLz() {
|
||||
return this.$root.getLz.apply(this.$root, arguments);
|
||||
}
|
||||
|
|
|
@ -1149,19 +1149,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
Collapsable Sidebar
|
||||
</div>
|
||||
<div class="md-option-segment md-option-segment_auto">
|
||||
<label>
|
||||
<input type="checkbox" v-model="app.cfg.advanced.experiments.includes('collapseSidebar')"
|
||||
@click="app.cfg.advanced.experiments.includes('collapseSidebar') ? removeExperiment('collapseSidebar') : addExperiment('collapseSidebar')"
|
||||
switch/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="md-option-line">
|
||||
<div class="md-option-segment">
|
||||
{{$root.getLz('settings.option.experimental.compactUI')}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue