diff options
Diffstat (limited to 'Configuration/configPage.html')
-rw-r--r-- | Configuration/configPage.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/Configuration/configPage.html b/Configuration/configPage.html new file mode 100644 index 0000000..b72df9f --- /dev/null +++ b/Configuration/configPage.html @@ -0,0 +1,80 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <title>Template</title> +</head> +<body> +<div class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox" data-role="page" + id="TemplateConfigPage"> + <div data-role="content"> + <div class="content-primary"> + <form id="TemplateConfigForm"> + <div class="selectContainer"> + <label class="selectLabel" for="Options">Several Options</label> + <select class="emby-select-withcolor emby-select" id="Options" is="emby-select" name="Options"> + <option id="optOneOption" value="OneOption">One Option</option> + <option id="optAnotherOption" value="AnotherOption">Another Option</option> + </select> + </div> + <div class="inputContainer"> + <label class="inputLabel inputLabelUnfocused" for="AnInteger">An Integer</label> + <input id="AnInteger" is="emby-input" min="0" name="AnInteger" type="number"/> + <div class="fieldDescription">A Description</div> + </div> + <div class="checkboxContainer checkboxContainer-withDescription"> + <label class="emby-checkbox-label"> + <input id="TrueFalseSetting" is="emby-checkbox" name="TrueFalseCheckBox" type="checkbox"/> + <span>A Checkbox</span> + </label> + </div> + <div class="inputContainer"> + <label class="inputLabel inputLabelUnfocused" for="AString">A String</label> + <input id="AString" is="emby-input" name="AString" type="text"/> + <div class="fieldDescription">Another Description</div> + </div> + <div> + <button class="raised button-submit block emby-button" is="emby-button" type="submit"> + <span>Save</span> + </button> + </div> + </form> + </div> + </div> + <script type="text/javascript"> + var TemplateConfig = { + pluginUniqueId: 'eb5d7894-8eef-4b36-aa6f-5d124e828ce1' + }; + + document.querySelector('#TemplateConfigPage') + .addEventListener('pageshow', function () { + Dashboard.showLoadingMsg(); + ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) { + document.querySelector('#Options').value = config.Options; + document.querySelector('#AnInteger').value = config.AnInteger; + document.querySelector('#TrueFalseSetting').checked = config.TrueFalseSetting; + document.querySelector('#AString').value = config.AString; + Dashboard.hideLoadingMsg(); + }); + }); + + document.querySelector('#TemplateConfigForm') + .addEventListener('submit', function (e) { + Dashboard.showLoadingMsg(); + ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) { + config.Options = document.querySelector('#Options').value; + config.AnInteger = document.querySelector('#AnInteger').value; + config.TrueFalseSetting = document.querySelector('#TrueFalseSetting').checked; + config.AString = document.querySelector('#AString').value; + ApiClient.updatePluginConfiguration(TemplateConfig.pluginUniqueId, config).then(function (result) { + Dashboard.processPluginConfigurationUpdateResult(result); + }); + }); + + e.preventDefault(); + return false; + }); + </script> +</div> +</body> +</html> |