summaryrefslogtreecommitdiff
path: root/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js')
-rw-r--r--yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js49
1 files changed, 0 insertions, 49 deletions
diff --git a/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js b/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js
deleted file mode 100644
index 935b21ede..000000000
--- a/yocto-poky/bitbake/lib/toaster/toastergui/static/js/newcustomimage.js
+++ /dev/null
@@ -1,49 +0,0 @@
-"use strict";
-
-function newCustomImagePageInit(ctx){
-
- var newCustomImgBtn = $("#create-new-custom-image-btn");
- var imgCustomModal = $("#new-custom-image-modal");
-
- newCustomImgBtn.click(function(e){
- e.preventDefault();
-
- var name = imgCustomModal.find('input').val();
- var baseRecipeId = imgCustomModal.data('recipe');
-
- if (name.length > 0) {
- createCustomRecipe(name, baseRecipeId);
- imgCustomModal.modal('hide');
- } else {
- console.warn("TODO No name supplied");
- }
- });
-
- function createCustomRecipe(name, baseRecipeId){
- var data = {
- 'name' : name,
- 'project' : libtoaster.ctx.projectId,
- 'base' : baseRecipeId,
- };
-
- $.ajax({
- type: "POST",
- url: ctx.xhrCustomRecipeUrl,
- data: data,
- headers: { 'X-CSRFToken' : $.cookie('csrftoken')},
- success: function (ret) {
- if (ret.error !== "ok") {
- console.warn(ret.error);
- } else {
- window.location.replace(ret.url + '?notify=new');
- }
- },
- error: function (ret) {
- console.warn("Call failed");
- console.warn(ret);
- }
- });
- }
-
-
-}