Passing url dynamically to the filebrowser button in ckeditor
I am customizing the functionality of ckeditor image upload. The user sees a dropdown with different options. Depending upon the option selected from the dropdown the "Browse Server" button should take the user to corresponding url.
So basically I need to dynamically pass the browse server url (which has chosen from a drop down list) to the filebrowser of Image Upload functionality of CK Editor 3.4.1 gem.
Example:
I am having a select box in the Image Info Tab for that I have added the following code.
{
type : 'select',
id : 'url_path',
items :
[
[ 'Add photos from My Computer', '' ],
[ 'Add photos from My Album', 'http://localhost:3000/pages/'],
],
onChange:function(){
L=this.getValue();
}
Browse Button code looks like this
{
type:'button',
id:'browse',
style:'display:inline-block;',
align:'center',
label:b.lang.common.browseServer,
hidden:true,
filebrowser :
{
开发者_开发技巧 action : 'Browse',
url : '',
target : 'info:txtUrl'
}
}
Here the url value has to set according to the value of select box. How can I configure that ?
Regards, Pankaj
精彩评论