Sha256: b74e317c778098e4e64d96b8537d732e190b4b68ee077a7ec8fae36a4db337f7

Contents?: true

Size: 1.75 KB

Versions: 1

Compression:

Stored size: 1.75 KB

Contents

/* ===========================================================
 * trumbowyg.indent.js v1.0
 * Indent or Outdent plugin for Trumbowyg
 * http://alex-d.github.com/Trumbowyg
 * ===========================================================
 * Author : Fabacks
 *          Website : https://github.com/Fabacks
 */

 (function ($) {
    'use strict';

    $.extend(true, $.trumbowyg, {
        langs: {
            en: {
                indent: 'Indent',
                outdent: 'Outdent'  
            },
            fr: {
                indent: 'Augmenter le retrait',
                outdent: 'Diminuer le retrait'
            }
        }
    });

    // Adds the extra button definition
    $.extend(true, $.trumbowyg, {
        plugins: {
            paragraph: {
                init: function (trumbowyg) {
                    var indentBtnDef = {
                        fn: 'indent',
                        title: trumbowyg.lang.indent,
                        isSupported: function () { 
                            return !!document.queryCommandSupported && !!document.queryCommandSupported('indent'); 
                        },
                        ico: 'indent'
                    };

                    var outdentBtnDef = {
                        fn: 'outdent',
                        title: trumbowyg.lang.outdent,
                        isSupported: function () { 
                            return !!document.queryCommandSupported && !!document.queryCommandSupported('outdent'); 
                        },
                        ico: 'outdent'
                    };

                    trumbowyg.addBtnDef('indent', indentBtnDef);
                    trumbowyg.addBtnDef('outdent', outdentBtnDef);
                }
            }
        }
    });
})(jQuery);

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin_trumbowyg-0.2.12 app/assets/javascripts/activeadmin/trumbowyg/plugins/indent/trumbowyg.indent.js