/** Obtain news content components of the vote */ var _newscontent_errcode = ""; var _newscontent_errorcode = ""; var _newscontent_votebgcolor = ""; var _newscontent_votetitlestyle = ""; var _newscontent_votefgcolor = ""; var _newscontent_qdimg = ""; var _newscontent_votestyle = ""; var _newscontent_Welcomevote = ""; var _newscontent_padding = ""; var _newscontent_toupiao = ""; var _newscontent_chakan = ""; var _newscontent_myform = ""; var _newscontent_writevote = ""; var _newscontent_owner = ""; var _newscontent_ip = ""; var _newscontent_newsid = ""; var _newscontent_againvote = ""; var _newscontent_errvote = ""; var _newscontent_thinksvote = ""; var _newscontent_voteresult = ""; function showVote(pnewsid,powner,pvotebgcolor,pvotetitlestyle,pvotefgcolor,pqdimg,pvotestyle,pWelcomevote,ppadding,ptoupiao,pchakan,pformname,pwritevote,pip,pagainvote,perrvote,pthinksvote,pvoteresult) { _newscontent_votebgcolor = pvotebgcolor; _newscontent_votetitlestyle = pvotetitlestyle; _newscontent_votefgcolor = pvotefgcolor; _newscontent_qdimg = pqdimg; _newscontent_votestyle = pvotestyle; _newscontent_Welcomevote = pWelcomevote; _newscontent_padding = ppadding; _newscontent_toupiao = ptoupiao; _newscontent_chakan = pchakan; _newscontent_myform = pformname; _newscontent_writevote = pwritevote; _newscontent_owner = powner; _newscontent_ip = pip; _newscontent_newsid = pnewsid; _newscontent_againvote = pagainvote; _newscontent_errvote = perrvote; _newscontent_thinksvote = pthinksvote; _newscontent_voteresult = pvoteresult; NewsvoteDWR.getVoteTitle(pnewsid,powner,_newscontent_puttitle); } function _newscontent_puttitle(title) { if(title.result == "true") { var vote = "
" vote += "
"; vote += "
" + _newscontent_qdimg + "  " + _newscontent_Welcomevote + "
" for(i=0; i"; vote += title.titlelist[i]; vote += "
"; vote += "
"; for(j = 0;j< title.option[i].optitlelist.length;j++) { if(j != 0) checked = ""; vote += "
"; vote += "
"; vote += " " vote += title.option[i].optitlelist[j]; vote += "
"; vote += "
"; } } vote += "
" vote += "
" vote += _newscontent_toupiao; vote += " "+_newscontent_chakan; vote += "
" vote += "
" vote += ""; vote += "" document.getElementById("div_vote_id").innerHTML = vote; } else { } } function _newscontent_getresult(_newscontent_newsid,_newscontent_owner) { var hascheck =false; var ischeck = false; for(var i = 0; i < _newscontent_myform.elements.length; i++) { var item = _newscontent_myform.elements[i]; if(item.tagName == "INPUT" ) { if(item.type.toLowerCase()=="checkbox") { hascheck = true; var checkboxvalues = document.getElementsByName(item.name); for(var j=0;j"; vote += "
" + _newscontent_qdimg + "  " + _newscontent_voteresult + "
" for(i=0; i"; vote += title.titlelist[i]; vote += ""; vote += ""; for(j = 0;j< title.option[i].optitlelist.length;j++) { vote += "
"; vote += "
"; vote += title.option[i].optitlelist[j]; vote += "
"; vote += "
"; vote += "
" vote += "
" vote += "
" vote += "
" vote += title.option[i].opchecklist[j]+"("+ title.option[i].opnumlist[j] +")"; vote += "
" vote += "
"; } } vote += ""; vote += "" document.getElementById("div_vote_id").innerHTML = vote; } else { alert(_newscontent_errvote); } } function _newscontnent_checkRadioValue(keystr) { var keyname = keystr; var obj = document.getElementsByName(keyname); var flag = false; var i = 0; if(obj == null) { return ""; } if(obj.length == null) { if(obj.checked) { return obj.value; } } for(i = 0; i < obj.length; i++) { if(obj[i].checked) { return obj[i].value; break; } } return ""; } function shareto(a,U,T,S,key) { var ec = encodeURIComponent, A = '/system/resource/news/weiboshare.htm'; var C = '?type=' + a + '&url=' + ec(U || document.location) + '&title=' + ec(T) + (S ? '&summary=' + S : '')+(key ? '&appkey=' + key : ''); if(a=='tsohu') C = '?type=' + a + '&url=' + ec(U || document.location) + '&title=' + T + (S ? '&summary=' + S : '')+(key ? '&appkey=' + key : ''); try { window.open(A + C, ''); } catch (e) { } return false; } function download_news(contentid,treeid,owner,newsid) { if(checkobj_content(contentid)) { if(confirm('文章含有word中无法显示内容,下载后可能无法正常显示。是否继续下载?')) { location.href="/tztufn/sftpvsdf/ofxt/ofxtupxpse.ktq?usffje="+treeid+'&owner='+owner+'&wbnewsid='+newsid; } }else{ location.href="/tztufn/sftpvsdf/ofxt/ofxtupxpse.ktq?usffje="+treeid+'&owner='+owner+'&wbnewsid='+newsid; } } function checkobj_content(contentid) { if(getContentTags(contentid)) { return true; } return false; } function getContentTags(contentid) { var current; var contentNode = document.getElementById(contentid).innerHTML; var regex = //]*>(.*?)<\/object|OBJECT|iframe|IFRAME|embed|EMBED>/i; var groups = regex.exec(contentNode); if(groups){ return true; } return false; } function show_vsb_content_tips(buttonObj,conentid) { buttonObj.style.display="none"; var o=document.getElementById(conentid); o.style.display=""; } //正文中输出mp3播放代码 function showVsbAudio(aurl,vheight,vwidth,align,styles,vautoplay) { if(aurl=="") { return; } var playersrc = "/system/resource/images/ueditor/musicFlash/player_mp3_maxi.swf"; var flashvars = "mp3="+aurl+"&showstop=1&showvolume=1&bgcolor1=eeeeee&bgcolor2=a0a0a0"; var autoplayStr = ""; if(vautoplay=="true") { autoplayStr = "autoplay = 'true'"; flashvars +="&autoplay=1"; } var outputHTML=""; outputHTML +=''; document.write(outputHTML); } /** * 正文中显示PDF * @param path * @param width * @param heigth * @param imagenum * @param style * @param imagedata */ function showVsbpdfIframe(path,width,heigth,imagenum,style,imagedata){ if(path=="") { return; } var outputHTML=""; //判断浏览器版本 if(isSupportPddfjs()){ //pdfjs outputHTML = ""; }else{ //图片 if(imagedata && imagedata.length >0){ var imageStr = ""; imageStr = "
"; for(var i=0;i"; imageStr += "
第 "+(i+1)+" 页
"; } imageStr += "
"; outputHTML = imageStr; }else{ outputHTML = ""; } } document.write(outputHTML); } /** * 判断浏览器是否支持pdf.js * @returns {boolean} */ function isSupportPddfjs(){ var agent = navigator.userAgent.toLowerCase(); var isIe = /(msie\s|trident.*rv:)([\w.]+)/.test(agent); if(isIe){ return false; } var safari; if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && !/chrome/i.test(agent)){ safari = + (RegExp['\x241'] || RegExp['\x242']); } if(safari && safari < 11){ return false; } var mobile = agent.match(/applewebkit.*mobile.*/); if(mobile){ return false; } return true; } function content_frame_load(contentid,doc,iframe){ var iframeHeight = doc.documentElement.scrollHeight; iframe.style.height = iframeHeight + 'px'; var divElement = document.getElementById(contentid); if(divElement.remove){ divElement.remove(); }else{ divElement.parentNode.removeChild(divElement); } } /** * 加载正文内容到iframe * @param contentid 内容部分容器id * @param csslink 一键排版样式css * @param customstyle 自定义样式 */ function loadContent2Frame(contentid,csslink,customstyle){ try{ var contentdiv = document.getElementById(contentid); if(!contentdiv){ return; } var myFrame = document.createElement('iframe'); myFrame.style.width="100%"; myFrame.style.height="0px"; myFrame.style.border = "none"; //对象插入 contentdiv.parentNode.insertBefore(myFrame,contentdiv) var doc = myFrame.contentWindow.document||myFrame.document||myFrame.contentDocument; if(myFrame.attachEvent){ myFrame.attachEvent("onload", function(){ content_frame_load(contentid,doc,myFrame); }); }else{ myFrame.addEventListener("load",function(){ content_frame_load(contentid,doc,myFrame); },false); } doc.open(); //加载一键排版样式 doc.write(""); if(customstyle.length > 0){ //加载自定义样式 doc.write(""); } //写入内容 doc.write(contentdiv.outerHTML); doc.close(); }catch (e){ console.log(e) } } function ContentBase64() { // private property var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; // public method for decoding this.decode = function (input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); while (i < input.length) { enc1 = _keyStr.indexOf(input.charAt(i++)); enc2 = _keyStr.indexOf(input.charAt(i++)); enc3 = _keyStr.indexOf(input.charAt(i++)); enc4 = _keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } output = _utf8_decode(output); return output; } // private method for UTF-8 decoding _utf8_decode = function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } }