I need to hide and show the editor based on event.
I initiate the editor. then, i try to hide using the code:
$('#textare').hide();
but it doesn't work, since it as I think initiate iframe
so how can I show and hide editor
Update: I'm sorry forget to add editor name.. I use wysihtml5.
I think the way that editor work is hide the textarea and make iframe
so the above text couldent hide the editor.
The textarea should already be hidden since it will only be used as a fallback. The editor itself is contained in an iframe with class wysihtml5-sandbox. So this should toggle the editor
$(".wysihtml5-sandbox").hide()
Related
I have a simple v-textarea
<v-textarea v-model="text"/></v-textarea>
Is there a way to detect that a link has been inserted and make it change color and be clickable?
Such as this https://stackoverflow.com/.
You cannot make clickable links inside textareas (v-textarea is just a wrapper around a native one). They are for plain text only.
As a possible workaround you can you can make a div, copy formatted content from the textarea to this div with the appropriate wrapping of links into the tags and then switch the textarea and div on blur event or maybe a custom switcher
I'm running into an issue where I have a button on my page that has a CKEditor.
When the button is pressed I want to append text to the editor.
I used the following code:
$('#mtxDescription').append($(this).data('key'));
CKEDITOR.instances['mtxDescription'].updateElement();
However this does not work. The editor does not reflect the change. However when I inspect the editor I find that the textarea does show the appropriate text appended, its just the editor is not showing it. Does anyone know of a way to get around this. Also, just in case anyone is wondering, I do have the jquery CKEditor adaptor script referenced in my page.
Also, if a somewhat related, but separate issue.
I have a drop down list that will allow the user to toggle between the text area shown on the page being the CKEDitor WIZIWIG and going back to being a normal textarea again. However I can't seem to do this without literally refreshing the page, I want to do it through javascript/jquery so I don't have to refresh the page whenever the change the dropdown selection. I've already tried the built in destroy method. It doesn't seem to do anything visually, the editor does not revert back to a simple textarea.
Just in case you were going to ask for some more code, here is what my HTML page looks like:
<textarea id="mtxDescription" name="mtxDescription"></textarea>
Here is how I initialize the editor
CKEDITOR.replace('mtxDescription', {
sharedSpaces: { top: 'ed-top'}
});
I was able to solve this problem by using the following code instead of using jQuery CKEDITOR.instances.mtxDescription.insertHtml($(this).data('key')) I still need a way to remove the editor at runtime.
I have a HTML page with some pre-set options this work fine when I use a plain HTML Text-area, but when I use a rich editor such as "nicEditor" the Text area loses focus.
working page: Here
no working page: Here
Use the following to set the value:
nicEditors.findEditor("TextArea").setContent('text');
You can't have focus on a hidden element. To make my point clear: When using a richtext editor, you are not typing into the original textarea, but one that is provided by the editor (or even an iframe/div tag).
SO to have the focus on the editor window you need to set the focus to it, not to the textarea – which effectively get filled by JS.
I want realize a "live" editing. When you editing content in ckeditor, the same content appear in other place (like div, p, etc.) in same time.
Other interesting question: when I removed display:none and visibility:hidden from text area, which attach to ckeditor, I saw, that it's empty. But if I try to get value of textarea ($('#text_editor').val()) there are content from ckeditor. What is the magic?
One of the developers of ckeditor has developed an onchange plugin.
I have a text area and when the user clicks a button say something like insert an image button the user selects the image to be uploaded and then i would like to add this image to the text area and the user can continue editing the text area, just like what orkut does. How do we achieve such functionality?
You can't display an image directly inside a textarea control.
The closes you can get is overlay an image on it, but it will not be part of the information in the textarea. That is, text will not flow around it and when posting the form it will not be included in the data for the textarea.
Perhaps a writable div (content editable) would suit your purposes better.
I don't believe this is possible. You should look into using a content editable div.
I don't think Orkut actually does what you are talking about either. Looks like they are doing the same thing that stackoverflow does - using a wysiwyg editor, albeit a nicely dressed up or homegrown version. TinyMCE and FCKeditor are the two I'm most familiar with. There are a few leads on this page too: html editor alternative besides tinyMCE