Add textSigle as a fetchable value for plugins
Change-Id: I53d25f153f159efed9863c575e8e6fa668618403
diff --git a/dev/demo/plugin-client.html b/dev/demo/plugin-client.html
index 728ef4e..7935347 100644
--- a/dev/demo/plugin-client.html
+++ b/dev/demo/plugin-client.html
@@ -88,6 +88,7 @@
<li><a onclick="redirect()">Redirect</a></li>
<li><a onclick="flood()">Flood!</a></li>
<li><a onclick="KorAPlugin.requestMsg({'action':'get', 'key':'KQ'}, function (d) { document.write(JSON.stringify(d.value))})">Get KQ</a></li>
+ <li><a onclick="KorAPlugin.requestMsg({'action':'get', 'key':'textSigle', 'value':'textSigle'}, function (d) { document.write(JSON.stringify(d.value))})">Get textSigle</a></li>
</ul>
<p style="width: 2000px">------------------------------------------------------------------------------------------------------------------------</p>
</body>
diff --git a/dev/demo/plugin-serverdemo.js b/dev/demo/plugin-serverdemo.js
index 171e9de..6540591 100644
--- a/dev/demo/plugin-serverdemo.js
+++ b/dev/demo/plugin-serverdemo.js
@@ -44,7 +44,12 @@
'onClick' : {
'action' : 'addWidget',
'template' : 'http://localhost:3003/demo/plugin-client.html',
- }
+ "permissions": [
+ "forms",
+ "scripts",
+ "downloads"
+ ]
+ },
}]
}];
diff --git a/dev/js/src/plugin/server.js b/dev/js/src/plugin/server.js
index 589263f..ecf436c 100644
--- a/dev/js/src/plugin/server.js
+++ b/dev/js/src/plugin/server.js
@@ -503,6 +503,16 @@
};
}
+ // Get text sigle from match
+ else if (d.key == 'textSigle') {
+ if (service.panel.type != "match") {
+ KorAP.log(0, "Service can only be called on matches", service.src);
+ return;
+ };
+ let v = d["value"] = {};
+ v["value"] = service.panel._match.textSigle;
+ }
+
// Get Query information from parameters
else if (d.key == 'QueryParam') {