blob: 406ea2bfaa20af03600e0912862d176773ceba38 [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',
Akronb0ae8412026-02-24 11:47:52 +010020 'active' : true,
Akron24f48ea2020-07-01 09:37:19 +020021 'template' : 'http://localhost:3003/demo/plugin-client.html',
Akron35fd0dc2021-09-15 15:01:36 +020022 "permissions": [
23 "forms",
24 "scripts",
25 "downloads"
26 ],
Akron24f48ea2020-07-01 09:37:19 +020027 }
28 },{
29 'panel' : 'result',
30 'title' : 'Glemm',
31 'onClick' : {
32 'action' : 'toggle',
33 'state' : 'glemm',
34 'template' : 'http://localhost:3003/demo/plugin-client.html',
35 }
36 }]
37},{
38 'name' : 'Example New',
39 'desc' : 'Some content about cats',
40 // 'about' : 'https://localhost:5678/',
41 'embed' : [{
42 'panel' : 'match',
43 'title' : 'Translate',
44 'classes' : ['translate'],
45 'onClick' : {
46 'action' : 'addWidget',
47 'template' : 'http://localhost:3003/demo/plugin-client.html',
Akron338b4d42022-12-20 13:59:22 +010048 "permissions": [
49 "forms",
50 "scripts",
51 "downloads"
52 ]
53 },
Akron24f48ea2020-07-01 09:37:19 +020054 }]
Akronb0ae8412026-02-24 11:47:52 +010055},{
56 "name": "Koral-Mapper",
57 "desc": "Mapping Service",
58 "embed": [
59 {
60 "classes": [
61 "termmapper"
62 ],
63 "onClick" : {
64 "action" : "setWidget",
65 "active" : false,
66 "template" : "http://localhost:5725",
67 "permissions": ["forms", "scripts", "downloads"]
68 },
69 "panel": "query",
70 "title": "Map"
71 }
72 ]
Akron24f48ea2020-07-01 09:37:19 +020073}];
hebastae094dc62019-12-06 13:12:40 +010074
75
Akronb0ae8412026-02-24 11:47:52 +010076define(['plugin/server', 'pipe', 'lib/domReady', 'app/en', 'init'], function(pluginClass, pipeClass, domReady) {
Akron855caf62021-07-21 10:47:52 +020077 domReady(function (event) {
78 if (KorAP.Plugin === undefined) {
79 // Load Plugin Server first
80 KorAP.Plugin = pluginClass.create();
81 // Add services container to head
82 document.head.appendChild(KorAP.Plugin.element());
83 };
Akronb0ae8412026-02-24 11:47:52 +010084
85 if (KorAP.Pipe === undefined) {
86 KorAP.Pipe = pipeClass.create("pipe");
87 let searchF = document.getElementById("searchform");
88 searchF.appendChild(KorAP.Pipe.element());
89
90 KorAP.ResponsePipe = pipeClass.create("response-pipe");
91 searchF.appendChild(KorAP.ResponsePipe.element());
92 };
93
Akron855caf62021-07-21 10:47:52 +020094 KorAP.Plugins.forEach(i => KorAP.Plugin.register(i));
95 });
96});