Fix javascript bindings
Change-Id: I480628c503a7f6aa097fc5987a204a669bbe488f
diff --git a/assets/mainfest.json b/assets/mainfest.json
deleted file mode 100644
index 9470441..0000000
--- a/assets/mainfest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "name" : "External Provider",
- "desc" : "Buy content from an external provider",
- "embed" : [{
- "panel" : "match",
- "title" : "Buy",
- "classes" : ["cart"],
- "onClick" : {
- "action" : "addWidget",
- "template" : "http://localhost:3003/demo/plugin-client.html",
- "permissions": [
- "scripts",
- "downloads"
- ]
- }
- }]
-}
\ No newline at end of file
diff --git a/templates/main.html b/templates/main.html
index bec6d1c..0b6ff9d 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -2,41 +2,45 @@
<html>
<head>
<title>External Provider</title>
- <script data-server="{{ .korapServer }}" src="client.js"></script>
- <script><!--
-"use strict";
-
-function pluginit(P) {
-
- // Request metadata from the embedding match
- P.requestMsg(
- {
- 'action':'get',
- 'key':'textSigle'
- }, function (d) {
- var textSigle = d.value.value;
- var xhttp = new XMLHttpRequest();
- xhttp.onload = function() {
- document.getElementById("buy").innerHTML = this.responseText;
- P.resize();
- }
- xhttp.open("GET", textSigle, true);
- xhttp.send();
- }
- );
-
- if (window.dynCall) {
- window.dynCall(P)
- };
-
- // Set plugin object globally
- window.Plugin = P;
-
-};
--->
- </script>
+ <script data-server="{{ .korapServer }}" src="https://korap.ids-mannheim.de/instance/test/js/korap-plugin-latest.js"></script>
</head>
<body>
<p id="buy">...</p>
+ <script defer=""><!--
+ "use strict";
+
+ function pluginit(P) {
+
+ P.resize();
+
+ // Request metadata from the embedding match
+ P.requestMsg(
+ {
+ 'action':'get',
+ 'key':'textSigle'
+ }, function (d) {
+ var textSigle = d.value.value;
+ var xhttp = new XMLHttpRequest();
+ console.log("Loading ...");
+ xhttp.onload = function() {
+ var ret = his.responseText.split(",");
+ document.getElementById("buy").innerHTML = "You can buy this text from <a href=\"" + ret[1] + "\" class=\"external\">" + ret[0] + "</a>.";
+ P.resize();
+ }
+ xhttp.open("GET", textSigle, true);
+ xhttp.send();
+ }
+ );
+
+ if (window.dynCall) {
+ window.dynCall(P)
+ };
+
+ // Set plugin object globally
+ window.Plugin = P;
+
+ };
+ -->
+ </script>
</body>
</html>