Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 817A0E007AB; Fri, 6 Feb 2015 10:45:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.181 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 831D4E00753 for ; Fri, 6 Feb 2015 10:45:27 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id fb4so4561202wid.2 for ; Fri, 06 Feb 2015 10:45:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UVqw0cFmarlPKVRV7PTFAY07gBmLP1u7oglLuqeLpI0=; b=ICDdTGyKkP2ai0hEhQ86oYK8igQANCtRHnOviYrK4PvzxOYQwypt800ddPuSgcfkSl YJNd1+tAebHyDLYYVXmqPsB2zkjwmab9ZlWfhkoqTKx1qt2LlXZNqkjOCkwSMnNtQ6zz gbVmzbuVHtAo5ift8DESyiZqe4pW+TkXRy1LHrJuwtC3MUXVeHyZ1MbWWzPSlF0ib/tT f54DAB6ti9k+YQQYsHaxydD0f6DCcb1RhmwB2uXsFY1sfjTOGfpOPP2XpSBtWpVC2TsO 5mfxtiGsyDp0Kmo7MQ+yK5rBphmSZhczhHuhYEw6hxZiU/KjVavomDv4l7Xn7isEgRC7 EtbA== X-Gm-Message-State: ALoCoQmK5nks1vm4xPM0gSVTrP0H6NzKlzUdekfNSocDZpCaIc8H9UOVjAic0YduZEG44ERBkqjC X-Received: by 10.180.103.7 with SMTP id fs7mr5974863wib.81.1423248320847; Fri, 06 Feb 2015 10:45:20 -0800 (PST) Received: from draco.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id r8sm2558381wib.16.2015.02.06.10.45.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Feb 2015 10:45:20 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Fri, 6 Feb 2015 18:45:06 +0000 Message-Id: <1423248306-934-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.0 Subject: [PATCH] bitbake: toaster: Use on input event for validation rather than keyup X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Feb 2015 18:45:29 -0000 Avoid using keyup event to trigger form validation as this won't fire for events such as pasting or autofill from the browser. [YOCTO #7292] Signed-off-by: Michael Wood --- bitbake/lib/toaster/toastergui/static/js/importlayer.js | 6 +++--- bitbake/lib/toaster/toastergui/static/js/layerdetails.js | 2 +- bitbake/lib/toaster/toastergui/templates/newproject.html | 2 +- bitbake/lib/toaster/toastergui/templates/projectconf.html | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/static/js/importlayer.js b/bitbake/lib/toaster/toastergui/static/js/importlayer.js index d6e140f..e782bda 100644 --- a/bitbake/lib/toaster/toastergui/static/js/importlayer.js +++ b/bitbake/lib/toaster/toastergui/static/js/importlayer.js @@ -245,15 +245,15 @@ function importLayerPageInit (ctx) { enable_import_btn(true); } - vcsURLInput.keyup(function() { + vcsURLInput.on('input', function() { check_form(); }); - gitRefInput.keyup(function() { + gitRefInput.on('input', function() { check_form(); }); - layerNameInput.keyup(function() { + layerNameInput.on('input', function() { if ($(this).val() && !validLayerName.test($(this).val())){ layerNameCtrl.addClass("error") $("#invalid-layer-name-hint").show(); diff --git a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js index 2793225..3e64d4a 100644 --- a/bitbake/lib/toaster/toastergui/static/js/layerdetails.js +++ b/bitbake/lib/toaster/toastergui/static/js/layerdetails.js @@ -351,7 +351,7 @@ function layerDetailsPageInit (ctx) { }); /* Disable the change button when we have no data in the input */ - $("dl input, dl textarea").keyup(function() { + $("dl input, dl textarea").on("input",function() { if ($(this).val().length == 0) $(this).parent().children(".change-btn").attr("disabled", "disabled"); else diff --git a/bitbake/lib/toaster/toastergui/templates/newproject.html b/bitbake/lib/toaster/toastergui/templates/newproject.html index 0265564..dcb6590 100644 --- a/bitbake/lib/toaster/toastergui/templates/newproject.html +++ b/bitbake/lib/toaster/toastergui/templates/newproject.html @@ -72,7 +72,7 @@ $('.btn-primary').attr('disabled', 'disabled'); // enable submit button when all required fields are populated - $("input#new-project-name").keyup(function() { + $("input#new-project-name").on('input', function() { if ($("input#new-project-name").val().length > 0 ){ $('.btn-primary').removeAttr('disabled'); $(".help-inline").css('visibility','hidden'); diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index edcad18..0d38a92 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html @@ -269,7 +269,7 @@ }); }); - $(".js-new-config_var").keyup(function(){ + $(".js-new-config_var").on('input', function(){ if ($(this).val().length == 0) { $(".js-apply-change-config_var").attr("disabled","disabled"); } @@ -386,7 +386,7 @@ }); }); - $("#new-distro").keyup(function(){ + $("#new-distro").on('input', function(){ if ($(this).val().length == 0) { $("#apply-change-distro").attr("disabled","disabled"); } @@ -469,7 +469,7 @@ }); }); - $("#new-image_install").keyup(function(){ + $("#new-image_install").on('input', function(){ if ($(this).val().length == 0) { $("#apply-change-image_install").attr("disabled","disabled"); } @@ -629,7 +629,7 @@ }); //activate / deactivate save added variable button - $("#variable, #value").keyup(function() { + $("#variable, #value").on('input', function() { if ( $("#variable").val().length > 0 && $("#value").val().trim().length > 0 ) { $(".save").removeAttr("disabled"); } -- 2.1.0