From 025533d90b694ed37278c8f5be85afbd05857971 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Wed, 14 Jan 2015 12:46:52 +0000 Subject: bitbake: toaster: Add layer details page feature This commit adds the layer details page which shows the metadata for the layer such as layer description, machines associated with the layer as well as the targets provided. If the layer is an imported layer this page also allows you to update the layer's configuration. >From this page you can add/remove the layer from the current project (Bitbake rev: c1442bc68ad8ba20c37b1a7cde1400297f4be811) Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/static/js/libtoaster.js | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js') diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index a2a0abd45b..04264cd8ba 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -161,6 +161,39 @@ var libtoaster = (function (){ }); }; + /* parses the query string of the current window.location to an object */ + function _parseUrlParams() { + string = window.location.search + string = string.substr(1); + stringArray = string.split ("&"); + obj = {}; + + for (i in stringArray) { + keyVal = stringArray[i].split ("="); + obj[keyVal[0]] = keyVal[1]; + } + + return obj; + }; + + /* takes a flat object and outputs it as a query string + * e.g. the output of dumpsUrlParams + */ + function _dumpsUrlParams(obj) { + var str = "?"; + + for (key in obj){ + if (!obj[key]) + continue; + + str += key+ "="+obj[key].toString(); + str += "&"; + } + + return str; + }; + + return { reload_params : reload_params, startABuild : _startABuild, @@ -169,6 +202,8 @@ var libtoaster = (function (){ getLayerDepsForProject : _getLayerDepsForProject, editProject : _editProject, debug: false, + parseUrlParams : _parseUrlParams, + dumpsUrlParams : _dumpsUrlParams, } })(); -- cgit v1.2.3-54-g00ecf