jquery - Jeditable with TinyMCE and a Character Count/limiter -
i've been trying fathom day no joy.... hope oni wan konobi!
i've looked @ max_chars plugin tinymce works fine if tinymce implemented on own.
jeditable has ability count/limit characters using custom type. see here: http://www.appelsiini.net/projects/jeditable/custom.html again works great if implemented on own.
i need implement tinymce jeditable. i've managed , works great. in order there had custom type tinymce.
here code type:
$.editable.addinputtype('mce', { element : function(settings, original) { var textarea = $('<textarea id="'+$(original).attr("id")+'_mce"/>'); if (settings.rows) { textarea.attr('rows', settings.rows); } else { textarea.height(settings.height); } if (settings.cols) { textarea.attr('cols', settings.cols); } else { textarea.width(settings.width); } $(this).append(textarea); return(textarea); }, plugin : function(settings, original) { tinymce.execcommand("mceaddcontrol", true, $(original).attr("id")+'_mce'); }, submit : function(settings, original) { tinymce.triggersave(); tinymce.execcommand("mceremovecontrol", true, $(original).attr("id")+'_mce'); }, reset : function(settings, original) { tinymce.execcommand("mceremovecontrol", true, $(original).attr("id")+'_mce'); original.reset(); } });
here code jeditable character counter:
$.editable.addinputtype('charcounter', { element : function(settings, original) { var textarea = $('<textarea />'); if (settings.rows) { textarea.attr('rows', settings.rows); } else { textarea.height(settings.height); } if (settings.cols) { textarea.attr('cols', settings.cols); } else { textarea.width(settings.width); } $(this).append(textarea); return(textarea); }, plugin : function(settings, original) { $('textarea', this).charcounter(settings.charcounter.characters, settings.charcounter); } });
is there anyway these 2 working together?? in ideal world able call 2 types. calling code is:
$(function(){ $(".editable_profbod").editable('save.asp?pageid=<%=pageid%>§ionid=1', { type : 'mce', indicator : 'saving...', tooltip : 'click edit...', name : 'note_text', submit : 'ok', cancel : 'cancel', height : '100px', onblur: 'ignore', cssclass: 'editable' });
is there way merge these 2 types?? badly need limit , show number of characters. ideally want use jeditable way of showing , limiting count.
many thanks, dave
you might open way of solution: can write own plugin takes care of this. pretty simple. here link howto write tinymce plugin. need act onkeydown content , count characters. depending on value may stop insertion of characters typed.
Comments
Post a Comment