fckeditor

how to select a text range in CKEDITOR programatically?

不羁岁月 提交于 2019-11-30 20:34:17
Problem: I have a CKEditor instance in my javascript: var editor = CKEDITOR.instances["id_corpo"]; and I need to insert some text programatically, and select some text range afterwards. I already did insert text through editor.insertHtml('<h1 id="myheader">This is a foobar header</h1>'); But I need to select (highlight) the word "foobar", programatically through javascript, so that I can use selenium to work out some functional tests with my CKEditor plugins. UPDATE 1: I've also tried something like var selection = editor.getSelection(); var childs = editor.document.getElementsByTag("p");

Remove CKEdit Instance

人盡茶涼 提交于 2019-11-30 17:20:29
I can't seem to destroy instances of CKEdit per the documentation. Consider the following: <input name="txt1" type="text" id="txt1" /><br /> <a href="javascript:void(0);" onclick="create()">Create</a><br /> <a href="javascript:void(0);" onclick="destroy()">Destroy</a> <script type= "text/javascript" > <!-- function create() { var hEd = CKEDITOR.instances['txt1']; if (hEd) { CKEDITOR.remove(hEd); } hEd = CKEDITOR.replace('txt1'); } function destroy(){ var hEd = CKEDITOR.instances['txt1']; if (hEd) { CKEDITOR.remove(hEd); } } --> </script> When destroy() runs, CKEDITOR.remove(hEd); is being

FCKEditor doesn't work in IE10

冷暖自知 提交于 2019-11-30 13:56:46
FCKEditor doesn't appear in IE10. When I go to IE development tools and switch browser mode to IE9, FCKEditor works all right. But when I put meta tag for emulate IE9: <meta http-equiv="X-UA-Compatible" content="IE=9" > into header of my web-page, it doesn't help me. How to make FCKEditor work? Or are there another ways for emulating IE9 within IE10? meexplorer try this Mozilla 17 in fckeditorcode_gecko.js find this>> if (A.IsGecko){var B=s.match(/gecko\/(\d+)/)[1];A.IsGecko10=((B<20051111)||(/rv:1\.7/.test(s)));A.IsGecko19=/rv:1\.9/.test(s);}else A.IsGecko10=false;} and replace with>> if (A

FCKEditor doesn't work in IE10

混江龙づ霸主 提交于 2019-11-29 19:54:01
问题 FCKEditor doesn't appear in IE10. When I go to IE development tools and switch browser mode to IE9, FCKEditor works all right. But when I put meta tag for emulate IE9: <meta http-equiv="X-UA-Compatible" content="IE=9" > into header of my web-page, it doesn't help me. How to make FCKEditor work? Or are there another ways for emulating IE9 within IE10? 回答1: try this Mozilla 17 in fckeditorcode_gecko.js find this>> if (A.IsGecko){var B=s.match(/gecko\/(\d+)/)[1];A.IsGecko10=((B<20051111)||(/rv:1

kindeditor + syntaxhighlighter 使文章内的插入代码高亮显示

让人想犯罪 __ 提交于 2019-11-27 13:23:43
首先需要在页面中引入所需FE文件: 两个js和一个css文件是必须要引用的文件; shCore.js是syntaxhighlighter插件的基础代码; shAutoloader.js作用 是 syntaxhighlighter插件的代码高亮显示时自动加载所需文件;但是如果目录不正确的话,就会加载失败,解决方法如下SyntaxHighlighter.autoloader.apply()中给出js文件的位置, <?php //syntaxhighlighter代码高亮显示需要加载的js/css====================begin Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . "/js/syntaxhighlighter/styles/shCoreDefault.css"); Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/syntaxhighlighter/scripts/shCore.js'); Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl . '/js/syntaxhighlighter/scripts

How to set cursor position to end of text in CKEditor?

北城以北 提交于 2019-11-27 08:21:10
Is there a way to set the cursor to be at the end of the contents of a CKEditor? This developer asked too, but received no answers: http://cksource.com/forums/viewtopic.php?f=11&t=19877&hilit=cursor+end I would like to set the focus at the end of the text inside a CKEditor. When I use: ckEditor.focus(); It takes me to the beginning of the text already inside the CKEditor. Dan's answer got strange results for me, but minor change (in addition to typo fix) made it work: var range = me.editor.createRange(); range.moveToElementEditEnd( range.root ); me.editor.getSelection().selectRanges( [ range ]

How do I modify serialized form data in jQuery?

六月ゝ 毕业季﹏ 提交于 2019-11-27 00:24:27
I am trying to submit my form in AJAX, so I have to serialize() the data. But I am using fckEditor and jQuery doesn't know how to deal with it, so after the serialization, I am trying to manually modify the value, but no luck so far... any ideas if(content_val!=""){ var values = $("#frmblog").serialize(); values.content = content_val; //content_val is the manually fetched data which I am trying to insert into the serialized content. alert(content_val); alert(values); } serialize returns a URL-encoded string containing the form fields. If you need to append to it, you do so using the standard

CKEditor strips <i> Tag

久未见 提交于 2019-11-26 19:55:12
I'm trying to find a solution to avoid CKEditor, but also the older FCKeditor strips out any <i> tag from previously inserted content to the db. Case: I insert html content to the db, some content contain the <i> elements. I do this with the CKEditor. Everything works perfect and the content shows up on the webpage. But when i want to edit the previously inserted content, the <i> elements are missing. In my specific case i use: <i class="fa-icon-fullscreen fa-icon-xxlarge main-color"></i> Of course if i disable the editor, the content shows up just fine in the textarea. Mike Peterson When the

2014-05-21 总结

﹥>﹥吖頭↗ 提交于 2019-11-26 17:18:14
1、dirname:获取前缀 $oBasePath = dirname($oBasePath)."/fckeditor/"; 2、addslashes:转义字符,把在文本里输入的单引号,一样的传入到数据库中 3、fckeditor的使用 <?php include("fckeditor/fckeditor.php"); $oBasePath = $_SERVER['PHP_SELF']; $oBasePath = dirname($oBasePath)."/fckeditor/"; $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = $oBasePath ; $oFCKeditor->Height = "500px"; // $oFCKeditor->ToolbarSet = "Basic"; $oFCKeditor->Create() ; ?> 转载于:https://www.cnblogs.com/zouyajun/p/3746758.html 来源: https://blog.csdn.net/weixin_30505225/article/details/98972699

How to set cursor position to end of text in CKEditor?

我只是一个虾纸丫 提交于 2019-11-26 14:07:33
问题 Is there a way to set the cursor to be at the end of the contents of a CKEditor? This developer asked too, but received no answers: http://cksource.com/forums/viewtopic.php?f=11&t=19877&hilit=cursor+end I would like to set the focus at the end of the text inside a CKEditor. When I use: ckEditor.focus(); It takes me to the beginning of the text already inside the CKEditor. 回答1: Dan's answer got strange results for me, but minor change (in addition to typo fix) made it work: var range = me