diff --git a/src/dede/css/base.css b/src/dede/css/base.css index 5579a04e..e78e065d 100755 --- a/src/dede/css/base.css +++ b/src/dede/css/base.css @@ -1,2 +1,643 @@ -*{font-size:12px;font-family:"宋体";}td{line-height:1.5;}body{font-size:12px;line-height:1.5;font-family:"宋体";background-color:#FFF;}form,h1,h2,h3,ul,ol,div{margin:0;padding:0;}td,th,div{word-break:break-all;word-wrap:break-word;}b,strong{color:#666600;}li,dd{list-style-type:none;margin:0px;padding:0px;}input{border:1px solid #ababab;zoom:expression(function(ele){(ele.type=='button'||ele.type=='submit'||ele.type=='reset') ? ele.className='coolbg':(ele.type=='text' ? ele.className='alltxt':'');(ele.type=='radio'||ele.type=='checkbox') ? ele.className='np':'';ele.style.zoom = '1';}(this));}input{background:url(../images/input.png) repeat-x scroll 0px 0px;}select{padding:3px;}input[type="button"],input[type="submit"],input[type="reset"]{border:none;border-right:1px solid #ACACAC;border-bottom:1px solid #ACACAC;background-color:#F1F8B4;padding:2px;padding-right:5px;padding-left:5px;background:url(../images/allbtbg2.gif) #EFF7D0;cursor:pointer;}input[type="text"],input[type="password"]{border-width:1px;border-style:solid;border-color:#707070 #CECECE #CECECE #707070;padding:2px 4px;height:18px;line-height:18px;vertical-align:middle;}input[type="text"]:focus,input[type="password"]:focus{border-color:#A5C760;color:#333;-moz-box-shadow:0 0 3px #A5C760;-webkit-box-shadow:0 0 3px #A5C760;box-shadow:0 0 3px #A5C760;outline:none ;}.alltxt{height:18px;line-height:18px;padding:3px 3px 2px 3px;vertical-align:middle;border-width:1px;border-style:solid;border-color:#707070 #CECECE #CECECE #707070;}textarea{background:url(../images/input.png) #fff repeat-x scroll 0px 0px;border-width:1px;border-style:solid;border-color:#707070 #CECECE #CECECE #707070;padding:2px 4px;vertical-align:middle;line-height:16px;overflow:auto;}textarea:focus{border-color:#A5C760;color:#333;-moz-box-shadow:0 0 3px #A5C760;-webkit-box-shadow:0 0 3px #A5C760;box-shadow:0 0 3px #A5C760;}h1{color:#171B16;font-size:130%;font-weight:bold;}h2{color:#171B16;font-size:115%;font-weight:bold;}h3{color:#171B16;font-size:100%;font-weight:bold;}a:link{font-size:9pt;color:#000000;text-decoration:none;font-family:""宋体"";}a:visited{font-size:9pt;color:#000000;text-decoration:none;font-family:""宋体"";}a:hover{color:red;font-family:""宋体"";}a img{border-style:none;}b a{color:#666600;}strong a{color:#666600;}a b{color:#666600;}a strong{color:#666600;}.pubinputs{height:16px;line-height:16px;width:250px;padding:4px 0px 2px 0px;border-width:1px;border-style:solid;border-color:#999999 #dddddd #dddddd #999999;}.iptxt{height:14px;line-height:14px;padding:4px 3px 2px 3px;border-width:1px;border-style:solid;border-color:#999999 #dddddd #dddddd #999999;}.pubinput{height:24px;width:250px;padding-top:3px;padding-bottom:0px;}.pubinputl{height:24px;width:350px;padding-top:3px;padding-bottom:0px;}.np{border:none;}.linerow{border-bottom:1px solid #ACACAC;}.coolbg{border:none;border-right:1px solid #ACACAC;border-bottom:1px solid #ACACAC;padding:2px;padding-right:5px;padding-left:5px;background:#CCC url(../images/allbtbg2.gif);cursor:pointer;}.coolbg2{border:1px solid #000000;background-color:#DFDDD2;height:18px}.ll{border-right:2px solid #ACACAC;border-bottom:2px solid #ACACAC;background-color:#E6E6E6}.bline{border-bottom:1px dotted #BCBCBC;height:28px;background-color:#FFFFFF;}#uploadfield{float:left;}.bline2{border-bottom:1px solid #BCBCBC;}.coolbt{border-left:1px solid #EFEFEF;border-top:1px solid #EFEFEF;border-right:1px solid #ACACAC;border-bottom:1px solid #ACACAC;background-color:#E4F7D7;cursor:pointer;}.coolbt2{border-left:1px solid #EFEFEF;border-top:1px solid #EFEFEF;border-right:1px solid #ACACAC;border-bottom:1px solid #ACACAC;background-color:#F7FCDA}.coolbg3{border:1px solid #BDC5B4;background-color:#DFDDD2;height:20px;width:140px;text-align:right;}.coolbg61{line-height:26px;width:380px;border-top:1px solid #BDC5B4;border-left:1px solid #BDC5B4;border-right:1px solid #BDC5B4;height:26px;text-align:right;background-color:#E7F3B1;}.coolbg62{border:1px solid #BDC5B4;background-color:#F8FDF0;height:300px;width:380px;padding:5px;}.coolbg4{border-bottom:1px solid #C9CFC1;background-color:#F9FCDC;background:url(../images/dlgtitle.gif) repeat-x;height:24px;line-height:24px;width:190px;text-align:right;}.coolbg5{border-top:1px solid #BDC5B4;background-color:#F9FCDC;font-size:1pt;height:6px;width:190px;}.wsselect{height:60px;line-height:24px - overflow-y:auto;overflow:auto;background-color:#FCFEF1;scrollbar-face-color:#ffffff;scrollbar-highlight-color:#919192;scrollbar-shadow-color:#919192;scrollbar-3dlight-color:#ffffff;scrollbar-arrow-color:#919192;scrollbar-track-color:#ffffff;scrollbar-darkshadow-color:#ffffff;}.dlg{border:2px solid #749F4D;background-color:#F0FAEB;padding:2px;width:360px;line-height:160%;}.pubdlg{z-index:8888;border:5px solid #749F4D;background-color:#fff;}.pubdlg .title{border-bottom:1px solid #C9CFC1;background-color:#F9FCDC;background:url(../images/dlgtitle.gif) repeat-x;height:28px;line-height:28px;text-align:left;cursor:move;}.pubdlg .titLeft{float:left;padding-left:8px;line-height:28px;font-weight:bold;color:#555;}.pubdlg .titRight{float:right;padding:0px;}.fullpagediv{z-index:1999;top:0;left:0;background:#cdcdcd;filter:Alpha(opacity=50);-moz-opacity:.5;opacity:0.5;position:absolute;width:100%;height:2500px;}.quicksel{z-index:10005;width:680px;height:420px;margin-left:5px;margin-top:5px;overflow:auto;scrollbar-face-color:#ffffff;scrollbar-highlight-color:#919192;scrollbar-shadow-color:#919192;scrollbar-3dlight-color:#ffffff;scrollbar-arrow-color:#919192;scrollbar-track-color:#ffffff;scrollbar-darkshadow-color:#ffffff;}.quickselfoot{padding-top:8px;border-top:1px dashed #C0CC9D;}.quickselItem{margin-bottom:8px;}.quickselItem .topcat{font-weight:bold;clear:both;line-height:24px;border-bottom:1px dashed #ccc;background:#FBFEEF;padding-left:5px;}.quickselItem .soncat{padding-left:10px;}.quickselItem .item{float:left;margin-right:8px;}.mysource,.mywriter{z-index:10001;border:5px solid #749F4D;background-color:#F0FAEB;padding:2px;width:280px;line-height:160%;}.dlgws div{width:100%;}.dlgTesttitle{border:2px solid #749F4D;background-color:#F0FAEB;padding:2px;width:300px;line-height:150%;}#_mysource{z-index:10003;}#_mywriter{z-index:10004;}#uploadwait{z-index:19999;}.option1{background-color:#DCECA6;}.option2{background-color:#F7FBD2;}.option3{background-color:#FFFFFF;}.ininput{width:96%;height:20px;border:1px solid #ffffff;}.nbt{padding:1px;background-image:url('../images/allbtbg.gif');background-color:#ffffff;border:1px solid #A5AF83;}.tdt{padding-left:6px;}.waitpage{top:0;left:0;filter:Alpha(opacity=70);-moz-opacity:0.7;position:absolute;z-index:10000;background:url(../../images/loading1.gif) #ababab center no-repeat;}.divpre img{max-width:150px;max-height:100px;}.divpre{overflow:hidden;}.autoinput{padding-left:3px;width:90%;}.bodytitle{margin:auto;height:28px;border:1px dotted #BFD67C;background:url('../images/wbg.gif');margin-bottom:6px;width:98%;font-weight:bold;}.bodytitle div{float:left}.bodytitletxt{padding-left:6px;line-height:28px;}.tbtitle td{padding:3px;}.tblist td{background:#FFFFFF;padding:6px;}.tblist td.tbsname{background:#F9FFE6;padding:6px;}.colordlg{width:100px;z-index;10005;border:2px dashed #749F4D;background-color:#F0FAEB;padding:2px;line-height:160%;}option.alltype{height:18px;line-height:18px;font-size:12px;padding-left:16px;background:url(../images/arr4.gif) 3px 4px no-repeat;}option.btype{height:18px;line-height:18px;font-size:12px;padding-left:16px;background:url(../images/arr4.gif) 3px 4px no-repeat;}option.stype{height:18px;line-height:18px;font-size:12px;padding-left:24px;background:url(../images/arrr.gif) 11px 4px no-repeat;}.ilist{border-top:1px dashed #BCBCBC;border-bottom:1px dashed #BCBCBC;border-left:1px dashed #BCBCBC;}.ilist td{border-right:1px dashed #BCBCBC;}#typeid2{border:0px;padding:0px;background:#ccc;height:18px;font-size:12px;padding-left:10px;background:url(../images/typeid2bg.gif) no-repeat;float:left;}.litpic_span{width:77px;overflow:hidden;height:21px;*vertical-align:3px;margin-left:-60px;*margin-left:-75px;cursor:pointer;}#litpic{width:85px;height:20px;margin-left:-20px;filter:alpha(opacity=00);-moz-opacity:.0;opacity:0.0;cursor:pointer;}#starttime,#endtime,#pubdate{background:url(../images/calendar.gif) 3px no-repeat;padding-left:23px;}#title{background:url(../images/ruler.gif) repeat-x 0px 5px;}.spec{width:60px;}.gtab a{width:80px;text-align:center;display:block;float:left;height:26px;line-height:26px;} \ No newline at end of file +* { + font-size: 12px; + font-family: "宋体"; +} + +td { + line-height: 1.5; +} + +body { + font-size: 12px; + line-height: 1.5; + font-family: "宋体"; + background-color: #FFF; +} + +form,h1,h2,h3,ul,ol,div { + margin: 0; + padding: 0; +} + +td,th,div { + word-break: break-all; + word-wrap: break-word; +} + +b,strong { + color: #666600; +} + +li,dd { + list-style-type: none; + margin: 0px; + padding: 0px; +} + +input { + border: 1px solid #ababab; + zoom: expression(function(ele){(ele.type=='button'||ele.type=='submit'||ele.type=='reset') ? ele.className='coolbg':(ele.type=='text' ? ele.className='alltxt':''); + (ele.type=='radio'||ele.type=='checkbox') ? ele.className='np': ''; + ele.style.zoom = '1'; +}(this)); +} + +input { +background: url(../images/input.png) repeat-x scroll 0px 0px; +} + +select { +padding: 3px; +} + +input[type="button"],input[type="submit"],input[type="reset"] { +border: none; +border-right: 1px solid #ACACAC; +border-bottom: 1px solid #ACACAC; +background-color: #F1F8B4; +padding: 2px; +padding-right: 5px; +padding-left: 5px; +background: url(../images/allbtbg2.gif) #EFF7D0; +cursor: pointer; +} + +input[type="text"],input[type="password"] { +border-width: 1px; +border-style: solid; +border-color: #707070 #CECECE #CECECE #707070; +padding: 2px 4px; +height: 18px; +line-height: 18px; +vertical-align: middle; +} + +input[type="text"]:focus,input[type="password"]:focus { +border-color: #A5C760; +color: #333; +-moz-box-shadow: 0 0 3px #A5C760; +-webkit-box-shadow: 0 0 3px #A5C760; +box-shadow: 0 0 3px #A5C760; +outline: none; +} + +.alltxt { +height: 18px; +line-height: 18px; +padding: 3px 3px 2px 3px; +vertical-align: middle; +border-width: 1px; +border-style: solid; +border-color: #707070 #CECECE #CECECE #707070; +} + +textarea { +background: url(../images/input.png) #fff repeat-x scroll 0px 0px; +border-width: 1px; +border-style: solid; +border-color: #707070 #CECECE #CECECE #707070; +padding: 2px 4px; +vertical-align: middle; +line-height: 16px; +overflow: auto; +} + +textarea:focus { +border-color: #A5C760; +color: #333; +-moz-box-shadow: 0 0 3px #A5C760; +-webkit-box-shadow: 0 0 3px #A5C760; +box-shadow: 0 0 3px #A5C760; +} + +h1 { +color: #171B16; +font-size: 130%; +font-weight: bold; +} + +h2 { +color: #171B16; +font-size: 115%; +font-weight: bold; +} + +h3 { +color: #171B16; +font-size: 100%; +font-weight: bold; +} + +a:link { +font-size: 9pt; +color: #000000; +text-decoration: none; +font-family: ""宋体""; +} + +a:visited { +font-size: 9pt; +color: #000000; +text-decoration: none; +font-family: ""宋体""; +} + +a:hover { +color: red; +font-family: ""宋体""; +} + +a img { +border-style: none; +} + +b a { +color: #666600; +} + +strong a { +color: #666600; +} + +a b { +color: #666600; +} + +a strong { +color: #666600; +} + +.pubinputs { +height: 16px; +line-height: 16px; +width: 250px; +padding: 4px 0px 2px 0px; +border-width: 1px; +border-style: solid; +border-color: #999999 #dddddd #dddddd #999999; +} + +.iptxt { +height: 14px; +line-height: 14px; +padding: 4px 3px 2px 3px; +border-width: 1px; +border-style: solid; +border-color: #999999 #dddddd #dddddd #999999; +} + +.pubinput { +height: 24px; +width: 250px; +padding-top: 3px; +padding-bottom: 0px; +} + +.pubinputl { +height: 24px; +width: 350px; +padding-top: 3px; +padding-bottom: 0px; +} + +.np { +border: none; +} + +.linerow { +border-bottom: 1px solid #ACACAC; +} + +.coolbg { +border: none; +border-right: 1px solid #ACACAC; +border-bottom: 1px solid #ACACAC; +padding: 2px; +padding-right: 5px; +padding-left: 5px; +background: #CCC url(../images/allbtbg2.gif); +cursor: pointer; +} + +.coolbg2 { +border: 1px solid #000000; +background-color: #DFDDD2; +height: 18px +} + +.ll { +border-right: 2px solid #ACACAC; +border-bottom: 2px solid #ACACAC; +background-color: #E6E6E6 +} + +.bline { +border-bottom: 1px dotted #BCBCBC; +height: 28px; +background-color: #FFFFFF; +} + +#uploadfield { +float: left; +} + +.bline2 { +border-bottom: 1px solid #BCBCBC; +} + +.coolbt { +border-left: 1px solid #EFEFEF; +border-top: 1px solid #EFEFEF; +border-right: 1px solid #ACACAC; +border-bottom: 1px solid #ACACAC; +background-color: #E4F7D7; +cursor: pointer; +} + +.coolbt2 { +border-left: 1px solid #EFEFEF; +border-top: 1px solid #EFEFEF; +border-right: 1px solid #ACACAC; +border-bottom: 1px solid #ACACAC; +background-color: #F7FCDA +} + +.coolbg3 { +border: 1px solid #BDC5B4; +background-color: #DFDDD2; +height: 20px; +width: 140px; +text-align: right; +} + +.coolbg61 { +line-height: 26px; +width: 380px; +border-top: 1px solid #BDC5B4; +border-left: 1px solid #BDC5B4; +border-right: 1px solid #BDC5B4; +height: 26px; +text-align: right; +background-color: #E7F3B1; +} + +.coolbg62 { +border: 1px solid #BDC5B4; +background-color: #F8FDF0; +height: 300px; +width: 380px; +padding: 5px; +} + +.coolbg4 { +border-bottom: 1px solid #C9CFC1; +background-color: #F9FCDC; +background: url(../images/dlgtitle.gif) repeat-x; +height: 24px; +line-height: 24px; +width: 190px; +text-align: right; +} + +.coolbg5 { +border-top: 1px solid #BDC5B4; +background-color: #F9FCDC; +font-size: 1pt; +height: 6px; +width: 190px; +} + +.wsselect { +height: 60px; +line-height: 24px + overflow-y:auto; +overflow: auto; +background-color: #FCFEF1; +scrollbar-face-color: #ffffff; +scrollbar-highlight-color: #919192; +scrollbar-shadow-color: #919192; +scrollbar-3dlight-color: #ffffff; +scrollbar-arrow-color: #919192; +scrollbar-track-color: #ffffff; +scrollbar-darkshadow-color: #ffffff; +} + +.dlg { +border: 2px solid #749F4D; +background-color: #F0FAEB; +padding: 2px; +width: 360px; +line-height: 160%; +} + +.pubdlg { +z-index: 8888; +border: 5px solid #749F4D; +background-color: #fff; +} + +.pubdlg .title { +border-bottom: 1px solid #C9CFC1; +background-color: #F9FCDC; +background: url(../images/dlgtitle.gif) repeat-x; +height: 28px; +line-height: 28px; +text-align: left; +cursor: move; +} + +.pubdlg .titLeft { +float: left; +padding-left: 8px; +line-height: 28px; +font-weight: bold; +color: #555; +} + +.pubdlg .titRight { +float: right; +padding: 0px; +} + +.fullpagediv { +z-index: 1999; +top: 0; +left: 0; +background: #cdcdcd; +filter: Alpha(opacity=50); +-moz-opacity: .5; +opacity: 0.5; +position: absolute; +width: 100%; +height: 2500px; +} + +.quicksel { +z-index: 10005; +width: 680px; +height: 420px; +margin-left: 5px; +margin-top: 5px; +overflow: auto; +scrollbar-face-color: #ffffff; +scrollbar-highlight-color: #919192; +scrollbar-shadow-color: #919192; +scrollbar-3dlight-color: #ffffff; +scrollbar-arrow-color: #919192; +scrollbar-track-color: #ffffff; +scrollbar-darkshadow-color: #ffffff; +} + +.quickselfoot { +padding-top: 8px; +border-top: 1px dashed #C0CC9D; +} + +.quickselItem { +margin-bottom: 8px; +} + +.quickselItem .topcat { +font-weight: bold; +clear: both; +line-height: 24px; +border-bottom: 1px dashed #ccc; +background: #FBFEEF; +padding-left: 5px; +} + +.quickselItem .soncat { +padding-left: 10px; +} + +.quickselItem .item { +float: left; +margin-right: 8px; +} + +.mysource,.mywriter { +z-index: 10001; +border: 5px solid #749F4D; +background-color: #F0FAEB; +padding: 2px; +width: 280px; +line-height: 160%; +} + +.dlgws div { +width: 100%; +} + +.dlgTesttitle { +border: 2px solid #749F4D; +background-color: #F0FAEB; +padding: 2px; +width: 300px; +line-height: 150%; +} + +#_mysource { +z-index: 10003; +} + +#_mywriter { +z-index: 10004; +} + +#uploadwait { +z-index: 19999; +} + +.option1 { +background-color: #DCECA6; +} + +.option2 { +background-color: #F7FBD2; +} + +.option3 { +background-color: #FFFFFF; +} + +.ininput { +width: 96%; +height: 20px; +border: 1px solid #ffffff; +} + +.nbt { +padding: 1px; +background-image: url('../images/allbtbg.gif'); +background-color: #ffffff; +border: 1px solid #A5AF83; +} + +.tdt { +padding-left: 6px; +} + +.waitpage { +top: 0; +left: 0; +filter: Alpha(opacity=70); +-moz-opacity: 0.7; +position: absolute; +z-index: 10000; +background: url(../../images/loading1.gif) #ababab center no-repeat; +} + +.divpre img { +max-width: 150px; +max-height: 100px; +} + +.divpre { +overflow: hidden; +} + +.autoinput { +padding-left: 3px; +width: 90%; +} + +.bodytitle { +margin: auto; +height: 28px; +border: 1px dotted #BFD67C; +background: url('../images/wbg.gif'); +margin-bottom: 6px; +width: 98%; +font-weight: bold; +} + +.bodytitle div { +float: left +} + +.bodytitletxt { +padding-left: 6px; +line-height: 28px; +} + +.tbtitle td { +padding: 3px; +} + +.tblist td { +background: #FFFFFF; +padding: 6px; +} + +.tblist td.tbsname { +background: #F9FFE6; +padding: 6px; +} + +.colordlg { +width: 100px; +z-index;10005;border: 2px dashed #749F4D; +background-color: #F0FAEB; +padding: 2px; +line-height: 160%; +} + +option.alltype { +height: 18px; +line-height: 18px; +font-size: 12px; +padding-left: 16px; +background: url(../images/arr4.gif) 3px 4px no-repeat; +} + +option.btype { +height: 18px; +line-height: 18px; +font-size: 12px; +padding-left: 16px; +background: url(../images/arr4.gif) 3px 4px no-repeat; +} + +option.stype { +height: 18px; +line-height: 18px; +font-size: 12px; +padding-left: 24px; +background: url(../images/arrr.gif) 11px 4px no-repeat; +} + +.ilist { +border-top: 1px dashed #BCBCBC; +border-bottom: 1px dashed #BCBCBC; +border-left: 1px dashed #BCBCBC; +} + +.ilist td { +border-right: 1px dashed #BCBCBC; +} + +#typeid2 { +border: 0px; +padding: 0px; +background: #ccc; +height: 18px; +font-size: 12px; +padding-left: 10px; +background: url(../images/typeid2bg.gif) no-repeat; +float: left; +} + +.litpic_span { +width: 77px; +overflow: hidden; +height: 21px; +*vertical-align: 3px; +margin-left: -60px; +*margin-left: -75px; +cursor: pointer; +} + +#litpic { +width: 85px; +height: 20px; +margin-left: -20px; +filter: alpha(opacity=00); +-moz-opacity: .0; +opacity: 0.0; +cursor: pointer; +} + +#starttime,#endtime,#pubdate { +background: url(../images/calendar.gif) 3px no-repeat; +padding-left: 23px; +} + +#title { +background: url(../images/ruler.gif) repeat-x 0px 5px; +} + +.spec { +width: 60px; +} + +.gtab a { +width: 80px; +text-align: center; +display: block; +float: left; +height: 26px; +line-height: 26px; +} + +.albCt img { +cursor: pointer; +} + +img { +vertical-align: baseline; +} + +input, + select { +height: auto !important; +} \ No newline at end of file diff --git a/src/dede/js/calendar/calendar-green.css b/src/dede/js/calendar/calendar-green.css deleted file mode 100755 index 5bf81a2d..00000000 --- a/src/dede/js/calendar/calendar-green.css +++ /dev/null @@ -1,239 +0,0 @@ -/* The main calendar widget. DIV containing a table. */ - -div.calendar { position: relative; } - -.calendar, .calendar table { - border: 1px solid #CDE4B3; - font-size: 11px; - color: #000; - cursor: default; - background: #F9FCF1; - font-family: tahoma,verdana,sans-serif; -} - -.calendar table{border: 1px solid #fff;} -/* Header part -- contains navigation buttons and day names. */ -.calendar table thead td{background:#E7F6D5; color:#97C069; border-bottom:1px solid #fff; border-right:none; height:16px; width:18px} -.calendar table thead tr.headrow td{ background:#EDF9E0} -.headrow{border-top:1px solid #CDE4B3} - -.calendar table thead td.button div div{ - background-image: url(../../images/question-balloon.png); - background-repeat: no-repeat; text-indent:-100px; overflow:hidden -} -.headrow .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - border-right:1px solid #FFF; padding:0 -} -.headrow .button div,.calendar table .wn div{border-right:1px solid #CDE4B3; height:23px; line-height:23px} -.calendar .nav { -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; /* Pressing it will take you to the current date */ - text-align: center; - padding: 2px; - color:#6b9936; width:auto -} - -.calendar thead tr { /* Row containing navigation buttons */ - background: #007ED1; - color: #fff; -} - -.calendar thead .daynames { /* Row containing the day names */ - background: #EDF9E0; -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #CDE4B3; - padding: 2px; - text-align: center; - color: #000; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #a66; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - background-color: #E7F6D5; - color: #6b9936; - -} - - - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - color: #456; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day div{ padding-right:5px} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #bbb; -} -.calendar tbody .day.othermonth.oweekend { - color: #fbb; -} - -.calendar table .wn { - border-right: 1px solid #fff; - background: #EDF9E0; padding:0 -} - -.calendar tbody .rowhilite td { - background: #def; -} - -.calendar tbody .rowhilite td.wn { - background: #F9FCF1; -} - -.calendar tbody td.hilite { /* Hovered cells */ - background: #93b9e2; - padding: 1px 3px 1px 1px; - color:#fff -} - -.calendar tbody td.active { /* Active (pressed) cells */ - background: #cde; - padding: 2px 2px 0px 2px; -} - -.calendar tbody td.selected { /* Cell showing today date */ - font-weight: bold; - padding: 1px 3px 1px 1px; - background: #ff7200; - color: #fff; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #a66; -} - -.calendar tbody td.today { /* Cell showing selected date */ - font-weight: bold; - color: #D50000; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ - text-align: center; - background: #206A9B; - color: #fff; -} -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: #EDF9E0; - color: #6b9936; - border-top: 1px solid #CDE4B3; - padding: 1px; height:24px -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - background: #B8DAF0; - border: 1px solid #178AEB; - color: #000; - padding: 1px; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - background: #006AA9; - padding: 2px 0px 0px 2px; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - top: 0px; - left: 0px; - width: 4em; - cursor: default; - border: 1px solid #655; - background: #def; - color: #000; - font-size: 90%; - z-index: 9999999999999999999999999999; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .hilite { - background: #34ABFA; - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - font-weight: bold; -} - -.calendar .combo .active { - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - background: #F9FCF1; - font-weight: bold; -} - -.calendar td.time { - border-top: 1px solid #CDE4B3; - padding: 1px 0px; - text-align: center; - background-color: #EDF2E3; - height:24px -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: #F9FCF1; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: #267DB7; - color: #fff; -} - -.calendar td.time span.active { - border-color: red; - background-color: #000; - color: #A5FF00; -} -.calendar thead .active div{ /* Active (pressed) buttons in header */ - background: #bdd2e8; -} \ No newline at end of file diff --git a/src/dede/js/calendar/calendar.js b/src/dede/js/calendar/calendar.js deleted file mode 100755 index d3ceffd1..00000000 --- a/src/dede/js/calendar/calendar.js +++ /dev/null @@ -1,1286 +0,0 @@ -/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo - * The DHTML Calendar, version 1.0 "It is happening again" - * Details and latest version at: - * www.dynarch.com/projects/calendar - * This script is developed by Dynarch.com. Visit us at www.dynarch.com. - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html -// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ -/** The Calendar object constructor. */ -//document.createStyleSheet('/images/js/calendar/calendar-blue.css'); - -var head = document.getElementsByTagName('HEAD').item(0); -var style = document.createElement('link'); -style.href = 'js/calendar/calendar-green.css'; -style.rel = 'stylesheet'; -style.type = 'text/css'; -head.appendChild(style); - -Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {this.activeDiv = null;this.currentDateEl = null;this.getDateStatus = null; -this.getDateToolTip = null;this.getDateText = null; -this.timeout = null;this.onSelected = onSelected || null; -this.onClose = onClose || null; -this.dragging = false; -this.hidden = false; -this.minYear = 1970; -this.maxYear = 2050; -this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; -this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; -this.isPopup = true; -this.weekNumbers = true; -this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; -this.showsOtherMonths = false; -this.dateStr = dateStr; -this.ar_days = null; -this.showsTime = false; -this.time24 = true; -this.yearStep = 2; -this.hiliteToday = true; -this.multiple = null;this.table = null; -this.element = null; -this.tbody = null;this.firstdayname = null;this.monthsCombo = null;this.yearsCombo = null;this.hilitedMonth = null;this.activeMonth = null;this.hilitedYear = null; -this.activeYear = null;this.dateClicked = false; -if (typeof Calendar._SDN == "undefined") {if (typeof Calendar._SDN_len == "undefined")Calendar._SDN_len = 3;var ar = new Array();for (var i = 8; i > 0;) {ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);}Calendar._SDN = ar;if (typeof Calendar._SMN_len == "undefined")Calendar._SMN_len = 3;ar = new Array();for (var i = 12; i > 0;) {ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);}Calendar._SMN = ar;}};Calendar._C = null;Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) );Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );Calendar.is_opera = /opera/i.test(navigator.userAgent);Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos = function(el) {var SL = 0, ST = 0;var is_div = /^div$/i.test(el.tagName);if (is_div && el.scrollLeft)SL = el.scrollLeft;if (is_div && el.scrollTop)ST = el.scrollTop;var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };if (el.offsetParent) {var tmp = this.getAbsolutePos(el.offsetParent);r.x += tmp.x;r.y += tmp.y;}return r;};Calendar.isRelated = function (el, evt) {var related = evt.relatedTarget;if (!related) {var type = evt.type;if (type == "mouseover") {related = evt.fromElement;} else if (type == "mouseout") {related = evt.toElement;}}while (related) {if (related == el) {return true;}related = related.parentNode;}return false;};Calendar.removeClass = function(el, className) {if (!(el && el.className)) {return;}var cls = el.className.split(" ");var ar = new Array();for (var i = cls.length; i > 0;) {if (cls[--i] != className) {ar[ar.length] = cls[i];}}el.className = ar.join(" ");};Calendar.addClass = function(el, className) {Calendar.removeClass(el, className);el.className += " " + className;};Calendar.getElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;while (f.nodeType != 1 || /^div$/i.test(f.tagName))f = f.parentNode;return f;};Calendar.getTargetElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.target;while (f.nodeType != 1)f = f.parentNode;return f;};Calendar.stopEvent = function(ev) {ev || (ev = window.event);if (Calendar.is_ie) {ev.cancelBubble = true;ev.returnValue = false;} else {ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent = function(el, evname, func) {if (el.attachEvent) { el.attachEvent("on" + evname, func);} else if (el.addEventListener) { el.addEventListener(evname, func, true);} else {el["on" + evname] = func;}};Calendar.removeEvent = function(el, evname, func) {if (el.detachEvent) { el.detachEvent("on" + evname, func);} else if (el.removeEventListener) { el.removeEventListener(evname, func, true);} else {el["on" + evname] = null;}};Calendar.createElement = function(type, parent) {var el = null;if (document.createElementNS) {el = document.createElementNS("http://www.w3.org/1999/xhtml", type);} else {el = document.createElement(type);}if (typeof parent != "undefined") {parent.appendChild(el);}return el;};Calendar._add_evs = function(el) {with (Calendar) {addEvent(el, "mouseover", dayMouseOver);addEvent(el, "mousedown", dayMouseDown);addEvent(el, "mouseout", dayMouseOut);if (is_ie) {addEvent(el, "dblclick", dayMouseDblClick);el.setAttribute("unselectable", true);}}};Calendar.findMonth = function(el) {if (typeof el.month != "undefined") {return el;} else if (typeof el.parentNode.month != "undefined") {return el.parentNode;}return null;};Calendar.findYear = function(el) {if (typeof el.year != "undefined") {return el;} else if (typeof el.parentNode.year != "undefined") {return el.parentNode;}return null;};Calendar.showMonthsCombo = function () {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var mc = cal.monthsCombo;if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}if (cal.activeMonth) {Calendar.removeClass(cal.activeMonth, "active");}var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon, "active");cal.activeMonth = mon;var s = mc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var mcw = mc.offsetWidth;if (typeof mcw == "undefined")mcw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";};Calendar.showYearsCombo = function (fwd) {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var yc = cal.yearsCombo;if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}if (cal.activeYear) {Calendar.removeClass(cal.activeYear, "active");}cal.activeYear = null;var Y = cal.date.getFullYear() + (fwd ? 1 : -1);var yr = yc.firstChild;var show = false;for (var i = 12; i > 0; --i) {if (Y >= cal.minYear && Y <= cal.maxYear) {yr.innerHTML = Y;yr.year = Y;yr.style.display = "block";show = true;} else {yr.style.display = "none";}yr = yr.nextSibling;Y += fwd ? cal.yearStep : -cal.yearStep;}if (show) {var s = yc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var ycw = yc.offsetWidth;if (typeof ycw == "undefined")ycw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";}};Calendar.tableMouseUp = function(ev) {var cal = Calendar._C;if (!cal) {return false;}if (cal.timeout) {clearTimeout(cal.timeout);}var el = cal.activeDiv;if (!el) {return false;}var target = Calendar.getTargetElement(ev);ev || (ev = window.event);Calendar.removeClass(el, "active");if (target == el || target.parentNode == el) {Calendar.cellClick(el, ev);}var mon = Calendar.findMonth(target);var date = null;if (mon) {date = new Date(cal.date);if (mon.month != date.getMonth()) {date.setMonth(mon.month);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}} else {var year = Calendar.findYear(target);if (year) {date = new Date(cal.date);if (year.year != date.getFullYear()) {date.setFullYear(year.year);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}}}with (Calendar) {removeEvent(document, "mouseup", tableMouseUp);removeEvent(document, "mouseover", tableMouseOver);removeEvent(document, "mousemove", tableMouseOver);cal._hideCombos();_C = null;return stopEvent(ev);}};Calendar.tableMouseOver = function (ev) {var cal = Calendar._C;if (!cal) {return;}var el = cal.activeDiv;var target = Calendar.getTargetElement(ev);if (target == el || target.parentNode == el) {Calendar.addClass(el, "hilite active");Calendar.addClass(el.parentNode, "rowhilite");} else {if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))Calendar.removeClass(el, "active");Calendar.removeClass(el, "hilite");Calendar.removeClass(el.parentNode, "rowhilite");}ev || (ev = window.event);if (el.navtype == 50 && target != el) {var pos = Calendar.getAbsolutePos(el);var w = el.offsetWidth;var x = ev.clientX;var dx;var decrease = true;if (x > pos.x + w) {dx = x - pos.x - w;decrease = false;} elsedx = pos.x - x;if (dx < 0) dx = 0;var range = el._range;var current = el._current;var count = Math.floor(dx / 10) % range.length;for (var i = range.length; --i >= 0;)if (range[i] == current) -break; -while (count-- > 0) -if (decrease) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval;cal.onUpdateTime(); -} -var mon = Calendar.findMonth(target); -if (mon) { -if (mon.month != cal.date.getMonth()) { -if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -Calendar.addClass(mon, "hilite"); -cal.hilitedMonth = mon; -} else if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -} else { -if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}var year = Calendar.findYear(target);if (year) {if (year.year != cal.date.getFullYear()) {if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}Calendar.addClass(year, "hilite");cal.hilitedYear = year;} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown = function (ev) {if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {return Calendar.stopEvent(ev);}};Calendar.calDragIt = function (ev) {var cal = Calendar._C;if (!(cal && cal.dragging)) {return false;}var posX;var posY;if (Calendar.is_ie) {posY = window.event.clientY + document.body.scrollTop;posX = window.event.clientX + document.body.scrollLeft;} else {posX = ev.pageX;posY = ev.pageY;}cal.hideShowCovered();var st = cal.element.style;st.left = (posX - cal.xOffs) + "px";st.top = (posY - cal.yOffs) + "px";return Calendar.stopEvent(ev);};Calendar.calDragEnd = function (ev) {var cal = Calendar._C;if (!cal) {return false;}cal.dragging = false;with (Calendar) {removeEvent(document, "mousemove", calDragIt);removeEvent(document, "mouseup", calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown = function(ev) {var el = Calendar.getElement(ev); -if (el.disabled) { -return false; -} -var cal = el.calendar; -cal.activeDiv = el; -Calendar._C = cal; -if (el.navtype != 300) with (Calendar) { -if (el.navtype == 50) { -el._current = el.innerHTML; -addEvent(document, "mousemove", tableMouseOver); -} else -addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); -addClass(el, "hilite active"); -addEvent(document, "mouseup", tableMouseUp); -} else if (cal.isPopup) { -cal._dragStart(ev); -} -if (el.navtype == -1 || el.navtype == 1) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); -} else if (el.navtype == -2 || el.navtype == 2) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); -} else { -cal.timeout = null; -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseDblClick = function(ev) { -Calendar.cellClick(Calendar.getElement(ev), ev || window.event); -if (Calendar.is_ie) { -document.selection.empty(); -} -};Calendar.dayMouseOver = function(ev) { -var el = Calendar.getElement(ev); -if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { -return false; -} -if (el.ttip) { -if (el.ttip.substr(0, 1) == "_") { -el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); -} -el.calendar.tooltips.innerHTML = el.ttip; -} -if (el.navtype != 300) { -Calendar.addClass(el, "hilite"); -if (el.caldate) { -Calendar.addClass(el.parentNode, "rowhilite"); -} -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseOut = function(ev) { -with (Calendar) { -var el = getElement(ev); -if (isRelated(el, ev) || _C || el.disabled) -return false; -removeClass(el, "hilite"); -if (el.caldate) -removeClass(el.parentNode, "rowhilite"); -if (el.calendar) -el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; -return stopEvent(ev); -} -}; -Calendar.cellClick = function(el, ev) { -var cal = el.calendar; -var closing = false; -var newdate = false; -var date = null; -if (typeof el.navtype == "undefined") { -if (cal.currentDateEl) { -Calendar.removeClass(cal.currentDateEl, "selected"); -Calendar.addClass(el, "selected"); -closing = (cal.currentDateEl == el); -if (!closing) { -cal.currentDateEl = el; -} -} -cal.date.setDateOnly(el.caldate); -date = cal.date; -var other_month = !(cal.dateClicked = !el.otherMonth); -if (!other_month && !cal.currentDateEl) -cal._toggleMultipleDate(new Date(date)); -else -newdate = !el.disabled;if (other_month) -cal._init(cal.firstDayOfWeek, date); -} else { -if (el.navtype == 200) { -Calendar.removeClass(el, "hilite"); -cal.callCloseHandler(); -return; -} -date = new Date(cal.date); -if (el.navtype == 0) -date.setDateOnly(new Date()); -cal.dateClicked = false; -var year = date.getFullYear(); -var mon = date.getMonth(); -function setMonth(m) { -var day = date.getDate(); -var max = date.getMonthDays(m); -if (day > max) { -date.setDate(max); -} -date.setMonth(m); -}; -switch (el.navtype) { - case 400: -Calendar.removeClass(el, "hilite"); -var text = Calendar._TT["ABOUT"]; -if (typeof text != "undefined") { -text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; -} else {text = "Help and about box text is not translated into this language.\n" + -"If you know this language and you feel generous please update\n" + -"the corresponding file in \"lang\" subdir to match calendar-en.js\n" + -"and send it back to to get it into the distribution ;-)\n\n" + -"Thank you!\n" + -"http://dynarch.com/mishoo/calendar.epl\n"; -} -alert(text); -return; - case -2: -if (year > cal.minYear) { -date.setFullYear(year - 1); -} -break; - case -1: -if (mon > 0) { -setMonth(mon - 1); -} else if (year-- > cal.minYear) { -date.setFullYear(year); -setMonth(11); -} -break; - case 1: -if (mon < 11) { -setMonth(mon + 1); -} else if (year < cal.maxYear) { -date.setFullYear(year + 1); -setMonth(0); -} -break; - case 2: -if (year < cal.maxYear) { -date.setFullYear(year + 1); -} -break; - case 100: -cal.setFirstDayOfWeek(el.fdow); -return; - case 50: -var range = el._range; -var current = el.innerHTML; -for (var i = range.length; --i >= 0;) -if (range[i] == current) -break; -if (ev && ev.shiftKey) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval; -cal.onUpdateTime(); -return; - case 0:if ((typeof cal.getDateStatus == "function") && - cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { -return false; -} -break; -} -if (!date.equalsTo(cal.date)) { -cal.setDate(date); -newdate = true; -} else if (el.navtype == 0) -newdate = closing = true; -} -if (newdate) { -ev && cal.callHandler(); -} -if (closing) { -Calendar.removeClass(el, "hilite"); -ev && cal.callCloseHandler(); -} -}; -Calendar.prototype.create = function (_par) { -var parent = null; -if (! _par) { -parent = document.getElementsByTagName("body")[0]; -this.isPopup = true; -} else { -parent = _par; -this.isPopup = false; -} -this.date = this.dateStr ? new Date(this.dateStr) : new Date();var table = Calendar.createElement("table"); -this.table = table; -table.cellSpacing = 0; -table.cellPadding = 0; -table.calendar = this; -Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);var div = Calendar.createElement("div"); -this.element = div; -div.className = "calendar"; -if (this.isPopup) { -div.style.position = "absolute"; -div.style.display = "none"; -} -div.appendChild(table);var thead = Calendar.createElement("thead", table); -var cell = null; -var row = null;var cal = this; -var hh = function (text, cs, navtype) { -cell = Calendar.createElement("td", row); -cell.colSpan = cs; -cell.className = "button"; -if (navtype != 0 && Math.abs(navtype) <= 2) -cell.className += " nav"; -Calendar._add_evs(cell); -cell.calendar = cal; -cell.navtype = navtype; -cell.innerHTML = "
" + text + "
"; -return cell; -};row = Calendar.createElement("tr", thead); -var title_length = 6; -(this.isPopup) && --title_length; -(this.weekNumbers) && ++title_length;hh("
?
", 1, 400).ttip = Calendar._TT["INFO"]; -this.title = hh("", title_length, 300); -this.title.className = "title"; -if (this.isPopup) { -this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; -this.title.style.cursor = "move"; -hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; -}row = Calendar.createElement("tr", thead); -row.className = "headrow";this._nav_py = hh("«", 1, -2); -this._nav_py.ttip = Calendar._TT["PREV_YEAR"];this._nav_pm = hh("‹", 1, -1); -this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); -this._nav_now.ttip = Calendar._TT["GO_TODAY"];this._nav_nm = hh("›", 1, 1); -this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];this._nav_ny = hh("»", 1, 2); -this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; -row = Calendar.createElement("tr", thead); -row.className = "daynames"; -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -cell.className = "name wn"; -cell.innerHTML = "
"+Calendar._TT["WK"]+"
"; -} -for (var i = 7; i > 0; --i) { -cell = Calendar.createElement("td", row); -if (!i) { -cell.navtype = 100; -cell.calendar = this; -Calendar._add_evs(cell); -} -} -this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; -this._displayWeekdays();var tbody = Calendar.createElement("tbody", table); -this.tbody = tbody;for (i = 6; i > 0; --i) { -row = Calendar.createElement("tr", tbody); -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -} -for (var j = 7; j > 0; --j) { -cell = Calendar.createElement("td", row); -cell.calendar = this; -Calendar._add_evs(cell); -} -}if (this.showsTime) { -row = Calendar.createElement("tr", tbody); -row.className = "time";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -cell.innerHTML = Calendar._TT["TIME"] || " ";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = this.weekNumbers ? 4 : 3;(function(){ -function makeTimePart(className, init, range_start, range_end) { -var part = Calendar.createElement("span", cell); -part.className = className; -part.innerHTML = init; -part.calendar = cal; -part.ttip = Calendar._TT["TIME_PART"]; -part.navtype = 50; -part._range = []; -if (typeof range_start != "number") -part._range = range_start; -else { -for (var i = range_start; i <= range_end; ++i) { -var txt; -if (i < 10 && range_end >= 10) txt = '0' + i; -else txt = '' + i; -part._range[part._range.length] = txt; -} -} -Calendar._add_evs(part); -return part; -}; -var hrs = cal.date.getHours(); -var mins = cal.date.getMinutes(); -var t12 = !cal.time24; -var pm = (hrs > 12); -if (t12 && pm) hrs -= 12; -var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); -var span = Calendar.createElement("span", cell); -span.innerHTML = ":"; -span.className = "colon"; -var M = makeTimePart("minute", mins, 0, 59); -var AP = null; -cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -if (t12) -AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); -else -cell.innerHTML = " ";cal.onSetTime = function() { -var pm, hrs = this.date.getHours(), -mins = this.date.getMinutes(); -if (t12) { -pm = (hrs >= 12); -if (pm) hrs -= 12; -if (hrs == 0) hrs = 12; -AP.innerHTML = pm ? "pm" : "am"; -} -H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; -M.innerHTML = (mins < 10) ? ("0" + mins) : mins; -};cal.onUpdateTime = function() { -var date = this.date; -var h = parseInt(H.innerHTML, 10); -if (t12) { -if (/pm/i.test(AP.innerHTML) && h < 12) -h += 12; -else if (/am/i.test(AP.innerHTML) && h == 12) -h = 0; -} -var d = date.getDate(); -var m = date.getMonth(); -var y = date.getFullYear(); -date.setHours(h); -date.setMinutes(parseInt(M.innerHTML, 10)); -date.setFullYear(y); -date.setMonth(m); -date.setDate(d); -this.dateClicked = false; -this.callHandler(); -}; -})(); -} else { -this.onSetTime = this.onUpdateTime = function() {}; -}var tfoot = Calendar.createElement("tfoot", table);row = Calendar.createElement("tr", tfoot); -row.className = "footrow";cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); -cell.className = "ttip"; -if (this.isPopup) { -cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; -cell.style.cursor = "move"; -} -this.tooltips = cell;div = Calendar.createElement("div", this.element); -this.monthsCombo = div; -div.className = "combo"; -for (i = 0; i < Calendar._MN.length; ++i) { -var mn = Calendar.createElement("div"); -mn.className = Calendar.is_ie ? "label-IEfix" : "label"; -mn.month = i; -mn.innerHTML = Calendar._SMN[i]; -div.appendChild(mn); -}div = Calendar.createElement("div", this.element); -this.yearsCombo = div; -div.className = "combo"; -for (i = 12; i > 0; --i) { -var yr = Calendar.createElement("div"); -yr.className = Calendar.is_ie ? "label-IEfix" : "label"; -div.appendChild(yr); -}this._init(this.firstDayOfWeek, this.date); -parent.appendChild(this.element); -}; -Calendar._keyEvent = function(ev) { -var cal = window._dynarch_popupCalendar; -if (!cal || cal.multiple) -return false; -(Calendar.is_ie) && (ev = window.event); -var act = (Calendar.is_ie || ev.type == "keypress"), -K = ev.keyCode; -if (ev.ctrlKey) { -switch (K) { - case 37: -act && Calendar.cellClick(cal._nav_pm); -break; - case 38: -act && Calendar.cellClick(cal._nav_py); -break; - case 39: -act && Calendar.cellClick(cal._nav_nm); -break; - case 40: -act && Calendar.cellClick(cal._nav_ny); -break; - default: -return false; -} -} else switch (K) { - case 32: -Calendar.cellClick(cal._nav_now); -break; - case 27: -act && cal.callCloseHandler(); -break; - case 37: - case 38: - case 39: - case 40: -if (act) { -var prev, x, y, ne, el, step; -prev = K == 37 || K == 38; -step = (K == 37 || K == 39) ? 1 : 7; -function setVars() { -el = cal.currentDateEl; -var p = el.pos; -x = p & 15; -y = p >> 4; -ne = cal.ar_days[y][x]; -};setVars(); -function prevMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() - step); -cal.setDate(date); -}; -function nextMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() + step); -cal.setDate(date); -}; -while (1) { -switch (K) { - case 37: -if (--x >= 0) -ne = cal.ar_days[y][x]; -else { -x = 6; -K = 38; -continue; -} -break; - case 38: -if (--y >= 0) -ne = cal.ar_days[y][x]; -else { -prevMonth(); -setVars(); -} -break; - case 39: -if (++x < 7) -ne = cal.ar_days[y][x]; -else { -x = 0; -K = 40; -continue; -} -break; - case 40: -if (++y < cal.ar_days.length) -ne = cal.ar_days[y][x]; -else { -nextMonth(); -setVars(); -} -break; -} -break; -} -if (ne) { -if (!ne.disabled) -Calendar.cellClick(ne); -else if (prev) -prevMonth(); -else -nextMonth(); -} -} -break; - case 13: -if (act) -Calendar.cellClick(cal.currentDateEl, ev); -break; - default: -return false; -} -return Calendar.stopEvent(ev); -}; -Calendar.prototype._init = function (firstDayOfWeek, date) { -var today = new Date(), -TY = today.getFullYear(), -TM = today.getMonth(), -TD = today.getDate(); -this.table.style.visibility = "hidden"; -var year = date.getFullYear(); -if (year < this.minYear) { -year = this.minYear; -date.setFullYear(year); -} else if (year > this.maxYear) { -year = this.maxYear; -date.setFullYear(year); -} -this.firstDayOfWeek = firstDayOfWeek; -this.date = new Date(date); -var month = date.getMonth(); -var mday = date.getDate(); -var no_days = date.getMonthDays(); -date.setDate(1); -var day1 = (date.getDay() - this.firstDayOfWeek) % 7; -if (day1 < 0) -day1 += 7; -date.setDate(-day1); -date.setDate(date.getDate() + 1);var row = this.tbody.firstChild; -var MN = Calendar._SMN[month]; -var ar_days = this.ar_days = new Array(); -var weekend = Calendar._TT["WEEKEND"]; -var dates = this.multiple ? (this.datesCells = {}) : null; -for (var i = 0; i < 6; ++i, row = row.nextSibling) { -var cell = row.firstChild; -if (this.weekNumbers) { -cell.className = "day wn"; -cell.innerHTML = "
"+date.getWeekNumber()+"
"; -cell = cell.nextSibling; -} -row.className = "daysrow"; -var hasdays = false, iday, dpos = ar_days[i] = []; -for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { -iday = date.getDate(); -var wday = date.getDay(); -cell.className = "day"; -cell.pos = i << 4 | j; -dpos[j] = cell; -var current_month = (date.getMonth() == month); -if (!current_month) { -if (this.showsOtherMonths) { -cell.className += " othermonth"; -cell.otherMonth = true; -} else { -cell.className = "emptycell"; -cell.innerHTML = " "; -cell.disabled = true; -continue; -} -} else { -cell.otherMonth = false; -hasdays = true; -} -cell.disabled = false; -cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; -if (dates) -dates[date.print("%Y%m%d")] = cell; -if (this.getDateStatus) { -var status = this.getDateStatus(date, year, month, iday); -if (this.getDateToolTip) { -var toolTip = this.getDateToolTip(date, year, month, iday); -if (toolTip) -cell.title = toolTip; -} -if (status === true) { -cell.className += " disabled"; -cell.disabled = true; -} else { -if (/disabled/i.test(status)) -cell.disabled = true; -cell.className += " " + status; -} -} -if (!cell.disabled) { -cell.caldate = new Date(date); -cell.ttip = "_"; -if (!this.multiple && current_month - && iday == mday && this.hiliteToday) { -cell.className += " selected"; -this.currentDateEl = cell; -} -if (date.getFullYear() == TY && - date.getMonth() == TM && - iday == TD) { -cell.className += " today"; -cell.ttip += Calendar._TT["PART_TODAY"]; -} -if (weekend.indexOf(wday.toString()) != -1) -cell.className += cell.otherMonth ? " oweekend" : " weekend"; -} -} -if (!(hasdays || this.showsOtherMonths)) -row.className = "emptyrow"; -} -this.title.innerHTML = Calendar._MN[month] + ", " + year; -this.onSetTime(); -this.table.style.visibility = "visible"; -this._initMultipleDates(); -};Calendar.prototype._initMultipleDates = function() { -if (this.multiple) { -for (var i in this.multiple) { -var cell = this.datesCells[i]; -var d = this.multiple[i]; -if (!d) -continue; -if (cell) -cell.className += " selected"; -} -} -};Calendar.prototype._toggleMultipleDate = function(date) { -if (this.multiple) { -var ds = date.print("%Y%m%d"); -var cell = this.datesCells[ds]; -if (cell) { -var d = this.multiple[ds]; -if (!d) { -Calendar.addClass(cell, "selected"); -this.multiple[ds] = date; -} else { -Calendar.removeClass(cell, "selected"); -delete this.multiple[ds]; -} -} -} -};Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { -this.getDateToolTip = unaryFunction; -}; -Calendar.prototype.setDate = function (date) { -if (!date.equalsTo(this.date)) { -this._init(this.firstDayOfWeek, date); -} -}; -Calendar.prototype.refresh = function () { -this._init(this.firstDayOfWeek, this.date); -}; -Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { -this._init(firstDayOfWeek, this.date); -this._displayWeekdays(); -}; -Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { -this.getDateStatus = unaryFunction; -}; -Calendar.prototype.setRange = function (a, z) { -this.minYear = a; -this.maxYear = z; -}; -Calendar.prototype.callHandler = function () { -if (this.onSelected) { -this.onSelected(this, this.date.print(this.dateFormat)); -} -}; -Calendar.prototype.callCloseHandler = function () { -if (this.onClose) { -this.onClose(this); -} -this.hideShowCovered(); -}; -Calendar.prototype.destroy = function () { -var el = this.element.parentNode; -el.removeChild(this.element); -Calendar._C = null; -window._dynarch_popupCalendar = null; -}; -Calendar.prototype.reparent = function (new_parent) { -var el = this.element; -el.parentNode.removeChild(el); -new_parent.appendChild(el); -}; -Calendar._checkCalendar = function(ev) { -var calendar = window._dynarch_popupCalendar; -if (!calendar) { -return false; -} -var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); -for (; el != null && el != calendar.element; el = el.parentNode); -if (el == null) {window._dynarch_popupCalendar.callCloseHandler(); -return Calendar.stopEvent(ev); -} -}; -Calendar.prototype.show = function () { -var rows = this.table.getElementsByTagName("tr"); -for (var i = rows.length; i > 0;) { -var row = rows[--i]; -Calendar.removeClass(row, "rowhilite"); -var cells = row.getElementsByTagName("td"); -for (var j = cells.length; j > 0;) { -var cell = cells[--j]; -Calendar.removeClass(cell, "hilite"); -Calendar.removeClass(cell, "active"); -} -} -this.element.style.display = "block"; -this.hidden = false; -if (this.isPopup) { -window._dynarch_popupCalendar = this; -Calendar.addEvent(document, "keydown", Calendar._keyEvent); -Calendar.addEvent(document, "keypress", Calendar._keyEvent); -Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); -} -this.hideShowCovered(); -}; -Calendar.prototype.hide = function () { -if (this.isPopup) { -Calendar.removeEvent(document, "keydown", Calendar._keyEvent); -Calendar.removeEvent(document, "keypress", Calendar._keyEvent); -Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); -} -this.element.style.display = "none"; -this.hidden = true; -this.hideShowCovered(); -};Calendar.prototype.showAt = function (x, y) { -var s = this.element.style; -s.left = x + "px"; -s.top = y + "px"; -this.show(); -}; -Calendar.prototype.showAtElement = function (el, opts) { -var self = this; -var p = Calendar.getAbsolutePos(el); -if (!opts || typeof opts != "string") { -this.showAt(p.x, p.y + el.offsetHeight); -return true; -} -function fixPosition(box) { -if (box.x < 0) -box.x = 0; -if (box.y < 0) -box.y = 0; -var cp = document.createElement("div"); -var s = cp.style; -s.position = "absolute"; -s.right = s.bottom = s.width = s.height = "0px"; -document.body.appendChild(cp); -var br = Calendar.getAbsolutePos(cp); -document.body.removeChild(cp); -if (Calendar.is_ie) { -br.y += document.body.scrollTop; -br.x += document.body.scrollLeft; -} else { -br.y += window.scrollY; -br.x += window.scrollX; -} -var tmp = box.x + box.width - br.x; -if (tmp > 0) box.x -= tmp; -tmp = box.y + box.height - br.y; -if (tmp > 0) box.y -= tmp; -}; -this.element.style.display = "block"; -Calendar.continuation_for_the_fucking_khtml_browser = function() { -var w = self.element.offsetWidth; -var h = self.element.offsetHeight; -self.element.style.display = "none"; -var valign = opts.substr(0, 1); -var halign = "l"; -if (opts.length > 1) { -halign = opts.substr(1, 1); -}switch (valign) { - case "T": p.y -= h; break; - case "B": p.y += el.offsetHeight; break; - case "C": p.y += (el.offsetHeight - h) / 2; break; - case "t": p.y += el.offsetHeight - h; break; - case "b": break; -}switch (halign) { - case "L": p.x -= w; break; - case "R": p.x += el.offsetWidth; break; - case "C": p.x += (el.offsetWidth - w) / 2; break; - case "l": p.x += el.offsetWidth - w; break; - case "r": break; -} -p.width = w; -p.height = h + 40; -self.monthsCombo.style.display = "none"; -fixPosition(p); -self.showAt(p.x, p.y); -}; -if (Calendar.is_khtml) -setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); -else -Calendar.continuation_for_the_fucking_khtml_browser(); -}; -Calendar.prototype.setDateFormat = function (str) { -this.dateFormat = str; -}; -Calendar.prototype.setTtDateFormat = function (str) { -this.ttDateFormat = str; -}; -Calendar.prototype.parseDate = function(str, fmt) { -if (!fmt) -fmt = this.dateFormat; -this.setDate(Date.parseDate(str, fmt)); -}; -Calendar.prototype.hideShowCovered = function () { -if (!Calendar.is_ie && !Calendar.is_opera) -return; -function getVisib(obj){ -var value = obj.style.visibility; -if (!value) { -if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { -if (!Calendar.is_khtml) -value = document.defaultView. -getComputedStyle(obj, "").getPropertyValue("visibility"); -else -value = ''; -} else if (obj.currentStyle) { -value = obj.currentStyle.visibility; -} else -value = ''; -} -return value; -};var tags = new Array("applet", "iframe", "select"); -var el = this.element;var p = Calendar.getAbsolutePos(el); -var EX1 = p.x; -var EX2 = el.offsetWidth + EX1; -var EY1 = p.y; -var EY2 = el.offsetHeight + EY1;for (var k = tags.length; k > 0; ) { -var ar = document.getElementsByTagName(tags[--k]); -var cc = null;for (var i = ar.length; i > 0;) { -cc = ar[--i];p = Calendar.getAbsolutePos(cc); -var CX1 = p.x; -var CX2 = cc.offsetWidth + CX1; -var CY1 = p.y; -var CY2 = cc.offsetHeight + CY1;if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = cc.__msh_save_visibility; -} else { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = "hidden"; -} -} -} -}; -Calendar.prototype._displayWeekdays = function () { -var fdow = this.firstDayOfWeek; -var cell = this.firstdayname; -var weekend = Calendar._TT["WEEKEND"]; -for (var i = 0; i < 7; ++i) { -cell.className = "day name"; -var realday = (i + fdow) % 7; -if (i) { -cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); -cell.navtype = 100; -cell.calendar = this; -cell.fdow = realday; -Calendar._add_evs(cell); -} -if (weekend.indexOf(realday.toString()) != -1) { -Calendar.addClass(cell, "weekend"); -} -cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; -cell = cell.nextSibling; -} -}; -Calendar.prototype._hideCombos = function () { -this.monthsCombo.style.display = "none"; -this.yearsCombo.style.display = "none"; -}; -Calendar.prototype._dragStart = function (ev) { -if (this.dragging) { -return; -} -this.dragging = true; -var posX; -var posY; -if (Calendar.is_ie) { -posY = window.event.clientY + document.body.scrollTop; -posX = window.event.clientX + document.body.scrollLeft; -} else { -posY = ev.clientY + window.scrollY; -posX = ev.clientX + window.scrollX; -} -var st = this.element.style; -this.xOffs = posX - parseInt(st.left); -this.yOffs = posY - parseInt(st.top); -with (Calendar) { -addEvent(document, "mousemove", calDragIt); -addEvent(document, "mouseup", calDragEnd); -} -}; -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY;Date.parseDate = function(str, fmt) { -var today = new Date(); -var y = 0; -var m = -1; -var d = 0; -var a = str.split(/\W+/); -var b = fmt.match(/%./g); -var i = 0, j = 0; -var hr = 0; -var min = 0; -for (i = 0; i < a.length; ++i) { -if (!a[i]) -continue; -switch (b[i]) { - case "%d": - case "%e": -d = parseInt(a[i], 10); -break; case "%m": -m = parseInt(a[i], 10) - 1; -break; case "%Y": - case "%y": -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -break; case "%b": - case "%B": -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } -} -break; case "%H": - case "%I": - case "%k": - case "%l": -hr = parseInt(a[i], 10); -break; case "%P": - case "%p": -if (/pm/i.test(a[i]) && hr < 12) -hr += 12; -else if (/am/i.test(a[i]) && hr >= 12) -hr -= 12; -break; case "%M": -min = parseInt(a[i], 10); -break; -} -} -if (isNaN(y)) y = today.getFullYear(); -if (isNaN(m)) m = today.getMonth(); -if (isNaN(d)) d = today.getDate(); -if (isNaN(hr)) hr = today.getHours(); -if (isNaN(min)) min = today.getMinutes(); -if (y != 0 && m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -y = 0; m = -1; d = 0; -for (i = 0; i < a.length; ++i) { -if (a[i].search(/[a-zA-Z]+/) != -1) { -var t = -1; -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } -} -if (t != -1) { -if (m != -1) { -d = m+1; -} -m = t; -} -} else if (parseInt(a[i], 10) <= 12 && m == -1) { -m = a[i]-1; -} else if (parseInt(a[i], 10) > 31 && y == 0) { -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -} else if (d == 0) { -d = a[i]; -} -} -if (y == 0) -y = today.getFullYear(); -if (m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -return today; -}; -Date.prototype.getMonthDays = function(month) { -var year = this.getFullYear(); -if (typeof month == "undefined") { -month = this.getMonth(); -} -if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { -return 29; -} else { -return Date._MD[month]; -} -}; -Date.prototype.getDayOfYear = function() { -var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); -var time = now - then; -return Math.floor(time / Date.DAY); -}; -Date.prototype.getWeekNumber = function() { -var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var DoW = d.getDay(); -d.setDate(d.getDate() - (DoW + 6) % 7 + 3); -var ms = d.valueOf(); -d.setMonth(0); -d.setDate(4); -return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; -}; -Date.prototype.equalsTo = function(date) { -return ((this.getFullYear() == date.getFullYear()) && -(this.getMonth() == date.getMonth()) && -(this.getDate() == date.getDate()) && -(this.getHours() == date.getHours()) && -(this.getMinutes() == date.getMinutes())); -}; -Date.prototype.setDateOnly = function(date) { -var tmp = new Date(date); -this.setDate(1); -this.setFullYear(tmp.getFullYear()); -this.setMonth(tmp.getMonth()); -this.setDate(tmp.getDate()); -}; -Date.prototype.print = function (str) { -var m = this.getMonth(); -var d = this.getDate(); -var y = this.getFullYear(); -var wn = this.getWeekNumber(); -var w = this.getDay(); -var s = {}; -var hr = this.getHours(); -var pm = (hr >= 12); -var ir = (pm) ? (hr - 12) : hr; -var dy = this.getDayOfYear(); -if (ir == 0) -ir = 12; -var min = this.getMinutes(); -var sec = this.getSeconds(); -s["%a"] = Calendar._SDN[w];s["%A"] = Calendar._DN[w];s["%b"] = Calendar._SMN[m];s["%B"] = Calendar._MN[m]; s["%C"] = 1 + Math.floor(y / 100);s["%d"] = (d < 10) ? ("0" + d) : d;s["%e"] = d;s["%H"] = (hr < 10) ? ("0" + hr) : hr;s["%I"] = (ir < 10) ? ("0" + ir) : ir;s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy;s["%k"] = hr; -s["%l"] = ir; -s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m);s["%M"] = (min < 10) ? ("0" + min) : min;s["%n"] = "\n"; -s["%p"] = pm ? "PM" : "AM"; -s["%P"] = pm ? "pm" : "am"; -s["%s"] = Math.floor(this.getTime() / 1000); -s["%S"] = (sec < 10) ? ("0" + sec) : sec;s["%t"] = "\t";s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; -s["%u"] = w + 1; -s["%w"] = w; -s["%y"] = ('' + y).substr(2, 2);s["%Y"] = y; -s["%%"] = "%"; -var re = /%./g; -if (!Calendar.is_ie5 && !Calendar.is_khtml) -return str.replace(re, function (par) { return s[par] || par; });var a = str.match(re); -for (var i = 0; i < a.length; i++) { -var tmp = s[a[i]]; -if (tmp) { -re = new RegExp(a[i], 'g'); -str = str.replace(re, tmp); -} -}return str; -};Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { -var d = new Date(this); -d.__msh_oldSetFullYear(y); -if (d.getMonth() != this.getMonth()) -this.setDate(28); -this.__msh_oldSetFullYear(y); -};window._dynarch_popupCalendar = null; - - -Calendar._DN = new Array -("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"); -Calendar._SDN = new Array -("日","一","二","三","四","五","六","日"); -Calendar._FD = 0; -Calendar._MN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._SMN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._TT = {}; -Calendar._TT["INFO"] = "帮助"; -Calendar._TT["ABOUT"] = -"选择日期:\n" + -"- 点击 \xab, \xbb 按钮选择年份\n" + -"- 点击 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按钮选择月份\n" + -"- 长按以上按钮可从菜单中快速选择年份或月份"; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"选择时间:\n" + -"- 点击小时或分钟可使改数值加一\n" + -"- 按住Shift键点击小时或分钟可使改数值减一\n" + -"- 点击拖动鼠标可进行快速选择"; -Calendar._TT["PREV_YEAR"] = "上一年 (按住出菜单)"; -Calendar._TT["PREV_MONTH"] = "上一月 (按住出菜单)"; -Calendar._TT["GO_TODAY"] = "转到今日"; -Calendar._TT["NEXT_MONTH"] = "下一月 (按住出菜单)"; -Calendar._TT["NEXT_YEAR"] = "下一年 (按住出菜单)"; -Calendar._TT["SEL_DATE"] = "选择日期"; -Calendar._TT["DRAG_TO_MOVE"] = "拖动"; -Calendar._TT["PART_TODAY"] = " (今日)"; -Calendar._TT["DAY_FIRST"] = "最左边显示%s"; -Calendar._TT["WEEKEND"] = "0,6"; -Calendar._TT["CLOSE"] = "关闭"; -Calendar._TT["TODAY"] = "今日"; -Calendar._TT["TIME_PART"] = "(Shift-)点击鼠标或拖动改变值"; -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e日"; -Calendar._TT["WK"] = "周"; -Calendar._TT["TIME"] = "时间:"; - - -Calendar.setup = function (params) { - function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; - - param_default("inputField", null); - param_default("displayArea", null); - param_default("button", null); - param_default("eventName", "click"); - param_default("ifFormat", "%Y/%m/%d"); - param_default("daFormat", "%Y/%m/%d"); - param_default("singleClick", true); - param_default("disableFunc", null); - param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("dateText", null); - param_default("firstDay", null); - param_default("align", "Br"); - param_default("range", [1900, 2999]); - param_default("weekNumbers", true); - param_default("flat", null); - param_default("flatCallback", null); - param_default("onSelect", null); - param_default("onClose", null); - param_default("onUpdate", null); - param_default("date", null); - param_default("showsTime", false); - param_default("timeFormat", "24"); - param_default("electric", true); - param_default("step", 2); - param_default("position", null); - param_default("cache", false); - param_default("showOthers", false); - param_default("multiple", null); - - var tmp = ["inputField", "displayArea", "button"]; - for (var i in tmp) { - if (typeof params[tmp[i]] == "string") { - params[tmp[i]] = document.getElementById(params[tmp[i]]); - } - } - if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { - alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); - return false; - } - - function onSelect(cal) { - var p = cal.params; - var update = (cal.dateClicked || p.electric); - if (update && p.inputField) { - p.inputField.value = cal.date.print(p.ifFormat); - if (typeof p.inputField.onchange == "function") - p.inputField.onchange(); - } - if (update && p.displayArea) - p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && typeof p.onUpdate == "function") - p.onUpdate(cal); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - } - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); - }; - - if (params.flat != null) { - if (typeof params.flat == "string") - params.flat = document.getElementById(params.flat); - if (!params.flat) { - alert("Calendar.setup:\n Flat specified but can't find parent."); - return false; - } - var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); - cal.showsOtherMonths = params.showOthers; - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.params = params; - cal.weekNumbers = params.weekNumbers; - cal.setRange(params.range[0], params.range[1]); - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - if (params.ifFormat) { - cal.setDateFormat(params.ifFormat); - } - if (params.inputField && typeof params.inputField.value == "string") { - cal.parseDate(params.inputField.value); - } - cal.create(params.flat); - cal.show(); - return false; - } - - var triggerEl = params.button || params.displayArea || params.inputField; - triggerEl["on" + params.eventName] = function() { - var dateEl = params.inputField || params.displayArea; - var dateFmt = params.inputField ? params.ifFormat : params.daFormat; - var mustCreate = false; - var cal = window.calendar; - if (dateEl) - params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); - if (!(cal && params.cache)) { - window.calendar = cal = new Calendar(params.firstDay, - params.date, - params.onSelect || onSelect, - params.onClose || function(cal) { cal.hide(); }); - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.weekNumbers = params.weekNumbers; - mustCreate = true; - } else { - if (params.date) - cal.setDate(params.date); - cal.hide(); - } - if (params.multiple) { - cal.multiple = {}; - for (var i = params.multiple.length; --i >= 0;) { - var d = params.multiple[i]; - var ds = d.print("%Y%m%d"); - cal.multiple[ds] = d; - } - } - cal.showsOtherMonths = params.showOthers; - cal.yearStep = params.step; - cal.setRange(params.range[0], params.range[1]); - cal.params = params; - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - cal.setDateFormat(dateFmt); - if (mustCreate) - cal.create(); - cal.refresh(); - if (!params.position) - cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); - else - cal.showAt(params.position[0], params.position[1]); - return false; - }; - - return cal; -}; \ No newline at end of file diff --git a/src/dede/js/main.js b/src/dede/js/main.js index c653e890..35e538ca 100755 --- a/src/dede/js/main.js +++ b/src/dede/js/main.js @@ -603,10 +603,10 @@ function getElementTop(element) { // 生成一个随机ID function guid() { - function S4() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - } - return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); + function S4() { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); + } + return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); } // 显示对话框,动态创建modal并显示,退出自动销毁窗体 @@ -622,57 +622,57 @@ args = { // 这里用到了一个展开语法 // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax function ShowMsg(content, ...args) { - title = "DedeCMS"; - if (typeof content == "undefined") content = ""; - modalID = guid(); - var footer = ``; - var noClose = false; - - if (args.length == 1) { - // 存在args参数 - if (typeof args[0].title !== 'undefined' && args[0].title != "") { - title = args[0].title; - } - if (typeof args[0].footer !== 'undefined' && args[0].footer != "") { - footer = args[0].footer; - } - if (typeof args[0].noClose !== 'undefined' && args[0].noClose == true) { - noClose = true; - } - } - - footer = footer.replace("~modalID~", modalID); - content = content.replace("~modalID~", modalID); - - var modal = ``; + $("body").append(modal) + $("#GKModal" + modalID).modal({ + backdrop: 'static', + show: true + }); + $("#GKModal" + modalID).on('hidden.bs.modal', function (e) { + $("#GKModal" + modalID).remove(); + }) + return modalID; } // 隐藏并销毁modal function CloseModal(modalID) { - $("#" + modalID).modal('hide'); - $("#" + modalID).on('hidden.bs.modal', function (e) { - if ($("#" + modalID).length > 0) { - $("#" + modalID).remove(); - } - }) + $("#" + modalID).modal('hide'); + $("#" + modalID).on('hidden.bs.modal', function (e) { + if ($("#" + modalID).length > 0) { + $("#" + modalID).remove(); + } + }) } // 获取缩略图 @@ -682,84 +682,84 @@ var currentCID = 0; var mdlCropperID = ""; var pubAt = 0; var optCropper = { - preview: ".pv", - crop: function (e) { - $("#cropWidth").text(Math.round(e.detail.height)); - $("#cropHeight").text(Math.round(e.detail.width)); - var dataUrl = $(this).cropper("getCroppedCanvas") - .toDataURL(); - litpicImg = dataUrl; - $("#litPic").attr("src", litpicImg); - $("#litpic_b64").val(litpicImg); - }, - aspectRatio: 4 / 3, - // 拖动截取缩略图后,截取的缩略图更新到imageItems中 - cropend: function (data) { - // 这里的ID要单独取出来 - var dataUrl = $(this).cropper("getCroppedCanvas") - .toDataURL(); - litpicImg = dataUrl; - $("#litPic").attr("src", litpicImg); - $("#litpic_b64").val(litpicImg); - } + preview: ".pv", + crop: function (e) { + $("#cropWidth").text(Math.round(e.detail.height)); + $("#cropHeight").text(Math.round(e.detail.width)); + var dataUrl = $(this).cropper("getCroppedCanvas") + .toDataURL(); + litpicImg = dataUrl; + $("#litPic").attr("src", litpicImg); + $("#litpic_b64").val(litpicImg); + }, + aspectRatio: 4 / 3, + // 拖动截取缩略图后,截取的缩略图更新到imageItems中 + cropend: function (data) { + // 这里的ID要单独取出来 + var dataUrl = $(this).cropper("getCroppedCanvas") + .toDataURL(); + litpicImg = dataUrl; + $("#litPic").attr("src", litpicImg); + $("#litpic_b64").val(litpicImg); + } } var cropperAspectRatio = { - 0: 16 / 9, - 1: 4 / 3, - 2: 1 / 1, - 3: 2 / 3, - 4: NaN, + 0: 16 / 9, + 1: 4 / 3, + 2: 1 / 1, + 3: 2 / 3, + 4: NaN, } function setAspectRatio(ar) { - var opts = optCropper; - opts.aspectRatio = cropperAspectRatio[ar]; - $("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); + var opts = optCropper; + opts.aspectRatio = cropperAspectRatio[ar]; + $("#cropImg" + mdlCropperID).cropper('destroy').cropper(opts); } function useDefault(modalID) { - $("#litpic_b64").val(litpicImgSrc); - $("#litPic").attr("src", litpicImgSrc); - CloseModal('GKModal' + modalID); + $("#litpic_b64").val(litpicImgSrc); + $("#litPic").attr("src", litpicImgSrc); + CloseModal('GKModal' + modalID); } $(document).ready(function () { - $("#btnClearAll").click(function (event) { - litpicImgSrc = ""; - litpicImg = ""; - $("#litpic_b64").val(litpicImg); - $("#litPic").attr("src", "../static/defaultpic.gif"); - }) - - // 添加图片 - $("#iptAddImages").change(function (event) { - var files = event.target.files; - for (var i = 0, f; f = files[i]; i++) { - // 如果不是图片忽略 - if (!f.type.match('image.*')) { - continue; - } - - // 将图片渲染到浏览器 - var reader = new FileReader(); - reader.onload = (function (theFile) { - return function (e) { - litpicImgSrc = e.target.result; - SetThumb(litpicImgSrc); - }; - })(f); - reader.readAsDataURL(f); - } - $("#iptAddImages").val(""); - }); - - // 截取缩略图 - function SetThumb(srcURL) { - var footer = - "

使用原图 确定

"; - var optButton = `

+ $("#btnClearAll").click(function (event) { + litpicImgSrc = ""; + litpicImg = ""; + $("#litpic_b64").val(litpicImg); + $("#litPic").attr("src", "../static/defaultpic.gif"); + }) + + // 添加图片 + $("#iptAddImages").change(function (event) { + var files = event.target.files; + for (var i = 0, f; f = files[i]; i++) { + // 如果不是图片忽略 + if (!f.type.match('image.*')) { + continue; + } + + // 将图片渲染到浏览器 + var reader = new FileReader(); + reader.onload = (function (theFile) { + return function (e) { + litpicImgSrc = e.target.result; + SetThumb(litpicImgSrc); + }; + })(f); + reader.readAsDataURL(f); + } + $("#iptAddImages").val(""); + }); + + // 截取缩略图 + function SetThumb(srcURL) { + var footer = + "

使用原图 确定

"; + var optButton = `

`; - mdlCropperID = ShowMsg( - '

宽度:px,高度:px

' + optButton + '
', { - footer: footer, - noClose: false, - title: 'DedeCMS缩略图裁剪', + mdlCropperID = ShowMsg( + '

宽度:px,高度:px

' + optButton + '
', { + footer: footer, + noClose: false, + title: 'DedeCMS缩略图裁剪', + }); + + setTimeout(function () { + $("#cropImg" + mdlCropperID).cropper(optCropper); + }, 500); + } + + $('.datepicker').daterangepicker({ + "singleDatePicker": true, + "autoApply": true, + "showDropdowns": true, + "linkedCalendars": false, + "timePicker": true, + "timePicker24Hour": true, + "timePickerSeconds": true, + "showCustomRangeLabel": false, + ranges: { + '今日': [moment(), moment()], + '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], + '本月': [moment().startOf('month'), moment().startOf('month')], + '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')] + }, + "locale": { + format: 'YYYY-MM-DD HH:mm:ss', + applyLabel: '确定', + cancelLabel: '取消', + daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'], + monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', + '七月', '八月', '九月', '十月', '十一月', '十二月'], + firstDay: 1 + } + }, function (start) { + $(this).val(start.format("YYYY-MM-DD HH:mm:ss")); }); - setTimeout(function () { - $("#cropImg" + mdlCropperID).cropper(optCropper); - }, 500); - } }) \ No newline at end of file diff --git a/src/dede/soft_add.php b/src/dede/soft_add.php index 0e4302ff..73ed3393 100755 --- a/src/dede/soft_add.php +++ b/src/dede/soft_add.php @@ -112,6 +112,21 @@ else if($dopost=='save') //处理上传的缩略图 if(empty($ddisremote)) $ddisremote = 0; $litpic = GetDDImage('none', $picname, $ddisremote); + // 处理新的缩略图上传 + if ($litpic_b64 != "") { + $data = explode( ',', $litpic_b64 ); + $ntime = time(); + $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); + CreateDir($savepath); + $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); + $fullUrl = $fullUrl.".png"; + + file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] )); + + // 加水印 + WaterImg($cfg_basedir.$fullUrl, 'up'); + $litpic = $fullUrl; + } //生成文档ID $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); diff --git a/src/dede/soft_edit.php b/src/dede/soft_edit.php index 9e647cff..fcedbce6 100755 --- a/src/dede/soft_edit.php +++ b/src/dede/soft_edit.php @@ -160,6 +160,21 @@ else if($dopost=='save') $ddisremote = 0; } $litpic = GetDDImage('litpic',$picname,$ddisremote); + // 处理新的缩略图上传 + if ($litpic_b64 != "") { + $data = explode( ',', $litpic_b64 ); + $ntime = time(); + $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); + CreateDir($savepath); + $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); + $fullUrl = $fullUrl.".png"; + + file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] )); + + // 加水印 + WaterImg($cfg_basedir.$fullUrl, 'up'); + $litpic = $fullUrl; + } //分析处理附加表数据 $inadd_f = ''; diff --git a/src/dede/spec_add.php b/src/dede/spec_add.php index 2e71c418..95ef7555 100755 --- a/src/dede/spec_add.php +++ b/src/dede/spec_add.php @@ -74,6 +74,21 @@ else if($dopost=='save') //处理上传的缩略图 if(empty($ddisremote)) $ddisremote = 0; $litpic = GetDDImage('none', $picname, $ddisremote); + // 处理新的缩略图上传 + if ($litpic_b64 != "") { + $data = explode( ',', $litpic_b64 ); + $ntime = time(); + $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); + CreateDir($savepath); + $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); + $fullUrl = $fullUrl.".png"; + + file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] )); + + // 加水印 + WaterImg($cfg_basedir.$fullUrl, 'up'); + $litpic = $fullUrl; + } //生成文档ID $arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid); diff --git a/src/dede/spec_edit.php b/src/dede/spec_edit.php index 06f93e4e..287a3dbd 100755 --- a/src/dede/spec_edit.php +++ b/src/dede/spec_edit.php @@ -90,7 +90,22 @@ else if($dopost=='save') $ddisremote = 0; } $litpic = GetDDImage('none', $picname, $ddisremote); + // 处理新的缩略图上传 + if ($litpic_b64 != "") { + $data = explode( ',', $litpic_b64 ); + $ntime = time(); + $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); + CreateDir($savepath); + $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999)); + $fullUrl = $fullUrl.".png"; + + file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] )); + // 加水印 + WaterImg($cfg_basedir.$fullUrl, 'up'); + $litpic = $fullUrl; + } + //分析处理附加表数据 $inadd_f = ''; $inadd_v = ''; diff --git a/src/dede/templets/ad_add.htm b/src/dede/templets/ad_add.htm index 3a213e5c..90384be3 100755 --- a/src/dede/templets/ad_add.htm +++ b/src/dede/templets/ad_add.htm @@ -1,78 +1,118 @@ - + + - -增加广告 - - - - + + + + + .i_table { + border: 1px solid #CCC; + } + + -
- - - - - - + +
广告管理 >> 增加广告位置
- - - - - - - - - - - - - - - - - -
广告代码的调用方法:{dede:myad name='广告位标识'/}
广告位标识: - (使用英文或数字表示的简洁标识)
广告分类:
广告投放范围: + + + + + + - -
广告管理 >> 增加广告位置
+ + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - -
广告代码的调用方法:{dede:myad name='广告位标识'/}
广告位标识: + (使用英文或数字表示的简洁标识)
广告分类:
广告投放范围:GetOptionArray(0,0,0); echo ""; ?> -
- (如果在所选栏目找不到指定标识的广告内容,系统会自动搜索父栏目)
广告位名称:
时间限制: - - -
投放时间:从 - - - 到 - -
广告内容:
-
    -
  • 代码
  • -
  • 文字
  • -
  • 图片
  • -
  • Flash
  • -
-
-
-
广告位名称:
时间限制: + + +
投放时间:从 + + 到 + +
广告内容: +
+
    +
  • 代码
  • +
  • 文字
  • +
  • 图片
  • +
  • Flash
  • +
+
+
+ +
 
过期显示内容: 
 
 
过期显示内容: 
 
- -
+
+ + @@ -205,44 +235,42 @@ function checkSubmit() - + - + - +
flash链接
flash宽度
flash高度
- - - + + + \ No newline at end of file diff --git a/src/dede/templets/ad_edit.htm b/src/dede/templets/ad_edit.htm index 7b41e23a..13ac0455 100755 --- a/src/dede/templets/ad_edit.htm +++ b/src/dede/templets/ad_edit.htm @@ -1,38 +1,79 @@ - + + - -更改广告 - - + + 更改广告 + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 广告管理 >> 更改广告
- - - - - - - - - - - - - - - + + + + - -
广告位标识:
广告分类:
广告投放范围: +
 广告管理 >> 更改广告
+ + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
广告位标识:
广告分类:
广告投放范围:GetOptionArray($row['typeid'],0,0); echo ""; ?> -
- (如果在所选栏目找不到指定标识的广告内容,系统会自动搜索父栏目)
广告位名称:
时间限制: /> - 永不过期 - /> - 在设内时间内有效
投放时间:从 - - 到 -
正常显示内容: 
过期显示内容: 
 
+
+ (如果在所选栏目找不到指定标识的广告内容,系统会自动搜索父栏目)
广告位名称:
时间限制: /> + 永不过期 + /> + 在设内时间内有效
投放时间:从 + + 到 +
正常显示内容: +  
过期显示内容: 
 
+ + + + \ No newline at end of file diff --git a/src/dede/templets/album_add.htm b/src/dede/templets/album_add.htm index a475394e..adafa1ab 100755 --- a/src/dede/templets/album_add.htm +++ b/src/dede/templets/album_add.htm @@ -11,7 +11,9 @@ - + + + @@ -501,16 +503,8 @@  发布时间: "; + echo ""; ?> - 消费金币: diff --git a/src/dede/templets/album_edit.htm b/src/dede/templets/album_edit.htm index 8607e513..87fe7612 100755 --- a/src/dede/templets/album_edit.htm +++ b/src/dede/templets/album_edit.htm @@ -14,7 +14,9 @@ body { - + + + @@ -306,33 +308,9 @@ if($cfg_need_typeid2=='Y') {  发布时间: "; + echo ""; ?> - + 消费金币: " size="10"> diff --git a/src/dede/templets/archives_add.htm b/src/dede/templets/archives_add.htm index 20a24c06..1cce397f 100755 --- a/src/dede/templets/archives_add.htm +++ b/src/dede/templets/archives_add.htm @@ -16,7 +16,9 @@ - + + + @@ -372,7 +374,7 @@  发布时间: "; + echo ""; ?> 消费金币: diff --git a/src/dede/templets/archives_edit.htm b/src/dede/templets/archives_edit.htm index 6f553936..46da982f 100755 --- a/src/dede/templets/archives_edit.htm +++ b/src/dede/templets/archives_edit.htm @@ -25,7 +25,9 @@ - + + + diff --git a/src/dede/templets/archives_sg_add.htm b/src/dede/templets/archives_sg_add.htm index 6f927764..218d0fc6 100755 --- a/src/dede/templets/archives_sg_add.htm +++ b/src/dede/templets/archives_sg_add.htm @@ -12,7 +12,9 @@ body { background-image: url(images/allbg.gif); } - + + + diff --git a/src/dede/templets/archives_sg_edit.htm b/src/dede/templets/archives_sg_edit.htm index 11354c3e..318a7e2c 100755 --- a/src/dede/templets/archives_sg_edit.htm +++ b/src/dede/templets/archives_sg_edit.htm @@ -12,7 +12,9 @@ body { background-image: url(images/allbg.gif); } - + + + diff --git a/src/dede/templets/article_add.htm b/src/dede/templets/article_add.htm index af94b139..f0869679 100755 --- a/src/dede/templets/article_add.htm +++ b/src/dede/templets/article_add.htm @@ -25,7 +25,9 @@ - + + + @@ -464,33 +466,9 @@ "; + echo ""; ?> - 发布选项: diff --git a/src/dede/templets/article_edit.htm b/src/dede/templets/article_edit.htm index 5b8af34e..fe2eb2a4 100755 --- a/src/dede/templets/article_edit.htm +++ b/src/dede/templets/article_edit.htm @@ -15,7 +15,9 @@ - + + + @@ -365,17 +367,9 @@ if($cfg_need_typeid2=='Y') {  更新时间: "; - ?> - + $nowtime = GetDateTimeMk(time()); + echo ""; + ?> 消费金币: " diff --git a/src/dede/templets/content_batch_up.htm b/src/dede/templets/content_batch_up.htm index f9e54dc6..cd9b13e7 100755 --- a/src/dede/templets/content_batch_up.htm +++ b/src/dede/templets/content_batch_up.htm @@ -1,45 +1,81 @@ - + + - -文档批量管理 - - - + + 文档批量管理 + + + + + + + - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + +
- - - - - -
文档批量管理: 
-
选定栏目: - + + +
+ + + + + +
文档批量管理: 
+
选定栏目: + GetOptionArray(0,$admin_catalogs,0,1); echo ""; ?> -
起始ID:开始: - - 结束: -
档案发布时间: - - - - - - - - -
用户的登录id: - (网址uid=后面跟的id)
操作: - - 审核文档 - - 更新HTML - - 移动文档 - - 删除文档
移动选项: - +
起始ID:开始: + + 结束: +
档案发布时间: + + + + + + + + +
+
用户的登录id: + (网址uid=后面跟的id)
操作: + + 审核文档 + + 更新HTML + + 移动文档 + + 删除文档
移动选项: + 新位置:"; echo ""; ?> -
- -
- - - - -
进行状态: - [增大] [缩小] -
-
- -
-
- - - - + + + + + + + + - - - + - - + - -
错误文档修正: 
+ +
+ + + +
进行状态: + + [增大] [缩小] +
-
- - 删除空标题的文章 - - 删除内容为空的文章 - - 更正缩图错误 -
- +
+
+ +
+
+ +
+ + + + + +
错误文档修正: 
+
+ + 删除空标题的文章 + + 删除内容为空的文章 + + 更正缩图错误 +
+ +
+ \ No newline at end of file diff --git a/src/dede/templets/makehtml_all.htm b/src/dede/templets/makehtml_all.htm index 2e9fbf58..c210b8d3 100755 --- a/src/dede/templets/makehtml_all.htm +++ b/src/dede/templets/makehtml_all.htm @@ -3,8 +3,44 @@ 一键更新 + - + + + + + + diff --git a/src/dede/templets/mytag_add.htm b/src/dede/templets/mytag_add.htm index 86ad4a85..8277a87e 100755 --- a/src/dede/templets/mytag_add.htm +++ b/src/dede/templets/mytag_add.htm @@ -1,45 +1,82 @@ - + + - -增加自定义标记 - - - + + 增加自定义标记 + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
自定义标记管理>>增加新标记
- - - - - - - - - - + + + + - -
自定义标记的调用方法:
- {dede:mytag name='标记名称' ismake='是否含板块代码(yes 或 no)' typeid='栏目ID'/} -
- 1、name 标记名称,该项是必须的属性,以下 2、3是可选属性;
- 2、ismake 默认是 no 表示设定的纯HTML代码, yes 表示含板块标记的代码;
- 3、typeid 表示所属栏目的ID,默认为 0 ,表示所有栏目通用的显示内容,在列表和文档模板中,typeid默认是这个列表或文档本身的栏目ID。
所属栏目: - +
自定义标记管理>>增加新标记
+ + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
自定义标记的调用方法:
+ {dede:mytag name='标记名称' ismake='是否含板块代码(yes 或 no)' typeid='栏目ID'/} +
+ 1、name 标记名称,该项是必须的属性,以下 2、3是可选属性;
+ 2、ismake 默认是 no 表示设定的纯HTML代码, yes 表示含板块标记的代码;
+ 3、typeid 表示所属栏目的ID,默认为 0 ,表示所有栏目通用的显示内容,在列表和文档模板中,typeid默认是这个列表或文档本身的栏目ID。
所属栏目: + GetOptionArray(0,0,0); echo ""; ?> -
标记名称:
时间限制: - 永不过期 - - 在设内时间内有效
开始时间: - - -
结束时间: - - -
正常显示内容: - -  
过期显示内容: - -  
  - -
-
+
标记名称:
时间限制: + 永不过期 + + 在设内时间内有效
开始时间: + +
结束时间: + +
正常显示内容: + +  
过期显示内容: + +  
  + +
+ + + + \ No newline at end of file diff --git a/src/dede/templets/soft_add.htm b/src/dede/templets/soft_add.htm index c142b282..a77acf11 100755 --- a/src/dede/templets/soft_add.htm +++ b/src/dede/templets/soft_add.htm @@ -5,11 +5,19 @@ 增加软件集 + + - + + + + + + + 消费金币: diff --git a/src/dede/templets/soft_edit.htm b/src/dede/templets/soft_edit.htm index 873ae8e0..40161478 100755 --- a/src/dede/templets/soft_edit.htm +++ b/src/dede/templets/soft_edit.htm @@ -5,11 +5,19 @@ 编辑软件 + + - + + + + + + + 消费金币: diff --git a/src/dede/templets/spec_add.htm b/src/dede/templets/spec_add.htm index 2b1a7eb0..b9a917c7 100755 --- a/src/dede/templets/spec_add.htm +++ b/src/dede/templets/spec_add.htm @@ -8,11 +8,19 @@ body { background-image: url(images/allbg.gif); } + + - + + + + + + + +
@@ -66,6 +84,7 @@ function CheckVal(id){ + @@ -128,18 +147,22 @@ function CheckVal(id){ - +
 专题列表 >> 发布专题 + +
- - - - + + 远程 + + + 选择图片 + - - - - 远程图片
@@ -225,16 +248,9 @@ function CheckVal(id){  发布时间: "; + echo ""; ?> - + diff --git a/src/dede/templets/spec_edit.htm b/src/dede/templets/spec_edit.htm index 27ba14b4..d3fa5d63 100755 --- a/src/dede/templets/spec_edit.htm +++ b/src/dede/templets/spec_edit.htm @@ -10,11 +10,19 @@ background-image: url(images/allbg.gif); } + + - + + + + + + + + @@ -73,6 +91,7 @@ + -
   缩 略 图: - " /> - - - 远程 + + "> + + 远程 + + + 选择图片 + + + - " - width="150" height="100" id="picview" name="picview" /> + " + style="height: 80px">
@@ -334,16 +361,8 @@ "; + echo ""; ?> -   diff --git a/src/dede/templets/video_add.htm b/src/dede/templets/video_add.htm deleted file mode 100755 index d2be2275..00000000 --- a/src/dede/templets/video_add.htm +++ /dev/null @@ -1,418 +0,0 @@ - - - - - - 增加视频 - - - - - - - - - - - - - - - - - - - -
 视频列表>>发布新视频 -   [栏目管理] -
- - - - - -
- - - - - -
 常规信息 高级参数
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
 视频名称:  简略标题:
-
- - - - - -
 自定义属性: - SetQuery("Select * From `#@__arcatt` order by sortid asc"); - $dsql->Execute(); - while($trow = $dsql->GetObject()) - { - if($trow->att=='j') - { - $jumpclick = " onclick='ShowUrlTr()'"; - } - else - { - $jumpclick = ''; - } - if(ereg($trow->att,$arcRow['flag'])) - { - echo "{$trow->attname}[{$trow->att}]"; - } - - else - { - echo "{$trow->attname}[{$trow->att}]"; - } - } - ?> -
-
- - - - - -
 TAG标签:(','号分开,单个标签小于12字节)
-
- - - - - - -
 缩 略 图: - - - - -
- - - - - - - 远程 -
-
-
-
-
- - - - - - - - -
 视频来源: - 视频作者: 
-
- - - - - - - - -
 视频主栏目: - - getUserChannel(),$channelid); - echo ""; - ?> - 快捷选择 -   - 选择副栏目】"; - } - ?> -
