blob: 096050f7d5098d2e6c2f8ea8a457d6156ceb8551 [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
9
10
Akron51ee6232019-12-17 21:00:05 +010011define(['app/en','match', 'panel/match', 'panel/result', 'plugin/server','pipe','lib/domReady','init'], function (lang, matchClass, matchPanelClass, resultPanelClass, pluginClass, pipeClass, domReady) {
Akron479994e2018-07-02 13:21:44 +020012 domReady(function () {
hebastae094dc62019-12-06 13:12:40 +010013
Akron51ee6232019-12-17 21:00:05 +010014 // Load Plugin Server first
Akron8d646d72018-07-08 13:45:53 +020015 KorAP.Plugin = pluginClass.create();
Akron22598cd2019-12-09 14:59:03 +010016
17 // Add services container to head
18 document.head.appendChild(KorAP.Plugin.element());
Akron51ee6232019-12-17 21:00:05 +010019
20 // Add pipe form
21 KorAP.Pipe = pipeClass.create();
22 document.getElementById("searchform").appendChild(KorAP.Pipe.element());
hebastae094dc62019-12-06 13:12:40 +010023
24 //Register result plugin
25 KorAP.Plugin.register({
26 'name' : 'Export',
27 'desc' : 'Exports Kalamar results',
28 // 'about' : 'https://localhost:5678/',
29 'embed' : [{
30 'panel' : 'result',
31 'title' : 'Export',
32 'classes' : ['export'],
33 'onClick' : {
34 'action' : 'addWidget',
35 'template' : 'http://localhost:3003/demo/plugin-client.html',
36 }
Akron22598cd2019-12-09 14:59:03 +010037 },{
38 'panel' : 'result',
39 'title' : 'Glemm',
40 'onClick' : {
41 'action' : 'toggle',
42 'state' : 'glemm',
43 'template' : 'http://localhost:3003/demo/plugin-client.html',
44 }
hebastae094dc62019-12-06 13:12:40 +010045 }]
46 });
Akron7c6e05f2018-07-12 19:08:13 +020047
Akrone1c27f62018-07-20 11:42:59 +020048 // Register match plugin
Akron7c6e05f2018-07-12 19:08:13 +020049 KorAP.Plugin.register({
50 'name' : 'Example New',
51 'desc' : 'Some content about cats',
52 // 'about' : 'https://localhost:5678/',
53 'embed' : [{
Akron10a47962018-07-12 21:17:10 +020054 'panel' : 'match',
Akron7c6e05f2018-07-12 19:08:13 +020055 'title' : 'Translate',
56 'classes' : ['translate'],
57 'onClick' : {
58 'action' : 'addWidget',
Akron7c6e05f2018-07-12 19:08:13 +020059 'template' : 'http://localhost:3003/demo/plugin-client.html',
60 }
61 }]
62 });
Akron479994e2018-07-02 13:21:44 +020063 });
64});