function WorkSpace() {
    Get("/VisualScript/WorkSpace", function(response) {
        $("#FileStructure").jstree({
            'types': {
                'itsfile': {
                    'icon': 'jstree-file',
                },
            },
            'core': {
                'check_callback': true,
                'data': response
            },
            'checkbox': {
              'three_state' : false, // to avoid that fact that checking a node also check others
              'whole_node' : false,  // to avoid checking the box just clicking the node
              'tie_selection' : false, // for checking without selecting and selecting without checking
              'cascade' : "down"
            },
            'contextmenu': {
                show_at_node: true,
                items: Menu,
            },
            'plugins':["contextmenu", "checkbox", "types"]
        });

        Get('/VisualScript/saveLog', function(result) {
            if (result == 'Fail')
                alert("Saving Log File Failed");
        });
    });
};

function Menu(node) {
    var items = {
        CreateItem: {
            label: "Create",
            action: function(data) {
                var inst = $.jstree.reference(data.reference);
                var obj = inst.get_node(data.reference);
                if (obj["parents"].length == 1) {
                    createSuite(inst, obj);
                }
                else {
                    createCase(inst, obj);
                }
            },
        },
        DeleteItem: {
            label: "Delete",
            action: function(data) {
                var inst = $.jstree.reference(data.reference);
                var obj = inst.get_node(data.reference);
                FileDelete(inst, obj);
            }
        }
    };

    if (node["parents"].length >= 3) {
        delete items.CreateItem;
    }
    return items;
}

function createSuite(inst, obj) {
    inst.create_node(obj, {}, "last", function (new_node) {
        try {
            inst.edit(new_node, null, function (node) {
                var data = {
                    Project: obj["text"],
                    Suite: node["text"],
                };
                Post("/VisualScript/WorkSpace/addSuite", data, function() {});
            });
        } catch (ex) {
            console.log(ex);
            setTimeout(function () { inst.edit(new_node); }, 0);
        }
    });
}

function createCase(inst, obj) {
    inst.create_node(obj, {}, "last", function (new_node) {
        try {
            inst.edit(new_node, null, function (node) {
                inst.set_type("itsfile", node)
                var data = {
                    Project: inst.get_node(obj["parent"])["text"],
                    Suite: obj["text"],
                    Case: node["text"],
                };
                Post("/VisualScript/WorkSpace/addCase", data, function() {});
            });
        } catch (ex) {
            console.log(ex);
            setTimeout(function () { inst.edit(new_node); }, 0);
        }
    });
}

function FileDelete(inst, obj) {
    if (obj["parents"].length == 1) {
        var data = {
            Project: obj["text"],
        };
    }
    else if (obj["parents"].length == 2) {
        var data = {
            Project: inst.get_node(obj["parent"])["text"],
            Suite: obj["text"],
        };
    }
    else {
        var data = {
            Project: inst.get_node(inst.get_node(obj["parent"])["parent"])["text"],
            Suite: inst.get_node(obj["parent"])["text"],
            Case: obj["text"],
        };
    }
    Post("/VisualScript/WorkSpace/delete", data, function(msg) {
        inst.delete_node(obj)
    });
}

@@ -1755,30 +1755,687 @@
     
-FileDelete(inst, obj);
+swal(%7B%0A                    title: 'Deletion',%0A                    text: %22Are you sure to delete: %22 + obj%5B%22text%22%5D,%0A                    type: 'info',%0A                    showCancelButton: true,%0A                    confirmButtonColor: '#3085d6',%0A                    cancelButtonColor: '#d33',%0A                    confirmButtonText: 'Delete',%0A                    cancelButtonText: 'Cancel',%0A                    buttonsStyling: true,%0A                    allowEscapeKey: false,%0A                    allowOutsideClick: false,%0A                %7D).then((result) =%3E %7B%0A                    if (result.value) %7B%0A                    FileDelete(inst, obj);%0A                    %7D%0A                %7D)
 %0A   

Add notification for user when they are going to delete a case/suite/project