Menu
  • HOME
  • TAGS

Dynamically loading TinyMCE - wrong plugin, theme paths

javascript,jquery,tinymce,tinymce-4

The only solution I could come up with is to copy and rename the theme.min.js, and plugin.min.js files to theme.js and plugin.js and publish those along with the minified versions.

Making All image bootstrap responsive class automatically

javascript,html,css,twitter-bootstrap,tinymce-4

okay sorry that i miss something, this question is already been asked in here so i just put a link to the answer Images not responsive by default in Twitter Bootstrap 3? so just add img { display: inline-block; height: auto; max-width: 100%; } just add this css line in...

Can't catch the ForeColor command anymore, tinymce 4.1.4

javascript,wordpress,tinymce,tinymce-4

The TextColor plugin no longer fires the execCommand event because since this commit it directly uses the Formatter infrastructure. So you cannot get your old event. However you can use the formatChanged on the formatter to provide a callback: tinymce.activeEditor.formatter.formatChanged('forecolor', function (isNew, args) { if (isNew) console.log("new color", args.node.style.color); },...

Can't validate TinyMCE 4 control in MVC4

asp.net-mvc,validation,asp.net-mvc-4,unobtrusive-validation,tinymce-4

It finally worked. Thanks to @marathonman I rechecked the posts of the link he provided (previously, the accepted one was the source for what i had already done), but this time I also looked at the Brian Surowiec's post (I'll upvote these two posts when I have enough credits to...

listbox return wrong value in wordpress3.9

javascript,listbox,tinymce-4,wordpress-3.9

Just did some updates in your code: var menuval=[]; var insertVar = function (val) { return function () { editor.insertContent(val); } }; for (var i = 0; i < SHORTCODES.length; i++) { var _id = SHORTCODES[i]; var _code = SHORTCODE_EXE[i]; var variable = insertVar(_code); //alert(_id+' '+ SHORTCODES[i]+' '+SHORTCODE_EXE[i]); menuval.push({text: _id,...

TinyMCE 4 add drop down menu to menu bar

javascript,jquery,tinymce,tinymce-4

You can try to specify both 'menu' and 'menubar' option when you call tinymce.init() to add a new menubar item on the modern theme. I tried it and it works. You can check the live demo on http://fiddle.tinymce.com/39eaab/1 with TinyMCE 4.1.7. <script type="text/javascript"> tinymce.init({ selector: "textarea", menu : { file...

How to create a button in TinyMCE 4 that increments font size

tinymce-4

You don't need to modify the source code, you can create a plugin. Here is the documentation of how to create a plugin for TinyMCE: http://www.tinymce.com/wiki.php/Tutorials:Creating_a_plugin based on that you can create your own button (see working example) here is part of the code: var currentFontSize = new Number($(tinyMCE.activeEditor.selection.getNode()).css('font-size').replace('px','')); //remove...

How to add a custom control to the TinyMce 4 toolbar

plugins,control,tinymce-4

Finally I managed to come up with a way to properly do this. First I introduce a new plugin icon (in icon/plugin.js) that registers a new control Icon. It uses a setting iconClass. tinymce.PluginManager.add('icon', function() { tinymce.ui.Icon = tinymce.ui.Widget.extend({ renderHtml: function () { return '<span class="icon icon-' + this.settings.iconClass +...

How to detect changes in wp_editor?

javascript,wordpress,tinymce-4,wp-editor

if (tinyMCE.activeEditor.isDirty()) alert("You must save your contents."); is working for me. More: activeEditor, isDirty...

Tinymce4 Remove background-color from text with colorpicker

tinymce-4

Found a solution changing the plugin (textcolor). If there is a better way please be free to post it. I added additional colors to the colorpicker. The Color #FFFFFe (near White) i marked as NO COLOR and changed the plugin as shown. function onPanelClick(e) { var buttonCtrl = this.parent(), value;...

Skipping tinymce image-upload modal

ruby-on-rails,tinymce,tinymce-4

UPDATE: Quick and dirty monkey patch here No additional window between button press and system file selection dialog and image is inserted right after file was selected. In my chrome 40.0.2214.111 Ubuntu 14.04 (64-bit) seems to work as expected. git clone https://github.com/PerfectlyNormal/tinymce-rails-imageupload.git cd tinymce-rails-imageupload # substitute app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js with a patched...

how to change tinyMCE Directionality after it has been set

javascript,jquery,tinymce,tinymce-4

I'd removed and initiated it again and it solved my problem : function tinyInit(tinyDir) { tinymce.init({ selector: ".txaContent", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor...

Cannot write in text box while it's autosaving using tinymce-4 plugin

javascript,jquery,tinymce-4

I have solved this problem: just change form async:false, to async:true, in ajax calling part. $.ajax({ url: settings.url, type: $form.attr('method'), data: ds, dataType:"json", async:true, success: function(msg) { if (settings.callback){ //editor.setContent(msg.draft_body); $("#save_status").html("Saved"); settings.callback(msg); } else{ $("#save_status").html("Saving error"); console.log(msg); } } }); ...

TinyMCE doesn't work on second init

javascript,jquery,tinymce,tinymce-4

Try by placing the initialization code at the head section <!-- Place inside the <head> of your HTML --> <script type="text/javascript" src="<your installation path>/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "textarea", menubar: false, statusbar: false }); </script> ...

How to add tinymce 4.x dynamically to textarea?

javascript,jquery,html,tinymce,tinymce-4

Have you tried calling tinymce.init function after the appendTo function? jQuery functions operates synchronously, one at a time. That means, your init function will run after the appentTo completes, and that means, you don't need a callback for that. Just write your tinymce.init funtion after the appendTo and get back...

Cannot render a dynamically added textarea as TinyMCE 4.1.8

javascript,jquery,html,tinymce-4

You are incrementing next_agpoitext too soon. You should increment it after using it to build the textAreaID variable. Let's say next_agpoitext has a value of 3: You are creating a <textarea> with id="agpoitexts-3-paragraph". You increment next_agpoitext. So it now has a value of 4 You use the incremented value to...

TinyMCE custom format with :before selector

javascript,css,internet-explorer,tinymce,tinymce-4

I've found the cause of the problem. It's a known bug with IE regarding the :before selector and Quirks mode

Internet Explorer Tells me The Cache for forward and backward ist deakivated

javascript,ruby-on-rails,html5,internet-explorer-9,tinymce-4

thats probably a Problem while saving? are you using something like the tinyMCE oder CKeditor? Check the configuration of those....

Getting the TinyMCE 4 Font Sizes drop down to set the font size in px instead of pt

tinymce-4

You need to use the fontsize_formats option where you can also change the unit of the values of the font sizes dropdown: tinymce.init({ selector: 'textarea', toolbar: 'fontsizeselect', fontsize_formats: "8px 10px 12px 14px 18px 24px 36px" }); Demo JSFiddle....

TinyMCE v4.1 multiple textboxes with different settings

javascript,asp.net,tinymce,tinymce-4

That does not work for me BUT I've found a "solution". The problem is only with TinyMCE v4.x. Using versions 3.x (3.5.11 in my case) all worked fine... I don't know if it is a bug or a different behaviour... the final working javascript code is: tinyMCE.init({ // General options...

Responsive Filemanager 9 opens blank dialog in TinyMCE 4

javascript,php,tinymce-4

You need to activate the mbstring extension in your php settings: see: Unable to call the built in mb_internal_encoding method?

Tinymce: allow userdefined tags

tinymce,tinymce-4

You should have a closer look into the documentation. Try custom_elements.

In TinyMCE 4, editor.onBeforeSetContent.add() is deprecated, what to use instead?

javascript,javascript-events,tinymce,tinymce-4,tinymce-3

You will have to use editor.on('BeforeSetcontent', function(event){ console.log(event) }); ...

How do I add toolbar buttons to a custom tinymce dropdown menu?

javascript,jquery,tinymce,rich-text-editor,tinymce-4

Try this setup - Plunker tinymce.init({ selector: "textarea", toolbar: "styleselect | bold italic | alignment | alignmentv2", setup: function(editor) { editor.addButton('alignment', { type: 'listbox', text: 'Alignment', icon: false, onselect: function(e) { tinyMCE.execCommand(this.value()); }, values: [ {icon: 'alignleft', value: 'JustifyLeft'}, {icon: 'alignright', value: 'JustifyRight'}, {icon: 'aligncenter', value: 'JustifyCenter'}, {icon: 'alignjustify', value:...

Tinymce 4.x insert flash player directly into the editor

javascript,html,tinymce-4

You should try initialising the player in the onLoadContent event handler of TinyMCE. E.g. tinyMCE.init({ ... setup : function(ed) { ed.onLoadContent.add(function(ed, o) { jwplayer(id).setup({ file: video.href, image: video.img, title: video.title, width: '640', height: '360', primary: 'flash', aspectratio: '16:9' }); }); } }); The pont is that you need an element...

tinymce 4 init button

javascript,button,initialization,tinymce-4

You need to move the onclick event outside the add button object. editor.addButton(...); editor.on('click', function(e) { alert('Insert logic here'); }); The syntax has also changed a little. This TinyMCE Migration Guide might help explain more....

Reactjs together with TinyMCE editor code plugin

tinymce,reactjs,tinymce-4

Alright, so it turned out that bootstrap modals javascript is somehow highjacking this. In favor of saving some time I decided not to dig realy into this but just to create my own modal js inside of the jsx. Aparently there is also React Bootstrap, but it looks at the...

How do you make changes from a new windowManager window?

javascript,tinymce,tinymce-4

I figured it out already! Here is my code if people want to know how I did it: setup: function(ed) { // on mouse up gets selected text ed.on('mouseup', function(ed) { var highlighted = tinyMCE.activeEditor.selection.getContent(); // Checks if highlighted texts contains a placeholder if (highlighted.indexOf("[!") > -1) { //alert(highlighted); tinyMCE.activeEditor.windowManager.open({...

Using TinyMCE with Fancybox

asp.net-mvc,tinymce,fancybox,tinymce-4

Nevermind, I have a good solution: just use EditorTemplates. I ended up doing the following: Add this on the model property: [UIHint("RichTextEditorFull")] Then use EditorFor instead of TextAreaFor in the plugins and finally: Create the RichTextEditorFull editor template in the main application In my case: @{ string fieldName = @ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty);...

Configure TinyMCE in Joomla front-end

joomla3.0,tinymce-4

This option allows you to configure the menus you want to appear in the menu bar. Disable all menus tinymce.init({ menubar : false }); for "toggle editor" button look for link remove toggle editor button...

TinyMCE escapes all tags upon saving

java,javascript,tinymce-4

It seems like the portal server WAS responsible, after all. After porting the project from WebSphere Portal 8.0 to 8.5, everything seems to work.

How to create a button in TinyMCE 4 that increments letter-spacing by 1px

tinymce-4

Replace every font-size by letter-spacing and it will work: http://fiddle.tinymce.com/Z9eaab/6 <script type="text/javascript"> tinymce.PluginManager.add('example', function(editor, url) { // Add a button that opens a window editor.addButton('example', { text: 'Increment font size', icon: false, onclick: function() { var currentFontSize = new Number($(tinyMCE.activeEditor.selection.getNode()) .css('letter-spacing').replace('px','')); // <-------- here currentFontSize = currentFontSize + 1;...

Adding a color box for “Transparent” on the TinyMCE-4 color picker

tinymce-4

I believe I was able to do that, I did some quick tests and it appears to be working fine. I got the latest version of TinyMCE (4.1.10_dev) to access the textcolor plugin's non minified javascript there's this instruction: if (value == 'transparent') { resetColor(); } else { selectColor(value); }...

addButton not working a second time

javascript,tinymce,tinymce-4

Update: The solution listed below still is the only way I got this placeholder menu business to work. Meanwhile, though, I have found the time to write a TinyMCE plugin, which I've put up on github. Because I've found evidence of people trying to do the same thing as I...

Loop always returns last value of array [duplicate]

javascript,jquery,tinymce,tinymce-4

Close over i for (var i in array) { new function(){ var iCopy = i; editor.addButton(array[iCopy ], { title: '', icon: true, image: 'img/smileys/'+ array[iCopy ] +'.gif', onclick: function() { editor.execCommand('mceInsertContent', false, '<img src="img/smileys/'+ array[iCopy ] +'.gif">'); } }); } } ...

TinyMCE - how to add custom insert template button for each template

javascript,tinymce,zurb-foundation,tinymce-4

Referring to your comment without writing much of javascript codes You will always have to write javascript to create something like this in TinyMce, but it doesn't have to be complicated. A simple and straightforward approach is to write a plugin for each toolbar button you would like to create....

How to remove other html tags except p tag on Paste?

javascript,jquery,html,copy-paste,tinymce-4

You need to explicitly tell TinyMCE what attributes to keep when using the valid_elements option. For example, using your previous valid_elements list, you might do something like this: valid_elements: "p[style],br,b,i,strong,em" This tells TinyMCE to only keep the tags listed and to keep any style attributes defined for p tags. Alternatively,...

TinyMCE windowManager - modal with scrollbars

javascript,tinymce,tinymce-4

Hah, I've spent all of yesterday trying to figure this out but as soon I've posted my question I've found the answer myself. I was trying to repaint the dialog after setting overflow: auto manually by calling win._bindings.repaint[0]() and it gave me an error: Cannot read property 'autoScroll' of undefined...

filtering out select style attributes and blacklisting attributes

tinymce,tinymce-4

There are several ways to filter your content: use the tinymce paste_preprocess parameter to filter pasted content before insertion you may use the valid_elements, valid_children and extended_valid_elements setting to allow which elements and attributes tinymce accepts as valid html tags (this is something you don't want?) you can filter your...

How to access Polymer variables from outside Polymer

javascript,html,iframe,polymer,tinymce-4

I think your trouble is just because you don't wait Polymer is ready. You have to add a listener on the polymer-ready event before to hope to use safely the Polyfill. Get a Polymer component property value from outside the element example. EDIT : I misread, I'm sorry. So, you...

set Content of a TinyMCE textarea via HTML

javascript,jquery,html,tinymce,tinymce-4

If you define TinyMCE like that: tinymce.init({selector:'textarea'}); that code should do what you need: <textarea>Some Contents</textarea> Example here: http://jsfiddle.net/n9djp4u2/...

tinymce - update plugin property after editor initialization

javascript,javascript-events,tinymce,tinymce-4

maybe in tinymce settings tinymce.init({ textcolor_map: ["000000", "Black"] }); ...

Add custom text color WordPress 3.9 TinyMCE 4 Visual editor

wordpress,wordpress-plugin,tinymce-4

Option for text colours is textcolor_map and each colour's format is "color_hex", "color_name". So, from your example, simply change option name and convert the colours array to something like this: function my_mce4_options($init) { $default_colours = '"000000", "Black", "993300", "Burnt orange", "333300", "Dark olive", "003300", "Dark green", "003366", "Dark azure", "000080",...

Reinitialize TinyMCE 4 in AJAX

jquery,ajax,tinymce-4

Problem here is that closing the box without shutting down the inner tinymce instance properly will result in not showing the editor the second time (because there is still a tinymce editor object in the variable window.tinymce.editors). Solution: onclose (in fact before destroying or removing) of the box shut down...

TinyMCE toolbar display on IE8 over https

internet-explorer,https,ruby-on-rails-3.1,tinymce-4

IE8 does not allow you to download any content from a secure SSL site. It is considering your tinymce.eot as a downloadable file and not letting you download via the browser. Deleting below headers will allow the files to be downloaded. This can be done on your proxy or web...

VBS and Tinymce

php,html,vbscript,tinymce-4

E-Mail Example: // Sending an email with PHP $to = $email; // Send email to our user $subject = 'Email Sent with PHP'; // Give the email a subject $message = ' <html> <head> </head><body> <h3>Hey!</h3> </body> </html> '; // Our message above including the link $headers = 'From:[email protected]' ....