diff --git a/css/themes/base16-default.css b/css/themes/base16-default.css index ec40fcb..dea026f 100644 --- a/css/themes/base16-default.css +++ b/css/themes/base16-default.css @@ -301,6 +301,9 @@ tr.bufferline:hover { input[type=text], input[type=password], #sendMessage, .badge { box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(0, 0, 0, 0.2) inset; } +input[type=text].is-invalid{ + box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(255, 0, 0, 0.6) inset; +} input[type=text], input[type=password], #sendMessage, .btn-send, .btn-send-image, .btn-complete-nick { color: var(--base05); diff --git a/css/themes/dark.css b/css/themes/dark.css index da260c8..7e79db3 100644 --- a/css/themes/dark.css +++ b/css/themes/dark.css @@ -86,6 +86,9 @@ input[type=text], input[type=password], #sendMessage, .badge, .btn-send, .btn-se color: #ccc; background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.3); } +input[type=text].is-invalid{ + box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(255, 0, 0, 0.8) inset; +} .btn-complete-nick:hover, .btn-complete-nick:focus, .btn-send:hover, .btn-send:focus, diff --git a/css/themes/light.css b/css/themes/light.css index be8012e..323e6c8 100644 --- a/css/themes/light.css +++ b/css/themes/light.css @@ -68,6 +68,9 @@ select.form-control, select option, input[type=text], input[type=password], #sen box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.1), 0px 1px 7px 0px rgba(255, 255, 255, 0.8) inset; background: none repeat scroll 0% 0% rgba(255, 255, 255, 0.3); } +input[type=text].is-invalid{ + box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.1), 0px 1px 7px 0px rgba(255, 0, 0, 0.8) inset; +} #connection-infos { color: #aaa; diff --git a/index.html b/index.html index 3505dc3..8491b70 100644 --- a/index.html +++ b/index.html @@ -104,7 +104,7 @@
- +
@@ -136,7 +136,7 @@
- +
diff --git a/js/glowingbear.js b/js/glowingbear.js index 58f6d14..fe9e075 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -663,31 +663,32 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', //If host is specified here the dedicated port field is disabled var parts; + $rootScope.hostInvalid = false; //host var regexHost = /^([^:\/]*|\[.*\])$/; var regexHostPort = /^([^:]*|\[.*\]):(\d+)$/; var regexHostPortPath = /^([^:]*|\[.*\]):(\d*)\/(.+)$/; - if((parts = regexHost.exec(settings.host)) !== null) - { + if((parts = regexHost.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; $rootScope.portDisabled = false; } //host:port - else if((parts = regexHostPort.exec(settings.host)) !== null) - { + else if((parts = regexHostPort.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; settings.port = parts[2]; $rootScope.portDisabled = true; } //host:port/path - else if((parts = regexHostPortPath.exec(settings.host)) !== null) - { + else if((parts = regexHostPortPath.exec(settings.host)) !== null) { settings.hostOnly = parts[1]; settings.port = parts[2]; settings.path = parts[3]; $rootScope.portDisabled = true; } + else { + $rootScope.hostInvalid = true; + } };