You will notice that in the plugins/filebrowser/plugin.js calls CKEDITOR.tools.addFunction( setUrl ), returning the index of this newly added function. That function number is passed into your upload script as the query parameter CKEditorFuncNum.
pserwylo wrote:I was grappling with this for a couple of hours yesterday, and after continually browsing around the source code, I came across this solution:
You will notice that in the plugins/filebrowser/plugin.js calls CKEDITOR.tools.addFunction( setUrl ), returning the index of this newly added function. That function number is passed into your upload script as the query parameter CKEditorFuncNum.
Hope that helps.
Amazing! This is exactly where I was tripping up, I did not catch that they register 'semi-anonymous' functions as callbacks. Now that I know how it works, I kind of dig the approach, much cleaner than trying to manage avoiding collisions with function names.
Is your $error a status code (202/403 etc) or a message to display to the user?
I'm trying to use the following method so as to update a field in the parent dialog window:
window.opener.CKEDITOR.tools.callFunction('$CKEditorFuncNum', internalUrl, function() {
// Get the reference to a dialog.
var element, dialog = this.getDialog();
// Check if it is an Image dialog.
if (dialog.getName() == 'internalLink') {
// Get the reference to a text field that holds the "alt" attribute.
element = dialog.getContentElement('linkTab', 'selectedLink');
// Assign the new value.
if (element) {
element.setValue(internalUrl);
}
}
But I can't get the alert to be displayed.
I open the child custom popup window with the following dialog button:
Re: Upload Integration
You will notice that in the plugins/filebrowser/plugin.js calls CKEDITOR.tools.addFunction( setUrl ), returning the index of this newly added function. That function number is passed into your upload script as the query parameter CKEditorFuncNum.
Hope that helps.
Re: Upload Integration
Amazing! This is exactly where I was tripping up, I did not catch that they register 'semi-anonymous' functions as callbacks. Now that I know how it works, I kind of dig the approach, much cleaner than trying to manage avoiding collisions with function names.
Is your $error a status code (202/403 etc) or a message to display to the user?
Re: Upload Integration
Re: Upload Integration
Here's the code in VB.NET
Re: Upload Integration
But I can't get the alert to be displayed.
I open the child custom popup window with the following dialog button:
Should I have use something else than the onClick handler ?