mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Compare commits
No commits in common. "3fd237446fbee78278be498ddcb0b5ebe31429ca" and "55a81d95438ae112e7bb6da5412ae63a55e65b36" have entirely different histories.
3fd237446f
...
55a81d9543
10 changed files with 910 additions and 516 deletions
|
@ -90,13 +90,15 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<video autoplay loop class="logo">
|
<video autoplay loop class="logo">
|
||||||
<source src="https://discord.com/assets/3b0d96ed8113994f3d139088726cfecd.webm" type="video/webm">
|
<source src="https://discord.com/assets/0bdc0497eb3a19e66f2b1e3d5741634c.webm" type="video/webm">
|
||||||
</video>
|
</video>
|
||||||
<p>Loading...</p>
|
<p>Loading...</p>
|
||||||
<h1></h1>
|
<h1></h1>
|
||||||
|
|
3
main.js
3
main.js
|
@ -4,7 +4,6 @@ const path = require("path");
|
||||||
const contextMenu = require("electron-context-menu");
|
const contextMenu = require("electron-context-menu");
|
||||||
const os = require("os");
|
const os = require("os");
|
||||||
require("v8-compile-cache");
|
require("v8-compile-cache");
|
||||||
require("./utils/updater.js")
|
|
||||||
if (require("./utils/ArmCord.js").Titlebar === "native") {
|
if (require("./utils/ArmCord.js").Titlebar === "native") {
|
||||||
var frame = true
|
var frame = true
|
||||||
} else {
|
} else {
|
||||||
|
@ -43,6 +42,7 @@ function createWindow() {
|
||||||
nodeIntegration: false,
|
nodeIntegration: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var appIcon = new Tray(iconformat);
|
var appIcon = new Tray(iconformat);
|
||||||
mainWindow.webContents.userAgent =
|
mainWindow.webContents.userAgent =
|
||||||
"Mozilla/5.0 (X12; Linux x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
|
"Mozilla/5.0 (X12; Linux x86) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36"; //fake useragent
|
||||||
|
@ -81,7 +81,6 @@ function createWindow() {
|
||||||
mainWindow.show()
|
mainWindow.show()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
appIcon.setContextMenu(contextMenu);
|
appIcon.setContextMenu(contextMenu);
|
||||||
|
|
||||||
// Emitted when the window is closed.
|
// Emitted when the window is closed.
|
||||||
|
|
920
package-lock.json
generated
920
package-lock.json
generated
File diff suppressed because it is too large
Load diff
23
package.json
23
package.json
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ArmCord",
|
"name": "ArmCord",
|
||||||
"version": "2.7.0",
|
"version": "2.6.1",
|
||||||
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
|
"description": "ArmCord is a Discord client made for ARM Linux that allows you to customize your experience.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -9,16 +9,21 @@
|
||||||
"package": "electron-builder --dir",
|
"package": "electron-builder --dir",
|
||||||
"make": "electron-builder",
|
"make": "electron-builder",
|
||||||
"linux-build": "electron-builder --linux deb tar.gz rpm AppImage",
|
"linux-build": "electron-builder --linux deb tar.gz rpm AppImage",
|
||||||
"windows-build": "electron-builder --windows nsis portable zip"
|
"windows-build": "electron-builder --windows nsis portable zip appx"
|
||||||
},
|
},
|
||||||
"author": "smartfrigde <smartfridge1337@protonmail.com>",
|
"author": "smartfrigde <smartfridge1337@protonmail.com>",
|
||||||
"license": "OSL-3.0",
|
"license": "OSL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^13.0.6",
|
||||||
|
"custom-electron-titlebar": "3.2.7",
|
||||||
"electron-context-menu": "^3.0.0",
|
"electron-context-menu": "^3.0.0",
|
||||||
"electron-dl": "^3.2.1",
|
"electron-dl": "^3.2.1",
|
||||||
"electron-localshortcut": "^3.2.1",
|
"electron-localshortcut": "^3.2.1",
|
||||||
"electron-store": "^8.0.0",
|
"electron-store": "^8.0.0",
|
||||||
"electron-updater": "^4.3.9",
|
"rollup": "^2.58.0",
|
||||||
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
"unzipper": "^0.10.1",
|
"unzipper": "^0.10.1",
|
||||||
"v8-compile-cache": "^2.3.0"
|
"v8-compile-cache": "^2.3.0"
|
||||||
},
|
},
|
||||||
|
@ -40,20 +45,14 @@
|
||||||
"productName": "ArmCord",
|
"productName": "ArmCord",
|
||||||
"mac": {
|
"mac": {
|
||||||
"category": "Network",
|
"category": "Network",
|
||||||
"extraResources": [
|
"extraResources": ["./mods/cumcord/*"]
|
||||||
"./mods/cumcord/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"extraResources": [
|
"extraResources": ["./mods/cumcord/*"]
|
||||||
"./mods/cumcord/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"category": "Network",
|
"category": "Network",
|
||||||
"extraResources": [
|
"extraResources": ["./mods/cumcord/*"],
|
||||||
"./mods/cumcord/*"
|
|
||||||
],
|
|
||||||
"maintainer": "smartfridge1337@protonmail.com",
|
"maintainer": "smartfridge1337@protonmail.com",
|
||||||
"target": [
|
"target": [
|
||||||
"deb",
|
"deb",
|
||||||
|
|
14
preload.js
14
preload.js
|
@ -1,14 +1,16 @@
|
||||||
const { remote } = require("electron");
|
const { remote } = require("electron");
|
||||||
const currentWindow = remote.getCurrentWindow();
|
const currentWindow = remote.getCurrentWindow();
|
||||||
const ArmCord = require("./utils/ArmCord.js");
|
const customTitlebar = require("custom-electron-titlebar");
|
||||||
const electronLocalshortcut = require("electron-localshortcut");
|
const electronLocalshortcut = require("electron-localshortcut");
|
||||||
|
const ArmCord = require("./utils/ArmCord.js");
|
||||||
require("./utils/theme.js");
|
require("./utils/theme.js");
|
||||||
require("./utils/bridge.js")
|
require("./utils/bridge.js")
|
||||||
require('./utils/titlebar')
|
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
if (require("./utils/ArmCord.js").Titlebar == "native") {console.log("Using native titlebar")} else {
|
if (require("./utils/ArmCord.js").Titlebar === "native") {console.log("Using native titlebar")} else {
|
||||||
//todo
|
new customTitlebar.Titlebar({
|
||||||
}
|
backgroundColor: customTitlebar.Color.fromHex("#202225"),
|
||||||
|
menu: false,
|
||||||
|
});}
|
||||||
|
|
||||||
electronLocalshortcut.register(currentWindow, "F5", () => {
|
electronLocalshortcut.register(currentWindow, "F5", () => {
|
||||||
location.reload();
|
location.reload();
|
||||||
|
@ -65,7 +67,7 @@ div.menubar[role="menubar"] {
|
||||||
.window-title {
|
.window-title {
|
||||||
font-size: 0px !important;
|
font-size: 0px !important;
|
||||||
margin-left: initial !important;
|
margin-left: initial !important;
|
||||||
transform: translate(10px, 0px);
|
transform: translate(10px, 2px);
|
||||||
}
|
}
|
||||||
.titlebar {
|
.titlebar {
|
||||||
background: var(--titlebar-color) !important;
|
background: var(--titlebar-color) !important;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
const { contextBridge, remote } = require("electron");
|
const { contextBridge, remote, desktopCapturer } = require("electron");
|
||||||
const currentWindow = remote.getCurrentWindow();
|
const currentWindow = remote.getCurrentWindow();
|
||||||
const {getDisplayMediaSelector} = require('./capturer')
|
|
||||||
const ArmCord = require("./ArmCord.js");
|
|
||||||
const version = require("../package.json").version;
|
const version = require("../package.json").version;
|
||||||
contextBridge.exposeInMainWorld("electron", {
|
contextBridge.exposeInMainWorld("electron", {
|
||||||
window: {
|
window: {
|
||||||
|
@ -13,7 +11,6 @@ contextBridge.exposeInMainWorld("electron", {
|
||||||
},
|
},
|
||||||
electron: process.versions.electron,
|
electron: process.versions.electron,
|
||||||
version: version,
|
version: version,
|
||||||
ArmCord: ArmCord,
|
desktopCapturer: desktopCapturer,
|
||||||
getDisplayMediaSelector: getDisplayMediaSelector,
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,36 +1,29 @@
|
||||||
//Fixed context isolation version https://github.com/getferdi/ferdi/blob/develop/src/webview/screenshare.ts
|
// This desktop capturer has been taken from https://github.com/SpacingBat3/electron-discord-webapp
|
||||||
//original https://github.com/electron/electron/issues/16513#issuecomment-602070250
|
|
||||||
const { desktopCapturer } = require('electron');
|
|
||||||
const CANCEL_ID = 'desktop-capturer-selection__cancel';
|
|
||||||
const ArmCord = require("./ArmCord.js");
|
|
||||||
async function getDisplayMediaSelector() {
|
|
||||||
const sources = await desktopCapturer.getSources({
|
|
||||||
types: ['screen', 'window'],
|
|
||||||
});
|
|
||||||
return `<div class="desktop-capturer-selection__scroller">
|
|
||||||
<ul class="desktop-capturer-selection__list">
|
|
||||||
${sources
|
|
||||||
.map(
|
|
||||||
({ id, name, thumbnail }) => `
|
|
||||||
<li class="desktop-capturer-selection__item">
|
|
||||||
<button class="desktop-capturer-selection__btn" data-id="${id}" title="${name}">
|
|
||||||
<img class="desktop-capturer-selection__thumbnail" src="${thumbnail.toDataURL()}" />
|
|
||||||
<span class="desktop-capturer-selection__name">${name}</span>
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
`,
|
|
||||||
)
|
|
||||||
.join('')}
|
|
||||||
<li class="desktop-capturer-selection__item">
|
|
||||||
<button class="desktop-capturer-selection__btn" data-id="${CANCEL_ID}" title="Cancel">
|
|
||||||
<span class="desktop-capturer-selection__name desktop-capturer-selection__name--cancel">Cancel</span>
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const screenShareCSS = `
|
|
||||||
|
/*
|
||||||
|
* Thanks, @WesselKroos!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*function l10n(origin, locale){
|
||||||
|
if(originalString == 'Entire Screen') {
|
||||||
|
return locale;
|
||||||
|
} else {
|
||||||
|
return origin;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
const { desktopCapturer } = require("electron");
|
||||||
|
|
||||||
|
navigator.mediaDevices.getDisplayMedia = () => {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
|
const sources = await desktopCapturer.getSources({
|
||||||
|
types: ["screen", "window"],
|
||||||
|
});
|
||||||
|
const selectionElem = document.createElement("div");
|
||||||
|
selectionElem.setAttribute("class", "desktop-capturer-selection");
|
||||||
|
selectionElem.innerHTML = `
|
||||||
|
<style>
|
||||||
.desktop-capturer-selection {
|
.desktop-capturer-selection {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -38,7 +31,7 @@ const screenShareCSS = `
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: rgba(30,30,30,.75);
|
background: rgba(30,30,30,.75);
|
||||||
color: #FFFFFF;
|
color: #fff;
|
||||||
z-index: 10000000;
|
z-index: 10000000;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -72,18 +65,14 @@ const screenShareCSS = `
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
background: #2C2F33;
|
color: #FFFFFF;
|
||||||
|
background: #36393F;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@media (prefers-reduced-motion: no-preference) {
|
transition: background-color .15s, box-shadow .15s;
|
||||||
transition: background-color .15s, box-shadow .15s, color .15s;
|
|
||||||
}
|
|
||||||
color: #dedede;
|
|
||||||
}
|
}
|
||||||
.desktop-capturer-selection__btn:hover,
|
.desktop-capturer-selection__btn:hover,
|
||||||
.desktop-capturer-selection__btn:focus {
|
.desktop-capturer-selection__btn:focus {
|
||||||
background: #7289DA;
|
background: #7289DA;
|
||||||
box-shadow: 0 0 4px rgba(0,0,0,0.45), 0 0 2px rgba(0,0,0,0.25);
|
|
||||||
color: #fff;
|
|
||||||
}
|
}
|
||||||
.desktop-capturer-selection__thumbnail {
|
.desktop-capturer-selection__thumbnail {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -91,62 +80,85 @@ const screenShareCSS = `
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
.desktop-capturer-selection__name {
|
.desktop-capturer-selection__name {
|
||||||
margin: 6px 0;
|
margin: 6px 0 6px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: white;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
text-align: center;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.desktop-capturer-selection__name--cancel {
|
.desktop-capturer-close {
|
||||||
margin: auto 0;
|
background-color: #36393F;
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
right: 15px;
|
||||||
|
padding-top: 5px;
|
||||||
|
transition: background-color .15s;
|
||||||
}
|
}
|
||||||
|
.desktop-capturer-close:hover {
|
||||||
|
background-color: #823A3A;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="desktop-capturer-selection__scroller">
|
||||||
|
<ul class="desktop-capturer-selection__list">
|
||||||
|
${sources
|
||||||
|
.map(
|
||||||
|
({ id, name, thumbnail }) => `
|
||||||
|
<li class="desktop-capturer-selection__item">
|
||||||
|
<button class="desktop-capturer-selection__btn" data-id="${id}" title="${name}">
|
||||||
|
<img class="desktop-capturer-selection__thumbnail" src="${thumbnail.toDataURL()}" />
|
||||||
|
<span class="desktop-capturer-selection__name">${name}</span>
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
`
|
||||||
|
)
|
||||||
|
.join("")}
|
||||||
|
</ul>
|
||||||
|
<button class="desktop-capturer-close">
|
||||||
|
<svg viewBox="0 0 10 10" height=20px>
|
||||||
|
<line x1="0" y1="10" x2="10" y2="0" stroke="white" />
|
||||||
|
<line x1="0" y1="0" x2="10" y2="10" stroke="white" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const screenShareJS = `
|
|
||||||
window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve, reject) => {
|
|
||||||
try {
|
|
||||||
const selectionElem = document.createElement('div');
|
|
||||||
selectionElem.classList = ['desktop-capturer-selection'];
|
|
||||||
selectionElem.innerHTML = await window.electron.getDisplayMediaSelector();
|
|
||||||
document.body.appendChild(selectionElem);
|
document.body.appendChild(selectionElem);
|
||||||
|
|
||||||
document
|
document
|
||||||
.querySelectorAll('.desktop-capturer-selection__btn')
|
.querySelectorAll(".desktop-capturer-selection__btn")
|
||||||
.forEach((button) => {
|
.forEach((button) => {
|
||||||
button.addEventListener('click', async () => {
|
button.addEventListener("click", async () => {
|
||||||
try {
|
try {
|
||||||
const id = button.getAttribute('data-id');
|
const id = button.getAttribute("data-id");
|
||||||
if (id === '${CANCEL_ID}') {
|
const source = sources.find((source) => source.id === id);
|
||||||
reject(new Error('Cancelled by user'));
|
if (!source) {
|
||||||
} else {
|
throw new Error(`Source with id ${id} does not exist`);
|
||||||
const stream = await window.navigator.mediaDevices.getUserMedia({
|
}
|
||||||
|
const stream = await navigator.mediaDevices.getUserMedia({
|
||||||
audio: false,
|
audio: false,
|
||||||
video: {
|
video: {
|
||||||
mandatory: {
|
mandatory: {
|
||||||
chromeMediaSource: 'desktop',
|
chromeMediaSource: "desktop",
|
||||||
chromeMediaSourceId: id,
|
chromeMediaSourceId: source.id,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
resolve(stream);
|
resolve(stream);
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
reject(err);
|
|
||||||
} finally {
|
|
||||||
selectionElem.remove();
|
selectionElem.remove();
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.error("Error selecting desktop capture source:", err);
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
`;
|
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
|
||||||
ArmCord.addScript(screenShareJS);
|
|
||||||
ArmCord.addStyle(screenShareCSS);
|
|
||||||
});
|
});
|
||||||
|
document.querySelectorAll(".desktop-capturer-close").forEach((button) => {
|
||||||
|
button.addEventListener("click", () => {
|
||||||
exports.getDisplayMediaSelector = getDisplayMediaSelector;
|
selectionElem.remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Error displaying desktop capture sources:", err);
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
console.log("Desktop capturer has been preloaded 🎉️");
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const { app, session } = require("electron");
|
const { app, session } = require("electron");
|
||||||
|
const electron = require("electron");
|
||||||
const path = require ('path');
|
const path = require ('path');
|
||||||
const execPath = path.dirname (process.execPath);
|
const execPath = path.dirname (process.execPath);
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
|
|
|
@ -1,138 +0,0 @@
|
||||||
const { remote } = require("electron");
|
|
||||||
var win = remote.BrowserWindow.getFocusedWindow();
|
|
||||||
const ArmCord = require("./ArmCord.js");
|
|
||||||
const css = `
|
|
||||||
.titleebar {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 0 16px;
|
|
||||||
overflow: hidden;
|
|
||||||
flex-shrink: 0;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
user-select: none;
|
|
||||||
zoom: 1;
|
|
||||||
line-height: 22px;
|
|
||||||
height: 22px;
|
|
||||||
display: flex;
|
|
||||||
z-index: 99999;
|
|
||||||
}
|
|
||||||
.titlebar {
|
|
||||||
display: block;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
flex-shrink: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
zoom: 1;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
clear:both;
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
background-color: #202225;
|
|
||||||
-webkit-app-region: drag;
|
|
||||||
width: 100%;
|
|
||||||
user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
position: fixed;
|
|
||||||
z-index: 99999;
|
|
||||||
|
|
||||||
}
|
|
||||||
.appMount-3lHmkl{
|
|
||||||
|
|
||||||
}
|
|
||||||
.titlebar #window-title {
|
|
||||||
width: 30%;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 30px;
|
|
||||||
float: left;
|
|
||||||
padding: 0 0 0 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titlebar #window-controls-container {
|
|
||||||
float: right;
|
|
||||||
width: 150px;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 30px;
|
|
||||||
background-color: #202225;
|
|
||||||
-webkit-app-region: no-drag;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titlebar #window-controls-container #minimize,
|
|
||||||
.titlebar #window-controls-container #maximize,
|
|
||||||
.titlebar #window-controls-container #quit {
|
|
||||||
float: left;
|
|
||||||
height: 100%;
|
|
||||||
width: 33%;
|
|
||||||
text-align: center;
|
|
||||||
color: #f7f7f7;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.titlebar #window-controls-container #minimize:hover {
|
|
||||||
background-color: #99AAB5;
|
|
||||||
}
|
|
||||||
.titlebar #window-controls-container #maximize:hover {
|
|
||||||
background-color: #99AAB5;
|
|
||||||
}
|
|
||||||
.titlebar #window-controls-container #quit:hover {
|
|
||||||
background-color: #F04747;
|
|
||||||
}
|
|
||||||
.titlebar #window-controls-container #quit {
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
}
|
|
||||||
.titlebar #window-controls-container #minimize {
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
}
|
|
||||||
.titlebar #window-controls-container #maximize {
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
`;
|
|
||||||
document.addEventListener("DOMContentLoaded", function (event) {
|
|
||||||
var elem = document.createElement("div");
|
|
||||||
elem.innerHTML = `<nav class="titlebar">
|
|
||||||
<div class="window-title" id="window-title"></div>
|
|
||||||
<div id="window-controls-container">
|
|
||||||
<div id="minimize"></div>
|
|
||||||
<div id="maximize"></div>
|
|
||||||
<div id="quit"></div>
|
|
||||||
</div>
|
|
||||||
</nav>`;
|
|
||||||
document.body.appendChild(elem);
|
|
||||||
|
|
||||||
ArmCord.addStyle(css);
|
|
||||||
|
|
||||||
var minimize = document.querySelector("#minimize");
|
|
||||||
var maximize = document.querySelector("#maximize");
|
|
||||||
var quit = document.querySelector("#quit");
|
|
||||||
|
|
||||||
minimize.addEventListener("click", () => {
|
|
||||||
win.minimize();
|
|
||||||
});
|
|
||||||
|
|
||||||
maximize.addEventListener("click", () => {
|
|
||||||
if (win.isMaximized() == true) {
|
|
||||||
win.unmaximize();
|
|
||||||
} else {
|
|
||||||
win.maximize();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
quit.addEventListener("click", () => {
|
|
||||||
win.close();
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,22 +0,0 @@
|
||||||
const { app, autoUpdater } = require('electron')
|
|
||||||
const server = "https://download.smartfridge.space"
|
|
||||||
const url = `${server}/update/${process.platform}/${app.getVersion()}`
|
|
||||||
|
|
||||||
autoUpdater.setFeedURL({ url })
|
|
||||||
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName) => {
|
|
||||||
const dialogOpts = {
|
|
||||||
type: 'info',
|
|
||||||
buttons: ['Restart', 'Later'],
|
|
||||||
title: 'ArmCord Update',
|
|
||||||
message: process.platform === 'win32' ? releaseNotes : releaseName,
|
|
||||||
detail: 'A new version has been downloaded. Restart the application to apply the updates.'
|
|
||||||
}
|
|
||||||
|
|
||||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
|
||||||
if (returnValue.response === 0) autoUpdater.quitAndInstall()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
autoUpdater.on('error', message => {
|
|
||||||
console.error('There was a problem updating the application')
|
|
||||||
console.error(message)
|
|
||||||
})
|
|
Loading…
Add table
Add a link
Reference in a new issue