blob: 6540591feb7e847eb007dff46b10c6ba7483160d [file] [log] [blame]
Akron479994e2018-07-02 13:21:44 +02001requirejs.config({
2 baseUrl: '/js/src',
3 paths : {
4 'lib': '../lib'
5 }
6});
7
hebastae094dc62019-12-06 13:12:40 +01008
Akron24f48ea2020-07-01 09:37:19 +02009KorAP.Plugins = [{
10 'name' : 'Export',
11 'desc' : 'Exports Kalamar results',
12 // 'about' : 'https://localhost:5678/',
13 'embed' : [{
14 'panel' : 'result',
15 'title' : 'Export',
hebasta40a85cf2020-07-15 18:10:08 +020016 'icon' : "\uf019",
17 'classes' : [ 'button-icon', 'plugin', 'export' ],
Akron24f48ea2020-07-01 09:37:19 +020018 'onClick' : {
19 'action' : 'addWidget',
20 'template' : 'http://localhost:3003/demo/plugin-client.html',
Akron35fd0dc2021-09-15 15:01:36 +020021 "permissions": [
22 "forms",
23 "scripts",
24 "downloads"
25 ],
Akron24f48ea2020-07-01 09:37:19 +020026 }
27 },{
28 'panel' : 'result',
29 'title' : 'Glemm',
30 'onClick' : {
31 'action' : 'toggle',
32 'state' : 'glemm',
33 'template' : 'http://localhost:3003/demo/plugin-client.html',
34 }
35 }]
36},{
37 'name' : 'Example New',
38 'desc' : 'Some content about cats',
39 // 'about' : 'https://localhost:5678/',
40 'embed' : [{
41 'panel' : 'match',
42 'title' : 'Translate',
43 'classes' : ['translate'],
44 'onClick' : {
45 'action' : 'addWidget',
46 'template' : 'http://localhost:3003/demo/plugin-client.html',
Akron338b4d42022-12-20 13:59:22 +010047 "permissions": [
48 "forms",
49 "scripts",
50 "downloads"
51 ]
52 },
Akron24f48ea2020-07-01 09:37:19 +020053 }]
54}];
hebastae094dc62019-12-06 13:12:40 +010055
56
Akron855caf62021-07-21 10:47:52 +020057define(['plugin/server', 'lib/domReady', 'app/en', 'init'], function(pluginClass, domReady) {
58 domReady(function (event) {
59 if (KorAP.Plugin === undefined) {
60 // Load Plugin Server first
61 KorAP.Plugin = pluginClass.create();
62 // Add services container to head
63 document.head.appendChild(KorAP.Plugin.element());
64 };
65 KorAP.Plugins.forEach(i => KorAP.Plugin.register(i));
66 });
67});