example/public/ueditor/third-party/SyntaxHighlighter/shCore.js
function(e)
            {
                var target = e.target,
                    className = target.className || ''
                    ;

                function getValue(name)
                {
                    var r = new RegExp(name + '_(\\w+)'),
                        match = r.exec(className)
                        ;

                    return match ? match[1] : null;
                };

                var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id),
                    commandName = getValue('command')
                    ;

                // execute the toolbar command
                if (highlighter && commandName)
                    sh.toolbar.items[commandName].execute(highlighter);

                // disable default A click behaviour
                e.preventDefault();
            }
function(e)
            {
                var target = e.target,
                    className = target.className || ''
                    ;

                function getValue(name)
                {
                    var r = new RegExp(name + '_(\\w+)'),
                        match = r.exec(className)
                        ;

                    return match ? match[1] : null;
                };

                var highlighter = getHighlighterById(findParentElement(target, '.syntaxhighlighter').id),
                    commandName = getValue('command')
                    ;

                // execute the toolbar command
                if (highlighter && commandName)
                    sh.toolbar.items[commandName].execute(highlighter);

                // disable default A click behaviour
                e.preventDefault();
            }
function ( e ) { var target = e . target , className = target . className || '' ; function getValue ( name ) { var r = new RegExp ( name + '_(\\w+)' ) , match = r . exec ( className ) ; return match ? match [ 1 ] : null ; } ; var highlighter = getHighlighterById ( findParentElement ( target , '.syntaxhighlighter' ) . id ) , commandName = getValue ( 'command' ) ; // execute the toolbar command if ( highlighter && commandName ) sh . toolbar . items [ commandName ] . execute ( highlighter ) ; // disable default A click behaviour e . preventDefault ( ) ; }
Event handler for a toolbar anchor.
Event handler for a toolbar anchor .