No commit activity in last 3 years
No release in over 3 years
Simple tinyMCE configuration manager that makes it easier to manage different configurations without changing templates
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 3.2
 Project Readme

TinymceRailsConfigManager

Simple tinyMCE configuration manager

Instructions

  1. Add tinymce-rails-config-manager
gem 'tinymce-rails-config-manager'
  1. Include asset in your JS manifest file

//= require tinymce-rails-config-manager

Usage

How to change setting properties

  • To add new property (added only once)

    This will add template to plugin option existing value

    TinyMCEConfigManager.get().config.add("plugin", "template")
  • To add new value after some other (added only once; buttons is shortcut to all theme_advanced_buttonsX)

    This will add fullscreen button after bold

    TinyMCEConfigManager.get().config.addAfter("buttons", "fullscreen", "bold")
  • To add new value before some other (added only once)

    This will add fullscreen button before bold

    TinyMCEConfigManager.get().config.addBefore("buttons", "fullscreen", "bold")
  • To set property

    This will set value right for theme_advanced_toolbar_align

    TinyMCEConfigManager.get().config.set("theme_advanced_toolbar_align", "right")
  • To add callback (new callback function will be added with every call)

    This will add callback for setup

    TinyMCEConfigManager.get().config.addFunction("setup", function(editor){ /*do something here*/})

How to change settings

To add or change settings for specific textareas use

TinyMCEConfigManager.get().configFor("#my_special_textarea")

and then use all property modifiers as mentioned above. Default settings will be loaded for all other textareas.

How to load

Simply call load(). Also it is possible to pass some specific configuration there, but that will overwrite existing and that is not recommended.

TinyMCEConfigManager.get().load()

Roadmap

  • Make it possible to change order of existing values
  • add tests

This project rocks and uses MIT-LICENSE.