Skip to content

CKEditor plugin that hides content in a spoiler box that can be toggled open.

License

Notifications You must be signed in to change notification settings

mdoelker/ckeditor-plugin-spoiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CKEditor Spoiler Plugin

This plugin let's you create a spoiler box that can be toggled to show it's contents. It is based on the CKEditor widget system.

Screenshot

The plugin will create the following structure which can be styled to fit your needs.

<div class="spoiler">
    <h6 class="spoiler-title">Title</h6>
    <div class="spoiler-content"><p>Hidden content</p></div>
</div>

To open the spoiler box it should receive the spoiler-open class on the outer div.

There is an example with some default style and some js to make the toggling work.

Installation

Install with Bower using bower install ckeditor-plugin-spoiler

or

  1. Copy the spoiler directory into the "plugins" folder of CKEditor.
  2. Add the following to the CKEditor config.js file: config.extraPlugins = 'spoiler';
  3. Add the spoiler/css/spoiler.css stylesheet to your document or create your own style.

Options

config.spoiler_template - Specify to override the default template seen above. Placeholders in curly braces will be replaced with language vars. E.g. {defaultTitle} will become Title.

About

CKEditor plugin that hides content in a spoiler box that can be toggled open.

Resources

License

Stars

Watchers

Forks

Packages

No packages published