summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectpage.js17
-rw-r--r--bitbake/lib/toaster/toastergui/templates/project.html3
2 files changed, 19 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectpage.js b/bitbake/lib/toaster/toastergui/static/js/projectpage.js
index 4536703649..21adf816c6 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectpage.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectpage.js
@@ -12,6 +12,8 @@ function projectPageInit(ctx) {
12 var machineChangeFormToggle = $("#change-machine-toggle"); 12 var machineChangeFormToggle = $("#change-machine-toggle");
13 var machineNameTitle = $("#project-machine-name"); 13 var machineNameTitle = $("#project-machine-name");
14 var machineChangeCancel = $("#cancel-machine-change"); 14 var machineChangeCancel = $("#cancel-machine-change");
15 var machineInputForm = $("#machine-input-form");
16 var invalidMachineNameHelp = $("#invalid-machine-name-help");
15 17
16 var freqBuildBtn = $("#freq-build-btn"); 18 var freqBuildBtn = $("#freq-build-btn");
17 var freqBuildList = $("#freq-build-list"); 19 var freqBuildList = $("#freq-build-list");
@@ -208,8 +210,23 @@ function projectPageInit(ctx) {
208 210
209 211
210 /* Change machine functionality */ 212 /* Change machine functionality */
213 machineChangeInput.keyup(function(){
214 if ($(this).val().indexOf(' ') >= 0) {
215 machineChangeBtn.attr("disabled", "disabled");
216 invalidMachineNameHelp.show();
217 machineInputForm.addClass('has-error');
218 } else {
219 machineChangeBtn.removeAttr("disabled");
220 invalidMachineNameHelp.hide();
221 machineInputForm.removeClass('has-error');
222 }
223 });
211 224
212 machineChangeFormToggle.click(function(){ 225 machineChangeFormToggle.click(function(){
226 machineChangeInput.val(machineNameTitle.text());
227 machineChangeBtn.removeAttr("disabled");
228 invalidMachineNameHelp.hide();
229 machineInputForm.removeClass('has-error');
213 machineForm.slideDown(); 230 machineForm.slideDown();
214 machineNameTitle.hide(); 231 machineNameTitle.hide();
215 $(this).hide(); 232 $(this).hide();
diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html
index 5abe241305..ab7e665b64 100644
--- a/bitbake/lib/toaster/toastergui/templates/project.html
+++ b/bitbake/lib/toaster/toastergui/templates/project.html
@@ -67,11 +67,12 @@
67 67
68 <form id="select-machine-form" style="display:none;" class="form-inline"> 68 <form id="select-machine-form" style="display:none;" class="form-inline">
69 <span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span> 69 <span class="help-block">Machine suggestions come from the list of layers added to your project. If you don't see the machine you are looking for, <a href="{% url 'projectmachines' project.id %}">check the full list of machines</a></span>
70 <div class="form-group"> 70 <div class="form-group" id="machine-input-form">
71 <input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text"> 71 <input class="form-control" id="machine-change-input" autocomplete="off" value="" data-provide="typeahead" data-minlength="1" data-autocomplete="off" type="text">
72 </div> 72 </div>
73 <button id="machine-change-btn" class="btn btn-default" type="button">Save</button> 73 <button id="machine-change-btn" class="btn btn-default" type="button">Save</button>
74 <a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a> 74 <a href="#" id="cancel-machine-change" class="btn btn-link">Cancel</a>
75 <span class="help-block text-danger" id="invalid-machine-name-help" style="display:none">A valid machine name cannot include spaces.</span>
75 <p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p> 76 <p class="form-link"><a href="{% url 'projectmachines' project.id %}">View compatible machines</a></p>
76 </form> 77 </form>
77 </div> 78 </div>