config.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>OMDb</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>OMDb</h1>
  11. <form class="configForm">
  12. <label class="checkboxContainer">
  13. <input is="emby-checkbox" type="checkbox" id="castAndCrew" />
  14. <span>Collect information about the cast and other crew members from OMDb.</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: "a628c0da-fac5-4c7e-9d1a-7134223f14c8"
  26. };
  27. document.querySelector('.configPage')
  28. .addEventListener('pageshow', function () {
  29. Dashboard.showLoadingMsg();
  30. ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
  31. document.querySelector('#castAndCrew').checked = config.CastAndCrew;
  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.CastAndCrew = document.querySelector('#castAndCrew').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>