<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <script src="./linkStacktrace.js" type="text/javascript"></script>
  <title>linkStacktrace</title>
</head>
<body>
  <p>
    Hi! linkStacktrace will go through a Java stacktrace, search for files in a Github repository and add links to the stacktrace.
  </p>
  <textarea id="stacktrace" placeholder="Enter the stacktrace here" rows="32" cols="120"></textarea>
  <input id="userRepo" type="text" placeholder="user OR user/repo"/>
  <input id="submit" type="submit" value="Submit" onclick="document.getElementById('stacktrace').value = linkStacktrace('5450665e1ee6e2894c5accb47b4488546931a6d4', document.getElementById('stacktrace').value, document.getElementById('userRepo').value); return false;"/>
  </body>
</html>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8"/>
  <script src="./linkStacktrace.js" type="text/javascript"></script>
  <script type="text/javascript">
    var token = "5450665e1ee6e2894c5accb47b4488546931a6d4";
    function onSubmit() {
        var stacktrace = document.getElementById('stacktrace').value;
        var userRepo = document.getElementById('userRepo').value;
        if(userRepo.length == 0) {
            alert("You need to enter a user or repository in the user/repository field!");
        } else if(userRepo.split('/').length > 1) {
            alert("Can’t parse user or repo – must have at most one slash ('/')!");
        } else {
            document.getElementById('stacktrace').value = linkStacktrace(token, stacktrace, userRepo);
        }
    }
  </script>
  <title>linkStacktrace</title>
</head>
<body>
  <p>
    Hi! linkStacktrace will go through a Java stacktrace, search for files in a Github repository and add links to the stacktrace.
  </p>
  <textarea id="stacktrace" placeholder="Enter the stacktrace here" rows="32" cols="120"></textarea>
  <input id="userRepo" type="text" placeholder="user OR user/repo"/>
  <input id="submit" type="submit" value="Submit" onclick="onSubmit(); return false"/>
  </body>
</html>

Validate user/repo field before linkStacktrace call
Validate user/repo field before linkStacktrace call

Also puts the submit code into an own function.
