def register_custom_buttons(features):
    features.register_editor_plugin(
        'hallo', 'superscriptformat',
        HalloPlugin(
            name='superscriptformat',
            js=[static('js/hallo-custombuttons.js')],
        ))
    features.default_features.append('superscriptformat')
    features.register_editor_plugin(
        'hallo', 'endnoteanchorbutton',
        HalloPlugin(
            name='endnoteanchorbutton',
            js=[static('js/hallo-custombuttons.js')],
        ))
    features.default_features.append('endnoteanchorbutton')
Beispiel #2
0
def register_tips_feature(features):
    features.register_editor_plugin(
        'hallo', 'ask-tips',
        HalloPlugin(
            name='answermodule',
            js=['js/ask_cfpb_tips.js'],
        ))
Beispiel #3
0
def register_html_feature(features):
    features.register_editor_plugin(
        'hallo', 'edit-html',
        HalloPlugin(
            name='editHtmlButton',
            js=['js/html_editor.js'],
        ))
Beispiel #4
0
def register_image_feature(features):
    features.register_editor_plugin(
        'hallo', 'image',
        HalloPlugin(
            name='hallowagtailimage',
            js=['wagtailimages/js/hallo-plugins/hallo-wagtailimage.js'],
        ))
    features.default_features.append('image')
Beispiel #5
0
def register_justify_feature(features):
    features.register_editor_plugin(
        'hallo', 'justify',
        HalloPlugin(
            name='hallojustify',
            js=['/static/plugins/justify.js'],
        ))
    features.default_features.append('justify')
Beispiel #6
0
def register_blockquote_feature(features):
    features.register_editor_plugin(
        'hallo', 'blockquote',
        HalloPlugin(
            name='halloblockquote',
            js=['testapp/js/hallo-blockquote.js'],
            css={'all': ['testapp/css/hallo-blockquote.css']},
        ))
Beispiel #7
0
def register_embed_feature(features):
    features.register_editor_plugin(
        'hallo', 'embed',
        HalloPlugin(
            name='hallowagtailembeds',
            js=['wagtailembeds/js/hallo-plugins/hallo-wagtailembeds.js'],
        ))
    features.default_features.append('embed')
Beispiel #8
0
def register_embed_feature(features):
    features.register_editor_plugin(
        'hallo', 'document-link',
        HalloPlugin(
            name='hallowagtaildoclink',
            js=['wagtaildocs/js/hallo-plugins/hallo-wagtaildoclink.js'],
        ))
    features.default_features.append('document-link')
def register_core_features(features):
    features.register_editor_plugin(
        'hallo', 'hr',
        HalloPlugin(
            name='hallohr',
            js=['wagtailadmin/js/hallo-plugins/hallo-hr.js'],
            order=45,
        )
    )
    features.default_features.append('hr')

    features.register_editor_plugin(
        'hallo', 'link',
        HalloPlugin(
            name='hallowagtaillink',
            js=['wagtailadmin/js/hallo-plugins/hallo-wagtaillink.js'],
        )
    )
    features.default_features.append('link')

    features.register_editor_plugin(
        'hallo', 'bold', HalloFormatPlugin(format_name='bold')
    )
    features.default_features.append('bold')

    features.register_editor_plugin(
        'hallo', 'italic', HalloFormatPlugin(format_name='italic')
    )
    features.default_features.append('italic')

    for element in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:
        features.register_editor_plugin(
            'hallo', element, HalloHeadingPlugin(element=element)
        )
    features.default_features.extend(['h2', 'h3', 'h4'])

    features.register_editor_plugin(
        'hallo', 'ol', HalloListPlugin(list_type='ordered')
    )
    features.default_features.append('ol')

    features.register_editor_plugin(
        'hallo', 'ul', HalloListPlugin(list_type='unordered')
    )
    features.default_features.append('ul')
def register_embed_feature(features):
    features.register_editor_plugin(
        'hallo', 'code',
        HalloPlugin(
            name='code',
            order=15,
            js=[staticfiles_storage.url('js/hallo-code.js')],
        )
    )
Beispiel #11
0
def register_embed_feature(features):
    """
    Hook to register custom richtext features
    """
    features.register_editor_plugin(
        'hallo', 'code-block',
        HalloPlugin(
            name='hallowagtailcodeblock',
            js=['js/lib/halo_codeblock_plugin.js'],
        )
    )
    features.default_features.append('code-block')
def register_snippet_feature(features):
    features.register_editor_plugin(
        'hallo',
        'snippet',
        HalloPlugin(
            name='halloembedder',
            options={'chooser': reverse('wagtailembedder_class_list')},
            js=['wagtailembedder/js/hallo-embedder.js'],
            css={'screen': ['wagtailembedder/css/admin.css']},
            order=999,
        )
    )
def register_cleanhtml_feature(features):
    features.register_editor_plugin(
        'hallo', 'cleanhtml',
        HalloPlugin(name='hallocleanhtml',
                    js=[
                        'wagtailadmin/js/vendor/jquery.htmlClean.min.js',
                        'wagtailadmin/js/vendor/rangy-selectionsaverestore.js',
                    ],
                    options={
                        'format':
                        False,
                        'allowedTags': [
                            'p', 'em', 'strong', 'div', 'ol', 'ul', 'li', 'a',
                            'figure', 'blockquote', 'cite', 'img'
                        ],
                        'allowedAttributes': ['style'],
                    }))