Skip to content

melquibrito/case-change-tinymce-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Case Change

Free case-change plugin for Tinymce WYSIWYG Editor.

preview

To use this plugin copy the folder "case" and paste it into the "plugins" folder in tinymce directory. Here's the path for tinymce_5.2.0 self-hosted production release -> tinymce_5.2.0/tinymce/js/tinymce/plugins

Download any of tinymce self-hosted releases here.

Tutorial

Initializing

Add the dropdown case-change button to your tinymce WYSIWYG editor by simply including "case" in your tinymce toolbar's configuration as well as in the plugins' configuration as demonstrated bellow:

tinymce.init({
    selector: "#target-element", // change this value according to your HTML target element selector
    toolbar: ["case"],
    plugins: ["case"],
});

Configuration

Title case minors

The following prepositions won't be title cased by default: at, by, in, of, on, up, to, en, re, vs, but, off, out, via, bar, mid, per, pro, qua, til, from, into, unto, with, amid, anit, atop, down, less, like, near, over, past, plus, sans, save, than, thru, till, upon, for, and, nor, but, or, yet, so, an, a, some, the.

To change the whole set of title case minors (to a different language, for instance), simply include title_case_minors to your tinymce init configuration as demonstrated bellow:

tinymce.init({
    selector: "#target-element", // change this value according to your HTML target element selector
    toolbar: ["case"],
    plugins: ["case"],
    title_case_minors: ["your", "customized", "set", "of", "minors", "here"]
    // You can also set it this way. Do it as you prefer.
    // title_case_minors: "your customized set of minors here with a space in between them"
});

To include minors to the default set, use inlcude_to_title_case_minors. To exclude any of the title minors, use rule_out_from_title_case_minors.

In the example below we are including who, whom, and that, and excluding down, into, and onto.

tinymce.init({
    selector: "#target-element", // change this value according to your HTML target element selector
    toolbar: ["case"],
    plugins: ["case"],
    inlcude_to_title_case_minors: ["who", "whom", "that"], // These won't be title cased anymore.
    rule_out_from_title_case_minors: ["down", "into", "onto"] // These will now be title cased.
});

Author

License

This project is licensed under the MIT License - see the LICENSE file for more details.