Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 1 | requirejs.config({ |
| 2 | baseUrl: '/js/src', |
| 3 | paths : { |
| 4 | 'lib': '../lib' |
| 5 | } |
| 6 | }); |
| 7 | |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 8 | |
| 9 | |
| 10 | |
Akron | 51ee623 | 2019-12-17 21:00:05 +0100 | [diff] [blame^] | 11 | define(['app/en','match', 'panel/match', 'panel/result', 'plugin/server','pipe','lib/domReady','init'], function (lang, matchClass, matchPanelClass, resultPanelClass, pluginClass, pipeClass, domReady) { |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 12 | domReady(function () { |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 13 | |
Akron | 51ee623 | 2019-12-17 21:00:05 +0100 | [diff] [blame^] | 14 | // Load Plugin Server first |
Akron | 8d646d7 | 2018-07-08 13:45:53 +0200 | [diff] [blame] | 15 | KorAP.Plugin = pluginClass.create(); |
Akron | 22598cd | 2019-12-09 14:59:03 +0100 | [diff] [blame] | 16 | |
| 17 | // Add services container to head |
| 18 | document.head.appendChild(KorAP.Plugin.element()); |
Akron | 51ee623 | 2019-12-17 21:00:05 +0100 | [diff] [blame^] | 19 | |
| 20 | // Add pipe form |
| 21 | KorAP.Pipe = pipeClass.create(); |
| 22 | document.getElementById("searchform").appendChild(KorAP.Pipe.element()); |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 23 | |
| 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 | } |
Akron | 22598cd | 2019-12-09 14:59:03 +0100 | [diff] [blame] | 37 | },{ |
| 38 | 'panel' : 'result', |
| 39 | 'title' : 'Glemm', |
| 40 | 'onClick' : { |
| 41 | 'action' : 'toggle', |
| 42 | 'state' : 'glemm', |
| 43 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 44 | } |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 45 | }] |
| 46 | }); |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 47 | |
Akron | e1c27f6 | 2018-07-20 11:42:59 +0200 | [diff] [blame] | 48 | // Register match plugin |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 49 | KorAP.Plugin.register({ |
| 50 | 'name' : 'Example New', |
| 51 | 'desc' : 'Some content about cats', |
| 52 | // 'about' : 'https://localhost:5678/', |
| 53 | 'embed' : [{ |
Akron | 10a4796 | 2018-07-12 21:17:10 +0200 | [diff] [blame] | 54 | 'panel' : 'match', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 55 | 'title' : 'Translate', |
| 56 | 'classes' : ['translate'], |
| 57 | 'onClick' : { |
| 58 | 'action' : 'addWidget', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 59 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 60 | } |
| 61 | }] |
| 62 | }); |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 63 | }); |
| 64 | }); |