Tag: tinymce

如何让TinyMCE和Jqueryvalidation一起工作?

我正在使用jquery validate和tinquce的jquery版本。 我发现这段代码使得每次有变化时都能自我validation。 你好 我正在使用jquery validate和我的jquery tinymce,所以我在我的代码中有这个 // update validation status on change onchange_callback: function (editor) { tinyMCE.triggerSave(); $(“#” + editor.id).valid(); }, 然而,这有一个问题。 如果用户从单词复制某些东西,它会带来所有垃圾样式,通常超过50,000个字符。 这超过了我允许用户输入的字符数量。 所以我的jqueryvalidation方法告诉我他们超过了限制。 同时虽然tinymce已经清理了这个烂摊子,但现在用户可能还没有超过限制。 然而,信息仍然存在。 那么有一个更好的函数调用我可以把它放进去吗? 也许告诉tinymce在粘贴发生时延迟有效,或者可能是不同的回调? 有人有任何想法吗?

TinyMCE 4 – remove()或destroy()

我正在使用TinyMCE编辑器。 我想删除或销毁tinymce编辑器(页面包含多个编辑器)。 还删除tinyMCE添加的类和ID。 但留下可编辑的内容 我试过了 : tinymce.remove() tinymce.destroy() tinymce.execCommand(‘mceRemoveControl’,true,’.editable’); 请注意: 我的编辑器类是.editable ,我的页面中有一个以上的编辑器。

什么是目前最好的WYSIWYG编辑器? (jQuery支持/集成是一个加号。)

我正在开发一个需要WYSIWYG编辑器的项目,但我不需要偶尔集成一个,所以我不熟悉最新和最好的。 我过去曾经使用过tinyMCE和nicEdit,因为它的开销很大,所以我不想在这个项目中使用tinyMCE。 我不需要它过于复杂,但我需要能够在每个实现的基础上更改可用按钮,并且与jQuery和AJAX的良好兼容性是一个巨大的优势。 显然,良好的干净HTML支持是必要的。 你最近找到了所见即所得的编辑? 你会推荐什么? PS我知道这有点像这个问题的副本,但这个问题已经有近一年的历史了,事情变化很快。

在CodeIgniter中实现TinyMCE的问题

我正在尝试在CodeIgniter中实现TinyMCE。 我创建了一个视图文件,并从控制器中调用它。 我已将所有文件上传到我的CI项目文件夹中,并显示了文件的路径。 但它没有用。 这是视图文件: Full featured example <script type="text/javascript" src="application/tinymce/jscripts/tiny_mce/tiny_mce.js”> tinyMCE.init({ // General options mode : “textareas”, theme : “advanced”, plugins : “autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks”, // Theme options theme_advanced_buttons1 : “save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect”, theme_advanced_buttons2 : “cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor”, theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen”, theme_advanced_buttons4 : “insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks”, theme_advanced_toolbar_location : “top”, theme_advanced_toolbar_align : “left”, theme_advanced_statusbar_location : “bottom”, theme_advanced_resizing : true, // Example content CSS […]

$(this).keyup()在关注tinyMCE时没有响应

我正试图在“keyup”事件发生时触发一个函数。 当我在普通的textarea和输入字段上测试时,这很好用,但是,当我在tinyMCE编辑器上使用相同的代码时,没有任何反应。 我怀疑这是因为tinyMCE在java上运行,并且已经有了事件监听器,但是我的java知识已经远离任何接近这个问题的年龄了! 除了tinyMCE编辑器之外,这是我的代码,它可以处理页面上的所有输入: $(document).ready(function() { $(this).keyup(function(){ // get the contents of the editor… var content = tinyMCE.get(‘demo_textarea’); content = escape(content.getContent()); content = content.replace(“+”, “%2B”); content = content.replace(“/”, “%2F”); // copy the contents of the editor into #box_2 $(‘#box_2’).html(content); }); } 我实际上想要实现的是类似于堆栈溢出编辑器,其中您的输入反映在另一个框中。 感谢您提前阅读并感谢我获得的任何帮助。 问候,汤姆

带有TinyMCE字段的Jqueryvalidation表单,它没有空值给出错误

我在TinyMCE编辑器中有以下jQuery Validation脚本: http ://www.zinomen.com/test/validate.html 通过firstname和lastname,当字段为空时,您会收到错误,但在消息字段中,您不会收到任何错误。 我使用以下代码: $.validator.setDefaults({ submitHandler: function() { alert(‘submitted, value of message = ‘+ tinyMCE.get(‘message’).getContent()); } }); $(document).ready(function() { // validate signup form on keyup and submit $(“#signupForm”).validate({ rules: { firstname: { required: true, minlength: 2 }, lastname: { required: true, minlength: 2 }, message: { required: true, minlength: 15 } }, messages: […]

如何在tinymce中的光标位置插入图像

我正在使用以下代码来获取tinymce的内容。 tinymce_content=tinyMCE.get(‘txt_area_id’).getContent(); updated_content=tinymce_content+””; 通过使用上面的代码我在tinymce内容中插入图像。 问题:如何在tinymce内的光标位置插入图像(即)如何预测光标位置并分割内容以在获取的内容之间插入图像。 提前致谢

TinyMCE宽度和高度不听话!

根据TinyMCE的(冲突的)文档,编辑器采用它替换的textarea(或其他)元素的大小。 它还说你可以通过在init方法中指定{ height: ‘123’, width: ‘123’ }来设置编辑器的大小。 我已经尝试了BOTH并且仍然只得到一个结果 – 编辑器调整自身(它记得如何超出我),这是用户最后一次resize的时间。

动态添加tinymce到新textarea

我怎样才能做到这一点 function addTinyText(id, text){ //add textarea to DOM $(”).append(text).appendTo(‘body’); //init tineMCE tinyMCE.init({ theme : “advanced”, plugins : “emotions,spellchecker” }); //add tinymce to this tinyMCE.execCommand(“mceAddControl”, false, ‘txt’+id); } 但结果每次我们有一个新的textarea + tinyMCE但内部没有文字 我错了什么?

jquery中的TinyMCE实例可排序

我很难过,很沮丧,所以有时间寻求帮助。 做了很多谷歌搜索但尚未找到适合我的解决方案。 我所拥有的是一大堆可以使用Jquery排序的div,一些div包含一个TinyMCE实例。 在你尝试移动包含TinyMCE实例的div之前,这一切都很好 – 当你做TinyMCE似乎刷新自己并创建一个新的实例,然后你丢失了数据等等。然后整个页面因javascript不再中断而中断工作:)。 在这段时间里,我在Firebug中获得了javascript构造函数错误等。 我决定最好的方法是当div开始被拖动时从文本区域移除tinymce并且当它被放置在它的新位置时插入tinymce。 我可以删除它,但无法将其添加回来 – 因为我得到更多的构造函数错误。 注意:TinyMCE会自动添加到我正在使用的系统中的所有文本区域,因此尽量避免弄乱TinyMCE。 在下面的代码中,我只是针对特定的textarea id进行测试。 $cols.sortable({ cursor: ‘move’, revert: true, opacity: 0.6, placeholder: ‘widgetplaceholder’, forcePlaceholderSize: true, connectWith: cols, zIndex:9000, cancel: “.collapsable_box_editpanel_groups, .collapsable_box_content”, start: function(e, ui) { // removes tinymce ok from textarea tinyMCE.execCommand( ‘mceRemoveControl’, false, ‘textarea1’ ); }, stop: function(e,ui) { // breaks here – constructor […]