1// JavaScript Document 2(function () { 3 window.ajaxUtil = { 4 getSync: function (url, success, error) { 5 var req = null; 6 if (window.XMLHttpRequest) { 7 req = new XMLHttpRequest(); 8 } else if (window.ActiveXObject) { 9 req = new ActiveXObject("Microsoft.XMLHTTP"); 10 } 11 if (!req) { 12 if (error) { 13 error('ä¸è½ä½¿ç¨ajax'); 14 } 15 return; 16 } 17 req.onreadystatechange = function () { 18 if (req.readyState == 4 && req.status == 200) { 19 if (success) { 20 success(req.responseText); 21 } 22 } 23 }; 24 25 req.open("GET", url, true); 26 req.send(); 27 } 28 } 29})() 30 31 32 33$(function () { 34 $(".rule-single-select").ruleSingleSelect(); 35 var mydate = new Date(); 36 var thisyear = mydate.getFullYear(); 37 var thismonth = mydate.getMonth() + 1; 38 var thisday = mydate.getDate(); 39 //æ¥æåå§å¡«å 40 function initdata() { 41 var days = getdaysinonemonth(thisyear, thismonth); //è¿ä¸ªæçå¤©æ° 42 var preDays = getdaysinonemonth(thisyear, thismonth - 1); //ä¸ä¸ªæçå¤©æ° 43 var weekday = getfirstday(thisyear, thismonth); //第ä¸å¤©ææå 44 if (weekday == 0) { 45 weekday = 7; 46 } 47 $('.month_name').text(thismonth + 'æä»½'); 48 $('.year_name').text(thisyear); 49 //è¿ä¸ªæç天æ°ï¼ç¬¬ä¸å¤©ææå ï¼ä¸ä¸ªæç天æ°ï¼å½å¤©ï¼å½å¹´ï¼å½æ 50 setcalender(days, weekday, preDays, thisday, thisyear, thismonth); 51 } 52 initdata(); 53 //ç¹å»ä¸ä¸ªæ 54 $('.month .prev').click(function (e) { 55 if (thisyear == 2023 && thismonth == 1) { 56 return false; 57 } else { 58 thismonth--; 59 if (thismonth == 0) { 60 thismonth = 12; 61 thisyear--; 62 } 63 initdata(); 64 } 65 }); 66 //ç¹å»ä¸ä¸ªæ 67 $('.month .next').click(function (e) { 68 thismonth++; 69 if (thismonth == 13) { 70 thismonth = 1; 71 thisyear++; 72 } 73 initdata(); 74 }); 75 //ç¹å»å»å¹´ 76 $('.year .prev').click(function (e) { 77 if (thisyear == 2023) { 78 return false; 79 } else { 80 thisyear--; 81 initdata(); 82 } 83 }); 84 //ç¹å»æå¹´ 85 $('.year .next').click(function (e) { 86 thisyear++; 87 initdata(); 88 }); 89 90 function jjr(jqdate, arg) { 91 $.ajax('http://api.goseek.cn/Tools/holiday?date=' + jqdate, { 92 dataType: 'json',//æå¡å¨è¿åjsonæ ¼å¼æ°æ® 93 type: 'get',//HTTP请æ±ç±»å 94 success: function (reul) { 95 if (reul.data == 1) { 96 $(arg).addClass('jq'); 97 $(arg).append('<br/><sapn class="xiu">ä¼</sapn>'); 98 } 99 }, 100 error: function (xhr, type, errorThrown) { 101 102 } 103 }); 104 } 105 function rqgs(arg) { 106 arg = Number(arg); 107 if (arg < 10) { 108 return "0" + arg; 109 } else { 110 return "" + arg; 111 } 112 } 113 //å¡«å æ¥æè¡¨æ ¼ 114 function setcalender(days, weekday, preDays, thisday, thisyear, thismonth) {//è¿ä¸ªæç天æ°ï¼ç¬¬ä¸å¤©ææå ï¼ä¸ä¸ªæç天æ°ï¼å½å¤©ï¼å½å¹´ï¼å½æ 115 var a = 1; 116 var b = 1; 117 var c = preDays - weekday + 1; 118 var trNum = days + weekday - 1; 119 120 if (trNum < 27) { 121 $('.calendar table tbody tr:eq(4),.calendar table tbody tr:eq(5)').hide(); 122 } else if (trNum > 35) { 123 $('.calendar table tbody tr').show(); 124 } else { 125 $('.calendar table tbody tr:eq(5)').hide(); 126 127 } 128 //转æ¢å¹´ææ¥ä¸ºå符串 129 thisyear = thisyear.toString(); 130 if (thismonth < 10) { 131 thismonth = "0" + thismonth.toString(); 132 } 133 for (var j = 0; j < 6; j++) { 134 for (var i = 0; i < 7; i++) { 135 if (j == 0 && i < weekday - 1) { 136 //第ä¸è¡ä¸ä¸ªæç 137 c++; 138 $(".data_table tbody tr").eq(0).find("td").eq(i).html(' '); 139 140 //jjr(thisyear+rqgs(thismonth-1)+rqgs(c),$(".data_table tbody tr").eq(0).find("td").eq(i)); 141 142 $(".data_table tbody tr").eq(0).find("td").eq(i).addClass("unselected_month preM"); 143 } else { 144 //è¿ä¸ªæçå 容 145 if (a > days) { 146 //ä¸ä¸ªæå ç°å¤ç 147 $(".data_table tbody tr").eq(j).find("td").eq(i).html(' '); 148 149 //jjr(thisyear+rqgs(parseInt(thismonth)+1)+rqgs(b),$(".data_table tbody tr").eq(j).find("td").eq(i)); 150 151 $(".data_table tbody tr").eq(j).find("td").eq(i).addClass("unselected_month nextM"); 152 b++; 153 154 } else { 155 //妿æ¯10å·ä»¥åçå 0 156 if (a < 10) { 157 a = "0" + a.toString(); 158 } 159 //æ·»å è¡¨æ ¼æ¥æå 容 160 var thisValue = thisyear + thismonth + a; 161 $(".data_table tbody tr").eq(j).find("td").eq(i).html("<div class='riqi'>" + a + "<div class='piaofu'><ul></ul><span></span></div>").attr('value', thisValue); 162 //jjr(thisyear+rqgs(thismonth)+rqgs(a),$(".data_table tbody tr").eq(j).find("td").eq(i).find('.riqi')); 163 164 $(".data_table tbody tr").eq(j).find("td").eq(i).addClass('usual_day').removeClass("unselected_month preM nextM"); 165 166 if (a == thisday && thismonth == mydate.getMonth() + 1 && thisyear == mydate.getFullYear()) {//ä»å¤© 167 $(".data_table tbody tr").eq(j).find("td").eq(i).find(".riqi").addClass("bghover"); 168 } 169 170 a++; 171 } 172 } 173 } 174 } 175 176 //var ajaxUrl = "http://www.sc.gov.cn/sousou/LeaderCalendar/LeaderCalendarByKp.ashx?year=" + thisyear + "&month=" + thismonth; 177 // var ajaxUrl = "../data/_year" + thisyear + "_month" + thismonth+'.shtml';
178 var channelIds = '1962759177267957760'; 179 var ajaxUrl = '/u/search/list/calendarManuscript?websiteId='+ websiteId +'&channelId='+ channelIds +'&pageSize=500&year=' + thisyear + '&month=' + thismonth; 180 //e3853c4820194f6896eee6efd2d52ad5 181 ajaxUtil.getSync(ajaxUrl, function (jsonText) { 182 var json = JSON.parse(jsonText); 183 var json1 = json.data; 184 if (json1) { 185 for (var j = 0; j < 6; j++) { 186 for (var i = 0; i < 7; i++) { 187 var thisValue = $(".data_table tbody tr").eq(j).find("td").eq(i).attr('value'); 188 for (k = 0; k < json1.length; k++) { 189 // var SUB_TITLE = json1[k].ldhdri.split('-').join(''); 190 var SUB_TITLE = json1[k].publishedTime; 191 var URL = json1[k].url; 192 var TITLE = json1[k].title; 193 var titleB = TITLE.replace(/<br\>/g, ""); 194 var titleC = titleB.replace(/\?/g, ""); 195 //var titleC=titleB.replace(titleB.indexOf('?',index),""); 196 if (thisValue == SUB_TITLE) { 197 $(".data_table tbody tr").eq(j).find("td").eq(i).find('.riqi .piaofu ul').append("<li><a href='" + URL + "' target='_blank'>" + titleC + "</a></li>"); 198 } 199 } 200 } 201 } 202 } 203 204 $(".data_table tbody tr:odd td").css('background', '#dddddd'); 205 $(".data_table tbody tr td .riqi").has('.piaofu ul li').addClass('has-content'); 206 }) 207 208 } 209 //ç®æä¸ªæçæ»å¤©æ° 210 function getdaysinonemonth(year, month) { 211 month = parseInt(month, 10); 212 var d = new Date(year, month, 0); 213 return d.getDate(); 214 } 215 //ç®æä¸ªæç第ä¸å¤©æ¯ææå 216 function getfirstday(year, month) { 217 month = month - 1; 218 var d = new Date(year, month, 1); 219 return d.getDay(); 220 } 221 //é¼ æ æ»è¿æ¥æ 222 $(".data_table tr td").mouseover(function (e) { 223 $('.data_table tr td .riqi').removeClass('current bgHover'); 224 $(this).find('.riqi').addClass('bgHover'); 225 $(this).find('.riqi').has('.piaofu ul li').addClass('current'); 226 }); 227 //é¼ æ ç¦»å¼æ¥æ 228 $(".data_table").mouseleave(function (e) { 229 $('.data_table tr td .riqi').removeClass('current bgHover'); 230 }); 231 $("#activeYear").change(function () { 232 var ckVal = $(this).val(); 233 if (ckVal > 0) { 234 $(".active-box .active-list ul").css("display", "none"); 235 $(".active-box .active-list").css("display", "block"); 236 $("#list-" + ckVal).css("display", "block"); 237 } else { 238 $(".active-box .active-list ul").css("display", "none"); 239 $(".active-box .active-list").css("display", "none"); 240 } 241 }) 242 //é¼ æ æ»è¿æ´»å¨é年份 243 $(".active-box .rule-single-select").mouseover(function (e) { 244 var ckVal = $("#activeYear").val(); 245 if (ckVal > 0) { 246 $(".active-box .active-list ul").css("display", "none"); 247 $(".active-box .active-list").css("display", "block"); 248 $("#list-" + ckVal).css("display", "block"); 249 } else { 250 $(".active-box .active-list ul").css("display", "none"); 251 $(".active-box .active-list").css("display", "none"); 252 } 253 }); 254 //é¼ æ ç¦»å¼æ´»å¨é年份 255 $(".active-box .active-list,.active-box").mouseleave(function (e) { 256 $(".active-box .active-list ul").css("display", "none"); 257 $(".active-box .active-list").css("display", "none"); 258 }); 259}) 260$.fn.ruleSingleSelect = function () { 261 var singleSelect = function (parentObj) { 262 parentObj.addClass("single-select"); //æ·»å æ ·å¼ 263 parentObj.children().hide(); //éèå 容 264 var divObj = $('<div class="boxwrap"></div>').prependTo(parentObj); //åæå ¥ä¸ä¸ªDIV 265 //å建å ç´ 266 var titObj = $('<a class="select-tit"><hr /><span></span><i></i></a>').appendTo(divObj); 267 var itemObj = $('<div class="select-items"><ul></ul></div>').appendTo(divObj); 268 var arrowObj = $('<i class="arrow"></i>').appendTo(divObj); 269 var selectObj = parentObj.find("select").eq(0); //åå¾select对象 270 //éåoptioné项 271 selectObj.find("option").each(function (i) { 272 var indexNum = selectObj.find("option").index(this); //å½åç´¢å¼ 273 var liObj = $('<li>' + $(this).text() + '</li>').appendTo(itemObj.find("ul")); //å建LI 274 if ($(this).prop("selected") == true) { 275 liObj.addClass("selected"); 276 titObj.find("span").text($(this).text()); 277 } 278 //æ£æ¥æ§ä»¶æ¯å¦å¯ç¨ 279 if ($(this).prop("disabled") == true) { 280 liObj.css("cursor", "default"); 281 return; 282 } 283 //ç»å®äºä»¶ 284 liObj.click(function () { 285 $(this).siblings().removeClass("selected"); 286 $(this).addClass("selected"); //æ·»å é䏿 ·å¼ 287 selectObj.find("option").prop("selected", false); 288 selectObj.find("option").eq(indexNum).prop("selected", true); //èµå¼ç»å¯¹åºçoption 289 titObj.find("span").text($(this).text()); //èµå¼éä¸å¼ 290 arrowObj.hide(); 291 itemObj.hide(); //éèä¸ææ¡ 292 selectObj.trigger("change"); //触åselectçonchangeäºä»¶ 293 //alert(selectObj.find("option:selected").text()); 294 }); 295 }); 296 //è®¾ç½®æ ·å¼ 297 //titObj.css({ "width": titObj.innerWidth(), "overflow": "hidden" }); 298 //itemObj.children("ul").css({ "max-height": $(document).height() - titObj.offset().top - 62 }); 299 300 //æ£æ¥æ§ä»¶æ¯å¦å¯ç¨ 301 if (selectObj.prop("disabled") == true) { 302 titObj.css("cursor", "default"); 303 return; 304 } 305 //ç»å®åå»äºä»¶ 306 titObj.click(function (e) { 307 e.stopPropagation(); 308 if (itemObj.is(":hidden")) { 309 //éèå ¶å®çä¸ä½æ¡èå 310 $(".single-select .select-items").hide(); 311 $(".single-select .arrow").hide(); 312 //ä½äºå ¶å®æ ç´ çä¸é¢ 313 arrowObj.css("z-index", "1"); 314 itemObj.css("z-index", "1"); 315 //æ¾ç¤ºä¸ææ¡ 316 arrowObj.show(); 317 itemObj.show(); 318 } else { 319 //ä½äºå ¶å®æ ç´ çä¸é¢ 320 arrowObj.css("z-index", ""); 321 itemObj.css("z-index", ""); 322 //éèä¸ææ¡ 323 arrowObj.hide(); 324 itemObj.hide(); 325 } 326 }); 327 //ç»å®é¡µé¢ç¹å»äºä»¶ 328 $(document).click(function (e) { 329 selectObj.trigger("blur"); //触åselectçonblureäºä»¶ 330 arrowObj.hide(); 331 itemObj.hide(); //éèä¸ææ¡ 332 }); 333 }; 334 return $(this).each(function () { 335 singleSelect($(this)); 336 }); 337}
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.