2019-02-21 01:57:43 -08:00
|
|
|
<!DOCTYPE html>
|
2019-03-10 08:55:35 +09:00
|
|
|
<html lang="en">
|
2019-02-21 01:57:43 -08:00
|
|
|
<head>
|
2019-11-27 03:13:09 +09:00
|
|
|
<meta charset="utf-8">
|
2019-03-10 08:55:35 +09:00
|
|
|
<title>Template</title>
|
2019-02-21 01:57:43 -08:00
|
|
|
</head>
|
|
|
|
<body>
|
2019-03-10 08:59:36 +09:00
|
|
|
<div id="TemplateConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox">
|
2019-03-10 08:55:35 +09:00
|
|
|
<div data-role="content">
|
|
|
|
<div class="content-primary">
|
2019-03-10 08:59:36 +09:00
|
|
|
<form id="TemplateConfigForm">
|
2019-03-10 08:55:35 +09:00
|
|
|
<div class="selectContainer">
|
2019-03-10 08:59:36 +09:00
|
|
|
<label class="selectLabel" for="Options">Several Options</label>
|
2019-03-10 08:55:35 +09:00
|
|
|
<select is="emby-select" id="Options" name="Options" class="emby-select-withcolor emby-select">
|
|
|
|
<option id="optOneOption" value="OneOption">One Option</option>
|
|
|
|
<option id="optAnotherOption" value="AnotherOption">Another Option</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
<div class="inputContainer">
|
|
|
|
<label class="inputeLabel inputLabelUnfocused" for="AnInteger">An Integer</label>
|
|
|
|
<input id="AnInteger" name="AnInteger" type="number" is="emby-input" min="0" />
|
2019-03-10 08:59:36 +09:00
|
|
|
<div class="fieldDescription">A Description</div>
|
2019-03-10 08:55:35 +09:00
|
|
|
</div>
|
|
|
|
<div class="checkboxContainer checkboxContainer-withDescripton">
|
|
|
|
<label class="emby-checkbox-label">
|
|
|
|
<input id="TrueFalseSetting" name="TrueFalseCheckBox" type="checkbox" is="emby-checkbox" />
|
2019-03-10 08:59:36 +09:00
|
|
|
<span>A Checkbox</span>
|
2019-03-10 08:55:35 +09:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div class="inputContainer">
|
|
|
|
<label class="inputeLabel inputLabelUnfocused" for="AString">A String</label>
|
|
|
|
<input id="AString" name="AString" type="text" is="emby-input" />
|
2019-03-10 08:59:36 +09:00
|
|
|
<div class="fieldDescription">Another Description</div>
|
2019-03-10 08:55:35 +09:00
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
|
|
|
|
<span>Save</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
2019-02-21 01:57:43 -08:00
|
|
|
</div>
|
2019-03-10 08:55:35 +09:00
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
2019-03-10 08:59:36 +09:00
|
|
|
var TemplateConfig = {
|
2019-03-10 08:55:35 +09:00
|
|
|
pluginUniqueId: 'eb5d7894-8eef-4b36-aa6f-5d124e828ce1'
|
|
|
|
};
|
2019-02-21 01:57:43 -08:00
|
|
|
|
2019-03-10 08:59:36 +09:00
|
|
|
$('#TemplateConfigPage').on('pageshow', function () {
|
2019-03-10 08:55:35 +09:00
|
|
|
Dashboard.showLoadingMsg();
|
2019-03-10 08:59:36 +09:00
|
|
|
ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {
|
2019-03-10 08:55:35 +09:00
|
|
|
$('#Options').val(config.Options).change();
|
|
|
|
$('#AnInteger').val(config.AnInteger).change();
|
2020-05-26 22:11:35 +09:00
|
|
|
$('#TrueFalseSetting').checked = config.TrueFalseSetting;
|
2019-03-10 08:55:35 +09:00
|
|
|
$('#AString').val(config.AString).change();
|
|
|
|
Dashboard.hideLoadingMsg();
|
2019-02-21 01:57:43 -08:00
|
|
|
});
|
2019-03-10 08:55:35 +09:00
|
|
|
});
|
2019-02-21 01:57:43 -08:00
|
|
|
|
2019-03-10 08:59:36 +09:00
|
|
|
$('#TemplateConfigForm').on('submit', function () {
|
2019-03-10 08:55:35 +09:00
|
|
|
Dashboard.showLoadingMsg();
|
2019-03-10 08:59:36 +09:00
|
|
|
ApiClient.getPluginConfiguration(TemplateConfig.pluginUniqueId).then(function (config) {
|
2019-03-10 08:55:35 +09:00
|
|
|
config.Options = $('#Options').val();
|
|
|
|
config.AnInteger = $('#AnInteger').val();
|
2020-05-26 22:11:35 +09:00
|
|
|
config.TrueFalseSetting = $('#TrueFalseSetting').checked;
|
2019-03-10 08:55:35 +09:00
|
|
|
config.AString = $('#AString').val();
|
2019-11-27 03:13:09 +09:00
|
|
|
ApiClient.updatePluginConfiguration(TemplateConfig.pluginUniqueId, config).then(function (result) {
|
2019-03-10 08:55:35 +09:00
|
|
|
Dashboard.processPluginConfigurationUpdateResult(result);
|
|
|
|
});
|
2019-02-21 01:57:43 -08:00
|
|
|
});
|
2019-03-10 08:55:35 +09:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</div>
|
2019-03-10 08:53:30 +09:00
|
|
|
</body>
|
|
|
|
</html>
|