Akron | 5e1252e | 2022-12-19 17:57:56 +0100 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
Akron | ebdfa00 | 2022-12-20 13:48:33 +0100 | [diff] [blame] | 4 | <title>External Provider</title> |
Akron | 3af88ae | 2022-12-21 11:20:00 +0100 | [diff] [blame] | 5 | <link href="https://korap.ids-mannheim.de/instance/test/css/kalamar-plugin-latest.css" type="text/css" rel="stylesheet" /> |
Akron | 8d25e1e | 2022-12-20 16:00:38 +0100 | [diff] [blame] | 6 | <script data-server="{{ .korapServer }}" src="https://korap.ids-mannheim.de/instance/test/js/korap-plugin-latest.js"></script> |
Akron | 5e1252e | 2022-12-19 17:57:56 +0100 | [diff] [blame] | 7 | </head> |
| 8 | <body> |
Akron | 9baa3eb | 2022-12-20 20:24:24 +0100 | [diff] [blame] | 9 | <h1>External Provider</h1> |
Akron | 9e76933 | 2022-12-21 11:25:38 +0100 | [diff] [blame] | 10 | <section style="background-color: #fefefe"> |
Akron | 9baa3eb | 2022-12-20 20:24:24 +0100 | [diff] [blame] | 11 | <p id="buy">...</p> |
| 12 | </section> |
Akron | 8d25e1e | 2022-12-20 16:00:38 +0100 | [diff] [blame] | 13 | <script defer=""><!-- |
| 14 | "use strict"; |
| 15 | |
| 16 | function pluginit(P) { |
| 17 | |
| 18 | P.resize(); |
| 19 | |
| 20 | // Request metadata from the embedding match |
| 21 | P.requestMsg( |
| 22 | { |
| 23 | 'action':'get', |
| 24 | 'key':'textSigle' |
| 25 | }, function (d) { |
| 26 | var textSigle = d.value.value; |
| 27 | var xhttp = new XMLHttpRequest(); |
Akron | 8d25e1e | 2022-12-20 16:00:38 +0100 | [diff] [blame] | 28 | xhttp.onload = function() { |
Akron | c2d2d3b | 2022-12-21 11:29:59 +0100 | [diff] [blame] | 29 | if (this.status === 404) { |
| 30 | document.getElementById("buy").innerHTML = "External provider unknown." |
| 31 | } else { |
| 32 | var ret = this.responseText.split(","); |
| 33 | document.getElementById("buy").innerHTML = "You can buy this text from <a href=\"" + ret[1] + "\" class=\"external\">" + ret[0] + "</a>."; |
| 34 | } |
Akron | 8d25e1e | 2022-12-20 16:00:38 +0100 | [diff] [blame] | 35 | P.resize(); |
| 36 | } |
| 37 | xhttp.open("GET", textSigle, true); |
| 38 | xhttp.send(); |
| 39 | } |
| 40 | ); |
| 41 | |
| 42 | if (window.dynCall) { |
| 43 | window.dynCall(P) |
| 44 | }; |
| 45 | |
| 46 | // Set plugin object globally |
| 47 | window.Plugin = P; |
| 48 | |
| 49 | }; |
| 50 | --> |
| 51 | </script> |
Akron | 5e1252e | 2022-12-19 17:57:56 +0100 | [diff] [blame] | 52 | </body> |
| 53 | </html> |