function Map(){ this.container = new Object(); } Map.prototype.put = function(key, value){ this.container[key] = value; } Map.prototype.get = function(key){ return this.container[key]; } String.prototype.substring2 = function(length){ var s = this; var isHtml = false; var isCode = false; var news = ""; var char_num = 0; for(var i=0; i' && isHtml){ isHtml = false; char_num--; } else if (s.charAt(i) && isCode){ isCode = false; } if(!isHtml && !isCode){ char_num++; } news += s.charAt(i); if(char_num >= length){ news += "..."; break; } } var temp_result = news.toString().replace(/(>)[^<>]*(]*\/?>/g, ""); //去掉成对的HTML标记 temp_result=temp_result.replace(/<([a-zA-Z]+)[^<>]*>(.*?)<\/\1>/g,"$2"); //用正则表达式取出标记 var preventcount = 0; while(temp_result.match(/<([a-zA-Z]+)[^<>]*>(.*?)<\/\1>/g) && preventcount<1000){ temp_result=temp_result.replace(/<([a-zA-Z]+)[^<>]*>(.*?)<\/\1>/g,"$2"); preventcount++; } var re = /<([a-zA-Z]+)[^<>]*>/g; var endtags = []; var sub = ""; var i = 0; while(sub = re.exec(temp_result)){ endtags[i++] = sub[1]; } for(var j=endtags.length-1; j>=0; j--){ news += ""; } return news; } var map = new Map(); map.put("11","tuShuId"); map.put("1","qiKanId"); map.put("13","baoZhiId"); map.put("websearch","tushuzhangjieId"); map.put("zhidao","zhidaoId"); map.put("29","newsId"); map.put("docs","wendangId"); map.put("rw","renwuId"); map.put("17","citiaoId"); map.put("olds","oldsId"); map.put("author","authorId"); map.put("8","shiPinId"); map.put("10","zhuanLiId"); map.put("15","biaoZhunId"); map.put("74","74Id"); map.put("75","75Id"); map.put("2","waiWenQiKanId"); map.put("5","5Id"); map.put("6","biaoZhunId"); map.put("4","4Id"); map.put("pic","picId"); map.put("7","7Id"); map.put("19","19Id"); map.put("15","15Id"); map.put("3","3Id"); map.put("68","shuoShiId"); map.put("69","boShiId"); map.put("70","wshuoShiId"); map.put("71","wboShiId"); map.put("xueshu","qsId"); map.put("daohang","daohangId"); map.put("yixue","yixueId"); map.put("80","80Id"); map.put("81","81Id"); map.put("weblog","weblogId"); map.put("kj","kjId"); map.put("stk","stkId"); map.put("enterprise","enterpriseId"); map.put("shici","shiciId"); map.put("website","websiteId"); map.put("npguide","npguideId"); map.put("78","78Id"); map.put("72","72Id"); map.put("73","73Id"); map.put("76","76Id"); map.put("77","77Id"); map.put("ir","irId"); map.put("zhaopin","zhaopinId"); map.put("wenshi","wenshiId"); map.put("guancang","guancangId"); map.put("faxian","faxianId"); map.put("mooccourse","mooccourseId"); map.put("bookfulltext","bookfulltextId"); map.put("bookimage","bookimageId"); map.put("mooccourses","mooccoursesId"); String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.len = function() { return this.replace(/[^\x00-\xff]/g, 'xx').length; //js验证字节数 }; function replaceParamVal(url,paramName,replaceWith) {//替换url的置顶参数 var oUrl = this.location.href.toString(); var re=eval('/('+ paramName+'=)([^&]*)/gi'); var nUrl = oUrl.replace(re,paramName+'='+replaceWith); return nUrl; } function subString(str, len, hasDot){ var newLength = 0; var newStr = ""; var chineseRegex = /[^\x00-\xff]/g; var singleChar = ""; var strLength = str.replace(chineseRegex,"**").length; for(var i = 0;i < strLength;i++){ singleChar = str.charAt(i).toString(); if(singleChar.match(chineseRegex) != null){ newLength += 2; } else{ newLength++; } if(newLength > len){ break; } newStr += singleChar; } if(hasDot && strLength > len){ newStr += "..."; } return newStr; } function submitbottomformfirst(){ $("#bottomform").find("input").not("#size1").not("#sw1").not("#newstrchannel1").not("#strindustry").val(""); submitbottomform(); } function ztskip(){ if(!checkLogin()){ loginMethed(true); }else{ window.open("http://i.mooc.chaoxing.com/space/index.shtml?ename=zne_zt_icon&burl=http://yunpan.chaoxing.com/special_user_list_new/1"); } } function loginMethed(){ var urldomain = window.location.host; var backurl = "http://" + urldomain + "/channelcookie?time="+new Date().getTime(); var url = "http://fxlogin.chaoxing.com/findlogin.jsp?backurl="+encodeURIComponent(backurl); var loginurl = "http://passport2.chaoxing.com/wlogin?refer=" + encodeURIComponent(url); if(arguments.length > 0){ //新窗口 window.open(loginurl); }else{ window.location.href = loginurl; } } function logoutMethod(){ var urldomain = window.location.host; if(urldomain.indexOf(".chaoxing.com") == -1){ urldomain = "ss.chaoxing.com"; } var url = window.location.href; $.getJSON("http://read.nongyekx.cn/pages/proxy/logout.jsp?jsonp=?", function(data){ $.getJSON("http://"+urldomain+"/pages/proxy/logout.jsp?jsonp=?", function(data){ window.location.href = "http://passport2.chaoxing.com/logout.html?refer=" + encodeURIComponent(url); }); }); } function ncgetCookie(objName){ var arrStr = document.cookie.split("; "); for(var i = 0;i < arrStr.length;i ++){ var temp = arrStr[i].split("="); if(temp[0] == objName) return unescape(temp[1]); } } function doCheckLogin(){ var url = "/passport2islogin?callback=?"; $.ajax({ cache: false, dataType: 'jsonp', type: 'post', url: url, success: function (data){ if(data && data.login == true){ $("#userNameId").html(data.nickname); $("#imgid").attr("src","http://photo.chaoxing.com/p/"+data.uid+"_80"); $("#logindivId").hide(); $("#statusid").show(); $("#searchinputId").show(); }else{ $("#statusid").hide(); $("#emaildivId").hide(); $("#logindivId").show(); $("#searchinputId").hide(); return; } }, error: function () { $("#statusid").hide(); $("#emaildivId").hide(); $("#logindivId").show(); $("#searchinputId").hide(); } }); } function imgnofind(event, datatype, e){ var evt = event ? event : (window.event ? window.event : null); var img=evt.srcElement; if(img == null){ img = evt.target; } if(datatype == 54){ img.src="/images/find/defaultVimg.jpg"; $(e).attr("url","/images/find/defaultVimg.jpg"); }else{ img.src="/images/discover/cover.jpg"; $(e).attr("url","/images/discover/cover.jpg"); } img.onerror=null; } function picchannelimgnofind(event, datatype, e){ var evt = event ? event : (window.event ? window.event : null); var img=evt.srcElement; if(img == null){ img = evt.target; } if(datatype == 54){ img.src="/images/find/defaultVimg.jpg"; $(e).attr("url","/images/find/defaultVimg.jpg"); }else{ img.src="/images/discover/cover.jpg"; $(e).attr("url","/images/discover/cover.jpg"); } img.onerror=null; $(e).parent().removeAttr("href").removeAttr("target");; } function pages(p){ $("#pages").val(p); goSearch(); } function goSearchfirst(e){ if(($("#hssform").find("#sw").val()=='' && $("#strchannel").val() != "daohang" && $("#strchannel").val() != "npguide" && $("#aorp").val() != "a") || ($("#hssform").find("#sw").val()=='' && $("#aorp").val() == "a")){ CXStudyUtils.alert({title:'提示',content:'请输入检索词',key:'#sw'}); } else { var jsptag = $("#jsptag").val(); var special_channel = $("#hssform #specialchannel").val() || ""; $("#hssform :input").each(function(){ var tag_id = $(this).attr("id"); if(jsptag != "ncxFind.jsp" && special_channel != ""){//故纸堆类的,strchannel参数有的时候需要清空 if(e==null){ if(tag_id != "sw" && tag_id != "x"){ $(this).val(""); } } else if (tag_id != "sw" && tag_id != "x" && tag_id != "specialchannel" && tag_id != "isfulltext" && tag_id != "field") { $(this).val(""); } } else { if ((jsptag == "ncxFind.jsp" || e == null) && tag_id != "sw" && tag_id != "x") { $(this).val(""); } else if (e!=null && tag_id != "sw" && tag_id != "x" && tag_id != "strchannel" && tag_id != "isfulltext") { $(this).val(""); } } }); if(e==null){ $("#dosearch").attr("action", "/search"); } var isblank = false; goSearch(isblank); } } function changeChannel(e,istopchannel){ $("#strchannel").val(e); $("#hssform :input").each(function(){ var _this = $(this); var this_id = _this.attr("id"); if (this_id != "sw" && this_id != "strchannel" && this_id != "x") { _this.val(""); } }); var isblank = istopchannel ? false : true; goSearch(isblank); } function goSearch(isblank){ var specialchannel_val = document.getElementById("specialchannel").value; var strchannel_val = document.getElementById("strchannel").value; var _dosearch = $("#dosearch"); if(specialchannel_val == "stk" || specialchannel_val == "wendang"){ _dosearch.attr("action", "searchdoc"); } else if(specialchannel_val == "ksht"){ _dosearch.attr("action", "ncxreport"); } else if(specialchannel_val != "" || strchannel_val != ""){ _dosearch.attr("action", "ncs"); } else { _dosearch.attr("action", "search"); } if(($("#hssform").find("#sw").val())=='' && strchannel_val != "daohang" && strchannel_val != "npguide" && $("#aorp").val() != "a"){ CXStudyUtils.alert({title:'提示',content:'请输入检索词',key:'#sw'}); }else{ _dosearch.html(""); $("#hssform :input").each(function(){ if ($(this).val() != "") { $("").appendTo("#dosearch"); } }); if(isblank){ _dosearch.attr("target","_blank"); }else{ _dosearch.attr("target","_self"); loading(); } _dosearch.submit(); } } function htmlspecialchars(str) { str = str.replace(/&/g, '&'); str = str.replace(//g, '>'); str = str.replace(/"/g, '"'); str = str.replace(/'/g, '''); return str; } //头部或频道检索js function searchZhangJie(istopchannel){ $("#specialchannel").val("zhangjie"); $("#isfulltext").val("0"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages" && $(this).attr("id") != "isfulltext") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function searchFullText(istopchannel){ $("#specialchannel").val("zhangjie"); $("#isfulltext").val("1"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages" && $(this).attr("id") != "isfulltext") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function searchBaike(istopchannel){ $("#specialchannel").val("baike"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function searchZhidao(istopchannel){ $("#specialchannel").val("zhidao"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function searchNews(istopchannel){ $("#specialchannel").val("news"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function searchWendang(istopchannel){ $("#specialchannel").val("wendang"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } function daohangsearch(){ $("#specialchannel").val("daohang"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; goSearch(isblank); } //实用接口从后台加载数据的都可以使用这个 function searchSpecific(specific,istopchange){ $("#specialchannel").val(specific); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchange){ isblank = false; } if(specific = "daohang"){//期刊导航要加这个参数 $("#field").val("1"); } goSearch(isblank); } function searchRenwu(istopchange){ $("#specialchannel").val("renwu"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchange){ isblank = false; } goSearch(isblank); } function searchCitiao(istopchange){ $("#specialchannel").val("citiao"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchange){ isblank = false; } goSearch(isblank); } function changeGuanCang(e){ $("#strtype").val(e); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "pages" && $(this).attr("id") != "strtype") { $(this).val(""); } }); var isblank = true; goSearch(isblank); } function changeFaXian(Ele){ var hr = window.location.href; hr = replaceParamVal(hr,"strchannel",""); var hrArray = hr.split("?"); if(hr.indexOf("?") != -1){ $(Ele).attr("href","http://www.zhizhen.com/s?"+hrArray[1]); $(Ele).attr("target","_blank"); return true; }else{ return false; } /*$("#searchzhizhen").val('1'); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "pages" && $(this).attr("id") != "searchzhizhen") { $(this).val(""); } }); goSearch();*/ } function searchBlog(istopchannel){ $("#specialchannel").val("weblog"); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "specialchannel" && $(this).attr("id") != "pages") { $(this).val(""); } }); var isblank = true; if(istopchannel){ isblank = false; } goSearch(isblank); } // 全部页面js调用数据 function searchZhangJie1(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#zhangjieweburl").val(); $("#tushuzhangjieurl").val(url); var t = 1; $.getJSON(url,function(data){ try{ if(data.results.length > 0){ $.each(data.results,function(i,v){ var showtishi = false; var showcont = v['title'] + v['bookname'] + v['author'] + v['publishdate']; if(showcont.match(//gi) == null && v['content'].match(//gi) != null) showtishi = true; (t++ < 5) && $(".resultDiv02websearch ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title'].trim()+" "+""+(showtishi?"":"")+"" + v['author']+" 《" + v['bookname']+"》 " + v['publishdate'].split(".")[0]+" "+v['pageNum']+"页"+ "
  • "); }); $("#websearchcounts").text("("+data.hitcount+")"); } else { $(".resultDiv02websearch").remove(); rmleftF("websearch"); } }catch(e){ $(".resultDiv02websearch").remove(); rmleftF("websearch"); } }); } else { $(".resultDiv02websearch").remove(); rmleftF("websearch"); } } function searchMooccourses(){ //专题域 var url = $("#mooccoursesurl").val() || ""; if(url != ""){ $.getJSON(url,function(data){ try{ var list = data.list; if(data.count > 0 && list && list.length > 0){ for (var i = 0; i < list.length && i < 4; i++) { var bean = list[i]; var titleUrl = "https://mooc1.chaoxing.com/course/"+bean.infos['moocid']+".html"; var content = bean.infos['C303']; var title = ""+bean.infos['C301']+" "+""; var moocid = bean.infos['moocid']; var subscribectn = ""; $(".resultDiv02mooccourses ul").append("
  • "+title+"" + content + subscribectn + "
  • "); } getSubcribeCtns(); $("#mooccoursescounts").text("("+data.count+")"); } else { $(".resultDiv02mooccourses").remove(); rmleftF("mooccourses"); } } catch (e){ $(".resultDiv02mooccourses").remove(); rmleftF("mooccourses"); } }); } else { $(".resultDiv02mooccourses").remove(); rmleftF("mooccourses"); } } //获取专题域每条专题的订阅量 function getSubcribeCtns(){ var mooccourses = $(".resultDiv02mooccourses"); var ids = ""; var $input = $("input[name=moocid]", mooccourses); for(var i=0; i<$input.length; i++){ ids += (ids == "" ? "\"" : ",\"") + $input[i].value + "\""; } if($input.length > 0){ $.ajax({ url : "/mooc/subscribectns?ids="+encodeURIComponent(ids), dataType : "json", success : function(data){ var result = data.result; if(result == 1){ var msg = data.msg; for(var i=0; i 0){ $.each(data.results,function(i,v){ var showtishi = false; var showcont = v['title'] + v['bookname'] + v['author'] + v['publishdate']; if(showcont.match(//ig) ==null && v['content'].match(//ig) !=null) showtishi = true; (t++ < 5) && $(".resultDiv02bookfulltext ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title'].trim()+" "+""+(showtishi?"":"")+"" + v['author']+" 《" + v['bookname']+"》 " + v['publishdate'].split(".")[0]+" "+v['pageNum']+"页
  • "); }); $("#bookfulltextcounts").text("("+data.hitcount+")"); } else { $(".resultDiv02bookfulltext").remove(); rmleftF("bookfulltext"); } }catch(e){ $(".resultDiv02bookfulltext").remove(); rmleftF("bookfulltext"); } }); } else { $(".resultDiv02bookfulltext").remove(); rmleftF("bookfulltext"); } } function addBaikeTags(con) { var p_con = con.split("<<######>>"); var return_con = ""; for (var i in p_con) { var con_2 = p_con[i].split("<<###mutil###>>"); var re_2 = con_2.length == 2 ? con_2[1] : con_2[0]; re_2 = re_2.replace(/<<###para(?:m)?###>>/g, '

    ').replace(/\[[0-9\-]+\]<\/sup>/g, ""); return_con += "

    "+re_2+"

    "; } return return_con; } function searchBaike1(){ var url = $("#chaoxingbaikeurl").val() || ""; if(url != ""){ var urlall = url.replace("&size=20", "&size=10"); // +"&bh=1"; $.getJSON(urlall,function(data){ if(data.list && data.list.length > 0){ var t = 1; var ishowmorect = true; var sw = $("#sw").val(); var h =""; $.each(data.list,function(i,v){ var con = "

    "+ v.infos['M305'].replace(/\.{3}/g,"").replace(/\[\d+\]<\/sup>/g, "") +"

    " ; con += "

    "+ v.infos['C319'].replace(/\.{3}/g,"").replace(/\[\d+\]<\/sup>/g, "") +"

    " ; if(/.*[\u2E80-\u9FFF]+.*/.test(con)){ //\u4e00-\u9fa5 var title = v.infos['C301'].replace(/()|(<\/font>)/gi,""); if(sw == title || t == 1){ h = v.infos['url']; var add2end = ""; con = ""; $(".tt_ency_more").remove() $(".resultDivbaike").empty().append(con).parent().after(add2end); t++; if (sw == title){ return false; } } } }); if (t > 1){ $(".resultDivbaike .fl:eq(0),.tt_ency_more").show(); $("#ct_details").attr("href" ,h); } } }); } } function searchBookImage1(){ var url = $("#bookimageurl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ var urlall = url.replace("&size=20","&size=7")+ "&jsonp=?"; $.getJSON(urlall,function(data){ try{ if(data.result.length>0){ var t = 1; $.each(data.result,function(i,v){ (t++ < 8) && $(".resultDiv02bookimage ul").append("
  • " + "" + "" + "" + "

    " + "" + "

    " + "
  • "); }); $("#bookimagecounts").text("("+data.hitcount+")"); } else { $(".resultDiv02bookimage").remove(); rmleftF("bookimage"); } } catch(e){ $(".resultDiv02bookimage").remove(); rmleftF("bookimage"); } }); } else { $(".resultDiv02bookimage").remove(); rmleftF("bookimage"); } } function searchZhidao1(){ var url = $("#chaoxingzhidaourl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ var urlall = url.replace("&size=20","&size=10"); $.getJSON(urlall,function(data){ try{ if(data.result.length>0){ var t = 1; $.each(data.result,function(i,v){ if(t++ < 5){ var showtishi = false; var showcont = v['title'] + v['con'] ; if(showcont.indexOf("") == -1 && v['detailcon'].indexOf("") != -1) showtishi = true; var title = v['title']; if(title.substring(title.length-1, title.length) != "?" && title.substring(title.length-1, title.length) != "?"){ title += "?"; // 问题后变加问号 } $(".resultDiv02zhidao ul").append("
  • "+title+" "+(showtishi?"":"")+"答:"+v['con'].replace(/<[^>font\/]*>/g,"")+""+ "
  • "); } $("#zhidaocounts").text("("+data.hitcount+")"); }); } else { $(".resultDiv02zhidao").remove(); rmleftF("zhidao"); } } catch(e){ $(".resultDiv02zhidao").remove(); rmleftF("zhidao"); } }); } else { $(".resultDiv02zhidao").remove(); rmleftF("zhidao"); } } function searchNews1(){ var url = $("#chaoxingnewsurl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ var urlall = url.replace("&size=20","&size=10"); $.getJSON(urlall,function(data){ try{ if(data.result.length > 0){ var t = 1; $.each(data.result,function(i,v){ if (t++ < 5) { var showtishi = false; var showcont = v['title'] + v['detailcon'].substring2(100); if(showcont.indexOf("") == -1 && v['detailcon'].indexOf("") != -1) showtishi = true; $(".resultDiv0229 ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+""+(showtishi?"":"")+"" + v['detailcon'].substring2(100)+""+ "
  • "); } }); $("#29counts").text("("+data.hitcount+")"); } else { $(".resultDiv0229").remove(); rmleftF("29"); } }catch(e){ $(".resultDiv0229").remove(); rmleftF("29"); } }); } else { $(".resultDiv0229").remove(); rmleftF("29"); } } function searchBlog1(){ var url = $("#chaoxingweblogurl").val(); if(url != ""){ url = url.replace("&size=20","&size=10"); $.ajax({ url : url, dataType : 'jsonp', type : 'get', success:function(data){ if(data.result && data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ if(v['title'].indexOf("") != -1 || v['author'].indexOf("") != -1){ $(".resultDiv02weblog ul").append("
  • |<\/font>/g, '')+"' target=\"_blank\">"+v['title']+" "+v['author']+"
  • "); } else { var con = v['con'].replace(/<\/?p>/g, "").replace(/\s+/g, " "); var neighborsRed = con.match(/([^((<\/font>)|())]{0,10})[^(<\/font>)]*<\/font>.?/g) || con.match(/.*/g) ||""; var firstRed = con.indexOf("")-10; if(neighborsRed != "") { firstRed = con.indexOf(neighborsRed[0]); } if(firstRed > 10){ con = "..."+con.substring(firstRed, firstRed + 200)+'...'; } else { con = con.substring(0, 200)+'...'; } $(".resultDiv02weblog ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+v['author']+""+ con +"
  • "); } rwmap.put(v['title'],v['title']); t++; } } }); $("#weblogcounts").text("("+data.hitcount+")"); } else { $(".resultDiv02weblog").remove(); rmleftF("weblog"); } }, error:function(XMLHttpRequest, textStatus, errorThrown){ $(".resultDiv02weblog").remove(); rmleftF("weblog"); } }); } else { $(".resultDiv02weblog").remove(); rmleftF("weblog"); } } function searchPic1(){ if($("#sw").val() && $("#sw").val().trim()!=""){ var url = "http://image.baidu.com/search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&word="+encodeURIComponent($("#sw").val())+"&rn=10&callback=?"; if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ $.getJSON(url,function(data){ try{ if(data.data.length > 0){ var t = 1; $.each(data.data.slice(0, 7),function(i,v){ var imgurl = bdImgUtils.decode(v['objURL']); $(".resultDiv02pic ul").append("
  • " + "" + "" + "" + "

    " + "" + "

    " + "
  • "); }); } else { $(".resultDiv02pic").remove(); rmleftF("pic"); } }catch(e){ $(".resultDiv02pic").remove(); rmleftF("pic"); } }); } else { $(".resultDiv02pic").remove(); rmleftF("pic"); } } else { $(".resultDiv02pic").remove(); rmleftF("pic"); } } function searchIR(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#irurl").val(); $.ajax({ url: url, dataType: "json", error: function(){ $(".resultDiv02ir").remove(); rmleftF("ir"); }, success: function(data){ try{ if(data && data.count > 0){ var t = 1; $.each(data.list,function(i,v){ if(t++ < 5){ var iscontain = (",1,2,13,11,12,".indexOf(","+v.infos['C112']+",")!=-1)?true:false; var valOf307 = (iscontain?"《":"")+v.infos['C307']+(iscontain?"》":""); if(v.infos['C307']==null || v.infos['C307'].replace(" ","") == '') valOf307= ""; $(".resultDiv02ir ul").append("
  • "+(v.infos['autoshow']?""+v.infos['autoshowname'].split(",")[0]+"":"")+getReadUrl(v)+" "+v.infos['C303']+valOf307+","+v.infos['C304']+"" +"
  • "); } }); $(".resultDiv02ir .font12").text("("+data.count+")"); } else { $(".resultDiv02ir").remove(); rmleftF("ir"); } } catch(e){ $(".resultDiv02ir").remove(); rmleftF("ir"); } }}); } else { $(".resultDiv02ir").remove(); rmleftF("ir"); } } function searchGuzhidui(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#guzhiduincxurl").val(); $.ajax({ url: url, dataType: "json", error: function(){ $(".resultDiv02olds").remove(); rmleftF("olds"); }, success: function(data){ try{ if(data && data.count > 0){ var t = 1; $.each(data.list,function(i,v){ if(t++ < 5){ var iscontain = (",1,2,13,11,12,".indexOf(","+v.infos['C112']+",")!=-1)?true:false; var valOf307 = (iscontain?"《":"")+v.infos['C307']+(iscontain?"》":""); if(v.infos['C307']==null || v.infos['C307'].replace(" ","") == '') valOf307= ""; $(".resultDiv02olds ul").append("
  • " + getReadUrl(v) + " " + (v.infos['autoshow']?""+v.infos['autoshowname'].split(",")[0]+"":"")+" "+v.infos['C303']+valOf307+","+v.infos['C304']+"" +"
  • "); } }); $(".resultDiv02olds .font12").text("("+data.count+")"); } else { $(".resultDiv02olds").remove(); rmleftF("olds"); } var str = data.relatedphrases; if(str != "" && str != null){ var specialchannel = $("#specialchannel").val(); var cxfindright = $("#cxfindright").val(); var strchannel = $("#strchannel").val(); var queryvalue = ""; if(specialchannel != ""){ queryvalue = queryvalue + "&specialchannel=" + specialchannel; } if(cxfindright != ""){ queryvalue = queryvalue + "&cxfindright=" + cxfindright; } if(strchannel != ""){ queryvalue = queryvalue + "&strchannel=" + strchannel; } var strArray = str.split(",|"); var htmlstr = ""; var action = document.getElementById("dosearch").action; for(var i = 0; i < strArray.length; i++){ htmlstr = "
    =15?"style='display:none;'":"")+">"; var holestr = strArray[i]; var holeArray = holestr.split(":"); var channelstr = "

    "+holeArray[0]+"

    "; htmlstr = htmlstr + endstr; $("#gongxianciId").before(htmlstr); } if(strArray.length > 15){ $("#gongxianciId").before("

    更多……

    "); } } } catch(e){ $(".resultDiv02olds").remove(); rmleftF("olds"); } }}); } else { $(".resultDiv02olds").remove(); rmleftF("olds"); } } function showmorerelatedphrases(e){ if($(e).find("a").text() == "更多……"){ $(e).find("a").text("隐藏"); $(e).siblings("div[id=relatedphrasesId]:gt(14)").show(); } else { $(e).find("a").text("更多……"); $(e).siblings("div[id=relatedphrasesId]:gt(14)").hide(); } } function searchZuozhewenku(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#zuozhewenkuncxurl").val(); if(url != ""){ $.ajax({ url:url, dataType: "json", error: function(){ $(".resultDiv02author").remove(); rmleftF("author"); }, success:function(data){ try{ if(data && data.count > 0){ var t = 1; $.each(data.list,function(i,v){ if(t++ < 5) { var iscontain = (",1,2,13,11,12,".indexOf(","+v.infos['C112']+",")!=-1)?true:false; var valOf307 = (iscontain?"《":"")+v.infos['C307']+(iscontain?"》":""); if(v.infos['C307']==null || v.infos['C307'].replace(" ","") == '') valOf307= ""; $(".resultDiv02author ul").append("
  • "+(v.infos['autoshow']?""+v.infos['autoshowname'].split(",")[0]+"":"")+getReadUrl(v)+"  "+valOf307+v.infos['C303']+","+v.infos['C304']+"" +"
  • "); } }); $(".resultDiv02author .font12").text("("+data.count+")"); } else { $(".resultDiv02author").remove(); rmleftF("author"); } } catch (e){ } } }); } else { $(".resultDiv02author").remove(); rmleftF("author"); } }else { $(".resultDiv02author").remove(); rmleftF("author"); } } function searchWenShi(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#wenshincxurl").val(); if(url != ""){ $.ajax({ url: url, dataType: "json", error: function(){ $(".resultDiv02wenshi").remove(); rmleftF("wenshi"); }, success: function(data){ try{ if(data.list && data.list.hitcount > 0){ var t = 1; $.each(data.list.result,function(i,v){ if(t++ < 5) { var titlecon = v['title']; titlecon = titlecon.replace(/^(([0-9]+)|([一二三四五六七八九十]+))(、|\s)/, ""); if(v['url'] != ""){ titlecon = " "+titlecon+""; } var showtishi = false; var showcont = titlecon + v['con']; if(showcont.indexOf("") == -1 && v['detailcon'].indexOf("") != -1) showtishi = true; $(".resultDiv02wenshi ul").append("
  • "+(showtishi?"":"")+titlecon+"  "+v['con']+""+ "
  • "); } }); $(".resultDiv02wenshi .font12").text("("+data.count+")"); } else { $(".resultDiv02wenshi").remove(); rmleftF("wenshi"); } }catch(e){ $(".resultDiv02wenshi").remove(); rmleftF("wenshi"); } } }); } else { $(".resultDiv02wenshi").remove(); rmleftF("wenshi"); } }else { $(".resultDiv02wenshi").remove(); rmleftF("wenshi"); } } //学术趋势图 function searchXSP(){ try{ var magyearxml = $("#yearchart").siblings("input:eq(0)").val(); if(magyearxml.length > 0 && magyearxml.indexOf("set") !=-1){ var chart = new FusionCharts("/swf/MSLine.swf", "ChartId", "650", "100","0","1"); chart.setDataXML(magyearxml); chart.addParam("wmode","Opaque"); chart.render("yearchart"); } else { $(".resultDiv02xueshu").remove(); rmleftF("xueshu"); } }catch(e){ $(".resultDiv02xueshu").remove(); rmleftF("xueshu"); } } function searchExam1(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = "/searchdoc?sw="+encodeURIComponent($("#sw").val())+"&specialchannel=stk&adminid=1&Field=all&json=json"; $.ajax({ url: url, error: function(){ $(".resultDiv02stk").remove(); rmleftF("stk"); }, dataType: "json", success: function(data){ try{ if(data.result.length > 0){ var t = 1; $.each(data.result,function(i,v){ (t++ < 5) && $(".resultDiv02stk ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"'>"+v['title']+"上传人:"+v['uploadperson']+" 上传时间:"+v['uploaddate']+" 文档格式:"+v['doctype']+"
  • "); }); $("#stkcounts").text("("+data.count+")"); } else { $(".resultDiv02stk").remove(); rmleftF("stk"); } }catch(e){ $(".resultDiv02stk").remove(); rmleftF("stk"); } } }); } else { $(".resultDiv02stk").remove(); rmleftF("stk"); } } function searchCourse1(){ var url = $("#rightcourseurl").val(); if(url != ""){ url = url+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var t = 1; $.each(data.result,function(i,v){ var origin = v['origin']; var con = v['con'].replace(/,/g," "); if(origin.length>200){ // 需要找下标红最好 origin = origin.substring(0, 200)+'...'; } if(con.length>200){ con = con.substring(0, 200)+'...'; } (t++ < 5) && $(".resultDiv02kj ul").append("
  • |<\/font>/g, '')+"' href='"+$("#ddurl").val()+encodeURIComponent(v['url'])+"' target=\"_blank\">"+v['title']+""+origin+" "+con+"
  • "); }); $("#kjcounts").text("("+data.hitcount+")"); } else { $(".resultDiv02kj").remove(); rmleftF("kj"); } }); } else { $(".resultDiv02kj").remove(); rmleftF("kj"); } } function searchWendang1(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = "/searchdoc?sw="+encodeURIComponent($("#sw").val())+"&specialchannel=wendang&adminid=1&Field=all&json=json"; url = url + "&bh=1"; $.getJSON(url,function(data){ try{ if(data.result && data.result.length > 0){ var t = 1; $.each(data.result,function(i,v){ if(t++ < 5){ var showtishi = false; var showcont = v['title'] + v['uperson'] + v['date']; if(showcont.indexOf("") == -1 && v['summary'].indexOf("") != -1) showtishi = true; $(".resultDiv02docs ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"'>"+v['title']+""+(showtishi?"":"")+"上传人:"+v['uperson']+"  "+v['date']+"  "+v['docsize']+"
  • "); } }); $("#docscounts").text("("+data.count+")"); } else { $(".resultDiv02docs").remove(); rmleftF("docs"); } }catch(e){ $(".resultDiv02docs").remove(); rmleftF("docs"); } }); } else { $(".resultDiv02docs").remove(); rmleftF("docs"); } } function searchRenwu1(){ var url = $("#chaoxingrwurl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ var origin = v['origin']; var con = v['con']; if(origin.length>200){ origin = origin.substring(0, 200)+'...'; } if(con.length>200){ con = con.substring(0, 200)+'...'; } if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var content = (v['detailcon'].indexOf("")>20)?v['detailcon'].substring(v['detailcon'].indexOf("")-10):v['detailcon']; $(".resultDiv02rw ul").append("
  • |<\/font>/g, '')+"' href='"+$("#ddurl").val()+encodeURIComponent(v['url'])+"' target=\"_blank\">"+v['title']+" "+content+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#rwcounts").text("("+data.hitcount+")"); } else { $(".resultDiv02rw").remove(); rmleftF("rw"); } }); } else { $(".resultDiv02rw").remove(); rmleftF("rw"); } } function searchMoocCourse(){ var url = $("#chaoxingmooc").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var str1 = v['detailcon']; if(str1.indexOf("内容:")!=-1){ str1 = str1.split("内容:")[0]; } var strArray = str1.split(";|"); var indexstr = ""; for(var m = 0; m < strArray.length; m++){ indexstr = indexstr + strArray[m].replace("讲师:", "").replace("单位名称:", "") + "  "; } var showtishi = false; var showcont = v['title'] + indexstr; var hidecont = v['detailcon'] + v['con']; if(showcont.indexOf("") == -1 && hidecont.indexOf("") != -1) showtishi = true; $(".resultDiv02mooccourse ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+(showtishi?"":"")+""+indexstr+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#mooccoursecounts").text("("+data.hitcount+")"); } else { $(".resultDiv02mooccourse").remove(); rmleftF("mooccourse"); } }); } else { $(".resultDiv02mooccourse").remove(); rmleftF("mooccourse"); } } function searchSmartRenwu(){ var url = $("#smartrwurl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var indexstr = v['con']; var showtishi = false; var showcont = v['title'] ; var hidecont = v['detailcon'] + v['con']; if(showcont.indexOf("") == -1 && hidecont.indexOf("") != -1) showtishi = true; $(".resultDiv02smartrw ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+(showtishi?"":"")+""+indexstr+"
  • "); // rwmap.put(v['title'],v['title']); t++; } } }); } else { $(".resultDiv02smartrw").remove(); rmleftF("smartrw"); } }); } else { $(".resultDiv02smartrw").remove(); rmleftF("smartrw"); } } function searchSmartCitiao(){ var url = $("#smartcturl").val(); if(stripscript($("#sw").val()) == ""){ url = ""; } if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var indexstr = v['con']; var showtishi = false; var showcont = v['title'] ; var hidecont = v['detailcon'] + v['con']; if(showcont.indexOf("") == -1 && hidecont.indexOf("") != -1) showtishi = true; $(".resultDiv02smartct ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+(showtishi?"":"")+""+indexstr+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); } else { $(".resultDiv02smartct").remove(); rmleftF("smartct"); } }); } else { $(".resultDiv02smartct").remove(); rmleftF("smartct"); } } function searchEnterprise1(){ var url = $("#enterpriseurl").val(); if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var enterprise_info = v['detailcon'].split(";|"); var content = ""; for(var ei in enterprise_info){ //标红判断少 var fieldsinfo = enterprise_info[ei].split("=", 2); if("fax" == fieldsinfo[0] || "contacts" == fieldsinfo[0] || "telephone" == fieldsinfo[0] || "contaceaddress" == fieldsinfo[0]) content += (content==""?"":",")+ enterprise_info[ei].substring(enterprise_info[ei].indexOf("=")+1); } $(".resultDiv02enterprise ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+content+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#enterprisecounts").text("("+data.hitcount+")"); } else { $(".resultDiv02enterprise").remove(); rmleftF("enterprise"); } }); } else { $(".resultDiv02enterprise").remove(); rmleftF("enterprise"); } } function searchShici1(){ var url = $("#shiciurl").val(); if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ var origin = v['origin']; var con = v['con']; if(origin.length>200){ origin = origin.substring(0, 200)+'...'; } if(con.length>200){ con = con.substring(0, 200)+'...'; } if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var repcon = v['detailcon'].replace(/(
    )|(author=)|(authorbrief=)|(dynasty=)|(abstract=)|(appreciation=)|(;\|)/g, ""); var content = (repcon.indexOf("")>20)?repcon.substring(repcon.indexOf("")-10):repcon; var author = v['detailcon'].split(";|")[0].replace("author=","")+" "; $(".resultDiv02shici ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+author+content+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#shicicounts").text("("+data.hitcount+")"); } else { $(".resultDiv02shici").remove(); rmleftF("shici"); } }); } else { $(".resultDiv02shici").remove(); rmleftF("shici"); } } function searchZhaopin1(){ var url = $("#zhaopinurl").val(); if(url != "" && url != undefined){ url = url.replace("&size=20","&size=10"); $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ var origin = v['origin']; var con = v['con']; if(origin.length>200){ origin = origin.substring(0, 200)+'...'; } if(con.length>200){ con = con.substring(0, 200)+'...'; } if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var content = (v['detailcon'].indexOf("")>20)?v['detailcon'].substring(v['detailcon'].indexOf("")-10):v['detailcon']; $(".resultDiv02zhaopin ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+content+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#zhaopincounts").text("("+data.hitcount+")"); } else { $(".resultDiv02zhaopin").remove(); rmleftF("zhaopin"); } }); } else { $(".resultDiv02zhaopin").remove(); rmleftF("zhaopin"); } } function searchWebsite1(){ var url = $("#websiteurl").val(); if(url != ""){ url = url.replace("&size=20","&size=10")+"&bh=1"; $.getJSON(url,function(data){ if(data.result.length > 0){ var rwmap = new Map(); var t = 1; $.each(data.result,function(i,v){ var origin = v['origin']; var con = v['con']; if(origin.length>200){ origin = origin.substring(0, 200)+'...'; } if(con.length>200){ con = con.substring(0, 200)+'...'; } if(t < 5){ if(rwmap.get(v['title']) == "" || rwmap.get(v['title']) == null){ var content = (v['detailcon'].indexOf("")>20)?v['detailcon'].substring(v['detailcon'].indexOf("")-10):v['detailcon']; $(".resultDiv02website ul").append("
  • |<\/font>/g, '')+"' href='"+v['url']+"' target=\"_blank\">"+v['title']+" "+v['url']+"
  • "); rwmap.put(v['title'],v['title']); t++; } } }); $("#websitecounts").text("("+data.hitcount+")"); } else { $(".resultDiv02website").remove(); rmleftF("website"); } }); } else { $(".resultDiv02website").remove(); rmleftF("website"); } } function requestleftbar(_, A) { if($("#hssform #sw").val()=='') return false ; oScript = document.getElementById(_); var _item = document.getElementsByTagName("head").item(0); if (oScript) { $.removeChild(oScript); } oScript = document.createElement("script"); oScript.setAttribute("src", A + encodeURIComponent($("#hssform #sw").val())); oScript.setAttribute("id", _); oScript.setAttribute("type", "text/javascript"); oScript.setAttribute("language", "javascript"); _item.appendChild(oScript); return oScript; } function moreLikethis(e){ var likes = $("#morelikethis a"); var specialchannel = $("#specialchannel").val(); var strchannel = $("#strchannel").val(); var isfulltext = $("#isfulltext").val(); var queryvalue = ""; if(specialchannel != ""){ queryvalue = queryvalue + "&specialchannel=" + specialchannel; } if(strchannel != ""){ queryvalue = queryvalue + "&strchannel=" + strchannel; } if(isfulltext != ""){ queryvalue = queryvalue + "&isfulltext=" + isfulltext; } if(likes.length>0){ var action = document.getElementById("dosearch").action; $("#xiangguanId").find(".clearfix").html(''); $("#xiangguanId").show(); for(var i=0;i" +$(likes[i]).html()+""); } if(e != 8){ $("#xiangguanId ul").append("
  • " +$(likes[i]).html()+"
  • "); } } /*if(likes.length > 8 && e != 10){ var str = "更多..."; $("#xiangguanId").find(".clearfix").append(str); } if(e != 8){ var str = "收起"; $("#xiangguanId").find(".clearfix").append(str); }*/ } else { $("#xiangguanId").hide(); setTimeout("moreLikethis("+e+")", 1000); } } function changeDegree(e,f){ $("#strdegree").val(e); $("#strchannel").val(3); $("#strchoren").val(f); $("#hssform :input").each(function(){ if ($(this).attr("id") != "sw" && $(this).attr("id") != "strdegree" && $(this).attr("id") != "strchannel" && $(this).attr("id") != "strchoren") { $(this).val(""); } }); var isblank = true; goSearch(isblank); } function changeChannelSort( changeChannelId, e){ var topChannel = $.cookie("topChannel") && $.cookie("topChannel").split(",|")||[]; var genChannel = $.cookie("genChannel") && $.cookie("genChannel").split(",|")||[]; var updateChannel = null; var opertNam = $(e).find(".fr").text(); if(opertNam == '[置顶]' || opertNam == '[置顶]'){ // 置顶 var newVal = ""; for(var j=0; j=10){ alert("保存置顶域不能超过10个!"); return false; } $.cookie("genChannel",newVal, {expires: 3600, path: "/"}); newVal = ($.cookie("topChannel")!=null && $.cookie("topChannel").trim()!=""?($.cookie("topChannel"))+",|":"") + updateChannel; $.cookie("topChannel",newVal, {expires: 3600, path: "/"}); searchTopChannel(); if(!$(".leftF input[value="+changeChannelId+"]")[0].checked){ if(!recover2Top(changeChannelId, 1)){ insertAfterLeftCh(changeChannelId, 1); } $(e).parents("h3").parent("div").remove(); var s = new selfAlert("置顶成功,1秒后自动返回",1500,''); } else { $(".resultDiv02"+changeChannelId).find(".fr").remove(); $(".resultDiv02"+changeChannelId).find("h3 div").append(""); } } else { // 取消 $("#"+map.get(changeChannelId)).hide(); var newVal = ""; for(var j=0; j[置顶]"); } } saveUserTopChannels(); if($(".menuCon .menu").css("display") == "none"){ $("#menuConDivId").show(); }else{ $("#menuConDivId").hide(); } } function saveUserTopChannels(){ var topChannel = $.cookie("topChannel") || ""; var channelv = $.cookie("channelv") || ""; $.post("/savachannls?time="+new Date().getTime(),{"topchannels":topChannel, "channelv":channelv}); } function insertAfterLeftCh(channel_id, type){ // 1:置顶 2:取消置顶 var leftsortch = $.cookie("leftsortch"); var has_insert = false; if(leftsortch != null && leftsortch != ""){ var channls = leftsortch.split(",|"); for(var i=channls.length-1; i>=0; i--){ if($(".resultDiv02"+channls[i].split("#")[0]).length==1){ if(type == 2){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append("[置顶]"); } else if(type == 1){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append(""); } var clone_element = $(".resultDiv02"+channel_id).clone().show(); $(".resultDiv02"+channel_id).remove(); $(".resultDiv02"+channls[i].split("#")[0]).after(clone_element); return true; } } } if(!has_insert){ putAfterleftTop(channel_id, type); } } function recover2Gen(channel_id, isqx){ // isqx:取消置顶的 var genChannel = $.cookie("genChannel"); if(genChannel != null && genChannel != ""){ var channls = genChannel.split(",|"); var is_insert = false; for(var i=channls.length-1; i>=0; i--){ if(channls[i].split("#")[0] == channel_id){ is_insert = true; } else if(is_insert && $(".resultDiv02"+channls[i].split("#")[0]).length==1 && $(".leftF input[value="+channls[i].split("#")[0]+"]").length>0 && !$(".leftF input[value="+channls[i].split("#")[0]+"]")[0].checked){ if(isqx){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append("[置顶]"); } var clone_element = $(".resultDiv02"+channel_id).clone().show(); $(".resultDiv02"+channel_id).remove(); $(".resultDiv02"+channls[i].split("#")[0]).after(clone_element); return true; } } } return false; } function recover2Top(channel_id, type){ var topChannel = $.cookie("topChannel"); if(topChannel != null && topChannel != ""){ var channls = topChannel.split(",|"); var is_insert = false; for(var i=channls.length-1; i>=0; i--){ if(channls[i].split("#")[0] == channel_id){ is_insert = true; } else if(is_insert && $(".resultDiv02"+channls[i].split("#")[0]).length==1 && !$(".leftF input[value="+channls[i].split("#")[0]+"]")[0].checked){ if(type == 2){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append("[置顶]"); } else if(type == 1){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append(""); } var clone_element = $(".resultDiv02"+channel_id).clone().show(); $(".resultDiv02"+channel_id).remove(); $(".resultDiv02"+channls[i].split("#")[0]).after(clone_element); return true; } } } return false; } function recoverAfterTop(channel_id, type){ var topChannel = $.cookie("topChannel"); if(topChannel != null && topChannel != ""){ var channls = topChannel.split(",|"); for(var i=channls.length-1; i>=0; i--){ if($(".resultDiv02"+channls[i].split("#")[0]).length==1 && !$(".leftF input[value="+channls[i].split("#")[0]+"]")[0].checked){ if(type == 2){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append("[置顶]"); } var clone_element = $(".resultDiv02"+channel_id).clone().show(); $(".resultDiv02"+channel_id).remove(); $(".resultDiv02"+channls[i].split("#")[0]).after(clone_element); return true; } } } return false; } function putAfterleftTop(channel_id, type){ if(type == 2){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append("[置顶]"); } else if(type == 1){ $(".resultDiv02"+channel_id).find(".fr").remove(); $(".resultDiv02"+channel_id).find("h3 div").append(""); } var clone_element = $(".resultDiv02"+channel_id).clone().show(); $(".resultDiv02"+channel_id).remove(); if($(".leftTop").length == 1){ $(".leftTop").after(clone_element); } else { $(".disLeft").prepend(clone_element); } } function deleteCookie(){ $.cookie("genChannel",""); $.cookie("topChannel",""); goSearch(); } function showmorechannels(){ $(".disLeft").children("div:hidden").show(); $(".resultDiv03more").hide(); } function showrelatedpraDiv(e,f,g){ $(e).show(); $(f).show(); $(g).hide(); } function hiderelatedpraDiv(e,f,g){ $(e).show(); $(f).hide(); $(g).hide(); } function getReadUrl(v){ var urlstr = ""; if(v.infos['C112'] == 11 || v.infos['C112'] == 12 ){ urlstr += "《"+v.infos['C301'] +"》"; }else { urlstr += v.infos['C301'] ; } urlstr += ""; return urlstr; } function keshihuasearch(){ $("#specialchannel").val("ksht"); var isblank = true; goSearch(isblank); } function keshihuafun(){ ajaxreprot(16384, null, null); $(".gxstWrap").show(); } function ajaxreprot(t0, t1, t2){ if(t1 == null || t2 == null){ t0 = 16384; t1 = 12582919; t2 = 3948512; } var isEn = 'not'; var url = window.location.href.replace("&strchannel=ksht","&strchannel=")+"&istrend=true"; $(".gxstWrap").html('
    加载中...
    '); var isShowFashionChartsDiv = true; $.ajax({ url:'/searchreport?isShowFashionChartsDiv='+isShowFashionChartsDiv+'&isEn='+isEn+'&time=' + t0 + '&url='+encodeURIComponent(url.substring(url.indexOf("?")+1, url.length)), success: function(data) { $(".gxstWrap").html(data); $("#duiBiId").css("margin-right","25px"); if(t2 != 0){ $.ajax({ url: '/searchreport?isEn='+isEn+'&time=' + t2 + '&url='+encodeURIComponent(url.substring(url.indexOf("?")+1, url.length)), success: function(data) { $(".gxstWrap").append(data.replace('学术辅助分析系统','').replace('绘图中...','')); if(t1 != 0){ $.ajax({ url: '/searchreport?isEn='+isEn+'&time=' + t1 + '&url='+encodeURIComponent(url.substring(url.indexOf("?")+1, url.length)), success: function(data) { $(".gxstWrap").append(data.replace('学术辅助分析系统','').replace('绘图中...','')); } }); } } }); } } }); } function searchTopChannel(){ var channel = $.cookie("topChannel") || ""; channel = channel.replace(/\"/g, "");//防止将""放入构造成"""" if($(".menu .current").length == 1 && $(".menu .current").text() != "全部") $(".menu").show(); if(channel != '' && channel != null){ $(".menu").show(); var channnelArray = channel.split(",|"); for(var i = 0; i < channnelArray.length; i++){ var channelId = channnelArray[i].split("#")[0]; var channelAId = map.get(channelId+""); var ele = $("#"+channelAId).clone(); $("#"+channelAId).remove(); $(".menu .wrap1070").append(ele); $("#"+channelAId).show(); } } if($(".menuCon .menu").css("display") == "none"){ $("#menuConDivId").show(); }else{ $("#menuConDivId").hide(); } } function searchGongXianCi(indexdata){ var sw = $("#sw").val(); if(sw != ""){ var ele = $("#menu").html(); var queryvalue = ""; if(ele != ''){ var specialchannel = $("#specialchannel").val(); var cxfindright = $("#cxfindright").val(); var strchannel = $("#strchannel").val(); if(specialchannel != ""){ queryvalue = queryvalue + "&specialchannel=" + specialchannel; } if(cxfindright != ""){ queryvalue = queryvalue + "&cxfindright=" + cxfindright; } if(strchannel != ""){ queryvalue = queryvalue + "&strchannel=" + strchannel; } } var encodeSw = encodeURIComponent(sw); var url = $("#gongxiancincxurl").val(); if(url != ""){ $.ajax({ url: url, dataType: 'json', success: function(data){ try{ if(data.length>0){ $("#gongxianciId").find(".clearfix").html(''); var action = document.getElementById("dosearch").action; $.each(data,function(i,v){ if(i < indexdata && indexdata == 8){ var str = "
  • "+v.word+"
  • "; $("#gongxianciId").find(".clearfix").append(str); } if(indexdata != 8){ var str = "
  • "+v.word+"
  • "; $("#gongxianciId").find(".clearfix").append(str); } }); /*if(data.length > 8 && e != 10){ var str = "更多..."; $("#gongxianciId").find(".clearfix").append(str); } if(e != 8){ var str = "收起"; $("#gongxianciId").find(".clearfix").append(str); }*/ }else{ $("#gongxianciId").hide(); } }catch(e){ $("#gongxianciId").hide(); } }, error: function (){ $("#gongxianciId").hide(); } }); } else { $("#gongxianciId").hide(); } } else { $("#gongxianciId").hide(); } } function fillDataToDiv(e){ var ele = $("#menu").html(); var fillDataStr = $("#popSaved2InputId").val();//去空格 var fillDataArray = fillDataStr.split(","); $("#xiaweiciId").find(".clearfix").html(''); var queryvalue = ""; if(ele != ''){ var specialchannel = $("#specialchannel").val(); var cxfindright = $("#cxfindright").val(); var strchannel = $("#strchannel").val(); if(specialchannel != ""){ queryvalue = queryvalue + "&specialchannel=" + specialchannel; } if(cxfindright != ""){ queryvalue = queryvalue + "&cxfindright=" + cxfindright; } if(strchannel != ""){ queryvalue = queryvalue + "&strchannel=" + strchannel; } } var action = document.getElementById("dosearch").action; for(var i = 0; i < fillDataArray.length; i++){ if(i < e && e == 8){ var str = "
  • "+fillDataArray[i]+"
  • "; $("#xiaweiciId").find(".clearfix").append(str); } if(e != 8){ var str = "
  • "+fillDataArray[i]+"
  • "; $("#xiaweiciId").find(".clearfix").append(str); } } if(fillDataArray.length > 8 && e != 10){ var str = "更多..."; $("#xiaweiciId").find(".clearfix").append(str); } if(e != 8){ var str = "收起"; $("#xiaweiciId").find(".clearfix").append(str); } } /** * Descrioption: 模拟alert对话框,一定时间内不点击则自动关闭 * param msgstr: 模拟对话框要显示的字符串 * timer: 自动关闭时间 */ function selfAlert(msgstr,timer,surestr){ //该值可以作为返回值,初始化时为 0 ,点击确定后变为 1 ,点击关闭后变为 2 ,自动关闭 3 var alertValue = 0; //确定遮罩层的高度,宽度 var h = screen.availHeight; var w = screen.availWidth; //创建遮罩层,它的主要作用就是使网页中的其他元素不可用。 var dv = document.createElement("div"); dv.setAttribute('id','bg'); //设置样式 dv.style.height = h + "px"; dv.style.width = w + "px"; dv.style.zIndex = "1111"; dv.style.top = 0; dv.style.left = 0; //如果不想遮罩,可以去掉这两句 dv.style.background = "#000"; dv.style.filter = "alpha(opacity=0)"; dv.style.opacity = "0.3"; //设为绝对定位很重要 dv.style.position = "fixed"; //将该元素添加至body中 document.body.appendChild(dv); //创建提示对话框面板 var dvMsg = document.createElement("div"); dvMsg.style.position = "fixed"; dvMsg.setAttribute('id','msg'); dvMsg.style.width = "280px"; dvMsg.style.height = "100px"; dvMsg.style.top="30%"; dvMsg.style.left="40%"; dvMsg.style.background = "white"; dvMsg.style.zIndex = "1112"; //可以继续采用如上形式创建模拟对话框表格,这里为了方便采用html形式 strHtml = "
    " strHtml += "
    "; strHtml += "
    "+msgstr+"
    "; if(surestr == "" || surestr == null){ strHtml += " "; }else if(surestr == "loginMethod"){ strHtml += " "; }else{ strHtml += " "; } strHtml += "
    "; dvMsg.innerHTML = strHtml; document.body.appendChild(dvMsg); //点击关闭按钮 imgClose = function (){ alertValue = 2; // 2 代表点击了关闭按钮 document.body.removeChild(dv); document.body.removeChild(dvMsg); } //点击确定按钮 btnclick = function (){ alertValue = 1; // 1 代表点击了确定按钮 document.body.removeChild(dv); document.body.removeChild(dvMsg); } remove = function () { //timer时间过后如果仍未点击,则自动关闭selfAlert框 if(alertValue==0){ document.body.removeChild(dv); document.body.removeChild(dvMsg); } } //timer秒后自动关闭selfAlert(提示框) setTimeout("remove()",timer); //实现鼠标拖动对话框 oMove = function(obj) { var otop,oleft; otop = event.y - obj.offsetTop; oleft = event.x - obj.offsetLeft; obj.setCapture(); obj.onmousemove = function() { obj.style.left = event.x - oleft; obj.style.top = event.y - otop; } obj.onmouseup = function() { obj.onmousemove = null; obj.style.filter = null; obj.releaseCapture(); } } } function searchinresults(){ var sw = $("#hssform").find("#sw").val(); var sw1 = $("#bottomform").find("#sw1").val(); $("#hssform").find("#sw").val(sw + " " + sw1); goSearch(); } function leftCheckedbottom(){ $(".leftCheckedbgcolor").removeClass("leftCheckedbottom"); $(".leftCheckedbgcolor").length>0 && $(".leftCheckedbgcolor").last().addClass("leftCheckedbottom"); } function searchFaXian(){ if($("#sw").val() && $("#sw").val().trim() != ""){ var url = $("#faxianncxurl").val(); $.ajax({ url: url, dataType: "json", error: function(){ $(".resultDiv02faxian").remove(); rmleftF("faxian"); }, success: function(data){ if(data && data.count > 0){ var t = 1; $.each(data.list,function(i,v){ if(t++ < 5){ var iscontain = (",1,2,13,11,12,".indexOf(","+v.infos['C112']+",")!=-1)?true:false; var valOf307 = (iscontain?"《":"")+v.infos['C307']+(iscontain?"》":""); if(v.infos['C307']==null || v.infos['C307'].replace(" ","") == '') valOf307= ""; $(".resultDiv02faxian ul").append("
  • "+(v.infos['autoshow']?""+v.infos['autoshowname'].split(",")[0]+"":"")+""+v.infos['C301']+" "+v.infos['C303']+valOf307+","+v.infos['C304']+""+ "
  • "); } }); $(".resultDiv02faxian .font12").text("("+data.count+")"); } else { $(".resultDiv02faxian").remove(); rmleftF("faxian"); } } }); } else { $(".resultDiv02faxian").remove(); rmleftF("faxian"); } } function rmleftF(chboxname){ var p_dl = $(".leftF input[type=checkbox][name="+chboxname+"]").parents("dl"); $(".leftF input[type=checkbox][name="+chboxname+"]").parents("dd").remove(); $(p_dl).find("dd:lt(3)").children("label").css("color",""); var ddArray = $(p_dl).find("dd"); if(ddArray.length<2){ $(p_dl).hide(); } } function checkAllChannels(e){ var inputTArray = $(e).parent().parent().find("label").find("input"); if($(e).attr("checked") == "checked"){ for(var j = inputTArray.length-1; j >= 0 ; j--){ if($(inputTArray[j]).attr("checked") != "checked"){ inputTArray[j].click(); } } }else{ for(var j = 0; j < inputTArray.length; j++){ if($(inputTArray[j]).attr("checked") == "checked"){ inputTArray[j].click(); } } } } function stripscript(s) { var pattern = /[`~!@#$^&*()=|{}'"%:;,.\[\]<>\/?!¥…()—【】‘’“”;:。,、?]/g; return s.replace( pattern, '' ); } function registerMethod(){ var urldomain = window.location.host; var url = "http://" + urldomain + "/channelcookie?time="+new Date().getTime(); window.location.href = "http://passport2.chaoxing.com/register3?refer=" + encodeURIComponent(url); } function getUID(){ var uid = $.cookie("UID"); return uid; } function checkLogin(){ var uid = getUID(); if(uid == "" || uid == null || uid == 0){ return false; //未登录 } else { return true; //已登录 } } function checkLoginAndAlert(e){ var href = $("#firsturlinput"+e).attr("href"); var AID_dsr = $.cookie("AID_dsr"); if(AID_dsr == 7209 || AID_dsr == 0){ if(!checkLogin()){ href = ""; $("#firsturlinput").val(""); } } if(href != "" ){ window.open(href); } else { alert("请先登录"+href); loginMethed(); } } function loading(){ var load = ''; var docHeight = $(document).height(); $(".overlay").css("height",docHeight).show(); if(navigator.appName.indexOf("Microsoft") != -1){ $("#gifload").append(load); }else{ $(".loadingGIF").show(); } if(!window.XMLHttpRequest){ $(".loadingGIF").css("top",$(window).height()/2+$(document).scrollTop()); $(window).scroll(function(){ $(".loadingGIF").css("top",$(window).height()/2+$(document).scrollTop()); }) } } function bookpicclick(e){ var url = $(".resultDiv0211").find("ul").find("a").first().click().attr("href"); window.open(url); } function advSearchState(e){ var event = window.event?window.event:e; //window.event: IE---e:火狐 var elem = event.srcElement||event.target; //srcElement:IE--target:火狐 if($('.zadvance:visible').length > 0){ $('.zadvance').hide(); $(elem).attr("src", "/images/discover/newcxdiscover/advsearchshow.gif"); } else { $('.zadvance').show(); $(elem).attr("src", "/images/discover/newcxdiscover/advsearchhidden.gif"); } } function favLogin(){ var url = "http://ss.chaoxing.com/channelcookie?time="+new Date().getTime(); window.location.href = "http://passport2.chaoxing.com/login?fid=9136&refer=" + encodeURIComponent(url); }