From 829fe326215b556ee5ca032ad3a8ff4c59a5f4c0 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Fri, 31 Jul 2015 15:09:23 +0300 Subject: 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 Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/static/js/base.js | 29 ++++++++++++++++++++++ .../toastergui/templates/projecttopbar.html | 11 +++++++- 2 files changed, 39 insertions(+), 1 deletion(-) (limited to 'bitbake') 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) { var newBuildButton = $("#new-build-button"); var newBuildTargetInput; var newBuildTargetBuildBtn; + var projectNameForm = $("#project-name-change-form"); + var projectName = $("#project-name"); + var projectNameFormToggle = $("#project-change-form-toggle"); + var projectNameChangeCancel = $("#project-name-change-cancel"); /* initially the current project is used unless overridden by the new build * button in top right nav @@ -16,6 +20,31 @@ function basePageInit(ctx) { var newBuildProjectInput = $("#new-build-button #project-name-input"); var newBuildProjectSaveBtn = $("#new-build-button #save-project-button"); + /* Project name change functionality */ + projectNameFormToggle.click(function(e){ + e.preventDefault(); + + $(this).add(projectName).hide(); + projectNameForm.fadeIn(); + }); + + projectNameChangeCancel.click(function(e){ + e.preventDefault(); + + projectNameForm.hide(); + projectName.add(projectNameFormToggle).fadeIn(); + }); + + $("#project-name-change-btn").click(function(e){ + var newProjectName = $("#project-name-change-input").val(); + + libtoaster.editCurrentProject({ projectName: newProjectName },function (){ + + projectName.text(newProjectName); + libtoaster.ctx.projectName = newProjectName; + projectNameChangeCancel.click(); + }); + }); _checkProjectBuildable(); 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 @@
-- cgit v1.2.3-54-g00ecf