diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/libtoaster.js')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/libtoaster.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js index 1012034404b..e81f5670574 100644 --- a/bitbake/lib/toaster/toastergui/static/js/libtoaster.js +++ b/bitbake/lib/toaster/toastergui/static/js/libtoaster.js @@ -332,6 +332,32 @@ var libtoaster = (function (){ $("#change-notification, #change-notification *").fadeIn(); } + function _createCustomRecipe(name, baseRecipeId, doneCb){ + var data = { + 'name' : name, + 'project' : libtoaster.ctx.projectId, + 'base' : baseRecipeId, + }; + + $.ajax({ + type: "POST", + url: libtoaster.ctx.xhrCustomRecipeUrl, + data: data, + headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, + success: function (ret) { + if (doneCb){ + doneCb(ret); + } else if (ret.error !== "ok") { + console.warn(ret.error); + } + }, + error: function (ret) { + console.warn("Call failed"); + console.warn(ret); + } + }); + } + return { reload_params : reload_params, @@ -347,6 +373,7 @@ var libtoaster = (function (){ addRmLayer : _addRmLayer, makeLayerAddRmAlertMsg : _makeLayerAddRmAlertMsg, showChangeNotification : _showChangeNotification, + createCustomRecipe: _createCustomRecipe, }; })(); |