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 { | ||||
Akron | 386f122 | 2022-12-21 16:26:11 +0100 | [diff] [blame] | 18 | type : 'query', |
19 | |||||
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 20 | create : function (opened) { |
21 | return Object.create(panelClass)._init(['query']).upgradeTo(this)._init(opened); | ||||
22 | }, | ||||
23 | |||||
24 | // Initialize panel | ||||
25 | _init : function (opened) { | ||||
26 | this._opened = opened; | ||||
Akron | 37ea119 | 2021-07-28 10:40:14 +0200 | [diff] [blame] | 27 | const a = this.actions(); |
hebasta | f6adf8d | 2019-11-26 14:04:10 +0100 | [diff] [blame] | 28 | |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 29 | // If plugins are enabled, add all buttons for the query panel |
30 | if (KorAP.Plugin) { | ||||
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 31 | |
32 | // Add all matchbuttons in order | ||||
Akron | 14f3ee9 | 2020-10-19 11:59:40 +0200 | [diff] [blame] | 33 | KorAP.Plugin |
34 | .buttonGroup("query") | ||||
35 | .forEach(i => a.add.apply(a, i)); | ||||
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 36 | |
hebasta | f6adf8d | 2019-11-26 14:04:10 +0100 | [diff] [blame] | 37 | KorAP.Plugin.clearButtonGroup("query") |
Akron | 2d0d96d | 2019-11-18 19:49:50 +0100 | [diff] [blame] | 38 | }; |
39 | |||||
40 | return this; | ||||
41 | } | ||||
42 | } | ||||
43 | }); |