Can use any id Sumo-xxxxxx or xxxxxx case insensitive also

This commit is contained in:
Marvin Martinson 2018-12-13 11:26:52 +02:00
parent 6515efafa9
commit 8d0140968d
3 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
_site/ _site/
.sass-cache/ .sass-cache/
.jekyll-metadata .jekyll-metadata
test.html

View File

@ -231,7 +231,7 @@ window.addEventListener('load', function() {
// Robot GO button listener // Robot GO button listener
$('.btn-robot-go').click(function() { $('.btn-robot-go').click(function() {
// Get and validate the selected robot ID // Get and validate the selected robot ID
var robotId = $('#robot-id').val().trim(); var robotId = $('#robot-id').val().trim().toLowerCase().split("-").reverse()[0];
if (robotId === '' || /^([a-zA-Z0-9]{6})$/.test(robotId) == false) { if (robotId === '' || /^([a-zA-Z0-9]{6})$/.test(robotId) == false) {
$('#robot-id, #robot-label').addClass('has-error'); $('#robot-id, #robot-label').addClass('has-error');
return; return;

View File

@ -4,7 +4,7 @@
</head> </head>
<body> <body>
<script> <script>
var exampleSocket = new WebSocket("ws://192.168.1.1:80/p2p/sumo-277344/browser/"); var exampleSocket = new WebSocket("ws://sumo.koodur.com:80/p2p/sumo-2773EE/browser/");