i am trying to set the defaultview to list when some one clicks link icon in ckeditor. I have already configured ckfinder with ckeditor. So now when i click links in ckeditor, i see a browse button and onclick of browse button it takes me to file list. But there it shows images as thumbnails. I want to display it as "list". I should do this only when i click links in ckeditor. if i click images it should show me the thumbnails.
foloowing is the way i created my ckeditor and associated it with my ckfinder.
function createCkEditor(textAreaId, width, height) {
var editor = CKEDITOR.replace( textAreaId,
{
customConfig : 'suConfig.js',
width : width,
height : height
});
CKFinder.setupCKEditor( editor, { basePath : '/CKFinderJava/ckfinder/', id:'123', startupPath : varStartupDir, startupFolderExpanded : true, rememberLastFolder : false} ) ;
}
CKEDITOR.on( 'dialogDefinition', function( ev ) {
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// If "Link" dialog
if ( dialogName == 'link' ) {
alert('link dialog clicked');
// Remove extraneous tabs
dialogDefinition.removeContents( 'target' );
dialogDefinition.removeContents( 'advanced' );
// Set default URL
var infoTab = dialogDefinition.getContents( 'info' );
var urlField = infoTab.get( 'url' );
urlField['default'] = contentUrl;
}
// If "Image" dialog
if ( dialogName == 'image' ) {
// Remove extraneous tabs
dialogDefinition.removeContents( 'Link' );
dialogDefinition.removeContents( 'advanced' );
// Set default URL
var infoTab = dialogDefinition.getContents( 'info' );
var urlField = infoTab.get( 'txtUrl' );
urlField['default'] = contentUrl;
}
});
CKEditor.on will be called if you click an option in ckeditor. I am not sure how to get the ckfinder instance associated with the current editor and set default view to list. Please help me. I am not using php. I am using javascript and jsp
foloowing is the way i created my ckeditor and associated it with my ckfinder.
function createCkEditor(textAreaId, width, height) {
var editor = CKEDITOR.replace( textAreaId,
{
customConfig : 'suConfig.js',
width : width,
height : height
});
CKFinder.setupCKEditor( editor, { basePath : '/CKFinderJava/ckfinder/', id:'123', startupPath : varStartupDir, startupFolderExpanded : true, rememberLastFolder : false} ) ;
}
CKEDITOR.on( 'dialogDefinition', function( ev ) {
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// If "Link" dialog
if ( dialogName == 'link' ) {
alert('link dialog clicked');
// Remove extraneous tabs
dialogDefinition.removeContents( 'target' );
dialogDefinition.removeContents( 'advanced' );
// Set default URL
var infoTab = dialogDefinition.getContents( 'info' );
var urlField = infoTab.get( 'url' );
urlField['default'] = contentUrl;
}
// If "Image" dialog
if ( dialogName == 'image' ) {
// Remove extraneous tabs
dialogDefinition.removeContents( 'Link' );
dialogDefinition.removeContents( 'advanced' );
// Set default URL
var infoTab = dialogDefinition.getContents( 'info' );
var urlField = infoTab.get( 'txtUrl' );
urlField['default'] = contentUrl;
}
});
CKEditor.on will be called if you click an option in ckeditor. I am not sure how to get the ckfinder instance associated with the current editor and set default view to list. Please help me. I am not using php. I am using javascript and jsp
Re: ckfinder change the default view settings to list when l
In config.js which is in CKFinderJava.war/ckfinder directory make the necessary configurations. config.defaultViewType_Images = 'thumbnails';
config.defaultViewType_Files = 'list';
this is the setting for Images and Links from ckeditor. If you want all the displays to be as list then config.defaultViewType = 'list';