diff --git a/Vocaluxe/Website/index.html b/Vocaluxe/Website/index.html index fdb14c43..3ef1620b 100644 --- a/Vocaluxe/Website/index.html +++ b/Vocaluxe/Website/index.html @@ -319,8 +319,13 @@
diff --git a/Vocaluxe/Website/js/main.js b/Vocaluxe/Website/js/main.js index 1719d00f..814d253b 100644 --- a/Vocaluxe/Website/js/main.js +++ b/Vocaluxe/Website/js/main.js @@ -26,11 +26,11 @@ function preStart() { translator.translationLoaded.done(function () { translator.translate(); - + sessionHandler = new SessionHandler(); imageLoader = new ImageLoader(); externalServices = new ExternalServices(); - pageHandler = new PageHandler(); + pageHandler = new PageHandler(); pageHandler.init(); }); @@ -154,7 +154,7 @@ } }; } - + function ExternalServices() { var popupVideoHeight = 390; var popupVideoWidth = 640; @@ -190,7 +190,7 @@ 'height': h - (ifrPadding + ifrBorder) }; } - + $("#popupVideo").find("a").click(function () { $("#popupVideo").popup("close"); $("#popupVideo").popup("close"); //Sometimes twice?? @@ -641,7 +641,6 @@ var KeyboardPageHandler = function () { var init = function () { - initKeyboardPageHandler(); }; @@ -694,26 +693,45 @@ }); }); + $("#keyboardAutoSend").change(function () { + if ($('#keyboardAutoSend').is(':checked')) { + $('#keyboardButtonSend').hide(); + } else { + $('#keyboardButtonSend').show(); + } + }); + + $('#keyboardButtonSend').click(function () { + sendKeyboardText(); + }); $('#keyboardButtonKeys').keyup(function (e) { + if (!$('#keyboardAutoSend').is(':checked') && e.keyCode != 13) { + return; + } + sendKeyboardText(); + }); + + function sendKeyboardText() { var text = $('#keyboardButtonKeys')[0].value; - $('#keyboardButtonKeys')[0].value = ""; if (text.length <= 0) { return; } + $('#keyboardButtonKeys')[0].value = ""; + $('#keyboardButtonKeys').first().focus(); - /* if ($('#keyboardButtonFunct').is(':checked')) { - $('#keyboardButtonKeys')[0].value = text.splice(1) + $('#keyboardButtonKeys')[0].value; - var numericElements = /^[0-9][0-9]?/.exec(text.charAt(0)); - if (parseInt(numericElements)) { - request({ - url: "sendKeyEvent?key=F" + numericElements - }); - } - $("#keyboardButtonFunct").attr("checked", false).checkboxradio("refresh"); - }*/ + /* if ($('#keyboardButtonFunct').is(':checked')) { + $('#keyboardButtonKeys')[0].value = text.splice(1) + $('#keyboardButtonKeys')[0].value; + var numericElements = /^[0-9][0-9]?/.exec(text.charAt(0)); + if (parseInt(numericElements)) { + request({ + url: "sendKeyEvent?key=F" + numericElements + }); + } + $("#keyboardButtonFunct").attr("checked", false).checkboxradio("refresh"); + }*/ request({ contentType: "application/json;charset=utf-8", @@ -726,8 +744,7 @@ }).fail(function () { $('#keyboardButtonKeys')[0].value = text + $('#keyboardButtonKeys')[0].value; }); - - }); + } }; init(); @@ -835,7 +852,7 @@ } }; - var handleDisplayProfileData = function(data) { + var handleDisplayProfileData = function (data) { $('#playerName').prop("value", data.PlayerName); imageLoader.addImage($('#playerAvatar')[0], data.Avatar, "img/profile.png"); @@ -852,19 +869,19 @@ $('#playerPassword').prop('disabled', false).prop("value", "***__oldPassword__***").parent().show(); $('#playerPasswordLabel').show(); - $('#playerAvatar').click(function() { + $('#playerAvatar').click(function () { if ($('#captureContainer').length > 0) { $('#captureContainer').remove(); } if (document.location.protocol == "file:" - && typeof(navigator) != 'undefined' - && typeof(navigator.camera) != 'undefined' - && typeof(navigator.camera.getPicture) != 'undefined') { - navigator.camera.getPicture(function(imageData) { + && typeof (navigator) != 'undefined' + && typeof (navigator.camera) != 'undefined' + && typeof (navigator.camera.getPicture) != 'undefined') { + navigator.camera.getPicture(function (imageData) { $('#playerAvatar').prop("src", "data:image/jpeg;base64," + imageData); $('#playerAvatar').data("changed", true); - }, function() { + }, function () { //Fail - do nothing }, { destinationType: navigator.camera.DestinationType.DATA_URL, @@ -877,11 +894,11 @@ } else { $(document.body).append('