config.html 2.2 KB

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