CKEDITOR 中的乌尔都语集成

发布于 2024-12-03 05:16:11 字数 1313 浏览 1 评论 0原文

我的网站有一个 jquery 插件,可以将文本区域/输入转换为乌尔都语键盘,但该插件不适用于 ckeditor,因为 ckeditor 需要一些时间来加载。 请求您让我知道是否有办法在延迟一段时间后或当 ckeditor 完全加载时加载我的 jquery 插件? 我在我的网站的{head}中添加了jquery代码:

    <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>

请您帮我更正上面的代码...

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...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无言温柔 2024-12-10 05:16:11

尝试将 document.ready 代码放入 CKEditor 加载事件中

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

try putting document.ready code in CKEditor load event

CKeditor.on('instanceReady',function(){
   //blabla
});
找回味觉 2024-12-10 05:16:11

而不是添加不同语言的插件,其中的单词不同或者可能是错误的。您可以只使用系统键盘语言,并在 CKEditor 中根据语言使用内容方向(即contentsLangDirection)。我做了如下:

$(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;
}
}

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;
}
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文