خرید بک لینک

Vote count: 0

I want to add options to choose (with a few more image src's links) in the input field ("info" "txtUrl") in standard dialog for adding images.

I have already found solutions for my other needs: how to add defualt table class, and how to set image source link in the input field - (default values).

In this case I have prepared a datalist element in the html structure, containing all needed src links. But now, I want to add a "list" attribute in the "input" tag to choose them. I know, that in 'standard" way we can write

$('#txtUrl').attr( "list", "my-options" );

But in CKEditor ID's are generated, so it's hard to aim in them. I know that there are some built-in methods for choosing elements, but I'll be thankful for showing me how to set it all up.

I know that it's also possible to use built-in options for creating/changing "input" tag type by adding to it a value like "text" or "select" and create selectable elements as array - is here someone who has used this in case similiar to my?

If it's possible, please show me step by step, how to do first or second solution, or both if you have time, and explain shortly.

CKEDITOR.on('dialogDefinition', function (ev) {

var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;

if (dialogName === 'table') {
var addCssClass =    dialogDefinition.getContents('advanced').get('advCSSClasses');
addCssClass['default'] = 'my_class';
}
if (dialogName === 'image') {
var txtUrl = dialogDefinition.getContents('info').get('txtUrl');
txtUrl['default'] = 'http://somethig.com/images/';
        }

});

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 25 ارديبهشت 1395 ساعت: 22:27

صفحه بندی