config.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>OMDb</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="castAndCrew" />
  13. <span>Collect information about the cast and other crew members from OMDb.</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: "a628c0da-fac5-4c7e-9d1a-7134223f14c8"
  25. };
  26. document.querySelector('.configPage')
  27. .addEventListener('pageshow', function () {
  28. Dashboard.showLoadingMsg();
  29. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  30. document.querySelector('#castAndCrew').checked = config.CastAndCrew;
  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.CastAndCrew = document.querySelector('#castAndCrew').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>