tinymce-4

How can I manipulate TinyMCE listbox elements?

你。 提交于 2019-12-25 07:07:36
问题 In TinyMCE how can add and remove options to listboxes in a plugin pop up window? 回答1: editor.addMenuItem('insertValue', { text: 'Menu item text', context: 'tools', onclick: function() { availableElements=[ { text:'Start typing into the search box' } ]; var w=editor.windowManager.open({ title: 'Pop up window title', body:[ { type:'textbox', name:'title', label:'Search', onkeyup:function(e){ $.post('THE URL WHICH GIVE BACK THE OPTIONS AS A JSON').done(function(response){ response=JSON.parse

TinyMCE plugin under Joomla to restrict and cut by chars limit number

寵の児 提交于 2019-12-24 19:28:50
问题 I try to adopt and create custom "maxstop" plugin for TinyMCE to restrict/cut by chars limit number based on solution from https://stackoverflow.com/a/53599500/2637838 Environment - Joomla 3.9.1, TinyMCE 4.5.9 - my basic code idea is tinymce.PluginManager.add('maxstop', function (editor) { max_chars: 10, // max. allowed chars setup: function (ed) { var allowedKeys = [8, 13, 16, 17, 18, 20, 33, 34, 35, 36, 37, 38, 39, 40, 46]; ed.on('keydown', function (e) { if (allowedKeys.indexOf(e.keyCode)

jQuery - Select element inside tinyMCE WYSIWYG

大憨熊 提交于 2019-12-24 17:57:39
问题 I have a site with some WYSIWYG-fields (using TinyMCE with Wordpress & Advanced Custom Fields). I want to select and manipulate some elements inside these fields (add a background image) but I'm not sure how to do that. How can I reach inside TinyMCE's iFrame and modify elements? How can I make sure all WYSIWYG-fields are properly loaded before I select them? I'm looking at TinyMCE 4 API, and I still have no clue. 回答1: How can I reach inside TinyMCE's iFrame and modify elements? You can

How to add style attribute to an image added with getDoc().createElement( “img” ); in TinyMCE

我的梦境 提交于 2019-12-24 16:16:24
问题 How To insert an image at cursor position in tinymce From the above mentioned question I manage to add an Image in TinyMCE. var ed = tinyMCE.get('txt_area_id'); // get editor instance var range = ed.selection.getRng(); // get range var newNode = ed.getDoc().createElement ( "img" ); // create img node newNode.src="sample.jpg"; // add src attribute range.insertNode(newNode); // insert Node I am trying to add the width to newNode with this code: newNode.style = "width:600px;"; // not working but

django-tinymce modern theme

廉价感情. 提交于 2019-12-24 08:34:51
问题 I'm having issues getting the modern theme to work with django-tinymce. Both the simple and the advanced themes render correctly, but when I switch to the modern theme nothing renders and I get a 404 error for /static/tiny_mce/themes/modern/editor_template.js in the console I am attempting to do all of this in the django admin. The error is coming from /static/tiny_mce/tiny_mce.js which is interesting because I don't have anything installed in that directory. I'm using /static/js/tinymce as

Inserting HTML template into tinymce 4 editor [closed]

不羁岁月 提交于 2019-12-24 04:15:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I have a HTML templates on one side. On the other hand, I have TinyMce Editor 4+ version. I have created a HTMl page with buttons(with name "Use Template") for each of the template I will be using. Basically, I want a user to click a corresponding template button and that should Insert the HTML template into the

TinyMCE fixed_toolbar_container configuration

徘徊边缘 提交于 2019-12-23 19:36:52
问题 I tried using fixed_toolbar_container configuration inside tinymce.init, but it left me with plain html textarea instead of rich text editor. Here's my code: <html> <head> <script src="tinymce\js\tinymce\tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", inline: true, fixed_toolbar_container: "#mytoolbar", plugins: [ "advlist autolink lists link image charmap print preview anchor", "searchreplace visualblocks code fullscreen", "insertdatetime media

First dynamically-added TinyMCE editor displays, others do not

风流意气都作罢 提交于 2019-12-23 01:44:53
问题 I'm building a javascript app that will be displaying a live-updated discussion thread. It will regularly poll the server for new data, and write it to the page. For posting comments and replies, we are trying to use the TinyMCE WYSIWYG editor, which converts a textarea into a nice HTML editor. This is my first experience with this editor. The app relies heavily on jQuery, so we are using TinyMCE's jQuery plugin to make it easier to work with. Here's the issue... Every time our code generates

TinyMCE 4 default font-size

余生长醉 提交于 2019-12-22 08:56:08
问题 In TinyMCE 3 you can change the editor's default font-size by using this code in the settings: setup : function(ed) { ed.onInit.add(function(ed) { ed.getDoc().body.style.fontSize = '14px'; }); } In version 4, I tried using the same method but get this error: TypeError: ed.onInit is undefined I also tried using the "content_css" option and set the body to 14px font size, but that works only when on preview. http://www.tinymce.com/wiki.php/Configuration:content_css Has anyone found another way

TinyMCE file_picker_callback select image from default browser file selection

大兔子大兔子 提交于 2019-12-21 17:34:29
问题 Im using TinyMCE in a project and want the user to select and upload images to the server using its default insert image window. I want to click the following button: Open the browsers default file select window and add the selected image to the editor: My code so far is as follows.. JS: tinymce.init({ selector: '#html-editor', language: 'pt_PT', plugins: [ "bdesk_photo advlist autolink link image lists charmap preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars