1 |
- window.onload=function(){editor.setOpt({emotionLocalization:false});emotion.SmileyPath=editor.options.emotionLocalization===true?"images/":"//imgbaidu.b0.upaiyun.com/hi/";emotion.SmileyBox=createTabList(emotion.tabNum);emotion.tabExist=createArr(emotion.tabNum);initImgName();initEvtHandler("tabHeads")};function initImgName(){for(var d in emotion.SmilmgName){var c=emotion.SmilmgName[d],e=emotion.SmileyBox[d],a="";if(e.length){return}for(var b=1;b<=c[1];b++){a=c[0];if(b<10){a=a+"0"}a=a+b+".gif";e.push(a)}}}function initEvtHandler(e){var c=$G(e);for(var d=0,b=0;d<c.childNodes.length;d++){var a=c.childNodes[d];if(a.nodeType==1){domUtils.on(a,"click",(function(f){return function(){switchTab(f)}})(b));b++}}switchTab(0);$G("tabIconReview").style.display="none"}function InsertSmiley(b,a){var c={src:editor.options.emotionLocalization?editor.options.UEDITOR_HOME_URL+"dialogs/emotion/"+b:b};c._src=c.src;editor.execCommand("insertimage",c);if(!a.ctrlKey){dialog.popup.hide()}}function switchTab(d){autoHeight(d);if(emotion.tabExist[d]==0){emotion.tabExist[d]=1;createTab("tab"+d)}var c=$G("tabHeads").getElementsByTagName("span"),b=$G("tabBodys").getElementsByTagName("div"),e=0,a=c.length;for(;e<a;e++){c[e].className="";b[e].style.display="none"}c[d].className="focus";b[d].style.display="block"}function autoHeight(a){var c=dialog.getDom("iframe"),b=c.parentNode.parentNode;switch(a){case 0:c.style.height="380px";b.style.height="392px";break;case 1:c.style.height="220px";b.style.height="232px";break;case 2:c.style.height="260px";b.style.height="272px";break;case 3:c.style.height="300px";b.style.height="312px";break;case 4:c.style.height="140px";b.style.height="152px";break;case 5:c.style.height="260px";b.style.height="272px";break;case 6:c.style.height="230px";b.style.height="242px";break;default:}}function createTab(a){var f="?v=1.1",d=$G(a),l=emotion.SmileyPath+emotion.imageFolders[a],k=11/2,r=iHeight=35,t=3,b=emotion.imageCss[a],h=emotion.imageCssOffset[a],m=['<table class="smileytable">'],q=0,c=emotion.SmileyBox[a].length,n=11,s,o,v,e,g,u;for(;q<c;){m.push("<tr>");for(var p=0;p<n;p++,q++){s=emotion.SmileyBox[a][q];if(s){o=l+s+f;v=l+s;e=p<k?0:1;g=h*q*(-1)-1;u=emotion.SmileyInfor[a][q];m.push('<td class="'+b+'" border="1" width="'+t+'%" style="border-collapse:collapse;" align="center" bgcolor="transparent" onclick="InsertSmiley(\''+v.replace(/'/g,"\\'")+"',event)\" onmouseover=\"over(this,'"+o+"','"+e+'\')" onmouseout="out(this)">');m.push("<span>");m.push('<img style="background-position:left '+g+'px;" title="'+u+'" src="'+emotion.SmileyPath+(editor.options.emotionLocalization?'0.gif" width="':'default/0.gif" width="')+r+'" height="'+iHeight+'"></img>');m.push("</span>")}else{m.push('<td width="'+t+'%" bgcolor="#FFFFFF">')}m.push("</td>")}m.push("</tr>")}m.push("</table>");m=m.join("");d.innerHTML=m}function over(c,b,a){c.style.backgroundColor="#ACCD3C";$G("faceReview").style.backgroundImage="url("+b+")";if(a==1){$G("tabIconReview").className="show"}$G("tabIconReview").style.display="block"}function out(b){b.style.backgroundColor="transparent";var a=$G("tabIconReview");a.className="";a.style.display="none"}function createTabList(c){var b={};for(var a=0;a<c;a++){b["tab"+a]=[]}return b}function createArr(c){var a=[];for(var b=0;b<c;b++){a[b]=0}return a};
|