Hi,
I'm currently developing my own CKFinder plugin and for some reason when I go to the image browsing window, right click an image and then select my plugin from the list (where it then sends the selected image to a new iframe window) it will load the image just fine, however if I then close the window and try to open another separate image (by right clicking it and selecting my plugin action) it will continue to load the first image I opened into the window.
Has anyone experienced this before?
My code is as follows:
CKFinder.addPlugin( 'myplugin', function( api ) {
CKFinder.dialog.add( 'cropresize', function( api ) {
var file = api.getSelectedFile();
var fileUrl = file.getUrl();
var fileName = file.name;
var folderName = file.folder;
/**
* This only alerts the first time i load the plugin window which is odd?
*/
alert( api.getSelectedFile().name );
var dialogDefinition =
{
title : "Crop " + file.name,
minWidth : 800,
minHeight : 500,
... more dialog definition ...
},
contents : [
{
id : 'tab1',
label : '',
title : 'Crop ' + fileName,
expand : true,
elements : [
{
type : 'html',
html: '<iframe id="crop_iframe" width="100%" style="height:100%" height="100%" src="plugins/myplugin/dialog.php?fileUrl=' + fileUrl + '&fileName=' + fileName + '&folderName=' + folderName + '"></iframe>'
}]
}],
buttons : [ CKFinder.dialog.okButton, CKFinder.dialog.cancelButton ]
};
return dialogDefinition;
});
api.addFileContextMenuOption( { label : 'Crop Image', command : "cropcommand" } , function( api, file )
{
if ( !file.isImage() ) {
api.openMsgDialog("Image cropping", "This feature is only available for editing images.");
return;
}
api.openDialog('cropresize');
});
});