<!DOCTYPE html>
<html>
  <head>
    <title>Panel and ButtonGroup demo</title>
    <meta charset="utf-8" />
    <script src="../js/lib/require.js" async="async"></script>
    <link type="text/css" rel="stylesheet" href="../css/kalamar.css" />
  </head>
  <body>
    <nav id="mainButton" style="position: absolute; width: 100%; top: 150px"></nav>
  </body>
  <script>
requirejs.config({
  baseUrl: '../js/src',
  paths : {
    'lib': '../lib'
  }
});


require(['buttongroup', 'panel', 'view/result/koralquery', 'state'], function (btnClass, panelClass, kqClass, stateClass) {
  KorAP.koralQuery = {
    '@type' : "https://beispiel",
    'key' : 'Cool'
  };

  let panel = panelClass.create();
  let actions = panel.actions();

  // Add simple button
  actions.add('Meta',{'cls':['meta']}, function () {
    console.log(this.button.classList.contains('meta'));
    view = kqClass.create();
    panel.add(view);
  });

  // Add list button
  var list = actions.addList('More', ['list']);

  list.list.readItems([
    ['cool', 'cool', function (e, action) { console.log('really' + this.action()) }],
    ['very cool', 'veryCool', function (e, action) { console.log('very cool') }]
  ]);

  // Add toggle button
  let s = stateClass.create(true);

  let bgChange = {
    setState : function (val) {
      if (val) {
        document.body.style.backgroundColor = 'red';
      } else {
        document.body.style.backgroundColor = 'transparent';
      }
    }
  };

  s.associate(bgChange);

  actions.addToggle('Background',['bg'], s);

  document.getElementById('mainButton').appendChild(panel.element());
});


  </script>
</html>
