Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 00AA8E006D1; Thu, 19 Nov 2015 10:38:34 -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,DKIM_SIGNED, DKIM_VALID,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 * [74.125.82.44 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4B41FE0049B for ; Thu, 19 Nov 2015 10:38:28 -0800 (PST) Received: by wmdw130 with SMTP id w130so252221136wmd.0 for ; Thu, 19 Nov 2015 10:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ld6q7MGz3t6nSq7chzLOW+pQ8IveVGH2EjqzkIu/x7Q=; b=MKbAyZ6gnDygMWz+HOoP4eVd/JcyTwq5KVgcV/vfE71h0R0EyQAmQCIidDqp976Cmc 8bg6xXhZhM1H3iAaOEy2jYpmwhkCQmxZZ4V3BXNKqFZw3Rnzm/lCeyZg2o8iNxlqLsAx wkD0wQC6QH6Cp+FLFKrRNx/izIn8hUwIqnlRnDAKNVUKokfW0MprPwuEthwgqdF/6ZG7 x/fm2Emi/rByBEw2G0XABK0BY+ze2Zt6leF7GCKJRemrPZ5aAdj069V7ChT1rvwGXnzG A5RARunutMOaXuNj1PImFoW6fm27Syok3a5mLPVdmc7/JzROhONW0RH9/VVFoATdKYmk rzzw== 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=ld6q7MGz3t6nSq7chzLOW+pQ8IveVGH2EjqzkIu/x7Q=; b=QgLpxOGrp/CYYF0i5nej/jBlPanKPPFRL42b6pdllrzZzcWKBOoHFtbTzWoH/SoECW JxFEie6ymgblA0FAManEIV2ahqafYqQkzjsIoirz8v+BNSDEsQQ1JOimrJ71596u26I7 ZbGST6wezMz90GOAXGpQpmh9oyZ61Jn9K721hkut0LHHm6WK0VLk5sTY0EJj8mI5G90k OmwEpSXnVpsBO7Y8pJngIYdt53HaozWA5Xx9qRfK8Nnia9Ewu2xfjLuhxiryIfxlpgee goPz5oa3y6pDkt9sa+zv12cwET16WZndbhRlXuzwVmJh7HdbcqzDCDCETfPKJyuQGn1Y mgyA== X-Gm-Message-State: ALoCoQl+zEQmLMWd879DWdZQNM3pZwMEvf+9JllS76VRukGcvkYncBjSzRrGmeuJ0dc5CcK6c8A+ X-Received: by 10.194.52.68 with SMTP id r4mr9603812wjo.8.1447958307903; Thu, 19 Nov 2015 10:38:27 -0800 (PST) Received: from draco.icx.intel.com ([83.217.123.106]) by smtp.gmail.com with ESMTPSA id jt9sm9131998wjc.24.2015.11.19.10.38.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 10:38:27 -0800 (PST) From: Michael Wood To: toaster@yoctoproject.org Date: Thu, 19 Nov 2015 18:38:24 +0000 Message-Id: <1447958304-4961-1-git-send-email-michael.g.wood@intel.com> X-Mailer: git-send-email 2.1.4 Subject: [PATCH] toaster: projectconf Add feature for free form IMAGE_FSTYPES 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: Thu, 19 Nov 2015 18:38:35 -0000 Add feature to the projectconf page to allow free form input of IMAGE_FSTYPES. Sometimes a recipe can provide an IMAGE_FSTYPE that isn't in the normal image_types class. So would need to be specified manually. [YOCTO #7828] Signed-off-by: Michael Wood --- .../toaster/toastergui/templates/projectconf.html | 95 +++++++++++++++++----- 1 file changed, 75 insertions(+), 20 deletions(-) diff --git a/bitbake/lib/toaster/toastergui/templates/projectconf.html b/bitbake/lib/toaster/toastergui/templates/projectconf.html index 30fd03e..13dde78 100644 --- a/bitbake/lib/toaster/toastergui/templates/projectconf.html +++ b/bitbake/lib/toaster/toastergui/templates/projectconf.html @@ -36,18 +36,35 @@ IMAGE_FSTYPES -
- {{fstypes}} - -
+

+ You must select at least one image type +

+ + +
+ + +
+ + {% endif %} {% if image_install_append_defined %} @@ -597,17 +614,52 @@ } }); - $('#apply-change-image_fstypes').click(function(){ - // extract the selected fstypes and sort them - var fstypes_array = []; - var checkboxes = document.getElementsByClassName('fs-checkbox-fstypes'); - $(".fs-checkbox-fstypes:checked").each(function(){ - fstypes_array.push($(this).val()); - }); - fstypes_array.sort(); + var fsTypesInput = $("#new-image-fstype-input"); + var fsTypesApplyBtn = $('#apply-change-image_fstypes'); + var invalidCharsMsg = $("#invalid-chars-in-fstype-msg"); + + fsTypesInput.on('input', function(){ + if ($(this).val()) { + fsTypesApplyBtn.removeAttr('disabled'); + $("#fstypes-error-message").hide(); + } + invalidCharsMsg.hide(); + }); + + fsTypesApplyBtn.click(function(e){ + e.preventDefault(); + + var fstypes = ''; + // extract the selected fstypes and sort them + var fstypes_array = []; + var checkboxes = document.getElementsByClassName('fs-checkbox-fstypes'); + $(".fs-checkbox-fstypes:checked").each(function(){ + fstypes_array.push($(this).val()); + }); + fstypes_array.sort(); + + if (fsTypesInput.val().length !== 0) { + var existsMsg = $("#exists-fstype-msg"); + + /* No whitespace or underscores allowed */ + if (fsTypesInput.val().match(/\_/)) { + invalidCharsMsg.show(); + return; + } else { + invalidCharsMsg.hide(); + } + + if (fstypes_array.indexOf(fsTypesInput.val()) !== -1){ + existsMsg.show(); + return; + } else { + existsMsg.hide(); + } + + fstypes += fsTypesInput.val()+' '; + } // now make a string of them - var fstypes = ''; for (var i = 0, length = fstypes_array.length; i < length; i++) { fstypes += fstypes_array[i] + ' '; } @@ -620,6 +672,9 @@ $("#change-image_fstypes-form").slideUp(function() { $('#image_fstypes, #change-image_fstypes-icon').show(); }); + + + fsTypesInput.val(""); }); {% endif %} -- 2.1.4