1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

bitbake: toaster: Create libtoaster.js with some utility functions

Replace main.js with libtoaster. This can be a place for common
functionality for toaster. Calling it lib... makes it more obvious as
well as helps with code readability due to the namespacing.

(Bitbake rev: cdf6178ae3675b40afca9f08d491ca1b7e45914e)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Michael Wood
2014-11-11 16:23:58 +00:00
committed by Richard Purdie
parent 0b6859cdf3
commit fa9206e427
3 changed files with 239 additions and 138 deletions
@@ -18,36 +18,11 @@
</script>
<script src="{% static 'js/prettify.js' %}">
</script>
<script src="{% static 'js/main.js' %}">
<script src="{% static 'js/libtoaster.js' %}">
</script>
</script>
<script>
function reload_params(params) {
uri = window.location.href;
splitlist = uri.split("?");
url = splitlist[0], parameters=splitlist[1];
// deserialize the call parameters
if(parameters){
cparams = parameters.split("&");
}else{
cparams = []
}
nparams = {}
for (i = 0; i < cparams.length; i++) {
temp = cparams[i].split("=");
nparams[temp[0]] = temp[1];
}
// update parameter values
for (i in params) {
nparams[encodeURIComponent(i)] = encodeURIComponent(params[i]);
}
// serialize the structure
callparams = []
for (i in nparams) {
callparams.push(i+"="+nparams[i]);
}
window.location.href = url+"?"+callparams.join('&');
}
</script>
{% block extraheadcontent %}