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' : [{ |
Akron | 10a4796 | 2018-07-12 21:17:10 +0200 | [diff] [blame] | 18 | 'panel' : 'match', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 19 | 'title' : 'Translate', |
| 20 | 'classes' : ['translate'], |
| 21 | 'onClick' : { |
| 22 | 'action' : 'addWidget', |
Akron | 7c6e05f | 2018-07-12 19:08:13 +0200 | [diff] [blame] | 23 | 'template' : 'http://localhost:3003/demo/plugin-client.html', |
| 24 | } |
| 25 | }] |
| 26 | }); |
| 27 | |
| 28 | |
| 29 | var btns = buttonGroupClass.create(); |
| 30 | document.getElementById('buttons').appendChild(btns.element()); |
| 31 | |
| 32 | // Are there plugin buttons defined |
| 33 | var matchButtons = KorAP.Plugin.buttonGroup("match"); |
| 34 | if (matchButtons) { |
| 35 | |
| 36 | // Add all matchbuttons in order |
| 37 | for (i in matchButtons) { |
| 38 | btns.add.apply(btns, matchButtons[i]); |
| 39 | } |
| 40 | }; |
Akron | 479994e | 2018-07-02 13:21:44 +0200 | [diff] [blame] | 41 | }); |
| 42 | }); |