PageSourceSearch

http://znwd.yueyang.gov.cn:8077/v2/blueocean/js/commonNew-v3.js?v=2.1

js yueyang.gov.cn collected 2026-09-24 19:35:49 UTC 45,681 bytes, 1,244 lines download raw bytes

1//应用上下文根
2var pathName = window.document.location.pathname;
3var contextName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
4// 没有结果时显示内容
5var noResult = "您好,此类问题建议您进入<a href='#' target='_blank' style='text-decoration: underline;color: #e2791f; font-weight: bold;'>匿名写信</a>进行咨询。<div style='margin-bottom:7px; font-size:12px; color:#999; margin-top:5px; '></div>"
6// 控制默认提示内容
7var dvalue = "请输入您想咨询的问题。";
8var content;
9// 新闻类型名
10var xinwen = ""
11// 栏目导航高度限制
12var lmdhHeight = 62
13var only = 0;
14var only1 = 0;
15var xqtitle;
16var xqurl;
17var value;
18var name;
19var type = 1;
20// qa新闻回复字数限制
21var qaNumLimitNews = 26
22// qa非新闻回复字数限制
23var qaNumLimit = 26
24window.out123456 = new Array();
25window.out456 = new Array();
26var question;
27
28$(function () {
29    //findmodule();
30    // 点击展开/隐藏栏目导航
31    $(document).on("click", ".showOrHide", function () {
32        var ul = $(this).siblings("ul");
33        // 大于两行就隐藏
34        if (parseInt(ul.css("height")) > lmdhHeight) {
35            ul.css("max-height", lmdhHeight + "px");
36            // $(this).find("img").attr("src", "../static/image/chat_close-ca.png");
37            $(this).find("img").attr("src", "<img th:src=\"@{{path}/static/blueocean/image/chat_close-ca.png(path=${basePath})}\">");
38
39
40        } else {
41            ul.css("max-height", "100%");
42            // $(this).find("img").attr("src", "../static/image/chat_open-ca.png");
43            $(this).find("img").attr("src", "<img th:src=\"@{{path}/static/blueocean/image/chat_open-ca.png(path=${basePath})}\">");
44        }
45    })
46    //自适应高度
47    var msgMinHeight = 490;
48    var msgHeight = $(window).height() - 300;
49    if (msgHeight < msgMinHeight) {
50        msgHeight = msgMinHeight;
51    }
52    $(window).resize(function () {
53        msgHeight = $(window).height() - 300;
54        if (msgHeight < msgMinHeight) {
55            msgHeight = msgMinHeight;
56        }
57    });
58
59    $(document).on(
60        "mouseover",
61        ".tipDiv li",
62        function () {
63            $(this).addClass("tipLiActive").siblings("li").removeClass(
64                "tipLiActive")
65        })
66    $("#messCon").val(dvalue);
67    $(document).on("click", ".tipDiv li", function (e) {
68        $("#messCon").val($(this).text());
69        $(".tipDiv").css("display", "none")
70        stopPropagation(e) // 停止dom事件层次传播
71    })
72    $(document).on("click", "body", function () {
73        $(".tipDiv").css("display", "none")
74    })
75
76    var showTipTimeOut;
77    $("#messCon").on('keyup', function () {
78
79        clearTimeout(showTipTimeOut);
80        var msg = $(this).val();
81        showTipTimeOut = setTimeout(function () {
82            $(".tipDiv").css("display", "none")
83            //showTip();
84        }, 500);
85    })
86
87    // 左侧标签点击效果
88    $("#main0 a").click(function () {
89        qaSearchList($(this).text());
90    })
91    // 竖向tab选项卡
92    var $tab_li = $(".tab_title ul li");
93    $tab_li.click(function () {
94        $(this).addClass("slected").siblings().removeClass("slected");
95        var index = $tab_li.index(this);
96        $(".tab_content > div").eq(index).show().siblings().hide();
97    })
98    $(".attention .btn-h").click(function () {
99        $(".tab_content > div").eq(1).show().siblings().hide();
100        $tab_li.eq(1).addClass("slected").siblings().removeClass("slected");
101
102    })
103
104    // 智能查询tab选项卡
105    $(document)
106        .on(
107            "click",
108            ".tab2_title ul li",
109            function () {
110                $(this).addClass("slected2").siblings().removeClass(
111                    "slected2");
112                var index = $(this).parent().children().index(this) + 1;
113                $(this).parents(".tab2_title").siblings().children()
114                    .eq(index).show().siblings().hide();
115                $("#message").getNiceScroll().resize();
116            })
117
118    // 显示滚动条
119    $("#message").niceScroll({
120        cursorborder: "",
121        cursorcolor: "#9e0001",
122        cursoropacitymax: 0.5,
123        boxzoom: false,
124        autohidemode: "leave"
125    });
126
127    // 可输入字数
128    function checkInputCount() {
129        var maxLen = 100; // 定义用户可以输入的最多字数
130        if (this.value.length > maxLen) {
131            this.value = this.value.substring(0, maxLen); // 就去掉多余的字
132            $("#number strong").html('0').css('color', '#fe5325');
133        } else {
134            $("#number strong").html(maxLen - this.value.length);
135        }
136    }
137
138    function controlInput_clear() {
139        if (this.value && this.value == dvalue) {
140            this.value = '';
141        }
142    }
143
144    function controlInput_init() {
145        if (!this.value) {
146            this.value = dvalue;
147        }
148    }
149
150    $('#messCon').bind({
151        keyup: checkInputCount,
152        keydown: checkInputCount,
153        focus: controlInput_clear,
154        blur: controlInput_init
155    });
156    // 点击回车提交
157    $("#messCon").keypress(function (event) {
158        if (event.keyCode == '13') {
159            event.preventDefault();
160            $("#sendMess").click();
161        }
162    })
163    // 使用帮助轮播图
164    $(".slideBox").slide({
165        mainCell: ".bd ul",
166        autoPlay: true,
167        delayTime: 1000
168    });
169
170    // 获得url参数,自动检索
171    var paramQuestion = getUrlParam("question");
172    if (paramQuestion != null && paramQuestion.length > 0) {
173        $("#messCon").val(decodeURIComponent(paramQuestion));
174        $("#sendMess").click();
175    }
176
177    // 隐藏展开答案
178    $(document).on("click", ".onoff", function () {
179        toggleDialog($(this));
180        $("#message").getNiceScroll().resize();
181    })
182
183    // 收藏结果
184    $(document)
185        .on(
186            "mousedown",
187            ".dialog_tab",
188            function (e) {
189                if (3 == e.which) {
190                    // 获得当前问题
191                    var question = $(this).prev("ul").children("li")
192                        .text();
193                    $(".tipDiv2 ul")
194                        .empty()
195                        .append(
196                            "<li  class='addFavorite' question='"
197                            + question
198                            + "'><i class='menu_ico add_favorite'>"
199                            + "</i>加入收藏</li><li  class='addHome'><i class='menu_ico add_home'>"
200                            + "</i>设为首页</li><li class='cleanContent'><i class='menu_ico clean_content'></i>清空屏幕</li>");
201                    $(".tipDiv2").css("display", "block");
202                    $(".tipDiv2").css("top", e.pageY + 5);
203                    $(".tipDiv2").css("left", e.pageX + 15);
204                    stopPropagation(e) // 停止dom事件层次传播
205                }
206            })
207
208    // 显示清空浮层
209    /*
210     * $("#message") .rightClick( function(e) { $(".tipDiv2 ul") .empty()
211     * .append( "<li  class='addHome'><i class='menu_ico add_home'>" + "</i>设为首页</li><li class='cleanContent'><i
212     * class='menu_ico clean_content'></i>清空屏幕</li>");
213     * $(".tipDiv2").css("display", "block"); $(".tipDiv2").css("top", e.pageY +
214     * 5); $(".tipDiv2").css("left", e.pageX + 15); }) // 隐藏清空浮层
215     * $("#message").click(function(e) { if (3 != e.which) {
216     * $(".tipDiv2").css("display", "none"); } })
217     */
218    // 清空屏幕绑定事件
219    $(document).on("click", ".cleanContent", function () {
220        $(".tipDiv2").css("display", "none");
221        $("#message").empty()
222    })
223    // 加入收藏绑定事件
224    $(document).on("click", ".addFavorite", function () {
225        var question = $(this).attr("question");
226        var url = window.location.href.split("?")[0];
227        if (url.indexOf("index.html") == -1) {
228            url += "index.html";
229        }
230        url += "?question=" + encodeURIComponent(question);
231        addFavorite(url, "智能咨询平台问题:" + question);
232        $(".tipDiv2").css("display", "none");
233    })
234
235    // 设为首页绑定事件
236    $(document).on("click", ".addHome", function () {
237        setHomepage()
238        $(".tipDiv2").css("display", "none");
239    })
240
241    // 新闻中心
242    //getLatestNews("政策文件", function(out) {
243    //      $("[channel='zcfb']").empty().html(out)
244    //  })
245    // 信息公开
246    //getLatestNews("政策解读", function(out) {
247    //      $("[channel='zcjd']").empty().html(out)
248    //  })
249
250    // 二次问答交互
251    $(document).on("click", ".box-questions-second button", function () {
252        var value = $(this).text();
253        //$("#messCon").val(value);
254
255        $("#queryTxt").val(value);
256        //qaSearch(value);
257        //$("#sendMess").click();
258    })
259
260    //登记卡城市选择
261    $(document).on("click", ".choose-city-more", function () {
262        if ($(this).text() == "展开") {
263            $(this).text("收起").addClass("choose-city-hide").closest(".choose-city").addClass("opencity");
264        } else {
265            $(this).text("展开").removeClass("choose-city-hide").closest(".choose-city").removeClass("opencity");
266        }
267    })
268    $(document).on("click", ".choose-city span", function () {
269        $(this).addClass("citycur").parent().siblings().find("span").removeClass("citycur");
270        var index = $(this).parent("li").index();
271        $(this).closest(".choose-city").siblings(".table-con").hide().eq(index).show();
272        //ajax
273        // var query = $(this).data("query");
274        // var did = $(this).data("did");
275        // var hits = dataSearch(query, did, "");
276        // hits = eval(hits);
277        // if (hits != null && hits.length>0){
278        // 	var hit = hits[0];
279        // 	$("#data-detail" + query).html(addMultiDataItem(hit));
280        // }
281    })
282    // 分类切换
283    $(document).on("click", ".choose-city-tab span", function () {
284        var index = $(this).parent("li").index();
285        $(this).addClass("citytabcur").parent().siblings().find("span").removeClass("citytabcur");
286        $(this).closest(".choose-city-tab").siblings(".table-tab-con").hide().eq(index).show();
287    })
288    //旅游投诉城市选择
289    $(document).on("click", ".box-tourist-city-more", function () {
290        if ($(this).text() == "展开") {
291            $(this).text("收起").addClass("box-tourist-city-hide").parent().siblings(".box-tourist-city-list").show();
292        } else {
293            $(this).text("展开").removeClass("box-tourist-city-hide").parent().siblings(".box-tourist-city-list").hide();
294        }
295    })
296
297    //答案多个相关数据选择
298    $(document).on("click", ".questions-more-btn", function () {
299        if ($(this).text() == "展开") {
300            $(this).text("收起").addClass("questions-more-btn-hide").siblings(".questions-more-list").show();
301        } else {
302            $(this).text("展开").removeClass("questions-more-btn-hide").siblings(".questions-more-list").hide();
303        }
304    })
305})
306//function findmodule(){
307// $.getJSON(contextName+"/admin/web/module.do",function(date){
308//  var modulelist=date.msg;
309//  for(var i = 0; i < modulelist.length; i++){
310//      if(modulelist[i].title=="欢迎语"){
311//          var huanyingyu=modulelist[i].content;
312//          $("#huanying").append(huanyingyu);
313//          }
314//      if(modulelist[i].title=="常见问题"){
315//var changjianwenti=""
316//  changjianwenti=changjianwenti+"<li><a href='javascript:;'>"+modulelist[i].content+"</a></li>"
317//          $("#changjianwenti").append(changjianwenti);
318//      }
319//  }
320//   liclick();
321//  });
322//
323// }
324function liclick() {
325    $(".hottags-ul li a").click(function () {
326        var hot = $(this).html();
327        $(".onoff").each(function () {
328            toggleDialog($(this), "off")
329        })
330
331        //resetMultiLable();
332        $("#queryTxt").val(hot);
333        toponym = "";
334        qaSearch(hot);
335
336    });
337    $(".box_bottom_cjwt li a").click(function () {
338        var hot = $(this).html();
339        $(".onoff").each(function () {
340            toggleDialog($(this), "off")
341        })
342
343        //resetMultiLable();
344        $("#queryTxt").val(hot);
345        toponym = "";
346        qaSearch(hot);
347
348    })
349}
350liclick();
351// 最新新闻
352//function getLatestNews(channel, callback) {
353//  var template_table = " <table>{tr}</table>"
354//  var template_tr = "<tr><td class='dd'></td><td class='t'><a href='{link}' target='_blank' title='{title}'>{title}</a></td></tr>"
355//  // 获取json
356//  var url = contextName + "/admin/web/searchByChannel.do";
357//  var param = {
358//      "channel" : channel
359//  }
360//  $
361//          .getJSON(
362//                  url,
363//                  param,
364//                  function(data) {
365//                      var out = "";
366//                      var msg = data.msg;
367//                      if (data.sig) {
368//                          // 请求成功
369//                          for (var i = 0; i < msg.length; i++) {
370//
371//                              var qaNumLimitTrue = qaNumLimit;
372//                              msg[i].title.length > qaNumLimitTrue ? msg[i].title = msg[i].title
373//                                      .substring(0, qaNumLimitTrue)
374//                                      + "..."
375//                                      : msg[i].title
376//                              var obj = [ {
377//                                  "name" : "link",
378//                                  "value" : msg[i].url
379//                              }, {
380//                                  "name" : "title",
381//                                  "value" : msg[i].title
382//                              }, {
383//                                  "name" : "date",
384//                                  "value" : msg[i].date
385//                              } ]
386//                              out += replaceTemplate(template_tr, obj);
387//                          }
388//                          var obj = [ {
389//                              "name" : "tr",
390//                              "value" : out
391//                          } ]
392//                          out = replaceTemplate(template_table, obj);
393//                          // 获得最终的html,回调函数自己处理拼接
394//                          callback(out)
395//                      } else {
396//                          // 请求失败,返回空字符串
397//                          callback("")
398//                      }
399//                  })
400//}
401
402// 定义加入收藏夹函数
403function addFavorite(siteUrl, siteName) {
404    if (document.all) {
405        try {
406            window.external.addFavorite(siteUrl, siteName);
407        } catch (e) {
408            alert(e.message)
409            alert("加入收藏失败,请使用Ctrl+D进行添加");
410        }
411
412    } else if (window.sidebar) {
413        window.sidebar.addPanel(document.title, window.location.href, "");
414    } else {
415        alert("加入收藏失败,请使用Ctrl+D进行添加");
416    }
417}
418
419// 设为首页 <a onclick="SetHome(this,window.location)">设为首页</a>
420function setHomepage() {
421    if (document.all) {
422        document.body.style.behavior = 'url(#default#homepage)';
423        document.body.setHomePage(window.location.href);
424    } else if (window.sidebar) {
425        if (window.netscape) {
426            try {
427                netscape.security.PrivilegeManager
428                    .enablePrivilege("UniversalXPConnect");
429            } catch (e) {
430                alert("该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true");
431            }
432        }
433        var prefs = Components.classes['@mozilla.org/preferences-service;1']
434            .getService(Components.interfaces.nsIPrefBranch);
435        prefs.setCharPref('browser.startup.homepage', window.location.href);
436    } else {
437        alert('您的浏览器不支持自动自动设置首页, 请使用浏览器菜单手动设置!');
438    }
439}
440
441function toggleDialog(obj, paramStatus) {
442    var toStatus = "";
443    // 未传入paramStatus参数,获得当前obj的status,toggle
444    if (typeof (paramStatus) == 'undefined' || paramStatus == null) {
445        var status = obj.attr("status");
446        if (status == "on") {
447            toStatus = "off";
448        } else {
449            toStatus = "on";
450        }
451    } else {
452        toStatus = paramStatus;
453    }
454
455    if (toStatus == "off") {
456        obj.attr("status", "off");
457        // obj.css("background-image", "url('<img th:src=\\\"@{{path}/static/image/chat_close-ca.png(path=${basePath})}\\\">')");
458        obj.css("background-image", "url('" + pathPost + "/static/blueocean/image/chat_close.png')");
459        obj.parent("li").parent("ul").next("div").css("display", "none");
460
461    } else {
462        obj.attr("status", "on");
463        obj.css("background-image", "url('" + pathPost + "/static/blueocean/image/chat_open.png')");
464        // obj.css("background-image", "url('<img th:src=\\\"@{{path}/static/image/chat_open-ca.png(path=${basePath})}\\\">");
465        obj.parent("li").parent("ul").next("div").css("display", "");
466
467    }
468
469}
470
471var tipArr = new Array();
472
473// 显示提示浮层
474//function showTip() {
475//  var url = contextName + "/admin/web/luceneSearch_searchHis.do"
476//  var param = {
477//      "question" : $("#messCon").val(),
478//      "isParticle" : "true",
479//      "isShould" : "true"
480//  }
481//  if (param.question == dvalue)
482//      return;
483//  if ($.trim($("#messCon").val()).length > 0) {
484//
485//      $.getJSON(url, param, function(data) {
486//          tipArr = new Array()
487//          var msg = data.msg;
488//          if (data.sig == true) {
489//              var out = "";
490//              var datalist = new Array();
491//              var flag = false;
492//              for (var i = 0; i < msg.length; i++) {
493//                  tipArr.push(msg[i]);
494//                  var datamasg = msg[i].SEARCHCONTENT.replace($("#messCon")
495//                          .val(), '<font color="red">' + $("#messCon").val()
496//                          + '</font>');
497//                  for (var j = 0; j < datalist.length; j++) {
498//                      if (datamasg == datalist[j]) {
499//                          flag = true;
500//                          break;
501//                      }
502//                  }
503//                  if (!flag) {
504//                      datalist.push(datamasg);
505//                      out += "<li>" + datamasg + "</li>";
506//                  }
507//
508//              }
509//
510//              if (msg.length > 0) {
511//                  $(".tipDiv ul").html(out);
512//                  $(".tipDiv").css("display", "block");
513//              }
514//          }
515//      })
516//  }
517//
518//}
519// 获得传入问题相同的提示,并将此提示ID作为参数传入后台
520function getSimTip(question) {
521    for (var i = 0; i < tipArr.length; i++) {
522        if (question == tipArr[i].SEARCHCONTENT) {
523            return tipArr[i].ID
524        }
525    }
526}
527
528// 阻止事件气泡
529function stopPropagation(e) {
530    e = window.event || e;
531    if (document.all) {
532        e.cancelBubble = true;
533    } else {
534        e.stopPropagation();
535    }
536}
537$('#talk').click(function () {
538
539    if (type == 1) {
540        $(this).html("闲聊模式")
541        type = 0;
542
543    } else {
544        $(this).html("问答模式")
545        type = 1;
546
547    }
548
549})
550
551function qaSearchList(question) {
552    var url = contextName + "/qa/list.html";
553    if (url.indexOf("?") != -1) {
554        window.open(url + "&word=" + encodeURIComponent(question));
555
556        // window.location.href=url+"&word="+encodeURIComponent(question);
557    } else {
558        window.open(url + "?word=" + encodeURIComponent(question));
559
560        // window.location.href=url+"?word="+encodeURIComponent(question);
561    }
562}
563
564function scrollToBottom() {
565    $("#message").scrollTop(
566        parseInt($("#message")[0].scrollHeight)
567        - parseInt($("#message").css("height")));
568    $("#message").getNiceScroll().resize();
569}
570
571// 追加问题
572function addQuestion(question) {
573	question = escapeHtml(question);
574	var template = "<ul class='dialog'><li class='center'><a title='" + question + "'>"+ question +"</a><div class='onoff' status='on'></div></li></ul>";	
575    $("#message").append(template);	
576    // 移动滚动条
577    scrollToBottom();
578}
579
580// 适用于$page $page[n-n:n]
581function changeChnlUrl(url) {
582    return url.replace(/\$page\[(.*?)-.*?\]/, "$1").replace(/\$page/, "1");
583}
584
585// 获得栏目导航信息
586function getChannels(msg) {
587    var channelObj = {};
588    var titleJson = {}
589    for (i in msg) {
590        for (var j = 0; j < msg[i].length; j++) {
591            // 过滤掉重复标题
592            var fullTitle = msg[i][j].title;
593            if (typeof (titleJson[fullTitle]) != 'undefined') {
594                continue;
595            } else {
596                titleJson[fullTitle] = "";
597            }
598            if (typeof (msg[i][j].channel) != 'undefined'
599                && typeof (msg[i][j].channelUrl) != 'undefined') {
600                msg[i][j].channel = msg[i][j].channel.replace(
601                    /[^a-zA-Z0-9_\u4e00-\u9fa5]/ig, "");
602                if (typeof (channelObj[msg[i][j].channel]) == 'undefined') {
603                    channelObj[msg[i][j].channel] = {
604                        "channel": msg[i][j].channel,
605                        "channelUrl": changeChnlUrl(msg[i][j].channelUrl),
606                        "num": 1
607                    }
608                } else {
609                    channelObj[msg[i][j].channel].num++;
610                }
611            }
612
613        }
614    }
615    return channelObj;
616}
617
618function submit1(submitid1) {
619    var obj = document.getElementsByName("pj1");
620    check_val = [];
621    var value1 = "";
622    for (var k = 0; k < obj.length; k++) {
623        if (obj[k].checked == true) {
624            if (value1 == "") {
625                if (k == 2) {
626                    value1 = document.getElementById('contentwhy1').value
627
628                } else {
629                    value1 = obj[k].value;
630                }
631            } else {
632                if (k == 2) {
633                    value1 = value1 + ";" + document.getElementById('contentwhy1').value
634                } else {
635                    value1 = value1 + ";" + obj[k].value;
636                }
637            }
638        }
639    }
640    var valueshanghai = "";
641    var obj = document.getElementsByName("pj1shanghai");
642    for (var k = 0; k < obj.length; k++) {
643        if (obj[k].checked == true) {
644            if (valueshanghai == "") {
645                valueshanghai = obj[k].value;
646            } else {
647                valueshanghai = valueshanghai + ";" + obj[k].value;
648            }
649        }
650    }
651    if (valueshanghai == "") {
652        valueshanghai = document.getElementById('content1').value
653    } else {
654        if (document.getElementById('content1').value == "") {
655
656        } else {
657            valueshanghai = valueshanghai + ";" + document.getElementById('content1').value
658        }
659    }
660
661    if (submitid1.id == "cancelBtn1") {
662    } else if (submitid1.id == "submitBtn1") {
663        var thumb = "不满意:" + value1;
664        var date = {
665            "question": this.question,
666            "thumb": thumb,
667            "jjthumbtext": valueshanghai
668        }
669        $.post(contextName + "/admin/web/qathumbSearch.do", date,
670            function (data) {
671                // 显示异步回传的数据
672
673            });
674    }
675
676}
677
678function js_response(date) {
679    alert(date.channelUrl);
680
681}
682
683function Sensitiveword() {
684
685    var cont22 = "<div class='dialog_tab'><div><div class='tab2_content'>很抱歉,您搜索的内容含有<font style='color:#e2791f; font-weight: 700;'>敏感词</font>,无法找到相关内容</div></div></div>"
686
687    $("#message").append(cont22);
688}
689
690function Chattingwords(msg) {
691    for (var i1 in msg) {
692        for (var j1 = 0; j1 < msg[i1].length && j1 < 1; j++) {
693            /*alert(msg[i][j].title);*/
694            var cont22 = "<div class='dialog_tab'><div><div class='tab2_content'>" + msg[i1][j1].title + "</div></div></div>";
695            $("#message").append(cont22);
696            return 0;
697        }
698    }
699
700
701}
702
703function Specialcharacters() {
704    var noResult1 = "<div class='dialog_tab'><div><div class='tab2_content'>很抱歉,您搜索的内容含有<font style='color:#e2791f;  font-weight: 700;'>敏感词</font>,无法找到相关内容。</div></div></div>";
705    $("#message").append(noResult1);
706}
707
708function addAnswer(question, qaMsg) {
709    var question = question;
710    var categoryLi = "";
711    var qaDiv = "";
712    var channelLi = "";
713    var msg = qaMsg.msg;
714    var index = 0;
715    // 重复标题
716    for (var i in msg) {
717        if (i == "含有敏感词") {
718            Sensitiveword();
719            return 0;
720        }
721        if (i == "闲聊词") {
722            Chattingwords(msg);
723            return 0;
724        }
725    }
726    if (question.indexOf("/") >= 0 || question.indexOf("\\") >= 0 || question.indexOf("{") >= 0 || question.indexOf("}") >= 0 || question.indexOf("[") >= 0 || question.indexOf("]") >= 0 || question.indexOf(":") >= 0 || question.indexOf("^") >= 0 || question.indexOf("(") >= 0 || question.indexOf(")") >= 0 || question.indexOf("~") >= 0) {
727
728        // Specialcharacters();
729        scrollToBottom();
730        return 0;
731    }
732    var titleJson = {}
733    if (qaMsg.sig) {
734        var channelObj = getChannels(msg);
735        for (i in channelObj) {
736
737            if (channelLi.length == 0) {
738                var date = {
739                    "channelUrl": channelObj[i].channelUrl,
740                    "channel": channelObj[i].channel,
741                    "content": channelObj[i].content
742                };
743                channelLi = "<a href='javascript:void(0);' onclick='js_response(date)' "
744                    + channelObj[i].channel
745                    + "("
746                    + channelObj[i].num
747                    + ")</a>"
748
749            } else {
750                var date = {
751                    "channelUrl": channelObj[i].channelUrl,
752                    "channel": channelObj[i].channel,
753                    "content": channelObj[i].content
754                };
755                channelLi = "-<a href='javascript:void(0);' onclick='js_response(date)' "
756                    + channelObj[i].channel
757                    + "("
758                    + channelObj[i].num
759                    + ")</a>"
760            }
761        }
762        if (channelLi.length != 0) {
763            channelLi = "<p><strong>栏目导航</strong></p><ul class='news chnl'><li>"
764                + channelLi + "</li></ul>"
765        }
766        var rr = 0;
767        for (i in msg) {
768            if (msg[i].length == 0) {
769                continue;
770            }
771            var curQaLi = "";
772            var curQaDiv = "";
773            // 遍历分类
774            if (index == 0) {
775                categoryLi = "<li class='slected2'>" + i + "</li>"
776            } else {
777                categoryLi += "<li>" + i + "</li>"
778            }
779            var result = 0;
780            for (var j = 0; j < msg[i].length && j < 4; j++) {
781                // qa回复字数限制
782                var title = msg[i][j].title;
783                var fullTitle = msg[i][j].title;
784                var qaNumLimitTrue = qaNumLimit;
785
786                // 过滤掉重复标题
787                if (typeof (titleJson[fullTitle]) != 'undefined') {
788                    continue;
789                } else {
790                    titleJson[fullTitle] = "";
791                }
792
793                if (isInclude(xinwen, i)) {
794                    qaNumLimitTrue = qaNumLimitNews;
795                }
796                if (title.length > qaNumLimitTrue) {
797                    title = title.substring(0, qaNumLimitTrue) + "...";
798                }
799                // 如果有预设页面html则优先展示
800                if (msg[i][j].html != undefined && msg[i][j].html != null
801                    && msg[i][j].html.length > 0) {
802                    curQaDiv += msg[i][j].html;
803                } else {
804                    if (msg[i][j].url.indexOf("http") == -1) {
805                        result++;
806                        curQaLi += "<li><a title='" + fullTitle
807                            + "' href='http://" + msg[i][j].url
808                            + "' target='_blank'>" + title
809                            + "</a><span class='bszn'>[" + i
810                            + "]</span></li>";
811
812                    } else {
813
814                        content = msg[i][j].content;
815                        if (i == "办事指南") {
816                            result++;
817                            curQaLi += "<li><a title='"
818                                + fullTitle
819                                + "' href="
820                                + msg[i][j].url
821                                + " target='_blank'>"
822                                + title
823                                + "</a><span class='bszn'>[办事指南]</span> </li>"
824                        } else {
825
826                            if (content == "" || content == null) {
827                                result++;
828                                curQaLi += "<li><a title='" + fullTitle
829                                    + "' href=" + msg[i][j].url
830                                    + " target='_blank'>" + title
831                                    + "</a><span class='bszn'>[" + i
832                                    + "]</span></li>"
833                            } else if (content.length >= 54) {
834                                var valuesubstr = msg[i][j].content.substr(0,
835                                    54);
836                                if (valuesubstr == '<img src="http://www.beijing.gov.cn/gongkai/shilingdao') {
837                                    result++;
838                                    curQaLi += "<li><button id='"
839                                        + title
840                                        + "' value='"
841                                        + content
842                                        + "' title='"
843                                        + title
844                                        + "' name='"
845                                        + msg[i][j].url
846                                        + "' onclick='findcontent123(this)' >"
847                                        + title
848                                        + "</button><span class='bszn'>[市领导]</span></li>"
849                                } else {
850                                    result++;
851                                    curQaLi += "<li><button id='"
852                                        + title
853                                        + "' value='"
854                                        + content
855                                        + "' title='"
856                                        + title
857                                        + "' name='"
858                                        + msg[i][j].url
859                                        + "' onclick='findcontent123(this)' >"
860                                        + title
861                                        + "</button><span class='bszn'>["
862                                        + i + "]</span></li>"
863                                }
864                            } else {
865                                result++;
866                                curQaLi += "<li><button id='"
867                                    + title
868                                    + "' value='"
869                                    + content
870                                    + "' title='"
871                                    + title
872                                    + "' name='"
873                                    + msg[i][j].url
874                                    + "' onclick='findcontent123(this)' >"
875                                    + title
876                                    + "</button><span class='bszn'>["
877                                    + i + "]</span></li>"
878                            }
879                        }
880                    }
881                    // 新闻类型的显示时间
882                    if (isInclude(xinwen, i) && msg[i][j].date != undefined) {
883                        curQaLi = curQaLi.replace(/\{date\}/g, "<span>"
884                            + msg[i][j].date + "</span>");
885                    } else {
886                        curQaLi = curQaLi.replace(/\{date\}/g, "");
887                    }
888                }
889            }
890            rr += result;
891            qaDiv += "" + curQaDiv + "  " + curQaLi + "";
892            index++;
893        }
894        if (rr > 6) {
895            var template = "<div class='dialog_tab'><div><p>您的问题是:<span>{question}</span><br/>我为您找到了以下答案:</p><div class='tab2_content'><ul class='news news-nn'>{qaDiv}<p class='more-new'>更多信息</p></ul></div></div>"
896                + out123456
897                + "<div class='g-man clearfix'><span>您对以上回答是否满意?</span><div class='g-man1 left'  onclick='judge(this)' id='yesDiv'><span></span>满意</div><div class='g-man2 left'  onclick='judge(this)' id='noDiv'><span></span>不满意</div></div></div>";
898
899
900        } else {
901            var template = "<div class='dialog_tab'><div><p>您的问题是:<span>{question}</span><br/>我为您找到了以下答案:</p><div class='tab2_content'><ul class='news news-nn'>{qaDiv}</ul></div></div>"
902                + out123456
903                + "<div class='g-man clearfix'><span>您对以上回答是否满意?</span><div class='g-man1 left'  onclick='judge(this)' id='yesDiv'><span></span>满意</div><div class='g-man2 left'  onclick='judge(this)' id='noDiv'><span></span>不满意</div></div></div>";
904
905        }
906    } else {
907        qaDiv = noResult;
908        var template = "<div class='dialog_tab' style='padding-bottom:0;'>{channelLi}<div><div class='tab2_content'>{qaDiv}</div></div>"
909            + out123456 + "</div>";
910    }
911    template = template.replace(/\{question\}/g, question);
912    template = template.replace(/\{categoryLi\}/g, categoryLi);
913    template = template.replace(/\{qaDiv\}/g, qaDiv);
914    template = template.replace(/\{channelLi\}/g, channelLi);
915
916    $("#message").append(template);
917    clickmore();
918    // 移动滚动条
919    scrollToBottom();
920
921
922}
923
924//判断是否是第一次点击
925function judge(a) {
926
927    if (a.id == "yesDiv") {
928        var thumb = "满意";
929        var date = {
930            "question": this.question,
931            "thumb": thumb
932        };
933        $.post(contextName + "/admin/web/qathumbSearch.do", date,
934            function (data) {
935                // 显示异步回传的数据
936                // $(a).children("span").css("background",
937                //      "url(images/good.png) no-repeat left center")
938                //      .parent().siblings('div').remove();
939                $(a).parent("div").html("谢谢您的评价!");
940
941            });
942    } else if (a.id == "noDiv") {
943        var thumb = "不满意";
944
945        $('.prompting1').show();
946        $(a).parent("div").html("谢谢您的评价!");
947
948    }
949}
950
951$('.other').click(function () {
952    if ($(this).is(':checked')) {
953        $(this).parent().siblings('.cause').show();
954    } else {
955        $(this).parent().siblings('.cause').hide();
956    }
957})
958$('#submitBtn').click(function () {
959    $(".prompting").hide();
960    $("#contentwhy").val("");
961    $("#content").val("");
962    $('.input-box').attr("checked", false);
963    $('.cause').hide();
964})
965
966$('#cancelBtn').click(function () {
967    $(".prompting").hide();
968    $("#contentwhy").val("");
969    $("#content").val("");
970    $('.input-box').attr("checked", false);
971    $('.cause').hide();
972
973})
974$('#submitBtn1').click(function () {
975    $(".prompting1").hide();
976    $("#contentwhy1").val("");
977    $("#content1").val("");
978    $('.input-box').attr("checked", false);
979    $('.cause').hide();
980})
981
982$('#cancelBtn1').click(function () {
983    $(".prompting1").hide();
984    $("#contentwhy1").val("");
985    $("#content1").val("");
986    $('.input-box').attr("checked", false);
987    $('.cause').hide();
988})
989
990//评价-end
991
992
993function recordClick(xqtitle) {
994    var url;
995    if (xqtitle.href == null) {
996        url = xqtitle;
997    } else {
998        url = xqtitle.href;
999    }
1000    var date = {
1001        "xqtitle": url
1002    };
1003    $.post(contextName + "/admin/web/recordClick.do", date, function (data) {
1004    });
1005}
1006
1007
1008// 返回答案
1009function findcontent123(obj) {
1010    // alert(obj.id)
1011    // alert(obj.value)
1012    //alert(obj.name)
1013    name = obj.name;
1014    value = obj.value;
1015    recordClick(name)
1016    var a = '<ul class="dialog"><li class="center"><a  title=' + obj.id + '>' + obj.id
1017        + '</a><div class="onoff" status="on"></div></li></ul>';
1018
1019    $("#message").append(a);
1020    // 判断是否含有空格
1021    if (obj.value.indexOf("img") > 0) {
1022
1023    } else {
1024        // obj.value = obj.value.replace(/\s+/g, "<br/>");
1025        obj.value = obj.value.replace(/\s+/g, "");
1026        obj.value = obj.value.replace(/br/g, "");
1027        obj.value = obj.value.replace(/。/g, "。<br/>");
1028
1029    }
1030    if (name != null && name != "") {
1031        if (obj.value.length < 160) {
1032            var cont = "<div class='dialog_tab daan'><div><div class='right_arrow'></div><p>您的问题是:<span>"
1033                + obj.id
1034                + "</span></p><p>我的回答:</p><div class='c_text1' id='c_text'>"
1035                + obj.value
1036                + "</div><a href='"
1037                + obj.name
1038                + "' target='_blank' class='adwz'>点击进入网页内容</a><div class='g-man clearfix' ><span>您对以上回答是否满意?</span><div class='g-man1 left' name='"
1039                + obj.id
1040                + "' url='"
1041                + obj.name
1042                + "' onclick='judge(this)' id='yesDiv' ><span></span>满意</div><div class='g-man2 left' name='"
1043                + obj.id
1044                + "' url='"
1045                + obj.name
1046                + "' onclick='judge(this)' id='noDiv' ><span></span>不满意</div></div></div></div>"
1047        } else {
1048            var cont = "<div class='dialog_tab daan'><div><div class='right_arrow'></div><p>您的问题是:<span>"
1049                + obj.id
1050                + "</span></p><p>我的回答:</p><div class='c_text' id='c_text'>"
1051                + obj.value
1052                + "</div><a href='"
1053                + obj.name
1054                + "' target='_blank' class='adwz'>点击进入网页内容</a><p class='more-dan'>[阅读全文]</p><div class='g-man clearfix' ><span>您对以上回答是否满意?</span><div class='g-man1 left' name='"
1055                + obj.id
1056                + "' url='"
1057                + obj.name
1058                + "' onclick='judge(this)' id='yesDiv' ><span></span>满意</div><div  class='g-man2 left' name='"
1059                + obj.id
1060                + "'url='"
1061                + obj.name
1062                + "' onclick='judge(this)' id='noDiv' ><span></span>不满意</div></div></div></div>"
1063
1064        }
1065    } else {
1066        var cont = "<div class='dialog_tab daan'><div><div class='right_arrow'></div><p>您的问题是:<span>"
1067            + obj.id
1068            + "</span></p><p>我的回答:</p><div class='c_text1' id='c_text'>"
1069            + obj.value
1070            + "</div><div class='g-man clearfix' ><span>您对以上回答是否满意?</span><div class='g-man1 left' name='"
1071            + obj.id
1072            + "' url='"
1073            + obj.name
1074            + "' onclick='judge(this)' id='yesDiv' ><span></span>满意</div><div class='g-man2 left' name='"
1075            + obj.id
1076            + "' url='"
1077            + obj.name
1078            + "' onclick='judge(this)' id='noDiv' ><span></span>不满意</div></div></div></div>"
1079
1080    }
1081    $("#message").append(cont);
1082    var flag = true;
1083    $('.more-dan').click(function () {
1084
1085        if (flag) {
1086            $(this).siblings('.c_text').css({
1087                'overflow': 'visible',
1088                'height': 'auto'
1089            })
1090            $(this).html("[收起]");
1091
1092            flag = false;
1093        } else {
1094            $(this).siblings('.c_text').css({
1095                'overflow': 'hidden',
1096                'height': '134px'
1097            })
1098            $(this).html("[阅读全文]");
1099
1100            flag = true;
1101        }
1102
1103    })
1104    scrollToBottom();
1105
1106}
1107
1108// 返回答案-end
1109function clickmore() {
1110    $('.news-nn li').slice(6, 20).hide();
1111    $('.news-nn li').parent().removeClass("news-nn");
1112
1113    $(".hottags-ul2 li").click(function () {
1114        var hot123 = $(this).html();
1115        $(".onoff").each(function () {
1116            toggleDialog($(this), "off")
1117        })
1118        qaSearch(hot123);
1119
1120    })
1121
1122    $('.more-new').click(function () {
1123        $(".news > li").slideDown(function () {
1124            scrollToBottom();
1125        });
1126        $(this).hide();
1127    })
1128
1129}
1130
1131// 横向tab选项卡
1132function setTab(m, n) {
1133    var tli = document.getElementById("menu" + m).getElementsByTagName("li");
1134    var mli = document.getElementById("main" + m).getElementsByTagName("ul");
1135    for (i = 0; i < tli.length; i++) {
1136        tli[i].className = i == n ? "hover" : "";
1137        mli[i].style.display = i == n ? "block" : "none";
1138    }
1139}
1140
1141// 横向tab选项卡
1142function Tab(a, b) {
1143    var tli = document.getElementById("me" + a).getElementsByTagName("li");
1144    var mli = document.getElementById("ma" + a).getElementsByTagName("ul");
1145    for (i = 0; i < tli.length; i++) {
1146        tli[i].className = i == b ? "hover" : "";
1147        mli[i].style.display = i == b ? "block" : "none";
1148    }
1149}
1150
1151// 获取url中的参数
1152function getUrlParam(name) {
1153    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 构造一个含有目标参数的正则表达式对象
1154    var r = window.location.search.substr(1).match(reg); // 匹配目标参数
1155    if (r != null)
1156        return r[2];
1157    return null; // 返回参数值
1158}
1159
1160var decToHex = function (str) {
1161    var res = [];
1162    for (var i = 0; i < str.length; i++)
1163        res[i] = ("00" + str.charCodeAt(i).toString(16)).slice(-4);
1164    return "\\u" + res.join("\\u");
1165}
1166var hexToDec = function (str) {
1167    str = str.replace(/\\/g, "%");
1168    return unescape(str);
1169}
1170
1171function replaceTemplate(template, obj) {
1172    var out = "";
1173    for (i in obj) {
1174        var reg = new RegExp("\\{" + obj[i].name + "\\}", "g");
1175        template = template.replace(reg, obj[i].value);
1176    }
1177    out = template;
1178    return out;
1179}
1180
1181function showOrHideUl() {
1182    var height = parseInt($("ul.chnl:last").css("height"));
1183    if (height > lmdhHeight) {
1184        $("ul.chnl:last").addClass("hideul");
1185        $("ul.chnl:last").after(
1186            "<div class='showOrHide'>"
1187            + "<a href='#' title='点击显示/隐藏所有栏目导航'>"
1188            // + "<img src='../static/image/chat_close-ca.png'/></a></div>"
1189            + "<img th:src=\"@{{path}/static/blueocean/image/chat_close-ca.png(path=${basePath})}\"/></a></div>"
1190            + "<div style='clear: both;'></div>");
1191    }
1192
1193}
1194
1195//$(function() {
1196//    $('.hottags-ul li').slice(5, 10).hide();
1197//    $('.more-b').click(function() {
1198//        $('.hottags-ul li').slice(5, 10).slideDown(500);
1199//        $('.more-b').hide();
1200//    });
1201//
1202//})
1203// 当前栏目是否在栏目列表,栏目列表使用逗号分隔
1204function isInclude(chnls, curChnl) {
1205    var arrChnls = chnls.split(",");
1206    for (var i = 0; i < arrChnls.length; i++) {
1207        if (curChnl == arrChnls[i]) {
1208            return true;
1209        }
1210    }
1211    return false;
1212}
1213
1214// 问答窗口自适应
1215function wResize(wHeight, wWidth) {
1216    var criticalHeight = 780,
1217        criticalWidth = 1000,
1218        headerHeight = $(".nav-main-new").outerHeight(true);
1219    rightWidth = $(".con-r").outerWidth(true);
1220//    console.log(headerHeight, rightWidth);
1221    if (wHeight - headerHeight- 25 < criticalHeight) {
1222        $(".con-r").height(wHeight - headerHeight - 25 );
1223        $("#message").height(wHeight - headerHeight - 130 - 25);
1224        // $("#message").getNiceScroll().resize();
1225    } else {
1226        $(".con-r").height(criticalHeight);
1227        $("#message").height(criticalHeight - 130);
1228        // $("#message").getNiceScroll().resize();
1229    }
1230    if (wWidth <= criticalWidth) {
1231        $(".con-l").width(wWidth - rightWidth);
1232        $(".b-content").width(wWidth);
1233        // $("#message").getNiceScroll().resize();
1234    } else {
1235        $(".con-l").width(criticalWidth - rightWidth);
1236        $(".b-content").width(criticalWidth);
1237        // $("#message").getNiceScroll().resize();
1238    }
1239}
1240$(window).resize(function () {
1241    // console.log($(this).height(),$(this).width());
1242    wResize($(this).height(), $(this).width());
1243});
1244wResize($(window).height(), $(window).width());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.