| //用于生成会话页面的布局,目前有四种布局 |
| //2012-2-29知识库匹配功能 |
| //2012-5-19排队改C服务器 |
| //2012-6-14修正无顶部标签时,因没生成标签UI而导致的排队留言转不过去的bug |
| //2012-8-20将机器人功能分离出来 |
| //2012-11-18加手机版支持 |
| //2013-4-7修正迷你会话时,在非firefox下无法发送消息的问题 |
| //2013-4-9修正在ie8下,迷你会话窗口上面有一大片空白的问题 |
| if(typeof(pagetype)=="undefined") |
| pagetype = ""; |
| |
| var chatwordsIframeHTML = '<iframe id="chatwordsFrames" name="chatwordsFrames" frameborder="0" hspace="0" height="100%" width="100%" marginwidth="0" marginheight="0" ></iframe>'; |
| //var chatwordsIframeHTML = '<div id="chatwordsFrames" style="width:100%;height:100%;overflow-x:hidden;overflow-y:scroll"></div>';// 用DIV的问题在于在firefox下,层的高度会撑开 |
| var infocardIframeHTML = '<iframe id=cardframe name=cardframe allowtransparency=true border=0 cellpadding=0 cellspacing=0 width=100% height=100% marginwidth=0 marginheight=0 frameborder=0 scrolling=no ></iframe>'; |
| var _logoImgUrl = ""; |
| |
| if(is_defined_logo == 1) |
| _logoImgUrl = logo_img; |
| else |
| { |
| if(typeof(logoLink) != "undefined" && logoLink != "") |
| _logoImgUrl = logoLink; |
| else if(typeof(chat_logo) != "undefined" && chat_logo != "") |
| _logoImgUrl = chat_logo; |
| else |
| _logoImgUrl = imgPath+'common/logo.png'; |
| } |
| var topLogoHTML = '<div class=talkframe_top_left><img src='+_logoImgUrl+' /></div><div class=talkframe_top_right '+(logo_area_style==1?'style="display:none"':'')+'><span id=ChatTips></span></div>'; |
| var topMenuHTML = []; |
| if( (style==4 || style==5) && is_top_menu==1 && (action == "chat" || action == "acd" || action == "leavemsg")) |
| { |
| var chatClass = 'talkframe_top_right_menu_li_active'; |
| var leavemsgClass = 'talkframe_top_right_menu_li_normal'; |
| if(action == "leavemsg") |
| { |
| chatClass = 'talkframe_top_right_menu_li_normal'; |
| leavemsgClass = 'talkframe_top_right_menu_li_active'; |
| } |
| topMenuHTML.push('<div id="talkframe_top_right_menu" class="talkframe_top_right_menu" >'); |
| topMenuHTML.push('<li class="'+chatClass+'" id=top_menu_chat onclick="WebIM.switchTag(this,\'chat\')" style="cursor:pointer" onmouseover="WebIM.mouseOverLi(this)" onmouseout="WebIM.mouseOutLi(this)">在线交谈</li>'); |
| |
| var dispStr = ''; |
| if(typeof(iscallback) == "undefined" || iscallback == 0) |
| dispStr = 'display:none;'; |
| topMenuHTML.push('<li class="talkframe_top_right_menu_li_normal" id=top_menu_call onclick="WebIM.switchTag(this,\'call\')" style="'+dispStr+'cursor:pointer" onmouseover="WebIM.mouseOverLi(this)" onmouseout="WebIM.mouseOutLi(this)">免费电话</li>'); |
| |
| topMenuHTML.push('<li class="'+leavemsgClass+'" id=top_menu_message onclick="WebIM.switchTag(this,\'message\')" style="cursor:pointer" onmouseover="WebIM.mouseOverLi(this)" onmouseout="WebIM.mouseOutLi(this)">在线留言</li>'); |
| |
| dispStr = ''; |
| if(typeof(is_robot) == "undefined" || is_robot == 0) |
| dispStr = 'display:none;'; |
| topMenuHTML.push('<li class="talkframe_top_right_menu_li_normal" id=top_menu_robot onclick="WebIM.switchTag(this,\'robot\')" style="'+dispStr+'cursor:pointer" onmouseover="WebIM.mouseOverLi(this)" onmouseout="WebIM.mouseOutLi(this)">自助答疑</li>'); |
| |
| topMenuHTML.push('</div>'); |
| } |
| else { |
| topMenuHTML.push('<div style="display:none;" id="talkframe_top_right_menu" class="talkframe_top_right_menu" ><li id="top_menu_chat"></li><li id="top_menu_call"></li><li id="top_menu_robot"><li id="top_menu_message"></li></div>'); |
| } |
| //会话页面与留言页面仅下面的变量值不同 |
| var chatBoxHTML = []; |
| chatBoxHTML.push('<tr>'); |
| chatBoxHTML.push('<td id="chatwordsTd" style="padding:0px 5px; " class="talkfarme_content">'); |
| chatBoxHTML.push(chatwordsIframeHTML); |
| chatBoxHTML.push('</td>'); |
| chatBoxHTML.push('</tr>'); |
| |
| //2012-2-19加知识库 |
| |
| chatBoxHTML.push('<tr id="knowledgeTipTR" style="display:none">'); |
| chatBoxHTML.push('<td style="padding:0px;">'); |
| chatBoxHTML.push('<div id="knowledgeTipDIV" style="padding-left:5px;padding-right:5px;background: none repeat scroll 0 0 #ffffff;visible;height:100px;border-top:1px solid #A5BBFD;"></div>'); |
| chatBoxHTML.push('</td>'); |
| chatBoxHTML.push('</tr>'); |
| |
| |
| chatBoxHTML.push('<tr class=tool_bar_tr>'); |
| chatBoxHTML.push('<td height=20>'); |
| chatBoxHTML.push('<div class="iconBg talktools_style" id=tools_bar_div>toolsbar</div>'); |
| chatBoxHTML.push('</td>'); |
| chatBoxHTML.push('</tr>'); |
| chatBoxHTML.push('<tr>'); |
| chatBoxHTML.push('<td class="message_input" id=message_input_td></td>'); |
| chatBoxHTML.push('</tr>'); |
| chatBoxHTML = chatBoxHTML.join(''); |
| |
| |
| if(action == "leavemsg" || action == "leavemsg_simple") |
| { |
| chatBoxHTML = document.getElementById("messageHTML").innerHTML;; |
| } |
| |
| var tagContentHTML = '';//点标签留言或呼叫时,要显示的隐藏内容 |
| if(style == 4 || style == 5) |
| { |
| tagContentHTML = []; |
| tagContentHTML.push('<table style="display:none" id=top_menu_message_table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| tagContentHTML.push('<tr>'); |
| tagContentHTML.push('<td style="background:#ffffff"><iframe src="about:blank" id="top_menu_message_frame" name="leavemsgFrame" frameborder="0" hspace="0" height="100%" width="100%" marginwidth="0" marginheight="0" scrolling=no></iframe></td>'); |
| tagContentHTML.push('</tr>'); |
| tagContentHTML.push('</table>'); |
| //if(iscallback == 1) |
| //{ |
| tagContentHTML.push('<table style="display:none" id=top_menu_call_table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| tagContentHTML.push('<tr><td style=" height:1px;"></td></tr>'); |
| tagContentHTML.push('<tr>'); |
| tagContentHTML.push('<td><iframe src="about:blank" id="top_menu_call_frame" name="callFrame" frameborder="0" hspace="0" height="100%" width="100%" marginwidth="0" marginheight="0" scrolling=no ></iframe></td>'); |
| tagContentHTML.push('</tr>'); |
| tagContentHTML.push('</table>'); |
| //} |
| |
| tagContentHTML.push('<table style="display:none" id=top_menu_robot_table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| tagContentHTML.push('<tr><td style=" height:1px;"></td></tr>'); |
| tagContentHTML.push('<tr>'); |
| tagContentHTML.push('<td><iframe src="about:blank" id="top_menu_robot_frame" name="robotFrame" frameborder="0" hspace="0" height="100%" width="100%" marginwidth="0" marginheight="0" scrolling=no ></iframe></td>'); |
| tagContentHTML.push('</tr>'); |
| tagContentHTML.push('</table>'); |
| |
| tagContentHTML = tagContentHTML.join(''); |
| } |
| |
| //var style = 5; |
| var html =[]; |
| if(style == 2) |
| { |
| html.push('<table id="webdialog" style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr>'); |
| html.push('<td valign="top" class="talkframe_box" >'); |
| html.push('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| html.push('<tr'+((pagetype=="mini")?' style="display:none"':'')+'>'); |
| html.push('<td class="talkframe_top talkframe_topbg_style">'); |
| html.push('<div id=top_left></div>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('<tr>'); |
| html.push('<td style=" height:1px;"></td>'); |
| html.push('</tr>'); |
| html.push(chatBoxHTML); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('<td valign="top" class="card_bg_trans_style" >'); |
| html.push(infocardIframeHTML); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| } |
| else if(style == 3) |
| { |
| html.push('<table id="webdialog" style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr>'); |
| html.push('<td valign="top" class="card_bg_trans_style" >'); |
| html.push(infocardIframeHTML); |
| html.push('</td>'); |
| html.push('<td valign="top" class="talkframe_box" >'); |
| html.push('<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| html.push('<tr'+((pagetype=="mini")?' style="display:none"':'')+'>'); |
| html.push('<td class="talkframe_top talkframe_topbg_style">'); |
| html.push('<div id=top_left></div>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('<tr>'); |
| html.push('<td style=" height:1px;"></td>'); |
| html.push('</tr>'); |
| html.push(chatBoxHTML); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| } |
| else if(style == 4) |
| { |
| html.push('<table id="webdialog" style="'+((action == "leavemsg_simple")?'border-left:0px;':'')+'width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr'+((action == "leavemsg_simple" || pagetype=="mini")?' style="display:none"':'')+'>'); |
| html.push('<td class="talkframe_top talkframe_topbg_style">'); |
| html.push('<div id=top_left></div>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('<tr>'); |
| html.push('<td>'); |
| html.push('<table style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr>'); |
| html.push('<td valign="top" class="talkframe_box" '+((action == "leavemsg_simple")?' style="padding-right:0px"':'')+'>'); |
| html.push(tagContentHTML); |
| html.push('<table id=chatTag border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| html.push('<tr>'); |
| html.push('<td style=" height:1px;"></td>'); |
| html.push('</tr>'); |
| html.push(chatBoxHTML); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('<td '+((action == "leavemsg_simple")?' style="display:none"':'')+' valign="top" class="card_bg_trans_style" >'); |
| if(action != "leavemsg_simple") |
| html.push(infocardIframeHTML); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| } |
| else if(style == 5) |
| { |
| html.push('<table id="webdialog" style="'+((action == "leavemsg_simple")?'border-right:0px;':'')+'width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr'+((action == "leavemsg_simple" || pagetype=="mini")?' style="display:none"':'')+'>'); |
| html.push('<td class="talkframe_top talkframe_topbg_style">'); |
| html.push('<div id=top_left></div>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('<tr>'); |
| html.push('<td>'); |
| html.push('<table style="width: 100%; height: 100%;" border="0" cellpadding="0" cellspacing="0">'); |
| html.push('<tr>'); |
| html.push('<td '+((action == "leavemsg_simple")?' style="display:none"':'')+' valign="top" class="card_bg_trans_style" >'); |
| if(action != "leavemsg_simple") |
| html.push(infocardIframeHTML); |
| html.push('</td>'); |
| html.push('<td valign="top" class="talkframe_box" '+((action == "leavemsg_simple")?' style="padding-left:0px"':'')+'>'); |
| html.push(tagContentHTML); |
| html.push('<table id=chatTag border="0" width="100%" height="100%" cellspacing="0" cellpadding="0" class="talkframe_all">'); |
| html.push('<tr>'); |
| html.push('<td style=" height:1px;"></td>'); |
| html.push('</tr>'); |
| html.push(chatBoxHTML); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| html.push('</td>'); |
| html.push('</tr>'); |
| html.push('</table>'); |
| } |
| |
| document.write(html.join('')); |
| |
| |
| function FillHTML() |
| { |
| document.getElementById("top_left").innerHTML = topLogoHTML + topMenuHTML.join(''); |
| if((action == "chat" || action == "acd")) |
| { |
| document.getElementById("tools_bar_div").innerHTML = document.getElementById("tools_bar_div_html").innerHTML; |
| if(isMobile == 1) |
| { |
| if(pagetype!="mini") |
| { |
| document.getElementById("message_input_td").innerHTML = |
| '<table border="0" cellpadding="0" cellspacing="0" class=inputarea_table>'+ |
| '<tr>'+ |
| '<td valign="top" id="input_td"><textarea id=FreeTextBox1_editor class=inputarea></textarea></td>'+ |
| '<td width=80><a class="button_1 green" href="javascript:void(0)" onclick="WebIM.FTB_Send();">发 送</a></td>'+ |
| '</tr>'+ |
| '<tr style="display:none"><td colspan=2 style="padding-bottom:2px;" id="sendImg_td"></td></tr>'+ |
| '</table>'; |
| document.getElementById("message_input_td").className="message_input_td"; |
| } |
| else |
| { |
| document.getElementById("message_input_td").innerHTML = |
| '<table border="0" cellpadding="0" cellspacing="0" class=inputarea_table>'+ |
| '<tr>'+ |
| '<td valign="top" id="input_td"><textarea id=FreeTextBox1_editor class=inputarea></textarea></td>'+ |
| '<td width=50><div class="send_mini send_zh_mini" onMouseOut="this.className=\'send_mini send_zh_mini\'" onMouseOver="this.className=\'send_mini send_zh2_mini\'" onClick="WebIM.FTB_Send();"></div>'+ |
| '<div id=shortcutsTipDIV class="send_tips" style="display:none"></div></td>'+ |
| '</tr>'+ |
| '<tr style="display:none"><td colspan=2 style="padding-bottom:2px;" id="sendImg_td"></td></tr>'+ |
| '</table>'; |
| document.getElementById("message_input_td").className="message_input_td"; |
| |
| } |
| } |
| else |
| { |
| document.getElementById("message_input_td").innerHTML = document.getElementById("message_input_td_html").innerHTML; |
| } |
| document.body.removeChild(document.getElementById("tools_bar_div_html")); |
| document.body.removeChild(document.getElementById("message_input_td_html")); |
| } |
| else |
| { |
| document.body.removeChild(document.getElementById("message_table_html")); |
| } |
| } |
| FillHTML();COPY |