-
视频地址:
- - - - - -
 视频地址: - -
- - - - - - - - -
-
-
剧情介绍:
- - - - - - -
 内容摘要: 
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
  - - - - - -
-
-
-
- - - - \ No newline at end of file diff --git a/src/dede/templets/video_edit.htm b/src/dede/templets/video_edit.htm deleted file mode 100755 index 6fb86675..00000000 --- a/src/dede/templets/video_edit.htm +++ /dev/null @@ -1,392 +0,0 @@ - - - - - - 编辑视频 - - - - - - - - - -
- - - - - - - - - -
 视频列表>>发布新视频  [栏目管理] -
- - - - - -
- - - - - -
 常规信息 高级参数
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
 视频名称:  简略标题:
- - - - - -
 自定义属性: - SetQuery("Select * From `#@__arcatt` order by sortid asc"); - $dsql->Execute(); - while($trow = $dsql->GetObject()) - { - if($trow->att=='j') $jumpclick = " onclick='ShowUrlTr()'"; - else $jumpclick = ''; - if(preg_match("#".$trow->att."#",$arcRow['flag'])) - echo "{$trow->attname}[{$trow->att}]"; - else - echo "{$trow->attname}[{$trow->att}]"; - } - ?> -
- - - - - -
 TAG标签:(','号分开,单个标签小于12字节)
