tinymce

how call a TinyMCE plugin function?

一个人想着一个人 提交于 2019-12-12 08:05:58
问题 how can I call a tinymce plugin function? tinymce.activeEditor.plugins.customplugin.customfunction(customvar); not working! 回答1: tinymce.activeEditor.plugins.customplugin.customfunction(customvar); is the correct way to call such a function. Be aware that tinymce.activeEditor needs to be set already in order to use it. tinymce.activeEditor gets set when the user clicks into the editor for example. Otherwise use tinymce.get('your_editor_id_here').plugins.customplugin.customfunction(customvar);

How to Make TinyMCE's modal dialogs Responsive?

和自甴很熟 提交于 2019-12-12 07:45:54
问题 I'm working with TinyMCE4 on a responsive CMS using Bootstrap 3. I've noticed that the dialog/modals aren't responsive in TinyMCE4 which is a bit of a bummer. I started writing some simple CSS classes to override the fixed widths, but there appears to be tons which makes this an task that seems rather daunting. So, I thought that surely someone else has done this by now. Here is what I have so far, but there is are many many more selectors that have to be done for this to work. So, question,

Unexpected end of JSON input while sending tinyMCE data using Ajax

一曲冷凌霜 提交于 2019-12-12 05:25:23
问题 I am using tinyMCE for some user data and to save that data i am using Ajax to send data. When I tried to save the data using ajax i get this two errors: parsererror SyntaxError: Unexpected end of JSON input SyntaxError: Unexpected token < in JSON at position 0 (after Some changes i get this another error) Here is my code.This is the HTML code: <textarea id="cover_letter" name="cover_letter" class="cover_letter_tinyMCE"></textarea> <button type="button" class="btn" id="save_cover_letter">Save

Removing x number of characters from the caret position in tinyMCE

折月煮酒 提交于 2019-12-12 04:47:33
问题 I am working on a project where the user can enter a special character and then tab to auto complete the values. This part is mostly working, but I want to be able to delete x number of characters from before the caret position. E.g. if | is the caret and I have the following text @chr| . I want to be able to delete 3 characters before the cursor position, e.g. I would just end up with @ . I have found a way to get the current cursor position using the below code, but I haven't been able to

Displayin tinyMCE after twice ajax call

℡╲_俬逩灬. 提交于 2019-12-12 04:28:30
问题 In my page, when a button is clicked, a div appears which has a textarea(tinyMCE). I have a close button for that div. When I open the div, do my job, close the div, and open the div again, tinyMCE editor doesn't appear. Here is the summary of my problem 1-) Click button, onclick="doAjax()" and display the returned value in a DIV 2-) In that DIV, there is a textarea with tinyMCE. Everything is OK 3-) Close the div(in fact, just fadeOut() the DIV) Everything is OK 4-) Click the button on step

Magnific Popup for Wordpress post body images

霸气de小男生 提交于 2019-12-12 04:04:44
问题 I am working on a WordPress theme and I was wondering if there is a way of opening images in Magnific Popup which are inserted on a post body by the editor. So, any image I insert in a post through TinyMCE editor will open on Magnific Popup when clicked on the front end. 回答1: There are a few different approaches to this question. I've outlined a couple below. Option 1 Filter the content and apply a HTML attribute that can be targeted with Magnific Popup. We can take a cue from this article

How to save and display uploaded image via tinymce editor in MOODLE 2.9

女生的网名这么多〃 提交于 2019-12-12 03:56:19
问题 Save and display tinymce content in Moodle . I have a block that save question and answer in db. I use tinymce editor for this, so that user can enter text and image. My editor form is: ..... $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$context); $mform->addElement('editor', 'title_editor', 'Questions', null, $editoroptions); $mform->addRule('title_editor', null, 'required', null, 'client'); $mform->setType('title_editor', PARAM_RAW); ..... I

AngularJS Getting the value of a selected dropdown option in a variable

我的未来我决定 提交于 2019-12-12 03:44:20
问题 I have dropdown selection menu & want to send the dropdown selected value in request params of api. My code is... <select class="form-control" id = "SelectionInput_reason"> <option name="careerType" value="type_1">Career</option> <option name="examType" value="type_2">Exams</option> </select> getValue = function() { var selectedValue = this.value; var selectedText = this.options[this.selectedIndex].getAttribute('name'); alert(selectedValue); alert(selectedText); } document.getElementById(

Wordpress Editor text tab design issue?

强颜欢笑 提交于 2019-12-12 02:56:58
问题 I tried the Wp_editor in wordpress for the visual tab is working fine and the text tab is getting list order. <?php $settings = array( 'textarea_name' => 'message1', 'media_buttons' => true, 'tinymce' => array( 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' . 'bullist,blockquote,|,justifyleft,justifycenter' . ',justifyright,justifyfull,|,link,unlink,|' . ',spellchecker,wp_fullscreen,wp_adv' ) ); wp_editor( '', 'content', $settings ); ?> Also For the Visual Editor it

how to prevent the cursor from jumping to next line in textarea using jquery

血红的双手。 提交于 2019-12-12 02:53:28
问题 I am working on TinyMCE editor where I have to customize it for some special equation. The problem is that when I press the enter key, the cursor goes to new line. My question is how to prevent the cursor from jumping to new line when someone press the enter key inside the editor.I want to cursor to remain where it is before, on pressing the enter key. Just like textarea, when the enter key is pressed, the cursor goes to new line. Can anyone explain how to prevent the cursor from jumping to