-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
56 lines (49 loc) · 1.96 KB
/
index.html
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
54
55
56
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>bioschemas-uniprot-adapter-demo</title>
</head>
<body>
<bioschemas-uniprot-adapter id="adapter1">
<data-loader id="loader1">
<source src="https://www.ebi.ac.uk/proteins/api/proteins/P12272" />
</data-loader>
</bioschemas-uniprot-adapter>
<button onclick="
var elem = document.getElementById('loader1');
elem.accession = 'P04637';
console.log(elem);
">Retrieve P04637 for loader 1</button>
<!-- Required for IE11 -->
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
<!-- Web component polyfill (only loads what it needs) -->
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-lite.js" charset="utf-8"></script>
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js" charset="utf-8"></script>
<script src="https://cdn.jsdelivr.net/npm/protvista-uniprot-entry-adapter/dist/ProtVistaUniProtEntryAdapter.js" charset="utf-8" defer></script>
<script src="https://cdn.jsdelivr.net/npm/data-loader@latest/dist/index.js" charset="utf-8" defer></script>
<script src="https://cdn.jsdelivr.net/npm/protvista-feature-adapter/dist/BioschemasUniProtAdapter.js" charset="utf-8" defer></script>
<script>
for (const adapter of document.querySelectorAll('bioschemas-uniprot-adapter')) {
adapter.addEventListener(
'load',
e => {
console.log('Data loaded');
console.log(e.target);
console.log(e.detail);
}
);
adapter.addEventListener(
'error',
e => {
console.log('error');
console.log(e.target);
console.log(e.detail);
}
);
}
</script>
</body>
</html>