An open API service indexing awesome lists of open source software.

https://github.com/amineo/redactor-trace-elements

This plugin adds the ability to toggle a trace on common parent block-level elements with an outline and their element name
https://github.com/amineo/redactor-trace-elements

Last synced: 3 months ago
JSON representation

This plugin adds the ability to toggle a trace on common parent block-level elements with an outline and their element name

Awesome Lists containing this project

README

        

![TraceElements in action](https://github.com/amineo/redactor-trace-elements/raw/master/screenshot.png)

[**Blog Post**](https://anthonymineo.com/trace-elements-plugin-for-redactor/)

This plugin adds the ability to toggle a trace on common parent block-level elements with an outline and their element name.

The purpose for creating this plugin was so that it becomes a little clearer on what my WYSIWYG is doing. Is it adding unnecessary `

` tags? Are there empty `

`,`
    ` or `` elements? Without jumping into source view it's hard to tell.

    It also comes in handy for writers/editors who may not be as familiar with HTML or the source view.

    Currently the plugin traces these common block elements by default:


    • div

    • br

    • p

    • ul

    • ol

    • pre

    • h1

    • h2

    • h3

    • h4

    • h5

    • h6


    ## How to Extend
    You can easily extend what gets traced with CSS! Just modify the selector below and add to your stylesheet.

    ```
    /* Replace ELEMENTNAME with the element you want to trace */
    .redactor-trace.redactor-layer > ELEMENTNAME:after {
    content:'ELEMENTNAME';
    }
    ```
    This plugin makes use of `::after` with the `content` property so it's fast and customizable.


    ## How to Initialize
    ```



    $(function(){
    $('#redactor').redactor({
    plugins: ['TraceElements']
    });
    });

    ```
    - Reference the plugin script src
    - Include **TraceElements** in the plugins array