nl_tokens: iframe初始化
pl_tokens: function ( tools , othis ) { var iframeDOM = this . document , CHECK = 'layedit-tool-active' , container = getContainer ( Range ( iframeDOM ) ) , item = function ( type ) { return tools . find ( '.layedit-tool-' + type ) } if ( othis ) { othis [ othis . hasClass ( CHECK ) ? 'removeClass' : 'addClass' ] ( CHECK ) ; } tools . find ( '>i' ) . removeClass ( CHECK ) ; item ( 'unlink' ) . addClass ( ABLED ) ; $ ( container ) . parents ( ) . each ( function ( ) { var tagName = this . tagName . toLowerCase ( ) , textAlign = this . style . textAlign ; //文字 if ( tagName === 'b' || tagName === 'strong' ) { item ( 'b' ) . addClass ( CHECK ) } if ( tagName === 'i' || tagName === 'em' ) { item ( 'i' ) . addClass ( CHECK ) } if ( tagName === 'u' ) { <mask> ( 'u' ) . addClass ( CHECK ) } if ( tagName === 'strike' ) { item ( 'd' ) . addClass ( CHECK ) } //对齐 if ( tagName === 'p' ) { if ( textAlign === 'center' ) { item ( 'center' ) . addClass ( CHECK ) ; } else if ( textAlign === 'right' ) { item ( 'right' ) . addClass ( CHECK ) ; } else { item ( 'left' ) . addClass ( CHECK ) ; } } //超链接 if ( tagName === 'a' ) { item ( 'link' ) . addClass ( CHECK ) ; item ( 'unlink' ) . removeClass ( ABLED ) ; } } ) ; }