Mohammed Suleman khan
2/22/2016 10:46:00 AM
I am using markdown editor to add or edit the content I have added a button to the panel when I click the button it is prompted the bootbox dialog with the list of images in it, from this dialog I want to select the images and embed the link in the editor. can anyone tell me how to make the images selectable on the bootbox dialog and embed the links in the editor ?
here is my code bootbox dialog that shows list of images on it.
additionalButtons:[
[{
name: "groupCustom",
data: [{
name: "cmdMyImage",
toggle: true,
title: "Image",
icon: "glyphicon glyphicon-upload",
className: "modal2",
callback: function(e){
$.ajax({
url : '/admin/image/gallery',
type : 'GET',
dataType : 'json',
contentType : "application/json",
data : JSON.stringify(),
success : function(data) {
var imgTag = '';
$.each(data, function(idx, value) {
imgTag+='<img src='+ value.replace('src/main/resources/static', '') +'></img> '
});
bootbox.dialog({
title: "This is a form in a modal.",
size: "large",
message: imgTag,
buttons: {
success: {
label: "Insert",
className: "btn-success",
type: "submit",
callback: function () {
var uploadedImages = $('#images').val();
// $.each(uploadedImages, function(idx, value) {
$('#content').append(uploadedImages);
// });
}
}
}
}
);
},
error : function(data) {
console.log("There are some errors")
}
});
}
}]
}]
],