blob: 7f66f9fb1f6469c563a7cdd794068bfcac72bde3 [file] [log] [blame]
Akron2d0d96d2019-11-18 19:49:50 +01001/**
2 * The query panel
3 *
4 * @author Nils Diewald
5 */
6define([
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;
hebastaf6adf8d2019-11-26 14:04:10 +010023 var a = this.actions;
24
Akron2d0d96d2019-11-18 19:49:50 +010025 // 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
Akron678c26f2020-10-09 08:52:50 +020030 queryButtons.forEach(i => a.add.apply(a, i));
Akron2d0d96d2019-11-18 19:49:50 +010031
hebastaf6adf8d2019-11-26 14:04:10 +010032 KorAP.Plugin.clearButtonGroup("query")
Akron2d0d96d2019-11-18 19:49:50 +010033 };
34
35 return this;
36 }
37 }
38});