Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bec69b3abf | ||
|
|
530e82cc6d | ||
|
|
29765230b1 | ||
|
|
29a556c7d1 | ||
|
|
7f3d4ba8aa | ||
|
|
9c714c9c4e | ||
|
|
91ef9955b4 | ||
|
|
97f0f3784d | ||
|
|
42d903ac16 | ||
|
|
b9111348d3 | ||
|
|
69b7fa79de | ||
|
|
4c67233e83 | ||
|
|
c9d14992b9 | ||
|
|
f06411e018 | ||
|
|
73b9c419ff | ||
|
|
e763d98134 | ||
|
|
0533256b87 | ||
|
|
4d0c874a95 | ||
|
|
ae1608e0bb | ||
|
|
88ae7c8994 | ||
|
|
d697ce8c81 | ||
|
|
a684cf1294 | ||
|
|
b9d4028074 | ||
|
|
916cb7e76f | ||
|
|
6dd61af5dd | ||
|
|
5bee7c0791 | ||
|
|
a4a731f04a | ||
|
|
b15d3c5375 | ||
|
|
99ba73f194 | ||
|
|
1456c15f91 | ||
|
|
8a26580453 | ||
|
|
af393ad0ca | ||
|
|
8a46f3a7d2 | ||
|
|
0aff71496c | ||
|
|
f3a5642bcd | ||
|
|
b97e6e0870 | ||
|
|
3e704c3d22 | ||
|
|
ae02fa80ce | ||
|
|
ec5c1038b3 | ||
|
|
e5e6295a83 | ||
|
|
19560fe60f | ||
|
|
1f1b469a4b | ||
|
|
eb095a7497 | ||
|
|
6415b095ab | ||
|
|
d93c959da8 | ||
|
|
09893e1409 | ||
|
|
93ec6384d0 | ||
|
|
a221bf33b2 | ||
|
|
c7ec3d2197 | ||
|
|
18d04099fd | ||
|
|
fec52ee19f | ||
|
|
d87a22da23 | ||
|
|
4bda273947 | ||
|
|
7c8a2e32b4 | ||
|
|
45e8d0c2b6 | ||
|
|
3fe0b93567 | ||
|
|
06147dd5cc | ||
|
|
44dae3832e |
6
.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
node_modules
|
||||
out
|
||||
.vscode
|
||||
dist
|
||||
dist
|
||||
website
|
||||
server
|
||||
.vscode
|
||||
104
Extension/_locales/de/messages.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"appDesc": {
|
||||
"message": "PreMiD fügt eine Discord-Rich-Presence-Integration, Kontrolle über Multimediatasten und viele weitere Funktionen zu YouTube/YouTube Music, Twitch etc. hinzu."
|
||||
},
|
||||
"connected": {
|
||||
"message": "Verbunden"
|
||||
},
|
||||
"disconnected": {
|
||||
"message": "Getrennt"
|
||||
},
|
||||
"installedThanks": {
|
||||
"message": "Vielen Dank, für das Installieren von PreMiD"
|
||||
},
|
||||
"installedApp": {
|
||||
"message": "Hast du das Programm bereits installiert?"
|
||||
},
|
||||
"installedNo": {
|
||||
"message": "Nein? Folge dieser Anleitung:"
|
||||
},
|
||||
"installedStepApp": {
|
||||
"message": "Lade die neueste Version von $1 herunter"
|
||||
},
|
||||
"installedStepAppMyRepository": {
|
||||
"message": "meinem GitHub Repository"
|
||||
},
|
||||
"installedWaitInstalled": {
|
||||
"message": "Offne das Installationsprogramm und warte bis die Installation abgeschlossen ist"
|
||||
},
|
||||
"installedMayWarning": {
|
||||
"message": "Möglicherweise bekommst du eine Warnung von deiner FireWall und SmartScreen (Es ist kein Virus. Das verspreche ich dir!)"
|
||||
},
|
||||
"installedAppAutostart": {
|
||||
"message": "Das Programm sollte automatisch starten. Du kannst dies prüfen, indem du auf deine Taskbar (Windows) oder deine Menubar (MacOS) schaust"
|
||||
},
|
||||
"installedYes": {
|
||||
"message": "Ja? Jetzt bist du bereit!"
|
||||
},
|
||||
"installedStart": {
|
||||
"message": "Starte, indem du ein Video auf YouTube, deine Lieblingsstreamer auf Twitch, deine Lieblings Animes auf KissAnime oder JKAnime anschaust oder vielleicht sogar Netflix... Wer weiß?<br>Oder du hörst dir deine Lieblingslieder auf SoundCloud und YouTube Music an. Einstellungen findest du indem du auf das PreMiD icon in deinem Browser klickst."
|
||||
},
|
||||
"installedSupportMe": {
|
||||
"message": "Unterstütze mich!"
|
||||
},
|
||||
"updatedYTPUpdated": {
|
||||
"message": "PreMiD wurde aktualisiert!"
|
||||
},
|
||||
"updatedWhatsNew": {
|
||||
"message": "Was ist neu?"
|
||||
},
|
||||
"updatedWhatChanged": {
|
||||
"message": "Was hat sich geändert?"
|
||||
},
|
||||
"updatedAdded0": {
|
||||
"message": "Support für JKAnime & KissAnime"
|
||||
},
|
||||
"updatedAdded1": {
|
||||
"message": "Erweiterungs Popup"
|
||||
},
|
||||
"updatedChanged0": {
|
||||
"message": "Eine Menge und Ich meine eine Menge Neuschreibungen!"
|
||||
},
|
||||
"updatedChanged1": {
|
||||
"message": "Große Schnelligkeits Verbesserungen der App"
|
||||
},
|
||||
"updatedAdded2": {
|
||||
"message": "Einstellungs Synchronisation (Google Account)"
|
||||
},
|
||||
"playbackPlaying": {
|
||||
"message": "Wiedergabe"
|
||||
},
|
||||
"playbackPaused": {
|
||||
"message": "Wiedergabe pausiert"
|
||||
},
|
||||
"about": {
|
||||
"message": "Über"
|
||||
},
|
||||
"feedback": {
|
||||
"message": "Feedback"
|
||||
},
|
||||
"options": {
|
||||
"message": "Optionen"
|
||||
},
|
||||
"general": {
|
||||
"message": "Allgemein"
|
||||
},
|
||||
"enabled": {
|
||||
"message": "Eingeschaltet"
|
||||
},
|
||||
"titleMenubar": {
|
||||
"message": "Titel Menubar"
|
||||
},
|
||||
"mediaControls": {
|
||||
"message": "Medien Kontrolle"
|
||||
},
|
||||
"checkForUpdates": {
|
||||
"message": "Nach Updates suchen"
|
||||
},
|
||||
"systemStartup": {
|
||||
"message": "System start"
|
||||
},
|
||||
"presences": {
|
||||
"message": "Presencen"
|
||||
}
|
||||
}
|
||||
104
Extension/_locales/en/messages.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"appDesc": {
|
||||
"message": "PreMiD adds Discord Rich Presence integration, Media controls and much more to YouTube/YouTube Music, Twitch etc..."
|
||||
},
|
||||
"connected": {
|
||||
"message": "Connected"
|
||||
},
|
||||
"disconnected": {
|
||||
"message": "Disconnected"
|
||||
},
|
||||
"installedThanks": {
|
||||
"message": "Thank you for installing PreMiD"
|
||||
},
|
||||
"installedApp": {
|
||||
"message": "Did you install the application yet?"
|
||||
},
|
||||
"installedNo": {
|
||||
"message": "No? Follow these steps:"
|
||||
},
|
||||
"installedStepApp": {
|
||||
"message": "Download the latest version from $1"
|
||||
},
|
||||
"installedStepAppMyRepository": {
|
||||
"message": "my repository"
|
||||
},
|
||||
"installedWaitInstalled": {
|
||||
"message": "Open the installer and wait until it installed"
|
||||
},
|
||||
"installedMayWarning": {
|
||||
"message": "You may receive a warning about FireWall and SmartScreen (Its not a virus i promise)"
|
||||
},
|
||||
"installedAppAutostart": {
|
||||
"message": "The application should start automatically, you can check this by looking at your taskbar (Windows) or your menubar (MacOS)"
|
||||
},
|
||||
"installedYes": {
|
||||
"message": "Yes? You are ready to go!"
|
||||
},
|
||||
"installedStart": {
|
||||
"message": "Start by watching a video on YouTube, watching your loved streamers on Twitch, Watch your favourite animes on KissAnime or JKAnime, maybe even Netflix... Who knows?<br>Or you just listen to your favourite songs on SoundCloud and YouTube Music. Settings can be found by clicking the PreMiD icon in your browser."
|
||||
},
|
||||
"installedSupportMe": {
|
||||
"message": "Support me!"
|
||||
},
|
||||
"updatedYTPUpdated": {
|
||||
"message": "PreMiD has been updated!"
|
||||
},
|
||||
"updatedWhatsNew": {
|
||||
"message": "Whats new?"
|
||||
},
|
||||
"updatedWhatChanged": {
|
||||
"message": "What changed?"
|
||||
},
|
||||
"playbackPlaying": {
|
||||
"message": "Playing back"
|
||||
},
|
||||
"playbackPaused": {
|
||||
"message": "Playback paused"
|
||||
},
|
||||
"about": {
|
||||
"message": "About"
|
||||
},
|
||||
"feedback": {
|
||||
"message": "Feedback"
|
||||
},
|
||||
"options": {
|
||||
"message": "Options"
|
||||
},
|
||||
"general": {
|
||||
"message": "General"
|
||||
},
|
||||
"enabled": {
|
||||
"message": "Enabled"
|
||||
},
|
||||
"titleMenubar": {
|
||||
"message": "Title Menubar"
|
||||
},
|
||||
"mediaControls": {
|
||||
"message": "Media Controls"
|
||||
},
|
||||
"checkForUpdates": {
|
||||
"message": "Check for updates"
|
||||
},
|
||||
"systemStartup": {
|
||||
"message": "System startup"
|
||||
},
|
||||
"presences": {
|
||||
"message": "Presences"
|
||||
},
|
||||
"updatedAdded0": {
|
||||
"message": "Support for JKAnime & KissAnime"
|
||||
},
|
||||
"updatedAdded1": {
|
||||
"message": "Extension popup"
|
||||
},
|
||||
"updatedAdded2": {
|
||||
"message": "Settings Sync (Google Account)"
|
||||
},
|
||||
"updatedChanged0": {
|
||||
"message": "A lot and I mean a lot of rewrites!"
|
||||
},
|
||||
"updatedChanged1": {
|
||||
"message": "Huge speed improvements to App"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
top: -50px;
|
||||
right: 0;
|
||||
z-index: 10000;
|
||||
width: 175px;
|
||||
min-width: 175px;
|
||||
border-bottom-left-radius: 5px;
|
||||
height: 50px;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
78
Extension/css/inputs.css
Normal file
@@ -0,0 +1,78 @@
|
||||
/* The switch - the box around the slider */
|
||||
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 35px;
|
||||
height: 15px;
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
|
||||
.switch input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgb(255, 75, 75);
|
||||
-webkit-transition: 0.25s;
|
||||
transition: 0.25s;
|
||||
}
|
||||
|
||||
.slider:before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 17px;
|
||||
width: 17px;
|
||||
left: -2.5px;
|
||||
top: -2.5px;
|
||||
background-color: white;
|
||||
-webkit-transition: 0.25s;
|
||||
transition: 0.25s cubic-bezier(0.215, 0.61, 0.355, 1);
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: rgb(75, 255, 75);
|
||||
}
|
||||
|
||||
input:disabled + .slider {
|
||||
background-color: rgb(255, 75, 75);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input:disabled + .slider:before {
|
||||
background-color: rgb(255, 75, 75);
|
||||
border: 1px solid rgb(255, 75, 75);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px rgb(75, 255, 75);
|
||||
}
|
||||
|
||||
input:hover + .slider {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
|
||||
/* Rounded sliders */
|
||||
|
||||
.slider.round {
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider.round:before {
|
||||
border-radius: 50%;
|
||||
}
|
||||
15
Extension/css/options.css
Normal file
@@ -0,0 +1,15 @@
|
||||
.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#content h1 {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
tr td:first-child {
|
||||
width: 90%;
|
||||
}
|
||||
98
Extension/css/popup.css
Normal file
@@ -0,0 +1,98 @@
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 0;
|
||||
width: 325px;
|
||||
background-color: #282828;
|
||||
}
|
||||
|
||||
#header {
|
||||
height: 50px;
|
||||
background-color: #596cae;
|
||||
color: white;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-weight: 900;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#header h1:last-child {
|
||||
position: absolute;
|
||||
font-weight: 700;
|
||||
float: right;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#panel {
|
||||
transition: 0.5s all cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
width: 150px;
|
||||
height: 125px;
|
||||
background-color: #596cae;
|
||||
border-radius: 5px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#panel:not(.open) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#panel:not(.open):hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
#panel #icon {
|
||||
margin-top: 25px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.about {
|
||||
background-color: #ff9d09 !important;
|
||||
}
|
||||
|
||||
.options {
|
||||
background-color: #7a7a7a !important;
|
||||
}
|
||||
|
||||
.github {
|
||||
background-color: #fa503c !important;
|
||||
}
|
||||
|
||||
.open {
|
||||
position: fixed;
|
||||
transition: 0.5s all ease-out;
|
||||
transform: scale(5);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.open * {
|
||||
transition: 0.15s all ease-out;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.panelContent {
|
||||
position: relative;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.panelContent:not(.open) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.panelContent.open {
|
||||
display: block;
|
||||
}
|
||||
20
Extension/css/reset.css
Normal file
@@ -0,0 +1,20 @@
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 0;
|
||||
width: 325px;
|
||||
background-color: #282828;
|
||||
}
|
||||
|
||||
* {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#header {
|
||||
height: 50px;
|
||||
background-color: #7289da;
|
||||
color: white;
|
||||
text-align: center;
|
||||
line-height: 50px;
|
||||
}
|
||||
106
Extension/css/tab.css
Normal file
@@ -0,0 +1,106 @@
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: 282828;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#header,
|
||||
#footer {
|
||||
background-color: #7289da;
|
||||
color: white;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#icon {
|
||||
margin: 5px;
|
||||
width: 50px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#title {
|
||||
float: left;
|
||||
font-size: 25px;
|
||||
font-weight: 900;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#version {
|
||||
margin-right: 15px;
|
||||
font-size: 25px;
|
||||
font-weight: 700;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
h1:not(#title):not(#version),
|
||||
h2,
|
||||
h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
position: relative;
|
||||
font-size: 25px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin-top: 5px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h2:last-of-type {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
p,
|
||||
li {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
a {
|
||||
transition: all 0.25s cubic-bezier(0.6, 0.29, 0.35, 0.85);
|
||||
position: relative;
|
||||
color: rgb(0, 125, 255);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.hu:after {
|
||||
transition: width 0.25s cubic-bezier(0.6, 0.29, 0.35, 0.85);
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
height: 2px;
|
||||
width: 0;
|
||||
background-color: rgb(0, 125, 255);
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: rgb(0, 150, 255);
|
||||
}
|
||||
|
||||
a.hu:hover:after {
|
||||
width: 100%;
|
||||
}
|
||||
137
Extension/html/popup/options.html
Normal file
@@ -0,0 +1,137 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="../../css/reset.css">
|
||||
<link rel="stylesheet" href="../../css/inputs.css">
|
||||
<link rel="stylesheet" href="../../css/options.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1 class="Ppreferences"></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1 class="Pgeneral"></h1>
|
||||
<table>
|
||||
<thead>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr id="tPresence">
|
||||
<td class="Penabled"></td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="togglePresence" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="PmediaControls"></td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleMediaControls" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="PcheckForUpdates"></td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleCheckUpdates" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="PsystemStartup"></td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleSystemStartup" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h1 class="Ppresences"></h1>
|
||||
<table>
|
||||
<thead>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>YouTube</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleYouTube" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YouTube Music</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleYouTubeMusic" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Twitch</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleTwitch" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SoundCloud</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleSoundCloud" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Netflix</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleNetflix" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>KissAnime</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleKissAnime" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>JKAnime</td>
|
||||
<td class="right">
|
||||
<label class="switch">
|
||||
<input class="toggleJKAnime" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script src="../../js/util/jquery-3.3.1.min.js"></script>
|
||||
<script src="../../js/util/socket.io-2.1.1.min.js"></script>
|
||||
<script src="../../js/options.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
28
Extension/html/popup/popup.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="../../css/popup.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1 class="Pname"></h1>
|
||||
<h1 class="Pversion"></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="panel" class="github">
|
||||
<i id="icon" class="fab fa-github"></i>
|
||||
<h1 id="name">GitHub</h1>
|
||||
</div>
|
||||
<div id="panel" class="options">
|
||||
<i id="icon" class="fas fa-cog"></i>
|
||||
<h1 id="name" class="Poptions"></h1>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../js/util/jquery-3.3.1.min.js"></script>
|
||||
<script src="../../js/popup.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
36
Extension/html/tabs/installed.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>PreMiD</title>
|
||||
<link rel="stylesheet" href="../../css/tab.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<img id="icon" src="../../icon.png" draggable="false">
|
||||
<h1 id="title">PreMiD</h1>
|
||||
<h1 id="version"></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1 id="installedThanks"></h1>
|
||||
<h2 id="installedApp"></h2>
|
||||
<h3 id="installedNo"></h3>
|
||||
<ul>
|
||||
<li id="installedStepApp"></li>
|
||||
<li id="installedWaitInstalled"></li>
|
||||
<li id="installedMayWarning"></li>
|
||||
<li id="installedAppAutostart"></li>
|
||||
</ul>
|
||||
<h3 id="installedYes"></h3>
|
||||
<p id="installedStart"></p>
|
||||
<h2 id="installedSupportMe"></h2>
|
||||
<a href="https://www.patreon.com/bePatron?u=4610890" target="_blank" data-patreon-widget-type="become-patron-button"><img
|
||||
src="../../images/patreonBTN.png" draggable="false" height="50px" alt="Support me on Patreon!"></a>
|
||||
<a href="https://discord.gg/Kw7WaYn" target="_blank" title="Join our Discord!">
|
||||
<img src="../../images/discord-logo.svg" height="50px" draggable="false" alt="Join my Discord!">
|
||||
</a>
|
||||
</div>
|
||||
<script src="../../js/installed.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
32
Extension/html/tabs/updated.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>PreMiD</title>
|
||||
<link rel="stylesheet" href="../../css/tab.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<img id="icon" src="../../icon.png" draggable="false">
|
||||
<h1 id="title">PreMiD</h1>
|
||||
<h1 id="version"></h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<h1 id="updatedYTPUpdated"></h1>
|
||||
<h2 id="updatedWhatsNew"></h2>
|
||||
<ul id="updatedWhatsNewList">
|
||||
</ul>
|
||||
<h2 id="updatedWhatChanged"></h2>
|
||||
<ul id="updatedWhatChangedList">
|
||||
</ul>
|
||||
<h2 id="installedSupportMe"></h2>
|
||||
<a href="https://www.patreon.com/bePatron?u=4610890" target="_blank" data-patreon-widget-type="become-patron-button"><img
|
||||
src="../../images/patreonBTN.png" draggable="false" height="50px" alt="Support me on Patreon!"></a>
|
||||
<a href="https://discord.gg/Kw7WaYn" target="_blank" title="Join our Discord!">
|
||||
<img src="../../images/discord-logo.svg" height="50px" draggable="false" alt="Join my Discord!">
|
||||
</a>
|
||||
</div>
|
||||
<script src="../../js/updated.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
Extension/images/patreonBTN.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
62
Extension/js/background.js
Normal file
@@ -0,0 +1,62 @@
|
||||
chrome.runtime.onInstalled.addListener(function(details) {
|
||||
switch(details.reason) {
|
||||
case "install": {
|
||||
chrome.tabs.create({url: "html/tabs/installed.html"})
|
||||
break;
|
||||
}
|
||||
case "update": {
|
||||
chrome.tabs.create({url: "html/tabs/updated.html"})
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//* Tab Priority
|
||||
var lastAllowedTab = null,
|
||||
allowedURL = []
|
||||
setInterval(() => {
|
||||
chrome.storage.sync.get(['options'], function(result) {
|
||||
allowedURL = ["www.youtube.com", "music.youtube.com", "twitch.tv", "soundcloud.com", "netflix.com", "kissanime.ac", "kissanime.ru", "jkanime.net"]
|
||||
var options = result.options
|
||||
if(!options.enabled) allowedURL = []
|
||||
if(!options.youtube) allowedURL.remove("www.youtube.com")
|
||||
if(!options.youtubeMusic) allowedURL.remove("music.youtube.com")
|
||||
if(!options.twitch) allowedURL.remove("twitch.tv")
|
||||
if(!options.soundcloud) allowedURL.remove("soundcloud.com")
|
||||
if(!options.netflix) allowedURL.remove("netflix.com")
|
||||
if(!options.kissanime) allowedURL.remove("kissanime.ac") && allowedURL.remove('kissanime.ru')
|
||||
if(!options.jkanime) allowedURL.remove("jkanime.net")
|
||||
})
|
||||
chrome.tabs.getAllInWindow(null, (tabs) => {
|
||||
|
||||
for (var i = 0; i < allowedURL.length; i++) {
|
||||
var currentTab = tabs.find(tab => tab.highlighted)
|
||||
if(currentTab.url.indexOf(allowedURL[i]) > -1) {
|
||||
lastAllowedTab = currentTab.id
|
||||
}
|
||||
}
|
||||
if(lastAllowedTab != null) {
|
||||
chrome.tabs.sendMessage(lastAllowedTab, {"high": true})
|
||||
}
|
||||
})
|
||||
}, 500)
|
||||
|
||||
Array.prototype.remove = function() {
|
||||
var what, a = arguments, L = a.length, ax;
|
||||
while (L && this.length) {
|
||||
what = a[--L];
|
||||
while ((ax = this.indexOf(what)) !== -1) {
|
||||
this.splice(ax, 1);
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
setInterval(() => {
|
||||
chrome.storage.sync.get(['options'], function(result) {
|
||||
socket.emit('settingsChange', result)
|
||||
})
|
||||
}, 1000)
|
||||
11
Extension/js/installed.js
Normal file
@@ -0,0 +1,11 @@
|
||||
document.getElementById('version').innerHTML = 'V' + chrome.runtime.getManifest().version
|
||||
document.getElementById('installedThanks').innerHTML = chrome.i18n.getMessage("installedThanks")
|
||||
document.getElementById('installedApp').innerHTML = chrome.i18n.getMessage("installedApp")
|
||||
document.getElementById('installedNo').innerHTML = chrome.i18n.getMessage("installedNo")
|
||||
document.getElementById('installedStepApp').innerHTML = chrome.i18n.getMessage("installedStepApp", "<a class='hu' target='_blank' href='https://github.com/Timeraa/PreMiD/releases/latest'>" + chrome.i18n.getMessage("installedStepAppMyRepository") + "</a>")
|
||||
document.getElementById('installedWaitInstalled').innerHTML = chrome.i18n.getMessage("installedWaitInstalled")
|
||||
document.getElementById('installedMayWarning').innerHTML = chrome.i18n.getMessage("installedMayWarning")
|
||||
document.getElementById('installedAppAutostart').innerHTML = chrome.i18n.getMessage("installedAppAutostart")
|
||||
document.getElementById('installedYes').innerHTML = chrome.i18n.getMessage("installedYes")
|
||||
document.getElementById('installedStart').innerHTML = chrome.i18n.getMessage("installedStart")
|
||||
document.getElementById('installedSupportMe').innerHTML = chrome.i18n.getMessage("installedSupportMe")
|
||||
140
Extension/js/options.js
Normal file
@@ -0,0 +1,140 @@
|
||||
let options = undefined
|
||||
|
||||
$('.Ppreferences').html(chrome.i18n.getMessage('options'))
|
||||
$('.Pgeneral').html(chrome.i18n.getMessage('general'))
|
||||
$('.Penabled').html(chrome.i18n.getMessage('enabled'))
|
||||
$('.PmediaControls').html(chrome.i18n.getMessage('mediaControls'))
|
||||
$('.PcheckForUpdates').html(chrome.i18n.getMessage('checkForUpdates'))
|
||||
$('.PsystemStartup').html(chrome.i18n.getMessage('systemStartup'))
|
||||
$('.Ppresences').html(chrome.i18n.getMessage('presences'))
|
||||
|
||||
chrome.runtime.getPlatformInfo(function(info) {
|
||||
if(info.os == "mac")
|
||||
$('<tr><td>Title Menubar</td><td><label class="switch"><input class="toggleTitleMenubar" type="checkbox"><span class="slider round"></span></label></td></tr>').insertAfter('#tPresence')
|
||||
titleMenubarToggle = $('.toggleTitleMenubar')
|
||||
titleMenubarToggle.change(tMB);
|
||||
})
|
||||
|
||||
$(document).ready(function() {
|
||||
var enabledToggle = $('.togglePresence'),
|
||||
youtubeToggle = $('.toggleYouTube'),
|
||||
youtubeMusicToggle = $('.toggleYouTubeMusic'),
|
||||
twitchToggle = $('.toggleTwitch'),
|
||||
soundcloudToggle = $('.toggleSoundCloud'),
|
||||
netflixToggle = $('.toggleNetflix'),
|
||||
kissanimeToggle = $('.toggleKissAnime'),
|
||||
jkanimeToggle = $('.toggleJKAnime')
|
||||
mediaControlsToggle = $('.toggleMediaControls')
|
||||
checkForUpdatesToggle = $('.toggleCheckUpdates')
|
||||
systemStartupToggle = $('.toggleSystemStartup')
|
||||
|
||||
enabledToggle.change(tEnabled);
|
||||
youtubeToggle.change(tYT);
|
||||
youtubeMusicToggle.change(tYTM);
|
||||
twitchToggle.change(tT);
|
||||
soundcloudToggle.change(tSC);
|
||||
netflixToggle.change(tN);
|
||||
kissanimeToggle.change(tKA);
|
||||
jkanimeToggle.change(tJKA);
|
||||
mediaControlsToggle.change(tMC);
|
||||
checkForUpdatesToggle.change(tCFU);
|
||||
systemStartupToggle.change(tSS);
|
||||
|
||||
chrome.storage.sync.get(['options'], function(result) {
|
||||
options = result.options
|
||||
if(result.options == undefined) {
|
||||
chrome.storage.sync.set({options: {enabled: true, youtube: true, youtubeMusic: true, twitch: true, soundcloud: true, netflix: true, kissanime: true, jkanime: true, titleMenubar: true, mediaControls: true, checkForUpdates: true, systemStartup: true}})
|
||||
enabledToggle.prop('checked', true)
|
||||
youtubeToggle.prop('checked', true)
|
||||
youtubeMusicToggle.prop('checked', true)
|
||||
twitchToggle.prop('checked', true)
|
||||
soundcloudToggle.prop('checked', true)
|
||||
netflixToggle.prop('checked', true)
|
||||
kissanimeToggle.prop('checked', true)
|
||||
jkanimeToggle.prop('checked', true)
|
||||
if(titleMenubarToggle != undefined)
|
||||
titleMenubarToggle.prop('checked', true)
|
||||
mediaControlsToggle.prop('checked', true)
|
||||
checkForUpdatesToggle.prop('checked', true)
|
||||
systemStartupToggle.prop('checked', true)
|
||||
} else {
|
||||
enabledToggle.prop('checked', result.options.enabled)
|
||||
youtubeToggle.prop('checked', result.options.youtube)
|
||||
youtubeMusicToggle.prop('checked', result.options.youtubeMusic)
|
||||
twitchToggle.prop('checked', result.options.twitch)
|
||||
soundcloudToggle.prop('checked', result.options.soundcloud)
|
||||
netflixToggle.prop('checked', result.options.netflix)
|
||||
kissanimeToggle.prop('checked', result.options.kissanime)
|
||||
jkanimeToggle.prop('checked', result.options.jkanime)
|
||||
if(titleMenubarToggle != undefined)
|
||||
titleMenubarToggle.prop('checked', result.options.titleMenubar)
|
||||
mediaControlsToggle.prop('checked', result.options.mediaControls)
|
||||
checkForUpdatesToggle.prop('checked', result.options.checkForUpdates)
|
||||
systemStartupToggle.prop('checked', result.options.systemStartup)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
function tEnabled() {
|
||||
options.enabled = !options.enabled
|
||||
sync()
|
||||
}
|
||||
|
||||
function tYT() {
|
||||
options.youtube = !options.youtube
|
||||
sync()
|
||||
}
|
||||
|
||||
function tYTM() {
|
||||
options.youtubeMusic = !options.youtubeMusic
|
||||
sync()
|
||||
}
|
||||
|
||||
function tT() {
|
||||
options.twitch = !options.twitch
|
||||
sync()
|
||||
}
|
||||
|
||||
function tSC() {
|
||||
options.soundcloud = !options.soundcloud
|
||||
sync()
|
||||
}
|
||||
|
||||
function tN() {
|
||||
options.netflix = !options.netflix
|
||||
sync()
|
||||
}
|
||||
|
||||
function tKA() {
|
||||
options.kissanime = !options.kissanime
|
||||
sync()
|
||||
}
|
||||
|
||||
function tJKA() {
|
||||
options.jkanime = !options.jkanime
|
||||
sync()
|
||||
}
|
||||
|
||||
function tMB() {
|
||||
options.titleMenubar = !options.titleMenubar
|
||||
sync()
|
||||
}
|
||||
|
||||
function tMC() {
|
||||
options.mediaControls = !options.mediaControls
|
||||
sync()
|
||||
}
|
||||
|
||||
function tCFU() {
|
||||
options.checkForUpdates = !options.checkForUpdates
|
||||
sync()
|
||||
}
|
||||
|
||||
function tSS() {
|
||||
options.systemStartup = !options.systemStartup
|
||||
sync()
|
||||
}
|
||||
|
||||
function sync() {
|
||||
chrome.storage.sync.set({options: options})
|
||||
}
|
||||
20
Extension/js/popup.js
Normal file
@@ -0,0 +1,20 @@
|
||||
$(document).ready(function() {
|
||||
$('.Pname').html(chrome.runtime.getManifest().name)
|
||||
$('.Pversion').html('V' + chrome.runtime.getManifest().version)
|
||||
$('.Pabout').html(chrome.i18n.getMessage('about'))
|
||||
$('.Pfeedback').html(chrome.i18n.getMessage('feedback'))
|
||||
$('.Poptions').html(chrome.i18n.getMessage('options'))
|
||||
|
||||
$('#content #panel').each(function() {
|
||||
this.addEventListener('click', updateItem)
|
||||
})
|
||||
})
|
||||
|
||||
function updateItem() {
|
||||
$(this).addClass('open')
|
||||
setTimeout(() => {
|
||||
if($(this).attr("class").split(' ')[0] == "github") {
|
||||
chrome.tabs.create({url: 'https://github.com/Timeraa/PreMiD'})
|
||||
} else window.location.href= $(this).attr("class").split(' ')[0] + ".html";
|
||||
}, 350)
|
||||
}
|
||||
146
Extension/js/presences/JKAnime.js
Normal file
@@ -0,0 +1,146 @@
|
||||
let videoRunning = false,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
//* Update data and send to application
|
||||
$(document).ready(() => {
|
||||
setInterval(playbackChange, 250)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
videoRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
})
|
||||
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Handle Media Keys from sent by application
|
||||
socket.on('mediaKeyHandler', handleMediaKeys)
|
||||
|
||||
/**
|
||||
* Handles Media Keys for easy media control
|
||||
* @param {Object} data Data received from socket
|
||||
*/
|
||||
function handleMediaKeys(data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (videoRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.server-box iframe:first').contents().find('video:first')[0].paused ? $('.server-box iframe:first').contents().find('video:first')[0].play() : $('.server-box iframe:first').contents().find('video:first')[0].pause()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Data and send it to the App
|
||||
* @param {String} playbackChange Playback if changed
|
||||
*/
|
||||
function updateData(playbackChange = false) {
|
||||
var eventType
|
||||
videoRunning = $('.video-header h1').html() != "" && $('.server-box iframe:first').contents().find('video:first')[0] != undefined && !isNaN($('.server-box iframe:first').contents().find('video:first')[0].duration) ? true : false
|
||||
if(videoRunning) {
|
||||
var videoTitle = $('.video-header h1').html(),
|
||||
videoEpisode = 'Episode ' + $('.video-header h1').html().split(' - ').pop(),
|
||||
videoTimeSeconds = Math.floor($('.server-box iframe:first').contents().find('video:first')[0].currentTime),
|
||||
videoDurationSeconds = Math.floor($('.server-box iframe:first').contents().find('video:first')[0].duration),
|
||||
videoTimestamps = getTimestamps(videoTimeSeconds, videoDurationSeconds)
|
||||
playback = $('.server-box iframe:first').contents().find('video:first')[0].paused ? "paused" : "playing"
|
||||
|
||||
if (playbackChange) eventType = 'playBackChange'; else eventType = 'updateData';
|
||||
|
||||
var playbackBoolean = !$('.server-box iframe:first').contents().find('video:first')[0].paused
|
||||
|
||||
var smallImageKey = playbackBoolean ? 'play' : 'pause',
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
if(playbackBoolean) {
|
||||
var data = {
|
||||
clientID: '505709790811389962',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoEpisode).text(),
|
||||
largeImageKey: 'jka_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: videoTimestamps[0],
|
||||
endTimestamp: videoTimestamps[1]
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'JKAnime'
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
clientID: '505709790811389962',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoEpisode).text(),
|
||||
largeImageKey: 'jka_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'JKAnime'
|
||||
}
|
||||
}
|
||||
console.log(data)
|
||||
}
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Timestamps
|
||||
* @param {Number} videoTime Song Time
|
||||
* @param {Number} videoDuration Song Duration
|
||||
*/
|
||||
function getTimestamps(videoTime, videoDuration) {
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
videoTime +
|
||||
videoDuration;
|
||||
return [Math.floor(startTime/1000), endTime]
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles playback
|
||||
*/
|
||||
function togglePlayback() {
|
||||
//* Toggle playback variable
|
||||
playback = !playback
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
var lastPlayback = false
|
||||
function playbackChange() {
|
||||
if(videoRunning) {
|
||||
if($('.server-box iframe:first').contents().find('video:first')[0].paused != lastPlayback) {
|
||||
togglePlayback()
|
||||
lastPlayback = $('.server-box iframe:first').contents().find('video:first')[0].paused
|
||||
}
|
||||
}
|
||||
}
|
||||
145
Extension/js/presences/KissAnime.js
Normal file
@@ -0,0 +1,145 @@
|
||||
let videoRunning = false,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
//* Update data and send to application
|
||||
$(document).ready(() => {
|
||||
setInterval(playbackChange, 250)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
videoRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
})
|
||||
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Handle Media Keys from sent by application
|
||||
socket.on('mediaKeyHandler', handleMediaKeys)
|
||||
|
||||
/**
|
||||
* Handles Media Keys for easy media control
|
||||
* @param {Object} data Data received from socket
|
||||
*/
|
||||
function handleMediaKeys(data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (videoRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('#player_html5_html5_api')[0].paused ? $('#player_html5_html5_api')[0].play() : $('#player_html5_html5_api')[0].pause()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Data and send it to the App
|
||||
* @param {String} playbackChange Playback if changed
|
||||
*/
|
||||
function updateData(playbackChange = false) {
|
||||
var eventType
|
||||
videoRunning = $('.movie_back_link strong').html() != "" && $('#player_html5_html5_api')[0] != undefined && !isNaN($('#player_html5_html5_api')[0].duration) ? true : false
|
||||
if(videoRunning) {
|
||||
var videoTitle = $('.movie_back_link strong').html(),
|
||||
videoEpisode = $('#selectEpisode option:selected').text().trim(),
|
||||
videoTimeSeconds = Math.floor($('#player_html5_html5_api')[0].currentTime),
|
||||
videoDurationSeconds = Math.floor($('#player_html5_html5_api')[0].duration),
|
||||
videoTimestamps = getTimestamps(videoTimeSeconds, videoDurationSeconds)
|
||||
playback = $('#player_html5_html5_api')[0].paused ? "paused" : "playing"
|
||||
|
||||
if (playbackChange) eventType = 'playBackChange'; else eventType = 'updateData';
|
||||
|
||||
var playbackBoolean = !$('#player_html5_html5_api')[0].paused
|
||||
|
||||
var smallImageKey = playbackBoolean ? 'play' : 'pause',
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
if(playbackBoolean) {
|
||||
var data = {
|
||||
clientID: '505704053238398986',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoEpisode).text(),
|
||||
largeImageKey: 'ka_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: videoTimestamps[0],
|
||||
endTimestamp: videoTimestamps[1]
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'KissAnime'
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
clientID: '505704053238398986',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoEpisode).text(),
|
||||
largeImageKey: 'ka_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'KissAnime'
|
||||
}
|
||||
}
|
||||
}
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Timestamps
|
||||
* @param {Number} videoTime Song Time
|
||||
* @param {Number} videoDuration Song Duration
|
||||
*/
|
||||
function getTimestamps(videoTime, videoDuration) {
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
videoTime +
|
||||
videoDuration;
|
||||
return [Math.floor(startTime/1000), endTime]
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles playback
|
||||
*/
|
||||
function togglePlayback() {
|
||||
//* Toggle playback variable
|
||||
playback = !playback
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
var lastPlayback = false
|
||||
function playbackChange() {
|
||||
if(videoRunning) {
|
||||
if($('#player_html5_html5_api')[0].paused != lastPlayback) {
|
||||
togglePlayback()
|
||||
lastPlayback = $('#player_html5_html5_api')[0].paused
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
playbackNew,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
@@ -14,29 +17,6 @@ setInterval(() => {
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
@@ -85,9 +65,25 @@ function checkPlayChange() {
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
}
|
||||
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
@@ -107,28 +103,51 @@ function updateData(playbackChange = false) {
|
||||
|
||||
var endTime
|
||||
if(musicRunning && $('.VideoContainer div video')[0] != undefined) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime / 1000) -
|
||||
var startTime = Math.floor(Date.now()/1000);
|
||||
endTime = startTime -
|
||||
Math.floor($('.VideoContainer div video')[0].currentTime) +
|
||||
Math.floor($('.VideoContainer div video')[0].duration);
|
||||
|
||||
data = {
|
||||
nflix: {
|
||||
url: urlForVideo,
|
||||
seriesTitle: $('.ellipsize-text').children().html(),
|
||||
season: $($('.ellipsize-text').children().get(1)).html(),
|
||||
episodeTitle: $($('.ellipsize-text').children().get(2)).html(),
|
||||
episodeCurrentTimeSeconds: Math.floor($('.VideoContainer div video')[0].currentTime),
|
||||
episodeEndTimeSeconds: Math.floor($('.VideoContainer div video')[0].duration),
|
||||
episodeCurrentTime: startTime,
|
||||
episodeEndTime: endTime,
|
||||
playback: $('.VideoContainer div video')[0].paused ? "paused" : "playing"
|
||||
|
||||
var playbackBoolean = !$('.VideoContainer div video')[0].paused
|
||||
|
||||
var smallImageKey = playbackBoolean ? "play" : "pause"
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
if(playbackBoolean) {
|
||||
data = {
|
||||
clientID: '499981204045430784',
|
||||
presenceData: {
|
||||
details: $('.ellipsize-text').children().html(),
|
||||
state: $($('.ellipsize-text').children().get(1)).html(),
|
||||
largeImageKey: 'nflix_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTime,
|
||||
endTimestamp: endTime
|
||||
},
|
||||
currentSeconds: Math.floor($('.VideoContainer div video')[0].currentTime),
|
||||
durationSeconds: Math.floor($('.VideoContainer div video')[0].duration),
|
||||
trayTitle: $('.ellipsize-text').children().html(),
|
||||
playback: playbackBoolean,
|
||||
service: 'Netflix'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
nflix: {
|
||||
playback: false
|
||||
} else {
|
||||
data = {
|
||||
clientID: '499981204045430784',
|
||||
presenceData: {
|
||||
details: $('.ellipsize-text').children().html(),
|
||||
state: $($('.ellipsize-text').children().get(1)).html(),
|
||||
largeImageKey: 'nflix_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText
|
||||
},
|
||||
currentSeconds: Math.floor($('.VideoContainer div video')[0].currentTime),
|
||||
durationSeconds: Math.floor($('.VideoContainer div video')[0].duration),
|
||||
trayTitle: $('.ellipsize-text').children().html(),
|
||||
playback: playbackBoolean,
|
||||
service: 'Netflix'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
playbackNew,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
@@ -14,29 +18,6 @@ setInterval(() => {
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
@@ -89,9 +70,25 @@ function checkPlayChange() {
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
}
|
||||
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
@@ -110,10 +107,57 @@ function updateData(playbackChange = false) {
|
||||
|
||||
var endTime
|
||||
if($('.playbackSoundBadge__titleContextContainer') != undefined) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime/1000) -
|
||||
var startTime = Math.floor(Date.now()/1000);
|
||||
endTime = startTime -
|
||||
getSeconds($('.playbackTimeline__timePassed').children().get(1).innerHTML) + getSeconds($('.playbackTimeline__duration').children().get(1).innerHTML);
|
||||
data = {
|
||||
|
||||
var playbackBoolean = $('.playControl').hasClass('playing')
|
||||
|
||||
var smallImageKey = playbackBoolean ? 'play' : 'pause',
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
|
||||
var songTitle = $('.playbackSoundBadge__titleLink').children().get(1).innerHTML,
|
||||
songAuthorsString = $('.playbackSoundBadge__titleContextContainer').children().get(0).innerHTML;
|
||||
if(playbackBoolean) {
|
||||
data = {
|
||||
clientID: '501021185887436810',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(songTitle).text(),
|
||||
state: $('<div/>').html(songAuthorsString).text(),
|
||||
largeImageKey: 'scloud_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTime,
|
||||
endTimestamp: endTime
|
||||
},
|
||||
currentSeconds: getSeconds($('.playbackTimeline__timePassed').children().get(1).innerHTML),
|
||||
durationSeconds: getSeconds($('.playbackTimeline__duration').children().get(1).innerHTML),
|
||||
trayTitle: $('<div/>').html(songTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'SoundCloud'
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
clientID: '501021185887436810',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(songTitle).text(),
|
||||
state: $('<div/>').html(songAuthorsString).text(),
|
||||
largeImageKey: 'scloud_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText
|
||||
},
|
||||
currentSeconds: getSeconds($('.playbackTimeline__timePassed').children().get(1).innerHTML),
|
||||
durationSeconds: getSeconds($('.playbackTimeline__duration').children().get(1).innerHTML),
|
||||
trayTitle: $('<div/>').html(songTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'SoundCloud'
|
||||
}
|
||||
}
|
||||
|
||||
/*data = {
|
||||
scloud: {
|
||||
url: urlForVideo,
|
||||
songTitle: $('.playbackSoundBadge__titleLink').children().get(1).innerHTML,
|
||||
@@ -124,13 +168,7 @@ function updateData(playbackChange = false) {
|
||||
songEndTime: endTime,
|
||||
playback: $('.playControl').hasClass('playing') ? "playing" : "paused"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
scloud: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
} */
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
175
Extension/js/presences/Twitch.js
Normal file
@@ -0,0 +1,175 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew,
|
||||
lastURL = null,
|
||||
startTimeStamp,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater;
|
||||
|
||||
var lastPlaybackState = true;
|
||||
setInterval(() => {
|
||||
if (
|
||||
$(".player-video video")[0] != null &&
|
||||
$(".player-video video")[0].paused &&
|
||||
lastPlaybackState == true
|
||||
) {
|
||||
handlePlayPause();
|
||||
lastPlaybackState = false;
|
||||
}
|
||||
if (
|
||||
$(".player-video video")[0] != null &&
|
||||
!$(".player-video video")[0].paused &&
|
||||
lastPlaybackState == false
|
||||
) {
|
||||
handlePlayPause();
|
||||
lastPlaybackState = true;
|
||||
}
|
||||
}, 500);
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on("mediaKeyHandler", function(data) {
|
||||
//* Check if the data is for twitch & if music is running
|
||||
//* Media control buttons
|
||||
if ($(".player-video video")[0] != null) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$(".player-video video")[0].paused
|
||||
? $(".qa-pause-play-button").click()
|
||||
: $(".qa-pause-play-button").click();
|
||||
updateData("playPauseVideo");
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false;
|
||||
else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused");
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($(".ytp-play-button svg").prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true;
|
||||
//* Pause song
|
||||
$(".ytp-play-button").click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function() {
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if (tabActive == 5) {
|
||||
dataUpdaterRunning = false;
|
||||
clearInterval(dataUpdater);
|
||||
}
|
||||
if (tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true;
|
||||
dataUpdater = setInterval(updateData, 1000);
|
||||
}
|
||||
if (tabActive > 0) tabActive--;
|
||||
}, 500);
|
||||
};
|
||||
|
||||
chrome.runtime.onMessage.addListener((message, sender) => {
|
||||
if (tabActive <= 9) tabActive += 2;
|
||||
if (tabActive == 0) tabActive = 5;
|
||||
});
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = [];
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
urlForVideo = document.location.href;
|
||||
|
||||
if (playbackChange != false) {
|
||||
var eventType = "playBackChange";
|
||||
} else {
|
||||
var eventType = "updateData";
|
||||
}
|
||||
|
||||
if (
|
||||
$(".player-video video")[0] != undefined &&
|
||||
$(".tw-ellipsis.tw-mg-b-05").children().length > 0
|
||||
) {
|
||||
if (urlForVideo != lastURL) {
|
||||
lastURL = urlForVideo;
|
||||
startTimeStamp = Math.floor(Date.now() / 1000);
|
||||
}
|
||||
|
||||
var playbackBoolean = !$(".player-video video")[0].paused;
|
||||
|
||||
var smallImageKey = playbackBoolean ? "play" : "pause",
|
||||
smallImageText = playbackBoolean
|
||||
? chrome.i18n.getMessage("playbackPlaying")
|
||||
: chrome.i18n.getMessage("playbackPaused");
|
||||
|
||||
var streamTitle = $(".tw-ellipsis.tw-mg-b-05")
|
||||
.children()
|
||||
.get(0).innerHTML,
|
||||
streamHost = $(".channel-header__user h5").html();
|
||||
if (playbackBoolean) {
|
||||
var data = {
|
||||
clientID: "501021996336021504",
|
||||
presenceData: {
|
||||
details: $("<div/>")
|
||||
.html(streamTitle)
|
||||
.text(),
|
||||
state: $("<div/>")
|
||||
.html(streamHost)
|
||||
.text(),
|
||||
largeImageKey: "twitch_lg",
|
||||
largeImageText:
|
||||
chrome.runtime.getManifest().name +
|
||||
" V" +
|
||||
chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimeStamp
|
||||
},
|
||||
trayTitle: $("<div/>")
|
||||
.html(streamTitle)
|
||||
.text(),
|
||||
playback: playbackBoolean,
|
||||
service: "Twitch"
|
||||
};
|
||||
} else {
|
||||
var data = {
|
||||
clientID: "501021996336021504",
|
||||
presenceData: {
|
||||
details: $("<div/>")
|
||||
.html(streamTitle)
|
||||
.text(),
|
||||
state: $("<div/>")
|
||||
.html(streamHost)
|
||||
.text(),
|
||||
largeImageKey: "twitch_lg",
|
||||
largeImageText:
|
||||
chrome.runtime.getManifest().name +
|
||||
" V" +
|
||||
chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText
|
||||
},
|
||||
trayTitle: $("<div/>")
|
||||
.html(streamTitle)
|
||||
.text(),
|
||||
playback: playbackBoolean,
|
||||
service: "Twitch"
|
||||
};
|
||||
}
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data);
|
||||
}
|
||||
155
Extension/js/presences/YouTube.js
Normal file
@@ -0,0 +1,155 @@
|
||||
let videoRunning = false,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
//* Update data and send to application
|
||||
$(document).ready(() => {
|
||||
setInterval(playbackChange, 250)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
videoRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
})
|
||||
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Handle Media Keys from sent by application
|
||||
socket.on('mediaKeyHandler', handleMediaKeys)
|
||||
|
||||
/**
|
||||
* Handles Media Keys for easy media control
|
||||
* @param {Object} data Data received from socket
|
||||
*/
|
||||
function handleMediaKeys(data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (videoRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.ytp-play-button').click()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.ytp-next-button')[0].click()
|
||||
//* Send response back to application
|
||||
updateData("nextTrack")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.ytp-prev-button')[0].click()
|
||||
//* Send response back to application
|
||||
updateData("previousTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Data and send it to the App
|
||||
* @param {String} playbackChange Playback if changed
|
||||
*/
|
||||
function updateData(playbackChange = false) {
|
||||
var eventType
|
||||
videoRunning = $('.ytd-video-primary-info-renderer .title').text() != "" && $('.video-stream')[0] != undefined && !isNaN($('.video-stream')[0].duration) ? true : false
|
||||
if(videoRunning) {
|
||||
var videoTitle = $('.ytd-video-primary-info-renderer .title').text(),
|
||||
videoAuthor = $("#upload-info .style-scope .ytd-video-owner-renderer").contents().first().html(),
|
||||
videoTimeSeconds = Math.floor($('.video-stream')[0].currentTime),
|
||||
videoDurationSeconds = Math.floor($('.video-stream')[0].duration),
|
||||
videoTimestamps = getTimestamps(videoTimeSeconds, videoDurationSeconds)
|
||||
playback = $('.video-stream')[0].paused ? "paused" : "playing"
|
||||
|
||||
if (playbackChange) eventType = 'playBackChange'; else eventType = 'updateData';
|
||||
|
||||
var playbackBoolean = !$('.video-stream')[0].paused
|
||||
|
||||
var smallImageKey = playbackBoolean ? 'play' : 'pause',
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
if(playbackBoolean) {
|
||||
var data = {
|
||||
clientID: '463097721130188830',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoAuthor).text(),
|
||||
largeImageKey: 'yt_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: videoTimestamps[0],
|
||||
endTimestamp: videoTimestamps[1]
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'YouTube'
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
clientID: '463097721130188830',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(videoTitle).text(),
|
||||
state: $('<div/>').html(videoAuthor).text(),
|
||||
largeImageKey: 'yt_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
},
|
||||
currentSeconds: videoTimeSeconds,
|
||||
durationSeconds: videoDurationSeconds,
|
||||
trayTitle: $('<div/>').html(videoTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'YouTube'
|
||||
}
|
||||
}
|
||||
}
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Timestamps
|
||||
* @param {Number} videoTime Song Time
|
||||
* @param {Number} videoDuration Song Duration
|
||||
*/
|
||||
function getTimestamps(videoTime, videoDuration) {
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
videoTime +
|
||||
videoDuration;
|
||||
return [Math.floor(startTime/1000), endTime]
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles playback
|
||||
*/
|
||||
function togglePlayback() {
|
||||
//* Toggle playback variable
|
||||
playback = !playback
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
var lastPlayback = false
|
||||
function playbackChange() {
|
||||
if(videoRunning) {
|
||||
if($('.video-stream')[0].paused != lastPlayback) {
|
||||
togglePlayback()
|
||||
lastPlayback = $('.video-stream')[0].paused
|
||||
}
|
||||
}
|
||||
}
|
||||
192
Extension/js/presences/YouTubeMusic.js
Normal file
@@ -0,0 +1,192 @@
|
||||
let musicRunning = false,
|
||||
tabActive = 0,
|
||||
dataUpdaterRunning = false,
|
||||
dataUpdater
|
||||
|
||||
//* Update data and send to application
|
||||
$(document).ready(() => {
|
||||
setInterval(playbackChange, 250)
|
||||
//* Tab Priority
|
||||
setInterval(() => {
|
||||
if(tabActive == 5) {
|
||||
dataUpdaterRunning = false
|
||||
musicRunning = false
|
||||
clearInterval(dataUpdater)
|
||||
}
|
||||
if(tabActive >= 9 && dataUpdaterRunning == false) {
|
||||
dataUpdaterRunning = true
|
||||
dataUpdater = setInterval(updateData, 1000)
|
||||
}
|
||||
if(tabActive > 0) tabActive--
|
||||
}, 500)
|
||||
})
|
||||
|
||||
|
||||
//* Tab Priority
|
||||
chrome.runtime.onMessage.addListener(((message, sender) => {
|
||||
if(tabActive <= 9) tabActive += 2
|
||||
if(tabActive == 0) tabActive = 5
|
||||
}))
|
||||
|
||||
//* Handle Media Keys from sent by application
|
||||
socket.on('mediaKeyHandler', handleMediaKeys)
|
||||
|
||||
/**
|
||||
* Handles Media Keys for easy media control
|
||||
* @param {Object} data Data received from socket
|
||||
*/
|
||||
function handleMediaKeys(data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.play-pause-button').click()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.next-button').click()
|
||||
//* Send response back to application
|
||||
updateData("nextTrack")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.previous-button').click()
|
||||
//* Send response back to application
|
||||
updateData("previousTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Data and send it to the App
|
||||
* @param {String} playbackChange Playback if changed
|
||||
*/
|
||||
function updateData(playbackChange = false) {
|
||||
var eventType
|
||||
musicRunning = $(".title.style-scope.ytmusic-player-bar").html() != "" && $('.video-stream')[0] != undefined && !isNaN($('.video-stream')[0].duration) ? true : false
|
||||
if(musicRunning) {
|
||||
var songTitle = $(".title.style-scope.ytmusic-player-bar").html(),
|
||||
songAuthors = getAuthors(),
|
||||
songTimeSeconds = Math.floor($('.video-stream')[0].currentTime),
|
||||
songDurationSeconds = Math.floor($('.video-stream')[0].duration),
|
||||
songTimestamps = getTimestamps(songTimeSeconds, songDurationSeconds)
|
||||
playback = $('.video-stream')[0].paused ? "paused" : "playing",
|
||||
songAuthorsString = null;
|
||||
|
||||
if (playbackChange) eventType = 'playBackChange'; else eventType = 'updateData';
|
||||
|
||||
songAuthors.forEach((author, index, authors) => {
|
||||
if (index == 0)
|
||||
songAuthorsString = author;
|
||||
else if (index < authors.length - 2)
|
||||
songAuthorsString = songAuthorsString + ", " + author;
|
||||
else if (index < authors.length - 1) songAuthorsString = songAuthorsString + " and " + author;
|
||||
else songAuthorsString = songAuthorsString + " • " + author;
|
||||
});
|
||||
|
||||
var playbackBoolean = !$('.video-stream')[0].paused
|
||||
|
||||
var smallImageKey = playbackBoolean ? 'play' : 'pause',
|
||||
smallImageText = playbackBoolean ? chrome.i18n.getMessage('playbackPlaying') : chrome.i18n.getMessage('playbackPaused')
|
||||
|
||||
if(playbackBoolean) {
|
||||
var data = {
|
||||
clientID: '463151177836658699',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(songTitle).text(),
|
||||
state: $('<div/>').html(songAuthorsString).text(),
|
||||
largeImageKey: 'ytm_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: songTimestamps[0],
|
||||
endTimestamp: songTimestamps[1]
|
||||
},
|
||||
currentSeconds: songTimeSeconds,
|
||||
durationSeconds: songDurationSeconds,
|
||||
trayTitle: $('<div/>').html(songTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'YouTube Music'
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
clientID: '463151177836658699',
|
||||
presenceData: {
|
||||
details: $('<div/>').html(songTitle).text(),
|
||||
state: $('<div/>').html(songAuthorsString).text(),
|
||||
largeImageKey: 'ytm_lg',
|
||||
largeImageText: chrome.runtime.getManifest().name + ' V' + chrome.runtime.getManifest().version,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText
|
||||
},
|
||||
currentSeconds: songTimeSeconds,
|
||||
durationSeconds: songDurationSeconds,
|
||||
trayTitle: $('<div/>').html(songTitle).text(),
|
||||
playback: playbackBoolean,
|
||||
service: 'YouTube Music'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//* If socket connection, send data
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get authors of Song
|
||||
*/
|
||||
function getAuthors() {
|
||||
var songAuthors = []
|
||||
//* Extract authors as array
|
||||
$(".byline.ytmusic-player-bar").contents().each(function (index, item) {
|
||||
if (item.classList != undefined) {
|
||||
if (item.classList.contains("yt-simple-endpoint") == true) {
|
||||
songAuthors.push(item.innerHTML)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//* If no authors found in previous method use this
|
||||
if (songAuthors.length == 0 || songAuthors.length == 1) {
|
||||
//* Clear old list
|
||||
songAuthors = []
|
||||
songAuthors.push($(".byline.ytmusic-player-bar").contents().first().text())
|
||||
}
|
||||
return songAuthors
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Timestamps
|
||||
* @param {Number} songTime Song Time
|
||||
* @param {Number} songDuration Song Duration
|
||||
*/
|
||||
function getTimestamps(songTime, songDuration) {
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
songTime +
|
||||
songDuration;
|
||||
return [Math.floor(startTime/1000), endTime]
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles playback
|
||||
*/
|
||||
function togglePlayback() {
|
||||
//* Toggle playback variable
|
||||
playback = !playback
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
var lastPlayback = false
|
||||
function playbackChange() {
|
||||
if(musicRunning) {
|
||||
if($('.video-stream')[0].paused != lastPlayback) {
|
||||
togglePlayback()
|
||||
lastPlayback = $('.video-stream')[0].paused
|
||||
}
|
||||
}
|
||||
}
|
||||
27
Extension/js/updated.js
Normal file
@@ -0,0 +1,27 @@
|
||||
document.getElementById('version').innerHTML = 'V' + chrome.runtime.getManifest().version
|
||||
document.getElementById('updatedYTPUpdated').innerHTML = chrome.i18n.getMessage("updatedYTPUpdated")
|
||||
document.getElementById('updatedWhatsNew').innerHTML = chrome.i18n.getMessage("updatedWhatsNew")
|
||||
|
||||
var hasNextChanged = true,
|
||||
index = 0
|
||||
while(hasNextChanged) {
|
||||
if(chrome.i18n.getMessage("updatedAdded" + index) != "") {
|
||||
var item = document.getElementById('updatedWhatsNewList').appendChild(document.createElement('li'))
|
||||
item.innerHTML = chrome.i18n.getMessage("updatedAdded" + index)
|
||||
} else hasNextChanged = false;
|
||||
index++
|
||||
}
|
||||
|
||||
document.getElementById('updatedWhatChanged').innerHTML = chrome.i18n.getMessage("updatedWhatChanged")
|
||||
|
||||
var hasNextChanged = true,
|
||||
index = 0
|
||||
while(hasNextChanged) {
|
||||
if(chrome.i18n.getMessage("updatedChanged" + index) != "") {
|
||||
var item = document.getElementById('updatedWhatChangedList').appendChild(document.createElement('li'))
|
||||
item.innerHTML = chrome.i18n.getMessage("updatedChanged" + index)
|
||||
} else hasNextChanged = false;
|
||||
index++
|
||||
}
|
||||
|
||||
document.getElementById('installedSupportMe').innerHTML = chrome.i18n.getMessage("installedSupportMe")
|
||||
27
Extension/js/util/socketConnector.js
Normal file
@@ -0,0 +1,27 @@
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', socketConnect)
|
||||
socket.on('disconnect', socketDisconnect)
|
||||
|
||||
function socketConnect() {
|
||||
console.log(chrome.runtime.getManifest().name + ': %c' + chrome.i18n.getMessage('connected'), "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
insertConnectionInfo(chrome.i18n.getMessage("connected"))
|
||||
}
|
||||
}
|
||||
|
||||
function socketDisconnect() {
|
||||
console.log(chrome.runtime.getManifest().name + ': %c' + chrome.i18n.getMessage('disconnected'), "color: red; font-weight: 700")
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
insertConnectionInfo(chrome.i18n.getMessage("disconnected"))
|
||||
}
|
||||
|
||||
function insertConnectionInfo(message) {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="https://raw.githubusercontent.com/Timeraa/YT-Presence/master/icon.png"><h1>' + chrome.runtime.getManifest().name + '</h1><h2>' + message + '</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
}
|
||||
@@ -1,49 +1,75 @@
|
||||
{
|
||||
"name": "YT Presence",
|
||||
"name": "PreMiD",
|
||||
"author": "Timeraa",
|
||||
"version": "1.1",
|
||||
"description": "YT Presence adds Discord Rich Presence integration, Media controls and much more to YouTube/YouTube Music, Twitch etc...",
|
||||
"version": "1.2",
|
||||
"description": "__MSG_appDesc__",
|
||||
"manifest_version": 2,
|
||||
"default_locale": "en",
|
||||
"icons": {
|
||||
"2024": "icon.png"
|
||||
},
|
||||
"background": {
|
||||
"scripts": ["js/util/socket.io-2.1.1.min.js", "js/background.js"],
|
||||
"presistent": false
|
||||
},
|
||||
"browser_action": {
|
||||
"default_popup": "html/popup/popup.html",
|
||||
"default_icon": {
|
||||
"2024": "icon.png"
|
||||
}
|
||||
},
|
||||
"content_scripts": [
|
||||
{
|
||||
"js": ["util/jquery-3.3.1.min.js", "util/socket.io-2.1.1.min.js"],
|
||||
"css": ["connect.css"],
|
||||
"js": [
|
||||
"js/util/jquery-3.3.1.min.js",
|
||||
"js/util/socket.io-2.1.1.min.js",
|
||||
"js/util/socketConnector.js"
|
||||
],
|
||||
"css": ["css/connect.css"],
|
||||
"matches": [
|
||||
"https://www.youtube.com/*",
|
||||
"https://music.youtube.com/*",
|
||||
"https://www.netflix.com/*",
|
||||
"https://*.netflix.com/*",
|
||||
"https://soundcloud.com/*",
|
||||
"https://www.twitch.tv/*"
|
||||
"https://*.twitch.tv/*",
|
||||
"https://kissanime.ac/*",
|
||||
"https://kissanime.ru/*",
|
||||
"https://jkanime.net/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"js": ["presences/YouTubeMusic.js"],
|
||||
"js": ["js/presences/YouTubeMusic.js"],
|
||||
"matches": ["https://music.youtube.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/YouTube.js"],
|
||||
"js": ["js/presences/YouTube.js"],
|
||||
"matches": ["https://www.youtube.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/Netflix.js"],
|
||||
"js": ["js/presences/Netflix.js"],
|
||||
"matches": ["https://*.netflix.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/SoundCloud.js"],
|
||||
"js": ["js/presences/SoundCloud.js"],
|
||||
"matches": ["https://*.soundcloud.com/*"]
|
||||
},
|
||||
{
|
||||
"js": ["presences/Twitch.js"],
|
||||
"js": ["js/presences/Twitch.js"],
|
||||
"matches": ["https://*.twitch.tv/*"]
|
||||
},
|
||||
{
|
||||
"js": ["js/presences/KissAnime.js"],
|
||||
"matches": ["https://kissanime.ac/*", "https://kissanime.ru/*"]
|
||||
},
|
||||
{
|
||||
"js": ["js/presences/JKAnime.js"],
|
||||
"matches": ["https://jkanime.net/*"]
|
||||
}
|
||||
],
|
||||
"permissions": ["http://localhost:3000/", "tabs", "storage"]
|
||||
"permissions": [
|
||||
"http://localhost:3020/",
|
||||
"tabs",
|
||||
"storage",
|
||||
"declarativeContent"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew,
|
||||
lastURL = null,
|
||||
startTimeStamp
|
||||
|
||||
var lastPlaybackState = true
|
||||
setInterval(() => {
|
||||
if($('.player-video video')[0] != null && $('.player-video video')[0].paused && lastPlaybackState == true) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = false;
|
||||
}
|
||||
if($('.player-video video')[0] != null && !$('.player-video video')[0].paused && lastPlaybackState == false) {
|
||||
handlePlayPause()
|
||||
lastPlaybackState = true;
|
||||
}
|
||||
}, 500)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if ($('.player-video video')[0] != null) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.player-video video')[0].paused ? $('.qa-pause-play-button').click() : $('.qa-pause-play-button').click()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
urlForVideo = document.location.href
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
if($('.player-video video')[0] != undefined && $('.tw-ellipsis.tw-mg-b-05').children().length > 0) {
|
||||
if(urlForVideo != lastURL) {
|
||||
lastURL = urlForVideo
|
||||
startTimeStamp = Date.now()
|
||||
}
|
||||
|
||||
data = {
|
||||
twitch: {
|
||||
url: urlForVideo,
|
||||
streamTitle: $('.tw-ellipsis.tw-mg-b-05').children().get(0).innerHTML,
|
||||
streamHost: $('.channel-header__user h5').html(),
|
||||
watchingSince: startTimeStamp,
|
||||
playback: $('.player-video video')[0].paused ? "paused" : "playing"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
data = {
|
||||
twitch: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
var pauseButton = '<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-91"></use><path class="ytp-svg-fill" d="M 12,26 18.5,22 18.5,14 12,10 z M 18.5,22 25,18 25,18 18.5,14 z" id="ytp-id-91"></path></svg>'
|
||||
var pauseButton = '<svg height="100%" version="1.1" viewBox="0 0 36 36" width="100%"><use class="ytp-svg-shadow" xlink:href="#ytp-id-93"></use><path class="ytp-svg-fill" d="M 12,26 16,26 16,10 12,10 z M 21,26 25,26 25,10 21,10 z" id="ytp-id-93"></path></svg>'
|
||||
|
||||
let playback = true,
|
||||
eventType,
|
||||
playbackNew
|
||||
|
||||
//* Register listeners
|
||||
$('.video-stream').click(handlePlayPause)
|
||||
$('.ytp-play-button').click(handlePlayPause)
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
//$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.video-stream').click()
|
||||
updateData("playPauseVideo")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.ytp-next-button')[0].click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextVideo")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.ytp-prev-button')[0].click()
|
||||
//* Send response back to application
|
||||
updateData("previousVideo")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($('.ytp-play-button svg').prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.ytp-play-button').click()
|
||||
}
|
||||
}
|
||||
|
||||
//* Set musicRunning variable to true if url has /watch or music title not empty
|
||||
if (document.location.pathname.includes("/watch") || $(".title.style-scope.ytmusic-player-bar").html() != "") musicRunning = true; else musicRunning = false;
|
||||
}
|
||||
|
||||
//* Start interval
|
||||
window.onload = function () {
|
||||
setInterval(updateData, 1000)
|
||||
}
|
||||
|
||||
//* Create needed variables
|
||||
let urlForVideo,
|
||||
songTime,
|
||||
calcDifference = []
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
if (document.location.pathname.includes("/watch")) musicRunning = true; else musicRunning = false;
|
||||
urlForVideo = document.location.href
|
||||
if ($(".ytp-time-current").html() != " " && $('.video-stream')[0] != null) {
|
||||
let data
|
||||
|
||||
if (playbackChange != false) {
|
||||
var playbackNew = playbackChange
|
||||
var eventType = 'playBackChange'
|
||||
} else {
|
||||
var playbackNew = playback ? "playing" : "paused"
|
||||
var eventType = 'updateData'
|
||||
}
|
||||
|
||||
var endTime
|
||||
if(musicRunning) {
|
||||
var startTime = Date.now();
|
||||
endTime = Math.floor(startTime / 1000) -
|
||||
Math.floor($('.video-stream')[0].currentTime) +
|
||||
Math.floor($('.video-stream')[0].duration);
|
||||
|
||||
data = {
|
||||
yt: {
|
||||
url: urlForVideo,
|
||||
videoTitle: $(".title.style-scope.ytd-video-primary-info-renderer")
|
||||
.children().html(),
|
||||
videoAuthor: $("#upload-info .style-scope .ytd-video-owner-renderer")
|
||||
.contents()
|
||||
.first()
|
||||
.html(),
|
||||
videoCurrentTimeSeconds: Math.floor($('.video-stream')[0].currentTime),
|
||||
videoEndTimeSeconds: Math.floor($('.video-stream')[0].duration),
|
||||
videoCurrentTime: startTime,
|
||||
videoEndTime: endTime,
|
||||
playback: playbackNew
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(document.location.pathname.startsWith('www.youtube.com')) console.log("NICE")
|
||||
data = {
|
||||
yt: {
|
||||
playback: false
|
||||
}
|
||||
}
|
||||
}
|
||||
if (socket.connected && !isNaN($('.video-stream')[0].duration)) socket.emit(eventType, data)
|
||||
}
|
||||
}
|
||||
|
||||
function getSeconds(string) {
|
||||
const a = string.split(":")
|
||||
|
||||
const seconds = +a[0] * 60 + +a[1]
|
||||
return seconds
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
//* Play Pause buttons
|
||||
var playButton = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope iron-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope iron-icon"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" class="style-scope iron-icon"></path></g></svg>'
|
||||
var pauseButton = '<svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope iron-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope iron-icon"><path d="M8 5v14l11-7z" class="style-scope iron-icon"></path></g></svg>'
|
||||
|
||||
//* Create needed variables
|
||||
let splitTime,
|
||||
songCurrentTime,
|
||||
songEndTime,
|
||||
songAuthors = [],
|
||||
playback = true,
|
||||
eventType
|
||||
|
||||
//* Register listeners
|
||||
$('.play-pause-button').click(handlePlayPause)
|
||||
$('.ytmusic-player').click(handlePlayPause)
|
||||
//* Start interval
|
||||
$(document).ready(() => {
|
||||
//* Check Play change
|
||||
setInterval(checkPlayChange, 250)
|
||||
//* Update data and send to application
|
||||
setInterval(updateData, 1000)
|
||||
})
|
||||
|
||||
//* Create socket connection to application
|
||||
var socket = io.connect('http://localhost:3020/');
|
||||
|
||||
//* Log when connected
|
||||
socket.on('connect', function () {
|
||||
console.log('YT Presence: %cConnected to Application', "color: green; font-weight: 700")
|
||||
if(sessionStorage['ytpconnected'] == null || sessionStorage['ytpconnected'] == 'false') {
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Connected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
sessionStorage['ytpconnected'] = 'true'
|
||||
}
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
sessionStorage['ytpconnected'] = 'false'
|
||||
$('<div id="ytp-connectinfo"><img draggable="false" src="//github.com/Timeraa/YT-Presence/blob/master/icon.png?raw=true"><h1>YT Presence</h1><h2>Disconnected</h2></div>').appendTo('body')
|
||||
setTimeout(() => {
|
||||
$('#ytp-connectinfo').remove()
|
||||
}, 5*1000)
|
||||
})
|
||||
|
||||
socket.on('error', (err) => console.log(`Error while connecting... ${err}`))
|
||||
|
||||
//* When we receive messages from the application
|
||||
socket.on('mediaKeyHandler', function (data) {
|
||||
//* Check if the data is for YTM & if music is running
|
||||
//* Media control buttons
|
||||
if (musicRunning) {
|
||||
//* Switch cases for playback / Clicks corresponding buttons
|
||||
switch (data.playback) {
|
||||
case "pause":
|
||||
$('.play-pause-button').click()
|
||||
updateData("playPauseTrack")
|
||||
break
|
||||
case "nextTrack":
|
||||
$('.next-button').click()
|
||||
//* Prevent playback from being paused again
|
||||
playback = true
|
||||
//* Send response back to application
|
||||
updateData("nextTrack")
|
||||
break
|
||||
case "previousTrack":
|
||||
$('.previous-button').click()
|
||||
//* Send response back to application
|
||||
updateData("previousTrack")
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function handlePlayPause() {
|
||||
//* Toggle playback variable
|
||||
if (playback == true) playback = false; else playback = true;
|
||||
//* Send status to application
|
||||
updateData(playback ? "playing" : "paused")
|
||||
}
|
||||
|
||||
function checkPlayChange() {
|
||||
//* Correct playback if out of sync
|
||||
if (playback == false) {
|
||||
//* Check if playbutton on page matches variable
|
||||
if ($(".play-pause-button svg").prop("outerHTML") == playButton) {
|
||||
//* Update playback variable
|
||||
playback = true
|
||||
//* Pause song
|
||||
$('.play-pause-button').click()
|
||||
}
|
||||
}
|
||||
|
||||
//* Set musicRunning variable to true if url has /watch or music title not empty
|
||||
if (document.location.pathname.includes("/watch") || $(".title.style-scope.ytmusic-player-bar").html() != "") musicRunning = true; else musicRunning = false;
|
||||
}
|
||||
|
||||
function updateData(playbackChange = false) {
|
||||
//* Clear author array
|
||||
songAuthors = []
|
||||
|
||||
if ($(".title.style-scope.ytmusic-player-bar").html() != "") {
|
||||
//* Get song Time String (2:10 / 3:21)
|
||||
//* Split to array ["2:10", "3:21"]
|
||||
splitTime = $(".time-info.style-scope.ytmusic-player-bar").html().split(" / ", 2)
|
||||
//* Convert to seconds
|
||||
songCurrentTime = getSeconds(splitTime[0])
|
||||
songEndTime = getSeconds(splitTime[1])
|
||||
|
||||
//* Get all authors
|
||||
$(".byline.ytmusic-player-bar").contents().each(function (index, item) {
|
||||
if (item.classList != undefined) {
|
||||
if (item.classList.contains("yt-simple-endpoint") == true) {
|
||||
songAuthors.push(item.innerHTML)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
//* If no authors found in previous method use this
|
||||
if (songAuthors.length == 0 || songAuthors.length == 1) {
|
||||
//* Clear old list
|
||||
songAuthors = []
|
||||
songAuthors.push($(".byline.ytmusic-player-bar").contents().first().text())
|
||||
}
|
||||
|
||||
var startTime = Date.now();
|
||||
var endTime =
|
||||
Math.floor(startTime / 1000) -
|
||||
songCurrentTime +
|
||||
songEndTime;
|
||||
|
||||
if (playbackChange != false) {
|
||||
playbackNew = playbackChange
|
||||
eventType = 'playBackChange'
|
||||
} else {
|
||||
playbackNew = playback ? "playing" : "paused"
|
||||
eventType = 'updateData'
|
||||
}
|
||||
|
||||
var data = {
|
||||
ytm: {
|
||||
songTitle: $(".title.style-scope.ytmusic-player-bar").html(),
|
||||
songAuthors: songAuthors,
|
||||
songCurrentTimeSeconds: songCurrentTime,
|
||||
songCurrentTime: startTime,
|
||||
songEndTimeSeconds: songEndTime,
|
||||
songEndTime: endTime,
|
||||
songCover: $(".image.style-scope.ytmusic-player-bar").attr("src"),
|
||||
playback: playbackNew
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var data = {
|
||||
status: "keepAlive"
|
||||
}
|
||||
eventType = 'updateData'
|
||||
}
|
||||
|
||||
if(socket.connected) socket.emit(eventType, data)
|
||||
}
|
||||
|
||||
//* Used to extract seconds from Syntax
|
||||
//* 1:39 => 99
|
||||
function getSeconds(string) {
|
||||
const s = string.split(":")
|
||||
|
||||
const seconds = +s[0] * 60 + +s[1]
|
||||
return seconds
|
||||
}
|
||||
155
README.md
@@ -1,34 +1,43 @@
|
||||
##  [](https://discord.gg/Kw7WaYn)
|
||||
##  [](https://discord.gg/Kw7WaYn)
|
||||
|
||||
# <img src="icon.png" width="20" draggable="false"><b> </b>YouTube Presence · Watcha watching there? 👀
|
||||
# <img src="gitassets/premid.webp" width="24px" draggable="false"><b> </b>PreMiD · Discord Rich Presence for your Media!
|
||||
|
||||
_YT Presence Features like **Discord Rich Presence** integration, **Media controls** to **YouTube**/**YouTube Music**, **Twitch**, **SoundCloud**, **Netflix**._
|
||||
<a target="_blank" href="https://discord.gg/Kw7WaYn" title="Join our Discord!">
|
||||
<img src="gitassets/discord.svg" height="50px" draggable="false" alt="Join my Discord!">
|
||||
</a>
|
||||
<a target="_blank" href="https://www.patreon.com/bePatron?u=4610890" data-patreon-widget-type="become-patron-button"><img src="gitassets/patreonBTN.png" draggable="false" height="50px" alt="Support me on Patreon!"></a>
|
||||
<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US"><img src="gitassets/PayPal.svg" height="50px" draggable="false" alt="PayPal"></a>
|
||||
|
||||
<a href="https://discord.gg/Kw7WaYn" title="Join our Discord!">
|
||||
<img src="discord-logo.svg" width="200px" draggable="false">
|
||||
</a>
|
||||
# About
|
||||
|
||||
## Summary
|
||||
|
||||
**PreMiD** is a simple, configurable utility that allows you to show what you're watching/listening in your Discord **now playing status**. It supports [many different platforms](#support), and will support multiple users watching the same content simultaneously in an upcoming update.
|
||||
|
||||
## Features
|
||||
|
||||
- Integrates with Discord's official Rich Presence API library.
|
||||
- Supports your keyboard's **Media Control** function keys.
|
||||
- Automatically clears your current presence after 1 minute of inactivity.
|
||||
- Supports **YouTube, YouTube Music, Netflix, SoundCloud, JKAnime, KissAnime** and many more to come.
|
||||
- _Watch parties and more are coming soon!_
|
||||
|
||||
# Table of contents
|
||||
|
||||
- [Features](#features)
|
||||
- [About](#about)
|
||||
- [Summary](#summary)
|
||||
- [Features](#features)
|
||||
- [Support](#support)
|
||||
- [Operating Systems](#operating-systems)
|
||||
- [Browsers](#browsers)
|
||||
- [Services](#services)
|
||||
- [Installation](#installation)
|
||||
- [Installing the Extension](#installing-the-extension)
|
||||
- [Extension](#extension)
|
||||
- Chrome
|
||||
- Opera
|
||||
- [Installing the Application](#installing-the-application)
|
||||
- [Application](#application)
|
||||
- Mac OS
|
||||
- Windows
|
||||
- [FAQ](#faq-·-frequently-asked-questions)
|
||||
- Is this project up to date?
|
||||
- Will this project stay free?
|
||||
|
||||
# Features
|
||||
|
||||
- Discord Rich Presence Integration
|
||||
- Media control keys
|
||||
- Automatically clears Presence after 1 minute of inactivity
|
||||
- _More soon_
|
||||
|
||||
# Support
|
||||
|
||||
@@ -42,32 +51,43 @@ _YT Presence Features like **Discord Rich Presence** integration, **Media contro
|
||||
- Chrome
|
||||
- Opera
|
||||
|
||||
### **Services**
|
||||
|
||||
- YouTube
|
||||
- YouTube Music
|
||||
- Netflix
|
||||
- SoundCloud
|
||||
- Twitch
|
||||
- JKAnime
|
||||
- KissAnime
|
||||
|
||||
One missing? Open an [Issue](https://github.com/Timeraa/PreMiD/issues/new?template=feature_request.md)!
|
||||
|
||||
# Installation
|
||||
|
||||
## Extension
|
||||
|
||||
<details>
|
||||
<summary><b><u>Installing the Chrome extension</u></b> (Click to expand)</summary>
|
||||
<h1>Chrome extension installation</h1>
|
||||
<h1>Chrome Extension Installation</h1>
|
||||
<ol>
|
||||
<li>Click <a href="https://chrome.google.com/webstore/detail/yt-presence/agjnjboanicjcpenljmaaigopkgdnihi">this</a> link</li>
|
||||
</li>
|
||||
<li>Click "add to Chrome"</li>
|
||||
<li>Install the <a href="#installing-the-application">application</a></li>
|
||||
<li>Install the <a href="#application">application</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
<details>
|
||||
<summary><b><u>Installing the Opera extension</u></b> (Click to expand)</summary>
|
||||
<h1>Opera extension installation</h1>
|
||||
<h1>Opera Extension Installation</h1>
|
||||
<ol>
|
||||
<li>Download the latest version of the <a href="https://github.com/Timeraa/YT-Presence/releases/latest">extension</a>
|
||||
</li>
|
||||
<li>Extract the downloaded <b>.zip</b> file</li>
|
||||
<li>Open Opera</li>
|
||||
<li>Go to <a href="chrome://extensions/">chrome://extensions/</a></li>
|
||||
<li>Drag and drop the extension's folder on the page<br>
|
||||
<li>Load the extracted <b>Extension</b> folder</li>
|
||||
<li>Install the <a href="#installing-the-application">application</a></li>
|
||||
<li>Drag and drop the Folder <b>"Extension"</b> on the page<br>
|
||||
<li>Install the <a href="#application">application</a></li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
@@ -80,10 +100,11 @@ _YT Presence Features like **Discord Rich Presence** integration, **Media contro
|
||||
<li>Download the latest version of the <a href="https://github.com/Timeraa/YT-Presence/releases/latest">application</a>
|
||||
</li>
|
||||
<li>Open the downloaded <b>.dmg</b> file</li>
|
||||
<li>Drag <b>YT Presence</b> Into your <b>Applications</b> Folder</li>
|
||||
<li>Open your Launchpad</li>
|
||||
<li>Open <b>YT Presence</b></li>
|
||||
<li>Install Extension if not already</li>
|
||||
<li>Drag <b>PreMiD</b> Into your <b>Applications</b> Folder</li>
|
||||
<li>Open your Launchpad or press F4</li>
|
||||
<li>Open <b>PreMiD</b></li>
|
||||
<li>Press <b>"Allow"</b> if a window pops up</li>
|
||||
<li>Install <a href="#extension">extension</a> if not already</li>
|
||||
</ol>
|
||||
</details>
|
||||
|
||||
@@ -93,23 +114,69 @@ _YT Presence Features like **Discord Rich Presence** integration, **Media contro
|
||||
<ol>
|
||||
<li>Download the latest installer from <a href="https://github.com/Timeraa/YT-Presence/releases/">here</a></li>
|
||||
<li>Open the downloaded <b>.exe</b> installer</li>
|
||||
<li>If SmartScreen comes up press more informations then press run anyways. (Its not a virus, i promise)</li>
|
||||
<li>YouTube Presence should install itself and start automatically (You can tell by looking at the taskbar)</li>
|
||||
<li>Install Extension if not already</li>
|
||||
<li>If SmartScreen comes up press more informations then press run anyways. (It's not a virus, I promise.)</li>
|
||||
<li>YouTube Presence should install itself and start automatically. (You can tell by looking at the taskbar.)</li>
|
||||
<li>Install the <a href="#extension">extension</a>, if you haven't already.</li>
|
||||
</ol>
|
||||
</details>
|
||||
<br>
|
||||
|
||||
# FAQ · Frequently Asked Questions
|
||||
|
||||
> ## Is this project still up to date?<br>
|
||||
|
||||
- Yes! I use and work on this program and extension almost everyday!<br>There are currently no plans on discontinuing this Project.
|
||||
|
||||
> ## Will this project stay free?<br>
|
||||
|
||||
- Of course! Its open source! But i would highly appreciate a little bit of Money it helps me for my Future, like a **Driving license**. <br><br><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US">Donate here</a>
|
||||
|
||||
---
|
||||
|
||||
### YT Presence V1.1 · By Timeraa
|
||||
<h1 style="text-align: center;">Creator</h1>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/timeraa.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Timeraa</h2>
|
||||
</div>
|
||||
|
||||
<h1 style="text-align: center;">Admin & Translation Manager</h1>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/fruxh.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Fruxh</h2>
|
||||
</div>
|
||||
|
||||
<h1 style="text-align: center;">Patrons \ Donators</h1>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/fruxh.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Fruxh</h2>
|
||||
<h3 style="text-align: center; font-weight: 700;margin: 0;">Patron</h3>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/UMU.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">UMU</h2>
|
||||
<h3 style="text-align: center; font-weight: 700;margin: 0;">Patron</h3>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/paz.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Paz</h2>
|
||||
<h3 style="text-align: center; font-weight: 700;margin: 0;">Paypal</h3>
|
||||
</div>
|
||||
|
||||
<h1 style="text-align: center;">Translators</h1>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/timeraa.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Timeraa</h2>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/fruxh.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Fruxh</h2>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/restrike.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Restrike</h2>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/xiRDX.gif" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">2dward.</h2>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/ufo.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">Ufo</h2>
|
||||
</div>
|
||||
<div style="margin: 5px; width: 100px; display: inline-block;">
|
||||
<img draggable="false" src="gitassets/VerifyBot.png" style="border-radius: 50%;" width="100px">
|
||||
<h2 style="text-align: center; font-weight: 700; margin: 0;">VerifyBot</h2>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
### PreMiD - Discord Rich Presence for your Media!
|
||||
|
||||
BIN
appIcon.icns
BIN
appIcon.ico
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 21 KiB |
@@ -1,11 +0,0 @@
|
||||
var electronInstaller = require('electron-winstaller');
|
||||
|
||||
resultPromise = electronInstaller.createWindowsInstaller({
|
||||
appDirectory: './out/YT Presence-win32-x64',
|
||||
outputDirectory: './dist/windows/',
|
||||
exe: './YT Presence.exe',
|
||||
iconUrl: 'https://raw.githubusercontent.com/Timeraa/YT-Presence/master/appIcon.ico',
|
||||
noMsi: true
|
||||
});
|
||||
|
||||
resultPromise.then(() => console.log("It worked!"), (e) => console.log(`No dice: ${e.message}`));
|
||||
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
dmg-background.png
Normal file
|
After Width: | Height: | Size: 79 KiB |
55
gitassets/PayPal.svg
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="124px" height="33px" viewBox="0 0 124 33" enable-background="new 0 0 124 33" xml:space="preserve">
|
||||
<path fill="#253B80" d="M46.211,6.749h-6.839c-0.468,0-0.866,0.34-0.939,0.802l-2.766,17.537c-0.055,0.346,0.213,0.658,0.564,0.658
|
||||
h3.265c0.468,0,0.866-0.34,0.939-0.803l0.746-4.73c0.072-0.463,0.471-0.803,0.938-0.803h2.165c4.505,0,7.105-2.18,7.784-6.5
|
||||
c0.306-1.89,0.013-3.375-0.872-4.415C50.224,7.353,48.5,6.749,46.211,6.749z M47,13.154c-0.374,2.454-2.249,2.454-4.062,2.454
|
||||
h-1.032l0.724-4.583c0.043-0.277,0.283-0.481,0.563-0.481h0.473c1.235,0,2.4,0,3.002,0.704C47.027,11.668,47.137,12.292,47,13.154z"
|
||||
/>
|
||||
<path fill="#253B80" d="M66.654,13.075h-3.275c-0.279,0-0.52,0.204-0.563,0.481l-0.145,0.916l-0.229-0.332
|
||||
c-0.709-1.029-2.29-1.373-3.868-1.373c-3.619,0-6.71,2.741-7.312,6.586c-0.313,1.918,0.132,3.752,1.22,5.031
|
||||
c0.998,1.176,2.426,1.666,4.125,1.666c2.916,0,4.533-1.875,4.533-1.875l-0.146,0.91c-0.055,0.348,0.213,0.66,0.562,0.66h2.95
|
||||
c0.469,0,0.865-0.34,0.939-0.803l1.77-11.209C67.271,13.388,67.004,13.075,66.654,13.075z M62.089,19.449
|
||||
c-0.316,1.871-1.801,3.127-3.695,3.127c-0.951,0-1.711-0.305-2.199-0.883c-0.484-0.574-0.668-1.391-0.514-2.301
|
||||
c0.295-1.855,1.805-3.152,3.67-3.152c0.93,0,1.686,0.309,2.184,0.892C62.034,17.721,62.232,18.543,62.089,19.449z"/>
|
||||
<path fill="#253B80" d="M84.096,13.075h-3.291c-0.314,0-0.609,0.156-0.787,0.417l-4.539,6.686l-1.924-6.425
|
||||
c-0.121-0.402-0.492-0.678-0.912-0.678h-3.234c-0.393,0-0.666,0.384-0.541,0.754l3.625,10.638l-3.408,4.811
|
||||
c-0.268,0.379,0.002,0.9,0.465,0.9h3.287c0.312,0,0.604-0.152,0.781-0.408L84.564,13.97C84.826,13.592,84.557,13.075,84.096,13.075z
|
||||
"/>
|
||||
<path fill="#179BD7" d="M94.992,6.749h-6.84c-0.467,0-0.865,0.34-0.938,0.802l-2.766,17.537c-0.055,0.346,0.213,0.658,0.562,0.658
|
||||
h3.51c0.326,0,0.605-0.238,0.656-0.562l0.785-4.971c0.072-0.463,0.471-0.803,0.938-0.803h2.164c4.506,0,7.105-2.18,7.785-6.5
|
||||
c0.307-1.89,0.012-3.375-0.873-4.415C99.004,7.353,97.281,6.749,94.992,6.749z M95.781,13.154c-0.373,2.454-2.248,2.454-4.062,2.454
|
||||
h-1.031l0.725-4.583c0.043-0.277,0.281-0.481,0.562-0.481h0.473c1.234,0,2.4,0,3.002,0.704
|
||||
C95.809,11.668,95.918,12.292,95.781,13.154z"/>
|
||||
<path fill="#179BD7" d="M115.434,13.075h-3.273c-0.281,0-0.52,0.204-0.562,0.481l-0.145,0.916l-0.23-0.332
|
||||
c-0.709-1.029-2.289-1.373-3.867-1.373c-3.619,0-6.709,2.741-7.311,6.586c-0.312,1.918,0.131,3.752,1.219,5.031
|
||||
c1,1.176,2.426,1.666,4.125,1.666c2.916,0,4.533-1.875,4.533-1.875l-0.146,0.91c-0.055,0.348,0.213,0.66,0.564,0.66h2.949
|
||||
c0.467,0,0.865-0.34,0.938-0.803l1.771-11.209C116.053,13.388,115.785,13.075,115.434,13.075z M110.869,19.449
|
||||
c-0.314,1.871-1.801,3.127-3.695,3.127c-0.949,0-1.711-0.305-2.199-0.883c-0.484-0.574-0.666-1.391-0.514-2.301
|
||||
c0.297-1.855,1.805-3.152,3.67-3.152c0.93,0,1.686,0.309,2.184,0.892C110.816,17.721,111.014,18.543,110.869,19.449z"/>
|
||||
<path fill="#179BD7" d="M119.295,7.23l-2.807,17.858c-0.055,0.346,0.213,0.658,0.562,0.658h2.822c0.469,0,0.867-0.34,0.939-0.803
|
||||
l2.768-17.536c0.055-0.346-0.213-0.659-0.562-0.659h-3.16C119.578,6.749,119.338,6.953,119.295,7.23z"/>
|
||||
<path fill="#253B80" d="M7.266,29.154l0.523-3.322l-1.165-0.027H1.061L4.927,1.292C4.939,1.218,4.978,1.149,5.035,1.1
|
||||
c0.057-0.049,0.13-0.076,0.206-0.076h9.38c3.114,0,5.263,0.648,6.385,1.927c0.526,0.6,0.861,1.227,1.023,1.917
|
||||
c0.17,0.724,0.173,1.589,0.007,2.644l-0.012,0.077v0.676l0.526,0.298c0.443,0.235,0.795,0.504,1.065,0.812
|
||||
c0.45,0.513,0.741,1.165,0.864,1.938c0.127,0.795,0.085,1.741-0.123,2.812c-0.24,1.232-0.628,2.305-1.152,3.183
|
||||
c-0.482,0.809-1.096,1.48-1.825,2c-0.696,0.494-1.523,0.869-2.458,1.109c-0.906,0.236-1.939,0.355-3.072,0.355h-0.73
|
||||
c-0.522,0-1.029,0.188-1.427,0.525c-0.399,0.344-0.663,0.814-0.744,1.328l-0.055,0.299l-0.924,5.855l-0.042,0.215
|
||||
c-0.011,0.068-0.03,0.102-0.058,0.125c-0.025,0.021-0.061,0.035-0.096,0.035H7.266z"/>
|
||||
<path fill="#179BD7" d="M23.048,7.667L23.048,7.667L23.048,7.667c-0.028,0.179-0.06,0.362-0.096,0.55
|
||||
c-1.237,6.351-5.469,8.545-10.874,8.545H9.326c-0.661,0-1.218,0.48-1.321,1.132l0,0l0,0L6.596,26.83l-0.399,2.533
|
||||
c-0.067,0.428,0.263,0.814,0.695,0.814h4.881c0.578,0,1.069-0.42,1.16-0.99l0.048-0.248l0.919-5.832l0.059-0.32
|
||||
c0.09-0.572,0.582-0.992,1.16-0.992h0.73c4.729,0,8.431-1.92,9.513-7.476c0.452-2.321,0.218-4.259-0.978-5.622
|
||||
C24.022,8.286,23.573,7.945,23.048,7.667z"/>
|
||||
<path fill="#222D65" d="M21.754,7.151c-0.189-0.055-0.384-0.105-0.584-0.15c-0.201-0.044-0.407-0.083-0.619-0.117
|
||||
c-0.742-0.12-1.555-0.177-2.426-0.177h-7.352c-0.181,0-0.353,0.041-0.507,0.115C9.927,6.985,9.675,7.306,9.614,7.699L8.05,17.605
|
||||
l-0.045,0.289c0.103-0.652,0.66-1.132,1.321-1.132h2.752c5.405,0,9.637-2.195,10.874-8.545c0.037-0.188,0.068-0.371,0.096-0.55
|
||||
c-0.313-0.166-0.652-0.308-1.017-0.429C21.941,7.208,21.848,7.179,21.754,7.151z"/>
|
||||
<path fill="#253B80" d="M9.614,7.699c0.061-0.393,0.313-0.714,0.652-0.876c0.155-0.074,0.326-0.115,0.507-0.115h7.352
|
||||
c0.871,0,1.684,0.057,2.426,0.177c0.212,0.034,0.418,0.073,0.619,0.117c0.2,0.045,0.395,0.095,0.584,0.15
|
||||
c0.094,0.028,0.187,0.057,0.278,0.086c0.365,0.121,0.704,0.264,1.017,0.429c0.368-2.347-0.003-3.945-1.272-5.392
|
||||
C20.378,0.682,17.853,0,14.622,0h-9.38c-0.66,0-1.223,0.48-1.325,1.133L0.01,25.898c-0.077,0.49,0.301,0.932,0.795,0.932h5.791
|
||||
l1.454-9.225L9.614,7.699z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
BIN
gitassets/UMU.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
gitassets/VerifyBot.png
Executable file
|
After Width: | Height: | Size: 129 KiB |
1
gitassets/discord.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 272.1"><style>.st0{fill:#7289DA;}</style><path class="st0" d="M142.8 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11s-4.6-11-10.2-11zM106.3 120.1c-5.7 0-10.2 4.9-10.2 11s4.6 11 10.2 11c5.7 0 10.2-4.9 10.2-11 .1-6.1-4.5-11-10.2-11z"/><path class="st0" d="M191.4 36.9h-134c-11.3 0-20.5 9.2-20.5 20.5v134c0 11.3 9.2 20.5 20.5 20.5h113.4l-5.3-18.3 12.8 11.8 12.1 11.1 21.6 18.7V57.4c-.1-11.3-9.3-20.5-20.6-20.5zm-38.6 129.5s-3.6-4.3-6.6-8c13.1-3.7 18.1-11.8 18.1-11.8-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.4-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.6-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.2-1.8-1-2.8-1.7-2.8-1.7s4.8 7.9 17.5 11.7c-3 3.8-6.7 8.2-6.7 8.2-22.1-.7-30.5-15.1-30.5-15.1 0-31.9 14.4-57.8 14.4-57.8 14.4-10.7 28-10.4 28-10.4l1 1.2c-18 5.1-26.2 13-26.2 13s2.2-1.2 5.9-2.8c10.7-4.7 19.2-5.9 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.5 0 0-7.9-7.5-24.9-12.6l1.4-1.6s13.7-.3 28 10.4c0 0 14.4 25.9 14.4 57.8 0-.1-8.4 14.3-30.5 15zM303.8 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1h33.2c17.8.1 34.5-8.8 34.5-29.2v-29.8c.1-20.8-16.6-29.9-34.4-29.9zm174 59.7v-30.6c0-11 19.8-13.5 25.8-2.5l18.3-7.4c-7.2-15.8-20.3-20.4-31.2-20.4-17.8 0-35.4 10.3-35.4 30.3v30.6c0 20.2 17.6 30.3 35 30.3 11.2 0 24.6-5.5 32-19.9l-19.6-9c-4.8 12.3-24.9 9.3-24.9-1.4zM417.3 113c-6.9-1.5-11.5-4-11.8-8.3.4-10.3 16.3-10.7 25.6-.8l14.7-11.3c-9.2-11.2-19.6-14.2-30.3-14.2-16.3 0-32.1 9.2-32.1 26.6 0 16.9 13 26 27.3 28.2 7.3 1 15.4 3.9 15.2 8.9-.6 9.5-20.2 9-29.1-1.8l-14.2 13.3c8.3 10.7 19.6 16.1 30.2 16.1 16.3 0 34.4-9.4 35.1-26.6 1-21.7-14.8-27.2-30.6-30.1zm-67 55.5h22.4V79.7h-22.4v88.8zM728 79.7h-33.2V117l22.1 19.9v-36.2h11.8c7.5 0 11.2 3.6 11.2 9.4v27.7c0 5.8-3.5 9.7-11.2 9.7h-34v21.1H728c17.8.1 34.5-8.8 34.5-29.2v-29.8c0-20.8-16.7-29.9-34.5-29.9zm-162.9-1.2c-18.4 0-36.7 10-36.7 30.5v30.3c0 20.3 18.4 30.5 36.9 30.5 18.4 0 36.7-10.2 36.7-30.5V109c0-20.4-18.5-30.5-36.9-30.5zm14.4 60.8c0 6.4-7.2 9.7-14.3 9.7-7.2 0-14.4-3.1-14.4-9.7V109c0-6.5 7-10 14-10 7.3 0 14.7 3.1 14.7 10v30.3zM682.4 109c-.5-20.8-14.7-29.2-33-29.2h-35.5v88.8h22.7v-28.2h4l20.6 28.2h28L665 138.1c10.7-3.4 17.4-12.7 17.4-29.1zm-32.6 12h-13.2v-20.3h13.2c14.1 0 14.1 20.3 0 20.3z"/></svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
BIN
gitassets/fruxh.png
Executable file
|
After Width: | Height: | Size: 149 KiB |
BIN
gitassets/patreonBTN.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
gitassets/paz.png
Executable file
|
After Width: | Height: | Size: 540 KiB |
BIN
gitassets/premid.webp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
BIN
gitassets/restrike.png
Executable file
|
After Width: | Height: | Size: 500 KiB |
BIN
gitassets/timeraa.png
Executable file
|
After Width: | Height: | Size: 31 KiB |
BIN
gitassets/ufo.png
Executable file
|
After Width: | Height: | Size: 178 KiB |
BIN
gitassets/xiRDX.gif
Executable file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
icon.png
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 18 KiB |
39
installer.js
Normal file
@@ -0,0 +1,39 @@
|
||||
var os = require('os')
|
||||
var os = os.platform()
|
||||
|
||||
var path = require('path')
|
||||
var chalk = require('chalk')
|
||||
|
||||
if(os == 'darwin') {
|
||||
console.log(chalk.yellow("Creating installer for Mac OS..."))
|
||||
var createDMG = require('electron-installer-dmg')
|
||||
|
||||
createDMG({
|
||||
appPath: "./out/PreMiD-darwin-x64/PreMiD.app",
|
||||
name: "PreMiD",
|
||||
background: "./dmg-background.png",
|
||||
icon: "./appIcon.icns",
|
||||
contents: [
|
||||
{ x: 500, y: 250, type: 'link', path: '/Applications'},
|
||||
{ x: 175, y: 250, type: 'file', path: path.join(__dirname, './out/PreMiD-darwin-x64/PreMiD.app')}
|
||||
],
|
||||
out: "./dist/installer/",
|
||||
overwrite: true
|
||||
}, function done(err) {
|
||||
if(err) console.error(err);
|
||||
else console.log(chalk.green("Created installer for Mac OS!"))
|
||||
})
|
||||
} else if(os == "win32") {
|
||||
console.log(chalk.yellow("Creating installer for Windows..."))
|
||||
var electronInstaller = require('electron-winstaller');
|
||||
|
||||
resultPromise = electronInstaller.createWindowsInstaller({
|
||||
appDirectory: './out/PreMiD-win32-x64',
|
||||
outputDirectory: './dist/installer/',
|
||||
exe: './PreMiD.exe',
|
||||
iconUrl: 'https://raw.githubusercontent.com/Timeraa/PreMiD/master/appIcon.ico',
|
||||
noMsi: true
|
||||
});
|
||||
|
||||
resultPromise.then(() => console.log(chalk.green("Created installer for Windows!")), (e) => console.log(`No dice: ${e.message}`));
|
||||
}
|
||||
|
Before Width: | Height: | Size: 16 KiB |
62
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"version": "1.0.0",
|
||||
"name": "premid",
|
||||
"version": "1.2.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -57,6 +57,26 @@
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"appdmg": {
|
||||
"version": "0.4.5",
|
||||
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.4.5.tgz",
|
||||
@@ -297,6 +317,17 @@
|
||||
"traverse": ">=0.3.0 <0.4"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
|
||||
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"chromium-pickle-js": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz",
|
||||
@@ -366,6 +397,12 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
|
||||
@@ -873,6 +910,12 @@
|
||||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
||||
"dev": true
|
||||
},
|
||||
"execa": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-0.4.0.tgz",
|
||||
@@ -1315,6 +1358,12 @@
|
||||
"har-schema": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
||||
"dev": true
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
||||
@@ -2571,6 +2620,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"temp": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
|
||||
|
||||
15
package.json
@@ -1,21 +1,22 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"productName": "YT Presence",
|
||||
"version": "1.0.0",
|
||||
"description": "YT Presence adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"name": "premid",
|
||||
"productName": "PreMiD",
|
||||
"version": "1.2.0",
|
||||
"description": "PreMiD adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"main": "index.js",
|
||||
"repository": "Timeraa/YT-Presence",
|
||||
"repository": "Timeraa/PreMiD",
|
||||
"scripts": {
|
||||
"start": "electron src/.",
|
||||
"pkgmac": "electron-packager ./src/ --out=./out/ --asar --overwrite --icon=./appIcon.ico --osx-sign.identity='Florian Metz'",
|
||||
"pkgwin": "electron-packager ./src/ --out=./out/ --overwrite --icon=./appIcon.ico",
|
||||
"installer-mac": "npm run pkgmac && electron-installer-dmg ./out/YT\\ Presence-darwin-x64/YT\\ Presence.app YT\\ Presence\\ Installer --overwrite --icon=./appIcon.icns --out=./dist",
|
||||
"installer-win": "npm run pkgwin && node createInstaller"
|
||||
"installer-mac": "npm run pkgmac && node installer",
|
||||
"installer-win": "npm run pkgwin && node installer"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Timeraa",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"chalk": "^2.4.1",
|
||||
"electron-installer-dmg": "^1.0.0",
|
||||
"electron-installer-windows": "^1.1.0",
|
||||
"electron-packager": "^12.2.0",
|
||||
|
||||
|
Before Width: | Height: | Size: 379 B After Width: | Height: | Size: 885 B |
|
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 18 KiB |
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"yt_client_id": "463097721130188830",
|
||||
"ytm_client_id": "463151177836658699",
|
||||
"nflix_client_id": "499981204045430784",
|
||||
"twitch_client_id": "501021996336021504",
|
||||
"scloud_client_id": "501021185887436810",
|
||||
"version": "1.1",
|
||||
"devBuild": false
|
||||
}
|
||||
93
src/index.js
@@ -5,56 +5,38 @@ require('./util/handleWinstall')
|
||||
//* Declare needed constants
|
||||
const {app} = require('electron')
|
||||
|
||||
const AutoLaunch = require('auto-launch')
|
||||
//* Require config
|
||||
const config = require('./config.json');
|
||||
const constants = require('./util/constants')
|
||||
var pjson = require('./package.json');
|
||||
//* Require electron-config
|
||||
const os = require('os')
|
||||
//* Update constant in file
|
||||
constants.platform = os.platform()
|
||||
//* Require Update checker
|
||||
const updater = require('./util/updateChecker')
|
||||
//* Require Needed packages
|
||||
const chalk = require("chalk")
|
||||
//* Setup electron-config
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//* Required for Windows Push notifications
|
||||
app.setAppUserModelId("eu.Timeraa.yt_presence")
|
||||
//* Set app user model id
|
||||
app.setAppUserModelId("eu.Timeraa.premid")
|
||||
|
||||
//* Define Global Variables
|
||||
global.PLATFORM = os.platform()
|
||||
global.UPDATEAVAIABLE = ""
|
||||
global.VERSION = config.version
|
||||
if(config.devBuild) {
|
||||
global.VERSIONSTRING = VERSION + "-DEV"
|
||||
} else {
|
||||
global.VERSIONSTRING = VERSION
|
||||
}
|
||||
global.VERSION = pjson.productVersion
|
||||
|
||||
if(pjson.devBuild)
|
||||
global.VERSIONSTRING = VERSION + "-DEV";
|
||||
else
|
||||
global.VERSIONSTRING = VERSION;
|
||||
|
||||
global.BROWSERCONNECTIONSTATE = "NOT_CONNECTED"
|
||||
global.EXTENSIONSOCKET = null
|
||||
|
||||
//* YTM global vars
|
||||
global.CURRENTSONGTITLE = ""
|
||||
global.CURRENTSONGAUTHORS = []
|
||||
global.CURRENTSONGAUTHORSSTRING = ""
|
||||
global.CURRENTSONGSTARTTIME = ""
|
||||
global.CURRENTSONGSTARTTIMESECONDS = ""
|
||||
global.CURRENTSONGENDTIME = ""
|
||||
global.CONSOLEPREFIX = chalk.bold(chalk.bgHex('#db0918')(chalk.hex('#000000')(" Y") + chalk.hex('#ffffff')("T "))) + chalk.cyan(" Presence") + chalk.hex('#ffffff')(": ")
|
||||
global.YTRPCREADY = false
|
||||
global.YTMRPCREADY = false
|
||||
global.NFLIXRPCREADY = false
|
||||
global.TWITCHRPCREADY = false
|
||||
global.SCLOUDRPCREADY = false
|
||||
|
||||
global.YTRPC = null
|
||||
global.YTMRPC = null
|
||||
global.NFLIXRPC = null
|
||||
global.TWITCHRPC = null
|
||||
global.SCLOUDRPC = null
|
||||
global.TRAY = null
|
||||
global.CONSOLEPREFIX = chalk.bold(chalk.hex('#596cae')("PreMiD")) + chalk.hex('#ffffff')(": ")
|
||||
|
||||
|
||||
//* Clear console
|
||||
@@ -69,66 +51,37 @@ if(iShouldQuit){
|
||||
return;
|
||||
}
|
||||
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
//* Set default values for electon-config userSettings
|
||||
if(userSettings.get('enabled') == undefined) userSettings.set('enabled', true)
|
||||
if(userSettings.get('youTube') == undefined) userSettings.set('youTube', true)
|
||||
if(userSettings.get('youTubeMusic') == undefined) userSettings.set('youTubeMusic', true)
|
||||
if(userSettings.get('netflix') == undefined) userSettings.set('netflix', true)
|
||||
if(userSettings.get('twitch') == undefined) userSettings.set('twitch', true)
|
||||
if(userSettings.get('soundcloud') == undefined) userSettings.set('soundcloud', true)
|
||||
if(userSettings.get('titleMenubar') == undefined) userSettings.set('titleMenubar', true)
|
||||
if(userSettings.get('autoStart') == undefined) userSettings.set('autoStart', true)
|
||||
if(userSettings.get('autoUpdateCheck') == undefined) userSettings.set('autoUpdateCheck', true)
|
||||
if(userSettings.get('mediaControls') == undefined) userSettings.set('mediaControls', true)
|
||||
|
||||
|
||||
//* Set dock Badge to version
|
||||
if(constants.platform == "darwin") {
|
||||
if(PLATFORM == "darwin") {
|
||||
app.dock.setBadge("V" + VERSION)
|
||||
}
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Loading..."))
|
||||
|
||||
//* App ready
|
||||
const appReady = () => {
|
||||
const appReady = async () => {
|
||||
//* Setup MenuBar
|
||||
require('./tray/createTray').run()
|
||||
//* Require shortcuts
|
||||
require('./util/shortcutHandler')
|
||||
require('./util/shortcutHandler').register()
|
||||
//* Include PresenceHandler
|
||||
require('./presenceHandler.js')
|
||||
//* Auto launch
|
||||
require('./util/autoLaunch')
|
||||
|
||||
//* Automatically check for update
|
||||
if(userSettings.get('autoUpdateCheck') == true)
|
||||
updater.checkForUpdate(true)
|
||||
|
||||
//* hide Dock icon when everything running
|
||||
if(constants.platform == "darwin") {
|
||||
app.dock.hide()
|
||||
}
|
||||
|
||||
if(userSettings.get('autoLaunch') == undefined || userSettings.get('autoLaunch') == true) {
|
||||
userSettings.set('autoLaunch', true)
|
||||
//* Add App to AutoLaunch
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Adding App to autostart..."))
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'YT Presence',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
//* Enable AutoLaunch if disabled
|
||||
autoLaunch.isEnabled().then(async (isEnabled) => {
|
||||
if (!isEnabled) autoLaunch.enable();
|
||||
console.log(CONSOLEPREFIX + chalk.green("Added App to autostart."))
|
||||
})
|
||||
//* Catch error
|
||||
.catch(function(err) {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Error while adding App to autostart."))
|
||||
})
|
||||
}
|
||||
if(PLATFORM == "darwin") app.dock.hide()
|
||||
}
|
||||
|
||||
//* Register Handler
|
||||
|
||||
388
src/package-lock.json
generated
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"version": "1.0.0",
|
||||
"name": "premid",
|
||||
"version": "1.2.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.2.tgz",
|
||||
"integrity": "sha512-x5HFsW+E/nQalGMw7hu+fvPqnBeBaIr0lWJ2SG0PPL2j+Pm9lYvCrsZJGIgauPIENx0v10INIyFjmSNUD/gSqQ==",
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.3.tgz",
|
||||
"integrity": "sha512-gqmspPZOMW3MIRb9HlrnbZHXI1/KHTOroBwN1NcLL6pWxzqzEKGvRTq0W/PxS45OtQGbaFikSQpkS5zbnsQm2w==",
|
||||
"dev": true
|
||||
},
|
||||
"@paulcbetts/mime-db": {
|
||||
@@ -72,9 +72,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "8.10.34",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.34.tgz",
|
||||
"integrity": "sha512-alypNiaAEd0RBGXoWehJ2gchPYCITmw4CYBoB5nDlji8l8on7FsklfdfIs4DDmgpKLSX3OF3ha6SV+0W7cTzUA==",
|
||||
"version": "8.10.37",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.37.tgz",
|
||||
"integrity": "sha512-Jp39foY8Euv/PG4OGPyzxis82mnjcUtXLEMA8oFMCE4ilmuJgZPdV2nZNV1moz+99EJTtcpOSgDCgATUwABKig==",
|
||||
"dev": true
|
||||
},
|
||||
"abab": {
|
||||
@@ -251,11 +251,11 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browserslist": "1.7.7",
|
||||
"caniuse-db": "1.0.30000889",
|
||||
"caniuse-db": "1.0.30000903",
|
||||
"normalize-range": "0.1.2",
|
||||
"num2fraction": "1.2.2",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"aws-sign2": {
|
||||
@@ -925,7 +925,7 @@
|
||||
"babel-plugin-transform-regenerator": "6.26.0",
|
||||
"browserslist": "3.2.8",
|
||||
"invariant": "2.2.4",
|
||||
"semver": "5.5.1"
|
||||
"semver": "5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"browserslist": {
|
||||
@@ -934,8 +934,8 @@
|
||||
"integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-lite": "1.0.30000889",
|
||||
"electron-to-chromium": "1.3.75"
|
||||
"caniuse-lite": "1.0.30000903",
|
||||
"electron-to-chromium": "1.3.83"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1093,23 +1093,23 @@
|
||||
},
|
||||
"blob": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz",
|
||||
"resolved": "http://registry.npmjs.org/blob/-/blob-0.0.4.tgz",
|
||||
"integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE="
|
||||
},
|
||||
"body-parser": {
|
||||
"version": "1.18.2",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
|
||||
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
|
||||
"version": "1.18.3",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
|
||||
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
|
||||
"requires": {
|
||||
"bytes": "3.0.0",
|
||||
"content-type": "1.0.4",
|
||||
"debug": "2.6.9",
|
||||
"depd": "1.1.2",
|
||||
"http-errors": "1.6.3",
|
||||
"iconv-lite": "0.4.19",
|
||||
"iconv-lite": "0.4.23",
|
||||
"on-finished": "2.3.0",
|
||||
"qs": "6.5.1",
|
||||
"raw-body": "2.3.2",
|
||||
"qs": "6.5.2",
|
||||
"raw-body": "2.3.3",
|
||||
"type-is": "1.6.16"
|
||||
}
|
||||
},
|
||||
@@ -1121,7 +1121,7 @@
|
||||
},
|
||||
"boom": {
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
|
||||
"integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -1144,8 +1144,8 @@
|
||||
"integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"caniuse-db": "1.0.30000889",
|
||||
"electron-to-chromium": "1.3.75"
|
||||
"caniuse-db": "1.0.30000903",
|
||||
"electron-to-chromium": "1.3.83"
|
||||
}
|
||||
},
|
||||
"btoa": {
|
||||
@@ -1190,7 +1190,7 @@
|
||||
},
|
||||
"camelcase-keys": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",
|
||||
"integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -1205,21 +1205,21 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"browserslist": "1.7.7",
|
||||
"caniuse-db": "1.0.30000889",
|
||||
"caniuse-db": "1.0.30000903",
|
||||
"lodash.memoize": "4.1.2",
|
||||
"lodash.uniq": "4.5.0"
|
||||
}
|
||||
},
|
||||
"caniuse-db": {
|
||||
"version": "1.0.30000889",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000889.tgz",
|
||||
"integrity": "sha512-Rf9Sbm2KS7s6Rk8iNeI5zJdquqctXBXAfy/bb1tCCYRds5RAaHNdyt2D4z8TSRToDkYsAwiSBV/bFHR+4IgTiw==",
|
||||
"version": "1.0.30000903",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000903.tgz",
|
||||
"integrity": "sha512-x3npiIhv0zDc5qAj+r4rByMETsz2XkukPFsVWzwyY5r5h63XoO8msj9D65BqeNt1aBn17fsBnDDP78yFM/OAqA==",
|
||||
"dev": true
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30000889",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000889.tgz",
|
||||
"integrity": "sha512-MFxcQ6x/LEEoaIhO7Zdb7Eg8YyNONN+WBnS5ERJ0li2yRw51+i4xXUNxnLaveTb/4ZoJqsWKEmlomhG2pYzlQA==",
|
||||
"version": "1.0.30000903",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000903.tgz",
|
||||
"integrity": "sha512-T1XVJEpGCoaq7MDw7/6hCdYUukmSaS+1l/OQJkLtw7Cr2+/+d67tNGKEbyiqf7Ck8x6EhNFUxjYFXXka0N/w5g==",
|
||||
"dev": true
|
||||
},
|
||||
"caseless": {
|
||||
@@ -1255,13 +1255,13 @@
|
||||
},
|
||||
"cheerio": {
|
||||
"version": "0.20.0",
|
||||
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/cheerio/-/cheerio-0.20.0.tgz",
|
||||
"integrity": "sha1-XHEPK6uVZTJyhCugHG6mGzVF7DU=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"css-select": "1.2.0",
|
||||
"dom-serializer": "0.1.0",
|
||||
"entities": "1.1.1",
|
||||
"entities": "1.1.2",
|
||||
"htmlparser2": "3.8.3",
|
||||
"jsdom": "7.2.2",
|
||||
"lodash": "4.17.11"
|
||||
@@ -1378,7 +1378,7 @@
|
||||
},
|
||||
"color": {
|
||||
"version": "0.11.4",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz",
|
||||
"resolved": "http://registry.npmjs.org/color/-/color-0.11.4.tgz",
|
||||
"integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -1592,7 +1592,7 @@
|
||||
},
|
||||
"cson-parser": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/cson-parser/-/cson-parser-1.3.5.tgz",
|
||||
"resolved": "http://registry.npmjs.org/cson-parser/-/cson-parser-1.3.5.tgz",
|
||||
"integrity": "sha1-fsZ14DkUVTO/KmqFYHPxWZ2cLSQ=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -1611,7 +1611,7 @@
|
||||
},
|
||||
"css-color-names": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
|
||||
"resolved": "http://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz",
|
||||
"integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -1623,14 +1623,14 @@
|
||||
},
|
||||
"css-select": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz",
|
||||
"integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boolbase": "1.0.0",
|
||||
"css-what": "2.1.0",
|
||||
"css-what": "2.1.2",
|
||||
"domutils": "1.5.1",
|
||||
"nth-check": "1.0.1"
|
||||
"nth-check": "1.0.2"
|
||||
}
|
||||
},
|
||||
"css-stringify": {
|
||||
@@ -1640,9 +1640,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"css-what": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz",
|
||||
"integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.2.tgz",
|
||||
"integrity": "sha512-wan8dMWQ0GUeF7DGEPVjhHemVW/vy6xUYmFzRY8RYqgA0JtXC9rJmbScBjqSu6dg9q0lwPQy6ZAmJVr3PPTvqQ==",
|
||||
"dev": true
|
||||
},
|
||||
"cssnano": {
|
||||
@@ -1681,7 +1681,7 @@
|
||||
"postcss-reduce-transforms": "1.0.4",
|
||||
"postcss-svgo": "2.1.6",
|
||||
"postcss-unique-selectors": "2.0.2",
|
||||
"postcss-value-parser": "3.3.0",
|
||||
"postcss-value-parser": "3.3.1",
|
||||
"postcss-zindex": "2.2.0"
|
||||
}
|
||||
},
|
||||
@@ -1796,15 +1796,15 @@
|
||||
"integrity": "sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "4.0.1",
|
||||
"debug": "4.1.0",
|
||||
"gonzales-pe": "4.2.3",
|
||||
"node-source-walk": "4.0.0"
|
||||
"node-source-walk": "4.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.0.1.tgz",
|
||||
"integrity": "sha512-K23FHJ/Mt404FSlp6gSZCevIbTMLX0j3fmHhUEhQ3Wq0FMODW3+cUSoLdy1Gx4polAf4t/lphhmHH35BB8cLYw==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz",
|
||||
"integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
@@ -1824,15 +1824,15 @@
|
||||
"integrity": "sha1-BWYKoblc/Yf1dGQ7+s4+iiaBEqE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "3.2.5",
|
||||
"debug": "3.2.6",
|
||||
"gonzales-pe": "3.4.7",
|
||||
"node-source-walk": "3.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
|
||||
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
@@ -1876,15 +1876,15 @@
|
||||
"integrity": "sha1-dDJGoN01jZ2R/0ElQX9qd/vPJw8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "3.2.5",
|
||||
"debug": "3.2.6",
|
||||
"gonzales-pe": "3.4.7",
|
||||
"node-source-walk": "3.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
|
||||
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
@@ -1944,21 +1944,21 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.1.3",
|
||||
"entities": "1.1.1"
|
||||
"entities": "1.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"domelementtype": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
|
||||
"integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"domelementtype": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
|
||||
"integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.2.1.tgz",
|
||||
"integrity": "sha512-SQVCLFS2E7G5CRCMdn6K9bIhRj1bS6QBWZfF0TUPh4V/BbqrQ619IdSS3/izn0FZ+9l+uODzaZjb08fjOfablA==",
|
||||
"dev": true
|
||||
},
|
||||
"domhandler": {
|
||||
@@ -1967,7 +1967,7 @@
|
||||
"integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.3.0"
|
||||
"domelementtype": "1.2.1"
|
||||
}
|
||||
},
|
||||
"domutils": {
|
||||
@@ -1977,7 +1977,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"dom-serializer": "0.1.0",
|
||||
"domelementtype": "1.3.0"
|
||||
"domelementtype": "1.2.1"
|
||||
}
|
||||
},
|
||||
"dot-prop": {
|
||||
@@ -2026,7 +2026,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@paulcbetts/mime-types": "2.1.10",
|
||||
"@types/node": "7.0.71",
|
||||
"@types/node": "7.10.1",
|
||||
"btoa": "1.2.1",
|
||||
"debug": "2.6.9",
|
||||
"lru-cache": "4.1.3",
|
||||
@@ -2039,14 +2039,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "7.0.71",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.71.tgz",
|
||||
"integrity": "sha512-wpTYiRPPsjw/wiwlmP11mnln9be499B58XwoGsCy2hT8jSrRj7DE84FiIu3TBAQZ7L1ky1ibz5J9AG2YN1qZlQ==",
|
||||
"version": "7.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.10.1.tgz",
|
||||
"integrity": "sha512-fZvabBkcFJzc+eJN2XTuhKhop1RKdlGQgjmQuxYuQJ6K5rMNoHr6tomb6q0E8Axe+WPyfe/lr7CnnkGvzNh5mA==",
|
||||
"dev": true
|
||||
},
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -2109,7 +2109,7 @@
|
||||
"stylus": "0.54.5",
|
||||
"stylus-lookup": "1.0.2",
|
||||
"toutsuite": "0.6.0",
|
||||
"typescript": "3.1.1"
|
||||
"typescript": "3.1.5"
|
||||
}
|
||||
},
|
||||
"electron-config": {
|
||||
@@ -2126,21 +2126,21 @@
|
||||
"integrity": "sha512-FjEWG9Jb/ppK/2zToP+U5dds114fM1ZOJqMAR4aXXL5CvyPE9fiqBK/9YcwC9poIFQTEJk/EM/zyRwziziRZrg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "3.2.5",
|
||||
"debug": "3.2.6",
|
||||
"env-paths": "1.0.0",
|
||||
"fs-extra": "4.0.3",
|
||||
"minimist": "1.2.0",
|
||||
"nugget": "2.0.1",
|
||||
"path-exists": "3.0.0",
|
||||
"rc": "1.2.8",
|
||||
"semver": "5.5.1",
|
||||
"semver": "5.6.0",
|
||||
"sumchecker": "2.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
|
||||
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
@@ -2182,7 +2182,7 @@
|
||||
"integrity": "sha512-BsU/KJRPODlEoaOZhsmFTIaG2h1Y28JCrqeTGVqGL+fef/7xQZdHx5ZCStUDXXUSTcoqiHlc5QvLH4PfZFbOmg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "8.10.34",
|
||||
"@types/node": "8.10.37",
|
||||
"electron-download": "4.1.1",
|
||||
"extract-zip": "1.6.7"
|
||||
}
|
||||
@@ -2191,16 +2191,16 @@
|
||||
},
|
||||
"electron-squirrel-startup": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz",
|
||||
"integrity": "sha1-GbTlWTP6Dvj1VnhLnGYPdyVGoLg=",
|
||||
"requires": {
|
||||
"debug": "2.6.9"
|
||||
}
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.3.75",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.75.tgz",
|
||||
"integrity": "sha512-nLo03Qpw++8R6BxDZL/B1c8SQvUe/htdgc5LWYHe5YotV2jVvRUMP5AlOmxOsyeOzgMiXrNln2mC05Ixz6vuUQ==",
|
||||
"version": "1.3.83",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz",
|
||||
"integrity": "sha512-DqJoDarxq50dcHsOOlMLNoy+qQitlMNbYb6wwbE0oUw2veHdRkpNrhmngiUYKMErdJ8SJ48rpJsZTQgy5SoEAA==",
|
||||
"dev": true
|
||||
},
|
||||
"encodeurl": {
|
||||
@@ -2292,9 +2292,9 @@
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
|
||||
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
|
||||
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
|
||||
"dev": true
|
||||
},
|
||||
"env-paths": {
|
||||
@@ -2401,13 +2401,13 @@
|
||||
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
||||
},
|
||||
"express": {
|
||||
"version": "4.16.3",
|
||||
"resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz",
|
||||
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
|
||||
"version": "4.16.4",
|
||||
"resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz",
|
||||
"integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==",
|
||||
"requires": {
|
||||
"accepts": "1.3.5",
|
||||
"array-flatten": "1.1.1",
|
||||
"body-parser": "1.18.2",
|
||||
"body-parser": "1.18.3",
|
||||
"content-disposition": "0.5.2",
|
||||
"content-type": "1.0.4",
|
||||
"cookie": "0.3.1",
|
||||
@@ -2425,9 +2425,9 @@
|
||||
"parseurl": "1.3.2",
|
||||
"path-to-regexp": "0.1.7",
|
||||
"proxy-addr": "2.0.4",
|
||||
"qs": "6.5.1",
|
||||
"qs": "6.5.2",
|
||||
"range-parser": "1.2.0",
|
||||
"safe-buffer": "5.1.1",
|
||||
"safe-buffer": "5.1.2",
|
||||
"send": "0.16.2",
|
||||
"serve-static": "1.13.2",
|
||||
"setprototypeof": "1.1.0",
|
||||
@@ -2435,21 +2435,12 @@
|
||||
"type-is": "1.6.16",
|
||||
"utils-merge": "1.0.1",
|
||||
"vary": "1.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"safe-buffer": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
|
||||
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
|
||||
"dev": true,
|
||||
"optional": true
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
|
||||
},
|
||||
"extract-opts": {
|
||||
"version": "3.3.1",
|
||||
@@ -2481,7 +2472,7 @@
|
||||
},
|
||||
"fast-deep-equal": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
|
||||
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
@@ -2551,23 +2542,13 @@
|
||||
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
|
||||
},
|
||||
"form-data": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
|
||||
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
|
||||
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
|
||||
"requires": {
|
||||
"asynckit": "0.4.0",
|
||||
"combined-stream": "1.0.6",
|
||||
"combined-stream": "1.0.7",
|
||||
"mime-types": "2.1.20"
|
||||
},
|
||||
"dependencies": {
|
||||
"combined-stream": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
|
||||
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
|
||||
"requires": {
|
||||
"delayed-stream": "1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"forwarded": {
|
||||
@@ -2799,7 +2780,7 @@
|
||||
},
|
||||
"hoek": {
|
||||
"version": "2.16.3",
|
||||
"resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
|
||||
"integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -2820,23 +2801,18 @@
|
||||
"dev": true
|
||||
},
|
||||
"html-comment-regex": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz",
|
||||
"integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=",
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz",
|
||||
"integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==",
|
||||
"dev": true
|
||||
},
|
||||
"html-entities": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz",
|
||||
"integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8="
|
||||
},
|
||||
"htmlparser2": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
|
||||
"resolved": "http://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
|
||||
"integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"domelementtype": "1.3.0",
|
||||
"domelementtype": "1.2.1",
|
||||
"domhandler": "2.3.0",
|
||||
"domutils": "1.5.1",
|
||||
"entities": "1.0.0",
|
||||
@@ -2845,7 +2821,7 @@
|
||||
"dependencies": {
|
||||
"entities": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
|
||||
"integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=",
|
||||
"dev": true
|
||||
}
|
||||
@@ -2873,9 +2849,12 @@
|
||||
}
|
||||
},
|
||||
"iconv-lite": {
|
||||
"version": "0.4.19",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
|
||||
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
|
||||
"version": "0.4.23",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
|
||||
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
|
||||
"requires": {
|
||||
"safer-buffer": "2.1.2"
|
||||
}
|
||||
},
|
||||
"image-size": {
|
||||
"version": "0.5.5",
|
||||
@@ -2997,7 +2976,7 @@
|
||||
},
|
||||
"is-obj": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
|
||||
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
|
||||
},
|
||||
"is-plain-obj": {
|
||||
@@ -3024,7 +3003,7 @@
|
||||
"integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"html-comment-regex": "1.1.1"
|
||||
"html-comment-regex": "1.1.2"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
@@ -3571,7 +3550,7 @@
|
||||
"dependencies": {
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
|
||||
"dev": true
|
||||
}
|
||||
@@ -3584,13 +3563,6 @@
|
||||
"requires": {
|
||||
"p-locate": "2.0.0",
|
||||
"path-exists": "3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
}
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
@@ -3674,12 +3646,12 @@
|
||||
},
|
||||
"media-typer": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
||||
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
||||
},
|
||||
"meow": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
"integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
@@ -3778,12 +3750,12 @@
|
||||
"integrity": "sha512-OayFWziIxiHY8bCUyLX6sTpDH8Jsbp4FfYd1j1f7vZyfgkcOnAyM4oQR16f8a0s7Gl/viMGRey8eScYk4V4EZA=="
|
||||
},
|
||||
"node-source-walk": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.0.0.tgz",
|
||||
"integrity": "sha512-uvuaGh3yVCNdkx/aiSJ3L5mnI8BNIFdJ89owJQEgLqC8cSw56NZZK4tHuDY13P3DeZr5DjmdRpTUlxr4dHbhAw==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/node-source-walk/-/node-source-walk-4.1.0.tgz",
|
||||
"integrity": "sha512-aR9GdKa9LT7sk00Z3V0c569Vx71n4KSS13be7EapoZGRFNXby/JNA0/3J+U50GaDOKKISw2HX3A3prunX4EEZw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/parser": "7.1.2"
|
||||
"@babel/parser": "7.1.3"
|
||||
}
|
||||
},
|
||||
"nopt": {
|
||||
@@ -3803,7 +3775,7 @@
|
||||
"requires": {
|
||||
"hosted-git-info": "2.7.1",
|
||||
"is-builtin-module": "1.0.0",
|
||||
"semver": "5.5.1",
|
||||
"semver": "5.6.0",
|
||||
"validate-npm-package-license": "3.0.4"
|
||||
}
|
||||
},
|
||||
@@ -3826,9 +3798,9 @@
|
||||
}
|
||||
},
|
||||
"nth-check": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz",
|
||||
"integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.2.tgz",
|
||||
"integrity": "sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"boolbase": "1.0.0"
|
||||
@@ -4029,8 +4001,7 @@
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"dev": true
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
@@ -4061,7 +4032,7 @@
|
||||
"dependencies": {
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
|
||||
"dev": true
|
||||
}
|
||||
@@ -4191,7 +4162,7 @@
|
||||
"requires": {
|
||||
"colormin": "1.1.2",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-convert-values": {
|
||||
@@ -4201,7 +4172,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-discard-comments": {
|
||||
@@ -4267,7 +4238,7 @@
|
||||
"requires": {
|
||||
"has": "1.0.3",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-merge-longhand": {
|
||||
@@ -4306,7 +4277,7 @@
|
||||
"requires": {
|
||||
"object-assign": "4.1.1",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-minify-gradients": {
|
||||
@@ -4316,7 +4287,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-minify-params": {
|
||||
@@ -4327,7 +4298,7 @@
|
||||
"requires": {
|
||||
"alphanum-sort": "1.0.2",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0",
|
||||
"postcss-value-parser": "3.3.1",
|
||||
"uniqs": "2.0.0"
|
||||
}
|
||||
},
|
||||
@@ -4361,7 +4332,7 @@
|
||||
"is-absolute-url": "2.1.0",
|
||||
"normalize-url": "1.9.1",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-ordered-values": {
|
||||
@@ -4371,7 +4342,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-reduce-idents": {
|
||||
@@ -4381,7 +4352,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-reduce-initial": {
|
||||
@@ -4401,7 +4372,7 @@
|
||||
"requires": {
|
||||
"has": "1.0.3",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0"
|
||||
"postcss-value-parser": "3.3.1"
|
||||
}
|
||||
},
|
||||
"postcss-selector-parser": {
|
||||
@@ -4423,7 +4394,7 @@
|
||||
"requires": {
|
||||
"is-svg": "2.1.0",
|
||||
"postcss": "5.2.18",
|
||||
"postcss-value-parser": "3.3.0",
|
||||
"postcss-value-parser": "3.3.1",
|
||||
"svgo": "0.7.2"
|
||||
}
|
||||
},
|
||||
@@ -4439,9 +4410,9 @@
|
||||
}
|
||||
},
|
||||
"postcss-value-parser": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz",
|
||||
"integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=",
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
|
||||
"integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
|
||||
"dev": true
|
||||
},
|
||||
"postcss-zindex": {
|
||||
@@ -4547,9 +4518,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
|
||||
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
|
||||
},
|
||||
"query-string": {
|
||||
"version": "4.3.4",
|
||||
@@ -4567,37 +4538,14 @@
|
||||
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
|
||||
},
|
||||
"raw-body": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
|
||||
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
|
||||
"integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
|
||||
"requires": {
|
||||
"bytes": "3.0.0",
|
||||
"http-errors": "1.6.2",
|
||||
"iconv-lite": "0.4.19",
|
||||
"http-errors": "1.6.3",
|
||||
"iconv-lite": "0.4.23",
|
||||
"unpipe": "1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"depd": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
|
||||
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
|
||||
},
|
||||
"http-errors": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
|
||||
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
|
||||
"requires": {
|
||||
"depd": "1.1.1",
|
||||
"inherits": "2.0.3",
|
||||
"setprototypeof": "1.0.3",
|
||||
"statuses": "1.4.0"
|
||||
}
|
||||
},
|
||||
"setprototypeof": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
|
||||
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
|
||||
}
|
||||
}
|
||||
},
|
||||
"rc": {
|
||||
@@ -4735,7 +4683,7 @@
|
||||
},
|
||||
"regjsgen": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
|
||||
"resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz",
|
||||
"integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=",
|
||||
"dev": true
|
||||
},
|
||||
@@ -4774,7 +4722,7 @@
|
||||
"combined-stream": "1.0.7",
|
||||
"extend": "3.0.2",
|
||||
"forever-agent": "0.6.1",
|
||||
"form-data": "2.3.2",
|
||||
"form-data": "2.3.3",
|
||||
"har-validator": "5.1.0",
|
||||
"http-signature": "1.2.0",
|
||||
"is-typedarray": "1.0.0",
|
||||
@@ -4788,18 +4736,6 @@
|
||||
"tough-cookie": "2.4.3",
|
||||
"tunnel-agent": "0.6.0",
|
||||
"uuid": "3.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
|
||||
},
|
||||
"qs": {
|
||||
"version": "6.5.2",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
@@ -4925,9 +4861,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.5.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz",
|
||||
"integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==",
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
|
||||
"dev": true
|
||||
},
|
||||
"send": {
|
||||
@@ -5154,7 +5090,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"spdx-expression-parse": "3.0.0",
|
||||
"spdx-license-ids": "3.0.1"
|
||||
"spdx-license-ids": "3.0.2"
|
||||
}
|
||||
},
|
||||
"spdx-exceptions": {
|
||||
@@ -5170,13 +5106,13 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"spdx-exceptions": "2.2.0",
|
||||
"spdx-license-ids": "3.0.1"
|
||||
"spdx-license-ids": "3.0.2"
|
||||
}
|
||||
},
|
||||
"spdx-license-ids": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz",
|
||||
"integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz",
|
||||
"integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==",
|
||||
"dev": true
|
||||
},
|
||||
"speedometer": {
|
||||
@@ -5333,7 +5269,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "2.8.1",
|
||||
"debug": "3.2.5",
|
||||
"debug": "3.2.6",
|
||||
"is-relative-path": "1.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -5347,9 +5283,9 @@
|
||||
}
|
||||
},
|
||||
"debug": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.5.tgz",
|
||||
"integrity": "sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg==",
|
||||
"version": "3.2.6",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "2.1.1"
|
||||
@@ -5595,7 +5531,7 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"errlop": "1.0.3",
|
||||
"semver": "5.5.1"
|
||||
"semver": "5.6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5607,9 +5543,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.1.tgz",
|
||||
"integrity": "sha512-Veu0w4dTc/9wlWNf2jeRInNodKlcdLgemvPsrNpfu5Pq39sgfFjvIIgTsvUHCoLBnMhPoUA+tFxsXjU6VexVRQ==",
|
||||
"version": "3.1.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.1.5.tgz",
|
||||
"integrity": "sha512-muYNWV9j5+3mXoKD6oPONKuGUmYiFX14gfo9lWm9ZXRHOqVDQiB4q1CzFPbF4QLV2E9TZXH6oK55oQ94rn3PpA==",
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "yt_presence",
|
||||
"productName": "YT Presence",
|
||||
"version": "1.0.0",
|
||||
"description": "YT Presence adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"name": "premid",
|
||||
"productName": "PreMiD",
|
||||
"productVersion": "1.2",
|
||||
"version": "1.2.0",
|
||||
"description": "PreMiD adds cool Features to YouTube/YouTube Music. Like for example Discord Rich Presence integration, Media controls and much more.",
|
||||
"main": "index.js",
|
||||
"repository": "Timeraa/YT-Presence",
|
||||
"repository": "Timeraa/PreMiD",
|
||||
"keywords": [],
|
||||
"author": "Timeraa",
|
||||
"license": "MIT",
|
||||
@@ -14,8 +15,7 @@
|
||||
"discord-rpc": "^3.0.1",
|
||||
"electron-config": "^1.0.0",
|
||||
"electron-squirrel-startup": "^1.0.0",
|
||||
"express": "^4.16.3",
|
||||
"html-entities": "^1.2.1",
|
||||
"express": "^4.16.4",
|
||||
"request": "^2.88.0",
|
||||
"socket.io": "^2.1.1"
|
||||
},
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
//* Require needed packages
|
||||
const chalk = require("chalk")
|
||||
const express = require("express")
|
||||
var constants = require('./util/constants.js')
|
||||
var extension = express();
|
||||
var http = require('http')
|
||||
var socketServer = http.createServer(extension);
|
||||
var io = require('socket.io')(socketServer);
|
||||
const chalk = require("chalk"),
|
||||
express = require("express")
|
||||
|
||||
//* Create server to listen for extension
|
||||
var extension = express(),
|
||||
http = require('http'),
|
||||
socketServer = http.createServer(extension),
|
||||
io = require('socket.io')(socketServer);
|
||||
|
||||
//* Load Config
|
||||
const Config = require('electron-config');
|
||||
@@ -14,25 +17,19 @@ const userSettings = new Config({
|
||||
});
|
||||
|
||||
//* Define needed variables
|
||||
var keepAliveSwitch = 0,
|
||||
lastKeepAliveSwitch = 0,
|
||||
ytrpcused = false,
|
||||
ytmrpcused = false,
|
||||
nflixrpcused = false,
|
||||
twitchrpcused = false,
|
||||
scloudrpcused = false
|
||||
var lastKeepAliveSwitch = 0
|
||||
|
||||
//* Keep alive check to automatically remove presence if browser not running/not using YT
|
||||
setInterval(keepAliveCheck, 1000)
|
||||
|
||||
function keepAliveCheck() {
|
||||
if (lastKeepAliveSwitch > keepAliveSwitch + 10) {
|
||||
TRAY.setTitle("")
|
||||
if (YTMRPCREADY) YTMRPC.clearActivity()
|
||||
if (YTRPCREADY) YTRPC.clearActivity()
|
||||
if (NFLIXRPCREADY) NFLIXRPC.clearActivity()
|
||||
if (TWITCHRPCREADY) TWITCHRPC.clearActivity()
|
||||
if (SCLOUDRPCREADY) SCLOUDRPC.clearActivity()
|
||||
async function keepAliveCheck() {
|
||||
if (lastKeepAliveSwitch > 0) {
|
||||
setupServices.forEach(service => {
|
||||
service.rpc.destroy()
|
||||
})
|
||||
setupServices = []
|
||||
serviceLogins = []
|
||||
if(PLATFORM == "darwin") TRAY.setTitle("");
|
||||
}
|
||||
lastKeepAliveSwitch += 1
|
||||
}
|
||||
@@ -47,74 +44,49 @@ io.on('connection', function (socket) {
|
||||
global.EXTENSIONSOCKET = socket
|
||||
BROWSERCONNECTIONSTATE = "CONNECTED"
|
||||
|
||||
socket.on('playBackChange', (data) => {
|
||||
updatePresence(data, true)
|
||||
})
|
||||
|
||||
socket.on('updateData', (data) => {
|
||||
updatePresence(data)
|
||||
})
|
||||
socket.on('playBackChange', updatePresence)
|
||||
socket.on('updateData', updatePresence)
|
||||
socket.on('settingsChange', require('./util/settingsHandler'))
|
||||
})
|
||||
|
||||
var setupServices = [],
|
||||
serviceLogins = [],
|
||||
presencePauseSwitch = 0
|
||||
|
||||
//* Updates the presence with the incomming data
|
||||
function updatePresence(data, force = false) {
|
||||
lastKeepAliveSwitch = 0
|
||||
if (!userSettings.get('titleMenubar')) constants.tray.setTitle("")
|
||||
async function updatePresence(data) {
|
||||
lastKeepAliveSwitch = 0;
|
||||
|
||||
if (data.yt != undefined) {
|
||||
ytrpcused = true
|
||||
if (userSettings.get('youTube')) require('./presences/YouTube.js')(data, force); else if (YTRPCREADY) YTRPC.clearActivity()
|
||||
} else if (data.ytm != undefined) {
|
||||
ytmrpcused = true
|
||||
if (userSettings.get('youTubeMusic')) require('./presences/YouTube_Music.js')(data, force); else if (YTMRPCREADY) YTMRPC.clearActivity()
|
||||
} else if(data.nflix != undefined) {
|
||||
nflixrpcused = true
|
||||
if (userSettings.get('netflix')) require('./presences/Netflix.js')(data, force); else if (NFLIXRPCREADY) NFLIXRPC.clearActivity()
|
||||
} else if(data.twitch != undefined) {
|
||||
twitchrpcused = true
|
||||
if (userSettings.get('twitch')) require('./presences/Twitch.js')(data, force); else if (TWITCHRPCREADY) TWITCHRPC.clearActivity()
|
||||
} else if(data.scloud != undefined) {
|
||||
scloudrpcused = true
|
||||
if (userSettings.get('soundcloud')) require('./presences/SoundCloud.js')(data, force); else if(SCLOUDRPCREADY) SCLOUDRPC.clearActivity()
|
||||
}
|
||||
var setupService = setupServices.find(svice => svice.serviceName == data.service);
|
||||
|
||||
if (data.yt == undefined && YTRPCREADY) {
|
||||
if (ytrpcused == true) {
|
||||
ytrpcused = false
|
||||
YTRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
if(!data.playback) presencePauseSwitch++; else presencePauseSwitch = 0;
|
||||
if(presencePauseSwitch >= 60) {
|
||||
if(setupService != null) {
|
||||
setupService.rpc.clearActivity()
|
||||
if(PLATFORM == "darwin") TRAY.setTitle("");
|
||||
}
|
||||
} else {
|
||||
if(setupService) {
|
||||
if(userSettings.get('titleMenubar')) if(PLATFORM == "darwin" && data.playback) TRAY.setTitle(data.trayTitle); else TRAY.setTitle("");
|
||||
setupService.rpc.setActivity(data.presenceData)
|
||||
} else {
|
||||
tryLogin(data.service, data.clientID)
|
||||
serviceLogins.push({serviceName: data.service, intervalID: setInterval(() => tryLogin(data.service, data.clientID), 10 * 1000)})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (data.ytm == undefined && YTMRPCREADY) {
|
||||
if (ytmrpcused == true) {
|
||||
ytmrpcused = false
|
||||
YTMRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.nflix == undefined && NFLIXRPCREADY) {
|
||||
if (nflixrpcused == true) {
|
||||
nflixrpcused = false
|
||||
NFLIXRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.twitch == undefined && TWITCHRPCREADY) {
|
||||
if (twitchrpcused == true) {
|
||||
twitchrpcused = false
|
||||
TWITCHRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
|
||||
if (data.scloud == undefined && SCLOUDRPCREADY) {
|
||||
if (scloudrpcused == true) {
|
||||
scloudrpcused = false
|
||||
SCLOUDRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin(service, clientID) {
|
||||
setupServices.push({rpc: new DiscordRPC.Client({ transport: "ipc" }), serviceName: service, ready: false})
|
||||
var serviceRPC = setupServices.find(svice => svice.serviceName == service)
|
||||
serviceRPC.rpc.login({ clientId: clientID })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}PreMiD - RPC: ${err.message}`))
|
||||
serviceRPC.rpc.on("ready", () => {
|
||||
clearInterval(serviceLogins.find(svice => svice.serviceName == service).intervalID)
|
||||
serviceRPC.ready = true
|
||||
})
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { nflix_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastVideoTitle = "",
|
||||
videoTitle,
|
||||
videoAuthor,
|
||||
videoStartTime,
|
||||
videoEndTime,
|
||||
seriesTitle
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.nflix.playback == "paused")
|
||||
updatePresence(seriesTitle, videoAuthor, "pause", "Paused")
|
||||
else if (data.nflix.playback == "playing")
|
||||
updatePresence(seriesTitle, videoAuthor, "play", "Watching", videoStartTime, videoEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.nflix.playback == "playing" && NFLIXRPCREADY) && (videoEndTime != lastEndTime || videoTitle != lastVideoTitle)) {
|
||||
lastVideoTitle = videoTitle
|
||||
lastEndTime = videoEndTime
|
||||
updatePresence(seriesTitle, videoAuthor, "play", "Watching", videoStartTime, videoEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) NFLIXRPC.clearActivity()
|
||||
if(data.nflix.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
NFLIXRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
NFLIXRPC.login({ clientId: nflix_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}NFLIXRPC: ${err.message}`))
|
||||
NFLIXRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
NFLIXRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
NFLIXRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "nflix_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
videoTitle = data.nflix.episodeTitle
|
||||
videoAuthor = data.nflix.season + " - " + data.nflix.episodeTitle
|
||||
videoStartTime = Math.floor(data.nflix.episodeCurrentTime / 1000);
|
||||
videoEndTime = data.nflix.episodeEndTime;
|
||||
seriesTitle = data.nflix.seriesTitle
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { scloud_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastSongTitle = "",
|
||||
songAuthor,
|
||||
songStartTime,
|
||||
songEndTime,
|
||||
songTitle
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.scloud.playback == "paused")
|
||||
updatePresence(songTitle, songAuthor, "pause", "Paused")
|
||||
else if (data.scloud.playback == "playing")
|
||||
updatePresence(songTitle, songAuthor, "play", "Playing back.", songStartTime, songEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.scloud.playback == "playing" && SCLOUDRPCREADY) && (songEndTime != lastEndTime || songTitle != lastSongTitle)) {
|
||||
lastSongTitle = songTitle
|
||||
lastEndTime = songEndTime
|
||||
updatePresence(songTitle, songAuthor, "play", "Playing back", songStartTime, songEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) SCLOUDRPC.clearActivity()
|
||||
if(data.scloud.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
SCLOUDRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
SCLOUDRPC.login({ clientId: scloud_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}SCLOUDRPC: ${err.message}`))
|
||||
SCLOUDRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
SCLOUDRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
SCLOUDRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "scloud_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
songAuthor = data.scloud.songAuthor
|
||||
songStartTime = Math.floor(data.scloud.songCurrentTime / 1000);
|
||||
songEndTime = data.scloud.songEndTime;
|
||||
songTitle = data.scloud.songTitle
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { twitch_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
laststreamTitle = "",
|
||||
streamTitle,
|
||||
streamHost,
|
||||
videoStartTime
|
||||
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.twitch.playback == "paused")
|
||||
updatePresence(streamTitle, streamHost, "pause", "Paused")
|
||||
else if (data.twitch.playback == "playing")
|
||||
updatePresence(streamTitle, streamHost, "play", "Watching", videoStartTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.twitch.playback == "playing" && TWITCHRPCREADY) && streamTitle != laststreamTitle) {
|
||||
laststreamTitle = streamTitle
|
||||
updatePresence(streamTitle, streamHost, "play", "Watching", videoStartTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) TWITCHRPC.clearActivity()
|
||||
if(data.twitch.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
TWITCHRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
TWITCHRPC.login({ clientId: twitch_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}TWITCHRPC: ${err.message}`))
|
||||
TWITCHRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
TWITCHRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
TWITCHRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "twitch_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
streamTitle = data.twitch.streamTitle
|
||||
streamHost = data.twitch.streamHost
|
||||
videoStartTime = Math.floor(data.twitch.watchingSince / 1000);
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
const DiscordRPC = require('discord-rpc')
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
const { yt_client_id } = require("../config.json");
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: 'userSettings'
|
||||
})
|
||||
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
lastVideoTitle = "",
|
||||
videoTitle,
|
||||
videoAuthor,
|
||||
videoStartTime,
|
||||
videoEndTime
|
||||
|
||||
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
if (force) {
|
||||
if (data.yt.playback == "paused")
|
||||
updatePresence(videoTitle, videoAuthor, "pause", "Playback paused.")
|
||||
else if (data.yt.playback == "playing")
|
||||
updatePresence(videoTitle, videoAuthor, "play", "Playing back.", videoStartTime, videoEndTime)
|
||||
} else {
|
||||
updateData(data)
|
||||
|
||||
if ((data.yt.playback == "playing" && YTRPCREADY) && (videoEndTime != lastEndTime || videoTitle != lastVideoTitle)) {
|
||||
lastVideoTitle = videoTitle
|
||||
lastEndTime = videoEndTime
|
||||
updatePresence(videoTitle, videoAuthor, "play", "Playing back.", videoStartTime, videoEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) YTRPC.clearActivity()
|
||||
if(data.yt.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
YTRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
YTRPC.login({ clientId: yt_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}YTRPC: ${err.message}`))
|
||||
YTRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
YTRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(details)); else TRAY.setTitle("");
|
||||
YTRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "yt_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
videoTitle = data.yt.videoTitle
|
||||
videoAuthor = data.yt.videoAuthor
|
||||
videoStartTime = Math.floor(data.yt.videoCurrentTime / 1000);
|
||||
videoEndTime = data.yt.videoEndTime;
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
const DiscordRPC = require("discord-rpc")
|
||||
|
||||
const Entities = require("html-entities").AllHtmlEntities;
|
||||
const entities = new Entities();
|
||||
|
||||
const { ytm_client_id } = require("../config.json");
|
||||
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({name: 'userSettings'})
|
||||
|
||||
//* Define needed variables
|
||||
let lastEndTime = 0,
|
||||
pauseRPCChange = 0,
|
||||
songTitle,
|
||||
songAuthorString,
|
||||
songEndTime,
|
||||
songStartTime
|
||||
|
||||
//* Try to connect RPC
|
||||
tryLogin()
|
||||
var retryRPCLogin = setInterval(tryLogin, 10 * 1000)
|
||||
|
||||
module.exports = (data, force) => {
|
||||
//* If YTM RPC Ready
|
||||
if(YTMRPCREADY) {
|
||||
//* Is update forced?
|
||||
if (force) {
|
||||
//* Check what playback state and set its Presence
|
||||
if (data.ytm.playback == "paused")
|
||||
updatePresence(songTitle, songAuthorString, "pause", "Playback paused.");
|
||||
else if (data.ytm.playback == "playing")
|
||||
updatePresence(songTitle, songAuthorString, "play", "Playing back.", songStartTime, songEndTime);
|
||||
} else {
|
||||
//* Update Presence data
|
||||
updateData(data)
|
||||
|
||||
//* Only update Presence if time changed
|
||||
if (data.ytm.playback == "playing" && songEndTime != lastEndTime) {
|
||||
lastEndTime = songEndTime
|
||||
updatePresence(songTitle, songAuthorString, "play", "Playing back.", songStartTime, songEndTime)
|
||||
}
|
||||
|
||||
//* Clear Presence after 1 minute if playback == pause
|
||||
if(pauseRPCChange >= 60 && pauseRPCChange <= 60) {
|
||||
YTMRPC.clearActivity()
|
||||
TRAY.setTitle("")
|
||||
}
|
||||
|
||||
//* Increase pauseChange if paused
|
||||
if(data.ytm.playback == "paused") pauseRPCChange++; else pauseRPCChange = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to login to RPC until connected
|
||||
*/
|
||||
async function tryLogin() {
|
||||
YTMRPC = new DiscordRPC.Client({ transport: "ipc" });
|
||||
YTMRPC.login({ clientId: ytm_client_id })
|
||||
.catch(err => console.log(`${CONSOLEPREFIX}YTMRPC: ${err.message}`))
|
||||
YTMRPC.on("ready", () => {
|
||||
clearInterval(retryRPCLogin)
|
||||
YTMRPCREADY = true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Presence on Discord
|
||||
* @param {String} details Details to show
|
||||
* @param {String} state State to show
|
||||
* @param {String} smallImageKey Small image name
|
||||
* @param {String} smallImageText Small image text
|
||||
* @param {Number} startTimestamp Start timestamp
|
||||
* @param {Number} endTimestamp End timerstamp
|
||||
*/
|
||||
function updatePresence(details, state, smallImageKey, smallImageText, startTimestamp = null, endTimestamp = null) {
|
||||
if(startTimestamp != null && userSettings.get('titleMenubar')) TRAY.setTitle(entities.decode(songTitle)); else TRAY.setTitle("");
|
||||
YTMRPC.setActivity({
|
||||
details: entities.decode(details),
|
||||
state: entities.decode(state),
|
||||
largeImageKey: "ytm_lg",
|
||||
largeImageText: "YT Presence " + VERSIONSTRING,
|
||||
smallImageKey: smallImageKey,
|
||||
smallImageText: smallImageText,
|
||||
startTimestamp: startTimestamp,
|
||||
endTimestamp: endTimestamp,
|
||||
instance: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the data used for the Presence
|
||||
* @param {Object} data Data received from Extension
|
||||
*/
|
||||
function updateData(data) {
|
||||
songTitle = data.ytm.songTitle
|
||||
var songAuthors = data.ytm.songAuthors
|
||||
songStartTime = Math.floor(data.ytm.songCurrentTime / 1000);
|
||||
songEndTime = data.ytm.songEndTime;
|
||||
|
||||
//* Create author string from author array
|
||||
songAuthors.forEach((author, index, authors) => {
|
||||
if (index == 0)
|
||||
songAuthorString = author;
|
||||
else if (index < authors.length - 2)
|
||||
songAuthorString = songAuthorString + ", " + author;
|
||||
else if (index < authors.length - 1) songAuthorString = songAuthorString + " and " + author;
|
||||
else songAuthorString = songAuthorString + " • " + author;
|
||||
});
|
||||
}
|
||||
@@ -1,32 +1,22 @@
|
||||
const path = require('path')
|
||||
const constants = require("../util/constants")
|
||||
const {Tray, Menu, MenuItem} = require('electron')
|
||||
|
||||
exports.run = () => {
|
||||
TRAY = new Tray(path.join(__dirname, "../assets/images/icon.png"))
|
||||
TRAY.setToolTip(`YT Presence V${VERSIONSTRING}`)
|
||||
constants.menuBarMenu = new Menu()
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
label: `YT Presence | V${VERSIONSTRING}`,
|
||||
TRAY.setToolTip(`PreMiD V${VERSIONSTRING}`)
|
||||
var menuBarMenu = new Menu()
|
||||
menuBarMenu.append(new MenuItem({
|
||||
label: `PreMiD | V${VERSIONSTRING}`,
|
||||
enabled: false,
|
||||
icon: path.join(__dirname, "../assets/images/icon.png")
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({type: "separator"}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
click: require('./showAbout').run,
|
||||
label: "About"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
menuBarMenu.append(new MenuItem({type: "separator"}))
|
||||
menuBarMenu.append(new MenuItem({
|
||||
click: cfu,
|
||||
label: "Check for update"
|
||||
label: "Check for updates"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({
|
||||
click: require('./showPreferences').run,
|
||||
label: "Preferences"
|
||||
}))
|
||||
constants.menuBarMenu.append(new MenuItem({type: "separator"}))
|
||||
constants.menuBarMenu.append(new MenuItem({role: "quit"}))
|
||||
TRAY.setContextMenu(constants.menuBarMenu)
|
||||
menuBarMenu.append(new MenuItem({role: "quit"}))
|
||||
TRAY.setContextMenu(menuBarMenu)
|
||||
}
|
||||
|
||||
cfu = () => require('../util/updateChecker').checkForUpdate(true, true)
|
||||
@@ -24,11 +24,7 @@ exports.run = () => {
|
||||
settingsWindow.setMenu(null)
|
||||
|
||||
settingsWindow.loadURL("file://" + path.join(__dirname, "../windows/preferences.html"))
|
||||
|
||||
settingsWindow.on('blur', () => {
|
||||
settingsWindow.close()
|
||||
})
|
||||
|
||||
|
||||
settingsWindow.on('close', () => {
|
||||
settingsWindow = null;
|
||||
})
|
||||
|
||||
31
src/util/autoLaunch.js
Normal file
@@ -0,0 +1,31 @@
|
||||
//* Declare needed constants
|
||||
const {app} = require('electron')
|
||||
const chalk = require("chalk")
|
||||
const AutoLaunch = require('auto-launch')
|
||||
|
||||
//* Setup electron-config
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
if(userSettings.get('autoLaunch') == undefined || userSettings.get('autoLaunch') == true) {
|
||||
userSettings.set('autoLaunch', true)
|
||||
//* Add App to AutoLaunch
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Adding App to autostart..."))
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'PreMiD',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
//* Enable AutoLaunch if disabled
|
||||
autoLaunch.isEnabled().then(async (isEnabled) => {
|
||||
if (!isEnabled) autoLaunch.enable();
|
||||
console.log(CONSOLEPREFIX + chalk.green("Added App to autostart."))
|
||||
})
|
||||
//* Catch error
|
||||
.catch(function(err) {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Error while adding App to autostart."))
|
||||
})
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
module.exports = {
|
||||
app: "",
|
||||
win: "",
|
||||
menuBar: "",
|
||||
menuBarMenu: "",
|
||||
chromeConnected: false,
|
||||
presenceReady: false,
|
||||
setup: false,
|
||||
newVersion: false,
|
||||
introRan: false,
|
||||
lastResponse: false,
|
||||
platform: "",
|
||||
data: ""
|
||||
};
|
||||
51
src/util/settingsHandler.js
Normal file
@@ -0,0 +1,51 @@
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
const {app} = require('electron')
|
||||
const AutoLaunch = require('auto-launch')
|
||||
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'PreMiD',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
var mediaControls = require('./shortcutHandler');
|
||||
|
||||
module.exports = async (data) => {
|
||||
if(userSettings.get('titleMenubar') != data.options.titleMenubar) {
|
||||
userSettings.set('titleMenubar', data.options.titleMenubar)
|
||||
if(PLATFORM == "darwin" && !data.options.titleMenubar) TRAY.setTitle("")
|
||||
}
|
||||
|
||||
if(userSettings.get('autoUpdateCheck') != data.options.checkForUpdates)
|
||||
userSettings.set('autoUpdateCheck', data.options.checkForUpdates)
|
||||
|
||||
if(userSettings.get('autoLaunch') != data.options.systemStartup) {
|
||||
userSettings.set('autoLaunch', data.options.systemStartup)
|
||||
|
||||
if(data.options.systemStartup) {
|
||||
autoLaunch.isEnabled().then(async (isEnabled) => {
|
||||
if (!isEnabled) autoLaunch.enable();
|
||||
})
|
||||
} else {
|
||||
autoLaunch.isEnabled().then(async (isEnabled) => {
|
||||
if (isEnabled) autoLaunch.disable();
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if(userSettings.get('mediaControls') != data.options.mediaControls) {
|
||||
userSettings.set('mediaControls', data.options.mediaControls)
|
||||
if(data.options.mediaControls) mediaControls.register(); else mediaControls.unregister();
|
||||
}
|
||||
|
||||
if(userSettings.get('titleMenubar') != data.options.titleMenubar) {
|
||||
userSettings.set('titleMenubar', data.options.titleMenubar)
|
||||
if(!data.options.titleMenubar) TRAY.setTitle("")
|
||||
}
|
||||
|
||||
//console.log(data.options)
|
||||
}
|
||||
@@ -1,18 +1,49 @@
|
||||
const Config = require('electron-config');
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
});
|
||||
|
||||
const chalk = require('chalk')
|
||||
var { globalShortcut } = require('electron')
|
||||
var { globalShortcut, app } = require('electron')
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Registering keyboard shortcuts..."))
|
||||
module.exports.register = async () => {
|
||||
if(!userSettings.get('mediaControls')) return
|
||||
console.log(CONSOLEPREFIX + chalk.yellow("Registering keyboard shortcuts..."))
|
||||
|
||||
globalShortcut.register('medianexttrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "nextTrack" })
|
||||
})
|
||||
|
||||
var pauseSkipToggle = 0;
|
||||
globalShortcut.register('mediaplaypause', () => {
|
||||
pauseSkipToggle++
|
||||
setTimeout(() => {
|
||||
if (EXTENSIONSOCKET != null && pauseSkipToggle == 1) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "pause" })
|
||||
if (EXTENSIONSOCKET != null && pauseSkipToggle == 2) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "nextTrack" })
|
||||
if (EXTENSIONSOCKET != null && pauseSkipToggle == 3) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "previousTrack" })
|
||||
pauseSkipToggle = 0
|
||||
}, 500)
|
||||
})
|
||||
|
||||
globalShortcut.register('mediaprevioustrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "previousTrack" })
|
||||
})
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.green("Successfully registered keyboard shortcuts."))
|
||||
}
|
||||
|
||||
globalShortcut.register('medianexttrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "nextTrack" })
|
||||
})
|
||||
module.exports.unregister = async () => {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Unregistering keyboard shortcuts..."))
|
||||
if(require('os').platform() == "darwin") {
|
||||
app.relaunch()
|
||||
app.exit(0)
|
||||
} else
|
||||
globalShortcut.unregisterAll()
|
||||
console.log(CONSOLEPREFIX + chalk.green("Unregistered keyboard shortcuts"))
|
||||
}
|
||||
|
||||
globalShortcut.register('mediaplaypause', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "pause" })
|
||||
})
|
||||
|
||||
globalShortcut.register('mediaprevioustrack', () => {
|
||||
if (EXTENSIONSOCKET != null) EXTENSIONSOCKET.emit('mediaKeyHandler', { playback: "previousTrack" })
|
||||
})
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.green("Successfully registered keyboard shortcuts."))
|
||||
app.on('will-quit', () => {
|
||||
console.log(CONSOLEPREFIX + chalk.red("Unregistering keyboard shortcuts..."))
|
||||
globalShortcut.unregisterAll()
|
||||
console.log(CONSOLEPREFIX + chalk.green("Unregistered keyboard shortcuts"))
|
||||
})
|
||||
@@ -4,7 +4,6 @@ const path = require('path')
|
||||
|
||||
const request = require("request")
|
||||
const chalk = require("chalk")
|
||||
let constants = require('./constants')
|
||||
|
||||
function checkForUpdate(sendNotification = false, sendNoUpdateInfo = false) {
|
||||
|
||||
@@ -24,7 +23,6 @@ function checkForUpdate(sendNotification = false, sendNoUpdateInfo = false) {
|
||||
//* Compare version
|
||||
if(gitVersion > VERSION) {
|
||||
global.UPDATEAVAIABLE = gitVersion
|
||||
constants.newVersion = gitVersion
|
||||
|
||||
console.log(CONSOLEPREFIX + chalk.cyan("New version avaiable: ") + chalk.red(`V${VERSION}`) + chalk.blue(' > ') + chalk.yellow(`V${gitVersion}`))
|
||||
|
||||
@@ -33,7 +31,9 @@ function checkForUpdate(sendNotification = false, sendNoUpdateInfo = false) {
|
||||
maximizable: false,
|
||||
minimizable: false,
|
||||
height: 500,
|
||||
minHeight: 500,
|
||||
width: 400,
|
||||
minWidth: 400,
|
||||
alwaysOnTop: true
|
||||
})
|
||||
|
||||
@@ -53,7 +53,7 @@ function checkForUpdate(sendNotification = false, sendNoUpdateInfo = false) {
|
||||
console.log(CONSOLEPREFIX + chalk.cyan("Up to date! ") + chalk.yellow(`V${VERSION}`))
|
||||
if(sendNoUpdateInfo) {
|
||||
const noUpdateAvaiableNotification = new Notification({
|
||||
title: 'YT Presence',
|
||||
title: 'PreMiD',
|
||||
body: `You are up to date! (V${VERSION})`,
|
||||
silent: true
|
||||
})
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>About YouTube Presence</title>
|
||||
<link rel="stylesheet" href="css/reset.css">
|
||||
<link rel="stylesheet" href="css/about.css">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 id="hello">Hi there!</h1>
|
||||
<img src="https://avatars2.githubusercontent.com/u/29104008?s=150">
|
||||
<div id="background"></div>
|
||||
<h1 id="name">Florian Metz</h1>
|
||||
<div id="nickname">
|
||||
<p>T</p>
|
||||
<p>i</p>
|
||||
<p>m</p>
|
||||
<p>e</p>
|
||||
<p>r</p>
|
||||
<p>a</p>
|
||||
<p>a</p>
|
||||
</div>
|
||||
<div id="aboutMe">
|
||||
<p>
|
||||
My name is <a href="https://github.com/Timeraa">Timeraa (Florian Metz)</a>. I am a Web developer, master a lot of
|
||||
known languages and i love the TV series
|
||||
called<br>
|
||||
<a href="https://en.wikipedia.org/wiki/My_Little_Pony:_Friendship_Is_Magic">My little Pony: Friendship is Magic</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div id="aboutYTP">
|
||||
<p>
|
||||
I started this project because i recently switched to <a href="https://music.youtube.com/">YouTube Music</a>, now
|
||||
i wanted to have <b>Rich Presence
|
||||
Integration</b> for <a href="https://discordapp.com/">Discord</a>, so i just started to create this. And now
|
||||
you can use it. :P
|
||||
</p>
|
||||
</div>
|
||||
<button id="supportMe">
|
||||
Support me!
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/anime.min.js"></script>
|
||||
<script src="js/preferences.js"></script>
|
||||
<script src="js/ripple.min.js"></script>
|
||||
|
||||
<script>if (window.module) module = window.module;</script>
|
||||
<script>
|
||||
var shell = require('electron').shell;
|
||||
//open links externally by default
|
||||
$(document).on('click', 'a[href^="http"]', function (event) {
|
||||
event.preventDefault();
|
||||
shell.openExternal(this.href);
|
||||
});
|
||||
|
||||
$('#supportMe').click(() => {
|
||||
shell.openExternal("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZU8Q766ACS2WS&lc=US");
|
||||
})
|
||||
|
||||
$(window).on("load", () => {
|
||||
$('html').addClass("ready")
|
||||
|
||||
anime.timeline({
|
||||
targets: 'img',
|
||||
scale: [
|
||||
{ value: 0, duration: 0 },
|
||||
{ value: 1.25, duration: 1000 },
|
||||
{ value: 1, duration: 500 }
|
||||
],
|
||||
easing: 'easeInOutExpo',
|
||||
}).add({
|
||||
targets: '#background',
|
||||
scale: [0, 20],
|
||||
duration: 750,
|
||||
offset: 900
|
||||
}).add({
|
||||
targets: '#hello',
|
||||
translateY: [75, -25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 2000,
|
||||
offset: 750
|
||||
}).add({
|
||||
targets: '#name',
|
||||
translateY: [0, 25],
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 2000,
|
||||
offset: 900
|
||||
}).add({
|
||||
targets: '#nickname p',
|
||||
opacity: [0, 1],
|
||||
duration: 500,
|
||||
color: ['rgba(0,0,0,0)', 'rgb(0, 150, 200)', '#fff'],
|
||||
delay: function (el, i) {
|
||||
return 2500 + 75 * i
|
||||
},
|
||||
offset: 0
|
||||
}).add({
|
||||
targets: '#aboutMe',
|
||||
translateY: [-25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0.75, 1],
|
||||
easing: 'easeInOutSine',
|
||||
duration: 1500,
|
||||
offset: 3250
|
||||
}).add({
|
||||
targets: '#aboutYTP',
|
||||
translateY: [-25, 0],
|
||||
opacity: [0, 1],
|
||||
scale: [0.75, 1],
|
||||
easing: 'easeInOutSine',
|
||||
duration: 1500,
|
||||
offset: 4500
|
||||
}).add({
|
||||
targets: '#supportMe',
|
||||
opacity: [0, 1],
|
||||
scale: [0, 1],
|
||||
duration: 1500,
|
||||
offset: 5000
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,99 +0,0 @@
|
||||
* {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
html:not(.ready) * {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#background {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
background-color: #1d1d1d;
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
border-radius: 50%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: 35px;
|
||||
}
|
||||
|
||||
#name {
|
||||
margin-top: 150px;
|
||||
}
|
||||
|
||||
#nickname p {
|
||||
position: relative;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
width: 150px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
#aboutMe,
|
||||
#aboutYTP {
|
||||
width: 380px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
a {
|
||||
position: relative;
|
||||
color: rgb(0, 150, 255);
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a:after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
height: 2px;
|
||||
width: 0;
|
||||
transition: width 0.25s ease-out;
|
||||
background-color: rgb(0, 125, 255);
|
||||
}
|
||||
|
||||
a:hover:after {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
p {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
button {
|
||||
transition: 0.25s all ease-out;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
background-color: rgb(0, 160, 255);
|
||||
color: white;
|
||||
width: 150px;
|
||||
height: 35px;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
outline: none;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: rgb(0, 175, 255);
|
||||
box-shadow: 0 0 5px 3px rgba(0, 174, 255, 0.5);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
html {
|
||||
transition: 0.5s background-color ease-out;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
#header img {
|
||||
margin: 5px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
#header h1 {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
top: 10px;
|
||||
position: absolute;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
#options {
|
||||
border-collapse: collapse;
|
||||
width: 90%;
|
||||
margin-left: 5%;
|
||||
margin-right: 5%;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
#options th:nth-child(1) {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
#options th:nth-child(2) {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
#options tbody tr {
|
||||
transition: 1s color ease-in-out, 0.75s border ease-out;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
#options tbody tr:not(:last-child) {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: #ce1d2a;
|
||||
color: white;
|
||||
height: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#footer #close-btn {
|
||||
position: relative;
|
||||
transition: background-color 0.2s ease-out;
|
||||
margin: 5px;
|
||||
appearance: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
color: white;
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
border-radius: 5px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#footer #close-btn:hover {
|
||||
background-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
html,
|
||||
body {
|
||||
background-color: #282828;
|
||||
color: white;
|
||||
}
|
||||
|
||||
#header {
|
||||
background-color: #ce1d2a;
|
||||
background-color: #596cae;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
@@ -26,7 +32,7 @@
|
||||
#footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
background-color: #ce1d2a;
|
||||
background-color: #596cae;
|
||||
color: white;
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
|
||||
33
src/windows/js/anime.min.js
vendored
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
2017 Julian Garnier
|
||||
Released under the MIT license
|
||||
*/
|
||||
var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||||
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++};
|
||||
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return r<e.length?{done:!1,value:e[r++]}:{done:!0}})};
|
||||
$jscomp.iteratorPrototype=function(e){$jscomp.initSymbolIterator();e={next:e};e[$jscomp.global.Symbol.iterator]=function(){return this};return e};$jscomp.array=$jscomp.array||{};$jscomp.iteratorFromArray=function(e,r){$jscomp.initSymbolIterator();e instanceof String&&(e+="");var p=0,m={next:function(){if(p<e.length){var u=p++;return{value:r(u,e[u]),done:!1}}m.next=function(){return{done:!0,value:void 0}};return m.next()}};m[Symbol.iterator]=function(){return m};return m};
|
||||
$jscomp.polyfill=function(e,r,p,m){if(r){p=$jscomp.global;e=e.split(".");for(m=0;m<e.length-1;m++){var u=e[m];u in p||(p[u]={});p=p[u]}e=e[e.length-1];m=p[e];r=r(m);r!=m&&null!=r&&$jscomp.defineProperty(p,e,{configurable:!0,writable:!0,value:r})}};$jscomp.polyfill("Array.prototype.keys",function(e){return e?e:function(){return $jscomp.iteratorFromArray(this,function(e){return e})}},"es6-impl","es3");var $jscomp$this=this;
|
||||
(function(e,r){"function"===typeof define&&define.amd?define([],r):"object"===typeof module&&module.exports?module.exports=r():e.anime=r()})(this,function(){function e(a){if(!h.col(a))try{return document.querySelectorAll(a)}catch(c){}}function r(a,c){for(var d=a.length,b=2<=arguments.length?arguments[1]:void 0,f=[],n=0;n<d;n++)if(n in a){var k=a[n];c.call(b,k,n,a)&&f.push(k)}return f}function p(a){return a.reduce(function(a,d){return a.concat(h.arr(d)?p(d):d)},[])}function m(a){if(h.arr(a))return a;
|
||||
h.str(a)&&(a=e(a)||a);return a instanceof NodeList||a instanceof HTMLCollection?[].slice.call(a):[a]}function u(a,c){return a.some(function(a){return a===c})}function C(a){var c={},d;for(d in a)c[d]=a[d];return c}function D(a,c){var d=C(a),b;for(b in a)d[b]=c.hasOwnProperty(b)?c[b]:a[b];return d}function z(a,c){var d=C(a),b;for(b in c)d[b]=h.und(a[b])?c[b]:a[b];return d}function T(a){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,c,d,k){return c+c+d+d+k+k});var c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
|
||||
a=parseInt(c[1],16);var d=parseInt(c[2],16),c=parseInt(c[3],16);return"rgba("+a+","+d+","+c+",1)"}function U(a){function c(a,c,b){0>b&&(b+=1);1<b&&--b;return b<1/6?a+6*(c-a)*b:.5>b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+
|
||||
255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1<a.indexOf("translate")||"perspective"===a)return"px";if(-1<a.indexOf("rotate")||-1<a.indexOf("skew"))return"deg"}function I(a,c){return h.fnc(a)?a(c.target,c.id,c.total):a}function E(a,c){if(c in a.style)return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function J(a,c){if(h.dom(a)&&
|
||||
u(W,c))return"transform";if(h.dom(a)&&(a.getAttribute(c)||h.svg(a)&&a[c]))return"attribute";if(h.dom(a)&&"transform"!==c&&E(a,c))return"css";if(null!=a[c])return"object"}function X(a,c){var d=V(c),d=-1<c.indexOf("scale")?1:0+d;a=a.style.transform;if(!a)return d;for(var b=[],f=[],n=[],k=/(\w+)\((.+?)\)/g;b=k.exec(a);)f.push(b[1]),n.push(b[2]);a=r(n,function(a,b){return f[b]===c});return a.length?a[0]:d}function K(a,c){switch(J(a,c)){case "transform":return X(a,c);case "css":return E(a,c);case "attribute":return a.getAttribute(c)}return a[c]||
|
||||
0}function L(a,c){var d=/^(\*=|\+=|-=)/.exec(a);if(!d)return a;var b=y(a)||0;c=parseFloat(c);a=parseFloat(a.replace(d[0],""));switch(d[0][0]){case "+":return c+a+b;case "-":return c-a+b;case "*":return c*a+b}}function F(a,c){return Math.sqrt(Math.pow(c.x-a.x,2)+Math.pow(c.y-a.y,2))}function M(a){a=a.points;for(var c=0,d,b=0;b<a.numberOfItems;b++){var f=a.getItem(b);0<b&&(c+=F(d,f));d=f}return c}function N(a){if(a.getTotalLength)return a.getTotalLength();switch(a.tagName.toLowerCase()){case "circle":return 2*
|
||||
Math.PI*a.getAttribute("r");case "rect":return 2*a.getAttribute("width")+2*a.getAttribute("height");case "line":return F({x:a.getAttribute("x1"),y:a.getAttribute("y1")},{x:a.getAttribute("x2"),y:a.getAttribute("y2")});case "polyline":return M(a);case "polygon":var c=a.points;return M(a)+F(c.getItem(c.numberOfItems-1),c.getItem(0))}}function Y(a,c){function d(b){b=void 0===b?0:b;return a.el.getPointAtLength(1<=c+b?c+b:0)}var b=d(),f=d(-1),n=d(1);switch(a.property){case "x":return b.x;case "y":return b.y;
|
||||
case "angle":return 180*Math.atan2(n.y-f.y,n.x-f.x)/Math.PI}}function O(a,c){var d=/-?\d*\.?\d+/g,b;b=h.pth(a)?a.totalLength:a;if(h.col(b))if(h.rgb(b)){var f=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b=f?"rgba("+f[1]+",1)":b}else b=h.hex(b)?T(b):h.hsl(b)?U(b):void 0;else f=(f=y(b))?b.substr(0,b.length-f.length):b,b=c&&!/\s/g.test(b)?f+c:f;b+="";return{original:b,numbers:b.match(d)?b.match(d).map(Number):[0],strings:h.str(a)||c?b.split(d):[]}}function P(a){a=a?p(h.arr(a)?a.map(m):m(a)):[];return r(a,
|
||||
function(a,d,b){return b.indexOf(a)===d})}function Z(a){var c=P(a);return c.map(function(a,b){return{target:a,id:b,total:c.length}})}function aa(a,c){var d=C(c);if(h.arr(a)){var b=a.length;2!==b||h.obj(a[0])?h.fnc(c.duration)||(d.duration=c.duration/b):a={value:a}}return m(a).map(function(a,b){b=b?0:c.delay;a=h.obj(a)&&!h.pth(a)?a:{value:a};h.und(a.delay)&&(a.delay=b);return a}).map(function(a){return z(a,d)})}function ba(a,c){var d={},b;for(b in a){var f=I(a[b],c);h.arr(f)&&(f=f.map(function(a){return I(a,
|
||||
c)}),1===f.length&&(f=f[0]));d[b]=f}d.duration=parseFloat(d.duration);d.delay=parseFloat(d.delay);return d}function ca(a){return h.arr(a)?A.apply(this,a):Q[a]}function da(a,c){var d;return a.tweens.map(function(b){b=ba(b,c);var f=b.value,e=K(c.target,a.name),k=d?d.to.original:e,k=h.arr(f)?f[0]:k,w=L(h.arr(f)?f[1]:f,k),e=y(w)||y(k)||y(e);b.from=O(k,e);b.to=O(w,e);b.start=d?d.end:a.offset;b.end=b.start+b.delay+b.duration;b.easing=ca(b.easing);b.elasticity=(1E3-Math.min(Math.max(b.elasticity,1),999))/
|
||||
1E3;b.isPath=h.pth(f);b.isColor=h.col(b.from.original);b.isColor&&(b.round=1);return d=b})}function ea(a,c){return r(p(a.map(function(a){return c.map(function(b){var c=J(a.target,b.name);if(c){var d=da(b,a);b={type:c,property:b.name,animatable:a,tweens:d,duration:d[d.length-1].end,delay:d[0].delay}}else b=void 0;return b})})),function(a){return!h.und(a)})}function R(a,c,d,b){var f="delay"===a;return c.length?(f?Math.min:Math.max).apply(Math,c.map(function(b){return b[a]})):f?b.delay:d.offset+b.delay+
|
||||
b.duration}function fa(a){var c=D(ga,a),d=D(S,a),b=Z(a.targets),f=[],e=z(c,d),k;for(k in a)e.hasOwnProperty(k)||"targets"===k||f.push({name:k,offset:e.offset,tweens:aa(a[k],d)});a=ea(b,f);return z(c,{children:[],animatables:b,animations:a,duration:R("duration",a,c,d),delay:R("delay",a,c,d)})}function q(a){function c(){return window.Promise&&new Promise(function(a){return p=a})}function d(a){return g.reversed?g.duration-a:a}function b(a){for(var b=0,c={},d=g.animations,f=d.length;b<f;){var e=d[b],
|
||||
k=e.animatable,h=e.tweens,n=h.length-1,l=h[n];n&&(l=r(h,function(b){return a<b.end})[0]||l);for(var h=Math.min(Math.max(a-l.start-l.delay,0),l.duration)/l.duration,w=isNaN(h)?1:l.easing(h,l.elasticity),h=l.to.strings,p=l.round,n=[],m=void 0,m=l.to.numbers.length,t=0;t<m;t++){var x=void 0,x=l.to.numbers[t],q=l.from.numbers[t],x=l.isPath?Y(l.value,w*x):q+w*(x-q);p&&(l.isColor&&2<t||(x=Math.round(x*p)/p));n.push(x)}if(l=h.length)for(m=h[0],w=0;w<l;w++)p=h[w+1],t=n[w],isNaN(t)||(m=p?m+(t+p):m+(t+" "));
|
||||
else m=n[0];ha[e.type](k.target,e.property,m,c,k.id);e.currentValue=m;b++}if(b=Object.keys(c).length)for(d=0;d<b;d++)H||(H=E(document.body,"transform")?"transform":"-webkit-transform"),g.animatables[d].target.style[H]=c[d].join(" ");g.currentTime=a;g.progress=a/g.duration*100}function f(a){if(g[a])g[a](g)}function e(){g.remaining&&!0!==g.remaining&&g.remaining--}function k(a){var k=g.duration,n=g.offset,w=n+g.delay,r=g.currentTime,x=g.reversed,q=d(a);if(g.children.length){var u=g.children,v=u.length;
|
||||
if(q>=g.currentTime)for(var G=0;G<v;G++)u[G].seek(q);else for(;v--;)u[v].seek(q)}if(q>=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q<k)b(q);else if(q<=n&&0!==r&&(b(0),x&&e()),q>=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime=
|
||||
0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1<a&&v.splice(a,1);g.paused=!0};g.play=function(){g.paused&&(g.paused=!1,t=0,l=d(g.currentTime),v.push(g),B||ia())};g.reverse=function(){g.reversed=!g.reversed;t=0;l=d(g.currentTime)};g.restart=function(){g.pause();
|
||||
g.reset();g.play()};g.finished=m;g.reset();g.autoplay&&g.play();return g}var ga={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},S={duration:1E3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},W="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),H,h={arr:function(a){return Array.isArray(a)},obj:function(a){return-1<Object.prototype.toString.call(a).indexOf("Object")},
|
||||
pth:function(a){return h.obj(a)&&a.hasOwnProperty("totalLength")},svg:function(a){return a instanceof SVGElement},dom:function(a){return a.nodeType||h.svg(a)},str:function(a){return"string"===typeof a},fnc:function(a){return"function"===typeof a},und:function(a){return"undefined"===typeof a},hex:function(a){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a)},rgb:function(a){return/^rgb/.test(a)},hsl:function(a){return/^hsl/.test(a)},col:function(a){return h.hex(a)||h.rgb(a)||h.hsl(a)}},A=function(){function a(a,
|
||||
d,b){return(((1-3*b+3*d)*a+(3*b-6*d))*a+3*d)*a}return function(c,d,b,f){if(0<=c&&1>=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0===
|
||||
n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0<n?h=m:l=m;while(1e-7<Math.abs(n)&&10>++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25,
|
||||
.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)?
|
||||
d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;d<b;)v[d]&&v[d].tick(c),d++;a()}else cancelAnimationFrame(B),B=0}return a}();q.version="2.2.0";q.speed=1;q.running=v;q.remove=
|
||||
function(a){a=P(a);for(var c=v.length;c--;)for(var d=v[c],b=d.animations,f=b.length;f--;)u(a,b[f].animatable.target)&&(b.splice(f,1),b.length||d.pause())};q.getValue=K;q.path=function(a,c){var d=h.str(a)?e(a)[0]:a,b=c||100;return function(a){return{el:d,property:a,totalLength:N(d)*(b/100)}}};q.setDashoffset=function(a){var c=N(a);a.setAttribute("stroke-dasharray",c);return c};q.bezier=A;q.easings=Q;q.timeline=function(a){var c=q(a);c.pause();c.duration=0;c.add=function(d){c.children.forEach(function(a){a.began=
|
||||
!0;a.completed=!0});m(d).forEach(function(b){var d=z(b,D(S,a||{}));d.targets=d.targets||a.targets;b=c.duration;var e=d.offset;d.autoplay=!1;d.direction=c.direction;d.offset=h.und(e)?b:L(e,b);c.began=!0;c.completed=!0;c.seek(d.offset);d=q(d);d.began=!0;d.completed=!0;d.duration>b&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q});
|
||||
@@ -1,231 +0,0 @@
|
||||
//* Declare needed constants
|
||||
const remote = require('electron').remote
|
||||
const app = remote.app
|
||||
const AutoLaunch = require('auto-launch');
|
||||
const Config = require('electron-config')
|
||||
const userSettings = new Config({
|
||||
name: "userSettings"
|
||||
})
|
||||
|
||||
var togglePresence,
|
||||
toggleYouTube,
|
||||
toggleYouTubeMusic,
|
||||
toggleTitleMenubar;
|
||||
|
||||
$(() => {
|
||||
|
||||
var os = require('os')
|
||||
if (os.platform() == "darwin") {
|
||||
$('<tr><td class="noselect">Title menubar</td><td class="right"><label class="switch"><input class="toggleTitleMenubar" type="checkbox"><span class="slider round"></span></label></td></tr>').insertAfter('.soundcloudToggle')
|
||||
}
|
||||
|
||||
togglePresence = $(".togglePresence"),
|
||||
toggleYouTube = $(".toggleYouTube"),
|
||||
toggleYouTubeMusic = $(".toggleYouTubeMusic");
|
||||
toggleNetflix = $(".toggleNetflix");
|
||||
toggleTwitch = $(".toggleTwitch");
|
||||
toggleSoundCloud = $(".toggleSoundCloud");
|
||||
toggleTitleMenubar = $(".toggleTitleMenubar");
|
||||
toggleAutoLaunch = $(".toggleAutoLaunch");
|
||||
toggleAutoUpdate = $(".toggleAutoUpdate");
|
||||
|
||||
togglePresence.change(switchPresence);
|
||||
toggleYouTube.change(switchYouTube);
|
||||
toggleYouTubeMusic.change(switchYouTubeMusic);
|
||||
toggleTitleMenubar.change(switchTitleMenubar);
|
||||
toggleAutoLaunch.change(switchAutomaticStartup);
|
||||
toggleAutoUpdate.change(switchAutoUpdate);
|
||||
toggleNetflix.change(switchNetflix);
|
||||
toggleTwitch.change(switchTwitch);
|
||||
toggleSoundCloud.change(switchSoundCloud);
|
||||
|
||||
if (userSettings.get('enabled') == true) togglePresence.prop("checked", true)
|
||||
else {
|
||||
togglePresence.prop("checked", false)
|
||||
toggleYouTube.prop("checked", false)
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
toggleNetflix.prop("checked", false)
|
||||
toggleTwitch.prop("checked", false)
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
|
||||
toggleYouTube.attr("disabled", "disabled")
|
||||
toggleYouTubeMusic.attr("disabled", "disabled")
|
||||
toggleNetflix.attr("disabled", "disabled")
|
||||
toggleTwitch.attr("disabled", "disabled")
|
||||
toggleSoundCloud.attr("disabled", "disabled")
|
||||
toggleTitleMenubar.attr("disabled", "disabled")
|
||||
}
|
||||
|
||||
if (userSettings.get('youTube') == true) {
|
||||
toggleYouTube.prop("checked", true)
|
||||
toggleYouTube.removeAttr("disabled")
|
||||
} else toggleYouTube.prop("checked", false)
|
||||
|
||||
if (userSettings.get('youTubeMusic') == true) {
|
||||
toggleYouTubeMusic.prop("checked", true)
|
||||
toggleYouTubeMusic.removeAttr("disabled")
|
||||
} else toggleYouTubeMusic.prop("checked", false)
|
||||
|
||||
if (userSettings.get('netflix') == true) {
|
||||
toggleNetflix.prop("checked", true)
|
||||
toggleNetflix.removeAttr("disabled")
|
||||
} else toggleNetflix.prop("checked", false)
|
||||
|
||||
if (userSettings.get('twitch') == true) {
|
||||
toggleTwitch.prop("checked", true)
|
||||
toggleTwitch.removeAttr("disabled")
|
||||
} else toggleTwitch.prop("checked", false)
|
||||
|
||||
if (userSettings.get('soundcloud') == true) {
|
||||
toggleSoundCloud.prop("checked", true)
|
||||
toggleSoundCloud.removeAttr("disabled")
|
||||
} else toggleSoundCloud.prop("checked", false)
|
||||
|
||||
if (userSettings.get('titleMenubar') == true) {
|
||||
toggleTitleMenubar.prop("checked", true)
|
||||
toggleTitleMenubar.removeAttr("disabled")
|
||||
} else {
|
||||
toggleTitleMenubar.prop("checked", false)
|
||||
}
|
||||
|
||||
if (userSettings.get('autoLaunch') == true) {
|
||||
toggleAutoLaunch.prop("checked", true)
|
||||
toggleAutoLaunch.removeAttr("disabled")
|
||||
} else toggleAutoLaunch.prop("checked", false)
|
||||
|
||||
if (userSettings.get('autoUpdateCheck') == true) {
|
||||
toggleAutoUpdate.prop("checked", true)
|
||||
toggleAutoUpdate.removeAttr("disabled")
|
||||
} else toggleAutoUpdate.prop("checked", false)
|
||||
})
|
||||
|
||||
function switchPresence() {
|
||||
if (userSettings.get('enabled') == true) {
|
||||
userSettings.set('enabled', false);
|
||||
userSettings.set('youTube', false);
|
||||
userSettings.set('youTubeMusic', false);
|
||||
userSettings.set('netflix', false);
|
||||
userSettings.set('soundcloud', false);
|
||||
|
||||
toggleYouTube.prop("checked", false)
|
||||
toggleYouTube.attr("disabled", "disabled")
|
||||
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
toggleYouTubeMusic.attr("disabled", "disabled")
|
||||
|
||||
toggleNetflix.prop("checked", false)
|
||||
toggleNetflix.attr("disabled", "disabled")
|
||||
|
||||
toggleTwitch.prop("checked", false)
|
||||
toggleTwitch.attr("disabled", "disabled")
|
||||
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
toggleSoundCloud.attr("disabled", "disabled")
|
||||
} else {
|
||||
userSettings.set('enabled', true);
|
||||
toggleYouTube.removeAttr("disabled")
|
||||
toggleYouTubeMusic.removeAttr("disabled")
|
||||
toggleNetflix.removeAttr("disabled")
|
||||
toggleTwitch.removeAttr("disabled")
|
||||
toggleSoundCloud.removeAttr("disabled")
|
||||
}
|
||||
}
|
||||
|
||||
function switchYouTube() {
|
||||
if (userSettings.get('youTube') == true) {
|
||||
userSettings.set('youTube', false)
|
||||
toggleYouTube.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('youTube', true)
|
||||
toggleYouTube.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchYouTubeMusic() {
|
||||
if (userSettings.get('youTubeMusic') == true) {
|
||||
userSettings.set('youTubeMusic', false);
|
||||
toggleYouTubeMusic.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('youTubeMusic', true);
|
||||
toggleYouTubeMusic.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchNetflix() {
|
||||
if (userSettings.get('netflix') == true) {
|
||||
userSettings.set('netflix', false);
|
||||
toggleNetflix.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('netflix', true);
|
||||
toggleNetflix.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchTwitch() {
|
||||
if (userSettings.get('twitch') == true) {
|
||||
userSettings.set('twitch', false);
|
||||
toggleTwitch.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('twitch', true);
|
||||
toggleTwitch.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchSoundCloud() {
|
||||
if (userSettings.get('soundcloud') == true) {
|
||||
userSettings.set('soundcloud', false);
|
||||
toggleSoundCloud.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('soundcloud', true);
|
||||
toggleSoundCloud.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchTitleMenubar() {
|
||||
if (userSettings.get('titleMenubar') == true) {
|
||||
userSettings.set('titleMenubar', false);
|
||||
toggleTitleMenubar.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('titleMenubar', true);
|
||||
toggleTitleMenubar.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchAutomaticStartup() {
|
||||
//* Add App to AutoLaunch
|
||||
let autoLaunch = new AutoLaunch({
|
||||
name: 'YT Presence',
|
||||
path: app.getPath('exe'),
|
||||
isHidden: true
|
||||
});
|
||||
|
||||
if (userSettings.get('autoLaunch') == true) {
|
||||
autoLaunch.isEnabled().then((isEnabled) => {
|
||||
if(isEnabled) autoLaunch.disable()
|
||||
}).catch((err) => {
|
||||
console.log("Error while adding App to autostart.")
|
||||
})
|
||||
|
||||
userSettings.set('autoLaunch', false);
|
||||
toggleAutoLaunch.prop("checked", false)
|
||||
} else {
|
||||
autoLaunch.isEnabled().then((isEnabled) => {
|
||||
if(!isEnabled) autoLaunch.enable()
|
||||
}).catch((err) => {
|
||||
console.log("Error while adding App to autostart.")
|
||||
})
|
||||
|
||||
userSettings.set('autoLaunch', true);
|
||||
toggleAutoLaunch.prop("checked", true)
|
||||
}
|
||||
}
|
||||
|
||||
function switchAutoUpdate() {
|
||||
if (userSettings.get('autoUpdateCheck') == true) {
|
||||
userSettings.set('autoUpdateCheck', false);
|
||||
toggleAutoUpdate.prop("checked", false)
|
||||
} else {
|
||||
userSettings.set('autoUpdateCheck', true);
|
||||
toggleAutoUpdate.prop("checked", true)
|
||||
}
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Preferences • YT Presence</title>
|
||||
<link href="css/reset.css" rel="stylesheet">
|
||||
<link href="css/preferences.css" rel="stylesheet">
|
||||
<link href="css/inputs.css" rel="stylesheet">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<img draggable="false" src="../assets/images/logo.png">
|
||||
<h1>YT Presence</h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<table id="options">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Enabled</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="togglePresence" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>YouTube</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleYouTube" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="ytmToggle">
|
||||
<td>YouTube Music</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleYouTubeMusic" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="nflixToggle">
|
||||
<td>Netflix</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleNetflix" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="twitchToggle">
|
||||
<td>Twitch</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleTwitch" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="soundcloudToggle">
|
||||
<td>SoundCloud</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleSoundCloud" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Launch on system startup</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleAutoLaunch" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Automatically check for updates</td>
|
||||
<td>
|
||||
<label class="switch">
|
||||
<input class="toggleAutoUpdate" type="checkbox">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<button id="close-btn">
|
||||
Close
|
||||
<div class="rippleJS"></div>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<script>if (typeof module === 'object') { window.module = module; module = undefined; }</script>
|
||||
|
||||
<script src="js/jquery-3.3.1.min.js"></script>
|
||||
<script src="js/preferences.js"></script>
|
||||
<script src="js/ripple.min.js"></script>
|
||||
|
||||
<script>if (window.module) module = window.module;</script>
|
||||
<script>
|
||||
document.getElementById("close-btn").addEventListener("click", function (e) {
|
||||
var window = remote.getCurrentWindow();
|
||||
window.close();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,7 +1,7 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>YT Presence • Update avaiable!</title>
|
||||
<title>PreMiD • Update avaiable!</title>
|
||||
<link rel="stylesheet" href="css/reset.css">
|
||||
<link rel="stylesheet" href="css/update.css">
|
||||
<link href="css/ripple.css" rel="stylesheet">
|
||||
@@ -10,7 +10,7 @@
|
||||
<body>
|
||||
<div id="header">
|
||||
<img draggable="false" src="../assets/images/logo.png">
|
||||
<h1>YT Presence</h1>
|
||||
<h1>PreMiD</h1>
|
||||
</div>
|
||||
<div id="content">
|
||||
<p id="description"></p>
|
||||
|
||||