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 | |
Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 9 | KorAP.Plugins = [{ |
| 10 | 'name' : 'Export', |
| 11 | 'desc' : 'Exports Kalamar results', |
| 12 | // 'about' : 'https://localhost:5678/', |
| 13 | 'embed' : [{ |
| 14 | 'panel' : 'result', |
| 15 | 'title' : 'Export', |
hebasta | 40a85cf | 2020-07-15 18:10:08 +0200 | [diff] [blame] | 16 | 'icon' : "\uf019", |
| 17 | 'classes' : [ 'button-icon', 'plugin', 'export' ], |
Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 18 | 'onClick' : { |
| 19 | 'action' : 'addWidget', |
| 20 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
Akron | 35fd0dc | 2021-09-15 15:01:36 +0200 | [diff] [blame^] | 21 | "permissions": [ |
| 22 | "forms", |
| 23 | "scripts", |
| 24 | "downloads" |
| 25 | ], |
Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 26 | } |
| 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', |
| 47 | } |
| 48 | }] |
| 49 | }]; |
hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 50 | |
| 51 | |
Akron | 855caf6 | 2021-07-21 10:47:52 +0200 | [diff] [blame] | 52 | define(['plugin/server', 'lib/domReady', 'app/en', 'init'], function(pluginClass, domReady) { |
| 53 | domReady(function (event) { |
| 54 | if (KorAP.Plugin === undefined) { |
| 55 | // Load Plugin Server first |
| 56 | KorAP.Plugin = pluginClass.create(); |
| 57 | // Add services container to head |
| 58 | document.head.appendChild(KorAP.Plugin.element()); |
| 59 | }; |
| 60 | KorAP.Plugins.forEach(i => KorAP.Plugin.register(i)); |
| 61 | }); |
| 62 | }); |