Added example plugin registry
Change-Id: I80daa31b6bdbaa9e6d6e81d62e6c34400509844a
diff --git a/dev/demo/plugin-serverdemo.js b/dev/demo/plugin-serverdemo.js
index d5f07f8..a6ba4a2 100644
--- a/dev/demo/plugin-serverdemo.js
+++ b/dev/demo/plugin-serverdemo.js
@@ -5,8 +5,39 @@
}
});
-define(['app/en','plugin/server','lib/domReady','init','hint/foundries/cnx'], function (lang, pluginClass, domReady) {
+define(['app/en','buttongroup', 'plugin/server','lib/domReady','init','hint/foundries/cnx'], function (lang, buttonGroupClass, pluginClass, domReady) {
domReady(function () {
+
KorAP.Plugin = pluginClass.create();
+
+ KorAP.Plugin.register({
+ 'name' : 'Example New',
+ 'desc' : 'Some content about cats',
+ // 'about' : 'https://localhost:5678/',
+ 'embed' : [{
+ 'buttonGroup' : 'match',
+ 'title' : 'Translate',
+ 'classes' : ['translate'],
+ 'onClick' : {
+ 'action' : 'addWidget',
+ 'panel' : 'container',
+ 'template' : 'http://localhost:3003/demo/plugin-client.html',
+ }
+ }]
+ });
+
+
+ var btns = buttonGroupClass.create();
+ document.getElementById('buttons').appendChild(btns.element());
+
+ // Are there plugin buttons defined
+ var matchButtons = KorAP.Plugin.buttonGroup("match");
+ if (matchButtons) {
+
+ // Add all matchbuttons in order
+ for (i in matchButtons) {
+ btns.add.apply(btns, matchButtons[i]);
+ }
+ };
});
});