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 | |
| 11 | define(['app/en','match', 'panel/match', 'panel/result', 'plugin/server','lib/domReady','init'], function (lang, matchClass, matchPanelClass, resultPanelClass, pluginClass, 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 | |
| 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()); |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 19 | |
| 20 | //Register result plugin |
| 21 | KorAP.Plugin.register({ |
| 22 | 'name' : 'Export', |
| 23 | 'desc' : 'Exports Kalamar results', |
| 24 | // 'about' : 'https://localhost:5678/', |
| 25 | 'embed' : [{ |
| 26 | 'panel' : 'result', |
| 27 | 'title' : 'Export', |
| 28 | 'classes' : ['export'], |
| 29 | 'onClick' : { |
| 30 | 'action' : 'addWidget', |
| 31 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 32 | } |
Akron | 22598cd | 2019-12-09 14:59:03 +0100 | [diff] [blame^] | 33 | },{ |
| 34 | 'panel' : 'result', |
| 35 | 'title' : 'Glemm', |
| 36 | 'onClick' : { |
| 37 | 'action' : 'toggle', |
| 38 | 'state' : 'glemm', |
| 39 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 40 | } |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 41 | }] |
| 42 | }); |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 43 | |
Akron | e1c27f6 | 2018-07-20 11:42:59 +0200 | [diff] [blame] | 44 | // Register match plugin |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 45 | KorAP.Plugin.register({ |
| 46 | 'name' : 'Example New', |
| 47 | 'desc' : 'Some content about cats', |
| 48 | // 'about' : 'https://localhost:5678/', |
| 49 | 'embed' : [{ |
Akron | 10a4796 | 2018-07-12 21:17:10 +0200 | [diff] [blame] | 50 | 'panel' : 'match', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 51 | 'title' : 'Translate', |
| 52 | 'classes' : ['translate'], |
| 53 | 'onClick' : { |
| 54 | 'action' : 'addWidget', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 55 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 56 | } |
| 57 | }] |
| 58 | }); |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 59 | }); |
| 60 | }); |