summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/base.js29
-rw-r--r--bitbake/lib/toaster/toastergui/templates/projecttopbar.html11
2 files changed, 39 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/base.js b/bitbake/lib/toaster/toastergui/static/js/base.js
index 09c3ef137b..f25336110a 100644
--- a/bitbake/lib/toaster/toastergui/static/js/base.js
+++ b/bitbake/lib/toaster/toastergui/static/js/base.js
@@ -5,6 +5,10 @@ function basePageInit(ctx) {
5 var newBuildButton = $("#new-build-button"); 5 var newBuildButton = $("#new-build-button");
6 var newBuildTargetInput; 6 var newBuildTargetInput;
7 var newBuildTargetBuildBtn; 7 var newBuildTargetBuildBtn;
8 var projectNameForm = $("#project-name-change-form");
9 var projectName = $("#project-name");
10 var projectNameFormToggle = $("#project-change-form-toggle");
11 var projectNameChangeCancel = $("#project-name-change-cancel");
8 12
9 /* initially the current project is used unless overridden by the new build 13 /* initially the current project is used unless overridden by the new build
10 * button in top right nav 14 * button in top right nav
@@ -16,6 +20,31 @@ function basePageInit(ctx) {
16 var newBuildProjectInput = $("#new-build-button #project-name-input"); 20 var newBuildProjectInput = $("#new-build-button #project-name-input");
17 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button"); 21 var newBuildProjectSaveBtn = $("#new-build-button #save-project-button");
18 22
23 /* Project name change functionality */
24 projectNameFormToggle.click(function(e){
25 e.preventDefault();
26
27 $(this).add(projectName).hide();
28 projectNameForm.fadeIn();
29 });
30
31 projectNameChangeCancel.click(function(e){
32 e.preventDefault();
33
34 projectNameForm.hide();
35 projectName.add(projectNameFormToggle).fadeIn();
36 });
37
38 $("#project-name-change-btn").click(function(e){
39 var newProjectName = $("#project-name-change-input").val();
40
41 libtoaster.editCurrentProject({ projectName: newProjectName },function (){
42
43 projectName.text(newProjectName);
44 libtoaster.ctx.projectName = newProjectName;
45 projectNameChangeCancel.click();
46 });
47 });
19 48
20 _checkProjectBuildable(); 49 _checkProjectBuildable();
21 50
diff --git a/bitbake/lib/toaster/toastergui/templates/projecttopbar.html b/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
index d4d1951ae4..79f6d1e346 100644
--- a/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
+++ b/bitbake/lib/toaster/toastergui/templates/projecttopbar.html
@@ -5,7 +5,16 @@
5 5
6<!-- project name --> 6<!-- project name -->
7<div class="row-fluid page-header"> 7<div class="row-fluid page-header">
8 <h1>{{project.name}}</h1> 8 <h1><span id="project-name">{{project.name}}</span>
9 <i class="icon-pencil" data-original-title="" id="project-change-form-toggle" title=""></i>
10 </h1>
11 <form id="project-name-change-form" style="margin-bottom: 0px; display: none;">
12 <div class="input-append">
13 <input class="huge input-xxlarge" type="text" id="project-name-change-input" autocomplete="off" value="{{project.name}}">
14 <button id="project-name-change-btn" class="btn btn-large" type="button">Save</button>
15 <a href="#" id="project-name-change-cancel" class="btn btn-large btn-link">Cancel</a>
16 </div>
17 </form>
9</div> 18</div>
10 19
11<div class="row-fluid" id="project-topbar"> 20<div class="row-fluid" id="project-topbar">