summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2015-07-31 15:09:23 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 11:26:13 +0100
commit829fe326215b556ee5ca032ad3a8ff4c59a5f4c0 (patch)
treeaecb763e8dc439f3a999b5a721b5e0b0dc217126 /bitbake
parentc76137e25b285f3f31c162b888cf14c8999ead07 (diff)
downloadpoky-829fe326215b556ee5ca032ad3a8ff4c59a5f4c0.tar.gz
bitbake: toastergui: project page Add inline project name change feature
This feature allows the project name to be changed from where ever it is displayed in the project pages. [YOCTO #7329] (Bitbake rev: 81cb1cd1aa900f29a25d14dce93d301cd6b6fdb7) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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">