I'm trying to implement a button outside of the TinyMce editor, that would add text to the active editor upon clicking.
How can I do this?
(For example: There's a button on my website that should add "Test" into the editor, but it doesn't).
Thanks for help :)
Add this code to the onClick of your button:
// the editor id is the same id of your textarea, default "content" in case your textarea does not have an id
tinymce.get('your_editor_id').execCommand('mceInsertContent', false, "Test");
In case you have one single editor on your page you may also use tinymce.activeEditor instead of tinymce.get('your_editor_id').
Related
I would like the toolbar of TinyMCE to be only displayed when the user clicks in the textarea.
Any clue how to do that ?
Thanks a lot
Have you tried TinyMCE's inline mode?
https://www.tiny.cloud/docs/demo/inline/
I've created a new plugin that opens an URL in dialogue box (url dialogue box using openUrl) but the problem is this dialogue box is fixed position, not draggable. In previous version 4.8.1
all the dialogue boxes were draggable/movable. I need the same behavior, anyone has any idea how can I make dialogue box draggable?
I just found a new property to make all the modal dialogs draggable. Use the draggable_modal option to enable dragging for modal dialogs.
Code Example:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
draggable_modal: true
});
Reference:
https://www.tiny.cloud/docs/configure/editor-appearance/#draggable_modal
Which is the event when you set the caret inside tinymce editor? For some reason, Click event works only for the first click. Is there any other event except click?
You could use the focus onActivate event. For a full list of possible tinymce events check out this page and have a look on the right side of the page, there is a list.
When I hover over a textbox I want it to be displayed as a dropdown list, then after I click it I want it to be displayed as a text box again, how can this be done using jquery?
Try this JqueryUI Autocomplete Box, It can be tweaked as ComboBox as well.
http://jqueryui.com/demos/autocomplete/
I suggest to use this.
I want to add editable combo box in GWT , so please tell me the solution ?
Try the Advanced GWT Components, specifically
org.gwt.advanced.client.ui.widget.ComboBox
You can see them in action at the demo page here, just select the Text & Button Widgets tab and have look at the source code behind it.