How to remove the “title” attribute that the CKEditor 4 add automatically on inline editing?

独自空忆成欢 提交于 2019-12-18 06:12:12

问题


When using CKEditor 4 Inline Editing on a object the CKEditor add a "Title" attribute that include a text and the object id.

e.g. In the CKEditor inline example we can see the next code:

<h2 id="inline-sampleTitle" title="Rich Text Editor, inline-sampleTitle"....>CKEditor<br>Goes Inline!</h2>

I like to remove the "title" attribute because i do not like the user to see it (my id is more complicated :) ).

Note: I was trying to remove it manually after the CKEditor create it using jQuery "removeAttr" function but this solution is not really good for me because in IE browsers the user still see it in the first time and it will remove only after the user mouse out from the object.


回答1:


CKEDITOR.config.title = false;

For More Details Visit this




回答2:


You can find here some details: How can I change the title ckeditor sets for inline instances?

Unfortunately, you cannot change it without modifying the code. I reported ticket for this http://dev.ckeditor.com/ticket/10042




回答3:


See https://stackoverflow.com/a/15270613/2148773 - looks like you can manually set the "title" attribute of the editor element to override the tooltip.




回答4:


in your config

CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here.
    // For the complete reference:
    // http://docs.ckeditor.com/#!/api/CKEDITOR.config
    config.title="";
}



回答5:


CKEditor fix it in version 4.2 so we can remove this fix now :) http://dev.ckeditor.com/ticket/10042




回答6:


You can put in ckeditor config object function that will delete the title after editor is initialized:

on: {       
        instanceReady: function(event){
            $(event.editor.element.$).attr('title','');
        },
},



回答7:


You can use this code in order to delete the title on every CKEDITOR will be created.

CKEDITOR.on('instanceReady',function(event){$(event.editor.element.$).attr('title','');});



回答8:


i tried this in my codeigniter view page and it works for me. also i used my own custom tooltip for my users.

CKEDITOR.inline( 'ckeditor' );
CKEDITOR.config.title = false; // or you can use own custom tooltip message.


thanks
Braham Dev Yadav




回答9:


I have tried using

CKEDITOR.config.title = false;

but it still persist showing title.

After some research, what I done is:

1.Go to ~/ckeditor/lang/en-gb.js remove out 'editorHelp' value

2.Assign language and title, same as below:

CKEDITOR.editorConfig = function( config ) {
config.language="en-gb";
config.title="Put your title here"; //cannot put blank, it will display "null"


来源:https://stackoverflow.com/questions/14730921/how-to-remove-the-title-attribute-that-the-ckeditor-4-add-automatically-on-inl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!