Tag: ckeditor

ckeditor + jquery + fancybox

目的是在我的管理页面上有一个小图标。 单击此图标将触发带有ckeditor textarea实例的模态窗口。 用户编辑文本,保存文本并关闭模态。 我的问题是,如果我再次点击图标,新的编辑器实例为空。 您可以在下面看到相关代码 HTML部分: JS脚本: $(“#editShortText”).fancybox({ ‘scrolling’: ‘no’, ‘titleShow’: false, ‘onStart’: function() { $(‘.jquery_texteditor’).ckeditor(config); }, ‘onComplete’: function() { $(‘.jquery_texteditor’).ckeditor(config); }, ‘onClosed’: function() { $(‘.jquery_texteditor’).ckeditor(config); } }); $(“#saveShortTextFrm”).live(“submit”, function() { $.fancybox.showActivity(); $.ajax({ type : “POST”, cache : false, url : “_save_text.php”, data : $(this).serializeArray(), success: function(data) { if (data!=”) { $(“#shortTtextImageHolder”).html(”); if(CKEDITOR.instances[“jquery_texteditor”]) { […]

在实施CKEDITOR时,通过id查找textarea不再有效

我有一个信息表,允许用户编辑它。 在一个单元格中,有文本信息。 如果用户单击该单元格,则会出现一个bootstrap模式,其中包含一个包含从数据库中检索的当前文本的textarea。 这是表格的一部分: Event Notes @foreach($events as $event) {{$event->Event}} id}}”>{{$event->notes}} @endforeach 这是javascript启动模式的一部分: $(‘[id^=”notes”]’).on(“click”, function(){ var input_id = $(this).attr(‘id’); var previousValue = $(‘#’+input_id).html(); console.log(‘clicked! The current notes are: ‘+previousValue); var result = input_id.split(‘-‘); var notes_id = result[1]; console.log(‘The event id selected is: ‘+notes_id); /*Open a modal*/ $(‘#modal-notes’).modal(‘show’); $(‘#modal-notes’).on(‘shown.bs.modal’, function() { console.log(‘Modal has been opened.’); $(this).find(‘#observations’).text(previousValue); […]

JQUERY竞争到iFRAME

我正在尝试构建一个“JS确认下面离开页面function” 我遇到的问题是在页面上我需要这个确认function我正在使用CKEDITOR为文本编辑器创建一个iframe。 // Javascript code that controls the onbeforeunload event function setConfirmUnload(on) { window.onbeforeunload = (on) ? unloadMessage : null; } function unloadMessage() { return ‘You have entered new data on this page. If you navigate away from this page without first saving your data, the changes will be lost.’; } // JQuery code to […]

CKeditor上的Jquery事件

你好,在一个带有id为“ckeditor_input”的textarea的表单中 $(“#ckeditor_input”).ckeditor(); $(“#ckeditor_input”).html(); // can get the value (“#ckeditor_input”).click/blur/keydown/keypressed( function(){ alert(“OK”); } ); //doesn’t work! 问题是ckeditor! 如果我没有在textarea上启动ckeditor的实例,所有事件都可以正常工作! 在ckeditor实例上获取事件的正确方法是什么? 谢谢

在ckeditor中为rails应用程序添加表

我想在默认创建的表中添加一个名为“table”的类。 我还想从ckeditor的表格对话框中更改边框的值。 我遇到了大麻烦。

禁用在ckeditor中拖动

我的ckeditor面临着一个问题。 我正在将整页HTML加载到ckeditor中。 它正在加载并显示正常。 我想让用户只编辑数据(文本),而不是它的对齐方式。 但在编辑器中,每个div都是可拖动的(就像办公室中的文本框一样)。 我该如何锁定这些区域。

Ckeditor和Lightbox不起作用

美好的一天! 我通过这个http://ckeditor.com/addon/lightbox指令做了一切,但我总是产生这个错误(当按下按钮灯箱时):未捕获的TypeError:无法读取未定义的属性’split’ 码: Replace Textarea by Code — CKEditor Sample CKEditor Samples » Replace Textarea Elements Using JavaScript Code This editor is using an <iframe> element-based editing area, provided by the Wysiwygarea plugin. CKEDITOR.replace( ‘textarea_id’ ) CKEDITOR.replace( ‘editor1’ ); CKEditor – The text editor for the Internet – http://ckeditor.com Copyright © 2003-2015, CKSource – Frederico […]

什么时候ckeditor实例正确加载?

我想在一个CKEDITOR实例正确加载后操作它,这意味着我已经获取了一系列内容并使用setData插入它们。 问题是,一旦我完成了操作加载数据的DOM的setData,我就调用了一个函数,它什么也没做,因为显然数据实际上并没有被加载和显示,或者……不管是什么,CKEDITOR确切地说。 如果我执行setTimeout(….,3000)或其左右,它确实有效。 当然,这是一个丑陋的黑客,因为这个数字只是一个随机猜测。 我想要一些可以锁定的事件,这让我知道可以深入了解编辑器的内容并开始摆弄它们。 我试过’加载’,’instanceReady’和各种其他回调没有取得很大的成功。

CKEditor 4如何在没有用户交互的情况下添加表(即没有对话框)

我已经完成了所有必需的表属性(即行,列数,样式,类,标题样式等)。 当用户点击我的自定义按钮时,我需要添加具有此属性的表,而不通过任何对话框。 我想到显示对话框并用我的数据替换必填字段并触发OK点击。 但这……有点丑陋的解决方案。 请告诉我,这项任务有什么优雅的解决方案吗?

访问iframe中的javascript ckeditor对象

假设我有一个带有iframe的页面,并且在iframe中我有一个ckeditor实例,我想从包含页面中销毁它。 我通常会尝试这样的事情: var iframe_document = document.getElementById(“iframe_id”).contentWindow.document; for(var i in iframe_document.CKEDITOR.instances) iframe_document.CKEDITOR.instances[i].destroy(); 但是,似乎无法以这种方式访问​​ckeditor实例。 是否有可能从文档外部销毁类似于此的实例? 澄清确切的错误是“无法读取未定义的属性’实例’”