index.html 4.17 KB
Newer Older
Tobias Steiner's avatar
Tobias Steiner committed
1
2
3
4
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
Tobias Steiner's avatar
Tobias Steiner committed
5
    <title>Example of the histHub-Net widget (beta) </title>
6
    <script src="../src/histhub-widget.js"></script>
7
8
9
10
11
12
    <style>
        .container {
            max-width: 600px;
            margin-left: auto;
            margin-right: auto;
        }
Tobias Steiner's avatar
Tobias Steiner committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

        /**
         * Override slot h3
        */
        #custom-title-color {
            color: red;
        }

        /**
         * example with css vars
         */
        #vars {
            --histhub-li-display: inline-block;
            --histhub-li-padding: 0 0.5rem 0 0;
            --histhub-a-hover-color: blue;
            --histhub-a-hover-text-decoration: none;
        }
30
    </style>
Tobias Steiner's avatar
Tobias Steiner committed
31
32
</head>
<body>
Tobias Steiner's avatar
Tobias Steiner committed
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template id="demo-template">
    <style>
        /**
         * Define your custom styles
         */
        ul {
            margin-left: 1rem;
            padding: 0;
        }
        h3 {
            margin-bottom: 0.5rem;
            color: green;
        }

        ul li {
48
            list-style: square;
Tobias Steiner's avatar
Tobias Steiner committed
49
50
51
52
53
54
55
        }
    </style>
    <!-- You may hardcode stuff in here -->
    <h3>Example 8: Custom template</h3>
    <!-- You need to provide a div with id links. Here we will render the links !-->
    <div id="links">Daten werden von Histhub geladen...</div>
</template>
56
    <div class="container">
Tobias Steiner's avatar
Tobias Steiner committed
57
        <h1>Example of the histHub-Net widget (beta)</h1>
58
59
60
61
62
63
64
        <p>The histhub widget can fetch sameas resources for different resoucrces. It makes a simple http request to one of the backends and gets a list of links from there. It finally renders the links in a list and display them.</p>
        <histhub-widget endpoint="//api.tagcloud.histhub.ch/v1/sameas/" resolver="resolvermanual" location="https://dodis.ch/T171">
            <h3 slot="title">Example 1: Links from tagcloud dodis: Aussenpolitik (allg.)</h3>
        </histhub-widget>
        <histhub-widget endpoint="//api.orgalinker.histhub.ch/v1/sameas/" resolver="resolvermanual" location="https://dodis.ch/R20">
            <h3 slot="title">Example 2: Links from orgalinker dodis: Lombard, Odier & Cie</h3>
        </histhub-widget>
65
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G82">
Tobias Steiner's avatar
Tobias Steiner committed
66
67
            <h3 slot="title">Example 3: Links (sameas) from geolinker dodis: Diedenhofen</h3>
        </histhub-widget>
68
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/similarto/" resolver="resolverelasticsearch" location="https://dodis.ch/G82">
Tobias Steiner's avatar
Tobias Steiner committed
69
            <h3 slot="title">Example 4: Links (similarto) from geolinker dodis: Diedenhofen</h3>
70
        </histhub-widget>
71
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G82000000000000">
Tobias Steiner's avatar
Tobias Steiner committed
72
73
74
75
76
            <h3 slot="title">Example 5: No links (sameas) from geolinker (will be hidden)</h3>
        </histhub-widget>
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/similarto/" resolver="resolverelasticsearch" location="https://dodis.ch/G82">
            <h3 slot="title" id="custom-title-color">Example 6: Links (similarto) from geolinker dodis: Diedenhofen and custom title color</h3>
        </histhub-widget>
77
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/similarto/" resolver="resolverelasticsearch" location="https://dodis.ch/G82" language="fr" timeout="50000">
Tobias Steiner's avatar
Tobias Steiner committed
78
79
80
81
82
83
            <h3 slot="title">Example 7: Links (similarto) from geolinker dodis: Diedenhofen</h3>
            Additional comment
        </histhub-widget>
        <histhub-widget endpoint="//api.geolinker.histhub.ch/v1-1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G82" template="demo-template">
        </histhub-widget>
        <histhub-widget id="vars" endpoint="//api.geolinker.histhub.ch/v1-1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G82">
84
        </histhub-widget>
Tobias Steiner's avatar
Tobias Steiner committed
85
86
87
88
        <histhub-widget  endpoint="//api.geolinker.histhub.ch/v1-1/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G82">
            <h3 slot="title">Example 10: Links (similarto) from geolinker dodis: Diedenhofen with credits</h3>
            <p slot="credits">Example credits</p>
        </histhub-widget>
89
    </div>
Tobias Steiner's avatar
Tobias Steiner committed
90
91
</body>
</html>