<commit_before>//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require_directory ./panel
//= require_directory ./shared
//= require wisiwygjs/standalone.min
//= require_self

$('document').ready(function() {
    $('.editor').each( function(index, element)
    {
        $(element).wysiwyg({
                'class': 'fake-bootstrap', // : (index == 1 ? 'fake-uikit' : 'some-more-classes'),
                // 'selection'|'top'|'top-selection'|'bottom'|'bottom-selection'
                toolbar: 'top-selection', // : (index == 1 ? 'bottom-focus' : 'selection'),
                buttons: {
                    insertimage: {
                        title: 'Insert image',
                        image: '\uf030', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        //showstatic: true,    // wanted on the toolbar
                        showselection: index == 2 ? true : false    // wanted on selection
                    },
                    insertvideo: {
                        title: 'Insert video',
                        image: '\uf03d', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        //showstatic: true,    // wanted on the toolbar
                        showselection: index == 2 ? true : false    // wanted on selection
                    },
                    insertlink: {
                        title: 'Insert link',
                        image: '\uf08e' // <img src="path/to/image.png" width="16" height="16" alt="" />
                    },
                    // Fontname plugin
                    fontname: {
                        title: 'Font',
                        image: '\uf031', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            var list_fontnames = {
                                // Name : Font
                                'Arial, Helvetica' : 'Arial,Helvetica',
                                'Verdana'          : 'Verdana,Geneva',
                                'Georgia'          : 'Georgia',
                                'Courier New'      : 'Courier New,Courier',
                                'Times New Roman'  : 'Times New Roman,Times'
                            };
                            var $list = $('<div/>').addClass('wysiwyg-plugin-list')
                                .attr('unselectable','on');
                            $.each( list_fontnames, function( name, font ) {
                                var $link = $('<a/>').attr('href','#')
                                    .css( 'font-family', font )
                                    .html( name )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').fontName(font).closePopup();
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append( $link );
                            });
                            $popup.append( $list );
                        },
                        //showstatic: true,    // wanted on the toolbar
                        showselection: index == 0 ? true : false    // wanted on selection
                    },
                    // Fontsize plugin
                    fontsize: {
                        title: 'Size',
                        style: 'color:white;background:red',      // you can pass any property - example: "style"
                        image: '\uf034', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            // Hack: http://stackoverflow.com/questions/5868295/document-execcommand-fontsize-in-pixels/5870603#5870603
                            var list_fontsizes = [];
                            for( var i=8; i <= 11; ++i )
                                list_fontsizes.push(i+'px');
                            for( var i=12; i <= 28; i+=2 )
                                list_fontsizes.push(i+'px');
                            list_fontsizes.push('36px');
                            list_fontsizes.push('48px');
                            list_fontsizes.push('72px');
                            var $list = $('<div/>').addClass('wysiwyg-plugin-list')
                                .attr('unselectable','on');
                            $.each( list_fontsizes, function( index, size ) {
                                var $link = $('<a/>').attr('href','#')
                                    .html( size )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').fontSize(7).closePopup();
                                        $(element).wysiwyg('container')
                                            .find('font[size=7]')
                                            .removeAttr("size")
                                            .css("font-size", size);
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append( $link );
                            });
                            $popup.append( $list );
                        }
                        //showstatic: true,    // wanted on the toolbar
                        //showselection: true    // wanted on selection
                    },
                    // Header plugin
                    header: {
                        title: 'Header',
                        style: 'color:white;background:blue',      // you can pass any property - example: "style"
                        image: '\uf1dc', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            var list_headers = {
                                // Name : Font
                                'Header 1' : '<h1>',
                                'Header 2' : '<h2>',
                                'Header 3' : '<h3>',
                                'Header 4' : '<h4>',
                                'Header 5' : '<h5>',
                                'Header 6' : '<h6>',
                                'Code'     : '<pre>'
                            };
                            var $list = $('<div/>').addClass('wysiwyg-plugin-list')
                                .attr('unselectable','on');
                            $.each( list_headers, function( name, format ) {
                                var $link = $('<a/>').attr('href','#')
                                    .css( 'font-family', format )
                                    .html( name )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').format(format).closePopup();
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append( $link );
                            });
                            $popup.append( $list );
                        }
                        //showstatic: true,    // wanted on the toolbar
                        //showselection: false    // wanted on selection
                    },
                    bold: {
                        title: 'Bold (Ctrl+B)',
                        image: '\uf032', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        hotkey: 'b'
                    },
                    italic: {
                        title: 'Italic (Ctrl+I)',
                        image: '\uf033', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        hotkey: 'i'<commit_msg>updates for editor list<commit_after>//= require jquery
//= require jquery_ujs
//= require twitter/bootstrap
//= require_directory ./panel
//= require_directory ./shared
//= require wisiwygjs/standalone.min
//= require_self

$('document').ready(function() {
    $('.editor').each( function(index, element)
    {
        $(element).wysiwyg({
                'class': 'fake-bootstrap', // : (index == 1 ? 'fake-uikit' : 'some-more-classes'),
                // 'selection'|'top'|'top-selection'|'bottom'|'bottom-selection'
                toolbar: 'top-selection', // : (index == 1 ? 'bottom-focus' : 'selection'),
                buttons: {
                    insertimage: {
                        title: 'Insert image',
                        image: '\uf030', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        //showstatic: true,    // wanted on the toolbar
                        showselection: index == 2 ? true : false    // wanted on selection
                    },
                    insertvideo: {
                        title: 'Insert video',
                        image: '\uf03d', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        //showstatic: true,    // wanted on the toolbar
                        showselection: index == 2 ? true : false    // wanted on selection
                    },
                    insertlink: {
                        title: 'Insert link',
                        image: '\uf08e' // <img src="path/to/image.png" width="16" height="16" alt="" />
                    },
                    // Fontname plugin
                    fontname: {
                        title: 'Font',
                        image: '\uf031', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            var list_fontnames = {
                                // Name : Font
                                'Arial, Helvetica' : 'Arial,Helvetica',
                                'Verdana'          : 'Verdana,Geneva',
                                'Georgia'          : 'Georgia',
                                'Courier New'      : 'Courier New,Courier',
                                'Times New Roman'  : 'Times New Roman,Times'
                            };
                            var $list = $('<ul/>').addClass('wysiwyg-plugin-list list-group')
                                .attr('unselectable','on');
                            $.each( list_fontnames, function( name, font ) {
                                var $link = $('<a/>').attr('href','#')
                                    .css( 'font-family', font )
                                    .html( name )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').fontName(font).closePopup();
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append($('<li/>').addClass('list-group-item').append($link));
                            });
                            $popup.append( $list );
                        },
                        showstatic: true,    // wanted on the toolbar
                        showselection: true    // wanted on selection
                    },
                    // Fontsize plugin
                    fontsize: {
                        title: 'Size',
                        style: 'color:white;background:red',      // you can pass any property - example: "style"
                        image: '\uf034', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            // Hack: http://stackoverflow.com/questions/5868295/document-execcommand-fontsize-in-pixels/5870603#5870603
                            var list_fontsizes = [];
                            for( var i=8; i <= 11; ++i )
                                list_fontsizes.push(i+'px');
                            for( var i=12; i <= 28; i+=2 )
                                list_fontsizes.push(i+'px');
                            list_fontsizes.push('36px');
                            list_fontsizes.push('48px');
                            list_fontsizes.push('72px');
                            var $list = $('<ul/>').addClass('wysiwyg-plugin-list list-group')
                                .attr('unselectable','on');
                            $.each( list_fontsizes, function( index, size ) {
                                var $link = $('<a/>').attr('href','#')
                                    .html( size )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').fontSize(7).closePopup();
                                        $(element).wysiwyg('container')
                                            .find('font[size=7]')
                                            .removeAttr("size")
                                            .css("font-size", size);
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append($('<li/>').addClass('list-group-item').append($link));
                            });
                            $popup.append( $list );
                        }
                        //showstatic: true,    // wanted on the toolbar
                        //showselection: true    // wanted on selection
                    },
                    // Header plugin
                    header: {
                        title: 'Header',
                        style: 'color:white;background:blue',      // you can pass any property - example: "style"
                        image: '\uf1dc', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        popup: function( $popup, $button ) {
                            var list_headers = {
                                // Name : Font
                                'Header 1' : '<h1>',
                                'Header 2' : '<h2>',
                                'Header 3' : '<h3>',
                                'Header 4' : '<h4>',
                                'Header 5' : '<h5>',
                                'Header 6' : '<h6>',
                                'Code'     : '<pre>'
                            };
                            var $list = $('<ul/>').addClass('wysiwyg-plugin-list list-group')
                                .attr('unselectable','on');
                            $.each( list_headers, function( name, format ) {
                                var $link = $('<a/>').attr('href','#')
                                    .css( 'font-family', format )
                                    .html( name )
                                    .click(function(event) {
                                        $(element).wysiwyg('shell').format(format).closePopup();
                                        // prevent link-href-#
                                        event.stopPropagation();
                                        event.preventDefault();
                                        return false;
                                    });
                                $list.append($('<li/>').addClass('list-group-item').append($link));
                            });
                            $popup.append( $list );
                        }
                        //showstatic: true,    // wanted on the toolbar
                        //showselection: false    // wanted on selection
                    },
                    bold: {
                        title: 'Bold (Ctrl+B)',
                        image: '\uf032', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        hotkey: 'b'
                    },
                    italic: {
                        title: 'Italic (Ctrl+I)',
                        image: '\uf033', // <img src="path/to/image.png" width="16" height="16" alt="" />
                        hotkey: 'i'
{'fraction_non_alphanumeric': 0.12639035241774968, 'fraction_numerical': 0.012352183585060298, 'mean_word_length': 0.7976428496264337, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 82, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7565143', 'n_tokens_mistral': 3961, 'n_tokens_neox': 3635, 'n_words': 753}