UNPKG

@bigfishtv/cockpit

Version:

43 lines (38 loc) 858 B
var $ = require('jquery'); if(typeof window.RedactorPlugins == 'undefined') window.RedactorPlugins = {}; var RedactorPlugins = window.RedactorPlugins; RedactorPlugins.styles = function() { return { langs: { en: { 'styles': 'Styles' } }, init: function() { var tags = { 'lead': { title: 'Lead', args: ['p', 'class', 'lead', 'toggle'] }, 'pullout': { title: 'Pullout', args: ['p', 'class', 'pullout', 'toggle'] }, 'tip': { title: 'Tip', args: ['p', 'class', 'tip', 'toggle'] } }; var dropdown = {}; $.each(tags, function(i, s) { dropdown[i] = { title: s.title, func: 'inline.format', args: s.args }; }); var button = this.button.addAfter('format', 'styles', this.lang.get('styles')); this.button.addDropdown(button, dropdown); } }; };