PageSourceSearch

https://ynwd.gov.cn/system/resource/js/news/newscontent.js

js ynwd.gov.cn collected 2026-10-03 00:26:33 UTC 17,276 bytes, 499 lines download raw bytes

1/**
2Obtain news content components of the vote
3*/
4var _newscontent_errcode = "";
5var _newscontent_errorcode = "";
6var _newscontent_votebgcolor = "";
7var _newscontent_votetitlestyle = "";
8var _newscontent_votefgcolor = "";
9var _newscontent_qdimg = "";
10var _newscontent_votestyle = "";
11var _newscontent_Welcomevote = "";
12var _newscontent_padding = "";
13var _newscontent_toupiao = "";
14var _newscontent_chakan = "";
15var _newscontent_myform = "";
16var _newscontent_writevote = "";
17var _newscontent_owner = "";
18var _newscontent_ip = "";
19var _newscontent_newsid = "";
20var _newscontent_againvote = "";
21var _newscontent_errvote = "";
22var _newscontent_thinksvote = "";
23var _newscontent_voteresult = "";
24function showVote(pnewsid,powner,pvotebgcolor,pvotetitlestyle,pvotefgcolor,pqdimg,pvotestyle,pWelcomevote,ppadding,ptoupiao,pchakan,pformname,pwritevote,pip,pagainvote,perrvote,pthinksvote,pvoteresult)
25{
26    _newscontent_votebgcolor = pvotebgcolor;
27    _newscontent_votetitlestyle = pvotetitlestyle;
28    _newscontent_votefgcolor = pvotefgcolor;
29    _newscontent_qdimg = pqdimg;
30    _newscontent_votestyle = pvotestyle;
31    _newscontent_Welcomevote = pWelcomevote;
32    _newscontent_padding = ppadding;
33    _newscontent_toupiao = ptoupiao;
34    _newscontent_chakan = pchakan;
35    _newscontent_myform = pformname;
36    _newscontent_writevote = pwritevote;
37    _newscontent_owner = powner;
38    _newscontent_ip = pip;
39    _newscontent_newsid = pnewsid;
40    _newscontent_againvote = pagainvote;
41    _newscontent_errvote = perrvote;
42    _newscontent_thinksvote = pthinksvote;
43    _newscontent_voteresult = pvoteresult;
44    NewsvoteDWR.getVoteTitle(pnewsid,powner,_newscontent_puttitle);
45}
46function _newscontent_puttitle(title)
47{
48    if(title.result == "true")
49    {
50        var vote = "<div  style='border:1px solid #cffcff;_newscontent_padding:4px;background-color:"+_newscontent_votebgcolor+";width:100%'>"
51        vote += "<table width='100%' align='center' " + _newscontent_votetitlestyle + ">";
52        vote += "<div style='_newscontent_padding:5px;border-bottom:1px dashed " + _newscontent_votefgcolor + ";margin:5px 5px 5px 5px;'>" + _newscontent_qdimg + "<span " + _newscontent_votestyle + ">&nbsp;&nbsp;" + _newscontent_Welcomevote + "</span></div>"
53        for(i=0; i<title.titlelist.length;i++)
54        {
55            var type = "radio";
56            var checked = "checked";
57            if(title.radiolist[i]==1)
58            {
59                type = "checkbox";
60                checked = "";
61            }
62            vote += "<tr>";
63            vote += "<td  title='"+title.captionlist[i]+"' colspan=4 height=100% " + _newscontent_votetitlestyle + ">";
64            vote += title.titlelist[i];
65            vote += "</td>";
66            vote += "</tr>";
67            for(j = 0;j< title.option[i].optitlelist.length;j++)
68            {
69                if(j != 0)
70                    checked = "";
71                vote += "<tr>";
72                vote += "<td style='_newscontent_padding-left:" + _newscontent_padding + "px'  title='"+ title.option[i].optitlelist[j]+ "' colspan=4 height=100% " + _newscontent_votetitlestyle + ">";
73                vote += "<input type="+ type +" name='vote"+ type+ title.titleidlist[i] +"' "+ checked +" value="+ title.option[i].opidlist[j] +"> "
74                vote += title.option[i].optitlelist[j];
75                vote += "</td>";
76                vote += "</tr>";
77            }
78        }
79        vote += "<tr>"
80        vote += "<td align='center'>"
81        vote += _newscontent_toupiao;
82        vote += "   "+_newscontent_chakan;
83        vote += "</td>"
84        vote += "</tr>"
85        vote += "</table>";
86        vote += "</div>"
87        document.getElementById("div_vote_id").innerHTML = vote;
88    }
89    else
90    {
91    }
92}
93function _newscontent_getresult(_newscontent_newsid,_newscontent_owner)
94{
95    var hascheck =false;
96    var ischeck = false;
97    for(var i = 0; i < _newscontent_myform.elements.length; i++)
98    {
99        var item = _newscontent_myform.elements[i];
100
101        if(item.tagName == "INPUT"  )
102        {
103            if(item.type.toLowerCase()=="checkbox")
104            {
105                hascheck = true;
106                var checkboxvalues = document.getElementsByName(item.name);
107                for(var j=0;j<checkboxvalues.length; j++)
108                {
109                    if(checkboxvalues[j].checked )
110                    {
111                        ischeck = true;
112                        break;
113                    }
114                }
115            }
116        }
117    }
118    if(!ischeck && hascheck)
119    {
120        alert(_newscontent_writevote);
121        return false;
122    }
123    NewsvoteDWR.isVote(_newscontent_newsid,_newscontent_owner,_newscontent_ip,_newscontent_isvote);
124}
125function _newscontent_isvote(result)
126{
127    if(result)
128    {
129        NewsvoteDWR.getVoteTitle(_newscontent_newsid,_newscontent_owner,_newscontent_setoption);
130    }
131    else
132    {
133        alert(_newscontent_againvote);
134    }
135}
136function _newscontent_lookresult()
137{
138    NewsvoteDWR.getResult(_newscontent_newsid,_newscontent_owner,_newscontent_putresult);
139}
140function _newscontent_setoption(result)
141{
142    for(i=0; i<result.titlelist.length;i++)
143    {
144        if(result.radiolist[i]==0)
145        {
146            NewsvoteDWR.save(result.titleidlist[i],_newscontent_owner,_newscontnent_checkRadioValue("voteradio" + result.titleidlist[i]),_newscontent_ip,_newscontent_seterror);
147        }
148        if(result.radiolist[i]==1)
149        {
150            var item = document.getElementsByName("votecheckbox"+result.titleidlist[i]);
151            for(j = 0;j< result.option[i].optitlelist.length;j++)
152            {
153                if(item[j].checked)
154                NewsvoteDWR.save(result.titleidlist[i],_newscontent_owner,item[j].value,_newscontent_ip,_newscontent_seterror);
155            }
156        }
157    }
158    _newscontent_geterror();
159}
160function _newscontent_seterror(error)
161{
162    if(error=="")
163        _newscontent_errorcode = _newscontent_errvote;
164    _newscontent_errcode = error;
165}
166function _newscontent_geterror()
167{
168    if(_newscontent_errorcode!="")
169        alert(_newscontent_errorcode);
170    else
171        alert(_newscontent_thinksvote);
172    NewsvoteDWR.getResult(_newscontent_newsid,_newscontent_owner,_newscontent_putresult);
173}
174function _newscontent_putresult(title)
175{
176    if(title.result == "true")
177    {
178        var vote = "<div style='border:1px solid #cffcff;_newscontent_padding:4px;background-color:#F9F9F9;width:100%'>"
179        vote += "<table width='100%' align='center' " + _newscontent_votetitlestyle + ">";
180        vote += "<div style='_newscontent_padding:5px;border-bottom:1px dashed #222222;margin:5px 5px 5px 5px;'>" + _newscontent_qdimg + "<span " + _newscontent_votestyle + ">&nbsp;&nbsp;" + _newscontent_voteresult + "</span></div>"
181        for(i=0; i<title.titlelist.length;i++)
182        {
183            vote += "<tr>";
184            vote += "<td  title='"+title.captionlist[i]+"' " + _newscontent_votetitlestyle + ">";
185            vote += title.titlelist[i];
186            vote += "</td>";
187            vote += "</tr>";
188            for(j = 0;j< title.option[i].optitlelist.length;j++)
189            {
190                vote += "<tr>";
191                vote += "<td style='_newscontent_padding-left:" + _newscontent_padding + "px'  title='"+ title.option[i].optitlelist[j]+ "' width='60%' " + _newscontent_votetitlestyle + ">";
192                vote += title.option[i].optitlelist[j];
193                vote += "</td>";
194                vote += "</tr>";
195                vote += "<tr>"
196                vote += "<td>"
197                vote += "<div class='process'>"
198                vote += "<div class='style7' style='width:"+ title.option[i].opnumlist[j] +"'></div></div>"
199                vote += title.option[i].opchecklist[j]+"("+ title.option[i].opnumlist[j] +")";
200                vote += "</td>"
201                vote += "</tr>";
202            }
203        }
204        vote += "</table>";
205        vote += "</div>"
206        document.getElementById("div_vote_id").innerHTML = vote;
207    }
208    else
209    {
210        alert(_newscontent_errvote);
211    }
212}
213
214function _newscontnent_checkRadioValue(keystr)
215{
216    var keyname = keystr;
217    var obj = document.getElementsByName(keyname);
218    
219    var flag = false;
220    var i = 0;
221
222    if(obj == null)
223    {
224        return "";
225    }
226
227    if(obj.length == null)
228    {
229        if(obj.checked)
230        {
231            return obj.value;
232        }
233    }
234    for(i = 0; i < obj.length; i++)
235    {
236        if(obj[i].checked)
237        {
238            return obj[i].value;
239            break;
240        }
241    }
242
243    return "";
244}
245
246function shareto(a,U,T,S,key)  
247{
248    var ec = encodeURIComponent,
249    A = '/system/resource/news/weiboshare.htm';
250    
251   	var C = '?type=' + a + '&url=' + ec(U || document.location) + '&title=' + ec(T) + (S ? '&summary=' + S : '')+(key ? '&appkey=' + key : '');
252   	if(a=='tsohu')
253   	   C = '?type=' + a + '&url=' + ec(U || document.location) + '&title=' + T + (S ? '&summary=' + S : '')+(key ? '&appkey=' + key : '');
254    try 
255    {
256        window.open(A + C, '');
257    } catch (e) 
258    {
259    }
260    return false;
261}
262
263
264function download_news(contentid,treeid,owner,newsid)
265{
266    if(checkobj_content(contentid))
267    {
268        if(confirm('文章含有word中无法显示内容,下载后可能无法正常显示。是否继续下载?'))
269        {
270            location.href='/system/resource/news/newstoword.jsp?treeid='+treeid+'&owner='+owner+'&wbnewsid='+newsid;
271        }
272    }else{
273        location.href='/system/resource/news/newstoword.jsp?treeid='+treeid+'&owner='+owner+'&wbnewsid='+newsid;
274    }
275}
276
277function checkobj_content(contentid)
278{
279   if(getContentTags(contentid))
280   {
281       return true;
282   }
283   return false;
284}
285
286function getContentTags(contentid)
287{
288	var current;
289	var contentNode = document.getElementById(contentid).innerHTML;
290	var regex = /<object|OBJECT|iframe|IFRAME|embed|EMBED[^>/]*>(.*?)<\/object|OBJECT|iframe|IFRAME|embed|EMBED>/i;
291	var groups = regex.exec(contentNode);
292	if(groups){
293		return true;
294	}
295	return false;
296}
297
298function show_vsb_content_tips(buttonObj,conentid)
299{
300    buttonObj.style.display="none";
301    var o=document.getElementById(conentid);
302    o.style.display="";
303}
304//正文中输出mp3播放代码 
305function showVsbAudio(aurl,vheight,vwidth,align,styles,vautoplay)
306{
307	if(aurl=="")
308	{
309	    return;   
310	}
311	var playersrc = "/system/resource/images/ueditor/musicFlash/player_mp3_maxi.swf";
312	var flashvars = "mp3="+aurl+"&showstop=1&showvolume=1&bgcolor1=eeeeee&bgcolor2=a0a0a0";
313	var autoplayStr = "";
314	if(vautoplay=="true")
315	{
316	        autoplayStr = "autoplay = 'true'";
317	        flashvars +="&autoplay=1";
318    }
319	var outputHTML="";
320	outputHTML +='<audio src="'+aurl+'" width="'+vwidth+'" height="'+vheight+'"  '+autoplayStr+' align="'+align+'" style="'+styles+'"  controls="controls"><embed align="'+align+'" style="'+styles+'" width="'+vwidth+'" height="'+vheight+'" src="'+playersrc+'" flashvars="'+flashvars+'" /></audio>';
321	document.write(outputHTML);
322}
323
324/**
325 * 正文中显示PDF
326 * @param path
327 * @param width
328 * @param heigth
329 * @param imagenum
330 * @param style
331 * @param imagedata
332 */
333function showVsbpdfIframe(path,width,heigth,imagenum,style,imagedata){
334    if(path=="")
335    {
336        return;
337    }
338
339    var outputHTML="";
340
341    //判断浏览器版本
342    if(isSupportPddfjs()){
343        //pdfjs
344        outputHTML = "<iframe src=\"/system/resource/pdfjs/viewer.html?file="+encodeURIComponent(path)+"\" width=\""+width+"\" height=\""+heigth+"\" style='"+style+"'></iframe>";
345    }else{
346        //图片
347        if(imagedata && imagedata.length >0){
348            var imageStr = "";
349            imageStr = "<div style='"+style+";overflow-y: auto;overflow-x:hidden;text-indent: 0;width: "+(width.indexOf("%") != -1?width:width+"px")+";height: "+(heigth.indexOf("%") != -1?heigth:heigth+"px")+"; '>";
350            for(var i=0;i<imagedata.length ;i++){
351                var tmpimgpath = imagedata[i];
352                imageStr += "<img src='"+tmpimgpath+"' width='100%' class='img_vsb_content'>";
353                imageStr += "<div style=\"height:32px;line-height:32px;font-size:14px; width:100%;background-color:#3D3D3D;text-align:center;color:#ececec;\">第 "+(i+1)+" 页</div>";
354            }
355            imageStr += "</div>";
356            outputHTML = imageStr;
357        }else{
358            outputHTML = "<iframe src=\""+path+"\" width=\""+width+"\" height=\""+heigth+"\" style='"+style+"'></iframe>";
359        }
360    }
361    document.write(outputHTML);
362}
363
364/**
365 * 判断浏览器是否支持pdf.js
366 * @returns {boolean}
367 */
368function isSupportPddfjs(){
369    var agent = navigator.userAgent.toLowerCase();
370    var isIe = /(msie\s|trident.*rv:)([\w.]+)/.test(agent);
371    if(isIe){
372        return false;
373    }
374
375    var safari;
376    if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(agent) && !/chrome/i.test(agent)){
377        safari = + (RegExp['\x241'] || RegExp['\x242']);
378    }
379
380    if(safari && safari < 11){
381        return false;
382    }
383
384    var mobile = agent.match(/applewebkit.*mobile.*/);
385    if(mobile){
386        return false;
387    }
388
389    return true;
390}
391
392
393function content_frame_load(contentid,doc,iframe){
394    var iframeHeight  = doc.documentElement.scrollHeight;
395    iframe.style.height = iframeHeight + 'px';
396    var divElement = document.getElementById(contentid);
397    if(divElement.remove){
398        divElement.remove();
399    }else{
400        divElement.parentNode.removeChild(divElement);
401    }
402}
403
404/**
405 * 加载正文内容到iframe
406 * @param contentid 内容部分容器id
407 * @param csslink 一键排版样式css
408 * @param customstyle 自定义样式
409 */
410function loadContent2Frame(contentid,csslink,customstyle){
411    try{
412        var contentdiv = document.getElementById(contentid);
413        if(!contentdiv){
414            return;
415        }
416        var myFrame = document.createElement('iframe');
417        myFrame.style.width="100%";
418        myFrame.style.height="0px";
419        myFrame.style.border = "none";
420        //对象插入
421        contentdiv.parentNode.insertBefore(myFrame,contentdiv)
422
423        var doc = myFrame.contentWindow.document||myFrame.document||myFrame.contentDocument;
424        if(myFrame.attachEvent){
425            myFrame.attachEvent("onload", function(){
426                content_frame_load(contentid,doc,myFrame);
427            });
428        }else{
429            myFrame.addEventListener("load",function(){
430                content_frame_load(contentid,doc,myFrame);
431            },false);
432        }
433        doc.open();
434        //加载一键排版样式
435        doc.write("<link rel=\"stylesheet\" content-type=\"text/css\" href=\""+csslink+"\">");
436        if(customstyle.length > 0){
437            //加载自定义样式
438            doc.write("<style>new ContentBase64().decode(customstyle)</style>");
439        }
440        //写入内容
441        doc.write(contentdiv.outerHTML);
442        doc.close();
443    }catch (e){
444        console.log(e)
445    }
446}
447function ContentBase64() {
448    // private property
449    var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
450    // public method for decoding
451    this.decode = function (input) {
452        var output = "";
453        var chr1, chr2, chr3;
454        var enc1, enc2, enc3, enc4;
455        var i = 0;
456        input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
457        while (i < input.length) {
458            enc1 = _keyStr.indexOf(input.charAt(i++));
459            enc2 = _keyStr.indexOf(input.charAt(i++));
460            enc3 = _keyStr.indexOf(input.charAt(i++));
461            enc4 = _keyStr.indexOf(input.charAt(i++));
462            chr1 = (enc1 << 2) | (enc2 >> 4);
463            chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
464            chr3 = ((enc3 & 3) << 6) | enc4;
465            output = output + String.fromCharCode(chr1);
466            if (enc3 != 64) {
467                output = output + String.fromCharCode(chr2);
468            }
469            if (enc4 != 64) {
470                output = output + String.fromCharCode(chr3);
471            }
472        }
473        output = _utf8_decode(output);
474        return output;
475    }
476    // private method for UTF-8 decoding
477    _utf8_decode = function (utftext) {
478        var string = "";
479        var i = 0;
480        var c = c1 = c2 = 0;
481        while ( i < utftext.length ) {
482            c = utftext.charCodeAt(i);
483            if (c < 128) {
484                string += String.fromCharCode(c);
485                i++;
486            } else if((c > 191) && (c < 224)) {
487                c2 = utftext.charCodeAt(i+1);
488                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
489                i += 2;
490            } else {
491                c2 = utftext.charCodeAt(i+1);
492                c3 = utftext.charCodeAt(i+2);
493                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
494                i += 3;
495            }
496        }
497        return string;
498    }
499}

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.