New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tinymce-rails-config-manager

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinymce-rails-config-manager

0.1.0
Rubygems
Version published
Maintainers
1
Created
Source

TinymceRailsConfigManager

Simple tinyMCE configuration manager

Instructions

  • Add tinymce-rails-config-manager
gem 'tinymce-rails-config-manager'
  • 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.

FAQs

Package last updated on 10 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts