blob: 0eca1b75221abf3102c2e3dbbb655d32ea2386e6 [file] [log] [blame]
Akron2d0d96d2019-11-18 19:49:50 +01001/**
2 * The query panel
3 *
4 * @author Nils Diewald
5 */
Akron14f3ee92020-10-19 11:59:40 +02006"use strict";
7
Akron2d0d96d2019-11-18 19:49:50 +01008define([
9 'panel'
10], function (panelClass) {
11
12 const d = document;
13
14 // Localization values
15 const loc = KorAP.Locale;
16
17 return {
Akron386f1222022-12-21 16:26:11 +010018 type : 'query',
19
Akron2d0d96d2019-11-18 19:49:50 +010020 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;
Akron37ea1192021-07-28 10:40:14 +020027 const a = this.actions();
hebastaf6adf8d2019-11-26 14:04:10 +010028
Akron2d0d96d2019-11-18 19:49:50 +010029 // If plugins are enabled, add all buttons for the query panel
30 if (KorAP.Plugin) {
Akron2d0d96d2019-11-18 19:49:50 +010031
32 // Add all matchbuttons in order
Akron14f3ee92020-10-19 11:59:40 +020033 KorAP.Plugin
34 .buttonGroup("query")
35 .forEach(i => a.add.apply(a, i));
Akron2d0d96d2019-11-18 19:49:50 +010036
hebastaf6adf8d2019-11-26 14:04:10 +010037 KorAP.Plugin.clearButtonGroup("query")
Akron2d0d96d2019-11-18 19:49:50 +010038 };
39
40 return this;
41 }
42 }
43});