1// Cal3.4.0 / 2012-10-22 2// SYNCK GRAPHICA 3// charset shift_jis 4 5var jsCalendar = function(target) { 6 this. targetClass = (target) ? target : 'cal'; 7 this. daysClass = []; 8 this. week = []; 9 this. month = []; 10 this. xDays = []; 11 this. xDaysLater = []; 12 this. calObj = new Array(); 13 this. calObj[0] = { 14 defaultMonth : 0, 15 daysClass : {}, 16 xDays : {}, 17 week : {}, 18 xDaysLater : {}, 19 month : {}, 20 backward : 'backward', 21 priority : [ 'month', 'week', 'xDay', 'xDaysLater', 'day', 'backward' ] 22 }; 23 this.wEnName = ["sun","mon","tue","wed","thu","fri","sat"]; 24 25 this.preload = function() 26 { 27 this.calLength = ( typeof calLength !== 'undefined' && !isNaN( calLength ) && calLength > 0 ) ? calLength : 12; 28 this.yearMonthInTable = ( typeof yearMonthInTable !== 'undefined' ) ? yearMonthInTable : false; 29 this.calCellSpacing = ( typeof calCellSpacing !== 'undefined' ) ? calCellSpacing : 0; 30 this.calShowPrevMonth = ( typeof calShowPrevMonth !== 'undefined' ) ? calShowPrevMonth : false; 31 this.calShowNextMonth = ( typeof calShowNextMonth !== 'undefined' ) ? calShowNextMonth : false; 32 this.calWeekLine = ( typeof calWeekLine !== 'undefined' ) ? calWeekLine : null; 33 this.minYear = ( typeof calMinYear !== 'undefined' ) ? calMinYear : 0; 34 this.maxYear = ( typeof calMaxYear !== 'undefined' ) ? calMaxYear : 0; 35 this.minMonth = ( typeof calMinMonth !== 'undefined' ) ? calMinMonth : 1; 36 this.maxMonth = ( typeof calMaxMonth !== 'undefined' ) ? calMaxMonth : 1; 37 this.weekImgDirectory = ( typeof weekImgDirectory !== 'undefined' ) ? weekImgDirectory : '/site/img/'; 38 this.useYearImage = ( typeof useYearImage !== 'undefined' ) ? !!useYearImage : true; 39 this.yImgEx = ( typeof yImgEx !== 'undefined' ) ? yImgEx : '.gif'; 40 this.useMonthImage = ( typeof useMonthImage !== 'undefined' ) ? !!useMonthImage : false; 41 this.mImgEx = ( typeof mImgEx !== 'undefined' ) ? mImgEx : '.gif'; 42 this.yearLabel = ( typeof yearLabel !== 'undefined' ) ? yearLabel : 'N'; 43 this.notationOfMonth = ( typeof notationOfMonth !== 'undefined' ) ? notationOfMonth : ['','1','2','3','4','5','6','7','8','9','10','11','12']; 44 this.notationOfWeek = ( typeof notationOfWeek !== 'undefined' ) ? notationOfWeek : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']; 45 this.useWeekImage = ( typeof useWeekImage !== 'undefined' ) ? useWeekImage : false; 46 this.wImgEx = ( typeof wImgEx !== 'undefined' ) ? wImgEx : '.gif'; 47 this.weekLabel = ( typeof weekLabel !== 'undefined' ) ? weekLabel : ''; 48////////// daysClassÉεÄîñÌÇÁ 49 if ( typeof ____daysClass !== 'undefined' ) // list.js©çÌÄÑoµf[^ 50 for ( i=0; i<____daysClass.length; i++ ) 51 this.daysClass.push( ____daysClass[i] ); 52 if ( typeof calDaysClass !== 'undefined' ) // _ÌÄÑoµf[^ 53 for ( i=0; i<calDaysClass.length; i++ ) 54 this.daysClass.push( calDaysClass[i] ); 55////////// weekÉεÄîñÌÇÁ 56 if ( typeof ____week !== 'undefined' ) // list.js©çÌÄÑoµf[^ 57 for ( i=0; i<____week.length; i++ ) 58 this.week.push( ____week[i] ); 59 if ( typeof calWeeksClass !== 'undefined' ) // _ÌÄÑoµf[^ 60 for ( i=0; i<calWeeksClass.length; i++ ){ 61 this.week[ calWeeksClass[i][0] ][1] = this.week[ calWeeksClass[i][0] ][1] + " " + calWeeksClass[i][1]; 62 }
63////////// monthÉεÄîñÌÇÁ 64 if ( typeof ____month !== 'undefined' ) // list.js©çÌÄÑoµf[^ 65 for ( i=0; i<____month.length; i++ ) 66 this.month.push( ____month[i] ); 67 if ( typeof calMonthsClass !== 'undefined' ) // _ÌÄÑoµf[^ 68 for ( i=0; i<calMonthsClass.length; i++ ) 69 this.month.push( calMonthsClass[i] ); 70////////// xDaysÉεÄîñÌÇÁ 71 if ( typeof ____xDays !== 'undefined' ) // list.js©çÌÄÑoµf[^ 72 for ( i=0; i<____xDays.length; i++ ) 73 this.xDays.push( ____xDays[i] ); 74 if ( typeof calXDaysClass !== 'undefined' ) // _ÌÄÑoµf[^ 75 for ( i=0; i<calXDaysClass.length; i++ ) 76 this.xDays.push( calXDaysClass[i] ); 77////////// xDaysLaterÉεÄîñÌÇÁ 78 if ( typeof ____xDaysLater !== 'undefined' ) // list.js©çÌÄÑoµf[^ 79 for ( i=0; i<____xDaysLater.length; i++ ) 80 this.xDaysLater.push( ____xDaysLater[i] ); 81 if ( typeof calXDaysLaterClass !== 'undefined' ) // _ÌÄÑoµf[^ 82 for ( i=0; i<calXDaysLaterClass.length; i++ ) 83 this.xDaysLater.push( calXDaysLaterClass[i] ); 84////////// notationOfWeekÉεÄÌîñÌã« 85 if ( typeof notationOfWeek !== 'undefined' && notationOfWeek.length == 7 ) // _ÌÄÑoµf[^ 86 for ( i=0; i<notationOfWeek.length; i++ ) 87 this.notationOfWeek[i] = notationOfWeek[i]; 88 } 89 90 // útÉεÄÝè³êÄ¢éclassðzñ`®ÅSÄÀ×é 91 this.init = function() 92 { 93 dChk = {}; 94 for ( i=0; i<this.daysClass.length; i++ ) // daysClass̾¯ 95 { 96 if ( typeof this.daysClass[i] !== 'undefined' ){ // daysClassÌútªªAzzñÉÜÜêĢȯêÎ 97 if ( ! ( this.daysClass[i][0] in dChk ) ) // vpeBŶݵȢ©`FbN 98 { 99 dChk[ this.daysClass[i][0] ] = []; 100 /* daysClassÉÝè³ê½útðkeyÉÁ½AzzñªoÄ¢ 101 dChk = { 102 '2013/5/13' = [], 103 '2013/5/14' = [], 104 '2013/6/2' = [], 105 '2013/8/15' = [] 106 }; 107 */ 108 } 109 // ãÅ쬵½[]ÌÉAdaysClassÅÝè³ê½class¼ðzñƵÄpushÇÁµÄ¢ 110 dChk[ this.daysClass[i][0] ].push( this.daysClass[i][1] ); 111 } 112 } 113 114 // útÉεÄÝè³êÄ¢éclassðzñ`®ÅSÄÀ×é 115 for ( key in dChk ) 116 { 117 names = {}; 118 for ( var i=0; i<dChk[key].length; i++ ) 119 { // dChkÌkey²ÆÉclassð»ê¼êêPÊÌzñ»µÄ¢ 120 dChk_sp = dChk[key][i].split(' '); 121 /* 122 '2013/5/13' = [class1, class1 class2, class3, class1], 123 « ãLÌê 124 dChk_sp = [class1], [class1 class2], [class3, class1] 125 */ 126 127 // d¡µÄ¢éclassðÜÆßÄAclass¼ðkeyÉÂAzzñðì¬ 128 for ( var j=0; j<dChk_sp.length; j++ ) 129 { // Ýè³ê½class¼ª "" ÅÈ¢©mF 130 if(dChk_sp[j] != "") 131 { // class¼ðkeyÉAvalueÍ""ÌAzzñð쬵Ģi¯¶class¼Í㫳êéÌÅd¡classªã«³êÄ¢j 132 names[dChk_sp[j]] = ''; //names['close'] = ''; names['red'] = ''; names['wtf'] = ''; 133 } 134 } 135 } 136 // classð¼pXy[XæØè̶ñÅcalObj[0].daysClassÉãü 137 printDaysClass = []; 138 139 // Ýè·éclass¼ðkeyÉÂzñinamesjÌvf̾¯ðÀs 140 for ( n in names ) 141 { // zñprintDaysClassÉAÝè·éclass¼id¡íÏÝjðÉÇÁµÄ¢ 142 printDaysClass.push(n); 143 } 144 // calObj[0].daysClass[ daysClassÅÝè³ê½út ] = ¼pXy[XæØèÌÝè·éclass¼ + öÉ";" 145 this.calObj[0].daysClass[ key ] = printDaysClass.join(' ') + ';'; 146 } 147 148 for ( i=0; i<this.week.length; i++ ) 149 this.calObj[0].week[ this.week[i][0] ] = this.week[i][1]; 150 for ( i=0; i<this.month.length; i++ ) 151 this.calObj[0].month[ this.month[i][0] ] = this.month[i][1]; 152 for ( i=0; i<this.xDays.length; i++ ) 153 this.calObj[0].xDays[ this.xDays[i][0] ] = this.xDays[i][1]; 154 for ( i=0; i<this.xDaysLater.length; i++ ) 155 this.calObj[0].xDaysLater[ this.xDaysLater[i][0] ] = this.xDaysLater[i][1]; 156 157///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 158/* ±±ÜÅxúwè */ 159 160 // J_[¡» 161 for ( cloneRepeat=1; cloneRepeat<this.calLength+1; cloneRepeat++ ) 162 { 163 this.calObj[cloneRepeat] = this.cal_clone( this.calObj[0] ); 164 this.calObj[cloneRepeat].defaultMonth = cloneRepeat; // ú\¦ðÉwèµ½á 165 } 166 167 // calObjÌÉ calendars Ìzñðì¬ 168 this.calObj.calendars = [];
169 /////////////////////// Ýè /////////////////////// 170 // notationOfMonthÅè`³ê½¼ðcalObj.monthNameÉÝè 171 this.calObj.monthName = this.notationOfMonth; 172 173 // úÌzñè` 174 this.calObj.days = new Array(0,31,28,31,30,31,30,31,31,30,31,30,31); 175 // ÉOÌútð\¦ 176 this.calObj.calShowPrevMonth = this.calShowPrevMonth; 177 // ÉÌútð\¦ 178 this.calObj.calShowNextMonth = this.calShowNextMonth; 179 180 // útÌsÅèÌêÌ\¦ 181 this.calObj.calWeekLine = this.calWeekLine; 182 ////////////////////////////////////////////////////// 183 ////////////////////// júÝè ////////////////////// 184 185 // jú¼ðè` 186 this.calObj.weekName = this.notationOfWeek; 187 188 // júæÌzñè` 189 this.calObj.wImg = new Array(); 190 // júæsrcðzñÉãü ex)***/site/img/cal_week_sun.gif 191 for(i=0; i<this.calObj.weekName.length; i++ ){ 192 this.calObj.wImg[i] = this.weekImgDirectory + 'week_' + this.wEnName[i] + this.wImgEx; 193 }
194 ////////////////////////////////////////////////////// 195 ////////////////////// »Ýú ////////////////////// 196 this.calObj.date = typeof defaultYmd === 'undefined' ? new Date() : defaultYmd; 197 this.calObj.date = new Date( 198 this.calObj.date.getFullYear() + "/" + 199 ( this.calObj.date.getMonth() + 1) + "/" + 200 this.calObj.date.getDate() + " 00:00:00"); 201 this.calObj.day = this.calObj.date.getDate(); 202 this.calObj.month = this.calObj.date.getMonth() + 1; 203 this.calObj.year = this.calObj.date.getFullYear(); 204 205 // `FbNpNGQÆ 206 if(location.search){ 207 var calChk = (location.search.substring(1).split('&')); 208 for(var i=0; i<calChk.length; i++){ 209 if(calChk[i].indexOf('calChk') !== -1){ 210 calChk = ( ( calChk[i].split('=') )[1] ).split('/'); 211 this.calObj.day = Number(calChk[2]); 212 this.calObj.month = Number(calChk[1]); 213 this.calObj.year = Number(calChk[0]); 214 } 215 } 216 } 217
218 ////////////////////////////////////////////////////// 219 ////////////////// è\¦Â\ ////////////////// 220 // ÅåNAŬN 221 this.minY = ( this.calObj.year ) - ( this.minYear ); 222 this.maxY = ( this.calObj.year ) + ( this.maxYear ); 223 224 // Ŭ 225 this.minM = ( this.calObj.month ) - ( this.minMonth ); 226 if ( 0 < this.minM ){ 227 this.minM = this.minM; 228 }else{ 229 this.minM = this.minM + 12; 230 this.minY = this.minY - 1; 231 } 232 // Åå 233 this.maxM = ( this.calObj.month ) + ( this.maxMonth ); 234 if( this.maxM < 13 ){ 235 this.maxM = this.maxM; 236 }else{ 237 this.maxM = this.maxM - 12; 238 this.maxY = this.maxY + 1; 239 } 240 } 241 242 // 1 Ìð0ßÅ2 É·éÖðpÓ 243 this.toDoubleDigits = function ( num ) 244 { 245 num += ""; 246 if( num.length === 1 ) 247 num = "0" + num; 248 return num; 249 } 250 251 // zñ©çd¡·éàÌðí 252 this.unique = function ( array ) { 253 var storage = {}; 254 var uniqueArray = []; 255 var i,value; 256 for ( i=0; i<array.length; i++) { 257 value = array[i]; 258 if (!(value in storage)) { 259 storage[value] = true; 260 uniqueArray.push(value); 261 } 262 } 263 return uniqueArray; 264 } 265 266 this.cal_init = function() 267 { 268 var d = window.document; 269 var tagObj = d.getElementsByTagName("div"); // div^OðT· 270 for ( i=0; i<tagObj.length; i++) // div^O»ê¼êÉÀs 271 if ( tagObj[i].className == this.targetClass + 'Wrap' ) 272 { 273 // class = calWrap ¾Á½çdiv.calWrapÌidð²×Ä "cal"È~Ì¶ðæ¾µÄ calObj.calendars ÉzñÔÆµÄãü 274 var calId = Number(tagObj[i].id.substring(3,tagObj[i].id.length)); 275 this.calObj.calendars.push( calId ); 276 277 // »ÝÌÆÁZ·éÌvl 278 var totalMonth = this.calObj.month + this.calObj[ calId ].defaultMonth; 279 280 // ½Nܽ®©iÁZ·éNjðvZ 281 var addYear = Math.floor((totalMonth - 1) / 12); 282 283 // \¦·éðvZ 284 var tmpMonth = totalMonth % 12; 285 if ( tmpMonth === 0 ) { 286 // ]èª0ÌêÍ12Éâ³ 287 tmpMonth = 12; 288 } 289 290 // vZÅß½ÁZNiaddYearjðgÁÄúðÝèµÜ· 291 this.calObj[ calId ].currentMonth = new Date( 292 ( this.calObj.year + addYear ) + "/" + tmpMonth + "/" + "1 00:00:00" 293 ); 294 295 this.cal_create( calId ); 296 } 297 } 298 299 // ±±©çJ_[¶¬i{^èÌÛàñÀs³êé 300 this. cal_create = function( calId ) 301 { 302 var d = window.document; 303 // N,,ú,júð»ê¼êcurrentMonthɶÄè` 304 var year = this.calObj[ calId ].currentMonth.getFullYear(); 305 var month = this.calObj[ calId ].currentMonth.getMonth() + 1; 306 var day = this.calObj[ calId ].currentMonth.getDate(); 307 var week = this.calObj[ calId ].currentMonth.getDay(); 308 var MonthDays = this.calObj.days[ month ]; // úÌÝè 309 var bisDay = 0; 310 var bisAfter = 0; 311 if ( month == 2 || month == 3 ){ 312 if ( year % 100 == 0 || year % 4 != 0 ) 313 if ( year % 400 != 0 ) 314 bisDay = 0; 315 else{ 316 if(month == 2){ bisDay = 1; } 317 else{ bisAfter = 1; } 318 } 319 else if ( year % 4 == 0 ){ 320 if(month == 2){ bisDay = 1; } 321 else{ bisAfter = 1; } 322 } 323 else{ 324 bisDay = 0; 325 } 326 MonthDays += bisDay; 327 } 328 // J_[tableJn^O 329 var calHTML = "<table border='0' cellspacing='"+ this.calCellSpacing +"' cellpadding='0' class='cal" + " year" + year + " month" + month + "'>"; 330 /* calHTMLÉ "calHTML += *****;"ðÇÁµÄ¢±ÆÅtableÌÌhtmlRecðÇÁµÄAÅãÉ"('cal'+calId).innerHTML = calHTML;"ÅÀs·é */ 331 if ( this.yearMonthInTable ) 332 { // NðtableÉüêéê 333 calHTML += '<tr class="yearMonthText"><th colspan="7"><div>'; 334 calHTML += "<span class='cal_year'>" + year + this.yearLabel + "</span>"; 335 calHTML += "<span class='cal_month'>" + this.calObj.monthName[month] + "</span>"; 336 calHTML += "</div></th></tr>"; 337 }else 338 { //NðtableÌOÉ©RÉCAEg·éê 339 yObj = jQuery('.cal_year').eq( calId ); 340 mObj = jQuery('.cal_month').eq( calId ); 341 342 if( jQuery('.cal_year').length > 0 ){ 343 if ( this.useYearImage ) 344 { // Næ 345 // J_[ÌÔÆ¯¶indexÔÌNæÌsrcðæ¾ 346 var yObj = jQuery('.cal_year').eq(calId).find('img'); 347 // æÌsrc©çt@C¼ÌÝðæèo· 348 var ySrc = yObj.attr('src'); 349 ySrc = ySrc.split('/'); 350 var yFile = ySrc[ySrc.length - 1]; 351 352 // N æÌt@C¼ðJ_[²ÆÌÝèÌNÉí¹é 353 yFile = yFile.replace( /\d\d\d\d/, (year) ); // Nu· 354 yFile = yFile.replace( /\..*/, this.yImgEx ); // g£qu· 355 ySrc[ySrc.length - 1] = yFile; 356 ySrc = ySrc.join('/'); 357 358 yObj.attr({ 359 alt: (year)+'N', 360 src: (ySrc) 361 }); 362 }else 363 yObj.html( year + this.yearLabel ); 364 } 365 if( jQuery('.cal_month').length > 0 ){ 366 if ( this.useMonthImage ) 367 { 368 // ð0ßÌ2 ÉÏ· 369 var month2dig = this.toDoubleDigits(month); 370 // J_[ÌÔÆ¯¶indexÔÌNæÌsrcðæ¾ 371 var mObj = jQuery('.cal_month').eq(calId).find('img'); 372 // æ©çt@C¼ÌÝðæèo· 373 var mSrc = mObj.attr('src'); 374 mSrc = mSrc.split('/'); 375 var mFile = mSrc[mSrc.length - 1]; 376 377 // æÌsrcðJ_[²ÆÌÝèÌÉí¹é 378 mFile = mFile.replace( /\d\d/, (month2dig) ); // u· 379 mFile = mFile.replace( /\..*/, this.mImgEx ); // g£qu· 380 mSrc[mSrc.length - 1] = mFile; 381 mSrc = mSrc.join('/'); 382 383 mObj.attr({ 384 alt: (month)+'', 385 src: (mSrc) 386 }); 387 }else 388 mObj.html( this.calObj.monthName[month] ); 389 } 390 } 391 // jú¶¬ 392 calHTML += "<tr class='cal_headline'>"; 393 if ( this.useWeekImage ) // æÌê 394 for ( i=0; i<7; i++ ) 395 calHTML += "<th><img src='" + this.calObj.wImg[i] + "' alt='" + this.calObj.weekName[i] + this.weekLabel + "' /></th>"; 396 else // eLXgÌê 397 for ( var i=0;i<7;i++ ) 398 calHTML += "<th><div class='" + this.calObj[calId].week[i] + "'>" + this.calObj.weekName[i] + "</div></th>"; 399 calHTML += "</tr>"; 400 401 // »ÝÌsi<tr></tr>jÌ 402 var currentCalWeekLine = 1; 403 404 // ßóZ = week 405 // IíèóZ = 406 var endBlankLength = ( 7 - ( (this.calObj.days[month]+bisDay+week) % 7) ); 407 408 /* 1úÜÅÌótd¶¬
409 ////////////////////////////////////////////////////////*/ 410 calHTML += "<tr>"; 411 412 if(this.calObj.calShowPrevMonth){ // óÌtdÉOÌú𶬠413 var temp_month = (month - 1 == 0) ? 12 : month - 1; 414 var prevEnd = ( this.calObj.days[temp_month]+bisAfter ) - (week - 1); 415 for ( i=0; i<week; i++ ){ 416 calHTML += "<td><div class='cal_PrevMonthDay cal_adjoin'>" + (prevEnd + i) + "</div></td>"; 417 } 418 }else{ // calShowPrevMonth ªÈ¯êÎjú̾¯óÌtd𶬠419 for ( i=0; i<week; i++ ) 420 calHTML += "<td><div class='cal_blank cal_pre_blank'> </div></td>"; 421 } 422 423 //»ÝÌjúJEgpzñè`@¦yjÉÈÁ½çüsitrðâ·j·é 424 var WeekCnt = new Array(); 425 426 /* útðDZÜÅ\¦·é© 427 ////////////////////////////////////////////////////////*/ 428 429 // úÜÅ 430 var dayCntLimit = this.calObj.days[month]+bisDay; 431 432 if(this.calObj.calShowNextMonth){@// Ìútð\¦ 433 if(this.calWeekLine){ // sÅè + Ìútð\¦ 434 var dayCntLimit = (this.calObj.calWeekLine * 7 - week <= dayCntLimit+endBlankLength) ? dayCntLimit+endBlankLength : this.calObj.calWeekLine * 7 - week 435 } else{ // ú©çyjÜÅÉÌútð\¦ 436 var dayCntLimit = dayCntLimit+endBlankLength; 437 } 438 } 439 440 // tdÐÆÂÐÆÂÌÝèiúi + ÝèæÅßÌútjÜÅȺÌscriptðJèÔµÀsj 441 for ( dayCnt=1; dayCnt<= dayCntLimit; dayCnt++ ) 442 { 443 var insertYear = year; 444 var insertMonth = month; 445 var insertDay = dayCnt; 446 447 if( dayCnt > ( this.calObj.days[month] + bisDay ) ){ 448 var insertYear = (month + 1 > 12) ? year + 1 : year; 449 var insertMonth = (month + 1 > 12) ? 1 : month + 1; 450 var insertDay = dayCnt - (this.calObj.days[month] + bisDay); 451 } 452 453 if ( WeekCnt[week] == undefined ) 454 WeekCnt[week] = 0; 455 WeekCnt[week]++; 456 457 458 459 // ÝèÉ}b`µ½classð dayClass ÌÉüêÄ¢ 460 var dayClass = new Object(); 461 462 463 // ì¬tdÌút 464 var currentDayDate = new Date( insertYear + "/" + insertMonth + "/" + insertDay + " 00:00:00" ); 465 // »ÝÌútæèãÌút(Oúª-1A»ÝÌútª0Aúª+1) 466 var laterDay = Math.floor( 467 ( currentDayDate.getTime() - this.calObj.date.getTime() ) / 1000 / (60 * 60 * 24) ); 468 // etdÉUéID td_J_[ID_yyyy_mm_dd 469 var tdId = "td_"+calId+"_"+insertYear+"_"+insertMonth+"_"+insertDay; 470 471 /* backward */ 472 if ( this.calObj[calId].backward != null && currentDayDate.getTime() < this.calObj.date.getTime()) 473 dayClass["backward"] = this.calObj[calId].backward; 474 /* week */ 475 //calObj[0].week[3] == "string" && calObj[0].week[3][undefined] 476 if ( typeof( this.calObj[calId].week[week] ) == "object" && 477 this.calObj[calId].week[week][WeekCnt[week]] != undefined ) 478 { 479 dayClass["week"] = this.calObj[calId].week[week][WeekCnt[week]]; 480 } 481 //calObj[0].week[3] == "wed close" && //calObj[0].week[3] 482 else if ( this.calObj[calId].week[week] != undefined && 483 typeof ( this.calObj[calId].week[week] ) != "object" ) 484 { 485 dayClass["week"] = this.calObj[calId].week[week]; 486 } 487 /* month i-~jú-æ¢TA~jú-æ¢TjÌÝè */ 488 // »Ýªæ½T©ðQƵÄ-~jú-æ¢TÌè` 489 var monStr = insertMonth + '-' + week + '-' + WeekCnt[ week ]; 490 // »Ýªæ½T©ðQƵÄ~jú-æ¢TÌè` 491 var weekStr = week + '-' + WeekCnt[week]; 492 // AzzñêvÅ monStr(-~jú-æ¢T)Éêvµ½ê 493 if ( this.calObj[calId].month[monStr] != undefined ) 494 dayClass["month"] = this.calObj[calId].month[monStr]; 495 // AzzñêvÅ weekStr(~jú-æ¢T)Éêvµ½ê 496 else if ( this.calObj[calId].month[weekStr] != undefined ) 497 dayClass["month"] = this.calObj[calId].month[weekStr]; 498 /* xDay */ 499 if ( this.calObj[calId].xDays[insertDay] != undefined ) 500 dayClass["xDay"] = this.calObj[calId].xDays[ insertDay ]; 501 /* xDaysLater */ 502 if ( this.calObj[calId].xDaysLater[laterDay] != undefined ) 503 dayClass["xDaysLater"] = this.calObj[calId].xDaysLater[laterDay]; 504 /* day út²Æ */ 505 // XbV æØèÅ@yyyy/m/dd 506 var dayStr = insertYear + "/" + insertMonth + "/" + insertDay; 507 // XbV æØèÅ@m/dd 508 var dayStrN = insertMonth + "/" + insertDay; 509 // ì¬ZÌNúªdayÝèÉÜÜêÄ¢êÎ 510 var dayJoin = new Array(); 511 if ( this.calObj[calId].daysClass[dayStr] != undefined ) 512 dayJoin.push( this.calObj[calId].daysClass[dayStr] ); 513 // ì¬ZÌúªdayÝèÉÜÜêÄ¢êÎi¦NðÈ¢½NKpÝèj 514 if ( this.calObj[calId].daysClass[dayStrN] != undefined ) 515 dayJoin.push( this.calObj[calId].daysClass[dayStrN] ); 516 if(dayJoin.length != 0){ 517 dayClass["day"] = dayJoin.join(' '); 518 dayClass["day"] = dayClass["day"].replace(';', ''); 519 } 520 var tdClassArr = new Array(); 521 var tdTextArr = new Array(); 522 var tdLinkArr = new Array(); 523 var tdClassPre = new Array(); 524 var tdClassStr = ""; 525 var tdClassNames = new Object(); 526 /* priorityÌÅzñðì¬ */ 527 //priorityzñÌclass̾¯JèÔµ 528 for ( ci=0; ci<this.calObj[calId].priority.length; ci++ ) 529 { //dayclass(ÝèÆ}b`µ½class)É priorityÅwèµ½classª é©mF 530 //(á: calObj[0].priority = new Array('month','week','xDay','xDaysLater','day','backward');) 531 // dayclassª Á½ê 532 if ( dayClass[ this.calObj[calId].priority[ci] ] != undefined) 533 { // dayclassð splitArr Éãü 534 var splitArr = new Array(); 535 // dayAmonthAweekAxDayÈÇÌL[[h²ÆÉ;ÅæØÁ½zñðìé 536 splitArr = dayClass[ this.calObj[calId].priority[ci] ].split(';'); 537 // splitArrðtdClassArrÉãü 538 tdClassArr.push(splitArr[0]); 539 // tdClassNames[ÝèÆ}b`µ½class] = true; 540 tdClassNames[splitArr[0]] = true; 541 } 542 } 543 if( dayCnt > ( this.calObj.days[month] + bisDay ) ) 544 tdClassArr.push('cal_nextMonthDay cal_adjoin'); 545 546 if(tdClassArr.length > 0){ 547 var deleteClose = false;
548 var tc = tdClassArr.join(' ').split(' '); 549 // d¡classðí 550 tc = this.unique(tc); 551 552 for( var i=0; i<tc.length; i++ ){ 553 if( tc[i].indexOf('cal_noClose') != -1 ) // cal_noCloseª Á½ç 554 deleteClose = true; 555 } 556 for( var i=0; i<tc.length; i++ ){ 557 if( deleteClose ){ 558 if( tc[i].indexOf("close") == -1) // closeÆ¢¤class¼ÌtàÌðOizñÉÇÁµÈ¢j 559 tdClassPre.push( tc[i] ); 560 } else{ 561 tdClassPre.push( tc[i] ); // noCloseªÈ¯êÎtcð»ÌÜÜtdClassPreÉÇÁ 562 } 563 } 564 tdClassStr = " class='" + tdClassPre.join(' ') + "'"; // dayClassð¼pXy[XæØèÅ class="" ÌÉüé`Å tdClassStrÉãü 565 } 566 567 /* útÌtdÉclassÌt¢½divðì¬ */ 568 // td¼ºÉdivð쬵ÄdayClassð¯ÄeLXgÅeútðüÍ 569 calHTML += "<td id='"+tdId+"_td'><div"+tdClassStr+">" + insertDay + "</div></td>"; 570 571 572 /* TPÊÌüs»f */ 573 // yjú¾Á½ç</tr> 574 if ( week == 6 ) 575 { 576 calHTML += "</tr>"; 577 currentCalWeekLine++; 578 if ( insertDay < this.calObj.days[month] ) 579 { // yjúÅAܾúÉÈÁĢȩÁ½ç³çÉ<tr>AjúðújÉ·é 580 calHTML += "<tr>"; 581 } 582 week = 0; 583 }else 584 { // yjÈOÈçjúðißÄÅÉßé 585 week++; 586 } 587 } 588 /* úÌÜÅút <td> ¶¬@JèÔµI¹ */
589 /////////////////////////////////////////////////////// 590 /* úð߬ÄyjúÜÅÌótd */ 591 while(week <= 6 && week != 0){ 592 calHTML += "<td><div class='cal_blank cal_end_blank'> </div></td>"; 593 if(week == 6){ 594 calHTML += "</tr>"; 595 currentCalWeekLine++; 596 } 597 week++; 598 } 599 //@útÌsÅèÌêÌ 600 if ( this.calWeekLine && !this.calShowNextMonth ) 601 while ( currentCalWeekLine <= this.calObj.calWeekLine && currentCalWeekLine != 0 ) 602 { var week = 0; 603 while ( week <= 6 ) 604 { calHTML += "<td><div class='cal_blank cal_end_blank'> </div></td>"; 605 if(week == 6){ 606 calHTML += "</tr>"; 607 } 608 week++; 609 } 610 currentCalWeekLine++; 611 } 612 calHTML += "</table>"; 613 d.getElementById(this.targetClass+calId).innerHTML = calHTML; 614 } 615 616 this.cal_clone = function( obj ){ 617 var dest; 618 if ( typeof obj == 'object' ) 619 if ( obj instanceof Array ) 620 { 621 dest = []; 622 for ( i=0; i<obj.length; i++ ) 623 dest[ i ] = this.cal_clone( obj[i] ); 624 }else 625 { 626 dest = {}; 627 for ( prop in obj ) 628 dest[ prop ] = this.cal_clone( obj[ prop ] ); 629 } 630 else 631 dest = obj; 632 return dest; 633 } 634 635 /* 636 1. J_[ÐÆÂ¸Âð cal_checkÉÊ· 637 2. true or false@ªÔÁÄé 638 3. ÐÆÂÅà false@ªÔÁÄ«½ç chk(J_[SÌÌ®ÉηétO)ðfalseÉÝè·é 639 4. chkªtrueÈç cal_move ÍÀsB chkªfalseÈç cal_move ÍÀsµÈ¢ 640 */ 641 this.cal_check = function( calId, m ) 642 { 643 var day = this.calObj[ calId ].currentMonth.getDate(); 644 var month = this.calObj[ calId ].currentMonth.getMonth() + 1; 645 var year = this.calObj[ calId ].currentMonth.getFullYear(); 646 // «@ŬN@or@ÅåN@ÈOÌJ_[Í trueÅ cal_checkð²¯é 647 if ( this.minY != year && year != this.maxY ) 648 return true; 649 else if ( this.minY == year && this.maxY == year ){ 650 if ( ( month + m ) < this.minM ) 651 return false; 652 else if ( ( month + m ) > this.maxM ) 653 return false; 654 } 655 else{ 656 if ( this.minY == year ){ 657 if ( ( month + m ) < this.minM ) 658 return false; 659 } 660 else if ( ( this.maxY == year ) ){ 661 if ( ( month + m ) > this.maxM ) 662 return false; 663 } 664 } 665 return true; 666 } 667 668 this.cal_move = function( calId, m ) 669 { 670 var day = this.calObj[calId].currentMonth.getDate(); 671 var month = this.calObj[calId].currentMonth.getMonth() + 1; 672 var year = this.calObj[calId].currentMonth.getFullYear(); 673 if ( 0 < month + m && month + m < 13 ) 674 this.calObj[calId].currentMonth = new Date( year+"/"+( month + m )+"/"+"1 00:00:00"); 675 else if( ( month + m ) < 1 ){// Nª¸éi1Åprev{^ªNbN³ê½jÆ« 676 if ( year > this.minY ) 677 { 678 year--; 679 month = 12; 680 this.calObj[calId].currentMonth = new Date( year + "/" + ( month ) + "/" + "1 00:00:00" ); 681 } 682 } 683 else{// Nªi12Ånext{^ªNbN³ê½j¦éÆ« 684 if( year <= ( this.maxY - 1) ){ 685 year++; 686 month = 1; 687 this.calObj[calId].currentMonth = new Date(year+"/"+(month)+"/"+"1 00:00:00"); 688 } 689 } 690 this.cal_create(calId); 691 } 692 693 // cal_moveêwèpwrap function 694 this.cal_prev = function() 695 { 696 start = 0; 697 chk = true; 698 for ( i=start; i<this.calLength; i++ ){ 699 if ( ! this.cal_check( i, -1 ) ) // J_[SÌÅminYearÈOÉ®¢ÄµÜ¤à̪Ȣ©`FbN·é½ß cal_check ðÊ· 700 chk = false; // cal_check ÌÔèlªtrueÅÍÈ©Á½çprev{^ÉηétO chk@ÉfalseðÔ· 701 } 702 if ( chk ) // chkª@trueiSÄÌJ_[ªfalseðÉÄÍÜçÈ¢êjÌÝ 703 for ( i=start; i<this.calLength; i++ ) // eJ_[Écal_moveðÀs 704 this.cal_move(i, -1); 705 } 706 707 this.cal_next = function() 708 { 709 start = 0; 710 chk = true; 711 for ( i=start; i<this.calLength; i++ ){ //@J_[SÌÅmaxYearÈ~É®¢ÄµÜ¤à̪Ȣ©`FbN·é½ß cal_check ðÊ· 712 if ( ! this.cal_check( i, 1 ) ) // cal_check ÌÔèlªtrueÅÍÈ©Á½ç 713 chk = false; // next{^ÉηétO chk@ÉfalseðÔ· 714 } 715 if ( chk ) // chkª@trueiSÄÌJ_[ªfalseðÉÄÍÜçÈ¢êjÌÝA 716 for ( i=start; i<this.calLength; i++ ) // eJ_[Écal_moveðÀs 717 this.cal_move(i,1); 718 } 719} 720
721// ÌÐÌîñƯxúè`t@CÌîñð}[W·éÜÅÌìÆðbsOµ½àÌ 722function cal_preload() 723{ if( typeof ____daysClass == 'object' && ! ( ____instance instanceof jsCalendar ) ) 724 { ____instance = new jsCalendar(); 725 ____instance.preload(); 726 ____instance.init(); 727 ____instance.cal_init(); 728 }else if ( typeof ____instance != 'undefined' ) 729 { ____instance.init(); 730 ____instance.cal_init(); 731 } 732} 733 734//////////////////////////////////////////////////////////////////////////////// 735var ____instance; 736var ____script; 737 738// Wrapper Section 739// jsCalendar().cal_prev() 740function cal_prev(){ 741 ____instance.cal_prev(); 742} 743 744// jsCalendar().cal_next() 745function cal_next(){ 746 ____instance.cal_next(); 747} 748function cal_init(fn) 749{ if( typeof ____script == 'undefined' ) 750 { ____script = document.createElement('script'); 751 ____script.setAttribute('type', 'text/javascript'); 752 ____script.setAttribute('src', '/common-js/mut.calendar.list.js?'+(new Date()).getTime()); 753// document.getElementsByTagName('head')[0].appendChild( ____script ); 754 document.body.appendChild( ____script ); 755 ____script.onreadystatechange = function() 756 { // IE6Î 757 cal_preload(); 758 if( fn ){ 759 try{ 760 fn(); 761 } catch(e){} 762 } else{} 763 } 764 ____script.onload = function() 765 { 766 cal_preload(); 767 if( fn ){ 768 try{ 769 fn(); 770 } catch(e){} 771 } else{} 772 } 773 }else 774 cal_preload(); 775}
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.