aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Plugins/Omdb/Configuration/config.html
blob: e59c3cf5f9f3bc4e962f76311402018723d41277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
    <title>OMDb</title>
</head>
<body>
    <div id="configPage" data-role="page" class="page type-interior pluginConfigurationPage configPage" data-require="emby-input,emby-button,emby-checkbox">
        <div data-role="content">
            <div class="content-primary">
                <h1>OMDb</h1>
                <form class="configForm">
                    <label class="checkboxContainer">
                        <input is="emby-checkbox" type="checkbox" id="castAndCrew" />
                        <span>Collect information about the cast and other crew members from OMDb.</span>
                    </label>
                    <br />
                    <div>
                        <button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>
                    </div>
                </form>
            </div>
        </div>
        <script type="text/javascript">
            var PluginConfig = {
                pluginId: "a628c0da-fac5-4c7e-9d1a-7134223f14c8"
            };

            document.querySelector('.configPage')
                .addEventListener('pageshow', function () {
                    Dashboard.showLoadingMsg();
                    ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
                        document.querySelector('#castAndCrew').checked = config.CastAndCrew;
                        Dashboard.hideLoadingMsg();
                    });
                });


            document.querySelector('.configForm')
                .addEventListener('submit', function (e) {
                    Dashboard.showLoadingMsg();

                    ApiClient.getPluginConfiguration(PluginConfig.pluginId).then(function (config) {
                        config.CastAndCrew = document.querySelector('#castAndCrew').checked;
                        ApiClient.updatePluginConfiguration(PluginConfig.pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult);
                    });

                    e.preventDefault();
                    return false;
                });
        </script>
    </div>
</body>
</html>