Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 1 | /** |
| 2 | * The query panel |
| 3 | * |
| 4 | * @author Nils Diewald |
| 5 | */ |
| 6 | define([ |
| 7 | 'panel' |
| 8 | ], function (panelClass) { |
| 9 | |
| 10 | const d = document; |
| 11 | |
| 12 | // Localization values |
| 13 | const loc = KorAP.Locale; |
| 14 | |
| 15 | return { |
| 16 | create : function (opened) { |
| 17 | return Object.create(panelClass)._init(['query']).upgradeTo(this)._init(opened); |
| 18 | }, |
| 19 | |
| 20 | // Initialize panel |
| 21 | _init : function (opened) { |
| 22 | this._opened = opened; |
hebasta | f6adf8d | 2019-11-26 14:04:10 +0100 | [diff] [blame] | 23 | var a = this.actions; |
| 24 | |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 25 | // If plugins are enabled, add all buttons for the query panel |
| 26 | if (KorAP.Plugin) { |
| 27 | var queryButtons = KorAP.Plugin.buttonGroup("query"); |
| 28 | |
| 29 | // Add all matchbuttons in order |
Akron | 678c26f | 2020-10-09 08:52:50 +0200 | [diff] [blame^] | 30 | queryButtons.forEach(i => a.add.apply(a, i)); |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 31 | |
hebasta | f6adf8d | 2019-11-26 14:04:10 +0100 | [diff] [blame] | 32 | KorAP.Plugin.clearButtonGroup("query") |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | return this; |
| 36 | } |
| 37 | } |
| 38 | }); |