<!DOCTYPE html>
<html>
<head>
<title>Cimdit Profile generator</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
<%= grunt.file.read('tmp/default.css') %>
</style>
</head>
<body>
<form><div>
<textarea id="jsoncounter" class="lineCounter" wrap="off" readonly>1</textarea>
<textarea id="json" class="codeEditor" wrap="off">
[
  {
    "name": "Joystick",
    "customimage": " ",
    "mappedbuttons": [
      {
        "source": 20,
        "type": "JOYSTICK_BUTTON",
        "target": 1
      },
      {
        "source": 62,
        "type": "SWITCH_PROFILE"
      },
      {
        "source": 61,
        "type": "MACRO_PRESS",
        "macro": 0
      },
      {
        "source": 60,
        "type": "MACRO_PRESS",
        "macro": 1
      },
      {
        "source": 59,
        "type": "MACRO_PRESS",
        "macro": 2
      },
      {
        "source": 59,
        "type": "MACRO_RELEASE",
        "macro": 3
      },
      {
        "source": 58,
        "type": "MACRO_PRESS",
        "macro": 4
      },
      {
        "source": 58,
        "type": "MACRO_RELEASE",
        "macro": 5
      },
      {
        "source": 50,
        "type": "KEYBOARD_BUTTON",
        "target": "KEY_0"
      }
    ],
    "mappedaxis": [
      {
        "source": 0,
        "type": "JOYSTICK_AXIS",
        "axis": 1
      }, 
      {
        "source": 1,
        "type": "JOYSTICK_AXIS",
        "axis": 2
      }, 
      {
        "source": 2,
        "type": "JOYSTICK_AXIS",
        "axis": 3
      }, 
      {
        "source": 3,
        "type": "JOYSTICK_AXIS",
        "axis": 4
      }
    ],
    "mappedrotary": [
      {
        "source": 0,
        "type": "PREV_PROFILE"
      },
      {
        "source": 1,
        "type": "NEXT_PROFILE"
      }
    ],
    "macros": [
      [
        "MACRO_SPEED", 
        10, 
        "MACRO_TYPE", 
        "test"
      ],
      [
        "MACRO_SPEED", 
        10, 
        "MACRO_KEY_PRESS",
        "KEY_LEFT_SHIFT",
        "t",
        "MACRO_KEY_RELEASE",
        "t",
        "KEY_LEFT_SHIFT",
        "MACRO_TYPE",
        "est"
      ],
      [
        "MACRO_SPEED",
        10,
        "MACRO_TYPE",
        "te",
        "MACRO_JOY_PRESS",
        2,
        "MACRO_DELAY",
        2000,
        "MACRO_JOY_RELEASE",
        2,
        "MACRO_TYPE",
        "s"
      ],
      [
        "MACRO_TYPE", 
        "t"
      ],
      [
        "MACRO_MOUSE_PRESS", 
        2,
        "MACRO_KEY_PRESS",
        "KEY_LEFT_SHIFT",
        "MACRO_MOUSE_REL_X_AXIS", 
        0, 
        5, 
        "MACRO_MOUSE_REL_Y_AXIS", 
        1, 
        5
      ],
      [
        "MACRO_MOUSE_REL_X_AXIS",
        -1,
        "MACRO_MOUSE_REL_Y_AXIS",
        -1,
        "MACRO_KEY_RELEASE",
        "KEY_LEFT_SHIFT",
        "MACRO_MOUSE_RELEASE",
        2
      ]
    ]
  },
  {
    "name": "Mouse",
    "mappedbuttons": [
      {
        "source": 62,
        "type": "SWITCH_PROFILE"
      },
      {
        "source": 15, 
        "type": "MOUSE_REL_X_AXIS",
        "value": 25
      },
      {
        "source": 23, 
        "type": "MOUSE_REL_Y_AXIS",
        "value": -25
      }
    ],
    "mappedaxis": [
      {
        "source": 0,
        "type": "MOUSE_REL_X_AXIS",
        "value": 50
      },
      {
        "source": 1,
        "type": "MOUSE_REL_Y_AXIS",
        "value": 50
      }
    ],
    "mappedrotary": [
      {
        "source": 0,
        "type": "PREV_PROFILE"
      },
      {
        "source": 1,
        "type": "NEXT_PROFILE"
      }
    ]
  }
]
</textarea>
<p><button id="generatestring" class="button">Generate String</button></p>
<p id="error"></p>
<textarea id="string"></textarea>
<p><button id="generatejson" class="button">Generate Json</button></p>
</div></form>
<script type="text/javascript">
<%= grunt.file.read('tmp/bootstrap.out') %>
</script>
</body>
</html>