Hi, I am having problems setting the configuration dynamically for link and image browsing. Basically what we need to do is to set the LinkBrowserURL property dynamically. We use the replace text area mechanism. This is how we do it:
<textarea cols="100" rows="15" id="WYSIWYGID2109834221" name="WYSIWYGID2109834221">Browsing Test </textarea>
<SCRIPT language=JavaScript type="text/javascript">
var myFckEditor = new FCKeditor( 'WYSIWYGID2109834221' ) ;
myFckEditor.BasePath = '/SiteConnect/resources/application/components/FCKeditor/' ;
myFckEditor.ToolbarSet = "Default" ;
myFckEditor.Width = "100%";
myFckEditor.Height = "200" ;
myFckEditor.Config[ "LinkBrowserURL" ] = "/SiteConnect/resources/application/components/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=/SiteConnect/WebObjects/SiteConnect.woa/wa/connectorXml" ;
myFckEditor.ReplaceTextarea() ;
</SCRIPT>
As you can see, we are trying to set the LinkBrowserURL dynamically but it does not seem to take the value for the particular instance we created.
If I set the link on the fckconfig.js file it works fine. but if I attempt to set the property dynamically it does not work....
Any help will be appreciated...
Thanks.
<textarea cols="100" rows="15" id="WYSIWYGID2109834221" name="WYSIWYGID2109834221">Browsing Test </textarea>
<SCRIPT language=JavaScript type="text/javascript">
var myFckEditor = new FCKeditor( 'WYSIWYGID2109834221' ) ;
myFckEditor.BasePath = '/SiteConnect/resources/application/components/FCKeditor/' ;
myFckEditor.ToolbarSet = "Default" ;
myFckEditor.Width = "100%";
myFckEditor.Height = "200" ;
myFckEditor.Config[ "LinkBrowserURL" ] = "/SiteConnect/resources/application/components/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=/SiteConnect/WebObjects/SiteConnect.woa/wa/connectorXml" ;
myFckEditor.ReplaceTextarea() ;
</SCRIPT>
As you can see, we are trying to set the LinkBrowserURL dynamically but it does not seem to take the value for the particular instance we created.
If I set the link on the fckconfig.js file it works fine. but if I attempt to set the property dynamically it does not work....
Any help will be appreciated...
Thanks.
RE: Dynamic Browsing Config Problem
myFckEditor.Config[ "LinkBrowserURL" ] = "/SiteConnect/resources/application/components/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=/SiteConnect/WebObjects/SiteConnect.woa/wa/connectorXml" ;
What happens is that when you click on the browse image button, the url that tries to oppen is:
/SiteConnect/resources/application/components/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=
Everything after "Connector=" is lost. I was able to fix the problem by encoding the url using the javascript escape function. Then on the fck_link.js around line 1004 I replaced the code:
var oWindow = window.open( oEditor.FCKConfig.LinkBrowserURL, "FCKBrowseWindow", sOptions ) ;
with:
var oWindow = window.open( unescape(oEditor.FCKConfig.LinkBrowserURL), "FCKBrowseWindow", sOptions ) ;
This way the url shows up complete with the query string intact.