The forum operates in read-only mode. Please head to StackOverflow for support.
modes : { wysiwyg : 1, source : 1 },
if(CKEDITOR.instances[Itemname].mode=='wysiwyg'){ CKEDITOR.instances[Itemname].insertText(TextToInsert); } else{ var input = document.getElementsByClassName('cke_source cke_enable_context_menu')[0]; input.focus(); if(typeof input.selectionStart != 'undefined') { /* Einfügen des Formatierungscodes */ var start = input.selectionStart; var end = input.selectionEnd; input.value = input.value.substr(0, start) + TextToInsert + input.value.substr(end); /* Anpassen der Cursorposition */ var pos; pos = start+TextToInsert.length; input.selectionStart = pos; input.selectionEnd = pos; } }
Re: Enable Button and insertText() on Sourcecode
modes : { wysiwyg : 1, source : 1 },Re: Enable Button and insertText() on Sourcecode
3: check editor.mode
Re: Enable Button and insertText() on Sourcecode
if(CKEDITOR.instances[Itemname].mode=='wysiwyg'){ CKEDITOR.instances[Itemname].insertText(TextToInsert); } else{ var input = document.getElementsByClassName('cke_source cke_enable_context_menu')[0]; input.focus(); if(typeof input.selectionStart != 'undefined') { /* Einfügen des Formatierungscodes */ var start = input.selectionStart; var end = input.selectionEnd; input.value = input.value.substr(0, start) + TextToInsert + input.value.substr(end); /* Anpassen der Cursorposition */ var pos; pos = start+TextToInsert.length; input.selectionStart = pos; input.selectionEnd = pos; } }Re: Enable Button and insertText() on Sourcecode