[英]how to set default font name preety in ckeditor
I have to use 2 ckeditor at once , one for normal english and another for font-family: Preeti at once.Normal english ckeditor is no problem but for another one I want that to be default in it and not changeable by user too. 我必须一次使用2个ckeditor,一个用于普通英语,另一个用于字体系列:Preeti。普通英语ckeditor没问题,但是对于另一个,我希望将它设置为默认值,并且用户也不能更改。 How am I to do it.
我该怎么做。 I was able to do using jquery change function.
我能够使用jquery更改功能。 ie when I change the font using dropdown i call the jquery change function as follows.
即当我使用下拉菜单更改字体时,我按以下方式调用jquery更改功能。
$('#language').change(function(){
var lang_id = $(this).val();
var font_family= $(this).find('option:selected').attr('rel');
var lang = $(this).find('option:selected').text();
if($('#'+lang_id).size() < 1){
var html_data= '<div class="single_data clone" id="'+lang_id+'"><span class="remove">Remove</span><span class="language">In '+lang+'</span><div class="control-group"><label class="control-label" >Content Title : *</label><div class="controls"> <input type="hidden" name="language[]" value="'+lang_id+'"/><input style="font-family:'+font_family+';" class="span12 title" type="text" value="" name="title['+lang_id+']" /></div></div><div class="span12"><div class="control-group"><label class="control-label">Content</label><div class="controls"><textarea style="font-family:'+font_family+';" class="editor" name="description['+lang_id+']"></textarea></div></div></div></div>';
$('.multi_data').append(html_data);
var text_content = $('#'+lang_id).find('textarea.editor').ckeditor();
CKEDITOR.on( 'instanceReady', function( ev ) {
ev.editor.setData('<span style="font-family:'+font_family+';">­</span>');
});
}else{
alert('Content is already add for this language.');
}
});
but I dont want the Preeti to load on change function but on default.ie one ckeditor with normal default english and another one with default font-family as Preeti.How am I to do it. 但是我不希望Preeti在change函数上加载但在default.ie上加载。例如,一个ckeditor具有正常的默认英语,而另一个则具有默认的字体系列作为Preeti。我该怎么做。 Any idea/suggestion.
任何想法/建议。 Thanks in advance.
提前致谢。
found one idea ... here 找到了一个主意...在这里
<textarea cols="100" id="editor1" name="editor1" rows="10"><p> <span style="font-family:Preeti;">description</span></p> </textarea>
<script type="text/javascript">
// Replace the <textarea id="editor1"> with an CKEditor instance.
var editor = CKEDITOR.replace( 'editor1' );
editor.on( 'instanceReady', function( ev ){ //set the background properties ev.editor.setData('<span style="font-family:Preeti">­</span>');
});
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.