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 |
| 30 | for (i in queryButtons) { |
| 31 | a.add.apply(a, queryButtons[i]); |
| 32 | }; |
| 33 | |
hebasta | f6adf8d | 2019-11-26 14:04:10 +0100 | [diff] [blame^] | 34 | KorAP.Plugin.clearButtonGroup("query") |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | return this; |
| 38 | } |
| 39 | } |
| 40 | }); |