-
- - - - - - -
 缩 略 图: - - - - -
- " /> - - - - - - 远程 -
-
-
-
- - - - - - - -
 视频来源: - "> 视频作者:"> 
- - - - - - - -
 视频主栏目: - getUserChannel(),$channelid); - echo ""; - ?> - 快捷选择 -   - >是否同步远程发布 -
视频地址:
- - - - - -
 视频地址: - "> -
- - - - - - - - -
-
-
剧情介绍:
- - - - - - -
 内容摘要: 
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
  - - - - - -
-
-
-
- - - - \ No newline at end of file diff --git a/src/include/customfields.func.php b/src/include/customfields.func.php index 3b9f5ac5..0709bcdb 100755 --- a/src/include/customfields.func.php +++ b/src/include/customfields.func.php @@ -124,15 +124,7 @@ function GetFormItem($ctag, $admintype='admin') else if($fieldType=="datetime") { $nowtime = GetDateTimeMk(time()); - $innertext = ""; - $innertext .= " "; + $innertext = ""; } else if($fieldType=='img'||$fieldType=='imgfile') { @@ -514,15 +506,7 @@ function GetFormItemValue($ctag, $fvalue, $admintype='admin', $fieldname='') else if($ftype=="datetime") { $nowtime = GetDateTimeMk($fvalue); - $innertext = ""; - $innertext .= " "; + $innertext = ""; } else if($ftype=="img") { diff --git a/src/member/templets/js/calendar-green.css b/src/member/templets/js/calendar-green.css deleted file mode 100755 index 5bf81a2d..00000000 --- a/src/member/templets/js/calendar-green.css +++ /dev/null @@ -1,239 +0,0 @@ -/* The main calendar widget. DIV containing a table. */ - -div.calendar { position: relative; } - -.calendar, .calendar table { - border: 1px solid #CDE4B3; - font-size: 11px; - color: #000; - cursor: default; - background: #F9FCF1; - font-family: tahoma,verdana,sans-serif; -} - -.calendar table{border: 1px solid #fff;} -/* Header part -- contains navigation buttons and day names. */ -.calendar table thead td{background:#E7F6D5; color:#97C069; border-bottom:1px solid #fff; border-right:none; height:16px; width:18px} -.calendar table thead tr.headrow td{ background:#EDF9E0} -.headrow{border-top:1px solid #CDE4B3} - -.calendar table thead td.button div div{ - background-image: url(../../images/question-balloon.png); - background-repeat: no-repeat; text-indent:-100px; overflow:hidden -} -.headrow .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - border-right:1px solid #FFF; padding:0 -} -.headrow .button div,.calendar table .wn div{border-right:1px solid #CDE4B3; height:23px; line-height:23px} -.calendar .nav { -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; /* Pressing it will take you to the current date */ - text-align: center; - padding: 2px; - color:#6b9936; width:auto -} - -.calendar thead tr { /* Row containing navigation buttons */ - background: #007ED1; - color: #fff; -} - -.calendar thead .daynames { /* Row containing the day names */ - background: #EDF9E0; -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #CDE4B3; - padding: 2px; - text-align: center; - color: #000; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #a66; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - background-color: #E7F6D5; - color: #6b9936; - -} - - - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - color: #456; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day div{ padding-right:5px} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #bbb; -} -.calendar tbody .day.othermonth.oweekend { - color: #fbb; -} - -.calendar table .wn { - border-right: 1px solid #fff; - background: #EDF9E0; padding:0 -} - -.calendar tbody .rowhilite td { - background: #def; -} - -.calendar tbody .rowhilite td.wn { - background: #F9FCF1; -} - -.calendar tbody td.hilite { /* Hovered cells */ - background: #93b9e2; - padding: 1px 3px 1px 1px; - color:#fff -} - -.calendar tbody td.active { /* Active (pressed) cells */ - background: #cde; - padding: 2px 2px 0px 2px; -} - -.calendar tbody td.selected { /* Cell showing today date */ - font-weight: bold; - padding: 1px 3px 1px 1px; - background: #ff7200; - color: #fff; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #a66; -} - -.calendar tbody td.today { /* Cell showing selected date */ - font-weight: bold; - color: #D50000; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ - text-align: center; - background: #206A9B; - color: #fff; -} -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: #EDF9E0; - color: #6b9936; - border-top: 1px solid #CDE4B3; - padding: 1px; height:24px -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - background: #B8DAF0; - border: 1px solid #178AEB; - color: #000; - padding: 1px; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - background: #006AA9; - padding: 2px 0px 0px 2px; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - top: 0px; - left: 0px; - width: 4em; - cursor: default; - border: 1px solid #655; - background: #def; - color: #000; - font-size: 90%; - z-index: 9999999999999999999999999999; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .hilite { - background: #34ABFA; - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - font-weight: bold; -} - -.calendar .combo .active { - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - background: #F9FCF1; - font-weight: bold; -} - -.calendar td.time { - border-top: 1px solid #CDE4B3; - padding: 1px 0px; - text-align: center; - background-color: #EDF2E3; - height:24px -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: #F9FCF1; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: #267DB7; - color: #fff; -} - -.calendar td.time span.active { - border-color: red; - background-color: #000; - color: #A5FF00; -} -.calendar thead .active div{ /* Active (pressed) buttons in header */ - background: #bdd2e8; -} \ No newline at end of file diff --git a/src/member/templets/js/calendar.js b/src/member/templets/js/calendar.js deleted file mode 100755 index 25430100..00000000 --- a/src/member/templets/js/calendar.js +++ /dev/null @@ -1,1286 +0,0 @@ -/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo - * The DHTML Calendar, version 1.0 "It is happening again" - * Details and latest version at: - * www.dynarch.com/projects/calendar - * This script is developed by Dynarch.com. Visit us at www.dynarch.com. - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html -// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ -/** The Calendar object constructor. */ -//document.createStyleSheet('/images/js/calendar/calendar-blue.css'); - -var head = document.getElementsByTagName('HEAD').item(0); -var style = document.createElement('link'); -style.href = 'templets/js/calendar/calendar-green.css'; -style.rel = 'stylesheet'; -style.type = 'text/css'; -head.appendChild(style); - -Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {this.activeDiv = null;this.currentDateEl = null;this.getDateStatus = null; -this.getDateToolTip = null;this.getDateText = null; -this.timeout = null;this.onSelected = onSelected || null; -this.onClose = onClose || null; -this.dragging = false; -this.hidden = false; -this.minYear = 1970; -this.maxYear = 2050; -this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; -this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; -this.isPopup = true; -this.weekNumbers = true; -this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; -this.showsOtherMonths = false; -this.dateStr = dateStr; -this.ar_days = null; -this.showsTime = false; -this.time24 = true; -this.yearStep = 2; -this.hiliteToday = true; -this.multiple = null;this.table = null; -this.element = null; -this.tbody = null;this.firstdayname = null;this.monthsCombo = null;this.yearsCombo = null;this.hilitedMonth = null;this.activeMonth = null;this.hilitedYear = null; -this.activeYear = null;this.dateClicked = false; -if (typeof Calendar._SDN == "undefined") {if (typeof Calendar._SDN_len == "undefined")Calendar._SDN_len = 3;var ar = new Array();for (var i = 8; i > 0;) {ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);}Calendar._SDN = ar;if (typeof Calendar._SMN_len == "undefined")Calendar._SMN_len = 3;ar = new Array();for (var i = 12; i > 0;) {ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);}Calendar._SMN = ar;}};Calendar._C = null;Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) );Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );Calendar.is_opera = /opera/i.test(navigator.userAgent);Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos = function(el) {var SL = 0, ST = 0;var is_div = /^div$/i.test(el.tagName);if (is_div && el.scrollLeft)SL = el.scrollLeft;if (is_div && el.scrollTop)ST = el.scrollTop;var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };if (el.offsetParent) {var tmp = this.getAbsolutePos(el.offsetParent);r.x += tmp.x;r.y += tmp.y;}return r;};Calendar.isRelated = function (el, evt) {var related = evt.relatedTarget;if (!related) {var type = evt.type;if (type == "mouseover") {related = evt.fromElement;} else if (type == "mouseout") {related = evt.toElement;}}while (related) {if (related == el) {return true;}related = related.parentNode;}return false;};Calendar.removeClass = function(el, className) {if (!(el && el.className)) {return;}var cls = el.className.split(" ");var ar = new Array();for (var i = cls.length; i > 0;) {if (cls[--i] != className) {ar[ar.length] = cls[i];}}el.className = ar.join(" ");};Calendar.addClass = function(el, className) {Calendar.removeClass(el, className);el.className += " " + className;};Calendar.getElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;while (f.nodeType != 1 || /^div$/i.test(f.tagName))f = f.parentNode;return f;};Calendar.getTargetElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.target;while (f.nodeType != 1)f = f.parentNode;return f;};Calendar.stopEvent = function(ev) {ev || (ev = window.event);if (Calendar.is_ie) {ev.cancelBubble = true;ev.returnValue = false;} else {ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent = function(el, evname, func) {if (el.attachEvent) { el.attachEvent("on" + evname, func);} else if (el.addEventListener) { el.addEventListener(evname, func, true);} else {el["on" + evname] = func;}};Calendar.removeEvent = function(el, evname, func) {if (el.detachEvent) { el.detachEvent("on" + evname, func);} else if (el.removeEventListener) { el.removeEventListener(evname, func, true);} else {el["on" + evname] = null;}};Calendar.createElement = function(type, parent) {var el = null;if (document.createElementNS) {el = document.createElementNS("http://www.w3.org/1999/xhtml", type);} else {el = document.createElement(type);}if (typeof parent != "undefined") {parent.appendChild(el);}return el;};Calendar._add_evs = function(el) {with (Calendar) {addEvent(el, "mouseover", dayMouseOver);addEvent(el, "mousedown", dayMouseDown);addEvent(el, "mouseout", dayMouseOut);if (is_ie) {addEvent(el, "dblclick", dayMouseDblClick);el.setAttribute("unselectable", true);}}};Calendar.findMonth = function(el) {if (typeof el.month != "undefined") {return el;} else if (typeof el.parentNode.month != "undefined") {return el.parentNode;}return null;};Calendar.findYear = function(el) {if (typeof el.year != "undefined") {return el;} else if (typeof el.parentNode.year != "undefined") {return el.parentNode;}return null;};Calendar.showMonthsCombo = function () {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var mc = cal.monthsCombo;if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}if (cal.activeMonth) {Calendar.removeClass(cal.activeMonth, "active");}var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon, "active");cal.activeMonth = mon;var s = mc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var mcw = mc.offsetWidth;if (typeof mcw == "undefined")mcw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";};Calendar.showYearsCombo = function (fwd) {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var yc = cal.yearsCombo;if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}if (cal.activeYear) {Calendar.removeClass(cal.activeYear, "active");}cal.activeYear = null;var Y = cal.date.getFullYear() + (fwd ? 1 : -1);var yr = yc.firstChild;var show = false;for (var i = 12; i > 0; --i) {if (Y >= cal.minYear && Y <= cal.maxYear) {yr.innerHTML = Y;yr.year = Y;yr.style.display = "block";show = true;} else {yr.style.display = "none";}yr = yr.nextSibling;Y += fwd ? cal.yearStep : -cal.yearStep;}if (show) {var s = yc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var ycw = yc.offsetWidth;if (typeof ycw == "undefined")ycw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";}};Calendar.tableMouseUp = function(ev) {var cal = Calendar._C;if (!cal) {return false;}if (cal.timeout) {clearTimeout(cal.timeout);}var el = cal.activeDiv;if (!el) {return false;}var target = Calendar.getTargetElement(ev);ev || (ev = window.event);Calendar.removeClass(el, "active");if (target == el || target.parentNode == el) {Calendar.cellClick(el, ev);}var mon = Calendar.findMonth(target);var date = null;if (mon) {date = new Date(cal.date);if (mon.month != date.getMonth()) {date.setMonth(mon.month);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}} else {var year = Calendar.findYear(target);if (year) {date = new Date(cal.date);if (year.year != date.getFullYear()) {date.setFullYear(year.year);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}}}with (Calendar) {removeEvent(document, "mouseup", tableMouseUp);removeEvent(document, "mouseover", tableMouseOver);removeEvent(document, "mousemove", tableMouseOver);cal._hideCombos();_C = null;return stopEvent(ev);}};Calendar.tableMouseOver = function (ev) {var cal = Calendar._C;if (!cal) {return;}var el = cal.activeDiv;var target = Calendar.getTargetElement(ev);if (target == el || target.parentNode == el) {Calendar.addClass(el, "hilite active");Calendar.addClass(el.parentNode, "rowhilite");} else {if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))Calendar.removeClass(el, "active");Calendar.removeClass(el, "hilite");Calendar.removeClass(el.parentNode, "rowhilite");}ev || (ev = window.event);if (el.navtype == 50 && target != el) {var pos = Calendar.getAbsolutePos(el);var w = el.offsetWidth;var x = ev.clientX;var dx;var decrease = true;if (x > pos.x + w) {dx = x - pos.x - w;decrease = false;} elsedx = pos.x - x;if (dx < 0) dx = 0;var range = el._range;var current = el._current;var count = Math.floor(dx / 10) % range.length;for (var i = range.length; --i >= 0;)if (range[i] == current) -break; -while (count-- > 0) -if (decrease) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval;cal.onUpdateTime(); -} -var mon = Calendar.findMonth(target); -if (mon) { -if (mon.month != cal.date.getMonth()) { -if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -Calendar.addClass(mon, "hilite"); -cal.hilitedMonth = mon; -} else if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -} else { -if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}var year = Calendar.findYear(target);if (year) {if (year.year != cal.date.getFullYear()) {if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}Calendar.addClass(year, "hilite");cal.hilitedYear = year;} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown = function (ev) {if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {return Calendar.stopEvent(ev);}};Calendar.calDragIt = function (ev) {var cal = Calendar._C;if (!(cal && cal.dragging)) {return false;}var posX;var posY;if (Calendar.is_ie) {posY = window.event.clientY + document.body.scrollTop;posX = window.event.clientX + document.body.scrollLeft;} else {posX = ev.pageX;posY = ev.pageY;}cal.hideShowCovered();var st = cal.element.style;st.left = (posX - cal.xOffs) + "px";st.top = (posY - cal.yOffs) + "px";return Calendar.stopEvent(ev);};Calendar.calDragEnd = function (ev) {var cal = Calendar._C;if (!cal) {return false;}cal.dragging = false;with (Calendar) {removeEvent(document, "mousemove", calDragIt);removeEvent(document, "mouseup", calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown = function(ev) {var el = Calendar.getElement(ev); -if (el.disabled) { -return false; -} -var cal = el.calendar; -cal.activeDiv = el; -Calendar._C = cal; -if (el.navtype != 300) with (Calendar) { -if (el.navtype == 50) { -el._current = el.innerHTML; -addEvent(document, "mousemove", tableMouseOver); -} else -addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); -addClass(el, "hilite active"); -addEvent(document, "mouseup", tableMouseUp); -} else if (cal.isPopup) { -cal._dragStart(ev); -} -if (el.navtype == -1 || el.navtype == 1) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); -} else if (el.navtype == -2 || el.navtype == 2) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); -} else { -cal.timeout = null; -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseDblClick = function(ev) { -Calendar.cellClick(Calendar.getElement(ev), ev || window.event); -if (Calendar.is_ie) { -document.selection.empty(); -} -};Calendar.dayMouseOver = function(ev) { -var el = Calendar.getElement(ev); -if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { -return false; -} -if (el.ttip) { -if (el.ttip.substr(0, 1) == "_") { -el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); -} -el.calendar.tooltips.innerHTML = el.ttip; -} -if (el.navtype != 300) { -Calendar.addClass(el, "hilite"); -if (el.caldate) { -Calendar.addClass(el.parentNode, "rowhilite"); -} -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseOut = function(ev) { -with (Calendar) { -var el = getElement(ev); -if (isRelated(el, ev) || _C || el.disabled) -return false; -removeClass(el, "hilite"); -if (el.caldate) -removeClass(el.parentNode, "rowhilite"); -if (el.calendar) -el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; -return stopEvent(ev); -} -}; -Calendar.cellClick = function(el, ev) { -var cal = el.calendar; -var closing = false; -var newdate = false; -var date = null; -if (typeof el.navtype == "undefined") { -if (cal.currentDateEl) { -Calendar.removeClass(cal.currentDateEl, "selected"); -Calendar.addClass(el, "selected"); -closing = (cal.currentDateEl == el); -if (!closing) { -cal.currentDateEl = el; -} -} -cal.date.setDateOnly(el.caldate); -date = cal.date; -var other_month = !(cal.dateClicked = !el.otherMonth); -if (!other_month && !cal.currentDateEl) -cal._toggleMultipleDate(new Date(date)); -else -newdate = !el.disabled;if (other_month) -cal._init(cal.firstDayOfWeek, date); -} else { -if (el.navtype == 200) { -Calendar.removeClass(el, "hilite"); -cal.callCloseHandler(); -return; -} -date = new Date(cal.date); -if (el.navtype == 0) -date.setDateOnly(new Date()); -cal.dateClicked = false; -var year = date.getFullYear(); -var mon = date.getMonth(); -function setMonth(m) { -var day = date.getDate(); -var max = date.getMonthDays(m); -if (day > max) { -date.setDate(max); -} -date.setMonth(m); -}; -switch (el.navtype) { - case 400: -Calendar.removeClass(el, "hilite"); -var text = Calendar._TT["ABOUT"]; -if (typeof text != "undefined") { -text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; -} else {text = "Help and about box text is not translated into this language.\n" + -"If you know this language and you feel generous please update\n" + -"the corresponding file in \"lang\" subdir to match calendar-en.js\n" + -"and send it back to to get it into the distribution ;-)\n\n" + -"Thank you!\n" + -"http://dynarch.com/mishoo/calendar.epl\n"; -} -alert(text); -return; - case -2: -if (year > cal.minYear) { -date.setFullYear(year - 1); -} -break; - case -1: -if (mon > 0) { -setMonth(mon - 1); -} else if (year-- > cal.minYear) { -date.setFullYear(year); -setMonth(11); -} -break; - case 1: -if (mon < 11) { -setMonth(mon + 1); -} else if (year < cal.maxYear) { -date.setFullYear(year + 1); -setMonth(0); -} -break; - case 2: -if (year < cal.maxYear) { -date.setFullYear(year + 1); -} -break; - case 100: -cal.setFirstDayOfWeek(el.fdow); -return; - case 50: -var range = el._range; -var current = el.innerHTML; -for (var i = range.length; --i >= 0;) -if (range[i] == current) -break; -if (ev && ev.shiftKey) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval; -cal.onUpdateTime(); -return; - case 0:if ((typeof cal.getDateStatus == "function") && - cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { -return false; -} -break; -} -if (!date.equalsTo(cal.date)) { -cal.setDate(date); -newdate = true; -} else if (el.navtype == 0) -newdate = closing = true; -} -if (newdate) { -ev && cal.callHandler(); -} -if (closing) { -Calendar.removeClass(el, "hilite"); -ev && cal.callCloseHandler(); -} -}; -Calendar.prototype.create = function (_par) { -var parent = null; -if (! _par) { -parent = document.getElementsByTagName("body")[0]; -this.isPopup = true; -} else { -parent = _par; -this.isPopup = false; -} -this.date = this.dateStr ? new Date(this.dateStr) : new Date();var table = Calendar.createElement("table"); -this.table = table; -table.cellSpacing = 0; -table.cellPadding = 0; -table.calendar = this; -Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);var div = Calendar.createElement("div"); -this.element = div; -div.className = "calendar"; -if (this.isPopup) { -div.style.position = "absolute"; -div.style.display = "none"; -} -div.appendChild(table);var thead = Calendar.createElement("thead", table); -var cell = null; -var row = null;var cal = this; -var hh = function (text, cs, navtype) { -cell = Calendar.createElement("td", row); -cell.colSpan = cs; -cell.className = "button"; -if (navtype != 0 && Math.abs(navtype) <= 2) -cell.className += " nav"; -Calendar._add_evs(cell); -cell.calendar = cal; -cell.navtype = navtype; -cell.innerHTML = "
" + text + "
"; -return cell; -};row = Calendar.createElement("tr", thead); -var title_length = 6; -(this.isPopup) && --title_length; -(this.weekNumbers) && ++title_length;hh("
?
", 1, 400).ttip = Calendar._TT["INFO"]; -this.title = hh("", title_length, 300); -this.title.className = "title"; -if (this.isPopup) { -this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; -this.title.style.cursor = "move"; -hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; -}row = Calendar.createElement("tr", thead); -row.className = "headrow";this._nav_py = hh("«", 1, -2); -this._nav_py.ttip = Calendar._TT["PREV_YEAR"];this._nav_pm = hh("‹", 1, -1); -this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); -this._nav_now.ttip = Calendar._TT["GO_TODAY"];this._nav_nm = hh("›", 1, 1); -this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];this._nav_ny = hh("»", 1, 2); -this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; -row = Calendar.createElement("tr", thead); -row.className = "daynames"; -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -cell.className = "name wn"; -cell.innerHTML = "
"+Calendar._TT["WK"]+"
"; -} -for (var i = 7; i > 0; --i) { -cell = Calendar.createElement("td", row); -if (!i) { -cell.navtype = 100; -cell.calendar = this; -Calendar._add_evs(cell); -} -} -this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; -this._displayWeekdays();var tbody = Calendar.createElement("tbody", table); -this.tbody = tbody;for (i = 6; i > 0; --i) { -row = Calendar.createElement("tr", tbody); -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -} -for (var j = 7; j > 0; --j) { -cell = Calendar.createElement("td", row); -cell.calendar = this; -Calendar._add_evs(cell); -} -}if (this.showsTime) { -row = Calendar.createElement("tr", tbody); -row.className = "time";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -cell.innerHTML = Calendar._TT["TIME"] || " ";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = this.weekNumbers ? 4 : 3;(function(){ -function makeTimePart(className, init, range_start, range_end) { -var part = Calendar.createElement("span", cell); -part.className = className; -part.innerHTML = init; -part.calendar = cal; -part.ttip = Calendar._TT["TIME_PART"]; -part.navtype = 50; -part._range = []; -if (typeof range_start != "number") -part._range = range_start; -else { -for (var i = range_start; i <= range_end; ++i) { -var txt; -if (i < 10 && range_end >= 10) txt = '0' + i; -else txt = '' + i; -part._range[part._range.length] = txt; -} -} -Calendar._add_evs(part); -return part; -}; -var hrs = cal.date.getHours(); -var mins = cal.date.getMinutes(); -var t12 = !cal.time24; -var pm = (hrs > 12); -if (t12 && pm) hrs -= 12; -var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); -var span = Calendar.createElement("span", cell); -span.innerHTML = ":"; -span.className = "colon"; -var M = makeTimePart("minute", mins, 0, 59); -var AP = null; -cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -if (t12) -AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); -else -cell.innerHTML = " ";cal.onSetTime = function() { -var pm, hrs = this.date.getHours(), -mins = this.date.getMinutes(); -if (t12) { -pm = (hrs >= 12); -if (pm) hrs -= 12; -if (hrs == 0) hrs = 12; -AP.innerHTML = pm ? "pm" : "am"; -} -H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; -M.innerHTML = (mins < 10) ? ("0" + mins) : mins; -};cal.onUpdateTime = function() { -var date = this.date; -var h = parseInt(H.innerHTML, 10); -if (t12) { -if (/pm/i.test(AP.innerHTML) && h < 12) -h += 12; -else if (/am/i.test(AP.innerHTML) && h == 12) -h = 0; -} -var d = date.getDate(); -var m = date.getMonth(); -var y = date.getFullYear(); -date.setHours(h); -date.setMinutes(parseInt(M.innerHTML, 10)); -date.setFullYear(y); -date.setMonth(m); -date.setDate(d); -this.dateClicked = false; -this.callHandler(); -}; -})(); -} else { -this.onSetTime = this.onUpdateTime = function() {}; -}var tfoot = Calendar.createElement("tfoot", table);row = Calendar.createElement("tr", tfoot); -row.className = "footrow";cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); -cell.className = "ttip"; -if (this.isPopup) { -cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; -cell.style.cursor = "move"; -} -this.tooltips = cell;div = Calendar.createElement("div", this.element); -this.monthsCombo = div; -div.className = "combo"; -for (i = 0; i < Calendar._MN.length; ++i) { -var mn = Calendar.createElement("div"); -mn.className = Calendar.is_ie ? "label-IEfix" : "label"; -mn.month = i; -mn.innerHTML = Calendar._SMN[i]; -div.appendChild(mn); -}div = Calendar.createElement("div", this.element); -this.yearsCombo = div; -div.className = "combo"; -for (i = 12; i > 0; --i) { -var yr = Calendar.createElement("div"); -yr.className = Calendar.is_ie ? "label-IEfix" : "label"; -div.appendChild(yr); -}this._init(this.firstDayOfWeek, this.date); -parent.appendChild(this.element); -}; -Calendar._keyEvent = function(ev) { -var cal = window._dynarch_popupCalendar; -if (!cal || cal.multiple) -return false; -(Calendar.is_ie) && (ev = window.event); -var act = (Calendar.is_ie || ev.type == "keypress"), -K = ev.keyCode; -if (ev.ctrlKey) { -switch (K) { - case 37: -act && Calendar.cellClick(cal._nav_pm); -break; - case 38: -act && Calendar.cellClick(cal._nav_py); -break; - case 39: -act && Calendar.cellClick(cal._nav_nm); -break; - case 40: -act && Calendar.cellClick(cal._nav_ny); -break; - default: -return false; -} -} else switch (K) { - case 32: -Calendar.cellClick(cal._nav_now); -break; - case 27: -act && cal.callCloseHandler(); -break; - case 37: - case 38: - case 39: - case 40: -if (act) { -var prev, x, y, ne, el, step; -prev = K == 37 || K == 38; -step = (K == 37 || K == 39) ? 1 : 7; -function setVars() { -el = cal.currentDateEl; -var p = el.pos; -x = p & 15; -y = p >> 4; -ne = cal.ar_days[y][x]; -};setVars(); -function prevMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() - step); -cal.setDate(date); -}; -function nextMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() + step); -cal.setDate(date); -}; -while (1) { -switch (K) { - case 37: -if (--x >= 0) -ne = cal.ar_days[y][x]; -else { -x = 6; -K = 38; -continue; -} -break; - case 38: -if (--y >= 0) -ne = cal.ar_days[y][x]; -else { -prevMonth(); -setVars(); -} -break; - case 39: -if (++x < 7) -ne = cal.ar_days[y][x]; -else { -x = 0; -K = 40; -continue; -} -break; - case 40: -if (++y < cal.ar_days.length) -ne = cal.ar_days[y][x]; -else { -nextMonth(); -setVars(); -} -break; -} -break; -} -if (ne) { -if (!ne.disabled) -Calendar.cellClick(ne); -else if (prev) -prevMonth(); -else -nextMonth(); -} -} -break; - case 13: -if (act) -Calendar.cellClick(cal.currentDateEl, ev); -break; - default: -return false; -} -return Calendar.stopEvent(ev); -}; -Calendar.prototype._init = function (firstDayOfWeek, date) { -var today = new Date(), -TY = today.getFullYear(), -TM = today.getMonth(), -TD = today.getDate(); -this.table.style.visibility = "hidden"; -var year = date.getFullYear(); -if (year < this.minYear) { -year = this.minYear; -date.setFullYear(year); -} else if (year > this.maxYear) { -year = this.maxYear; -date.setFullYear(year); -} -this.firstDayOfWeek = firstDayOfWeek; -this.date = new Date(date); -var month = date.getMonth(); -var mday = date.getDate(); -var no_days = date.getMonthDays(); -date.setDate(1); -var day1 = (date.getDay() - this.firstDayOfWeek) % 7; -if (day1 < 0) -day1 += 7; -date.setDate(-day1); -date.setDate(date.getDate() + 1);var row = this.tbody.firstChild; -var MN = Calendar._SMN[month]; -var ar_days = this.ar_days = new Array(); -var weekend = Calendar._TT["WEEKEND"]; -var dates = this.multiple ? (this.datesCells = {}) : null; -for (var i = 0; i < 6; ++i, row = row.nextSibling) { -var cell = row.firstChild; -if (this.weekNumbers) { -cell.className = "day wn"; -cell.innerHTML = "
"+date.getWeekNumber()+"
"; -cell = cell.nextSibling; -} -row.className = "daysrow"; -var hasdays = false, iday, dpos = ar_days[i] = []; -for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { -iday = date.getDate(); -var wday = date.getDay(); -cell.className = "day"; -cell.pos = i << 4 | j; -dpos[j] = cell; -var current_month = (date.getMonth() == month); -if (!current_month) { -if (this.showsOtherMonths) { -cell.className += " othermonth"; -cell.otherMonth = true; -} else { -cell.className = "emptycell"; -cell.innerHTML = " "; -cell.disabled = true; -continue; -} -} else { -cell.otherMonth = false; -hasdays = true; -} -cell.disabled = false; -cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; -if (dates) -dates[date.print("%Y%m%d")] = cell; -if (this.getDateStatus) { -var status = this.getDateStatus(date, year, month, iday); -if (this.getDateToolTip) { -var toolTip = this.getDateToolTip(date, year, month, iday); -if (toolTip) -cell.title = toolTip; -} -if (status === true) { -cell.className += " disabled"; -cell.disabled = true; -} else { -if (/disabled/i.test(status)) -cell.disabled = true; -cell.className += " " + status; -} -} -if (!cell.disabled) { -cell.caldate = new Date(date); -cell.ttip = "_"; -if (!this.multiple && current_month - && iday == mday && this.hiliteToday) { -cell.className += " selected"; -this.currentDateEl = cell; -} -if (date.getFullYear() == TY && - date.getMonth() == TM && - iday == TD) { -cell.className += " today"; -cell.ttip += Calendar._TT["PART_TODAY"]; -} -if (weekend.indexOf(wday.toString()) != -1) -cell.className += cell.otherMonth ? " oweekend" : " weekend"; -} -} -if (!(hasdays || this.showsOtherMonths)) -row.className = "emptyrow"; -} -this.title.innerHTML = Calendar._MN[month] + ", " + year; -this.onSetTime(); -this.table.style.visibility = "visible"; -this._initMultipleDates(); -};Calendar.prototype._initMultipleDates = function() { -if (this.multiple) { -for (var i in this.multiple) { -var cell = this.datesCells[i]; -var d = this.multiple[i]; -if (!d) -continue; -if (cell) -cell.className += " selected"; -} -} -};Calendar.prototype._toggleMultipleDate = function(date) { -if (this.multiple) { -var ds = date.print("%Y%m%d"); -var cell = this.datesCells[ds]; -if (cell) { -var d = this.multiple[ds]; -if (!d) { -Calendar.addClass(cell, "selected"); -this.multiple[ds] = date; -} else { -Calendar.removeClass(cell, "selected"); -delete this.multiple[ds]; -} -} -} -};Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { -this.getDateToolTip = unaryFunction; -}; -Calendar.prototype.setDate = function (date) { -if (!date.equalsTo(this.date)) { -this._init(this.firstDayOfWeek, date); -} -}; -Calendar.prototype.refresh = function () { -this._init(this.firstDayOfWeek, this.date); -}; -Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { -this._init(firstDayOfWeek, this.date); -this._displayWeekdays(); -}; -Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { -this.getDateStatus = unaryFunction; -}; -Calendar.prototype.setRange = function (a, z) { -this.minYear = a; -this.maxYear = z; -}; -Calendar.prototype.callHandler = function () { -if (this.onSelected) { -this.onSelected(this, this.date.print(this.dateFormat)); -} -}; -Calendar.prototype.callCloseHandler = function () { -if (this.onClose) { -this.onClose(this); -} -this.hideShowCovered(); -}; -Calendar.prototype.destroy = function () { -var el = this.element.parentNode; -el.removeChild(this.element); -Calendar._C = null; -window._dynarch_popupCalendar = null; -}; -Calendar.prototype.reparent = function (new_parent) { -var el = this.element; -el.parentNode.removeChild(el); -new_parent.appendChild(el); -}; -Calendar._checkCalendar = function(ev) { -var calendar = window._dynarch_popupCalendar; -if (!calendar) { -return false; -} -var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); -for (; el != null && el != calendar.element; el = el.parentNode); -if (el == null) {window._dynarch_popupCalendar.callCloseHandler(); -return Calendar.stopEvent(ev); -} -}; -Calendar.prototype.show = function () { -var rows = this.table.getElementsByTagName("tr"); -for (var i = rows.length; i > 0;) { -var row = rows[--i]; -Calendar.removeClass(row, "rowhilite"); -var cells = row.getElementsByTagName("td"); -for (var j = cells.length; j > 0;) { -var cell = cells[--j]; -Calendar.removeClass(cell, "hilite"); -Calendar.removeClass(cell, "active"); -} -} -this.element.style.display = "block"; -this.hidden = false; -if (this.isPopup) { -window._dynarch_popupCalendar = this; -Calendar.addEvent(document, "keydown", Calendar._keyEvent); -Calendar.addEvent(document, "keypress", Calendar._keyEvent); -Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); -} -this.hideShowCovered(); -}; -Calendar.prototype.hide = function () { -if (this.isPopup) { -Calendar.removeEvent(document, "keydown", Calendar._keyEvent); -Calendar.removeEvent(document, "keypress", Calendar._keyEvent); -Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); -} -this.element.style.display = "none"; -this.hidden = true; -this.hideShowCovered(); -};Calendar.prototype.showAt = function (x, y) { -var s = this.element.style; -s.left = x + "px"; -s.top = y + "px"; -this.show(); -}; -Calendar.prototype.showAtElement = function (el, opts) { -var self = this; -var p = Calendar.getAbsolutePos(el); -if (!opts || typeof opts != "string") { -this.showAt(p.x, p.y + el.offsetHeight); -return true; -} -function fixPosition(box) { -if (box.x < 0) -box.x = 0; -if (box.y < 0) -box.y = 0; -var cp = document.createElement("div"); -var s = cp.style; -s.position = "absolute"; -s.right = s.bottom = s.width = s.height = "0px"; -document.body.appendChild(cp); -var br = Calendar.getAbsolutePos(cp); -document.body.removeChild(cp); -if (Calendar.is_ie) { -br.y += document.body.scrollTop; -br.x += document.body.scrollLeft; -} else { -br.y += window.scrollY; -br.x += window.scrollX; -} -var tmp = box.x + box.width - br.x; -if (tmp > 0) box.x -= tmp; -tmp = box.y + box.height - br.y; -if (tmp > 0) box.y -= tmp; -}; -this.element.style.display = "block"; -Calendar.continuation_for_the_fucking_khtml_browser = function() { -var w = self.element.offsetWidth; -var h = self.element.offsetHeight; -self.element.style.display = "none"; -var valign = opts.substr(0, 1); -var halign = "l"; -if (opts.length > 1) { -halign = opts.substr(1, 1); -}switch (valign) { - case "T": p.y -= h; break; - case "B": p.y += el.offsetHeight; break; - case "C": p.y += (el.offsetHeight - h) / 2; break; - case "t": p.y += el.offsetHeight - h; break; - case "b": break; -}switch (halign) { - case "L": p.x -= w; break; - case "R": p.x += el.offsetWidth; break; - case "C": p.x += (el.offsetWidth - w) / 2; break; - case "l": p.x += el.offsetWidth - w; break; - case "r": break; -} -p.width = w; -p.height = h + 40; -self.monthsCombo.style.display = "none"; -fixPosition(p); -self.showAt(p.x, p.y); -}; -if (Calendar.is_khtml) -setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); -else -Calendar.continuation_for_the_fucking_khtml_browser(); -}; -Calendar.prototype.setDateFormat = function (str) { -this.dateFormat = str; -}; -Calendar.prototype.setTtDateFormat = function (str) { -this.ttDateFormat = str; -}; -Calendar.prototype.parseDate = function(str, fmt) { -if (!fmt) -fmt = this.dateFormat; -this.setDate(Date.parseDate(str, fmt)); -}; -Calendar.prototype.hideShowCovered = function () { -if (!Calendar.is_ie && !Calendar.is_opera) -return; -function getVisib(obj){ -var value = obj.style.visibility; -if (!value) { -if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { -if (!Calendar.is_khtml) -value = document.defaultView. -getComputedStyle(obj, "").getPropertyValue("visibility"); -else -value = ''; -} else if (obj.currentStyle) { -value = obj.currentStyle.visibility; -} else -value = ''; -} -return value; -};var tags = new Array("applet", "iframe", "select"); -var el = this.element;var p = Calendar.getAbsolutePos(el); -var EX1 = p.x; -var EX2 = el.offsetWidth + EX1; -var EY1 = p.y; -var EY2 = el.offsetHeight + EY1;for (var k = tags.length; k > 0; ) { -var ar = document.getElementsByTagName(tags[--k]); -var cc = null;for (var i = ar.length; i > 0;) { -cc = ar[--i];p = Calendar.getAbsolutePos(cc); -var CX1 = p.x; -var CX2 = cc.offsetWidth + CX1; -var CY1 = p.y; -var CY2 = cc.offsetHeight + CY1;if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = cc.__msh_save_visibility; -} else { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = "hidden"; -} -} -} -}; -Calendar.prototype._displayWeekdays = function () { -var fdow = this.firstDayOfWeek; -var cell = this.firstdayname; -var weekend = Calendar._TT["WEEKEND"]; -for (var i = 0; i < 7; ++i) { -cell.className = "day name"; -var realday = (i + fdow) % 7; -if (i) { -cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); -cell.navtype = 100; -cell.calendar = this; -cell.fdow = realday; -Calendar._add_evs(cell); -} -if (weekend.indexOf(realday.toString()) != -1) { -Calendar.addClass(cell, "weekend"); -} -cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; -cell = cell.nextSibling; -} -}; -Calendar.prototype._hideCombos = function () { -this.monthsCombo.style.display = "none"; -this.yearsCombo.style.display = "none"; -}; -Calendar.prototype._dragStart = function (ev) { -if (this.dragging) { -return; -} -this.dragging = true; -var posX; -var posY; -if (Calendar.is_ie) { -posY = window.event.clientY + document.body.scrollTop; -posX = window.event.clientX + document.body.scrollLeft; -} else { -posY = ev.clientY + window.scrollY; -posX = ev.clientX + window.scrollX; -} -var st = this.element.style; -this.xOffs = posX - parseInt(st.left); -this.yOffs = posY - parseInt(st.top); -with (Calendar) { -addEvent(document, "mousemove", calDragIt); -addEvent(document, "mouseup", calDragEnd); -} -}; -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY;Date.parseDate = function(str, fmt) { -var today = new Date(); -var y = 0; -var m = -1; -var d = 0; -var a = str.split(/\W+/); -var b = fmt.match(/%./g); -var i = 0, j = 0; -var hr = 0; -var min = 0; -for (i = 0; i < a.length; ++i) { -if (!a[i]) -continue; -switch (b[i]) { - case "%d": - case "%e": -d = parseInt(a[i], 10); -break; case "%m": -m = parseInt(a[i], 10) - 1; -break; case "%Y": - case "%y": -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -break; case "%b": - case "%B": -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } -} -break; case "%H": - case "%I": - case "%k": - case "%l": -hr = parseInt(a[i], 10); -break; case "%P": - case "%p": -if (/pm/i.test(a[i]) && hr < 12) -hr += 12; -else if (/am/i.test(a[i]) && hr >= 12) -hr -= 12; -break; case "%M": -min = parseInt(a[i], 10); -break; -} -} -if (isNaN(y)) y = today.getFullYear(); -if (isNaN(m)) m = today.getMonth(); -if (isNaN(d)) d = today.getDate(); -if (isNaN(hr)) hr = today.getHours(); -if (isNaN(min)) min = today.getMinutes(); -if (y != 0 && m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -y = 0; m = -1; d = 0; -for (i = 0; i < a.length; ++i) { -if (a[i].search(/[a-zA-Z]+/) != -1) { -var t = -1; -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } -} -if (t != -1) { -if (m != -1) { -d = m+1; -} -m = t; -} -} else if (parseInt(a[i], 10) <= 12 && m == -1) { -m = a[i]-1; -} else if (parseInt(a[i], 10) > 31 && y == 0) { -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -} else if (d == 0) { -d = a[i]; -} -} -if (y == 0) -y = today.getFullYear(); -if (m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -return today; -}; -Date.prototype.getMonthDays = function(month) { -var year = this.getFullYear(); -if (typeof month == "undefined") { -month = this.getMonth(); -} -if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { -return 29; -} else { -return Date._MD[month]; -} -}; -Date.prototype.getDayOfYear = function() { -var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); -var time = now - then; -return Math.floor(time / Date.DAY); -}; -Date.prototype.getWeekNumber = function() { -var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var DoW = d.getDay(); -d.setDate(d.getDate() - (DoW + 6) % 7 + 3); -var ms = d.valueOf(); -d.setMonth(0); -d.setDate(4); -return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; -}; -Date.prototype.equalsTo = function(date) { -return ((this.getFullYear() == date.getFullYear()) && -(this.getMonth() == date.getMonth()) && -(this.getDate() == date.getDate()) && -(this.getHours() == date.getHours()) && -(this.getMinutes() == date.getMinutes())); -}; -Date.prototype.setDateOnly = function(date) { -var tmp = new Date(date); -this.setDate(1); -this.setFullYear(tmp.getFullYear()); -this.setMonth(tmp.getMonth()); -this.setDate(tmp.getDate()); -}; -Date.prototype.print = function (str) { -var m = this.getMonth(); -var d = this.getDate(); -var y = this.getFullYear(); -var wn = this.getWeekNumber(); -var w = this.getDay(); -var s = {}; -var hr = this.getHours(); -var pm = (hr >= 12); -var ir = (pm) ? (hr - 12) : hr; -var dy = this.getDayOfYear(); -if (ir == 0) -ir = 12; -var min = this.getMinutes(); -var sec = this.getSeconds(); -s["%a"] = Calendar._SDN[w];s["%A"] = Calendar._DN[w];s["%b"] = Calendar._SMN[m];s["%B"] = Calendar._MN[m]; s["%C"] = 1 + Math.floor(y / 100);s["%d"] = (d < 10) ? ("0" + d) : d;s["%e"] = d;s["%H"] = (hr < 10) ? ("0" + hr) : hr;s["%I"] = (ir < 10) ? ("0" + ir) : ir;s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy;s["%k"] = hr; -s["%l"] = ir; -s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m);s["%M"] = (min < 10) ? ("0" + min) : min;s["%n"] = "\n"; -s["%p"] = pm ? "PM" : "AM"; -s["%P"] = pm ? "pm" : "am"; -s["%s"] = Math.floor(this.getTime() / 1000); -s["%S"] = (sec < 10) ? ("0" + sec) : sec;s["%t"] = "\t";s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; -s["%u"] = w + 1; -s["%w"] = w; -s["%y"] = ('' + y).substr(2, 2);s["%Y"] = y; -s["%%"] = "%"; -var re = /%./g; -if (!Calendar.is_ie5 && !Calendar.is_khtml) -return str.replace(re, function (par) { return s[par] || par; });var a = str.match(re); -for (var i = 0; i < a.length; i++) { -var tmp = s[a[i]]; -if (tmp) { -re = new RegExp(a[i], 'g'); -str = str.replace(re, tmp); -} -}return str; -};Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { -var d = new Date(this); -d.__msh_oldSetFullYear(y); -if (d.getMonth() != this.getMonth()) -this.setDate(28); -this.__msh_oldSetFullYear(y); -};window._dynarch_popupCalendar = null; - - -Calendar._DN = new Array -("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"); -Calendar._SDN = new Array -("日","一","二","三","四","五","六","日"); -Calendar._FD = 0; -Calendar._MN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._SMN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._TT = {}; -Calendar._TT["INFO"] = "帮助"; -Calendar._TT["ABOUT"] = -"选择日期:\n" + -"- 点击 \xab, \xbb 按钮选择年份\n" + -"- 点击 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按钮选择月份\n" + -"- 长按以上按钮可从菜单中快速选择年份或月份"; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"选择时间:\n" + -"- 点击小时或分钟可使改数值加一\n" + -"- 按住Shift键点击小时或分钟可使改数值减一\n" + -"- 点击拖动鼠标可进行快速选择"; -Calendar._TT["PREV_YEAR"] = "上一年 (按住出菜单)"; -Calendar._TT["PREV_MONTH"] = "上一月 (按住出菜单)"; -Calendar._TT["GO_TODAY"] = "转到今日"; -Calendar._TT["NEXT_MONTH"] = "下一月 (按住出菜单)"; -Calendar._TT["NEXT_YEAR"] = "下一年 (按住出菜单)"; -Calendar._TT["SEL_DATE"] = "选择日期"; -Calendar._TT["DRAG_TO_MOVE"] = "拖动"; -Calendar._TT["PART_TODAY"] = " (今日)"; -Calendar._TT["DAY_FIRST"] = "最左边显示%s"; -Calendar._TT["WEEKEND"] = "0,6"; -Calendar._TT["CLOSE"] = "关闭"; -Calendar._TT["TODAY"] = "今日"; -Calendar._TT["TIME_PART"] = "(Shift-)点击鼠标或拖动改变值"; -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e日"; -Calendar._TT["WK"] = "周"; -Calendar._TT["TIME"] = "时间:"; - - -Calendar.setup = function (params) { - function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; - - param_default("inputField", null); - param_default("displayArea", null); - param_default("button", null); - param_default("eventName", "click"); - param_default("ifFormat", "%Y/%m/%d"); - param_default("daFormat", "%Y/%m/%d"); - param_default("singleClick", true); - param_default("disableFunc", null); - param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("dateText", null); - param_default("firstDay", null); - param_default("align", "Br"); - param_default("range", [1900, 2999]); - param_default("weekNumbers", true); - param_default("flat", null); - param_default("flatCallback", null); - param_default("onSelect", null); - param_default("onClose", null); - param_default("onUpdate", null); - param_default("date", null); - param_default("showsTime", false); - param_default("timeFormat", "24"); - param_default("electric", true); - param_default("step", 2); - param_default("position", null); - param_default("cache", false); - param_default("showOthers", false); - param_default("multiple", null); - - var tmp = ["inputField", "displayArea", "button"]; - for (var i in tmp) { - if (typeof params[tmp[i]] == "string") { - params[tmp[i]] = document.getElementById(params[tmp[i]]); - } - } - if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { - alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); - return false; - } - - function onSelect(cal) { - var p = cal.params; - var update = (cal.dateClicked || p.electric); - if (update && p.inputField) { - p.inputField.value = cal.date.print(p.ifFormat); - if (typeof p.inputField.onchange == "function") - p.inputField.onchange(); - } - if (update && p.displayArea) - p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && typeof p.onUpdate == "function") - p.onUpdate(cal); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - } - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); - }; - - if (params.flat != null) { - if (typeof params.flat == "string") - params.flat = document.getElementById(params.flat); - if (!params.flat) { - alert("Calendar.setup:\n Flat specified but can't find parent."); - return false; - } - var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); - cal.showsOtherMonths = params.showOthers; - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.params = params; - cal.weekNumbers = params.weekNumbers; - cal.setRange(params.range[0], params.range[1]); - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - if (params.ifFormat) { - cal.setDateFormat(params.ifFormat); - } - if (params.inputField && typeof params.inputField.value == "string") { - cal.parseDate(params.inputField.value); - } - cal.create(params.flat); - cal.show(); - return false; - } - - var triggerEl = params.button || params.displayArea || params.inputField; - triggerEl["on" + params.eventName] = function() { - var dateEl = params.inputField || params.displayArea; - var dateFmt = params.inputField ? params.ifFormat : params.daFormat; - var mustCreate = false; - var cal = window.calendar; - if (dateEl) - params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); - if (!(cal && params.cache)) { - window.calendar = cal = new Calendar(params.firstDay, - params.date, - params.onSelect || onSelect, - params.onClose || function(cal) { cal.hide(); }); - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.weekNumbers = params.weekNumbers; - mustCreate = true; - } else { - if (params.date) - cal.setDate(params.date); - cal.hide(); - } - if (params.multiple) { - cal.multiple = {}; - for (var i = params.multiple.length; --i >= 0;) { - var d = params.multiple[i]; - var ds = d.print("%Y%m%d"); - cal.multiple[ds] = d; - } - } - cal.showsOtherMonths = params.showOthers; - cal.yearStep = params.step; - cal.setRange(params.range[0], params.range[1]); - cal.params = params; - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - cal.setDateFormat(dateFmt); - if (mustCreate) - cal.create(); - cal.refresh(); - if (!params.position) - cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); - else - cal.showAt(params.position[0], params.position[1]); - return false; - }; - - return cal; -}; \ No newline at end of file diff --git a/src/member/templets/js/calendar/calendar-green.css b/src/member/templets/js/calendar/calendar-green.css deleted file mode 100755 index 5bf81a2d..00000000 --- a/src/member/templets/js/calendar/calendar-green.css +++ /dev/null @@ -1,239 +0,0 @@ -/* The main calendar widget. DIV containing a table. */ - -div.calendar { position: relative; } - -.calendar, .calendar table { - border: 1px solid #CDE4B3; - font-size: 11px; - color: #000; - cursor: default; - background: #F9FCF1; - font-family: tahoma,verdana,sans-serif; -} - -.calendar table{border: 1px solid #fff;} -/* Header part -- contains navigation buttons and day names. */ -.calendar table thead td{background:#E7F6D5; color:#97C069; border-bottom:1px solid #fff; border-right:none; height:16px; width:18px} -.calendar table thead tr.headrow td{ background:#EDF9E0} -.headrow{border-top:1px solid #CDE4B3} - -.calendar table thead td.button div div{ - background-image: url(../../images/question-balloon.png); - background-repeat: no-repeat; text-indent:-100px; overflow:hidden -} -.headrow .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - border-right:1px solid #FFF; padding:0 -} -.headrow .button div,.calendar table .wn div{border-right:1px solid #CDE4B3; height:23px; line-height:23px} -.calendar .nav { -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; /* Pressing it will take you to the current date */ - text-align: center; - padding: 2px; - color:#6b9936; width:auto -} - -.calendar thead tr { /* Row containing navigation buttons */ - background: #007ED1; - color: #fff; -} - -.calendar thead .daynames { /* Row containing the day names */ - background: #EDF9E0; -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #CDE4B3; - padding: 2px; - text-align: center; - color: #000; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #a66; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - background-color: #E7F6D5; - color: #6b9936; - -} - - - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - color: #456; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day div{ padding-right:5px} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #bbb; -} -.calendar tbody .day.othermonth.oweekend { - color: #fbb; -} - -.calendar table .wn { - border-right: 1px solid #fff; - background: #EDF9E0; padding:0 -} - -.calendar tbody .rowhilite td { - background: #def; -} - -.calendar tbody .rowhilite td.wn { - background: #F9FCF1; -} - -.calendar tbody td.hilite { /* Hovered cells */ - background: #93b9e2; - padding: 1px 3px 1px 1px; - color:#fff -} - -.calendar tbody td.active { /* Active (pressed) cells */ - background: #cde; - padding: 2px 2px 0px 2px; -} - -.calendar tbody td.selected { /* Cell showing today date */ - font-weight: bold; - padding: 1px 3px 1px 1px; - background: #ff7200; - color: #fff; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #a66; -} - -.calendar tbody td.today { /* Cell showing selected date */ - font-weight: bold; - color: #D50000; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ - text-align: center; - background: #206A9B; - color: #fff; -} -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: #EDF9E0; - color: #6b9936; - border-top: 1px solid #CDE4B3; - padding: 1px; height:24px -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - background: #B8DAF0; - border: 1px solid #178AEB; - color: #000; - padding: 1px; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - background: #006AA9; - padding: 2px 0px 0px 2px; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - top: 0px; - left: 0px; - width: 4em; - cursor: default; - border: 1px solid #655; - background: #def; - color: #000; - font-size: 90%; - z-index: 9999999999999999999999999999; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .hilite { - background: #34ABFA; - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - font-weight: bold; -} - -.calendar .combo .active { - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - background: #F9FCF1; - font-weight: bold; -} - -.calendar td.time { - border-top: 1px solid #CDE4B3; - padding: 1px 0px; - text-align: center; - background-color: #EDF2E3; - height:24px -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: #F9FCF1; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: #267DB7; - color: #fff; -} - -.calendar td.time span.active { - border-color: red; - background-color: #000; - color: #A5FF00; -} -.calendar thead .active div{ /* Active (pressed) buttons in header */ - background: #bdd2e8; -} \ No newline at end of file diff --git a/src/member/templets/js/calendar/calendar.js b/src/member/templets/js/calendar/calendar.js deleted file mode 100755 index 25430100..00000000 --- a/src/member/templets/js/calendar/calendar.js +++ /dev/null @@ -1,1286 +0,0 @@ -/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo - * The DHTML Calendar, version 1.0 "It is happening again" - * Details and latest version at: - * www.dynarch.com/projects/calendar - * This script is developed by Dynarch.com. Visit us at www.dynarch.com. - * This script is distributed under the GNU Lesser General Public License. - * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html -// $Id: calendar.js,v 1.51 2005/03/07 16:44:31 mishoo Exp $ -/** The Calendar object constructor. */ -//document.createStyleSheet('/images/js/calendar/calendar-blue.css'); - -var head = document.getElementsByTagName('HEAD').item(0); -var style = document.createElement('link'); -style.href = 'templets/js/calendar/calendar-green.css'; -style.rel = 'stylesheet'; -style.type = 'text/css'; -head.appendChild(style); - -Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {this.activeDiv = null;this.currentDateEl = null;this.getDateStatus = null; -this.getDateToolTip = null;this.getDateText = null; -this.timeout = null;this.onSelected = onSelected || null; -this.onClose = onClose || null; -this.dragging = false; -this.hidden = false; -this.minYear = 1970; -this.maxYear = 2050; -this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; -this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; -this.isPopup = true; -this.weekNumbers = true; -this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; -this.showsOtherMonths = false; -this.dateStr = dateStr; -this.ar_days = null; -this.showsTime = false; -this.time24 = true; -this.yearStep = 2; -this.hiliteToday = true; -this.multiple = null;this.table = null; -this.element = null; -this.tbody = null;this.firstdayname = null;this.monthsCombo = null;this.yearsCombo = null;this.hilitedMonth = null;this.activeMonth = null;this.hilitedYear = null; -this.activeYear = null;this.dateClicked = false; -if (typeof Calendar._SDN == "undefined") {if (typeof Calendar._SDN_len == "undefined")Calendar._SDN_len = 3;var ar = new Array();for (var i = 8; i > 0;) {ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);}Calendar._SDN = ar;if (typeof Calendar._SMN_len == "undefined")Calendar._SMN_len = 3;ar = new Array();for (var i = 12; i > 0;) {ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);}Calendar._SMN = ar;}};Calendar._C = null;Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) );Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );Calendar.is_opera = /opera/i.test(navigator.userAgent);Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos = function(el) {var SL = 0, ST = 0;var is_div = /^div$/i.test(el.tagName);if (is_div && el.scrollLeft)SL = el.scrollLeft;if (is_div && el.scrollTop)ST = el.scrollTop;var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };if (el.offsetParent) {var tmp = this.getAbsolutePos(el.offsetParent);r.x += tmp.x;r.y += tmp.y;}return r;};Calendar.isRelated = function (el, evt) {var related = evt.relatedTarget;if (!related) {var type = evt.type;if (type == "mouseover") {related = evt.fromElement;} else if (type == "mouseout") {related = evt.toElement;}}while (related) {if (related == el) {return true;}related = related.parentNode;}return false;};Calendar.removeClass = function(el, className) {if (!(el && el.className)) {return;}var cls = el.className.split(" ");var ar = new Array();for (var i = cls.length; i > 0;) {if (cls[--i] != className) {ar[ar.length] = cls[i];}}el.className = ar.join(" ");};Calendar.addClass = function(el, className) {Calendar.removeClass(el, className);el.className += " " + className;};Calendar.getElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;while (f.nodeType != 1 || /^div$/i.test(f.tagName))f = f.parentNode;return f;};Calendar.getTargetElement = function(ev) {var f = Calendar.is_ie ? window.event.srcElement : ev.target;while (f.nodeType != 1)f = f.parentNode;return f;};Calendar.stopEvent = function(ev) {ev || (ev = window.event);if (Calendar.is_ie) {ev.cancelBubble = true;ev.returnValue = false;} else {ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent = function(el, evname, func) {if (el.attachEvent) { el.attachEvent("on" + evname, func);} else if (el.addEventListener) { el.addEventListener(evname, func, true);} else {el["on" + evname] = func;}};Calendar.removeEvent = function(el, evname, func) {if (el.detachEvent) { el.detachEvent("on" + evname, func);} else if (el.removeEventListener) { el.removeEventListener(evname, func, true);} else {el["on" + evname] = null;}};Calendar.createElement = function(type, parent) {var el = null;if (document.createElementNS) {el = document.createElementNS("http://www.w3.org/1999/xhtml", type);} else {el = document.createElement(type);}if (typeof parent != "undefined") {parent.appendChild(el);}return el;};Calendar._add_evs = function(el) {with (Calendar) {addEvent(el, "mouseover", dayMouseOver);addEvent(el, "mousedown", dayMouseDown);addEvent(el, "mouseout", dayMouseOut);if (is_ie) {addEvent(el, "dblclick", dayMouseDblClick);el.setAttribute("unselectable", true);}}};Calendar.findMonth = function(el) {if (typeof el.month != "undefined") {return el;} else if (typeof el.parentNode.month != "undefined") {return el.parentNode;}return null;};Calendar.findYear = function(el) {if (typeof el.year != "undefined") {return el;} else if (typeof el.parentNode.year != "undefined") {return el.parentNode;}return null;};Calendar.showMonthsCombo = function () {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var mc = cal.monthsCombo;if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}if (cal.activeMonth) {Calendar.removeClass(cal.activeMonth, "active");}var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon, "active");cal.activeMonth = mon;var s = mc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var mcw = mc.offsetWidth;if (typeof mcw == "undefined")mcw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";};Calendar.showYearsCombo = function (fwd) {var cal = Calendar._C;if (!cal) {return false;}var cal = cal;var cd = cal.activeDiv;var yc = cal.yearsCombo;if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}if (cal.activeYear) {Calendar.removeClass(cal.activeYear, "active");}cal.activeYear = null;var Y = cal.date.getFullYear() + (fwd ? 1 : -1);var yr = yc.firstChild;var show = false;for (var i = 12; i > 0; --i) {if (Y >= cal.minYear && Y <= cal.maxYear) {yr.innerHTML = Y;yr.year = Y;yr.style.display = "block";show = true;} else {yr.style.display = "none";}yr = yr.nextSibling;Y += fwd ? cal.yearStep : -cal.yearStep;}if (show) {var s = yc.style;s.display = "block";if (cd.navtype < 0)s.left = cd.offsetLeft + "px";else {var ycw = yc.offsetWidth;if (typeof ycw == "undefined")ycw = 50;s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";}s.top = (cd.offsetTop + cd.offsetHeight) + "px";}};Calendar.tableMouseUp = function(ev) {var cal = Calendar._C;if (!cal) {return false;}if (cal.timeout) {clearTimeout(cal.timeout);}var el = cal.activeDiv;if (!el) {return false;}var target = Calendar.getTargetElement(ev);ev || (ev = window.event);Calendar.removeClass(el, "active");if (target == el || target.parentNode == el) {Calendar.cellClick(el, ev);}var mon = Calendar.findMonth(target);var date = null;if (mon) {date = new Date(cal.date);if (mon.month != date.getMonth()) {date.setMonth(mon.month);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}} else {var year = Calendar.findYear(target);if (year) {date = new Date(cal.date);if (year.year != date.getFullYear()) {date.setFullYear(year.year);cal.setDate(date);cal.dateClicked = false;cal.callHandler();}}}with (Calendar) {removeEvent(document, "mouseup", tableMouseUp);removeEvent(document, "mouseover", tableMouseOver);removeEvent(document, "mousemove", tableMouseOver);cal._hideCombos();_C = null;return stopEvent(ev);}};Calendar.tableMouseOver = function (ev) {var cal = Calendar._C;if (!cal) {return;}var el = cal.activeDiv;var target = Calendar.getTargetElement(ev);if (target == el || target.parentNode == el) {Calendar.addClass(el, "hilite active");Calendar.addClass(el.parentNode, "rowhilite");} else {if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))Calendar.removeClass(el, "active");Calendar.removeClass(el, "hilite");Calendar.removeClass(el.parentNode, "rowhilite");}ev || (ev = window.event);if (el.navtype == 50 && target != el) {var pos = Calendar.getAbsolutePos(el);var w = el.offsetWidth;var x = ev.clientX;var dx;var decrease = true;if (x > pos.x + w) {dx = x - pos.x - w;decrease = false;} elsedx = pos.x - x;if (dx < 0) dx = 0;var range = el._range;var current = el._current;var count = Math.floor(dx / 10) % range.length;for (var i = range.length; --i >= 0;)if (range[i] == current) -break; -while (count-- > 0) -if (decrease) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval;cal.onUpdateTime(); -} -var mon = Calendar.findMonth(target); -if (mon) { -if (mon.month != cal.date.getMonth()) { -if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -Calendar.addClass(mon, "hilite"); -cal.hilitedMonth = mon; -} else if (cal.hilitedMonth) { -Calendar.removeClass(cal.hilitedMonth, "hilite"); -} -} else { -if (cal.hilitedMonth) {Calendar.removeClass(cal.hilitedMonth, "hilite");}var year = Calendar.findYear(target);if (year) {if (year.year != cal.date.getFullYear()) {if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}Calendar.addClass(year, "hilite");cal.hilitedYear = year;} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}} else if (cal.hilitedYear) {Calendar.removeClass(cal.hilitedYear, "hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown = function (ev) {if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {return Calendar.stopEvent(ev);}};Calendar.calDragIt = function (ev) {var cal = Calendar._C;if (!(cal && cal.dragging)) {return false;}var posX;var posY;if (Calendar.is_ie) {posY = window.event.clientY + document.body.scrollTop;posX = window.event.clientX + document.body.scrollLeft;} else {posX = ev.pageX;posY = ev.pageY;}cal.hideShowCovered();var st = cal.element.style;st.left = (posX - cal.xOffs) + "px";st.top = (posY - cal.yOffs) + "px";return Calendar.stopEvent(ev);};Calendar.calDragEnd = function (ev) {var cal = Calendar._C;if (!cal) {return false;}cal.dragging = false;with (Calendar) {removeEvent(document, "mousemove", calDragIt);removeEvent(document, "mouseup", calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown = function(ev) {var el = Calendar.getElement(ev); -if (el.disabled) { -return false; -} -var cal = el.calendar; -cal.activeDiv = el; -Calendar._C = cal; -if (el.navtype != 300) with (Calendar) { -if (el.navtype == 50) { -el._current = el.innerHTML; -addEvent(document, "mousemove", tableMouseOver); -} else -addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); -addClass(el, "hilite active"); -addEvent(document, "mouseup", tableMouseUp); -} else if (cal.isPopup) { -cal._dragStart(ev); -} -if (el.navtype == -1 || el.navtype == 1) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); -} else if (el.navtype == -2 || el.navtype == 2) { -if (cal.timeout) clearTimeout(cal.timeout); -cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); -} else { -cal.timeout = null; -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseDblClick = function(ev) { -Calendar.cellClick(Calendar.getElement(ev), ev || window.event); -if (Calendar.is_ie) { -document.selection.empty(); -} -};Calendar.dayMouseOver = function(ev) { -var el = Calendar.getElement(ev); -if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { -return false; -} -if (el.ttip) { -if (el.ttip.substr(0, 1) == "_") { -el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); -} -el.calendar.tooltips.innerHTML = el.ttip; -} -if (el.navtype != 300) { -Calendar.addClass(el, "hilite"); -if (el.caldate) { -Calendar.addClass(el.parentNode, "rowhilite"); -} -} -return Calendar.stopEvent(ev); -};Calendar.dayMouseOut = function(ev) { -with (Calendar) { -var el = getElement(ev); -if (isRelated(el, ev) || _C || el.disabled) -return false; -removeClass(el, "hilite"); -if (el.caldate) -removeClass(el.parentNode, "rowhilite"); -if (el.calendar) -el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; -return stopEvent(ev); -} -}; -Calendar.cellClick = function(el, ev) { -var cal = el.calendar; -var closing = false; -var newdate = false; -var date = null; -if (typeof el.navtype == "undefined") { -if (cal.currentDateEl) { -Calendar.removeClass(cal.currentDateEl, "selected"); -Calendar.addClass(el, "selected"); -closing = (cal.currentDateEl == el); -if (!closing) { -cal.currentDateEl = el; -} -} -cal.date.setDateOnly(el.caldate); -date = cal.date; -var other_month = !(cal.dateClicked = !el.otherMonth); -if (!other_month && !cal.currentDateEl) -cal._toggleMultipleDate(new Date(date)); -else -newdate = !el.disabled;if (other_month) -cal._init(cal.firstDayOfWeek, date); -} else { -if (el.navtype == 200) { -Calendar.removeClass(el, "hilite"); -cal.callCloseHandler(); -return; -} -date = new Date(cal.date); -if (el.navtype == 0) -date.setDateOnly(new Date()); -cal.dateClicked = false; -var year = date.getFullYear(); -var mon = date.getMonth(); -function setMonth(m) { -var day = date.getDate(); -var max = date.getMonthDays(m); -if (day > max) { -date.setDate(max); -} -date.setMonth(m); -}; -switch (el.navtype) { - case 400: -Calendar.removeClass(el, "hilite"); -var text = Calendar._TT["ABOUT"]; -if (typeof text != "undefined") { -text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; -} else {text = "Help and about box text is not translated into this language.\n" + -"If you know this language and you feel generous please update\n" + -"the corresponding file in \"lang\" subdir to match calendar-en.js\n" + -"and send it back to to get it into the distribution ;-)\n\n" + -"Thank you!\n" + -"http://dynarch.com/mishoo/calendar.epl\n"; -} -alert(text); -return; - case -2: -if (year > cal.minYear) { -date.setFullYear(year - 1); -} -break; - case -1: -if (mon > 0) { -setMonth(mon - 1); -} else if (year-- > cal.minYear) { -date.setFullYear(year); -setMonth(11); -} -break; - case 1: -if (mon < 11) { -setMonth(mon + 1); -} else if (year < cal.maxYear) { -date.setFullYear(year + 1); -setMonth(0); -} -break; - case 2: -if (year < cal.maxYear) { -date.setFullYear(year + 1); -} -break; - case 100: -cal.setFirstDayOfWeek(el.fdow); -return; - case 50: -var range = el._range; -var current = el.innerHTML; -for (var i = range.length; --i >= 0;) -if (range[i] == current) -break; -if (ev && ev.shiftKey) { -if (--i < 0) -i = range.length - 1; -} else if ( ++i >= range.length ) -i = 0; -var newval = range[i]; -el.innerHTML = newval; -cal.onUpdateTime(); -return; - case 0:if ((typeof cal.getDateStatus == "function") && - cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { -return false; -} -break; -} -if (!date.equalsTo(cal.date)) { -cal.setDate(date); -newdate = true; -} else if (el.navtype == 0) -newdate = closing = true; -} -if (newdate) { -ev && cal.callHandler(); -} -if (closing) { -Calendar.removeClass(el, "hilite"); -ev && cal.callCloseHandler(); -} -}; -Calendar.prototype.create = function (_par) { -var parent = null; -if (! _par) { -parent = document.getElementsByTagName("body")[0]; -this.isPopup = true; -} else { -parent = _par; -this.isPopup = false; -} -this.date = this.dateStr ? new Date(this.dateStr) : new Date();var table = Calendar.createElement("table"); -this.table = table; -table.cellSpacing = 0; -table.cellPadding = 0; -table.calendar = this; -Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);var div = Calendar.createElement("div"); -this.element = div; -div.className = "calendar"; -if (this.isPopup) { -div.style.position = "absolute"; -div.style.display = "none"; -} -div.appendChild(table);var thead = Calendar.createElement("thead", table); -var cell = null; -var row = null;var cal = this; -var hh = function (text, cs, navtype) { -cell = Calendar.createElement("td", row); -cell.colSpan = cs; -cell.className = "button"; -if (navtype != 0 && Math.abs(navtype) <= 2) -cell.className += " nav"; -Calendar._add_evs(cell); -cell.calendar = cal; -cell.navtype = navtype; -cell.innerHTML = "
" + text + "
"; -return cell; -};row = Calendar.createElement("tr", thead); -var title_length = 6; -(this.isPopup) && --title_length; -(this.weekNumbers) && ++title_length;hh("
?
", 1, 400).ttip = Calendar._TT["INFO"]; -this.title = hh("", title_length, 300); -this.title.className = "title"; -if (this.isPopup) { -this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; -this.title.style.cursor = "move"; -hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; -}row = Calendar.createElement("tr", thead); -row.className = "headrow";this._nav_py = hh("«", 1, -2); -this._nav_py.ttip = Calendar._TT["PREV_YEAR"];this._nav_pm = hh("‹", 1, -1); -this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); -this._nav_now.ttip = Calendar._TT["GO_TODAY"];this._nav_nm = hh("›", 1, 1); -this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];this._nav_ny = hh("»", 1, 2); -this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; -row = Calendar.createElement("tr", thead); -row.className = "daynames"; -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -cell.className = "name wn"; -cell.innerHTML = "
"+Calendar._TT["WK"]+"
"; -} -for (var i = 7; i > 0; --i) { -cell = Calendar.createElement("td", row); -if (!i) { -cell.navtype = 100; -cell.calendar = this; -Calendar._add_evs(cell); -} -} -this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; -this._displayWeekdays();var tbody = Calendar.createElement("tbody", table); -this.tbody = tbody;for (i = 6; i > 0; --i) { -row = Calendar.createElement("tr", tbody); -if (this.weekNumbers) { -cell = Calendar.createElement("td", row); -} -for (var j = 7; j > 0; --j) { -cell = Calendar.createElement("td", row); -cell.calendar = this; -Calendar._add_evs(cell); -} -}if (this.showsTime) { -row = Calendar.createElement("tr", tbody); -row.className = "time";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -cell.innerHTML = Calendar._TT["TIME"] || " ";cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = this.weekNumbers ? 4 : 3;(function(){ -function makeTimePart(className, init, range_start, range_end) { -var part = Calendar.createElement("span", cell); -part.className = className; -part.innerHTML = init; -part.calendar = cal; -part.ttip = Calendar._TT["TIME_PART"]; -part.navtype = 50; -part._range = []; -if (typeof range_start != "number") -part._range = range_start; -else { -for (var i = range_start; i <= range_end; ++i) { -var txt; -if (i < 10 && range_end >= 10) txt = '0' + i; -else txt = '' + i; -part._range[part._range.length] = txt; -} -} -Calendar._add_evs(part); -return part; -}; -var hrs = cal.date.getHours(); -var mins = cal.date.getMinutes(); -var t12 = !cal.time24; -var pm = (hrs > 12); -if (t12 && pm) hrs -= 12; -var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); -var span = Calendar.createElement("span", cell); -span.innerHTML = ":"; -span.className = "colon"; -var M = makeTimePart("minute", mins, 0, 59); -var AP = null; -cell = Calendar.createElement("td", row); -cell.className = "time"; -cell.colSpan = 2; -if (t12) -AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); -else -cell.innerHTML = " ";cal.onSetTime = function() { -var pm, hrs = this.date.getHours(), -mins = this.date.getMinutes(); -if (t12) { -pm = (hrs >= 12); -if (pm) hrs -= 12; -if (hrs == 0) hrs = 12; -AP.innerHTML = pm ? "pm" : "am"; -} -H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; -M.innerHTML = (mins < 10) ? ("0" + mins) : mins; -};cal.onUpdateTime = function() { -var date = this.date; -var h = parseInt(H.innerHTML, 10); -if (t12) { -if (/pm/i.test(AP.innerHTML) && h < 12) -h += 12; -else if (/am/i.test(AP.innerHTML) && h == 12) -h = 0; -} -var d = date.getDate(); -var m = date.getMonth(); -var y = date.getFullYear(); -date.setHours(h); -date.setMinutes(parseInt(M.innerHTML, 10)); -date.setFullYear(y); -date.setMonth(m); -date.setDate(d); -this.dateClicked = false; -this.callHandler(); -}; -})(); -} else { -this.onSetTime = this.onUpdateTime = function() {}; -}var tfoot = Calendar.createElement("tfoot", table);row = Calendar.createElement("tr", tfoot); -row.className = "footrow";cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); -cell.className = "ttip"; -if (this.isPopup) { -cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; -cell.style.cursor = "move"; -} -this.tooltips = cell;div = Calendar.createElement("div", this.element); -this.monthsCombo = div; -div.className = "combo"; -for (i = 0; i < Calendar._MN.length; ++i) { -var mn = Calendar.createElement("div"); -mn.className = Calendar.is_ie ? "label-IEfix" : "label"; -mn.month = i; -mn.innerHTML = Calendar._SMN[i]; -div.appendChild(mn); -}div = Calendar.createElement("div", this.element); -this.yearsCombo = div; -div.className = "combo"; -for (i = 12; i > 0; --i) { -var yr = Calendar.createElement("div"); -yr.className = Calendar.is_ie ? "label-IEfix" : "label"; -div.appendChild(yr); -}this._init(this.firstDayOfWeek, this.date); -parent.appendChild(this.element); -}; -Calendar._keyEvent = function(ev) { -var cal = window._dynarch_popupCalendar; -if (!cal || cal.multiple) -return false; -(Calendar.is_ie) && (ev = window.event); -var act = (Calendar.is_ie || ev.type == "keypress"), -K = ev.keyCode; -if (ev.ctrlKey) { -switch (K) { - case 37: -act && Calendar.cellClick(cal._nav_pm); -break; - case 38: -act && Calendar.cellClick(cal._nav_py); -break; - case 39: -act && Calendar.cellClick(cal._nav_nm); -break; - case 40: -act && Calendar.cellClick(cal._nav_ny); -break; - default: -return false; -} -} else switch (K) { - case 32: -Calendar.cellClick(cal._nav_now); -break; - case 27: -act && cal.callCloseHandler(); -break; - case 37: - case 38: - case 39: - case 40: -if (act) { -var prev, x, y, ne, el, step; -prev = K == 37 || K == 38; -step = (K == 37 || K == 39) ? 1 : 7; -function setVars() { -el = cal.currentDateEl; -var p = el.pos; -x = p & 15; -y = p >> 4; -ne = cal.ar_days[y][x]; -};setVars(); -function prevMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() - step); -cal.setDate(date); -}; -function nextMonth() { -var date = new Date(cal.date); -date.setDate(date.getDate() + step); -cal.setDate(date); -}; -while (1) { -switch (K) { - case 37: -if (--x >= 0) -ne = cal.ar_days[y][x]; -else { -x = 6; -K = 38; -continue; -} -break; - case 38: -if (--y >= 0) -ne = cal.ar_days[y][x]; -else { -prevMonth(); -setVars(); -} -break; - case 39: -if (++x < 7) -ne = cal.ar_days[y][x]; -else { -x = 0; -K = 40; -continue; -} -break; - case 40: -if (++y < cal.ar_days.length) -ne = cal.ar_days[y][x]; -else { -nextMonth(); -setVars(); -} -break; -} -break; -} -if (ne) { -if (!ne.disabled) -Calendar.cellClick(ne); -else if (prev) -prevMonth(); -else -nextMonth(); -} -} -break; - case 13: -if (act) -Calendar.cellClick(cal.currentDateEl, ev); -break; - default: -return false; -} -return Calendar.stopEvent(ev); -}; -Calendar.prototype._init = function (firstDayOfWeek, date) { -var today = new Date(), -TY = today.getFullYear(), -TM = today.getMonth(), -TD = today.getDate(); -this.table.style.visibility = "hidden"; -var year = date.getFullYear(); -if (year < this.minYear) { -year = this.minYear; -date.setFullYear(year); -} else if (year > this.maxYear) { -year = this.maxYear; -date.setFullYear(year); -} -this.firstDayOfWeek = firstDayOfWeek; -this.date = new Date(date); -var month = date.getMonth(); -var mday = date.getDate(); -var no_days = date.getMonthDays(); -date.setDate(1); -var day1 = (date.getDay() - this.firstDayOfWeek) % 7; -if (day1 < 0) -day1 += 7; -date.setDate(-day1); -date.setDate(date.getDate() + 1);var row = this.tbody.firstChild; -var MN = Calendar._SMN[month]; -var ar_days = this.ar_days = new Array(); -var weekend = Calendar._TT["WEEKEND"]; -var dates = this.multiple ? (this.datesCells = {}) : null; -for (var i = 0; i < 6; ++i, row = row.nextSibling) { -var cell = row.firstChild; -if (this.weekNumbers) { -cell.className = "day wn"; -cell.innerHTML = "
"+date.getWeekNumber()+"
"; -cell = cell.nextSibling; -} -row.className = "daysrow"; -var hasdays = false, iday, dpos = ar_days[i] = []; -for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { -iday = date.getDate(); -var wday = date.getDay(); -cell.className = "day"; -cell.pos = i << 4 | j; -dpos[j] = cell; -var current_month = (date.getMonth() == month); -if (!current_month) { -if (this.showsOtherMonths) { -cell.className += " othermonth"; -cell.otherMonth = true; -} else { -cell.className = "emptycell"; -cell.innerHTML = " "; -cell.disabled = true; -continue; -} -} else { -cell.otherMonth = false; -hasdays = true; -} -cell.disabled = false; -cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; -if (dates) -dates[date.print("%Y%m%d")] = cell; -if (this.getDateStatus) { -var status = this.getDateStatus(date, year, month, iday); -if (this.getDateToolTip) { -var toolTip = this.getDateToolTip(date, year, month, iday); -if (toolTip) -cell.title = toolTip; -} -if (status === true) { -cell.className += " disabled"; -cell.disabled = true; -} else { -if (/disabled/i.test(status)) -cell.disabled = true; -cell.className += " " + status; -} -} -if (!cell.disabled) { -cell.caldate = new Date(date); -cell.ttip = "_"; -if (!this.multiple && current_month - && iday == mday && this.hiliteToday) { -cell.className += " selected"; -this.currentDateEl = cell; -} -if (date.getFullYear() == TY && - date.getMonth() == TM && - iday == TD) { -cell.className += " today"; -cell.ttip += Calendar._TT["PART_TODAY"]; -} -if (weekend.indexOf(wday.toString()) != -1) -cell.className += cell.otherMonth ? " oweekend" : " weekend"; -} -} -if (!(hasdays || this.showsOtherMonths)) -row.className = "emptyrow"; -} -this.title.innerHTML = Calendar._MN[month] + ", " + year; -this.onSetTime(); -this.table.style.visibility = "visible"; -this._initMultipleDates(); -};Calendar.prototype._initMultipleDates = function() { -if (this.multiple) { -for (var i in this.multiple) { -var cell = this.datesCells[i]; -var d = this.multiple[i]; -if (!d) -continue; -if (cell) -cell.className += " selected"; -} -} -};Calendar.prototype._toggleMultipleDate = function(date) { -if (this.multiple) { -var ds = date.print("%Y%m%d"); -var cell = this.datesCells[ds]; -if (cell) { -var d = this.multiple[ds]; -if (!d) { -Calendar.addClass(cell, "selected"); -this.multiple[ds] = date; -} else { -Calendar.removeClass(cell, "selected"); -delete this.multiple[ds]; -} -} -} -};Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { -this.getDateToolTip = unaryFunction; -}; -Calendar.prototype.setDate = function (date) { -if (!date.equalsTo(this.date)) { -this._init(this.firstDayOfWeek, date); -} -}; -Calendar.prototype.refresh = function () { -this._init(this.firstDayOfWeek, this.date); -}; -Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { -this._init(firstDayOfWeek, this.date); -this._displayWeekdays(); -}; -Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { -this.getDateStatus = unaryFunction; -}; -Calendar.prototype.setRange = function (a, z) { -this.minYear = a; -this.maxYear = z; -}; -Calendar.prototype.callHandler = function () { -if (this.onSelected) { -this.onSelected(this, this.date.print(this.dateFormat)); -} -}; -Calendar.prototype.callCloseHandler = function () { -if (this.onClose) { -this.onClose(this); -} -this.hideShowCovered(); -}; -Calendar.prototype.destroy = function () { -var el = this.element.parentNode; -el.removeChild(this.element); -Calendar._C = null; -window._dynarch_popupCalendar = null; -}; -Calendar.prototype.reparent = function (new_parent) { -var el = this.element; -el.parentNode.removeChild(el); -new_parent.appendChild(el); -}; -Calendar._checkCalendar = function(ev) { -var calendar = window._dynarch_popupCalendar; -if (!calendar) { -return false; -} -var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); -for (; el != null && el != calendar.element; el = el.parentNode); -if (el == null) {window._dynarch_popupCalendar.callCloseHandler(); -return Calendar.stopEvent(ev); -} -}; -Calendar.prototype.show = function () { -var rows = this.table.getElementsByTagName("tr"); -for (var i = rows.length; i > 0;) { -var row = rows[--i]; -Calendar.removeClass(row, "rowhilite"); -var cells = row.getElementsByTagName("td"); -for (var j = cells.length; j > 0;) { -var cell = cells[--j]; -Calendar.removeClass(cell, "hilite"); -Calendar.removeClass(cell, "active"); -} -} -this.element.style.display = "block"; -this.hidden = false; -if (this.isPopup) { -window._dynarch_popupCalendar = this; -Calendar.addEvent(document, "keydown", Calendar._keyEvent); -Calendar.addEvent(document, "keypress", Calendar._keyEvent); -Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); -} -this.hideShowCovered(); -}; -Calendar.prototype.hide = function () { -if (this.isPopup) { -Calendar.removeEvent(document, "keydown", Calendar._keyEvent); -Calendar.removeEvent(document, "keypress", Calendar._keyEvent); -Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); -} -this.element.style.display = "none"; -this.hidden = true; -this.hideShowCovered(); -};Calendar.prototype.showAt = function (x, y) { -var s = this.element.style; -s.left = x + "px"; -s.top = y + "px"; -this.show(); -}; -Calendar.prototype.showAtElement = function (el, opts) { -var self = this; -var p = Calendar.getAbsolutePos(el); -if (!opts || typeof opts != "string") { -this.showAt(p.x, p.y + el.offsetHeight); -return true; -} -function fixPosition(box) { -if (box.x < 0) -box.x = 0; -if (box.y < 0) -box.y = 0; -var cp = document.createElement("div"); -var s = cp.style; -s.position = "absolute"; -s.right = s.bottom = s.width = s.height = "0px"; -document.body.appendChild(cp); -var br = Calendar.getAbsolutePos(cp); -document.body.removeChild(cp); -if (Calendar.is_ie) { -br.y += document.body.scrollTop; -br.x += document.body.scrollLeft; -} else { -br.y += window.scrollY; -br.x += window.scrollX; -} -var tmp = box.x + box.width - br.x; -if (tmp > 0) box.x -= tmp; -tmp = box.y + box.height - br.y; -if (tmp > 0) box.y -= tmp; -}; -this.element.style.display = "block"; -Calendar.continuation_for_the_fucking_khtml_browser = function() { -var w = self.element.offsetWidth; -var h = self.element.offsetHeight; -self.element.style.display = "none"; -var valign = opts.substr(0, 1); -var halign = "l"; -if (opts.length > 1) { -halign = opts.substr(1, 1); -}switch (valign) { - case "T": p.y -= h; break; - case "B": p.y += el.offsetHeight; break; - case "C": p.y += (el.offsetHeight - h) / 2; break; - case "t": p.y += el.offsetHeight - h; break; - case "b": break; -}switch (halign) { - case "L": p.x -= w; break; - case "R": p.x += el.offsetWidth; break; - case "C": p.x += (el.offsetWidth - w) / 2; break; - case "l": p.x += el.offsetWidth - w; break; - case "r": break; -} -p.width = w; -p.height = h + 40; -self.monthsCombo.style.display = "none"; -fixPosition(p); -self.showAt(p.x, p.y); -}; -if (Calendar.is_khtml) -setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); -else -Calendar.continuation_for_the_fucking_khtml_browser(); -}; -Calendar.prototype.setDateFormat = function (str) { -this.dateFormat = str; -}; -Calendar.prototype.setTtDateFormat = function (str) { -this.ttDateFormat = str; -}; -Calendar.prototype.parseDate = function(str, fmt) { -if (!fmt) -fmt = this.dateFormat; -this.setDate(Date.parseDate(str, fmt)); -}; -Calendar.prototype.hideShowCovered = function () { -if (!Calendar.is_ie && !Calendar.is_opera) -return; -function getVisib(obj){ -var value = obj.style.visibility; -if (!value) { -if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { -if (!Calendar.is_khtml) -value = document.defaultView. -getComputedStyle(obj, "").getPropertyValue("visibility"); -else -value = ''; -} else if (obj.currentStyle) { -value = obj.currentStyle.visibility; -} else -value = ''; -} -return value; -};var tags = new Array("applet", "iframe", "select"); -var el = this.element;var p = Calendar.getAbsolutePos(el); -var EX1 = p.x; -var EX2 = el.offsetWidth + EX1; -var EY1 = p.y; -var EY2 = el.offsetHeight + EY1;for (var k = tags.length; k > 0; ) { -var ar = document.getElementsByTagName(tags[--k]); -var cc = null;for (var i = ar.length; i > 0;) { -cc = ar[--i];p = Calendar.getAbsolutePos(cc); -var CX1 = p.x; -var CX2 = cc.offsetWidth + CX1; -var CY1 = p.y; -var CY2 = cc.offsetHeight + CY1;if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = cc.__msh_save_visibility; -} else { -if (!cc.__msh_save_visibility) { -cc.__msh_save_visibility = getVisib(cc); -} -cc.style.visibility = "hidden"; -} -} -} -}; -Calendar.prototype._displayWeekdays = function () { -var fdow = this.firstDayOfWeek; -var cell = this.firstdayname; -var weekend = Calendar._TT["WEEKEND"]; -for (var i = 0; i < 7; ++i) { -cell.className = "day name"; -var realday = (i + fdow) % 7; -if (i) { -cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); -cell.navtype = 100; -cell.calendar = this; -cell.fdow = realday; -Calendar._add_evs(cell); -} -if (weekend.indexOf(realday.toString()) != -1) { -Calendar.addClass(cell, "weekend"); -} -cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; -cell = cell.nextSibling; -} -}; -Calendar.prototype._hideCombos = function () { -this.monthsCombo.style.display = "none"; -this.yearsCombo.style.display = "none"; -}; -Calendar.prototype._dragStart = function (ev) { -if (this.dragging) { -return; -} -this.dragging = true; -var posX; -var posY; -if (Calendar.is_ie) { -posY = window.event.clientY + document.body.scrollTop; -posX = window.event.clientX + document.body.scrollLeft; -} else { -posY = ev.clientY + window.scrollY; -posX = ev.clientX + window.scrollX; -} -var st = this.element.style; -this.xOffs = posX - parseInt(st.left); -this.yOffs = posY - parseInt(st.top); -with (Calendar) { -addEvent(document, "mousemove", calDragIt); -addEvent(document, "mouseup", calDragEnd); -} -}; -Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); -Date.SECOND = 1000 /* milliseconds */; -Date.MINUTE = 60 * Date.SECOND; -Date.HOUR = 60 * Date.MINUTE; -Date.DAY = 24 * Date.HOUR; -Date.WEEK = 7 * Date.DAY;Date.parseDate = function(str, fmt) { -var today = new Date(); -var y = 0; -var m = -1; -var d = 0; -var a = str.split(/\W+/); -var b = fmt.match(/%./g); -var i = 0, j = 0; -var hr = 0; -var min = 0; -for (i = 0; i < a.length; ++i) { -if (!a[i]) -continue; -switch (b[i]) { - case "%d": - case "%e": -d = parseInt(a[i], 10); -break; case "%m": -m = parseInt(a[i], 10) - 1; -break; case "%Y": - case "%y": -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -break; case "%b": - case "%B": -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } -} -break; case "%H": - case "%I": - case "%k": - case "%l": -hr = parseInt(a[i], 10); -break; case "%P": - case "%p": -if (/pm/i.test(a[i]) && hr < 12) -hr += 12; -else if (/am/i.test(a[i]) && hr >= 12) -hr -= 12; -break; case "%M": -min = parseInt(a[i], 10); -break; -} -} -if (isNaN(y)) y = today.getFullYear(); -if (isNaN(m)) m = today.getMonth(); -if (isNaN(d)) d = today.getDate(); -if (isNaN(hr)) hr = today.getHours(); -if (isNaN(min)) min = today.getMinutes(); -if (y != 0 && m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -y = 0; m = -1; d = 0; -for (i = 0; i < a.length; ++i) { -if (a[i].search(/[a-zA-Z]+/) != -1) { -var t = -1; -for (j = 0; j < 12; ++j) { -if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } -} -if (t != -1) { -if (m != -1) { -d = m+1; -} -m = t; -} -} else if (parseInt(a[i], 10) <= 12 && m == -1) { -m = a[i]-1; -} else if (parseInt(a[i], 10) > 31 && y == 0) { -y = parseInt(a[i], 10); -(y < 100) && (y += (y > 29) ? 1900 : 2000); -} else if (d == 0) { -d = a[i]; -} -} -if (y == 0) -y = today.getFullYear(); -if (m != -1 && d != 0) -return new Date(y, m, d, hr, min, 0); -return today; -}; -Date.prototype.getMonthDays = function(month) { -var year = this.getFullYear(); -if (typeof month == "undefined") { -month = this.getMonth(); -} -if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { -return 29; -} else { -return Date._MD[month]; -} -}; -Date.prototype.getDayOfYear = function() { -var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); -var time = now - then; -return Math.floor(time / Date.DAY); -}; -Date.prototype.getWeekNumber = function() { -var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); -var DoW = d.getDay(); -d.setDate(d.getDate() - (DoW + 6) % 7 + 3); -var ms = d.valueOf(); -d.setMonth(0); -d.setDate(4); -return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; -}; -Date.prototype.equalsTo = function(date) { -return ((this.getFullYear() == date.getFullYear()) && -(this.getMonth() == date.getMonth()) && -(this.getDate() == date.getDate()) && -(this.getHours() == date.getHours()) && -(this.getMinutes() == date.getMinutes())); -}; -Date.prototype.setDateOnly = function(date) { -var tmp = new Date(date); -this.setDate(1); -this.setFullYear(tmp.getFullYear()); -this.setMonth(tmp.getMonth()); -this.setDate(tmp.getDate()); -}; -Date.prototype.print = function (str) { -var m = this.getMonth(); -var d = this.getDate(); -var y = this.getFullYear(); -var wn = this.getWeekNumber(); -var w = this.getDay(); -var s = {}; -var hr = this.getHours(); -var pm = (hr >= 12); -var ir = (pm) ? (hr - 12) : hr; -var dy = this.getDayOfYear(); -if (ir == 0) -ir = 12; -var min = this.getMinutes(); -var sec = this.getSeconds(); -s["%a"] = Calendar._SDN[w];s["%A"] = Calendar._DN[w];s["%b"] = Calendar._SMN[m];s["%B"] = Calendar._MN[m]; s["%C"] = 1 + Math.floor(y / 100);s["%d"] = (d < 10) ? ("0" + d) : d;s["%e"] = d;s["%H"] = (hr < 10) ? ("0" + hr) : hr;s["%I"] = (ir < 10) ? ("0" + ir) : ir;s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy;s["%k"] = hr; -s["%l"] = ir; -s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m);s["%M"] = (min < 10) ? ("0" + min) : min;s["%n"] = "\n"; -s["%p"] = pm ? "PM" : "AM"; -s["%P"] = pm ? "pm" : "am"; -s["%s"] = Math.floor(this.getTime() / 1000); -s["%S"] = (sec < 10) ? ("0" + sec) : sec;s["%t"] = "\t";s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; -s["%u"] = w + 1; -s["%w"] = w; -s["%y"] = ('' + y).substr(2, 2);s["%Y"] = y; -s["%%"] = "%"; -var re = /%./g; -if (!Calendar.is_ie5 && !Calendar.is_khtml) -return str.replace(re, function (par) { return s[par] || par; });var a = str.match(re); -for (var i = 0; i < a.length; i++) { -var tmp = s[a[i]]; -if (tmp) { -re = new RegExp(a[i], 'g'); -str = str.replace(re, tmp); -} -}return str; -};Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; -Date.prototype.setFullYear = function(y) { -var d = new Date(this); -d.__msh_oldSetFullYear(y); -if (d.getMonth() != this.getMonth()) -this.setDate(28); -this.__msh_oldSetFullYear(y); -};window._dynarch_popupCalendar = null; - - -Calendar._DN = new Array -("星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"); -Calendar._SDN = new Array -("日","一","二","三","四","五","六","日"); -Calendar._FD = 0; -Calendar._MN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._SMN = new Array -("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); -Calendar._TT = {}; -Calendar._TT["INFO"] = "帮助"; -Calendar._TT["ABOUT"] = -"选择日期:\n" + -"- 点击 \xab, \xbb 按钮选择年份\n" + -"- 点击 " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " 按钮选择月份\n" + -"- 长按以上按钮可从菜单中快速选择年份或月份"; -Calendar._TT["ABOUT_TIME"] = "\n\n" + -"选择时间:\n" + -"- 点击小时或分钟可使改数值加一\n" + -"- 按住Shift键点击小时或分钟可使改数值减一\n" + -"- 点击拖动鼠标可进行快速选择"; -Calendar._TT["PREV_YEAR"] = "上一年 (按住出菜单)"; -Calendar._TT["PREV_MONTH"] = "上一月 (按住出菜单)"; -Calendar._TT["GO_TODAY"] = "转到今日"; -Calendar._TT["NEXT_MONTH"] = "下一月 (按住出菜单)"; -Calendar._TT["NEXT_YEAR"] = "下一年 (按住出菜单)"; -Calendar._TT["SEL_DATE"] = "选择日期"; -Calendar._TT["DRAG_TO_MOVE"] = "拖动"; -Calendar._TT["PART_TODAY"] = " (今日)"; -Calendar._TT["DAY_FIRST"] = "最左边显示%s"; -Calendar._TT["WEEKEND"] = "0,6"; -Calendar._TT["CLOSE"] = "关闭"; -Calendar._TT["TODAY"] = "今日"; -Calendar._TT["TIME_PART"] = "(Shift-)点击鼠标或拖动改变值"; -Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; -Calendar._TT["TT_DATE_FORMAT"] = "%A, %b %e日"; -Calendar._TT["WK"] = "周"; -Calendar._TT["TIME"] = "时间:"; - - -Calendar.setup = function (params) { - function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; - - param_default("inputField", null); - param_default("displayArea", null); - param_default("button", null); - param_default("eventName", "click"); - param_default("ifFormat", "%Y/%m/%d"); - param_default("daFormat", "%Y/%m/%d"); - param_default("singleClick", true); - param_default("disableFunc", null); - param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined - param_default("dateText", null); - param_default("firstDay", null); - param_default("align", "Br"); - param_default("range", [1900, 2999]); - param_default("weekNumbers", true); - param_default("flat", null); - param_default("flatCallback", null); - param_default("onSelect", null); - param_default("onClose", null); - param_default("onUpdate", null); - param_default("date", null); - param_default("showsTime", false); - param_default("timeFormat", "24"); - param_default("electric", true); - param_default("step", 2); - param_default("position", null); - param_default("cache", false); - param_default("showOthers", false); - param_default("multiple", null); - - var tmp = ["inputField", "displayArea", "button"]; - for (var i in tmp) { - if (typeof params[tmp[i]] == "string") { - params[tmp[i]] = document.getElementById(params[tmp[i]]); - } - } - if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { - alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); - return false; - } - - function onSelect(cal) { - var p = cal.params; - var update = (cal.dateClicked || p.electric); - if (update && p.inputField) { - p.inputField.value = cal.date.print(p.ifFormat); - if (typeof p.inputField.onchange == "function") - p.inputField.onchange(); - } - if (update && p.displayArea) - p.displayArea.innerHTML = cal.date.print(p.daFormat); - if (update && typeof p.onUpdate == "function") - p.onUpdate(cal); - if (update && p.flat) { - if (typeof p.flatCallback == "function") - p.flatCallback(cal); - } - if (update && p.singleClick && cal.dateClicked) - cal.callCloseHandler(); - }; - - if (params.flat != null) { - if (typeof params.flat == "string") - params.flat = document.getElementById(params.flat); - if (!params.flat) { - alert("Calendar.setup:\n Flat specified but can't find parent."); - return false; - } - var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); - cal.showsOtherMonths = params.showOthers; - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.params = params; - cal.weekNumbers = params.weekNumbers; - cal.setRange(params.range[0], params.range[1]); - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - if (params.ifFormat) { - cal.setDateFormat(params.ifFormat); - } - if (params.inputField && typeof params.inputField.value == "string") { - cal.parseDate(params.inputField.value); - } - cal.create(params.flat); - cal.show(); - return false; - } - - var triggerEl = params.button || params.displayArea || params.inputField; - triggerEl["on" + params.eventName] = function() { - var dateEl = params.inputField || params.displayArea; - var dateFmt = params.inputField ? params.ifFormat : params.daFormat; - var mustCreate = false; - var cal = window.calendar; - if (dateEl) - params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); - if (!(cal && params.cache)) { - window.calendar = cal = new Calendar(params.firstDay, - params.date, - params.onSelect || onSelect, - params.onClose || function(cal) { cal.hide(); }); - cal.showsTime = params.showsTime; - cal.time24 = (params.timeFormat == "24"); - cal.weekNumbers = params.weekNumbers; - mustCreate = true; - } else { - if (params.date) - cal.setDate(params.date); - cal.hide(); - } - if (params.multiple) { - cal.multiple = {}; - for (var i = params.multiple.length; --i >= 0;) { - var d = params.multiple[i]; - var ds = d.print("%Y%m%d"); - cal.multiple[ds] = d; - } - } - cal.showsOtherMonths = params.showOthers; - cal.yearStep = params.step; - cal.setRange(params.range[0], params.range[1]); - cal.params = params; - cal.setDateStatusHandler(params.dateStatusFunc); - cal.getDateText = params.dateText; - cal.setDateFormat(dateFmt); - if (mustCreate) - cal.create(); - cal.refresh(); - if (!params.position) - cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); - else - cal.showAt(params.position[0], params.position[1]); - return false; - }; - - return cal; -}; \ No newline at end of file diff --git a/src/static/css/daterangepicker.css b/src/static/css/daterangepicker.css new file mode 100644 index 00000000..a9638049 --- /dev/null +++ b/src/static/css/daterangepicker.css @@ -0,0 +1,410 @@ +.daterangepicker { + position: absolute; + color: inherit; + background-color: #fff; + border-radius: 4px; + border: 1px solid #ddd; + width: 278px; + max-width: none; + padding: 0; + margin-top: 7px; + top: 100px; + left: 20px; + z-index: 3001; + display: none; + font-family: arial; + font-size: 15px; + line-height: 1em; +} + +.daterangepicker:before, .daterangepicker:after { + position: absolute; + display: inline-block; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; +} + +.daterangepicker:before { + top: -7px; + border-right: 7px solid transparent; + border-left: 7px solid transparent; + border-bottom: 7px solid #ccc; +} + +.daterangepicker:after { + top: -6px; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-left: 6px solid transparent; +} + +.daterangepicker.opensleft:before { + right: 9px; +} + +.daterangepicker.opensleft:after { + right: 10px; +} + +.daterangepicker.openscenter:before { + left: 0; + right: 0; + width: 0; + margin-left: auto; + margin-right: auto; +} + +.daterangepicker.openscenter:after { + left: 0; + right: 0; + width: 0; + margin-left: auto; + margin-right: auto; +} + +.daterangepicker.opensright:before { + left: 9px; +} + +.daterangepicker.opensright:after { + left: 10px; +} + +.daterangepicker.drop-up { + margin-top: -7px; +} + +.daterangepicker.drop-up:before { + top: initial; + bottom: -7px; + border-bottom: initial; + border-top: 7px solid #ccc; +} + +.daterangepicker.drop-up:after { + top: initial; + bottom: -6px; + border-bottom: initial; + border-top: 6px solid #fff; +} + +.daterangepicker.single .daterangepicker .ranges, .daterangepicker.single .drp-calendar { + float: none; +} + +.daterangepicker.single .drp-selected { + display: none; +} + +.daterangepicker.show-calendar .drp-calendar { + display: block; +} + +.daterangepicker.show-calendar .drp-buttons { + display: block; +} + +.daterangepicker.auto-apply .drp-buttons { + display: none; +} + +.daterangepicker .drp-calendar { + display: none; + max-width: 270px; +} + +.daterangepicker .drp-calendar.left { + padding: 8px 0 8px 8px; +} + +.daterangepicker .drp-calendar.right { + padding: 8px; +} + +.daterangepicker .drp-calendar.single .calendar-table { + border: none; +} + +.daterangepicker .calendar-table .next span, .daterangepicker .calendar-table .prev span { + color: #fff; + border: solid black; + border-width: 0 2px 2px 0; + border-radius: 0; + display: inline-block; + padding: 3px; +} + +.daterangepicker .calendar-table .next span { + transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); +} + +.daterangepicker .calendar-table .prev span { + transform: rotate(135deg); + -webkit-transform: rotate(135deg); +} + +.daterangepicker .calendar-table th, .daterangepicker .calendar-table td { + white-space: nowrap; + text-align: center; + vertical-align: middle; + min-width: 32px; + width: 32px; + height: 24px; + line-height: 24px; + font-size: 12px; + border-radius: 4px; + border: 1px solid transparent; + white-space: nowrap; + cursor: pointer; +} + +.daterangepicker .calendar-table { + border: 1px solid #fff; + border-radius: 4px; + background-color: #fff; +} + +.daterangepicker .calendar-table table { + width: 100%; + margin: 0; + border-spacing: 0; + border-collapse: collapse; +} + +.daterangepicker td.available:hover, .daterangepicker th.available:hover { + background-color: #eee; + border-color: transparent; + color: inherit; +} + +.daterangepicker td.week, .daterangepicker th.week { + font-size: 80%; + color: #ccc; +} + +.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { + background-color: #fff; + border-color: transparent; + color: #999; +} + +.daterangepicker td.in-range { + background-color: #ebf4f8; + border-color: transparent; + color: #000; + border-radius: 0; +} + +.daterangepicker td.start-date { + border-radius: 4px 0 0 4px; +} + +.daterangepicker td.end-date { + border-radius: 0 4px 4px 0; +} + +.daterangepicker td.start-date.end-date { + border-radius: 4px; +} + +.daterangepicker td.active, .daterangepicker td.active:hover { + background-color: #357ebd; + border-color: transparent; + color: #fff; +} + +.daterangepicker th.month { + width: auto; +} + +.daterangepicker td.disabled, .daterangepicker option.disabled { + color: #999; + cursor: not-allowed; + text-decoration: line-through; +} + +.daterangepicker select.monthselect, .daterangepicker select.yearselect { + font-size: 12px; + padding: 1px; + height: auto; + margin: 0; + cursor: default; +} + +.daterangepicker select.monthselect { + margin-right: 2%; + width: 56%; +} + +.daterangepicker select.yearselect { + width: 40%; +} + +.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { + width: 50px; + margin: 0 auto; + background: #eee; + border: 1px solid #eee; + padding: 2px; + outline: 0; + font-size: 12px; +} + +.daterangepicker .calendar-time { + text-align: center; + margin: 4px auto 0 auto; + line-height: 30px; + position: relative; +} + +.daterangepicker .calendar-time select.disabled { + color: #ccc; + cursor: not-allowed; +} + +.daterangepicker .drp-buttons { + clear: both; + text-align: right; + padding: 8px; + border-top: 1px solid #ddd; + display: none; + line-height: 12px; + vertical-align: middle; +} + +.daterangepicker .drp-selected { + display: inline-block; + font-size: 12px; + padding-right: 8px; +} + +.daterangepicker .drp-buttons .btn { + margin-left: 8px; + font-size: 12px; + font-weight: bold; + padding: 4px 8px; +} + +.daterangepicker.show-ranges.single.rtl .drp-calendar.left { + border-right: 1px solid #ddd; +} + +.daterangepicker.show-ranges.single.ltr .drp-calendar.left { + border-left: 1px solid #ddd; +} + +.daterangepicker.show-ranges.rtl .drp-calendar.right { + border-right: 1px solid #ddd; +} + +.daterangepicker.show-ranges.ltr .drp-calendar.left { + border-left: 1px solid #ddd; +} + +.daterangepicker .ranges { + float: none; + text-align: left; + margin: 0; +} + +.daterangepicker.show-calendar .ranges { + margin-top: 8px; +} + +.daterangepicker .ranges ul { + list-style: none; + margin: 0 auto; + padding: 0; + width: 100%; +} + +.daterangepicker .ranges li { + font-size: 12px; + padding: 8px 12px; + cursor: pointer; +} + +.daterangepicker .ranges li:hover { + background-color: #eee; +} + +.daterangepicker .ranges li.active { + background-color: #08c; + color: #fff; +} + +/* Larger Screen Styling */ +@media (min-width: 564px) { + .daterangepicker { + width: auto; + } + + .daterangepicker .ranges ul { + width: 140px; + } + + .daterangepicker.single .ranges ul { + width: 100%; + } + + .daterangepicker.single .drp-calendar.left { + clear: none; + } + + .daterangepicker.single .ranges, .daterangepicker.single .drp-calendar { + float: left; + } + + .daterangepicker { + direction: ltr; + text-align: left; + } + + .daterangepicker .drp-calendar.left { + clear: left; + margin-right: 0; + } + + .daterangepicker .drp-calendar.left .calendar-table { + border-right: none; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + + .daterangepicker .drp-calendar.right { + margin-left: 0; + } + + .daterangepicker .drp-calendar.right .calendar-table { + border-left: none; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + + .daterangepicker .drp-calendar.left .calendar-table { + padding-right: 8px; + } + + .daterangepicker .ranges, .daterangepicker .drp-calendar { + float: left; + } +} + +@media (min-width: 730px) { + .daterangepicker .ranges { + width: auto; + } + + .daterangepicker .ranges { + float: left; + } + + .daterangepicker.rtl .ranges { + float: right; + } + + .daterangepicker .drp-calendar.left { + clear: none !important; + } +} diff --git a/src/static/js/daterangepicker.js b/src/static/js/daterangepicker.js new file mode 100644 index 00000000..4048310c --- /dev/null +++ b/src/static/js/daterangepicker.js @@ -0,0 +1,1578 @@ +/** +* @version: 3.1 +* @author: Dan Grossman http://www.dangrossman.info/ +* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved. +* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php +* @website: http://www.daterangepicker.com/ +*/ +// Following the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Make globaly available as well + define(['moment', 'jquery'], function (moment, jquery) { + if (!jquery.fn) jquery.fn = {}; // webpack server rendering + if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default'] + return factory(moment, jquery); + }); + } else if (typeof module === 'object' && module.exports) { + // Node / Browserify + //isomorphic issue + var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; + if (!jQuery) { + jQuery = require('jquery'); + if (!jQuery.fn) jQuery.fn = {}; + } + var moment = (typeof window != 'undefined' && typeof window.moment != 'undefined') ? window.moment : require('moment'); + module.exports = factory(moment, jQuery); + } else { + // Browser globals + root.daterangepicker = factory(root.moment, root.jQuery); + } +}(this, function(moment, $) { + var DateRangePicker = function(element, options, cb) { + + //default settings for options + this.parentEl = 'body'; + this.element = $(element); + this.startDate = moment().startOf('day'); + this.endDate = moment().endOf('day'); + this.minDate = false; + this.maxDate = false; + this.maxSpan = false; + this.autoApply = false; + this.singleDatePicker = false; + this.showDropdowns = false; + this.minYear = moment().subtract(100, 'year').format('YYYY'); + this.maxYear = moment().add(100, 'year').format('YYYY'); + this.showWeekNumbers = false; + this.showISOWeekNumbers = false; + this.showCustomRangeLabel = true; + this.timePicker = false; + this.timePicker24Hour = false; + this.timePickerIncrement = 1; + this.timePickerSeconds = false; + this.linkedCalendars = true; + this.autoUpdateInput = true; + this.alwaysShowCalendars = false; + this.ranges = {}; + + this.opens = 'right'; + if (this.element.hasClass('pull-right')) + this.opens = 'left'; + + this.drops = 'down'; + if (this.element.hasClass('dropup')) + this.drops = 'up'; + + this.buttonClasses = 'btn btn-sm'; + this.applyButtonClasses = 'btn-primary'; + this.cancelButtonClasses = 'btn-default'; + + this.locale = { + direction: 'ltr', + format: moment.localeData().longDateFormat('L'), + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + weekLabel: 'W', + customRangeLabel: 'Custom Range', + daysOfWeek: moment.weekdaysMin(), + monthNames: moment.monthsShort(), + firstDay: moment.localeData().firstDayOfWeek() + }; + + this.callback = function() { }; + + //some state information + this.isShowing = false; + this.leftCalendar = {}; + this.rightCalendar = {}; + + //custom options from user + if (typeof options !== 'object' || options === null) + options = {}; + + //allow setting options with data attributes + //data-api options will be overwritten with custom javascript options + options = $.extend(this.element.data(), options); + + //html template for the picker UI + if (typeof options.template !== 'string' && !(options.template instanceof $)) + options.template = + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + + '' + + ' ' + + '
' + + '
'; + + this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl); + this.container = $(options.template).appendTo(this.parentEl); + + // + // handle all the possible options overriding defaults + // + + if (typeof options.locale === 'object') { + + if (typeof options.locale.direction === 'string') + this.locale.direction = options.locale.direction; + + if (typeof options.locale.format === 'string') + this.locale.format = options.locale.format; + + if (typeof options.locale.separator === 'string') + this.locale.separator = options.locale.separator; + + if (typeof options.locale.daysOfWeek === 'object') + this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + + if (typeof options.locale.monthNames === 'object') + this.locale.monthNames = options.locale.monthNames.slice(); + + if (typeof options.locale.firstDay === 'number') + this.locale.firstDay = options.locale.firstDay; + + if (typeof options.locale.applyLabel === 'string') + this.locale.applyLabel = options.locale.applyLabel; + + if (typeof options.locale.cancelLabel === 'string') + this.locale.cancelLabel = options.locale.cancelLabel; + + if (typeof options.locale.weekLabel === 'string') + this.locale.weekLabel = options.locale.weekLabel; + + if (typeof options.locale.customRangeLabel === 'string'){ + //Support unicode chars in the custom range name. + var elem = document.createElement('textarea'); + elem.innerHTML = options.locale.customRangeLabel; + var rangeHtml = elem.value; + this.locale.customRangeLabel = rangeHtml; + } + } + this.container.addClass(this.locale.direction); + + if (typeof options.startDate === 'string') + this.startDate = moment(options.startDate, this.locale.format); + + if (typeof options.endDate === 'string') + this.endDate = moment(options.endDate, this.locale.format); + + if (typeof options.minDate === 'string') + this.minDate = moment(options.minDate, this.locale.format); + + if (typeof options.maxDate === 'string') + this.maxDate = moment(options.maxDate, this.locale.format); + + if (typeof options.startDate === 'object') + this.startDate = moment(options.startDate); + + if (typeof options.endDate === 'object') + this.endDate = moment(options.endDate); + + if (typeof options.minDate === 'object') + this.minDate = moment(options.minDate); + + if (typeof options.maxDate === 'object') + this.maxDate = moment(options.maxDate); + + // sanity check for bad options + if (this.minDate && this.startDate.isBefore(this.minDate)) + this.startDate = this.minDate.clone(); + + // sanity check for bad options + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); + + if (typeof options.applyButtonClasses === 'string') + this.applyButtonClasses = options.applyButtonClasses; + + if (typeof options.applyClass === 'string') //backwards compat + this.applyButtonClasses = options.applyClass; + + if (typeof options.cancelButtonClasses === 'string') + this.cancelButtonClasses = options.cancelButtonClasses; + + if (typeof options.cancelClass === 'string') //backwards compat + this.cancelButtonClasses = options.cancelClass; + + if (typeof options.maxSpan === 'object') + this.maxSpan = options.maxSpan; + + if (typeof options.dateLimit === 'object') //backwards compat + this.maxSpan = options.dateLimit; + + if (typeof options.opens === 'string') + this.opens = options.opens; + + if (typeof options.drops === 'string') + this.drops = options.drops; + + if (typeof options.showWeekNumbers === 'boolean') + this.showWeekNumbers = options.showWeekNumbers; + + if (typeof options.showISOWeekNumbers === 'boolean') + this.showISOWeekNumbers = options.showISOWeekNumbers; + + if (typeof options.buttonClasses === 'string') + this.buttonClasses = options.buttonClasses; + + if (typeof options.buttonClasses === 'object') + this.buttonClasses = options.buttonClasses.join(' '); + + if (typeof options.showDropdowns === 'boolean') + this.showDropdowns = options.showDropdowns; + + if (typeof options.minYear === 'number') + this.minYear = options.minYear; + + if (typeof options.maxYear === 'number') + this.maxYear = options.maxYear; + + if (typeof options.showCustomRangeLabel === 'boolean') + this.showCustomRangeLabel = options.showCustomRangeLabel; + + if (typeof options.singleDatePicker === 'boolean') { + this.singleDatePicker = options.singleDatePicker; + if (this.singleDatePicker) + this.endDate = this.startDate.clone(); + } + + if (typeof options.timePicker === 'boolean') + this.timePicker = options.timePicker; + + if (typeof options.timePickerSeconds === 'boolean') + this.timePickerSeconds = options.timePickerSeconds; + + if (typeof options.timePickerIncrement === 'number') + this.timePickerIncrement = options.timePickerIncrement; + + if (typeof options.timePicker24Hour === 'boolean') + this.timePicker24Hour = options.timePicker24Hour; + + if (typeof options.autoApply === 'boolean') + this.autoApply = options.autoApply; + + if (typeof options.autoUpdateInput === 'boolean') + this.autoUpdateInput = options.autoUpdateInput; + + if (typeof options.linkedCalendars === 'boolean') + this.linkedCalendars = options.linkedCalendars; + + if (typeof options.isInvalidDate === 'function') + this.isInvalidDate = options.isInvalidDate; + + if (typeof options.isCustomDate === 'function') + this.isCustomDate = options.isCustomDate; + + if (typeof options.alwaysShowCalendars === 'boolean') + this.alwaysShowCalendars = options.alwaysShowCalendars; + + // update day names order to firstDay + if (this.locale.firstDay != 0) { + var iterator = this.locale.firstDay; + while (iterator > 0) { + this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); + iterator--; + } + } + + var start, end, range; + + //if no start/end dates set, check if an input element contains initial values + if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { + if ($(this.element).is(':text')) { + var val = $(this.element).val(), + split = val.split(this.locale.separator); + + start = end = null; + + if (split.length == 2) { + start = moment(split[0], this.locale.format); + end = moment(split[1], this.locale.format); + } else if (this.singleDatePicker && val !== "") { + start = moment(val, this.locale.format); + end = moment(val, this.locale.format); + } + if (start !== null && end !== null) { + this.setStartDate(start); + this.setEndDate(end); + } + } + } + + if (typeof options.ranges === 'object') { + for (range in options.ranges) { + + if (typeof options.ranges[range][0] === 'string') + start = moment(options.ranges[range][0], this.locale.format); + else + start = moment(options.ranges[range][0]); + + if (typeof options.ranges[range][1] === 'string') + end = moment(options.ranges[range][1], this.locale.format); + else + end = moment(options.ranges[range][1]); + + // If the start or end date exceed those allowed by the minDate or maxSpan + // options, shorten the range to the allowable period. + if (this.minDate && start.isBefore(this.minDate)) + start = this.minDate.clone(); + + var maxDate = this.maxDate; + if (this.maxSpan && maxDate && start.clone().add(this.maxSpan).isAfter(maxDate)) + maxDate = start.clone().add(this.maxSpan); + if (maxDate && end.isAfter(maxDate)) + end = maxDate.clone(); + + // If the end of the range is before the minimum or the start of the range is + // after the maximum, don't display this range option at all. + if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day')) + || (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day'))) + continue; + + //Support unicode chars in the range names. + var elem = document.createElement('textarea'); + elem.innerHTML = range; + var rangeHtml = elem.value; + + this.ranges[rangeHtml] = [start, end]; + } + + var list = '
    '; + for (range in this.ranges) { + list += '
  • ' + range + '
  • '; + } + if (this.showCustomRangeLabel) { + list += '
  • ' + this.locale.customRangeLabel + '
  • '; + } + list += '
