PageSourceSearch

https://www.ctsscs.com/js/common.js

js ctsscs.com collected 2026-10-02 20:25:00 UTC 11,302 bytes, 259 lines download raw bytes

1var votetype, rlogin = 0, voteobj, votea = ['citydxq', 'citydqg', 'cityxq', 'cityqg', 'travelstj', 'travelstj2', 'travels', 'travels2', 'visa'];
2var editor = new Array();
3//添加编辑器
4function AddEditor(id, tool, RanNum) {
5    //$.include([webpath + 'sys/webedit/ueditor.config.js', webpath + 'sys/webedit/ueditor.all.js']);
6    var config = {
7        imageUrl: webpath + "sys/ajax/editorImageUp.ashx?r=" + RanNum,     //图片上传地址
8        imagePath: upfolder,                                   //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
9        scrawlUrl: webpath + "sys/ajax/editorScrawlImgUp.ashx?r=" + RanNum, //涂鸦上传地址
10        scrawlPath: upfolder,                                          //图片修正地址,同imagePath
11        catcherUrl: webpath + "sys/ajax/editorGetRemoteImage.ashx?r=" + RanNum, //处理远程图片抓取的地址
12        catcherPath: upfolder,                         //图片修正地址,同imagePath
13        snapscreenHost: 'ueditor.baidu.com',                            //屏幕截图的server端文件所在的网站地址或者ip,请不要加http://
14        snapscreenServerUrl: webpath + "sys/ajax/editorImageUp.ashx?r=" + RanNum, //屏幕截图的server端保存程序,UEditor的范例代码为“URL +"server/upload/net/snapImgUp.ashx"”
15        snapscreenPath: upfolder,
16
17        wordImageUrl: webpath + "sys/ajax/editorImageUp.ashx?r=" + RanNum, //word转存提交地址
18        wordImagePath: upfolder, //
19        getMovieUrl: webpath + "sys/ajax/editorGetMovie.ashx",    //视频数据获取地址
20        initialFrameWidth: '100%',
21        focus: false,
22        toolbars: [
23                ['fullscreen', 'source', '|', 'undo', 'redo', '|',
24                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
25                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
26                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
27                    'directionalityltr', 'directionalityrtl', 'indent', '|',
28                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
29                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
30                    'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
31                    'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
32                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', '|',
33                    'print', 'preview', 'searchreplace', 'help']
34            ]
35    };
36    if (!tool) tool = 'full';
37    if (tool == 'simple') {
38        config.toolbars[0] = [ 'source', '|', 'undo', 'redo', '|',
39            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
40            'rowspacingtop', 'rowspacingbottom', 'lineheight'];
41    } else if (tool != 'full') {
42        config.toolbars[0] = $.map(config.toolbars[0], function (n) {
43            return n != 'pagebreak' ? n : null;
44        });
45    }
46    editor[id] = UE.getEditor(id, config);
47}
48
49$(document).ready(function () {
50    mySearch();
51    $('img[data-original]').lazyload({ threshold: 100 }); //图片延时加载
52    $('.headSearch .sInput').focus(function () { //头部搜索
53        $('.headSearch .defaultKey').hide();
54    }).blur(function () {
55        if (!$.trim($(this).val())) {
56            $('.headSearch .defaultKey').show();
57            $(this).val('');
58        }
59    });
60    $(".drop").hover(function () {//头部下拉
61        $(this).find('.dropDown').show();
62        $(this).addClass('hover');
63
64    }, function () {
65        $(this).find('.dropDown').hide();
66        $(this).removeClass('hover');
67    });
68
69    $('#loginout').click(function () {
70        $.get(webpath + 'sys/ajax/login.ashx', { act: "out" }, function () {
71            checklogin(); getvote();
72        });
73    });
74    $('#login').click(function () {
75        rlogin = 2;
76        ShowWindow('', 'alertlogin', webpath + 'alertlogin.aspx');
77    });
78    $('#logins').click(function () {
79        rlogin = 2;
80        ShowWindow('', 'alertlogin', webpath + 'alertlogin.aspx');
81    });
82    checklogin();
83    voteobj = $('[id^="citydxq_"],[id^="citydqg_"],[id^="cityxq_"],[id^="cityqg_"],[id^="travelstj_"],[id^="travels_"],[id^="travelstj2_"],[id^="travels2_"],[id^="visa_"]');
84    if (voteobj.length > 0) {
85        voteobj.click(function () {
86            rlogin = 1;
87            var id = $(this).attr('id').split('_');
88            if ($(this).attr('status') == 1) {
89                if (id[0] == 'visa') {
90                    alert('您已经收藏过!');
91                }
92                return;
93            }
94            if ((id[0] != 'travelstj' && id[0] != 'travelstj2') && GetCookie('username') == '') {
95                votetype = $(this);
96                rlogin = 0;
97                ShowWindow('', 'alertlogin', webpath + 'alertlogin.aspx'); return;
98            }
99            favorites(
100				id[0],
101				id[1],
102				function () {
103				    if (arguments[0] == 'true') {
104				        if (id[0] == "citydxq" || id[0] == "citydqg") {
105				            $('#' + id[0] + '_' + id[1]).removeClass('cur').addClass('cur');
106				        } else {
107				            $('#' + id[0] + '_' + id[1]).removeClass('voteyes').addClass('voteno');
108				        }
109				        $('#' + id[0] + 'text_' + id[1]).text((parseInt($('#' + id[0] + 'text_' + id[1]).text()) + 1));
110				        if (id[0] == 'visa') {
111				            alert('恭喜您收藏成功!');
112				        }
113				    }
114				});
115        });
116        getvote();
117    }
118});
119
120//会员中心左侧
121$(".userNavTit1").click(function () { 
122    if ($(this).find('div').hasClass("mores")) {
123        $(".curUNav").addClass("mores");
124        $(".more").removeClass("curUNav");
125        $(this).find('div').removeClass('mores').addClass("curUNav");
126    } else {
127        if ($(this).find('div').hasClass("curUNav")) {
128            return;
129        }
130
131        $(this).find('div').addClass('mores');
132    }
133    $('.userNavText').hide();
134    $(this).next('.userNavText').slideToggle("slow");
135});
136
137
138//头部搜索切换
139function mySearch() {
140    $('#optChange').hover(
141		function () {
142		    $(this).find('dl').show();
143		    $(this).addClass('hover');
144		},
145		function () {
146		    $(this).find('dl').hide();
147		    $(this).removeClass('hover');
148		}
149	);
150
151    $('#optChange dd').hover(
152		function () { $(this).addClass('cur'); },
153		function () { $(this).removeClass('cur'); }
154	).click(
155		function () {
156		    $('.optionCur').html($(this).attr('text'));
157		    $('#defaultKey').text($(this).attr('defaultkey'));
158		    $('#optChange').removeClass('hover').find('dl').hide();
159		    $('#searchform').attr('action', $(this).attr('url'));
160		    if (!$.trim($('#s_input').val())) {
161		        $('#defaultKey').show();
162		        $('#s_input').val('');
163		    }
164		}
165	).first().click();
166}
167
168
169/*弹出登陆回调*/
170function AlertLoginReturn() {
171    checklogin();
172    HideWindow();
173    if (rlogin == 0) {
174        votetype.click();
175    } else if (rlogin == 1) {
176        getvote();
177    }
178}
179
180/*检测登陆*/
181function checklogin() {
182    if (GetCookie('username') == '') {
183        $('#logined').hide();
184        $('#unlogin').show();
185    } else {
186        $('#unlogin').hide();
187        $('#logined_name').text(GetCookie('realname') == '' ? GetCookie('username') : GetCookie('realname'));
188        $('#logined').show();
189        $.ajax({
190            type: "GET",
191            url: webpath + 'sys/Ajax/GetUserInfoCount.ashx',
192            cache: false,
193            dataType: "json",
194            success: function (json) {
195                if (json.CountSMS > 0) {
196                    if ($(".sitemsg").length > 0) {
197                        $('.sitemsg').html('站内信:<a href="' + json.url + '" >未读(' + json.CountSMS + ')</a>');
198                    } else {
199                        $('#logined').append('<span class="sitemsg">站内信:<a href="' + json.url + '" >未读(' + json.CountSMS + ')</a></span>');
200                    }
201                }
202            }
203        });
204    }
205}
206//投票与收藏
207function getvote() {
208    if (voteobj.length == 0) return;
209    var url = webpath + 'sys/ajax/getvote.ashx?t=', adid = '', f, f1 = '';
210    for (var i = 0; i < votea.length; i++) {
211        f = voteobj.filter('[id^="' + votea[i] + '_"]');
212        if (f.length != 0) {
213            url += votea[i] + ',';
214            f1 += '&' + votea[i] + 'id=';
215            f.each(function () {
216                f1 += $(this).attr('id').replace(votea[i] + '_', '') + ',';
217            });
218            f1 = f1.substring(0, f1.length - 1);
219        }
220    }
221    url = url.substring(0, url.length - 1) + f1 + '&callback=?';
222    $.getJSON(url,
223		 function (json) {
224		     for (var i = 0; i < json.length; i++) {
225		         for (var j = 0; j < json[i].item.length; j++) {
226		             var t = json[i].item[j];
227		             $('#' + json[i].type + 'text_' + t.adid).text(t.votes);
228		             $('#' + json[i].type + '_' + t.adid).attr('status', t.status);
229		             if (t.status == 1) {
230		                 if (json[i].type == "citydxq" || json[i].type == "citydqg") {
231		                     $('#' + json[i].type + '_' + t.adid).addClass('cur');
232		                     $('#' + json[i].type + 'text_' + t.adid).text(t.votes);
233		                 } else {
234		                     $('#' + json[i].type + '_' + t.adid).removeClass('voteyes').addClass('voteno');
235		                     $('#' + json[i].type + 'text_' + t.adid).text(t.votes);
236		                 }
237		             } else {
238		                 if (json[i].type == "citydxq" || json[i].type == "citydqg") {
239		                     $('#' + json[i].type + '_' + t.adid).removeClass('cur');
240		                     $('#' + json[i].type + 'text_' + t.adid).text(t.votes);
241
242
243		                 } else {
244		                     $('#' + json[i].type + '_' + t.adid).removeClass('voteno').addClass('voteyes');
245
246		                     $('#' + json[i].type + 'text_' + t.adid).text(t.votes);
247		                 }
248		             }
249		         }
250		     }
251		     $('[id^="cityxq_"]').each(function () {
252		         var adid = $(this).attr('id').split('_')[1];
253		         if (parseInt($('#cityxqtext_' + adid).text()) + parseInt($('#cityxqtext_' + adid).text()) < 10) {
254		             $('#cityvotelevel_' + adid).removeClass().addClass('s3');
255		         }
256		     });
257		 }
258	);
259};

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.