blob: 92c4611fd0b56576aba169a4f4ad5c9a54ccba26 [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' : [{
Akron10a47962018-07-12 21:17:10 +020018 'panel' : 'match',
Akron7c6e05f2018-07-12 19:08:13 +020019 'title' : 'Translate',
20 'classes' : ['translate'],
21 'onClick' : {
22 'action' : 'addWidget',
Akron7c6e05f2018-07-12 19:08:13 +020023 'template' : 'http://localhost:3003/demo/plugin-client.html',
24 }
25 }]
26 });
27
28
29 var btns = buttonGroupClass.create();
30 document.getElementById('buttons').appendChild(btns.element());
31
32 // Are there plugin buttons defined
33 var matchButtons = KorAP.Plugin.buttonGroup("match");
34 if (matchButtons) {
35
36 // Add all matchbuttons in order
37 for (i in matchButtons) {
38 btns.add.apply(btns, matchButtons[i]);
39 }
40 };
Akron479994e2018-07-02 13:21:44 +020041 });
42});