1// ======================================================== 2// jkl-calendar.js ---- ãããã¢ããã«ã¬ã³ãã¼è¡¨ç¤ºã¯ã©ã¹ 3// Copyright 2005-2006 Kawasaki Yusuke <u-suke [at] kawa.net> 4// 2005/04/06 - æåã®ãã¼ã¸ã§ã³ 5// 2005/04/10 - å¤é¨ã¹ã¿ã¤ã«ã·ã¼ãã使ç¨ããªããJKL.Opacity ã¯ãªãã·ã§ã³ 6// 2006/10/22 - typoä¿®æ£ãspliter/min_date/max_dateããããã£ãÃãã¿ã³è¿½å 7// 2006/10/23 - prototype.jsä½µç¨æã¯ãEvent.observe()ã§ã¤ãã³ãç»é² 8// 2006/10/24 - max_date ç¯å²ãã°ä¿®æ£ 9// 2006/10/25 - ãã©ã¼ã ã«åæå¤ãããã°ãã«ã¬ã³ãã¼ã®åæå¤ã«æ¡ç¨ãã 10// 2006/11/15 - MOM Update é±ã®åãã®ææ¥ã夿´ã§ããããã«ä¿®æ£ 11// 2006/11/23 - MOM Update 仿¥æ¥ä»ã®æåè²ãæå®ã§ããããã«ä¿®æ£ããã¨æ ç·ãæç»ãã¦ã¿ã 12// éªéãª<select>ã¸ã®å¿æ¥å¦ç½®ãæ¸ãã¦ã¿ã 13// 2006/11/27 - MOM Update éªéãª<select>ã¸ã®å¿æ¥å¦ç½®ãä¿®æ£ãæç»é åã®é«ããåå¾ãã 14// 2006/11/30 - MOM Update 鏿å¯è½ãªææ¥ãããããã£ã«è¿½å ã仿¥æ¥ä»ã¨é¸æä¸å¯è½ãªæ¥ä»ã®èæ¯è²ãã¹ã¿ã¤ã«ã«è¿½å 15// ã«ã¬ã³ãã¼ã®z-indexãããããã£ã«è¿½å 16// 2006/12/04 - ksuzu Update 鏿å¯è½æ¥ããªãæã«ã¯ç§»åã§ããªãããã«å¤æ´ 17// ã«ã¬ã³ãã¼ã®è¡¨ç¤ºæãã¯ãªãã¯ããã¨ç¾å¨ã®æã«ç§»åã§ãããã夿´ 18// éãããã¿ã³ã«ã¦ã«ã¬ã³ãã¼ãéããã¨ããã«ã¬ã³ãã¼ã®åæè¡¨ç¤ºãæ»ããã夿´ 19// 2006/12/30 - MOM IFRAMEã®SRC屿§ã«dummy.htmlãæ¿å ¥ 20// 2007/02/04 - MOM setDateYMDã®ãã°ãä¿®æ£ 21// TDã¿ã°ã®ã¹ã¿ã¤ã«ã«èæ¯è²ãæå®ããããä¿®æ£ 22// 2013/10/18 - DYN ç¥æ¥ãæåè²ã夿´ããããã«ä¿®æ£ 23// 24// ======================================================== 25 26// 親ã¯ã©ã¹ 27 28if ( typeof(JKL) == 'undefined' ) JKL = function() {}; 29 30// JKL.Calendar ã³ã³ã¹ãã©ã¯ã¿ã®å®ç¾© 31 32JKL.Calendar = function ( eid, fid, valname ) { 33 // 2013.10.18 DYN ç¥æ¥ 颿°è¨å® 34 this.initHoliday(); 35 36 this.eid = eid; 37 this.formid = fid; 38 this.valname = valname; 39 this.__dispelem = null; // ã«ã¬ã³ãã¼è¡¨ç¤ºæ¬ã¨ã¬ã¡ã³ã 40 this.__textelem = null; // ããã¹ãå ¥åæ¬ã¨ã¬ã¡ã³ã 41 this.__opaciobj = null; // JKL.Opacity ãªãã¸ã§ã¯ã 42 this.style = new JKL.Calendar.Style(); 43 return this; 44}; 45 46// ãã¼ã¸ã§ã³çªå· 47 48JKL.Calendar.VERSION = "0.13"; 49 50// ããã©ã«ãã®ãããã㣠51 52JKL.Calendar.prototype.spliter = "/"; 53JKL.Calendar.prototype.date = null; 54JKL.Calendar.prototype.min_date = null; 55JKL.Calendar.prototype.max_date = null; 56 57// 2006.11.15 MOM 表示éå§ææ¥ãããããã£ã«è¿½å (ããã©ã«ãã¯æ¥ææ¥=0) 58JKL.Calendar.prototype.start_day = 0; 59 60// 2006.11.23 MOM ã«ã¬ã³ãã¼å ã®æ¥ä»ãæ ç·ã§åºåããã©ããã®ããããã£(ããã©ã«ãã¯true) 61JKL.Calendar.prototype.draw_border = true; 62 63// 2006.11.30 MOM åææ¥ã®é¸æå¯å¦ãããããã£ã«è¿½å (ããã©ã«ãã¯å ¨ã¦true) 64// é åã®æ·»ãåã§ææ¥ãæå®(0ï½6 = æ¥æï½åæ)ã鏿å¯å¦ãbooleanå¤ã§ä»£å ¥ãããã¨ããä½¿ãæ¹ 65JKL.Calendar.prototype.selectable_days = new Array(true,true,true,true,true,true,true); 66 67// 2006.11.30 MOM ã«ã¬ã³ãã¼ã®z-indexãããããã£ã«è¿½å 68JKL.Calendar.prototype.zindex = 10; 69 70// 2013.10.18 DYN ç¥æ¥ããããã£è¿½å 71JKL.Calendar.prototype.holiday = null; 72 73// JKL.Calendar.Style 74JKL.Calendar.Style = function() { 75 return this; 76}; 77 78// ããã©ã«ãã®ã¹ã¿ã¤ã« 79 80JKL.Calendar.Style.prototype.frame_width = "220px"; // ãã¬ã¼ã æ¨ªå¹ 81JKL.Calendar.Style.prototype.frame_color = "#CCCCCC"; // ãã¬ã¼ã æ ã®è² 82JKL.Calendar.Style.prototype.font_size = "12px"; // æåãµã¤ãº 83JKL.Calendar.Style.prototype.day_bgcolor = "#FFFFFF"; // ã«ã¬ã³ãã¼ã®èæ¯è² 84JKL.Calendar.Style.prototype.month_color = "#333333"; // âå¹´âæé¨åã®èæ¯è² 85JKL.Calendar.Style.prototype.month_hover_color = "#333333"; // æã®ãã¦ã¹ãªã¼ãã¼æã®âªâ«æåè² 86JKL.Calendar.Style.prototype.month_hover_bgcolor= "#DDDDDD"; // æã®ãã¦ã¹ãªã¼ãã¼æã®âªâ«èæ¯è² 87JKL.Calendar.Style.prototype.weekday_color = "#404040"; // ææï½éææ¥ã»ã«ã®æåè² 88JKL.Calendar.Style.prototype.saturday_color = "#0040D0"; // åææ¥ã»ã«ã®æåè² 89JKL.Calendar.Style.prototype.sunday_color = "#D00000"; // æ¥ææ¥ã»ã«ã®æåè² 90JKL.Calendar.Style.prototype.others_color = "#AAAAAA"; // ä»ã®æã®æ¥ã»ã«ã®æåè² 91JKL.Calendar.Style.prototype.day_hover_bgcolor = "#FEB797"; // æ¥ä»ã®ãã¦ã¹ãªã¼ãã¼æã®æ¥ã»ã«ã®èæ¯ 92JKL.Calendar.Style.prototype.cursor = "pointer"; // æ¥ä»ã®ãã¦ã¹ãªã¼ãã¼æã®ã«ã¼ã½ã«å½¢ç¶ 93 94// 2006.11.23 MOM 仿¥æ¥ä»ã®æåè²ãããããã£ã«è¿½å 95JKL.Calendar.Style.prototype.today_color = "#666666"; // 仿¥æ¥ä»ã»ã«ã®æåè² 96 97// 2006.11.23 MOM æ ç·ãã¤ãã¦ã¿ã 98JKL.Calendar.Style.prototype.today_border_color = "#666666"; // 仿¥æ¥ä»ã»ã«ã®æ ç·ã®è² 99JKL.Calendar.Style.prototype.others_border_color= "#EEEEEE"; // ä»ã®æ¥ã»ã«ã®æ ç·ã®è² 100
101// 2006.11.30 MOM 仿¥æ¥ä»ã®èæ¯è²ãå¿ãã¦ãã®ã§è¿½å ãã¦ã¿ã 102JKL.Calendar.Style.prototype.today_bgcolor = "#FFFFFF"; // 仿¥æ¥ä»ã»ã«ã®èæ¯è² 103 104// 2006.11.30 MOM 鏿ä¸å¯è½ãªæ¥ä»ã®èæ¯è²ã追å 105JKL.Calendar.Style.prototype.unselectable_day_bgcolor = "#EEEEEE"; // 鏿ä¸å¯è½ãªæ¥ä»ã®èæ¯è² 106 107// 2013.10.18 DYN ç¥æ¥ã»ã«ã®æåè²ã追å 108JKL.Calendar.Style.prototype.holiday_color = "#D00000"; 109 110// ã¡ã½ãã 111 112JKL.Calendar.Style.prototype.set = function(key,val) { this[key] = val; } 113JKL.Calendar.Style.prototype.get = function(key) { return this[key]; } 114JKL.Calendar.prototype.setStyle = function(key,val) { this.style.set(key,val); }; 115JKL.Calendar.prototype.getStyle = function(key) { return this.style.get(key); }; 116 117// æ¥ä»ãåæåãã 118 119JKL.Calendar.prototype.initDate = function ( dd ) { 120 if ( ! dd ) dd = new Date(); 121 var year = dd.getFullYear(); 122 var mon = dd.getMonth(); 123 var date = dd.getDate(); 124 this.date = new Date( year, mon, date ); 125 this.getFormValue(); 126 return this.date; 127} 128 129// 2013.10.18 DYN ç¥æ¥ãåå¾ãã 130JKL.Calendar.prototype.initHoliday = function () { 131 // var $j = jQuery.noConflict(true); 132 // alert($j.fn.jquery); 133 var holiday = new Array(); 134 135 // googleãã 136 if (!this.date) this.initDate(); 137 138 var endDate = new Date(this.date.getFullYear(), this.date.getMonth() + 13, 01); // 13ãæå¾ 139 140 // ãã©ã¼ããã 141 var startM = this.date.getMonth() + 1; 142 var endM = endDate.getMonth() + 1; 143 if (startM < 10) startM = '0' + startM; 144 if (endM < 10) endM = '0' + endM; 145 146 var start = this.date.getFullYear() + '-' + startM + '-01'; // 仿ãã 147 var end = endDate.getFullYear() + '-' + endM + '-01';
147 // 13ãæå¾ã¾ã§ã¨ã£ã¦ãã 148 149 jQuery.ajax({ 150 url: 'http://www.google.com/calendar/feeds/japanese__ja%40holiday.calendar.google.com/public/full?alt=json&start-min=' + start + '&start-max=' + end, 151 type: 'GET', 152 dataType: 'jsonp', 153 scriptCharset: 'utf-8', 154 timeout: 5000, 155 success: function (data) { 156 var entry = data.feed.entry; 157 for (var i = 0; i < entry.length; i++) { 158 holiday.push(entry[i].gd$when[0].startTime.replace(/-/g, '/')); 159 } 160 holiday.sort(); 161 }, 162 error: function (data) { 163 }, 164 complete: function (data) { 165 } 166 }); 167 168 this.holiday = holiday; 169} 170 171 172// éæåº¦è¨å®ã®ãªãã¸ã§ã¯ããè¿ã 173 174JKL.Calendar.prototype.getOpacityObject = function () { 175 if ( this.__opaciobj ) return this.__opaciobj; 176 var cal = this.getCalendarElement(); 177 if ( ! JKL.Opacity ) return; 178 this.__opaciobj = new JKL.Opacity( cal ); 179 return this.__opaciobj; 180}; 181 182// ã«ã¬ã³ãã¼è¡¨ç¤ºæ¬ã®ã¨ã¬ã¡ã³ããè¿ã 183 184JKL.Calendar.prototype.getCalendarElement = function () { 185 if ( this.__dispelem ) return this.__dispelem; 186 this.__dispelem = document.getElementById( this.eid ) 187 return this.__dispelem; 188}; 189 190// ããã¹ãå ¥åæ¬ã®ã¨ã¬ã¡ã³ããè¿ã 191 192JKL.Calendar.prototype.getFormElement = function () { 193 if ( this.__textelem ) return this.__textelem; 194 var frmelms = document.getElementById( this.formid ); 195 if ( ! frmelms ) return; 196 for( var i=0; i < frmelms.elements.length; i++ ) { 197 if ( frmelms.elements[i].name == this.valname ) { 198 this.__textelem = frmelms.elements[i]; 199 } 200 } 201 return this.__textelem; 202}; 203 204// ãªãã¸ã§ã¯ãã«æ¥ä»ãè¨æ¶ããï¼YYYY/MM/DDå½¢å¼ã§æå®ããï¼ 205 206JKL.Calendar.prototype.setDateYMD = function (ymd) { 207 var splt = ymd.split( this.spliter ); 208 if ( splt[0]-0 > 0 && 209 splt[1]-0 >= 1 && splt[1]-0 <= 12 && // bug fix 2006/03/03 thanks to ucb 210 splt[2]-0 >= 1 && splt[2]-0 <= 31 ) { 211 if ( ! this.date ) this.initDate(); 212 this.date.setDate( splt[2] ); 213 this.date.setMonth( splt[1]-1 ); 214 this.date.setFullYear( splt[0] ); 215 } else { 216 ymd = ""; 217 } 218 return ymd; 219}; 220 221// ãªãã¸ã§ã¯ãããæ¥ä»ãåãåºãï¼YYYY/MM/DDå½¢å¼ã§è¿ãï¼ 222// 弿°ã« Date ãªãã¸ã§ã¯ãã®æå®ãããã°ã 223// ãªãã¸ã§ã¯ãã¯ç¡è¦ãã¦ã弿°ã®æ¥ä»ã使ç¨ããï¼åãªãfprintæ©è½ï¼ 224 225JKL.Calendar.prototype.getDateYMD = function ( dd ) { 226 if ( ! dd ) { 227 if ( ! this.date ) this.initDate(); 228 dd = this.date; 229 } 230 var mm = "" + (dd.getMonth()+1); 231 var aa = "" + dd.getDate(); 232 if ( mm.length == 1 ) mm = "" + "0" + mm; 233 if ( aa.length == 1 ) aa = "" + "0" + aa; 234 return dd.getFullYear() + this.spliter + mm + this.spliter + aa; 235}; 236 237// ããã¹ãå ¥åæ¬ã®å¤ãè¿ãï¼ã¤ãã§ã«ãªãã¸ã§ã¯ããæ´æ°ããï¼ 238 239JKL.Calendar.prototype.getFormValue = function () { 240 var form1 = this.getFormElement(); 241 if ( ! form1 ) return ""; 242 var date1 = this.setDateYMD( form1.value ); 243 return date1; 244}; 245 246// ãã©ã¼ã å ¥åæ¬ã«æå®ããå¤ãæ¸ãè¾¼ã 247 248JKL.Calendar.prototype.setFormValue = function (ymd) { 249 if ( ! ymd ) ymd = this.getDateYMD(); // ç¡æå®æã¯ãªãã¸ã§ã¯ãããï¼ 250 var form1 = this.getFormElement(); 251 if ( form1 ) form1.value = ymd; 252}; 253 254// 2011.02.09 DYN追å 255// ã«ã¬ã³ãã¼ããæ¥ä»ãã¼ã¿ãæ»ã 256JKL.Calendar.prototype.SetCalenderYmd = function (ymd) { 257 var warrArray = new Array; 258 var warrY; 259 var warrM; 260 var warrD; 261 var cnt; 262 263 warrArray = ymd.split('/'); 264 warrYãã = warrArray[0]; 265 warrMãã = Number(warrArray[1]); 266 warrDãã = Number(warrArray[2]); 267 268 objfrm.cmbARRY.value = warrY; 269 objfrm.cmbARRM.value = warrM; 270 objfrm.cmbARRD.value = warrD; 271}; 272 273// ã«ã¬ã³ãã¼è¡¨ç¤ºæ¬ã表示ãã 274 275JKL.Calendar.prototype.show = function () { 276 this.getCalendarElement().style.display = ""; 277}; 278 279// ã«ã¬ã³ãã¼è¡¨ç¤ºæ¬ãå³åº§ã«é ã 280 281JKL.Calendar.prototype.hide = function () { 282 this.getCalendarElement().style.display = "none"; 283}; 284 285// ã«ã¬ã³ãã¼è¡¨ç¤ºæ¬ããã§ã¼ãã¢ã¦ããã 286 287JKL.Calendar.prototype.fadeOut = function (s) { 288 if ( JKL.Opacity ) { 289 this.getOpacityObject().fadeOut(s); 290 } else { 291 this.hide(); 292 } 293}; 294 295// æåä½ã§ç§»åãã 296 297JKL.Calendar.prototype.moveMonth = function ( mon ) { 298 // åã¸ç§»å 299 if ( ! this.date ) this.initDate(); 300 for( ; mon<0; mon++ ) { 301 this.date.setDate(1); // æ¯æ1æ¥ã®1æ¥åã¯å¿ ãåã®æ 302 this.date.setTime( this.date.getTime() - (24*3600*1000) ); 303 } 304 // å¾ã¸ç§»å 305 for( ; mon>0; mon-- ) { 306 this.date.setDate(1); // æ¯æ1æ¥ã®32æ¥å¾ã¯å¿ ãæ¬¡ã®æ 307 this.date.setTime( this.date.getTime() + (24*3600*1000)*32 ); 308 } 309 this.date.setDate(1); // 彿ã®1æ¥ã«æ»ã 310 this.write(); // æç»ãã 311}; 312 313// ã¤ãã³ããç»é²ãã 314 315JKL.Calendar.prototype.addEvent = function ( elem, ev, func ) { 316// prototype.js ãããã°å©ç¨ãã(IEã¡ã¢ãªãªã¼ã¯åé¿) 317 if ( window.Event && Event.observe ) { 318 Event.observe( elem, ev, func, false ); 319 } else { 320 elem["on"+ev] = func; 321 } 322} 323 324// ã«ã¬ã³ãã¼ãæç»ãã 325 326JKL.Calendar.prototype.write = function () { 327 var date = new Date(); 328 if ( ! this.date ) this.initDate(); 329 date.setTime( this.date.getTime() ); 330 331 var year = date.getFullYear(); // æå®å¹´ 332 var mon = date.getMonth(); // æå®æ 333 var today = date.getDate(); // æå®æ¥ 334 var form1 = this.getFormElement(); 335 336 // 2013.10.18 DYN æå®æã®ç¥æ¥ãåãåºã 337 var holy = new Array(); 338 for (var i = 0; i < this.holiday.length; i++) { 339 var ymd = this.holiday[i].split('/'); 340 if (ymd[0] == year && ymd[1] == mon+1) {
341 holy.push(ymd[2]); 342 } 343 } 344 345 346// 2011.6.17 DYN æ·±å¤è²©å£²æéãè¨å®ï¼é常ã¯0ãè¨å®ï¼ 347 var midnight = 5; 348 var checktime = new Date(); 349 var hours = (new Date(checktime.getHours())).getTime(); 350 351 // 鏿å¯è½ãªæ¥ä»ç¯å² 352 var min; 353 if ( this.min_date ) { 354 355 // 2011.6.17 DYN æåã«æ·±å¤è²©å£²ï¼midnightæï¼ã¾ã§ãã©ããããã§ãã¯ãã 356 if ( midnight > hours ){ 357 this.min_date.setDate(checktime.getDate() - 1); 358 var tmp = new Date( this.min_date.getFullYear(), this.min_date.getMonth(), this.min_date.getDate() ); 359 }else{ 360 var tmp = new Date( this.min_date.getFullYear(), this.min_date.getMonth(), this.min_date.getDate() ); 361 } 362 min = tmp.getTime(); 363 } 364 var max; 365 if ( this.max_date ) { 366 var tmp = new Date( this.max_date.getFullYear(), 367 this.max_date.getMonth(), this.max_date.getDate() ); 368 max = tmp.getTime(); 369 } 370 371 // ç´åã®æææ¥ã¾ã§æ»ã 372 date.setDate(1); // 1æ¥ã«æ»ã 373 var wday = date.getDay(); // ææ¥ æ¥æ(0)ï½åæ(6) 374 375// 2006.11.15 MOM 表示éå§ææ¥ãå¯å¤ã«ããã®ã§ããã¸ãã¯ã¡ãã£ã¨ãããã¾ãã 376 if ( wday != this.start_day ) { 377 date.setTime( date.getTime() - (24*3600*1000)*((wday-this.start_day+7)%7) ); 378 } 379 380 381 // æå¤§ã§7æ¥Ã6é±éï¼42æ¥åã®ã«ã¼ã 382 var list = new Array(); 383 for( var i=0; i<42; i++ ) { 384 var tmp = new Date(); 385 tmp.setTime( date.getTime() + (24*3600*1000)*i ); 386 if ( i && i%7==0 && tmp.getMonth() != mon ) break; 387 list[list.length] = tmp; 388 } 389 390 // ã¹ã¿ã¤ã«ã·ã¼ããçæãã 391 var month_table_style = 'width: 100%; '; 392 month_table_style += 'background: '+this.style.frame_color+'; '; 393 month_table_style += 'border: 1px solid '+this.style.frame_color+';'; 394 395 var week_table_style = 'width: 100%; '; 396 week_table_style += 'background: '+this.style.day_bgcolor+'; '; 397 week_table_style += 'border-left: 1px solid '+this.style.frame_color+'; '; 398 week_table_style += 'border-right: 1px solid '+this.style.frame_color+'; '; 399 400 var days_table_style = 'width: 100%; '; 401 days_table_style += 'background: '+this.style.day_bgcolor+'; '; 402 days_table_style += 'border: 1px solid '+this.style.frame_color+'; '; 403 404 var month_td_style = ""; 405// 2007.02.04 MOM TDã¿ã°ãèæ¯è²ã®ã¹ã¿ã¤ã«ãæç¤ºçã«æå®ãã 406 month_td_style += 'background: '+this.style.frame_color+'; '; 407 month_td_style += 'font-size: '+this.style.font_size+'; '; 408 month_td_style += 'color: '+this.style.month_color+'; '; 409 month_td_style += 'padding: 4px 0px 2px 0px; '; 410 month_td_style += 'text-align: center; '; 411 month_td_style += 'font-weight: bold;'; 412 413 var week_td_style = ""; 414// 2007.02.04 MOM TDã¿ã°ãèæ¯è²ã®ã¹ã¿ã¤ã«ãæç¤ºçã«æå®ãã 415 week_td_style += 'background: '+this.style.day_bgcolor+'; '; 416 week_td_style += 'font-size: '+this.style.font_size+'; '; 417 week_td_style += 'padding: 2px 0px 2px 0px; '; 418 week_td_style += 'font-weight: bold;'; 419 week_td_style += 'text-align: center;'; 420 421 var days_td_style = ""; 422// 2007.02.04 MOM TDã¿ã°ãèæ¯è²ã®ã¹ã¿ã¤ã«ãæç¤ºçã«æå®ãã 423 days_td_style += 'background: '+this.style.day_bgcolor+'; '; 424 days_td_style += 'font-size: '+this.style.font_size+'; '; 425 days_td_style += 'padding: 1px; '; 426 days_td_style += 'text-align: center; '; 427 days_td_style += 'font-weight: bold;'; 428 429 var days_unselectable = "font-weight: normal;"; 430 431 // HTMLã½ã¼ã¹ãçæãã 432 var src1 = ""; 433 434// 2006.11.23 MOM éªéãª<select>ã¸ã®å¿æ¥å¦ç½®ãã®ï¼ 435// ãã¼ãã«ãdivã§å²ãã§ä¸ä½ã¬ã¤ã¤ã«è¨å®(z-indexã®å¤ã大ãããã¦ãã) 436// 2006.11.27 MOM æç»ãã£ã¼ã«ãã®é«ããåå¾ãããããidãã»ãããã¦ãã 437 src1 += '<div id="'+this.eid+'_screen" style="position:relative;z-index:'+(this.zindex+1)+';">\n'; 438 439 src1 += '<table border="0" cellpadding="0" cellspacing="0" style="'+month_table_style+'"><tr>'; 440 src1 += '<td id="__'+this.eid+'_btn_prev" title="åã®æã¸" style="'+month_td_style+'">âª</td>'; 441 src1 += '<td style="'+month_td_style+'"> </td>'; 442// 2006.12.04 ksuzu 表示æãã¯ãªãã¯ããã¨ç¾å¨ã®æã«ç§»å 443 src1 += '<td id="__'+this.eid+'_btn_today" style="'+month_td_style+'">'+(year)+'å¹´ '+(mon+1)+'æ</td>'; 444 src1 += '<td id="__'+this.eid+'_btn_close" title="éãã" style="'+month_td_style+'">
444Ã</td>'; 445 src1 += '<td id="__'+this.eid+'_btn_next" title="æ¬¡ã®æã¸" style="'+month_td_style+'">â«</td>'; 446 src1 += "</tr></table>\n"; 447 src1 += '<table border="0" cellpadding="0" cellspacing="0" style="'+week_table_style+'"><tr>'; 448 449// 2006.11.15 MOM 表示éå§ææ¥start_dayããé ã«ä¸é±éå表示ãã 450 for(var i = this.start_day; i < this.start_day + 7; i++){ 451 var _wday = i%7; 452 if(_wday == 0){ 453 src1 += '<td style="color: '+this.style.sunday_color+'; '+week_td_style+'">æ¥</td>'; 454 }else if(_wday == 6){ 455 src1 += '<td style="color: '+this.style.saturday_color+'; '+week_td_style+'">å</td>'; 456 }else{ 457 src1 += '<td style="color: '+this.style.weekday_color+'; '+week_td_style+'">'; 458 if(_wday == 1) src1 += 'æ</td>'; 459 else if(_wday == 2) src1 += 'ç«</td>'; 460 else if(_wday == 3) src1 += 'æ°´</td>'; 461 else if(_wday == 4) src1 += 'æ¨</td>'; 462 else if(_wday == 5) src1 += 'é</td>'; 463 } 464 } 465 466 467 src1 += "</tr></table>\n"; 468 src1 += '<table border="0" cellpadding="0" cellspacing="0" style="'+days_table_style+'">'; 469 470 var curutc; 471 if ( form1 && form1.value ) { 472 var splt = form1.value.split(this.spliter); 473 if ( splt[0] > 0 && splt[2] > 0 ) { 474 var curdd = new Date( splt[0]-0, splt[1]-1, splt[2]-0 ); 475 curutc = curdd.getTime(); // ãã©ã¼ã ä¸ã®å½æ¥ 476 } 477 } 478 479//2006.11.23 MOM 仿¥æ¥ä»ãåå¾ããæåç§ãåãæ¨ã¦ã 480 var realdd = new Date(); 481 var realutc = (new Date(realdd.getFullYear(),realdd.getMonth(),realdd.getDate())).getTime(); 482 483 for ( var i=0; i<list.length; i++ ) { 484 var dd = list[i]; 485 var ww = dd.getDay(); 486 var mm = dd.getMonth(); 487 488 if ( ww == this.start_day ) { 489 src1 += "<tr>"; // 表示éå§ææ¥ã®åã«è¡é 490 } 491 492 var cc = days_td_style; 493 var utc = dd.getTime(); 494 495 if ( mon == mm ) { 496 497//2006.11.23 MOM æåã«ä»æ¥æ¥ä»ãã©ããããã§ãã¯ãã 498//â»å½æã§ãªãå ´åã«ãè²å¤ããã¨é¸æã§ãããã«è¦ãã¦ç´ããããã®ã§ã彿ãã¤ä»æ¥æ¥ä»ã®å ´åã®ã¿è²ãå¤ãã 499 if ( utc == realutc ){ 500 cc += "color: "+this.style.today_color+";"; // 仿¥æ¥ä» 501 } else 502 503 //s131018 t-suhara 彿ã®ç¥æ¥ã追å 504 if (dd.getDate() == holy[0]) { 505 cc += "color: " + this.style.holiday_color + ";"; 506 holy = holy.slice(1); 507 } else 508 //e131018 t-suhara 509 if (ww == 0) { 510 cc += "color: " + this.style.sunday_color + ";"; // å½æã®æ¥ææ¥ 511 } else if (ww == 6) { 512 cc += "color: " + this.style.saturday_color + ";"; // 彿ã®åææ¥ 513 } else { 514 cc += "color: " + this.style.weekday_color + ";"; // 彿ã®å¹³æ¥ 515 } 516 517 } else { 518 cc += "color: "+this.style.others_color+";"; // åææ«ã¨ç¿æåã®æ¥ä» 519 } 520 521//2006.11.23 MOM utcã®å¤æ°å®£è¨ãâã«ç§»å 522// var utc = dd.getTime(); 523 524// 2006.11.30 MOM 鏿å¯è½ãªææ¥æå®ã®æ¡ä»¶è¿½å 525// if (( min && min > utc ) || ( max && max < utc )) { 526 if (( min && min > utc ) || ( max && max < utc ) || ( !this.selectable_days[dd.getDay()] )) { 527 cc += days_unselectable; 528 } 529 if ( utc == curutc ) { // ãã©ã¼ã ä¸ã®å½æ¥ 530 cc += "background: "+this.style.day_hover_bgcolor+";"; 531 } 532// 2006.11.30 MOM 仿¥æ¥ä»ã®èæ¯è² 533 else if ( mon == mm && utc == realutc ) { 534 cc += "background: "+this.style.today_bgcolor+";"; 535 } 536// 2006.11.30 MOM 鏿ä¸å¯è½ãªæ¥ä»ã®èæ¯è² 537 else if (( min && min > utc ) || ( max && max < utc ) || ( !this.selectable_days[dd.getDay()] )) { 538 cc += 'background: '+this.style.unselectable_day_bgcolor+';'; 539 } 540 541//2006.11.23 MOM æ ç·æç»ã追å 542 if ( this.draw_border ){ 543 if ( mon == mm && utc == realutc ){ 544 cc += "border:solid 1px "+this.style.today_border_color+";"; // 彿ãã¤ä»æ¥æ¥ä» 545 } else { 546 cc += "border:solid 1px "+this.style.others_border_color+";"; // ãã®ä» 547 } 548 } 549 550 var ss = this.getDateYMD(dd); 551 var tt = dd.getDate(); 552 553 src1 += '<td style="'+cc+'" title='+ss+' id="__'+this.eid+'_td_'+ss+'">'+tt+'</td>'; 554 555 if ( ww == (this.start_day+6)%7 ) { 556 src1 += "</tr>\n"; // 表示éå§ææ¥ã®ï¼ã¤æåã§è¡æ« 557 } 558 } 559 src1 += "</table>\n"; 560 561 src1 += '</div>\n'; 562 563 // ã«ã¬ã³ãã¼ãæ¸ãæãã 564 var cal1 = this.getCalendarElement(); 565 if ( ! cal1 ) return; 566 cal1.style.width = this.style.frame_width; 567 cal1.style.position = "absolute"; 568 cal1.innerHTML = src1; 569 570 571// 2006.11.23 MOM éªéãª<select>ã¸ã®å¿æ¥å¦ç½®ãã®ï¼ 572// ã«ã¬ã³ãã¼ã¨å ¨ãåããµã¤ãºã®IFRAMEãçæãã座æ¨ãä¸è´ããã¦ä¸ä½ã¬ã¤ã¤ã«æç»ãã 573 574// IFRAME対å¿ãå¯è½ãªãã¼ã¸ã§ã³ã®ã¿å¦ç½®ãæ½ã 575 var ua = navigator.userAgent; 576 if( ua.indexOf("MSIE 5.5") >= 0 || ua.indexOf("MSIE 6") >= 0 ){ 577 578// 2006.11.27 MOM å ã«innerHTMLã«ã«ã¬ã³ãã¼ã®å®ä½ã渡ãã¦ããã¦ãæç»ãã£ã¼ã«ãã®é«ããåå¾ãã 579// â»hide()ãå¼ã°ããç´å¾ã ã¨ãoffsetHeightã0ã«ãªã£ã¦ãã¾ãã®ã§ã䏿çã«showãå¼ã¶ 580 this.show(); 581 var screenHeight = cal1.document.getElementById(this.eid+"_screen").offsetHeight; 582 this.hide(); 583 584 src1 += '<div style="position:absolute;z-index:'+this.zindex+';top:0px;left:0px;">'; 585 src1 += '<iframe /?scid="dummy.htm" frameborder=0 scrolling=no width='+this.style.frame_width+' height='+screenHeight+'></iframe>'; 586 src1 += '</div>\n'; 587 588//æ¹ãã¦innerHTMLã«ã»ãã 589 cal1.innerHTML = src1; 590 } 591 592 593 594 // ã¤ãã³ããç»é²ãã 595 var __this = this; 596 var get_src = function (ev) { 597 ev = ev || window.event; 598 var src = ev.target || ev.srcElement; 599 return src; 600 }; 601 var month_onmouseover = function (ev) { 602 var src = get_src(ev); 603 src.style.color = __this.style.month_hover_color; 604 src.style.background = __this.style.month_hover_bgcolor; 605 }; 606 var month_onmouseout = function (ev) { 607 var src = get_src(ev); 608 src.style.color = __this.style.month_color; 609 src.style.background = __this.style.frame_color; 610 }; 611 var day_onmouseover = function (ev) { 612 var src = get_src(ev); 613 src.style.background = __this.style.day_hover_bgcolor; 614 }; 615 var day_onmouseout = function (ev) { 616 var src = get_src(ev); 617// 2006.11.30 MOM 彿ãã¤ä»æ¥æ¥ä»ã§ããã°ã仿¥æ¥ä»ç¨ã®èæ¯è²ãé©ç¨ 618 var today = new Date(); 619 if( today.getMonth() == __this.date.getMonth() && src.id == '__'+__this.eid+'_td_'+__this.getDateYMD(today) ){ 620 src.style.background = __this.style.today_bgcolor; 621 }else{ 622 src.style.background = __this.style.day_bgcolor; 623 } 624 }; 625 var day_onclick = function (ev) { 626 var src = get_src(ev); 627 var srcday = src.id.substr(src.id.length-10); 628// __this.setFormValue( srcday ); 629 __this.SetCalenderYmd( srcday ); 630 __this.fadeOut( 1.0 ); 631 }; 632 633// 634// 2006.12.04 ksuzu 鏿ã§ããªãæã¸ã®ãªã³ã¯ã¯ä½æããªã 635// 636 // åã®æã¸ãã¿ã³ 637 var tdprev = document.getElementById( "__"+this.eid+"_btn_prev" ); 638 //åã®æã®æçµæ¥ 639 var tmpDate = new Date(year,mon,1); 640 tmpDate.setTime( tmpDate.getTime() - (24*3600*1000) ); 641 //鏿å¯è½ãªæ¥ãããï¼ 642 if ( !min || this.min_date <= tmpDate ){ 643 tdprev.style.cursor = this.style.cursor; 644 this.addEvent( tdprev, "mouseover", month_onmouseover ); 645 this.addEvent( tdprev, "mouseout", month_onmouseout ); 646 this.addEvent( tdprev, "click", function(){ __this.moveMonth( -1 ); }); 647 } 648 //鏿ä¸å¯è½ 649 else{ 650 tdprev.title = "åã®æã¯é¸æã§ãã¾ãã"; 651 } 652 653 654// 655// 2006.12.04 ksuzu 表示æãã¯ãªãã¯ããã¨ç¾å¨ã®æã«ç§»å 656// 657 var nMov = (realdd.getFullYear() - year) * 12 + (realdd.getMonth() - mon); 658 if ( nMov != 0 ){ 659 // ç¾å¨ã®æã¸ãã¿ã³ 660 var tdtoday = document.getElementById( "__"+this.eid+"_btn_today" ); 661 tdtoday.style.cursor = this.style.cursor; 662 tdtoday.title = "ç¾å¨ã®æã¸"; 663 this.addEvent( tdtoday, "mouseover", month_onmouseover ); 664 this.addEvent( tdtoday, "mouseout", month_onmouseout ); 665 this.addEvent( tdtoday, "click", function(){ __this.moveMonth( nMov ); }); 666 } 667 668 // éãããã¿ã³ 669 var tdclose = document.getElementById( "__"+this.eid+"_btn_close" ); 670 tdclose.style.cursor = this.style.cursor; 671 this.addEvent( tdclose, "mouseover", month_onmouseover ); 672 this.addEvent( tdclose, "mouseout", month_onmouseout ); 673 674// 675// 2006.12.04 ksuzu ã«ã¬ã³ãã¼ã®åæè¡¨ç¤ºãæ»ã 676// 677 this.addEvent( tdclose, "click", function(){ __this.getFormValue(); __this.hide(); }); 678 679// 680// 2006.12.04 ksuzu 鏿ã§ããªãæã¸ã®ãªã³ã¯ã¯ä½æããªã 681// 682 // æ¬¡ã®æã¸ãã¿ã³ 683 var tdnext = document.getElementById( "__"+this.eid+"_btn_next" ); 684 //æ¬¡ã®æã®åæ¥ 685 var tmpDate = new Date(year,mon,1); 686 tmpDate.setTime( tmpDate.getTime() + (24*3600*1000)*32 ); 687 tmpDate.setDate(1); 688 //鏿å¯è½ãªæ¥ãããï¼ 689 if ( !max || this.max_date >= tmpDate ){ 690 tdnext.style.cursor = this.style.cursor; 691 this.addEvent( tdnext, "mouseover", month_onmouseover ); 692 this.addEvent( tdnext, "mouseout", month_onmouseout ); 693 this.addEvent( tdnext, "click", function(){ __this.moveMonth( +1 ); }); 694 } 695 //鏿ä¸å¯è½ 696 else{ 697 tdnext.title = "æ¬¡ã®æã¯é¸æã§ãã¾ãã"; 698 } 699 700 701 // ã»ã«ãã¨ã®ã¤ãã³ããç»é²ãã 702 for ( var i=0; i<list.length; i++ ) { 703 var dd = list[i]; 704 if ( mon != dd.getMonth() ) continue; // 仿ã®ã»ã«ã«ã®ã¿è¨å®ãã 705 706 var utc = dd.getTime(); 707 if ( min && min > utc ) continue; // æéãã 708 if ( max && max < utc ) continue; // æªæ¥éãã 709// if ( utc == curutc ) continue; // ãã©ã¼ã ä¸ã®å½æ¥ 710// 2006.11.30 MOM 鏿å¯è½ãªææ¥æå®å¯¾å¿ 711 if ( !this.selectable_days[dd.getDay()] ) continue; 712 713 var ss = this.getDateYMD(dd); 714 var cc = document.getElementById( "__"+this.eid+"_td_"+ss ); 715 if ( ! cc ) continue; 716 717 cc.style.cursor = this.style.cursor; 718 this.addEvent( cc, "mouseover", day_onmouseover ); 719 this.addEvent( cc, "mouseout", day_onmouseout ); 720 this.addEvent( cc, "click", day_onclick ); 721 } 722 723 // 表示ãã 724 this.show(); 725 726}; 727 728 729// æ§ãã¼ã¸ã§ã³äºæï¼typoï¼ 730JKL.Calendar.prototype.getCalenderElement = JKL.Calendar.prototype.getCalendarElement; 731JKL.Calender = JKL.Calendar;
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.