<!DOCTYPE html>
<html>
  <head>
    <title>Plugin demo</title>

    <link type="text/css" rel="stylesheet" href="/css/kalamar-plugin.css" />

    <!-- load client javascript library -->
    <script src="/js/src/plugin/client.js" data-server="http://localhost:3003/"></script>
    <style>
      body, html {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        border-width: 0;
        height: unset !important;
      }

      body {
        min-height: unset !important;
      }
    </style>
  </head>
  <body class="result-view">
    <h2>Example Widget!</h2>
    <script>
      function flood () {
        var i = 0;
        for (; i < 90; i++) {
          KorAPlugin.sendMsg({
            'action' : '-'
          });
        };
      };

      function pluginit (p) {
        p.onMessage = function(msg) {
          switch (msg.key) {
            // console.log("State changed to", msg.key, msg.value);
            case 'glemm':
              let data = {
                'action' : 'pipe',
                'service' : 'http://glemm/'
              };
                   
              if (!msg.value) {
                data['job'] = 'del';
              };
              KorAPlugin.sendMsg(data);
              break;
          }
        };
      };

      function redirect() {

        KorAPlugin.requestMsg({
          "action":"get",
          "key": 'QueryParam'
        }, function (d) {

          const par = new URLSearchParams(d.value.search);
          par.set("q",56);
          
          KorAPlugin.sendMsg({
            'action':'redirect',
            'queryParam' : par.toString()
          })
        });
      }

      function getQueryParam() {
        KorAPlugin.requestMsg({
          "action":"get",
          "key": 'QueryParam'
        }, function (d) {
          KorAPlugin.log(0, d.value.search);
        });
      }

      
      </script>
    <ul>
      <li><a onclick="KorAPlugin.log(333, 'Huhu!')">Send log!</a></li>
      <li><a onclick="KorAPlugin.resize()">Resize</a></li>
      <li><a onclick="KorAPlugin.sendMsg({'action':'pipe','service':'Glemm'})">Add Glemm</a></li>
      <li><a onclick="getQueryParam()">GetQueryParam</a></li>
      <li><a onclick="redirect()">Redirect</a></li>
      <li><a onclick="flood()">Flood!</a></li>
      <li><a onclick="KorAPlugin.requestMsg({'action':'get', 'key':'KQ'}, function (d) { document.write(JSON.stringify(d.value))})">Get KQ</a></li>
      <li><a onclick="KorAPlugin.requestMsg({'action':'get', 'key':'textSigle', 'value':'textSigle'}, function (d) { document.write(JSON.stringify(d.value))})">Get textSigle</a></li>
    </ul>
    <p style="width: 2000px">------------------------------------------------------------------------------------------------------------------------</p>
  </body>
</html>
