config.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>AudioDB</title>
  5. </head>
  6. <body>
  7. <div data-role="page" class="page type-interior pluginConfigurationPage configPage" data-require="emby-input,emby-button,emby-checkbox">
  8. <div data-role="content">
  9. <div class="content-primary">
  10. <form class="configForm">
  11. <label class="checkboxContainer">
  12. <input is="emby-checkbox" type="checkbox" id="enable" />
  13. <span>Enable this provider for metadata searches on artists and albums.</span>
  14. </label>
  15. <label class="checkboxContainer">
  16. <input is="emby-checkbox" type="checkbox" id="replaceAlbumName" />
  17. <span>When an album is found during a metadata search, replace the name with the value on the server.</span>
  18. </label>
  19. <br />
  20. <div>
  21. <button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>
  22. </div>
  23. </form>
  24. </div>
  25. </div>
  26. <script type="text/javascript">
  27. var PluginConfig = {
  28. pluginId: "a629c0da-fac5-4c7e-931a-7174223f14c8"
  29. };
  30. document.querySelector('.configPage')
  31. .addEventListener('pageshow', function () {
  32. Dashboard.showLoadingMsg();
  33. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  34. document.querySelector('#enable').checked = config.Enable;
  35. document.querySelector('#replaceAlbumName').checked = config.ReplaceAlbumName;
  36. Dashboard.hideLoadingMsg();
  37. });
  38. });
  39. document.querySelector('.configForm')
  40. .addEventListener('submit', function (e) {
  41. Dashboard.showLoadingMsg();
  42. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  43. config.Enable = document.querySelector('#enable').checked;
  44. config.ReplaceAlbumName = document.querySelector('#replaceAlbumName').checked;
  45. ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
  46. });
  47. e.preventDefault();
  48. return false;
  49. });
  50. </script>
  51. </div>
  52. </body>
  53. </html>