config.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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="replaceAlbumName" />
  13. <span>When an album is found during a metadata search, replace the name with the value on the server.</span>
  14. </label>
  15. <br />
  16. <div>
  17. <button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>
  18. </div>
  19. </form>
  20. </div>
  21. </div>
  22. <script type="text/javascript">
  23. var PluginConfig = {
  24. pluginId: "a629c0da-fac5-4c7e-931a-7174223f14c8"
  25. };
  26. document.querySelector('.configPage')
  27. .addEventListener('pageshow', function () {
  28. Dashboard.showLoadingMsg();
  29. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  30. document.querySelector('#replaceAlbumName').checked = config.ReplaceAlbumName;
  31. Dashboard.hideLoadingMsg();
  32. });
  33. });
  34. document.querySelector('.configForm')
  35. .addEventListener('submit', function (e) {
  36. Dashboard.showLoadingMsg();
  37. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  38. config.ReplaceAlbumName = document.querySelector('#replaceAlbumName').checked;
  39. ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
  40. });
  41. e.preventDefault();
  42. return false;
  43. });
  44. </script>
  45. </div>
  46. </body>
  47. </html>