I want to create a button on imperavi's redactor, that will display uploaded files (only photos) in a modal, that i previously uploaded, and i will allow the user, to organize this photos, order their order and organize them in folders, and create folders. And when the user select the photo, the tag is inserted in the text field (redactor).
I rely want a place to begin, or a already existing solution, my knowledge with php is big but my jquery and ajax is very small
I don't want to display the computer folder, i want to display the images int the database
Sorry for the bad English.
Where do i begin?
edit 1: I manged to add the button
if (typeof RedactorPlugins === 'undefined') var RedactorPlugins = {};
RedactorPlugins.myPlugin = {
init: function() {
this.addBtn('myMethod', 'Add Image', function(obj) {
obj.myMethod();
});
},
myMethod: function()
{
// callback (optional)
var callback = $.proxy(function()
{
return 1;
}, this);
var modal = String() +
'<div id="redactor_modal_content">' +
'<div class="modal-body">' +
'<p>One fine body...</p>' +
'</div>' +
'<div id="redactor_modal_footer">' +
'<a href="javascript:void(null);" class="redactor_modal_btn redactor_btn_modal_close">Close</a>' +
'<a href="javascript:void(null);" class="redactor_modal_btn" id="redactor_upload_btn">Save changes</a>' +
'</div>' +
'</div>';
// 500 it is the width of the window in pixels
// or call a modal with a code
this.modalInit('<h3>Modal header</h3>', modal, 500, callback);
// call a modal from element with ID #mymodal
//this.modalInit('<h3>Modal header</h3>', '#mymodal', 500, callback);
}
}