'; + this.container.find('.ranges').prepend(list); + } + + if (typeof cb === 'function') { + this.callback = cb; + } + + if (!this.timePicker) { + this.startDate = this.startDate.startOf('day'); + this.endDate = this.endDate.endOf('day'); + this.container.find('.calendar-time').hide(); + } + + //can't be used together for now + if (this.timePicker && this.autoApply) + this.autoApply = false; + + if (this.autoApply) { + this.container.addClass('auto-apply'); + } + + if (typeof options.ranges === 'object') + this.container.addClass('show-ranges'); + + if (this.singleDatePicker) { + this.container.addClass('single'); + this.container.find('.drp-calendar.left').addClass('single'); + this.container.find('.drp-calendar.left').show(); + this.container.find('.drp-calendar.right').hide(); + if (!this.timePicker && this.autoApply) { + this.container.addClass('auto-apply'); + } + } + + if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) { + this.container.addClass('show-calendar'); + } + + this.container.addClass('opens' + this.opens); + + //apply CSS classes and labels to buttons + this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses); + if (this.applyButtonClasses.length) + this.container.find('.applyBtn').addClass(this.applyButtonClasses); + if (this.cancelButtonClasses.length) + this.container.find('.cancelBtn').addClass(this.cancelButtonClasses); + this.container.find('.applyBtn').html(this.locale.applyLabel); + this.container.find('.cancelBtn').html(this.locale.cancelLabel); + + // + // event listeners + // + + this.container.find('.drp-calendar') + .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)) + .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)) + .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) + .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)) + .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this)); + + this.container.find('.ranges') + .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)); + + this.container.find('.drp-buttons') + .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) + .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)); + + if (this.element.is('input') || this.element.is('button')) { + this.element.on({ + 'click.daterangepicker': $.proxy(this.show, this), + 'focus.daterangepicker': $.proxy(this.show, this), + 'keyup.daterangepicker': $.proxy(this.elementChanged, this), + 'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility + }); + } else { + this.element.on('click.daterangepicker', $.proxy(this.toggle, this)); + this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this)); + } + + // + // if attached to a text input, set the initial value + // + + this.updateElement(); + + }; + + DateRangePicker.prototype = { + + constructor: DateRangePicker, + + setStartDate: function(startDate) { + if (typeof startDate === 'string') + this.startDate = moment(startDate, this.locale.format); + + if (typeof startDate === 'object') + this.startDate = moment(startDate); + + if (!this.timePicker) + this.startDate = this.startDate.startOf('day'); + + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + + if (this.minDate && this.startDate.isBefore(this.minDate)) { + this.startDate = this.minDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } + + if (this.maxDate && this.startDate.isAfter(this.maxDate)) { + this.startDate = this.maxDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } + + if (!this.isShowing) + this.updateElement(); + + this.updateMonthsInView(); + }, + + setEndDate: function(endDate) { + if (typeof endDate === 'string') + this.endDate = moment(endDate, this.locale.format); + + if (typeof endDate === 'object') + this.endDate = moment(endDate); + + if (!this.timePicker) + this.endDate = this.endDate.endOf('day'); + + if (this.timePicker && this.timePickerIncrement) + this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + + if (this.endDate.isBefore(this.startDate)) + this.endDate = this.startDate.clone(); + + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); + + if (this.maxSpan && this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)) + this.endDate = this.startDate.clone().add(this.maxSpan); + + this.previousRightTime = this.endDate.clone(); + + this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + + if (!this.isShowing) + this.updateElement(); + + this.updateMonthsInView(); + }, + + isInvalidDate: function() { + return false; + }, + + isCustomDate: function() { + return false; + }, + + updateView: function() { + if (this.timePicker) { + this.renderTimePicker('left'); + this.renderTimePicker('right'); + if (!this.endDate) { + this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled'); + } else { + this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled'); + } + } + if (this.endDate) + this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.updateMonthsInView(); + this.updateCalendars(); + this.updateFormInputs(); + }, + + updateMonthsInView: function() { + if (this.endDate) { + + //if both dates are visible already, do nothing + if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && + (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + && + (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + ) { + return; + } + + this.leftCalendar.month = this.startDate.clone().date(2); + if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) { + this.rightCalendar.month = this.endDate.clone().date(2); + } else { + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); + } + + } else { + if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) { + this.leftCalendar.month = this.startDate.clone().date(2); + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); + } + } + if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) { + this.rightCalendar.month = this.maxDate.clone().date(2); + this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month'); + } + }, + + updateCalendars: function() { + + if (this.timePicker) { + var hour, minute, second; + if (this.endDate) { + hour = parseInt(this.container.find('.left .hourselect').val(), 10); + minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + if (isNaN(minute)) { + minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10); + } + second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + } else { + hour = parseInt(this.container.find('.right .hourselect').val(), 10); + minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + if (isNaN(minute)) { + minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10); + } + second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + } + this.leftCalendar.month.hour(hour).minute(minute).second(second); + this.rightCalendar.month.hour(hour).minute(minute).second(second); + } + + this.renderCalendar('left'); + this.renderCalendar('right'); + + //highlight any predefined range matching the current start and end dates + this.container.find('.ranges li').removeClass('active'); + if (this.endDate == null) return; + + this.calculateChosenLabel(); + }, + + renderCalendar: function(side) { + + // + // Build the matrix of dates that will populate the calendar + // + + var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar; + var month = calendar.month.month(); + var year = calendar.month.year(); + var hour = calendar.month.hour(); + var minute = calendar.month.minute(); + var second = calendar.month.second(); + var daysInMonth = moment([year, month]).daysInMonth(); + var firstDay = moment([year, month, 1]); + var lastDay = moment([year, month, daysInMonth]); + var lastMonth = moment(firstDay).subtract(1, 'month').month(); + var lastYear = moment(firstDay).subtract(1, 'month').year(); + var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + var dayOfWeek = firstDay.day(); + + //initialize a 6 rows x 7 columns array for the calendar + var calendar = []; + calendar.firstDay = firstDay; + calendar.lastDay = lastDay; + + for (var i = 0; i < 6; i++) { + calendar[i] = []; + } + + //populate the calendar with date objects + var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; + if (startDay > daysInLastMonth) + startDay -= 7; + + if (dayOfWeek == this.locale.firstDay) + startDay = daysInLastMonth - 6; + + var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); + + var col, row; + for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) { + if (i > 0 && col % 7 === 0) { + col = 0; + row++; + } + calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second); + curDate.hour(12); + + if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') { + calendar[row][col] = this.minDate.clone(); + } + + if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') { + calendar[row][col] = this.maxDate.clone(); + } + + } + + //make the calendar object available to hoverDate/clickDate + if (side == 'left') { + this.leftCalendar.calendar = calendar; + } else { + this.rightCalendar.calendar = calendar; + } + + // + // Display the calendar + // + + var minDate = side == 'left' ? this.minDate : this.startDate; + var maxDate = this.maxDate; + var selected = side == 'left' ? this.startDate : this.endDate; + var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'}; + + var html = ''; + html += ''; + html += ''; + + // add empty cell for week number + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; + + if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) { + html += ''; + } else { + html += ''; + } + + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + + if (this.showDropdowns) { + var currentMonth = calendar[1][1].month(); + var currentYear = calendar[1][1].year(); + var maxYear = (maxDate && maxDate.year()) || (this.maxYear); + var minYear = (minDate && minDate.year()) || (this.minYear); + var inMinYear = currentYear == minYear; + var inMaxYear = currentYear == maxYear; + + var monthHtml = '"; + + var yearHtml = ''; + + dateHtml = monthHtml + yearHtml; + } + + html += ''; + if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) { + html += ''; + } else { + html += ''; + } + + html += ''; + html += ''; + + // add week number label + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; + + $.each(this.locale.daysOfWeek, function(index, dayOfWeek) { + html += ''; + }); + + html += ''; + html += ''; + html += ''; + + //adjust maxDate to reflect the maxSpan setting in order to + //grey out end dates beyond the maxSpan + if (this.endDate == null && this.maxSpan) { + var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day'); + if (!maxDate || maxLimit.isBefore(maxDate)) { + maxDate = maxLimit; + } + } + + for (var row = 0; row < 6; row++) { + html += ''; + + // add week number + if (this.showWeekNumbers) + html += ''; + else if (this.showISOWeekNumbers) + html += ''; + + for (var col = 0; col < 7; col++) { + + var classes = []; + + //highlight today's date + if (calendar[row][col].isSame(new Date(), "day")) + classes.push('today'); + + //highlight weekends + if (calendar[row][col].isoWeekday() > 5) + classes.push('weekend'); + + //grey out the dates in other months displayed at beginning and end of this calendar + if (calendar[row][col].month() != calendar[1][1].month()) + classes.push('off', 'ends'); + + //don't allow selection of dates before the minimum date + if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day')) + classes.push('off', 'disabled'); + + //don't allow selection of dates after the maximum date + if (maxDate && calendar[row][col].isAfter(maxDate, 'day')) + classes.push('off', 'disabled'); + + //don't allow selection of date if a custom function decides it's invalid + if (this.isInvalidDate(calendar[row][col])) + classes.push('off', 'disabled'); + + //highlight the currently selected start date + if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) + classes.push('active', 'start-date'); + + //highlight the currently selected end date + if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) + classes.push('active', 'end-date'); + + //highlight dates in-between the selected dates + if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate) + classes.push('in-range'); + + //apply custom classes for this date + var isCustom = this.isCustomDate(calendar[row][col]); + if (isCustom !== false) { + if (typeof isCustom === 'string') + classes.push(isCustom); + else + Array.prototype.push.apply(classes, isCustom); + } + + var cname = '', disabled = false; + for (var i = 0; i < classes.length; i++) { + cname += classes[i] + ' '; + if (classes[i] == 'disabled') + disabled = true; + } + if (!disabled) + cname += 'available'; + + html += ''; + + } + html += ''; + } + + html += ''; + html += '
' + dateHtml + '
' + this.locale.weekLabel + '' + dayOfWeek + '
' + calendar[row][0].week() + '' + calendar[row][0].isoWeek() + '' + calendar[row][col].date() + '
'; + + this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html); + + }, + + renderTimePicker: function(side) { + + // Don't bother updating the time picker if it's currently disabled + // because an end date hasn't been clicked yet + if (side == 'right' && !this.endDate) return; + + var html, selected, minDate, maxDate = this.maxDate; + + if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate))) + maxDate = this.startDate.clone().add(this.maxSpan); + + if (side == 'left') { + selected = this.startDate.clone(); + minDate = this.minDate; + } else if (side == 'right') { + selected = this.endDate.clone(); + minDate = this.startDate; + + //Preserve the time already selected + var timeSelector = this.container.find('.drp-calendar.right .calendar-time'); + if (timeSelector.html() != '') { + + selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val()); + selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val()); + selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val()); + + if (!this.timePicker24Hour) { + var ampm = timeSelector.find('.ampmselect option:selected').val(); + if (ampm === 'PM' && selected.hour() < 12) + selected.hour(selected.hour() + 12); + if (ampm === 'AM' && selected.hour() === 12) + selected.hour(0); + } + + } + + if (selected.isBefore(this.startDate)) + selected = this.startDate.clone(); + + if (maxDate && selected.isAfter(maxDate)) + selected = maxDate.clone(); + + } + + // + // hours + // + + html = ' '; + + // + // minutes + // + + html += ': '; + + // + // seconds + // + + if (this.timePickerSeconds) { + html += ': '; + } + + // + // AM/PM + // + + if (!this.timePicker24Hour) { + html += ''; + } + + this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html); + + }, + + updateFormInputs: function() { + + if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) { + this.container.find('button.applyBtn').prop('disabled', false); + } else { + this.container.find('button.applyBtn').prop('disabled', true); + } + + }, + + move: function() { + var parentOffset = { top: 0, left: 0 }, + containerTop, + drops = this.drops; + + var parentRightEdge = $(window).width(); + if (!this.parentEl.is('body')) { + parentOffset = { + top: this.parentEl.offset().top - this.parentEl.scrollTop(), + left: this.parentEl.offset().left - this.parentEl.scrollLeft() + }; + parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; + } + + switch (drops) { + case 'auto': + containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; + if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) { + containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; + drops = 'up'; + } + break; + case 'up': + containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; + break; + default: + containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; + break; + } + + // Force the container to it's actual width + this.container.css({ + top: 0, + left: 0, + right: 'auto' + }); + var containerWidth = this.container.outerWidth(); + + this.container.toggleClass('drop-up', drops == 'up'); + + if (this.opens == 'left') { + var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth(); + if (containerWidth + containerRight > $(window).width()) { + this.container.css({ + top: containerTop, + right: 'auto', + left: 9 + }); + } else { + this.container.css({ + top: containerTop, + right: containerRight, + left: 'auto' + }); + } + } else if (this.opens == 'center') { + var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2 + - containerWidth / 2; + if (containerLeft < 0) { + this.container.css({ + top: containerTop, + right: 'auto', + left: 9 + }); + } else if (containerLeft + containerWidth > $(window).width()) { + this.container.css({ + top: containerTop, + left: 'auto', + right: 0 + }); + } else { + this.container.css({ + top: containerTop, + left: containerLeft, + right: 'auto' + }); + } + } else { + var containerLeft = this.element.offset().left - parentOffset.left; + if (containerLeft + containerWidth > $(window).width()) { + this.container.css({ + top: containerTop, + left: 'auto', + right: 0 + }); + } else { + this.container.css({ + top: containerTop, + left: containerLeft, + right: 'auto' + }); + } + } + }, + + show: function(e) { + if (this.isShowing) return; + + // Create a click proxy that is private to this instance of datepicker, for unbinding + this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this); + + // Bind global datepicker mousedown for hiding and + $(document) + .on('mousedown.daterangepicker', this._outsideClickProxy) + // also support mobile devices + .on('touchend.daterangepicker', this._outsideClickProxy) + // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them + .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy) + // and also close when focus changes to outside the picker (eg. tabbing between controls) + .on('focusin.daterangepicker', this._outsideClickProxy); + + // Reposition the picker if the window is resized while it's open + $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this)); + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + this.previousRightTime = this.endDate.clone(); + + this.updateView(); + this.container.show(); + this.move(); + this.element.trigger('show.daterangepicker', this); + this.isShowing = true; + }, + + hide: function(e) { + if (!this.isShowing) return; + + //incomplete date selection, revert to last values + if (!this.endDate) { + this.startDate = this.oldStartDate.clone(); + this.endDate = this.oldEndDate.clone(); + } + + //if a new date range was selected, invoke the user callback function + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel); + + //if picker is attached to a text input, update it + this.updateElement(); + + $(document).off('.daterangepicker'); + $(window).off('.daterangepicker'); + this.container.hide(); + this.element.trigger('hide.daterangepicker', this); + this.isShowing = false; + }, + + toggle: function(e) { + if (this.isShowing) { + this.hide(); + } else { + this.show(); + } + }, + + outsideClick: function(e) { + var target = $(e.target); + // if the page is clicked anywhere except within the daterangerpicker/button + // itself then call this.hide() + if ( + // ie modal dialog fix + e.type == "focusin" || + target.closest(this.element).length || + target.closest(this.container).length || + target.closest('.calendar-table').length + ) return; + this.hide(); + this.element.trigger('outsideClick.daterangepicker', this); + }, + + showCalendars: function() { + this.container.addClass('show-calendar'); + this.move(); + this.element.trigger('showCalendar.daterangepicker', this); + }, + + hideCalendars: function() { + this.container.removeClass('show-calendar'); + this.element.trigger('hideCalendar.daterangepicker', this); + }, + + clickRange: function(e) { + var label = e.target.getAttribute('data-range-key'); + this.chosenLabel = label; + if (label == this.locale.customRangeLabel) { + this.showCalendars(); + } else { + var dates = this.ranges[label]; + this.startDate = dates[0]; + this.endDate = dates[1]; + + if (!this.timePicker) { + this.startDate.startOf('day'); + this.endDate.endOf('day'); + } + + if (!this.alwaysShowCalendars) + this.hideCalendars(); + this.clickApply(); + } + }, + + clickPrev: function(e) { + var cal = $(e.target).parents('.drp-calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.subtract(1, 'month'); + if (this.linkedCalendars) + this.rightCalendar.month.subtract(1, 'month'); + } else { + this.rightCalendar.month.subtract(1, 'month'); + } + this.updateCalendars(); + }, + + clickNext: function(e) { + var cal = $(e.target).parents('.drp-calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.add(1, 'month'); + } else { + this.rightCalendar.month.add(1, 'month'); + if (this.linkedCalendars) + this.leftCalendar.month.add(1, 'month'); + } + this.updateCalendars(); + }, + + hoverDate: function(e) { + + //ignore dates that can't be selected + if (!$(e.target).hasClass('available')) return; + + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.drp-calendar'); + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; + + //highlight the dates between the start date and the date being hovered as a potential end date + var leftCalendar = this.leftCalendar; + var rightCalendar = this.rightCalendar; + var startDate = this.startDate; + if (!this.endDate) { + this.container.find('.drp-calendar tbody td').each(function(index, el) { + + //skip week numbers, only look at dates + if ($(el).hasClass('week')) return; + + var title = $(el).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(el).parents('.drp-calendar'); + var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col]; + + if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) { + $(el).addClass('in-range'); + } else { + $(el).removeClass('in-range'); + } + + }); + } + + }, + + clickDate: function(e) { + + if (!$(e.target).hasClass('available')) return; + + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.drp-calendar'); + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; + + // + // this function needs to do a few things: + // * alternate between selecting a start and end date for the range, + // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date + // * if autoapply is enabled, and an end date was chosen, apply the selection + // * if single date picker mode, and time picker isn't enabled, apply the selection immediately + // * if one of the inputs above the calendars was focused, cancel that manual input + // + + if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start + if (this.timePicker) { + var hour = parseInt(this.container.find('.left .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + var minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + if (isNaN(minute)) { + minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10); + } + var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); + } + this.endDate = null; + this.setStartDate(date.clone()); + } else if (!this.endDate && date.isBefore(this.startDate)) { + //special case: clicking the same date for start/end, + //but the time of the end date is before the start date + this.setEndDate(this.startDate.clone()); + } else { // picking end + if (this.timePicker) { + var hour = parseInt(this.container.find('.right .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + var minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + if (isNaN(minute)) { + minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10); + } + var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); + } + this.setEndDate(date.clone()); + if (this.autoApply) { + this.calculateChosenLabel(); + this.clickApply(); + } + } + + if (this.singleDatePicker) { + this.setEndDate(this.startDate); + if (!this.timePicker && this.autoApply) + this.clickApply(); + } + + this.updateView(); + + //This is to cancel the blur event handler if the mouse was in one of the inputs + e.stopPropagation(); + + }, + + calculateChosenLabel: function () { + var customRange = true; + var i = 0; + for (var range in this.ranges) { + if (this.timePicker) { + var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm"; + //ignore times when comparing dates if time picker seconds is not enabled + if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key'); + break; + } + } else { + //ignore times when comparing dates if time picker is not enabled + if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key'); + break; + } + } + i++; + } + if (customRange) { + if (this.showCustomRangeLabel) { + this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key'); + } else { + this.chosenLabel = null; + } + this.showCalendars(); + } + }, + + clickApply: function(e) { + this.hide(); + this.element.trigger('apply.daterangepicker', this); + }, + + clickCancel: function(e) { + this.startDate = this.oldStartDate; + this.endDate = this.oldEndDate; + this.hide(); + this.element.trigger('cancel.daterangepicker', this); + }, + + monthOrYearChanged: function(e) { + var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'), + leftOrRight = isLeft ? 'left' : 'right', + cal = this.container.find('.drp-calendar.'+leftOrRight); + + // Month must be Number for new moment versions + var month = parseInt(cal.find('.monthselect').val(), 10); + var year = cal.find('.yearselect').val(); + + if (!isLeft) { + if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) { + month = this.startDate.month(); + year = this.startDate.year(); + } + } + + if (this.minDate) { + if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) { + month = this.minDate.month(); + year = this.minDate.year(); + } + } + + if (this.maxDate) { + if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) { + month = this.maxDate.month(); + year = this.maxDate.year(); + } + } + + if (isLeft) { + this.leftCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month'); + } else { + this.rightCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month'); + } + this.updateCalendars(); + }, + + timeChanged: function(e) { + + var cal = $(e.target).closest('.drp-calendar'), + isLeft = cal.hasClass('left'); + + var hour = parseInt(cal.find('.hourselect').val(), 10); + var minute = parseInt(cal.find('.minuteselect').val(), 10); + if (isNaN(minute)) { + minute = parseInt(cal.find('.minuteselect option:last').val(), 10); + } + var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0; + + if (!this.timePicker24Hour) { + var ampm = cal.find('.ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + + if (isLeft) { + var start = this.startDate.clone(); + start.hour(hour); + start.minute(minute); + start.second(second); + this.setStartDate(start); + if (this.singleDatePicker) { + this.endDate = this.startDate.clone(); + } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) { + this.setEndDate(start.clone()); + } + } else if (this.endDate) { + var end = this.endDate.clone(); + end.hour(hour); + end.minute(minute); + end.second(second); + this.setEndDate(end); + } + + //update the calendars so all clickable dates reflect the new time component + this.updateCalendars(); + + //update the form inputs above the calendars with the new time + this.updateFormInputs(); + + //re-render the time pickers because changing one selection can affect what's enabled in another + this.renderTimePicker('left'); + this.renderTimePicker('right'); + + }, + + elementChanged: function() { + if (!this.element.is('input')) return; + if (!this.element.val().length) return; + + var dateString = this.element.val().split(this.locale.separator), + start = null, + end = null; + + if (dateString.length === 2) { + start = moment(dateString[0], this.locale.format); + end = moment(dateString[1], this.locale.format); + } + + if (this.singleDatePicker || start === null || end === null) { + start = moment(this.element.val(), this.locale.format); + end = start; + } + + if (!start.isValid() || !end.isValid()) return; + + this.setStartDate(start); + this.setEndDate(end); + this.updateView(); + }, + + keydown: function(e) { + //hide on tab or enter + if ((e.keyCode === 9) || (e.keyCode === 13)) { + this.hide(); + } + + //hide on esc and prevent propagation + if (e.keyCode === 27) { + e.preventDefault(); + e.stopPropagation(); + + this.hide(); + } + }, + + updateElement: function() { + if (this.element.is('input') && this.autoUpdateInput) { + var newValue = this.startDate.format(this.locale.format); + if (!this.singleDatePicker) { + newValue += this.locale.separator + this.endDate.format(this.locale.format); + } + if (newValue !== this.element.val()) { + this.element.val(newValue).trigger('change'); + } + } + }, + + remove: function() { + this.container.remove(); + this.element.off('.daterangepicker'); + this.element.removeData(); + } + + }; + + $.fn.daterangepicker = function(options, callback) { + var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options); + this.each(function() { + var el = $(this); + if (el.data('daterangepicker')) + el.data('daterangepicker').remove(); + el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback)); + }); + return this; + }; + + return DateRangePicker; + +})); diff --git a/src/static/js/moment.min.js b/src/static/js/moment.min.js new file mode 100644 index 00000000..5787a408 --- /dev/null +++ b/src/static/js/moment.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,i;function c(){return e.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function u(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function l(e){return void 0===e}function h(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,s=[];for(n=0;n>>0,s=0;sSe(e)?(r=e+1,o-Se(e)):(r=e,o),{year:r,dayOfYear:a}}function Ie(e,t,n){var s,i,r=Ve(e.year(),t,n),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?s=a+Ae(i=e.year()-1,t,n):a>Ae(e.year(),t,n)?(s=a-Ae(e.year(),t,n),i=e.year()+1):(i=e.year(),s=a),{week:s,year:i}}function Ae(e,t,n){var s=Ve(e,t,n),i=Ve(e+1,t,n);return(Se(e)-s+i)/7}I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),F("week",5),F("isoWeek",5),ue("w",B),ue("ww",B,z),ue("W",B),ue("WW",B,z),fe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=D(e)});function je(e,t){return e.slice(t,7).concat(e.slice(0,t))}I("d",0,"do","day"),I("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),I("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),I("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),F("day",11),F("weekday",11),F("isoWeekday",11),ue("d",B),ue("e",B),ue("E",B),ue("dd",function(e,t){return t.weekdaysMinRegex(e)}),ue("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ue("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,n,s){var i=n._locale.weekdaysParse(e,s,n._strict);null!=i?t.d=i:g(n).invalidWeekday=e}),fe(["d","e","E"],function(e,t,n,s){t[s]=D(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var $e="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var qe=ae;var Je=ae;var Be=ae;function Qe(){function e(e,t){return t.length-e.length}var t,n,s,i,r,a=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=y([2e3,1]).day(t),s=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),r=this.weekdays(n,""),a.push(s),o.push(i),u.push(r),l.push(s),l.push(i),l.push(r);for(a.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=he(o[t]),u[t]=he(u[t]),l[t]=he(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){I(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}I("H",["HH",2],0,"hour"),I("h",["hh",2],0,Xe),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),C("hour","h"),F("hour",13),ue("a",et),ue("A",et),ue("H",B),ue("h",B),ue("k",B),ue("HH",B,z),ue("hh",B,z),ue("kk",B,z),ue("hmm",Q),ue("hmmss",X),ue("Hmm",Q),ue("Hmmss",X),ce(["H","HH"],ge),ce(["k","kk"],function(e,t,n){var s=D(e);t[ge]=24===s?0:s}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ge]=D(e),g(n).bigHour=!0}),ce("hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s)),g(n).bigHour=!0}),ce("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i)),g(n).bigHour=!0}),ce("Hmm",function(e,t,n){var s=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s))}),ce("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[ge]=D(e.substr(0,s)),t[ve]=D(e.substr(s,2)),t[pe]=D(e.substr(i))});var tt,nt=Te("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:He,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:$e,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},it={},rt={};function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(e){var t=null;if(!it[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),ut(t)}catch(e){}return it[e]}function ut(e,t){var n;return e&&((n=l(t)?ht(e):lt(e,t))?tt=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function lt(e,t){if(null===t)return delete it[e],null;var n,s=st;if(t.abbr=e,null!=it[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=it[e]._config;else if(null!=t.parentLocale)if(null!=it[t.parentLocale])s=it[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return rt[t.parentLocale]||(rt[t.parentLocale]=[]),rt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return it[e]=new P(x(s,t)),rt[e]&&rt[e].forEach(function(e){lt(e.name,e.config)}),ut(e),it[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,s,i,r=0;r=t&&a(i,n,!0)>=t-1)break;t--}r++}return tt}(e)}function dt(e){var t,n=e._a;return n&&-2===g(e).overflow&&(t=n[_e]<0||11Pe(n[me],n[_e])?ye:n[ge]<0||24Ae(n,r,a)?g(e)._overflowWeeks=!0:null!=u?g(e)._overflowWeekday=!0:(o=Ee(n,s,i,r,a),e._a[me]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(r=ct(e._a[me],s[me]),(e._dayOfYear>Se(r)||0===e._dayOfYear)&&(g(e)._overflowDayOfYear=!0),n=Ge(r,0,e._dayOfYear),e._a[_e]=n.getUTCMonth(),e._a[ye]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=s[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ge]&&0===e._a[ve]&&0===e._a[pe]&&0===e._a[we]&&(e._nextDay=!0,e._a[ge]=0),e._d=(e._useUTC?Ge:function(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}).apply(null,a),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ge]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(g(e).weekdayMismatch=!0)}}var mt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,yt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pt=/^\/?Date\((\-?\d+)/i;function wt(e){var t,n,s,i,r,a,o=e._i,u=mt.exec(o)||_t.exec(o);if(u){for(g(e).iso=!0,t=0,n=gt.length;tn.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},mn.isUtc=Et,mn.isUTC=Et,mn.zoneAbbr=function(){return this._isUTC?"UTC":""},mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},mn.dates=n("dates accessor is deprecated. Use date instead.",un),mn.months=n("months accessor is deprecated. Use month instead",Ue),mn.years=n("years accessor is deprecated. Use year instead",Oe),mn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),mn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!l(this._isDSTShifted))return this._isDSTShifted;var e={};if(w(e,this),(e=Ot(e))._a){var t=e._isUTC?y(e._a):bt(e._a);this._isDSTShifted=this.isValid()&&0