Saul,
I'm able to get the sajax object in the manager.php and use sajax.
However, I need to get it to work in the fckplugin.js file where the image string is built.
Is there a way to pass that object to fckplugin.js?
I even tried moving the JavaScript from fckplugin.js into manager.php javascript section, but the ImageManager does not work when I do this.
I feel I'm so close! I tried defining the oEditor variable in manager.php near the top (not in any functions) and then use it over in fckplugin.js, but get a null value. How can I pass it to fckplugin.js?
Thanks,
Clay
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: ImageManager sajax
Sent at: Thu Sep 27, 2007 2:00 am
by saul11
Hi Clay,
Perhaps
FCK.EditorWindow.parent.sajax_do_call
I can't test it, because I have no sajax_do_call anywhere. I did a search in de FCKeditor's code, but that confirmed that there exists no sajax_do_call function. What framework are you working in?
The above code brings you to the editor itself, but when working in a framework, I think the function you need is on the window containing the FCKeditor, so try adding one or more '.parent' to the code : FCK.EditorWindow.parent.parent.sajax_do_call
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: ImageManager sajax
Sent at: Wed Sep 26, 2007 7:21 am
by cyshaw
Saul,
Thanks for your quick response. I tired your solutions.
In manager.php, I tried :
oEditor = window.opener;
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
oEditor was set in manager.php and sajax_do_call did work! However, my code that builds ajaxArg is in fckplugin.js, a included js file in manager.php. How can I pass oEditor from manager.php to fckplugin.js? If I can do this I think I can solve my problem.
I tried not putting var in front of oEditor in hopes that it would treat it as a global, but seems not to work. Any suggestions?
I also noticed that having:
Code: Select all
window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
in fckplugin.js works for IE but NOT in FIreFox. The response.responsetext returns nothing in firefox.
Again, THANKS for all of your help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
saul11 Re: ImageManager sajax
Sent at: Tue Sep 25, 2007 8:42 am
by saul11
In manager.php, try :
oEditor = window.opener;
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
or
oEditor = window.opener.FCKeditorAPI.GetInstance('InstanceName').EditorWindow.parent; (with 'InstanceName' being the instancename you gave to your editor.)
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
or
oEditor.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
Please let me know if this worked
------------------------------------------------------------------------------------------------------------------------------------------------------------------
ImageManager sajax
Sent at: Tue Sep 25, 2007 7:33 am
by cyshaw
I'm using the ImageManager Plug-in. I want to access sajax to do some interaction between js and php.
I noticed that sajax works well with pages in the dialog directory. They use:
var oEditor = window.parent.InnerDialogLoaded();
Then call sajax by: oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
I tried to get oEditor in the ImageManager, but fail to get the dialog window because the ImageManager uses popup.js instead of dialog.html.
So, I tried to use sajax_do_call outside the dialog window with the ImageManager using:
oEditor = FCKeditorAPI.GetInstance('InstanceName').EditorWindow.parent;
oEditor.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
But get oEditor is not a function error.
Is there a way to use sajax_do_call outside the dialog window with the ImageManager?
Please help...
Thanks,
Clay
I'm able to get the sajax object in the manager.php and use sajax.
oEditor = window.opener; oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
However, I need to get it to work in the fckplugin.js file where the image string is built.
Is there a way to pass that object to fckplugin.js?
I even tried moving the JavaScript from fckplugin.js into manager.php javascript section, but the ImageManager does not work when I do this.
I feel I'm so close! I tried defining the oEditor variable in manager.php near the top (not in any functions) and then use it over in fckplugin.js, but get a null value. How can I pass it to fckplugin.js?
Thanks,
Clay
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: ImageManager sajax
Sent at: Thu Sep 27, 2007 2:00 am
by saul11
Hi Clay,
Perhaps
FCK.EditorWindow.parent.sajax_do_call
I can't test it, because I have no sajax_do_call anywhere. I did a search in de FCKeditor's code, but that confirmed that there exists no sajax_do_call function. What framework are you working in?
The above code brings you to the editor itself, but when working in a framework, I think the function you need is on the window containing the FCKeditor, so try adding one or more '.parent' to the code : FCK.EditorWindow.parent.parent.sajax_do_call
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Re: ImageManager sajax
Sent at: Wed Sep 26, 2007 7:21 am
by cyshaw
Saul,
Thanks for your quick response. I tired your solutions.
In manager.php, I tried :
oEditor = window.opener;
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
oEditor was set in manager.php and sajax_do_call did work! However, my code that builds ajaxArg is in fckplugin.js, a included js file in manager.php. How can I pass oEditor from manager.php to fckplugin.js? If I can do this I think I can solve my problem.
I tried not putting var in front of oEditor in hopes that it would treat it as a global, but seems not to work. Any suggestions?
I also noticed that having:
Code: Select all
window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
in fckplugin.js works for IE but NOT in FIreFox. The response.responsetext returns nothing in firefox.
Again, THANKS for all of your help.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
saul11 Re: ImageManager sajax
Sent at: Tue Sep 25, 2007 8:42 am
by saul11
In manager.php, try :
oEditor = window.opener;
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
or
oEditor = window.opener.FCKeditorAPI.GetInstance('InstanceName').EditorWindow.parent; (with 'InstanceName' being the instancename you gave to your editor.)
oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
or
oEditor.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
Please let me know if this worked
------------------------------------------------------------------------------------------------------------------------------------------------------------------
ImageManager sajax
Sent at: Tue Sep 25, 2007 7:33 am
by cyshaw
I'm using the ImageManager Plug-in. I want to access sajax to do some interaction between js and php.
I noticed that sajax works well with pages in the dialog directory. They use:
var oEditor = window.parent.InnerDialogLoaded();
Then call sajax by: oEditor.window.parent.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
I tried to get oEditor in the ImageManager, but fail to get the dialog window because the ImageManager uses popup.js instead of dialog.html.
So, I tried to use sajax_do_call outside the dialog window with the ImageManager using:
oEditor = FCKeditorAPI.GetInstance('InstanceName').EditorWindow.parent;
oEditor.sajax_do_call( 'wgMyFunction', [ajaxArg], UpdateImageAjax );
But get oEditor is not a function error.
Is there a way to use sajax_do_call outside the dialog window with the ImageManager?
Please help...
Thanks,
Clay
Re: ImageManager sajax
Thanks for moving our conversation to the forums.
Did you try FCK.EditorWindow.parent.sajax_do_call (in fckplugin.js)?
Re: ImageManager sajax
Any way, I got it working.
Thanks for all of your help Saul!