Plugin 1.3.0: Tasten Schlaf-Timer und Mini-Player

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-15 11:58:54 +01:00
co-authored by Claude Opus 5.5
parent 00047b9fa1
commit 6a73cef7ea
17 changed files with 204 additions and 16 deletions
@@ -47,6 +47,19 @@
<input type="number" id="seconds" min="1" max="300" />
</div>
<div class="row" data-for="sleepMinutes" hidden>
<label id="l-sleepMinutes" for="sleepMinutes"></label>
<select id="sleepMinutes">
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
<option value="60">60</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="-1" id="o-sleepEnd"></option>
</select>
</div>
<div class="row" data-for="tab" hidden>
<label id="l-tab" for="tab"></label>
<select id="tab">
@@ -85,7 +98,7 @@
en: {
target: 'Target tab', auto: 'Automatic (active tab)', step: 'Step (%)', volume: 'Volume (%)',
seconds: 'Seconds', tab: 'Switch to', toggle: 'Toggle YouTube / Music', playlist: 'Playlist',
playlistId: 'Playlist ID (manual)', showTitle: 'Show title on the key', showProgress: 'Show progress bar', reload: 'Reload',
playlistId: 'Playlist ID (manual)', showTitle: 'Show title on the key', showProgress: 'Show progress bar', sleepMinutes: 'Minutes', sleepEnd: 'End of song', reload: 'Reload',
choose: '- choose a playlist -', loading: 'Loading playlists ...',
offline: 'Playtube is not running or too old (needs the newer version with Stream Dock support).',
failed: 'Playlists could not be read. Is YouTube Music loaded in Playtube?', count: 'playlists found'
@@ -93,7 +106,7 @@
de: {
target: 'Ziel-Tab', auto: 'Automatisch (aktiver Tab)', step: 'Schrittweite (%)', volume: 'Lautstärke (%)',
seconds: 'Sekunden', tab: 'Wechseln zu', toggle: 'YouTube / Musik umschalten', playlist: 'Playlist',
playlistId: 'Playlist-ID (manuell)', showTitle: 'Titel auf der Taste anzeigen', showProgress: 'Fortschrittsbalken anzeigen', reload: 'Neu laden',
playlistId: 'Playlist-ID (manuell)', showTitle: 'Titel auf der Taste anzeigen', showProgress: 'Fortschrittsbalken anzeigen', sleepMinutes: 'Minuten', sleepEnd: 'Ende des Songs', reload: 'Neu laden',
choose: '- Playlist wählen -', loading: 'Playlists werden geladen ...',
offline: 'Playtube läuft nicht oder ist zu alt (benötigt die neuere Version mit Stream-Dock-Unterstützung).',
failed: 'Playlists konnten nicht gelesen werden. Ist YouTube Musik in Playtube geladen?', count: 'Playlists gefunden'
@@ -104,7 +117,7 @@
volumeup: ['target', 'step'], volumedown: ['target', 'step'], volumeset: ['target', 'volume'],
seekback: ['target', 'seconds'], seekforward: ['target', 'seconds'],
playpause: ['target', 'showTitle'], nowplaying: ['target', 'showTitle', 'showProgress'],
playlist: ['playlist'], switchtab: ['tab'], show: []
playlist: ['playlist'], switchtab: ['tab'], sleep: ['sleepMinutes'], mini: [], show: []
};
var DEFAULT_FIELDS = ['target'];
@@ -147,11 +160,12 @@
window.connectElgatoStreamDeckSocket = connectElgatoStreamDeckSocket;
function applyTexts() {
['target', 'step', 'volume', 'seconds', 'tab', 'playlist', 'playlistId', 'showTitle', 'showProgress'].forEach(function (key) {
['target', 'step', 'volume', 'seconds', 'tab', 'playlist', 'playlistId', 'showTitle', 'showProgress', 'sleepMinutes'].forEach(function (key) {
$('l-' + key).textContent = t[key];
});
$('o-auto').textContent = t.auto;
$('o-toggle').textContent = t.toggle;
$('o-sleepEnd').textContent = t.sleepEnd;
$('reload').textContent = t.reload;
}
@@ -168,6 +182,7 @@
$('volume').value = settings.volume === undefined ? 30 : settings.volume;
$('seconds').value = settings.seconds || 10;
$('tab').value = settings.tab || 'toggle';
$('sleepMinutes').value = String(settings.sleepMinutes || 30);
$('playlistId').value = settings.playlistId || '';
var defaultShow = actionId() === 'nowplaying';
$('showTitle').checked = settings.showTitle === undefined
@@ -184,6 +199,7 @@
volume: Number($('volume').value),
seconds: Number($('seconds').value) || 10,
tab: $('tab').value,
sleepMinutes: Number($('sleepMinutes').value) || 30,
playlistId: $('playlistId').value.trim(),
showTitle: $('showTitle').checked,
showProgress: $('showProgress').checked
@@ -244,7 +260,7 @@
save({ playlistTitle: select.value ? select.options[select.selectedIndex].textContent : '' });
});
$('reload').addEventListener('click', requestPlaylists);
['target', 'step', 'volume', 'seconds', 'tab', 'showTitle', 'showProgress'].forEach(function (id) {
['target', 'step', 'volume', 'seconds', 'tab', 'showTitle', 'showProgress', 'sleepMinutes'].forEach(function (id) {
$(id).addEventListener('input', function () { save(); });
$(id).addEventListener('change', function () { save(); });
});