From 8d0140968d7dc5c54475f30b0e9bc83c35ff06b6 Mon Sep 17 00:00:00 2001 From: Marvin Martinson Date: Thu, 13 Dec 2018 11:26:52 +0200 Subject: [PATCH] Can use any id Sumo-xxxxxx or xxxxxx case insensitive also --- .gitignore | 1 + assets/js/main.js | 2 +- test.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 752c60b..41a4316 100755 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _site/ .sass-cache/ .jekyll-metadata +test.html diff --git a/assets/js/main.js b/assets/js/main.js index 6542fe9..d69d772 100755 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -231,7 +231,7 @@ window.addEventListener('load', function() { // Robot GO button listener $('.btn-robot-go').click(function() { // 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) { $('#robot-id, #robot-label').addClass('has-error'); return; diff --git a/test.html b/test.html index f8fa67f..07e88e9 100644 --- a/test.html +++ b/test.html @@ -4,7 +4,7 @@