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