简体   繁体   中英

tinyMCE JQuery plugin - How do you set global config options?

I'm new to tinyMCE and I like the jQuery plugin that comes in the latest version. However I'd like to set global options that would be used in every subsequent instance; for example themes and skins. Is this possible?

Edit.

Here is an example of the method I have used.

$(document).ready(function(){
    var config = {
        directionality : 'rtl'
    }

    $('#message').tinymce(
        $.extend({}, config, {
            directionality : "ltr"
        }
    );
});

why not just create a defaults object containing the common options

and then use $.extend(defaults, overrideOptions);

to put your overrides for each instance:

You can also use tinymce.overrideDefaults() :

tinymce.overrideDefaults({
   directionality: 'rtl'
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM