|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
@@ -19,40 +19,40 @@
|
|
|
|
|
<hr style="max-width: 800px; margin: 1em 0;">
|
|
|
|
|
|
|
|
|
|
<div style="margin-bottom: 1.5em;">
|
|
|
|
|
<button class="jellyfin-tab-button active" onclick="showTab('basic', this)"
|
|
|
|
|
<button class="seasonals-tab-button active" onclick="showSeasonalsTab('seasonals-basic', this)"
|
|
|
|
|
style="background: none; border: none; color: #fff; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid #00a4dc;">
|
|
|
|
|
<h3>General Settings</h3>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="jellyfin-tab-button" onclick="showTab('auto-selection', this)"
|
|
|
|
|
<button class="seasonals-tab-button" onclick="showSeasonalsTab('seasonals-auto-selection', this)"
|
|
|
|
|
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
|
|
|
|
|
<h3>Auto Selection</h3>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="jellyfin-tab-button" onclick="showTab('advanced', this)"
|
|
|
|
|
<button class="seasonals-tab-button" onclick="showSeasonalsTab('seasonals-advanced', this)"
|
|
|
|
|
style="background: none; border: none; color: #ccc; cursor: pointer; transition: color 0.3s, border-bottom 0.3s; padding: 0.5em 1em; border-bottom: 2px solid transparent;">
|
|
|
|
|
<h3>Advanced Settings</h3>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form id="SeasonalsConfigForm">
|
|
|
|
|
<!-- General Tab -->
|
|
|
|
|
<div id="general" class="tab-content">
|
|
|
|
|
<!-- BASIC Tab -->
|
|
|
|
|
<div id="seasonals-basic" class="seasonals-tab-content">
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="IsEnabled" name="IsEnabled" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<input id="SeasonalsIsEnabled" name="SeasonalsIsEnabled" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Enable Seasonals</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">Enable or disable the entire plugin functionality.</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="AutomateSeasonSelection" name="AutomateSeasonSelection" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<input id="SeasonalsAutomateSeasonSelection" name="SeasonalsAutomateSeasonSelection" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Automate Season Selection</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">If enabled, the plugin will use the rules defined in the "Auto Selection" tab to assume the season. If no rule matches, it falls back to the "Standard Season" below.</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="selectContainer">
|
|
|
|
|
<label class="selectLabel" for="SelectedSeason">Standard Season</label>
|
|
|
|
|
<select is="emby-select" id="SelectedSeason" name="SelectedSeason" class="selectLayout emby-select-withcolor emby-select" style="width: 100%; -webkit-appearance: menulist; appearance: menulist;">
|
|
|
|
|
<label class="selectLabel" for="SeasonalsSelectedSeason">Standard Season</label>
|
|
|
|
|
<select is="emby-select" id="SeasonalsSelectedSeason" name="SeasonalsSelectedSeason" class="selectLayout emby-select-withcolor emby-select" style="width: 100%; -webkit-appearance: menulist; appearance: menulist;">
|
|
|
|
|
<option value="none">None</option>
|
|
|
|
|
<option value="snowflakes">Snowflakes</option>
|
|
|
|
|
<option value="snowfall">Snowfall</option>
|
|
|
|
|
@@ -78,7 +78,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="EnableClientSideToggle" name="EnableClientSideToggle" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<input id="SeasonalsEnableClientSideToggle" name="SeasonalsEnableClientSideToggle" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Allow Client-Side Toggle</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">If enabled, users will see a seasonals icon in the header to toggle seasonals for their browser (device-specific).</div>
|
|
|
|
|
@@ -86,7 +86,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Auto Selection Tab -->
|
|
|
|
|
<div id="auto-selection" class="tab-content" style="display: none;">
|
|
|
|
|
<div id="seasonals-auto-selection" class="seasonals-tab-content" style="display: none;">
|
|
|
|
|
<div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin-bottom: 1.5em;">
|
|
|
|
|
<h3>Auto Selection Rules</h3>
|
|
|
|
|
<p>Define rules to automatically select a season based on the date. Rules are evaluated from top to bottom. The first matching rule wins.</p>
|
|
|
|
|
@@ -96,14 +96,14 @@
|
|
|
|
|
<!-- Rules will be injected here via JS -->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button is="emby-button" type="button" class="raised block" onclick="SeasonalsConfigPage.addRule()">
|
|
|
|
|
<i class="md-icon button-icon button-icon-left">add</i>
|
|
|
|
|
<button is="emby-button" type="button" class="raised button-accent block" onclick="SeasonalsConfigPage.addRule();">
|
|
|
|
|
<i class="material-icons button-icon button-icon-left">add</i>
|
|
|
|
|
<span>Add Rule</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Advanced Tab -->
|
|
|
|
|
<div id="advanced" class="tab-content" style="display: none;">
|
|
|
|
|
<div id="seasonals-advanced" class="seasonals-tab-content" style="display: none;">
|
|
|
|
|
<p>Configure specific settings for each seasonal theme below.</p>
|
|
|
|
|
<p>All symbol count settings add this number in addition to the standard 12 symbols (if additional symbols is enabled).</p>
|
|
|
|
|
<details>
|
|
|
|
|
@@ -533,6 +533,44 @@
|
|
|
|
|
<div class="fieldDescription">Maximum time the bunny waits before appearing again.</div>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
|
|
|
|
<hr style="max-width: 800px; margin: 1em 0;">
|
|
|
|
|
|
|
|
|
|
<details>
|
|
|
|
|
<summary>Resurrection</summary>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="EnableResurrection" name="EnableResurrection" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Enable Resurrection Seasonal</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">Enable the Resurrection theme in general (e.g. for automation).</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="EnableRandomResurrection" name="EnableRandomResurrection" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Enable Additional Random Symbols</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">Displays additional symbols randomly distributed across the screen.</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="EnableRandomResurrectionMobile" name="EnableRandomResurrectionMobile" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Enable Additional Random Symbols on Mobile</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">Displays additional symbols randomly distributed across the screen on mobile devices. Warning: High values may affect performance.</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="inputContainer">
|
|
|
|
|
<label class="inputLabel" for="ResurrectionSymbolCount">Symbol Count</label>
|
|
|
|
|
<input is="emby-input" type="number" id="ResurrectionSymbolCount" name="ResurrectionSymbolCount" />
|
|
|
|
|
<div class="fieldDescription">Number of additional symbols (if enabled).</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
|
<input id="EnableDifferentDurationResurrection" name="EnableDifferentDurationResurrection" type="checkbox" is="emby-checkbox" />
|
|
|
|
|
<span>Enable Different Duration</span>
|
|
|
|
|
</label>
|
|
|
|
|
<div class="fieldDescription">Randomize the movement speed.</div>
|
|
|
|
|
</div>
|
|
|
|
|
</details>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="background-color: rgba(255, 255, 255, 0.05); border-left: 4px solid #00a4dc; border-radius: 4px; padding: 1em 1.5em; margin: 1.5em 0; display: flex; align-items: center; gap: 1em;">
|
|
|
|
|
@@ -584,7 +622,7 @@
|
|
|
|
|
.date-range-group {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
}
|
|
|
|
|
@media (max-width: 800px) {
|
|
|
|
|
.seasonal-rule-content {
|
|
|
|
|
@@ -593,7 +631,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Styles for the Tabs */
|
|
|
|
|
.jellyfin-tab-button.active {
|
|
|
|
|
.seasonals-tab-button.active {
|
|
|
|
|
color: #fff !important;
|
|
|
|
|
border-bottom: 2px solid #00a4dc !important;
|
|
|
|
|
}
|
|
|
|
|
@@ -604,11 +642,11 @@
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script>
|
|
|
|
|
function showTab(tabId, btn) {
|
|
|
|
|
document.querySelectorAll('.tab-content').forEach(el => el.style.display = 'none');
|
|
|
|
|
function showSeasonalsTab(tabId, btn) {
|
|
|
|
|
document.querySelectorAll('.seasonals-tab-content').forEach(el => el.style.display = 'none');
|
|
|
|
|
document.getElementById(tabId).style.display = 'block';
|
|
|
|
|
|
|
|
|
|
document.querySelectorAll('.jellyfin-tab-button').forEach(b => {
|
|
|
|
|
document.querySelectorAll('.seasonals-tab-button').forEach(b => {
|
|
|
|
|
b.classList.remove('active');
|
|
|
|
|
b.style.color = '#ccc';
|
|
|
|
|
b.style.borderBottom = '2px solid transparent';
|
|
|
|
|
@@ -629,12 +667,12 @@
|
|
|
|
|
var div = document.createElement('div');
|
|
|
|
|
div.className = 'seasonal-rule';
|
|
|
|
|
|
|
|
|
|
var name = data ? data.Name : 'New Rule';
|
|
|
|
|
var startDay = data ? data.StartDay : 1;
|
|
|
|
|
var startMonth = data ? data.StartMonth : 1;
|
|
|
|
|
var endDay = data ? data.EndDay : 1;
|
|
|
|
|
var endMonth = data ? data.EndMonth : 1;
|
|
|
|
|
var theme = data ? data.Theme : 'snowflakes';
|
|
|
|
|
var name = data ? (data.Name || data.name || 'New Rule') : 'New Rule';
|
|
|
|
|
var startDay = data ? (data.StartDay !== undefined ? data.StartDay : (data.startDay !== undefined ? data.startDay : 1)) : 1;
|
|
|
|
|
var startMonth = data ? (data.StartMonth !== undefined ? data.StartMonth : (data.startMonth !== undefined ? data.startMonth : 1)) : 1;
|
|
|
|
|
var endDay = data ? (data.EndDay !== undefined ? data.EndDay : (data.endDay !== undefined ? data.endDay : 1)) : 1;
|
|
|
|
|
var endMonth = data ? (data.EndMonth !== undefined ? data.EndMonth : (data.endMonth !== undefined ? data.endMonth : 1)) : 1;
|
|
|
|
|
var theme = data ? (data.Theme || data.theme || 'snowflakes') : 'snowflakes';
|
|
|
|
|
|
|
|
|
|
div.innerHTML = `
|
|
|
|
|
<div class="seasonal-rule-header">
|
|
|
|
|
@@ -737,10 +775,10 @@
|
|
|
|
|
.addEventListener('pageshow', function() {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
ApiClient.getPluginConfiguration(SeasonalsConfigPage.pluginUniqueId).then(function (config) {
|
|
|
|
|
document.querySelector('#IsEnabled').checked = config.IsEnabled;
|
|
|
|
|
document.querySelector('#SelectedSeason').value = config.SelectedSeason;
|
|
|
|
|
document.querySelector('#AutomateSeasonSelection').checked = config.AutomateSeasonSelection;
|
|
|
|
|
document.querySelector('#EnableClientSideToggle').checked = config.EnableClientSideToggle !== undefined ? config.EnableClientSideToggle : true;
|
|
|
|
|
document.querySelector('#SeasonalsIsEnabled').checked = config.IsEnabled;
|
|
|
|
|
document.querySelector('#SeasonalsSelectedSeason').value = config.SelectedSeason;
|
|
|
|
|
document.querySelector('#SeasonalsAutomateSeasonSelection').checked = config.AutomateSeasonSelection;
|
|
|
|
|
document.querySelector('#SeasonalsEnableClientSideToggle').checked = config.EnableClientSideToggle !== undefined ? config.EnableClientSideToggle : true;
|
|
|
|
|
|
|
|
|
|
// Load Rules
|
|
|
|
|
try {
|
|
|
|
|
@@ -835,6 +873,13 @@
|
|
|
|
|
document.querySelector('#MinBunnyRestTime').value = config.Easter.MinBunnyRestTime;
|
|
|
|
|
document.querySelector('#MaxBunnyRestTime').value = config.Easter.MaxBunnyRestTime;
|
|
|
|
|
|
|
|
|
|
// Resurrection
|
|
|
|
|
document.querySelector('#EnableResurrection').checked = config.Resurrection.EnableResurrection;
|
|
|
|
|
document.querySelector('#ResurrectionSymbolCount').value = config.Resurrection.SymbolCount;
|
|
|
|
|
document.querySelector('#EnableRandomResurrection').checked = config.Resurrection.EnableRandomSymbols;
|
|
|
|
|
document.querySelector('#EnableRandomResurrectionMobile').checked = config.Resurrection.EnableRandomSymbolsMobile;
|
|
|
|
|
document.querySelector('#EnableDifferentDurationResurrection').checked = config.Resurrection.EnableDifferentDuration;
|
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
@@ -843,10 +888,10 @@
|
|
|
|
|
.addEventListener('submit', function(e) {
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
ApiClient.getPluginConfiguration(SeasonalsConfigPage.pluginUniqueId).then(function (config) {
|
|
|
|
|
config.IsEnabled = document.querySelector('#IsEnabled').checked;
|
|
|
|
|
config.SelectedSeason = document.querySelector('#SelectedSeason').value;
|
|
|
|
|
config.AutomateSeasonSelection = document.querySelector('#AutomateSeasonSelection').checked;
|
|
|
|
|
config.EnableClientSideToggle = document.querySelector('#EnableClientSideToggle').checked;
|
|
|
|
|
config.IsEnabled = document.querySelector('#SeasonalsIsEnabled').checked;
|
|
|
|
|
config.SelectedSeason = document.querySelector('#SeasonalsSelectedSeason').value;
|
|
|
|
|
config.AutomateSeasonSelection = document.querySelector('#SeasonalsAutomateSeasonSelection').checked;
|
|
|
|
|
config.EnableClientSideToggle = document.querySelector('#SeasonalsEnableClientSideToggle').checked;
|
|
|
|
|
|
|
|
|
|
// Save Rules
|
|
|
|
|
config.SeasonalRules = JSON.stringify(SeasonalsConfigPage.getRulesFromUI());
|
|
|
|
|
@@ -935,10 +980,17 @@
|
|
|
|
|
config.Easter.MinBunnyRestTime = parseInt(document.querySelector('#MinBunnyRestTime').value);
|
|
|
|
|
config.Easter.MaxBunnyRestTime = parseInt(document.querySelector('#MaxBunnyRestTime').value);
|
|
|
|
|
|
|
|
|
|
// Resurrection
|
|
|
|
|
config.Resurrection.EnableResurrection = document.querySelector('#EnableResurrection').checked;
|
|
|
|
|
config.Resurrection.SymbolCount = parseInt(document.querySelector('#ResurrectionSymbolCount').value);
|
|
|
|
|
config.Resurrection.EnableRandomSymbols = document.querySelector('#EnableRandomResurrection').checked;
|
|
|
|
|
config.Resurrection.EnableRandomSymbolsMobile = document.querySelector('#EnableRandomResurrectionMobile').checked;
|
|
|
|
|
config.Resurrection.EnableDifferentDuration = document.querySelector('#EnableDifferentDurationResurrection').checked;
|
|
|
|
|
|
|
|
|
|
ApiClient.updatePluginConfiguration(SeasonalsConfigPage.pluginUniqueId, config).then(function (result) {
|
|
|
|
|
Dashboard.processPluginConfigurationUpdateResult(result);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
return false;
|
|
|
|
|
|