blob: f309cbdf34cd6e87f386504bce54c394565ece07 [file] [log] [blame]
Akron52ed22d2018-07-11 17:05:19 +02001<!DOCTYPE html>
2<html>
3 <head>
Akron537bc522018-07-13 19:06:27 +02004 <title>Panel and ButtonGroup demo</title>
Akron52ed22d2018-07-11 17:05:19 +02005 <meta charset="utf-8" />
6 <script src="../js/lib/require.js" async="async"></script>
7 <link type="text/css" rel="stylesheet" href="../css/kalamar.css" />
8 </head>
9 <body>
Akron537bc522018-07-13 19:06:27 +020010 <nav id="mainButton" style="position: absolute; width: 100%; top: 150px"></nav>
Akron52ed22d2018-07-11 17:05:19 +020011 </body>
12 <script>
13requirejs.config({
14 baseUrl: '../js/src',
15 paths : {
16 'lib': '../lib'
17 }
18});
19
20
Akron4d926f12018-07-16 15:30:25 +020021require(['buttongroup', 'panel', 'view/koralquery'], function (btnClass, panelClass, kqClass) {
22 KorAP.koralQuery = {
23 '@type' : "https://beispiel",
24 'key' : 'Cool'
25 };
26
27 var panel = panelClass.create();
Akron537bc522018-07-13 19:06:27 +020028 var actions = panel.actions;
Akron4d926f12018-07-16 15:30:25 +020029
Akron537bc522018-07-13 19:06:27 +020030 actions.add('Meta',['meta'], function () {
Akron52ed22d2018-07-11 17:05:19 +020031 console.log(this.button.classList.contains('meta'));
Akron4d926f12018-07-16 15:30:25 +020032 view = kqClass.create();
Akron537bc522018-07-13 19:06:27 +020033 panel.add(view);
Akron52ed22d2018-07-11 17:05:19 +020034 });
Akron4d926f12018-07-16 15:30:25 +020035
Akron537bc522018-07-13 19:06:27 +020036 var list = actions.addList('More', ['list']);
Akron4d926f12018-07-16 15:30:25 +020037
Akron52ed22d2018-07-11 17:05:19 +020038 list.readItems([
39 ['cool', 'cool', function (e, action) { console.log('really' + this.action()) }],
40 ['very cool', 'veryCool', function (e, action) { console.log('very cool') }]
41 ]);
Akron537bc522018-07-13 19:06:27 +020042
43 document.getElementById('mainButton').appendChild(panel.element());
Akron52ed22d2018-07-11 17:05:19 +020044});
45
46
47 </script>
48</html>