blob: a6ba4a2fd39b72ffa4e12806fcd613585d958ebb [file] [log] [blame]
Akron479994e2018-07-02 13:21:44 +02001requirejs.config({
2 baseUrl: '/js/src',
3 paths : {
4 'lib': '../lib'
5 }
6});
7
Akron7c6e05f2018-07-12 19:08:13 +02008define(['app/en','buttongroup', 'plugin/server','lib/domReady','init','hint/foundries/cnx'], function (lang, buttonGroupClass, pluginClass, domReady) {
Akron479994e2018-07-02 13:21:44 +02009 domReady(function () {
Akron7c6e05f2018-07-12 19:08:13 +020010
Akron8d646d72018-07-08 13:45:53 +020011 KorAP.Plugin = pluginClass.create();
Akron7c6e05f2018-07-12 19:08:13 +020012
13 KorAP.Plugin.register({
14 'name' : 'Example New',
15 'desc' : 'Some content about cats',
16 // 'about' : 'https://localhost:5678/',
17 'embed' : [{
18 'buttonGroup' : 'match',
19 'title' : 'Translate',
20 'classes' : ['translate'],
21 'onClick' : {
22 'action' : 'addWidget',
23 'panel' : 'container',
24 'template' : 'http://localhost:3003/demo/plugin-client.html',
25 }
26 }]
27 });
28
29
30 var btns = buttonGroupClass.create();
31 document.getElementById('buttons').appendChild(btns.element());
32
33 // Are there plugin buttons defined
34 var matchButtons = KorAP.Plugin.buttonGroup("match");
35 if (matchButtons) {
36
37 // Add all matchbuttons in order
38 for (i in matchButtons) {
39 btns.add.apply(btns, matchButtons[i]);
40 }
41 };
Akron479994e2018-07-02 13:21:44 +020042 });
43});