is there a way that I can use ckeditor as the textarea within a bootbox dialog? I am using bootbox for other areas with inputs but the only bit I cannot get to work is the textarea. The textarea does show in the dialog, but it is not replaced with ckeditor. Any help with this would be appreciated.
Thanks
you can try to use this:
CKEDITOR.ui.dialog.textarea(dialog, elementDefinition, htmlList)
or visit here:http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.textarea.html
hope it helps.
I managed to do this by loading the form with the textarea into the bootbox dialog using AJAX.
I just needed to include the following in my ajax response.
<script>CKEDITOR.replaceAll(function( textarea, config )</script>
Related
here is the piece of code I want to add the wordpress page:
But when I click visual tab and come back to text tab. The onclick event disappeared:
Can anyone explain why it happens? why do it change the code when I switch the visual and text tab! Thanks in advance!
Check this question:
Wordpress insert javascript into page text area
Basically, check that you are not inside a p or anther element or have a look to the plugin they suggest on that answer:
http://wordpress.org/extend/plugins/raw-html/
Wordpress strips code from your posts which is why that is happening.
Source: http://wordpress.org/support/topic/placing-javascript-in-posts
I'm working on a TinyMCE client request. In TinyMCE, a user inputs a url into the editor. (Let's say www.google.com). The user saves the input and "www.google.com" is rendered as plain text inside of a p tag. How can I make this url clickable? Our application is using TinyMCE version 3.5. I would very much appreciate some guidance here as I'm new to the inner workings of TinyMCE. Thank you.
If you've upgraded to TinyMCE 4, add plugins: "autolink" to your TinyMCE init function.
If not, http://www.tinymce.com/wiki.php/Plugin3x:autolink
I'm working in a form update section using Tinymce and jquery and using ejs for load form including textarea and i call tinymce (tinymce init) using JavaScript function right after the ejs loaded.
The editor is working fine, but when i use
tinymce.get("content-text").setContent( $(".grid:first").html() );
for set content to editor its showing error.
if i load the textarea form and load tinymce again it will work ;) I don't what is happening here.
From your comments, what I suggest is that you instantiate tinymce outside your $(document).ready(), and before your html form.
I'm developing a WordPress plugin that allows sending a short code into the rich text editor. Assuming the short code content is stored inside shortcode variable, the following code works perfectly:
tinyMCE.execCommand('mceInsertContent', false, shortcode);
...if the user is in "Visual Editor" mode. If they switch to "Plain Text" mode, the code doesn't work anymore - no content appears in the textarea.
Anyone can help? Thanks in advance.
(Ah, if that matters, I have several instance of editors on the same "Add Post" page).
Just got it! Simply do
send_to_editor(shortcode);
this function is located inside media-upload.js, which should be loaded in Edit/Add Post pages.
I have a very simple message to display in one jQuery popup and I just want to generate it without adding extra divs into my HTML.
What I'd like to do is just open a dialog box with a message and thats it.
Here is something like that I want:
$("<div>Hello sir</div>").dialog("open");
But that doesn't work. Should it? It seems like that should just open a simple dialog box, shouldn't it?
Thanks!!
You don't need to call open, simply:
$('<div />').html('Hello sir').dialog();
And here's a live demo.
Have you made sure you have included jQuery.UI library in addition to core jQuery ?
see example here :
http://jqueryui.com/demos/dialog/
$("<div>This is a test</div>").dialog();
works fine for me http://jsfiddle.net/fyMct/