chore: Prettified Code
[ci skip]
This commit is contained in:
parent
27a3a73124
commit
246450fde3
4 changed files with 75 additions and 76 deletions
|
@ -1048,7 +1048,7 @@ export class BrowserWindow {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on("get-i18n-listing", (event) => {
|
ipcMain.on("get-i18n-listing", (event) => {
|
||||||
const translations = utils.i18n
|
const translations = utils.i18n;
|
||||||
const i18nListing: any = [];
|
const i18nListing: any = [];
|
||||||
|
|
||||||
for (const lang in translations) {
|
for (const lang in translations) {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import fetch from "electron-fetch";
|
||||||
import ElectronStore from "electron-store";
|
import ElectronStore from "electron-store";
|
||||||
|
|
||||||
export class utils {
|
export class utils {
|
||||||
static crowdinClient: OtaClient = new OtaClient('fda9a6528649ea90dee35390wog')
|
static crowdinClient: OtaClient = new OtaClient("fda9a6528649ea90dee35390wog");
|
||||||
static i18n: any = {};
|
static i18n: any = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +106,7 @@ export class utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async initializeTranslations() {
|
static async initializeTranslations() {
|
||||||
this.i18n = await this.crowdinClient.getTranslations()
|
this.i18n = await this.crowdinClient.getTranslations();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,7 +116,7 @@ export class utils {
|
||||||
* @returns {string | Object} The locale value.
|
* @returns {string | Object} The locale value.
|
||||||
*/
|
*/
|
||||||
static getLocale(language: string, key?: string): string | object {
|
static getLocale(language: string, key?: string): string | object {
|
||||||
let i18n: any = {}
|
let i18n: any = {};
|
||||||
if (!this.i18n[language]) {
|
if (!this.i18n[language]) {
|
||||||
i18n = this.i18n["en"][0].content;
|
i18n = this.i18n["en"][0].content;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -32,7 +32,7 @@ const CiderPlug = new Plugins();
|
||||||
* App Event Handlers
|
* App Event Handlers
|
||||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||||
app.on("ready", async () => {
|
app.on("ready", async () => {
|
||||||
await utils.initializeTranslations()
|
await utils.initializeTranslations();
|
||||||
Cider.ready(CiderPlug);
|
Cider.ready(CiderPlug);
|
||||||
|
|
||||||
console.log("[Cider] Application is Ready. Creating Window.");
|
console.log("[Cider] Application is Ready. Creating Window.");
|
||||||
|
@ -40,10 +40,10 @@ app.on("ready", async () => {
|
||||||
console.info("[Cider] Running in development mode.");
|
console.info("[Cider] Running in development mode.");
|
||||||
require("vue-devtools").install();
|
require("vue-devtools").install();
|
||||||
}
|
}
|
||||||
console.log("aa")
|
console.log("aa");
|
||||||
components.whenReady().then(async () => {
|
components.whenReady().then(async () => {
|
||||||
const bw = new BrowserWindow();
|
const bw = new BrowserWindow();
|
||||||
console.log("[Cider] Creating Window.")
|
console.log("[Cider] Creating Window.");
|
||||||
const win = await bw.createWindow();
|
const win = await bw.createWindow();
|
||||||
|
|
||||||
app.getGPUInfo("complete").then((gpuInfo) => {
|
app.getGPUInfo("complete").then((gpuInfo) => {
|
||||||
|
@ -112,4 +112,3 @@ app.on("widevine-error", (error) => {
|
||||||
console.log("[Cider][Widevine] Widevine installation encountered an error: " + error);
|
console.log("[Cider][Widevine] Widevine installation encountered an error: " + error);
|
||||||
app.exit();
|
app.exit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class Thumbar {
|
||||||
|
|
||||||
private isNotMac: boolean = process.platform !== "darwin";
|
private isNotMac: boolean = process.platform !== "darwin";
|
||||||
private isMac: boolean = process.platform === "darwin";
|
private isMac: boolean = process.platform === "darwin";
|
||||||
private _menuTemplate: any = []
|
private _menuTemplate: any = [];
|
||||||
|
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
* Public Methods
|
* Public Methods
|
||||||
|
@ -57,13 +57,13 @@ export default class Thumbar {
|
||||||
...(this.isMac ? [{ type: "separator" }, { role: "services" }, { type: "separator" }, { role: "hide" }, { role: "hideOthers" }, { role: "unhide" }, { type: "separator" }, { role: "quit" }] : []),
|
...(this.isMac ? [{ type: "separator" }, { role: "services" }, { type: "separator" }, { role: "hide" }, { role: "hideOthers" }, { role: "unhide" }, { type: "separator" }, { role: "quit" }] : []),
|
||||||
...(this.isNotMac
|
...(this.isNotMac
|
||||||
? [
|
? [
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.quit"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.quit"),
|
||||||
accelerator: "Control+Q",
|
accelerator: "Control+Q",
|
||||||
click: () => app.quit(),
|
click: () => app.quit(),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -120,67 +120,67 @@ export default class Thumbar {
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
...(this.isMac
|
...(this.isMac
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: "Show",
|
label: "Show",
|
||||||
click: () => utils.getWindow().show(),
|
click: () => utils.getWindow().show(),
|
||||||
},
|
},
|
||||||
{ role: "zoom" },
|
{ role: "zoom" },
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{ role: "front" },
|
{ role: "front" },
|
||||||
{ role: "close" },
|
{ role: "close" },
|
||||||
{
|
{
|
||||||
label: "Edit",
|
label: "Edit",
|
||||||
submenu: [{ role: "undo" }, { role: "redo" }, { type: "separator" }, { role: "cut" }, { role: "copy" }, { role: "paste" }],
|
submenu: [{ role: "undo" }, { role: "redo" }, { type: "separator" }, { role: "cut" }, { role: "copy" }, { role: "paste" }],
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
...(this.isNotMac
|
...(this.isNotMac
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.zoom"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.zoom"),
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomin"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomin"),
|
||||||
role: "zoomIn",
|
role: "zoomIn",
|
||||||
accelerator: utils.getStoreValue("general.keybindings.zoomn").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.zoomn").join("+"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomout"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomout"),
|
||||||
role: "zoomOut",
|
role: "zoomOut",
|
||||||
accelerator: utils.getStoreValue("general.keybindings.zoomt").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.zoomt").join("+"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomreset"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.zoomreset"),
|
||||||
role: "resetZoom",
|
role: "resetZoom",
|
||||||
accelerator: utils.getStoreValue("general.keybindings.zoomrst").join("+"),
|
accelerator: utils.getStoreValue("general.keybindings.zoomrst").join("+"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "term.fullscreen"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "term.fullscreen"),
|
||||||
accelerator: "Control+Enter",
|
accelerator: "Control+Enter",
|
||||||
role: "togglefullscreen",
|
role: "togglefullscreen",
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "action.close"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "action.close"),
|
||||||
accelerator: "Control+W",
|
accelerator: "Control+W",
|
||||||
role: "close",
|
role: "close",
|
||||||
},
|
},
|
||||||
{ type: "separator" },
|
{ type: "separator" },
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.reload"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.reload"),
|
||||||
accelerator: "Control+R",
|
accelerator: "Control+R",
|
||||||
role: "reload",
|
role: "reload",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.forcereload"),
|
label: utils.getLocale(utils.getStoreValue("general.language"), "menubar.options.forcereload"),
|
||||||
accelerator: "Control+Shift+R",
|
accelerator: "Control+Shift+R",
|
||||||
role: "forceReload",
|
role: "forceReload",
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -317,11 +317,11 @@ export default class Thumbar {
|
||||||
* Runs on playback State Change
|
* Runs on playback State Change
|
||||||
* @param attributes Music Attributes (attributes.status = current state)
|
* @param attributes Music Attributes (attributes.status = current state)
|
||||||
*/
|
*/
|
||||||
onPlaybackStateDidChange(attributes: object): void { }
|
onPlaybackStateDidChange(attributes: object): void {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs on song change
|
* Runs on song change
|
||||||
* @param attributes Music Attributes
|
* @param attributes Music Attributes
|
||||||
*/
|
*/
|
||||||
onNowPlayingItemDidChange(attributes: object): void { }
|
onNowPlayingItemDidChange(attributes: object): void {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue