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 | |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame^] | 8 | define(['app/en','buttongroup', 'plugin/server','lib/domReady','init','hint/foundries/cnx'], function (lang, buttonGroupClass, pluginClass, domReady) { |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 9 | domReady(function () { |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame^] | 10 | |
Akron | 8d646d7 | 2018-07-08 13:45:53 +0200 | [diff] [blame] | 11 | KorAP.Plugin = pluginClass.create(); |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame^] | 12 | |
| 13 | KorAP.Plugin.register({ |
| 14 | 'name' : 'Example New', |
| 15 | 'desc' : 'Some content about cats', |
| 16 | // 'about' : 'https://localhost:5678/', |
| 17 | 'embed' : [{ |
| 18 | 'buttonGroup' : 'match', |
| 19 | 'title' : 'Translate', |
| 20 | 'classes' : ['translate'], |
| 21 | 'onClick' : { |
| 22 | 'action' : 'addWidget', |
| 23 | 'panel' : 'container', |
| 24 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 25 | } |
| 26 | }] |
| 27 | }); |
| 28 | |
| 29 | |
| 30 | var btns = buttonGroupClass.create(); |
| 31 | document.getElementById('buttons').appendChild(btns.element()); |
| 32 | |
| 33 | // Are there plugin buttons defined |
| 34 | var matchButtons = KorAP.Plugin.buttonGroup("match"); |
| 35 | if (matchButtons) { |
| 36 | |
| 37 | // Add all matchbuttons in order |
| 38 | for (i in matchButtons) { |
| 39 | btns.add.apply(btns, matchButtons[i]); |
| 40 | } |
| 41 | }; |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 42 | }); |
| 43 | }); |