Add warning and hide option when injection fails (#315)
* Add warning and hide option when injection fails * Update configPage.html * Update configPage.html --------- Co-authored-by: rlauu <46294892+rlauu@users.noreply.github.com>
This commit is contained in:
parent
2ed22338e7
commit
d2dc8daaed
@ -139,6 +139,11 @@ public class PluginConfiguration : BasePluginConfiguration
|
||||
/// </summary>
|
||||
public bool SkipButtonVisible { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to show the skip intro warning.
|
||||
/// </summary>
|
||||
public bool SkipButtonWarning { get => WarningManager.HasFlag(PluginWarning.UnableToAddSkipButton); }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether introductions should be automatically skipped.
|
||||
/// </summary>
|
||||
|
@ -416,7 +416,11 @@
|
||||
<input id="ClientList" type="hidden" is="emby-input" />
|
||||
</details>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<div id="warningMessage" style="color: #721c24; background-color: #f7cf1f; border: 1px solid #f5c6cb; border-radius: 4px; padding: 10px; margin-bottom: 10px;">
|
||||
Failed to add skip button to web interface. See <a href="https://github.com/intro-skipper/intro-skipper/wiki/Troubleshooting#skip-button-is-not-visible" target="_blank" rel="noopener noreferrer">troubleshooting guide</a> for the most common issues.
|
||||
</div>
|
||||
|
||||
<div id="SkipButtonContainer" class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label class="emby-checkbox-label">
|
||||
<input id="SkipButtonVisible" type="checkbox" is="emby-checkbox" />
|
||||
<span>Show skip intro button</span>
|
||||
@ -429,7 +433,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<div id="PersistContainer" class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label class="emby-checkbox-label">
|
||||
<input id="PersistSkipButton" type="checkbox" is="emby-checkbox" />
|
||||
<span>Display button for intro duration</span>
|
||||
@ -1296,6 +1300,13 @@
|
||||
document.querySelector("#" + field).checked = config[field];
|
||||
}
|
||||
|
||||
if (config["SkipButtonWarning"]) {
|
||||
document.getElementById("SkipButtonContainer").style.display = 'none';
|
||||
document.getElementById("PersistContainer").style.display = 'none';
|
||||
} else {
|
||||
document.getElementById("warningMessage").style.display = 'none';
|
||||
}
|
||||
|
||||
populateLibraries();
|
||||
selectAllLibrariesChanged();
|
||||
autoSkipChanged();
|
||||
|
Loading…
x
Reference in New Issue
Block a user