开发者

Urdu integration in CKEDITOR

开发者 https://www.devze.com 2023-04-03 08:48 出处:网络
I have a jquery plugin for my website which converts textareas / Inputs to Urdu Keyboard but that plugin doesn\'t work with ckeditor, because ckeditor takes some time to load.

I have a jquery plugin for my website which converts textareas / Inputs to Urdu Keyboard but that plugin doesn't work with ckeditor, because ckeditor takes some time to load. Request you to please let me know if there is a way to load my jquery plugin after some delay or when ckeditor is completely loaded? I have added jquery code in {head} of my website:

    <link rel="stylesheet" type="text/css" href="{vb:raw vboptions.bburl}/clientscript/UrduEditor.css" />
<link rel="stylesheet" type="text/css" href="{vb:raw vboptions.bburl}/clientscript/keyboard.css" />

<script src="{vb:raw vboptions.bburl}/clientscript/VirtualKeyboard/vk_loader.js?vk_layout=PK%20Urdu%20CRULP%20Phonetic&vk_skin=flat_gray" ></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="{vb:raw vboptions.bburl}/clientscript/jquery.UrduEditor.js" type="text/javascript"></script>
<script src="{vb:raw vboptions.bburl}/clientscript/keyboard.js" type="text/javascript"></script>

<script language="JavaScript" type="text/javascript">
    jqcc开发者_开发知识库 = jQuery.noConflict(true);
    jqcc.fn.UrduEditor.defaults.EditorFont = 'Jameel Noori Nastaleeq';
    //jQ = jQuery.noConflict(true);
    jqcc(document).ready(function () {
          jqcc(this).UrduEditor.writeKeyboard(jqcc('.cke_source'));
            jqcc('.cke_source').UrduEditor("18px");

    });
</script>

Request you to please help me to correct the above code...


try putting document.ready code in CKEditor load event

CKeditor.on('instanceReady',function(){
   //blabla
});


Instead of adding different language plugins, where the words are different or may be wrong. You can just use your system keyboard languages and in CKEditor use content direction (i.e. contentsLangDirection) as per the languages. I did it as below :

$(function(){
$("#Language_secondary").change(function(){
resetCKEditorAccordingToLanguage(CKEDITOR.instances.editor4, this.value)
});
});

function resetCKEditorAccordingToLanguage(ckeditorObj, Language_secondary){
switch(Language_secondary){
case 'ARABIAN':
case 'URDU':
ckeditorObj.config.contentsLangDirection = 'rtl';
break;
default :
ckeditorObj.config.contentsLangDirection = 'ltr';
break;
}
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号