Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to remove title attribute from tinymce textarea

I am using jquery-ui tooltip and tinimce 4,

the problem is when tinymce is loaded in a textarea there is the title attribute "Rich Text AreaPress ALT-F10 for toolbar..." that display a jqueryui tooltip all the time.

I have tried to remove the title with js, but nothing changed:

document.getelementbyid('message_ifr').RemoveAttribute('title');

Is there a way to remove the title from tinymce or the jqueryui tooltip on the textarea?

EDIT:

this is tinymce code:

tinymce.init({

mode : "exact",

elements : "message,notes",

plugins: "advlist autolink lists link image charmap hr anchor pagebreak code fullscreen table ",

toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image table code fullscreen",

menubar: false,

statusbar: false,

});

and jquery-ui tooltip code:

$(function() { 
    $( document ).tooltip({ 
    content: function() { return $(this).attr('title'); } // br
    }); 
});
like image 919
ipel Avatar asked Aug 18 '13 09:08

ipel


People also ask

How to remove TinyMCE from a control?

And if you would like to remove only a special instance of TinyMCE, you can also pass the appropriate ID: Of course, you can also use other selectors such as classes, for example. Older versions of TinyMCE can be removed using the line tinyMCE.execCommand ('mceRemoveControl', false, 'myid'), where you have to adjust "myid".

How to remove style from TinyMCE content using regular expressions?

The regular expression (also called regex) can then change the attributes to remove style. TinyMCE’s APIs offer the main methods to get content, and remove style from the content with regular expressions or other means. The tinymce.activeEditor.getContent is a common and reliable method to get content from TinyMCE.

How to remove only the editors bind to textareas or divs?

If you only would like to remove the editors, that are bind to textareas or divs, you can use one of the following commands: And if you would like to remove only a special instance of TinyMCE, you can also pass the appropriate ID: Of course, you can also use other selectors such as classes, for example.

What is a free TinyMCE API key?

When you sign up for a FREE API key, you not only receive access to premium plugins for 14 days, but for that same period you also receive support for your project development. Get your FREE TinyMCE API key today for your app!


2 Answers

I have just figured out the correct solution for my problem:

(thx to: raina77ow for this fiddle )

STEP 1:

after the tinymce integration code add this:

tinymce.init({
// ...
});

var ed = tinymce.activeEditor;
var ifr = tinymce.DOM.get(ed.id + '_ifr');
ed.dom.setAttrib(ifr, 'title', '');

STEP 2

change the jquery-ui tooltip function from document to '[title]', like this:

$(function() { $( '[title]' ).tooltip({ content: function() { return $(this).attr('title'); } }); });
like image 178
ipel Avatar answered Sep 20 '22 22:09

ipel


tinymce.init({
    setup: function( editor ){
        editor.on('init', function( e ){
            $('#' + e.target.id + '_ifr').removeAttr('title');
        });
    }
});

Used jQuery !

like image 43
John Fort Avatar answered Sep 18 '22 22:09

John Fort