jellyfin-smart-playlist/Jellyfin.Plugin.SmartPlaylist/configPage.html

61 lines
2.6 KiB
HTML
Raw Permalink Normal View History

2024-06-27 01:47:44 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SmartPlaylist</title>
2024-06-27 01:47:44 +02:00
</head>
<body>
<div id="SmartPlaylistConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox">
2024-06-27 01:47:44 +02:00
<div data-role="content">
<div class="content-primary">
<form id="SmartPlaylistConfigForm">
2024-06-27 01:47:44 +02:00
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="InitialProgram">Initial Program</label>
<div class="fieldDescription">A program which can set up the environment</div>
<textarea id="InitialProgram" class="emby-input smartplaylist-monospace" name="InitialProgram" rows="16" cols="120"></textarea>
2024-06-27 01:47:44 +02:00
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
</button>
</div>
</form>
</div>
</div>
<style>
.smartplaylist-monospace {
font-family: monospace;
}
</style>
2024-06-27 01:47:44 +02:00
<script type="text/javascript">
var SmartPlaylistConfig = {
2024-06-27 01:47:44 +02:00
pluginUniqueId: 'dd2326e3-4d3e-4bfc-80e6-28502c1131df'
};
document.querySelector('#SmartPlaylistConfigPage')
2024-06-27 01:47:44 +02:00
.addEventListener('pageshow', function() {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(SmartPlaylistConfig.pluginUniqueId).then(function (config) {
document.querySelector('#InitialProgram').value = config.InitialProgram;
2024-06-27 01:47:44 +02:00
Dashboard.hideLoadingMsg();
});
});
document.querySelector('#SmartPlaylistConfigForm')
2024-06-27 01:47:44 +02:00
.addEventListener('submit', function(e) {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(SmartPlaylistConfig.pluginUniqueId).then(function (config) {
config.InitialProgram = document.querySelector('#InitialProgram').value;
ApiClient.updatePluginConfiguration(SmartPlaylistConfig.pluginUniqueId, config).then(function (result) {
2024-06-27 01:47:44 +02:00
Dashboard.processPluginConfigurationUpdateResult(result);
});
});
e.preventDefault();
return false;
});
</script>
</div>
</body>
</html>