legacy/src/wysiwyg-editor.js
function( button ) {
            var $element = $('<a/>').addClass( 'wysiwyg-toolbar-icon' )
                                    .prop('href','#')
                                    .prop('unselectable','on')
                                    .append(button.image);
            // pass other properties as "prop()"
            $.each( button, function( name, value )
            {
                switch( name )
                {
                    // classes
                    case 'class':
                        $element.addClass( value );
                        break;
                    // special meaning
                    case 'image':
                    case 'html':
                    case 'popup':
                    case 'click':
                    case 'showstatic':
                    case 'showselection':
                        break;
                    default: // button.title, ...
                        $element.attr( name, value );
                        break;
                }
            });
            return $element;
        }
function( button ) {
            var $element = $('<a/>').addClass( 'wysiwyg-toolbar-icon' )
                                    .prop('href','#')
                                    .prop('unselectable','on')
                                    .append(button.image);
            // pass other properties as "prop()"
            $.each( button, function( name, value )
            {
                switch( name )
                {
                    // classes
                    case 'class':
                        $element.addClass( value );
                        break;
                    // special meaning
                    case 'image':
                    case 'html':
                    case 'popup':
                    case 'click':
                    case 'showstatic':
                    case 'showselection':
                        break;
                    default: // button.title, ...
                        $element.attr( name, value );
                        break;
                }
            });
            return $element;
        }
function ( button ) { var $element = $ ( '<a/>' ) . addClass ( 'wysiwyg-toolbar-icon' ) . prop ( 'href' , '#' ) . prop ( 'unselectable' , 'on' ) . append ( button . image ) ; // pass other properties as "prop()" $ . each ( button , function ( name , value ) { switch ( name ) { // classes case 'class' : $element . addClass ( value ) ; break ; // special meaning case 'image' : case 'html' : case 'popup' : case 'click' : case 'showstatic' : case 'showselection' : break ; default : // button.title, ... $element . attr ( name , value ) ; break ; } } ) ; return $element ; }
Create the toolbar
Create the toolbar