| 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', |
| Akron | b0ae841 | 2026-02-24 11:47:52 +0100 | [diff] [blame^] | 20 | 'active' : true, |
| Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 21 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| Akron | 35fd0dc | 2021-09-15 15:01:36 +0200 | [diff] [blame] | 22 | "permissions": [ |
| 23 | "forms", |
| 24 | "scripts", |
| 25 | "downloads" |
| 26 | ], |
| Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 27 | } |
| 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', |
| Akron | 338b4d4 | 2022-12-20 13:59:22 +0100 | [diff] [blame] | 48 | "permissions": [ |
| 49 | "forms", |
| 50 | "scripts", |
| 51 | "downloads" |
| 52 | ] |
| 53 | }, |
| Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 54 | }] |
| Akron | b0ae841 | 2026-02-24 11:47:52 +0100 | [diff] [blame^] | 55 | },{ |
| 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 | ] |
| Akron | 24f48ea | 2020-07-01 09:37:19 +0200 | [diff] [blame] | 73 | }]; |
| hebasta | e094dc6 | 2019-12-06 13:12:40 +0100 | [diff] [blame] | 74 | |
| 75 | |
| Akron | b0ae841 | 2026-02-24 11:47:52 +0100 | [diff] [blame^] | 76 | define(['plugin/server', 'pipe', 'lib/domReady', 'app/en', 'init'], function(pluginClass, pipeClass, domReady) { |
| Akron | 855caf6 | 2021-07-21 10:47:52 +0200 | [diff] [blame] | 77 | 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 | }; |
| Akron | b0ae841 | 2026-02-24 11:47:52 +0100 | [diff] [blame^] | 84 | |
| 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 | |
| Akron | 855caf6 | 2021-07-21 10:47:52 +0200 | [diff] [blame] | 94 | KorAP.Plugins.forEach(i => KorAP.Plugin.register(i)); |
| 95 | }); |
| 96 | }); |