window.onload = function () { editor.setOpt({ emotionLocalization:false }); emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://www.njzpsb.com/blog/zb_users/emotion/"; emotion.tabNum++; emotion.SmilmgName["tab0"]=['png',19]; emotion.imageFolders["tab0"]='default/'; emotion.imageCss["tab0"]='default'; emotion.imageCssOffset["tab0"]=35; emotion.SmileyInfor["tab0"]=['yell%2Epng','wink%2Epng','waii%2Epng','unhappy%2Epng','tongue%2Epng','surprised%2Epng','smile%2Epng','slim%2Epng','roll%2Epng','red%2Epng','neutral%2Epng','mad%2Epng','happy%2Epng','grin%2Epng','fat%2Epng','evilgrin%2Epng','cry%2Epng','cool%2Epng','confuse%2Epng']; var tp=$G('tabHeads'),tc=$G('tabBodys'); var dtp=document.createElement("span"); dtp.innerHTML ="default"; tp.appendChild(dtp); tp.innerHTML = tp.innerHTML+" \n"; var dtc=document.createElement("div"); dtc.id='tab0'; tc.appendChild(dtc); emotion.tabNum++; emotion.SmilmgName["tab1"]=['gif',16]; emotion.imageFolders["tab1"]='face/'; emotion.imageCss["tab1"]='face'; emotion.imageCssOffset["tab1"]=35; emotion.SmileyInfor["tab1"]=['Smile%2Egif','Sleep%2Egif','Shame%2Egif','Sad%2Egif','Nothing%5Fto%5Fsay%2Egif','Music%2Egif','Misdoubt%2Egif','Love%2Egif','Grimace%2Egif','Faint%2Egif','Effort%2Egif','Cry%2Egif','Cool%2Egif','Angry%2Egif','After%5Fboom%2Egif','Adore%2Egif']; var tp=$G('tabHeads'),tc=$G('tabBodys'); var dtp=document.createElement("span"); dtp.innerHTML ="face"; tp.appendChild(dtp); tp.innerHTML = tp.innerHTML+" \n"; var dtc=document.createElement("div"); dtc.id='tab1'; tc.appendChild(dtc); emotion.SmileyBox = createTabList( emotion.tabNum ); emotion.tabExist = createArr( emotion.tabNum ); initImgName(); initEvtHandler( "tabHeads" ); }; function initImgName() { for ( var pro in emotion.SmilmgName ) { var tempName = emotion.SmilmgName[pro], tempBox = emotion.SmileyBox[pro], tempStr=emotion.SmileyInfor[pro]; if ( tempBox.length ) return; for ( var i = 0; i < tempName[1]; i++ ) { tempBox.push( tempStr[i]); } } } function initEvtHandler( conId ) { var tabHeads = $G( conId ); for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) { var tabObj = tabHeads.childNodes[i]; if ( tabObj.nodeType == 1 ) { domUtils.on( tabObj, "click", (function ( index ) { return function () { switchTab( index ); }; })( j ) ); j++; } } switchTab( 0 ); $G( "tabIconReview" ).style.display = 'none'; } function InsertSmiley( url, evt ) { var obj = { src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url }; obj.data_ue_src = obj.src; editor.execCommand( 'insertimage', obj ); if ( !evt.ctrlKey ) { dialog.popup.hide(); } } function switchTab( index ) { autoHeight( index ); if ( emotion.tabExist[index] == 0 ) { emotion.tabExist[index] = 1; createTab( 'tab' + index ); } //获取呈现元素句柄数组 var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ), tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ), i = 0, L = tabHeads.length; //隐藏所有呈现元素 for ( ; i < L; i++ ) { tabHeads[i].className = ""; tabBodys[i].style.display = "none"; } //显示对应呈现元素 tabHeads[index].className = "focus"; tabBodys[index].style.display = "block"; } function autoHeight( index ) { var iframe = dialog.getDom( "iframe" ), parent = iframe.parentNode.parentNode; } function createTab( tabName ) { var faceVersion = "?v=1.1", //版本号 tab = $G( tabName ), //获取将要生成的Div句柄 imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径 positionLine = 11 / 2, //中间数 iWidth = iHeight = 35, //图片长宽 iColWidth = 3, //表格剩余空间的显示比例 tableCss = emotion.imageCss[tabName], cssOffset = emotion.imageCssOffset[tabName], textHTML = ['
' );
textHTML.push( '' );
textHTML.push( ' | ' ); } textHTML.push( ' | ' ); } textHTML.push( '