├── .DS_Store ├── .gitattributes ├── README.md ├── config.php ├── css ├── bootstrap-datetimepicker.min.css ├── bootstrap.min.css ├── calendar.css └── font-awesome.min.css ├── descripcion_evento.php ├── eventos.sql ├── fonts ├── FontAwesome.otf ├── GOODTIME.ttf ├── SourceSansPro-Regular.otf ├── fontawesome-webfont.eot ├── fontawesome-webfont.svg ├── fontawesome-webfont.ttf ├── fontawesome-webfont.woff ├── fontawesome-webfont.woff2 ├── glyphicons-halflings-regular.woff └── glyphicons-halflings-regular.woff2 ├── funciones.php ├── index.php ├── js ├── bootstrap-datetimepicker.js ├── bootstrap.min.js ├── calendar.js ├── es-ES.js ├── jquery.min.js ├── moment.js └── underscore-min.js ├── obtener_eventos.php └── tmpls ├── day.html ├── events-list.html ├── modal.html ├── month-day.html ├── month.html ├── week-days.html ├── week.html ├── year-month.html └── year.html /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/.DS_Store -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Calendario by icodeart 2 | Calendario con eventos en php y mysql diseñado en Bootstrap. 3 | 4 | # Uso 5 | Modificar el archivo config.php con la informacion de tu base de dato e importar el archivo sql a tu base de datos. 6 | 7 | # Funcionamiento 8 | https://www.youtube.com/watch?v=fIiNIcID7ik 9 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | set_charset('utf8'); 33 | 34 | // verificamos si hubo algun error y lo mostramos 35 | if ($conexion->connect_errno) { 36 | echo "Error al conectar la base de datos {$conexion->connect_errno}"; 37 | } 38 | 39 | // Url donde estara el proyecto, debe terminar con un "/" al final 40 | $base_url="http://localhost/calendario/"; 41 | 42 | ?> 43 | 44 | -------------------------------------------------------------------------------- /css/bootstrap-datetimepicker.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Datetimepicker for Bootstrap v3 3 | * https://github.com/Eonasdan/bootstrap-datetimepicker/ 4 | */ 5 | .bootstrap-datetimepicker-widget{top:0;left:0;width:260px;padding:4px;margin-top:1px;z-index:99999!important;border-radius:4px}.bootstrap-datetimepicker-widget.timepicker-sbs{width:600px}.bootstrap-datetimepicker-widget.bottom:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:7px}.bootstrap-datetimepicker-widget.bottom:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:8px}.bootstrap-datetimepicker-widget.top:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.top:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;position:absolute;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget .dow{width:14.2857%}.bootstrap-datetimepicker-widget.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget>ul{list-style-type:none;margin:0}.bootstrap-datetimepicker-widget .timepicker-hour,.bootstrap-datetimepicker-widget .timepicker-minute,.bootstrap-datetimepicker-widget .timepicker-second{width:100%;font-weight:bold;font-size:1.2em}.bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator{width:4px;padding:0;margin:0}.bootstrap-datetimepicker-widget .datepicker>div{display:none}.bootstrap-datetimepicker-widget .picker-switch{text-align:center}.bootstrap-datetimepicker-widget table{width:100%;margin:0}.bootstrap-datetimepicker-widget td,.bootstrap-datetimepicker-widget th{text-align:center;width:20px;height:20px;border-radius:4px}.bootstrap-datetimepicker-widget td.day:hover,.bootstrap-datetimepicker-widget td.hour:hover,.bootstrap-datetimepicker-widget td.minute:hover,.bootstrap-datetimepicker-widget td.second:hover{background:#eee;cursor:pointer}.bootstrap-datetimepicker-widget td.old,.bootstrap-datetimepicker-widget td.new{color:#999}.bootstrap-datetimepicker-widget td.today{position:relative}.bootstrap-datetimepicker-widget td.today:before{content:'';display:inline-block;border-left:7px solid transparent;border-bottom:7px solid #428bca;border-top-color:rgba(0,0,0,.2);position:absolute;bottom:4px;right:4px}.bootstrap-datetimepicker-widget td.active,.bootstrap-datetimepicker-widget td.active:hover{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td.active.today:before{border-bottom-color:#fff}.bootstrap-datetimepicker-widget td.disabled,.bootstrap-datetimepicker-widget td.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget td span{display:block;width:47px;height:54px;line-height:54px;float:left;margin:2px;cursor:pointer;border-radius:4px}.bootstrap-datetimepicker-widget td span:hover{background:#eee}.bootstrap-datetimepicker-widget td span.active{background-color:#428bca;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.bootstrap-datetimepicker-widget td span.old{color:#999}.bootstrap-datetimepicker-widget td span.disabled,.bootstrap-datetimepicker-widget td span.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget th.switch{width:145px}.bootstrap-datetimepicker-widget th.next,.bootstrap-datetimepicker-widget th.prev{font-size:21px}.bootstrap-datetimepicker-widget th.disabled,.bootstrap-datetimepicker-widget th.disabled:hover{background:none;color:#999;cursor:not-allowed}.bootstrap-datetimepicker-widget thead tr:first-child th{cursor:pointer}.bootstrap-datetimepicker-widget thead tr:first-child th:hover{background:#eee}.input-group.date .input-group-addon span{display:block;cursor:pointer;width:16px;height:16px}.bootstrap-datetimepicker-widget.left-oriented:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.left-oriented:after{left:auto;right:7px}.bootstrap-datetimepicker-widget ul.list-unstyled li div.timepicker div.timepicker-picker table.table-condensed tbody>tr>td{padding:0!important} -------------------------------------------------------------------------------- /css/calendar.css: -------------------------------------------------------------------------------- 1 | [class*="cal-cell"] { 2 | float: left; 3 | margin-left: 0; 4 | min-height: 1px; 5 | } 6 | .cal-row-fluid { 7 | width: 100%; 8 | *zoom: 1; 9 | } 10 | .cal-row-fluid:before, 11 | .cal-row-fluid:after { 12 | display: table; 13 | content: ""; 14 | line-height: 0; 15 | } 16 | .cal-row-fluid:after { 17 | clear: both; 18 | } 19 | .cal-row-fluid [class*="cal-cell"] { 20 | display: block; 21 | width: 100%; 22 | -webkit-box-sizing: border-box; 23 | -moz-box-sizing: border-box; 24 | box-sizing: border-box; 25 | float: left; 26 | margin-left: 0%; 27 | *margin-left: -0.05213764337851929%; 28 | } 29 | .cal-row-fluid [class*="cal-cell"]:first-child { 30 | margin-left: 0; 31 | } 32 | .cal-row-fluid .controls-row [class*="cal-cell"] + [class*="cal-cell"] { 33 | margin-left: 0%; 34 | } 35 | .cal-row-fluid .cal-cell7 { 36 | width: 100%; 37 | *width: 99.94669509594883%; 38 | } 39 | .cal-row-fluid .cal-cell6 { 40 | width: 85.71428571428571%; 41 | *width: 85.66098081023453%; 42 | } 43 | .cal-row-fluid .cal-cell5 { 44 | width: 71.42857142857142%; 45 | *width: 71.37526652452024%; 46 | } 47 | .cal-row-fluid .cal-cell4 { 48 | width: 57.14285714285714%; 49 | *width: 57.089552238805965%; 50 | } 51 | .cal-row-fluid .cal-cell3 { 52 | width: 42.857142857142854%; 53 | *width: 42.80383795309168%; 54 | } 55 | .cal-row-fluid .cal-cell2 { 56 | width: 28.57142857142857%; 57 | *width: 28.518123667377395%; 58 | } 59 | .cal-row-fluid .cal-cell1 { 60 | width: 14.285714285714285%; 61 | *width: 14.232409381663112%; 62 | } 63 | .cal-week-box .cal-offset7, 64 | .cal-row-fluid .cal-offset7, 65 | .cal-row-fluid .cal-offset7:first-child { 66 | margin-left: 100%; 67 | *margin-left: 99.89339019189765%; 68 | } 69 | .cal-week-box .cal-offset6, 70 | .cal-row-fluid .cal-offset6, 71 | .cal-row-fluid .cal-offset6:first-child { 72 | margin-left: 85.71428571428571%; 73 | *margin-left: 85.60767590618336%; 74 | } 75 | .cal-week-box .cal-offset5, 76 | .cal-row-fluid .cal-offset5, 77 | .cal-row-fluid .cal-offset5:first-child { 78 | margin-left: 71.42857142857142%; 79 | *margin-left: 71.32196162046907%; 80 | } 81 | .cal-week-box .cal-offset4, 82 | .cal-row-fluid .cal-offset4, 83 | .cal-row-fluid .cal-offset4:first-child { 84 | margin-left: 57.14285714285714%; 85 | *margin-left: 57.03624733475479%; 86 | } 87 | .cal-week-box .cal-offset3, 88 | .cal-row-fluid .cal-offset3, 89 | .cal-row-fluid .cal-offset3:first-child { 90 | margin-left: 42.857142857142854%; 91 | *margin-left: 42.750533049040506%; 92 | } 93 | .cal-week-box .cal-offset2, 94 | .cal-row-fluid .cal-offset2, 95 | .cal-row-fluid .cal-offset2:first-child { 96 | margin-left: 28.57142857142857%; 97 | *margin-left: 28.46481876332622%; 98 | } 99 | .cal-week-box .cal-offset1, 100 | .cal-row-fluid .cal-offset1, 101 | .cal-row-fluid .cal-offset1:first-child { 102 | margin-left: 14.285714285714285%; 103 | *margin-left: 14.17910447761194%; 104 | } 105 | .cal-row-fluid .cal-cell1 { 106 | width: 14.285714285714285%; 107 | *width: 14.233576642335766%; 108 | } 109 | [class*="cal-cell"].hide, 110 | .cal-row-fluid [class*="cal-cell"].hide { 111 | display: none; 112 | } 113 | [class*="cal-cell"].pull-right, 114 | .cal-row-fluid [class*="cal-cell"].pull-right { 115 | float: right; 116 | } 117 | .cal-row-head [class*="cal-cell"]:first-child, 118 | .cal-row-head [class*="cal-cell"] { 119 | min-height: auto; 120 | overflow: hidden; 121 | text-overflow: ellipsis; 122 | } 123 | .cal-events-num { 124 | margin-top: 20px; 125 | } 126 | .cal-month-day { 127 | position: relative; 128 | display: block; 129 | width: 100%; 130 | } 131 | #cal-week-box { 132 | position: absolute; 133 | width: 70px; 134 | left: -71px; 135 | top: -1px; 136 | padding: 8px 5px; 137 | cursor: pointer; 138 | } 139 | #cal-day-tick { 140 | position: absolute; 141 | right: 50%; 142 | bottom: -21px; 143 | padding: 0px 5px; 144 | cursor: pointer; 145 | z-index: 5; 146 | text-align: center; 147 | width: 26px; 148 | margin-right: -17px; 149 | } 150 | .cal-year-box #cal-day-tick { 151 | margin-right: -7px; 152 | } 153 | #cal-slide-box { 154 | position: relative; 155 | } 156 | #cal-slide-tick { 157 | position: absolute; 158 | width: 16px; 159 | margin-left: -7px; 160 | height: 9px; 161 | top: -1px; 162 | z-index: 1; 163 | } 164 | #cal-slide-tick.tick-month1 { 165 | left: 12.5%; 166 | } 167 | #cal-slide-tick.tick-month2 { 168 | left: 37.5%; 169 | } 170 | #cal-slide-tick.tick-month3 { 171 | left: 62.5%; 172 | } 173 | #cal-slide-tick.tick-month4 { 174 | left: 87.5%; 175 | } 176 | #cal-slide-tick.tick-day1 { 177 | left: 7.14285714285715%; 178 | } 179 | #cal-slide-tick.tick-day2 { 180 | left: 21.42857142857143%; 181 | } 182 | #cal-slide-tick.tick-day3 { 183 | left: 35.71428571428572%; 184 | } 185 | #cal-slide-tick.tick-day4 { 186 | left: 50%; 187 | } 188 | #cal-slide-tick.tick-day5 { 189 | left: 64.2857142857143%; 190 | } 191 | #cal-slide-tick.tick-day6 { 192 | left: 78.57142857142859%; 193 | } 194 | #cal-slide-tick.tick-day7 { 195 | left: 92.85714285714285%; 196 | } 197 | .events-list { 198 | position: absolute; 199 | bottom: 0; 200 | left: 0; 201 | overflow: hidden; 202 | } 203 | #cal-slide-content ul.unstyled { 204 | margin-bottom: 0; 205 | } 206 | .cal-week-box { 207 | position: relative; 208 | } 209 | .cal-week-box [data-event-class] { 210 | white-space: nowrap; 211 | height: 30px; 212 | margin: 1px 1px; 213 | line-height: 30px; 214 | text-overflow: ellipsis; 215 | overflow: hidden; 216 | padding-left: 10px; 217 | } 218 | .cal-week-box .cal-column { 219 | position: absolute; 220 | height: 100%; 221 | z-index: -1; 222 | } 223 | .cal-week-box .arrow-before, 224 | .cal-week-box .arrow-after { 225 | position: relative; 226 | } 227 | .cal-week-box .arrow-after:after { 228 | content: ""; 229 | position: absolute; 230 | top: 0px; 231 | width: 0; 232 | height: 0; 233 | right: 0; 234 | border-top: 15px solid #ffffff; 235 | border-left: 8px solid; 236 | border-bottom: 15px solid #FFFFFF; 237 | } 238 | .cal-week-box .arrow-before:before { 239 | content: ""; 240 | position: absolute; 241 | top: 0px; 242 | width: 0; 243 | height: 0; 244 | left: 1px; 245 | border-top: 15px solid transparent; 246 | border-left: 8px solid #FFFFFF; 247 | border-bottom: 15px solid transparent; 248 | } 249 | #cal-day-box { 250 | text-wrap: none; 251 | } 252 | #cal-day-box .cal-day-hour-part { 253 | height: 30px; 254 | box-sizing: border-box; 255 | -moz-box-sizing: border-box; 256 | -webkit-box-sizing: border-box; 257 | border-bottom: thin dashed #e1e1e1; 258 | } 259 | #cal-day-box .cal-day-hour .day-highlight { 260 | height: 30px; 261 | } 262 | #cal-day-box .cal-hours { 263 | font-weight: bolder; 264 | } 265 | #cal-day-box .cal-day-hour:nth-child(odd) { 266 | background-color: #fafafa; 267 | } 268 | #cal-day-box #cal-day-panel { 269 | position: sticky; 270 | padding-left: 60px; 271 | } 272 | #cal-day-box #cal-day-panel-hour { 273 | position: absolute; 274 | width: 100%; 275 | margin-left: -60px; 276 | z-index: -1; 277 | } 278 | #cal-day-box .day-event { 279 | max-width: 200px; 280 | overflow: hidden; 281 | } 282 | #cal-day-box .day-highlight { 283 | line-height: 30px; 284 | padding-left: 8px; 285 | padding-right: 8px; 286 | box-sizing: border-box; 287 | -moz-box-sizing: border-box; 288 | -webkit-box-sizing: border-box; 289 | border: 1px solid #c3c3c3; 290 | margin: 1px 1px; 291 | overflow: hidden; 292 | text-overflow: ellipsis; 293 | } 294 | #cal-day-box .day-highlight.dh-event-important { 295 | border: 1px solid #ad2121; 296 | } 297 | #cal-day-box .day-highlight.dh-event-warning { 298 | border: 1px solid #e3bc08; 299 | } 300 | #cal-day-box .day-highlight.dh-event-info { 301 | border: 1px solid #1e90ff; 302 | } 303 | #cal-day-box .day-highlight.dh-event-inverse { 304 | border: 1px solid #1b1b1b; 305 | } 306 | #cal-day-box .day-highlight.dh-event-success { 307 | border: 1px solid #006400; 308 | } 309 | #cal-day-box .day-highlight.dh-event-special { 310 | background-color: #ffe6ff; 311 | border: 1px solid #800080; 312 | } 313 | .event { 314 | display: block; 315 | background-color: #c3c3c3; 316 | width: 12px; 317 | height: 12px; 318 | margin-right: 2px; 319 | margin-bottom: 2px; 320 | -webkit-box-shadow: inset 0px 0px 5px 0px rgba(0, 0, 0, 0.4); 321 | box-shadow: inset 0px 0px 5px 0px rgba(0, 0, 0, 0.4); 322 | border-radius: 8px; 323 | border: 1px solid #ffffff; 324 | } 325 | .event-block { 326 | display: block; 327 | background-color: #c3c3c3; 328 | width: 20px; 329 | height: 100%; 330 | } 331 | .cal-event-list .event.pull-left { 332 | margin-top: 3px; 333 | } 334 | .event-important { 335 | background-color: #ad2121; 336 | } 337 | .event-info { 338 | background-color: #1e90ff; 339 | } 340 | .event-warning { 341 | background-color: #e3bc08; 342 | } 343 | .event-inverse { 344 | background-color: #1b1b1b; 345 | } 346 | .event-success { 347 | background-color: #006400; 348 | } 349 | .event-special { 350 | background-color: #800080; 351 | } 352 | .day-highlight:hover, 353 | .day-highlight { 354 | background-color: #dddddd; 355 | } 356 | .day-highlight.dh-event-important:hover, 357 | .day-highlight.dh-event-important { 358 | background-color: #fae3e3; 359 | } 360 | .day-highlight.dh-event-warning:hover, 361 | .day-highlight.dh-event-warning { 362 | background-color: #fdf1ba; 363 | } 364 | .day-highlight.dh-event-info:hover, 365 | .day-highlight.dh-event-info { 366 | background-color: #d1e8ff; 367 | } 368 | .day-highlight.dh-event-inverse:hover, 369 | .day-highlight.dh-event-inverse { 370 | background-color: #c1c1c1; 371 | } 372 | .day-highlight.dh-event-success:hover, 373 | .day-highlight.dh-event-success { 374 | background-color: #caffca; 375 | } 376 | .day-highlight.dh-event-special:hover, 377 | .day-highlight.dh-event-special { 378 | background-color: #ffe6ff; 379 | } 380 | .cal-row-head [class*="cal-cell"]:first-child, 381 | .cal-row-head [class*="cal-cell"] { 382 | font-weight: bolder; 383 | text-align: center; 384 | border: 0px solid; 385 | padding: 14px 0; 386 | z-index: 1; 387 | margin-top: -4%; 388 | } 389 | .cal-row-head [class*="cal-cell"] small { 390 | font-weight: normal; 391 | } 392 | .cal-year-box .row-fluid:hover, 393 | .cal-row-fluid:hover { 394 | background-color: #fafafa; 395 | } 396 | .cal-month-day { 397 | height: 100px; 398 | } 399 | [class*="cal-cell"]:hover { 400 | background-color: #ededed; 401 | } 402 | .cal-year-box [class*="span"], 403 | .cal-month-box [class*="cal-cell"] { 404 | min-height: 100px; 405 | border-right: 1px solid #e1e1e1; 406 | position: relative; 407 | } 408 | .cal-year-box [class*="span"] { 409 | min-height: 60px; 410 | } 411 | .cal-year-box .row-fluid [class*="span"]:last-child, 412 | .cal-month-box .cal-row-fluid [class*="cal-cell"]:last-child { 413 | border-right: 0px; 414 | } 415 | .cal-year-box .row-fluid, 416 | .cal-month-box .cal-row-fluid { 417 | border-bottom: 1px solid #e1e1e1; 418 | margin-left: 0px; 419 | margin-right: 0px; 420 | } 421 | .cal-year-box .row-fluid:last-child, 422 | .cal-month-box .cal-row-fluid:last-child { 423 | border-bottom: 0px; 424 | } 425 | .cal-month-box, 426 | .cal-year-box, 427 | .cal-week-box { 428 | border-top: 1px solid #e1e1e1; 429 | border-bottom: 1px solid #e1e1e1; 430 | border-right: 1px solid #e1e1e1; 431 | border-left: 1px solid #e1e1e1; 432 | border-radius: 2px; 433 | } 434 | span[data-cal-date] { 435 | font-size: 1.2em; 436 | font-weight: normal; 437 | opacity: 0.5; 438 | cursor: pointer; 439 | transition: all 0.3s ease-in-out; 440 | -webkit-transition: all 0.1s ease-in-out; 441 | -moz-transition: all 0.1s ease-in-out; 442 | -ms-transition: all 0.1s ease-in-out; 443 | -o-transition: all 0.1s ease-in-out; 444 | margin-top: 15px; 445 | margin-right: 15px; 446 | } 447 | span[data-cal-date]:hover { 448 | opacity: 1; 449 | } 450 | .cal-day-outmonth span[data-cal-date] { 451 | opacity: 0.1; 452 | cursor: default; 453 | } 454 | .cal-day-today { 455 | background-color: #e8fde7; 456 | } 457 | .cal-day-today span[data-cal-date] { 458 | color: darkgreen; 459 | } 460 | .cal-month-box .cal-day-today span[data-cal-date] { 461 | font-size: 1.9em; 462 | } 463 | .cal-day-holiday span[data-cal-date] { 464 | color: #800080; 465 | } 466 | .cal-day-weekend span[data-cal-date] { 467 | color: darkred; 468 | } 469 | #cal-week-box { 470 | border: 1px solid #e1e1e1; 471 | border-right: 0px; 472 | border-radius: 5px 0 0 5px; 473 | background-color: #fafafa; 474 | text-align: right; 475 | } 476 | #cal-day-tick { 477 | border: 1px solid #e1e1e1; 478 | border-top: 0px solid; 479 | border-radius: 0 0 5px 5px; 480 | background-color: #ededed; 481 | text-align: center; 482 | } 483 | #cal-slide-box { 484 | border-top: 0px solid #8c8c8c; 485 | } 486 | #cal-slide-content { 487 | padding: 20px; 488 | color: #ffffff; 489 | background-color: steelblue; 490 | } 491 | #cal-slide-tick { 492 | background-image: url("../img/tick.png?2"); 493 | } 494 | #cal-slide-content a.event-item { 495 | color: #ffffff; 496 | font-weight: normal; 497 | line-height: 22px; 498 | } 499 | .events-list { 500 | max-height: 47px; 501 | padding-left: 5px; 502 | } 503 | .cal-column { 504 | border-left: 1px solid #e1e1e1; 505 | } 506 | a.cal-event-week { 507 | text-decoration: none; 508 | color: #151515; 509 | } 510 | .badge-important { 511 | background-color: #b94a48; 512 | } 513 | -------------------------------------------------------------------------------- /css/font-awesome.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.3.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.3.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.3.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.3.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.3.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.3.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.3.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;transform:translate(0, 0)}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-genderless:before,.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"} -------------------------------------------------------------------------------- /descripcion_evento.php: -------------------------------------------------------------------------------- 1 | query("SELECT * FROM agenda WHERE id=$id"); 33 | 34 | // Obtenemos los datos 35 | $row = $bd->fetch_assoc(); 36 | 37 | // titulo 38 | $titulo=$row['title']; 39 | 40 | // cuerpo 41 | $evento=$row['body']; 42 | 43 | // Fecha inicio 44 | $inicio=$row['inicio_normal']; 45 | 46 | // Fecha Termino 47 | $final=$row['final_normal']; 48 | 49 | // Eliminar evento 50 | if (isset($_POST['eliminar_evento'])) 51 | { 52 | $id = evaluar($_GET['id']); 53 | $sql = "DELETE FROM agenda WHERE id = $id"; 54 | if ($conexion->query($sql)) 55 | { 56 | echo "Evento eliminado"; 57 | 58 | 59 | } 60 | else 61 | { 62 | echo "El evento no se pudo eliminar"; 63 | } 64 | } 65 | ?> 66 | 67 | 68 | 69 | 70 | 71 | <?=$titulo?> 72 | 73 | 74 | 75 |

76 |
77 | Fecha inicio:
78 | Fecha termino:
79 | Descripcion:

80 | 81 |
82 | 85 |
86 | 87 | -------------------------------------------------------------------------------- /eventos.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.6.6 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Servidor: localhost 6 | -- Tiempo de generación: 06-11-2017 a las 19:48:21 7 | -- Versión del servidor: 5.7.17-log 8 | -- Versión de PHP: 5.6.30 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8mb4 */; 18 | 19 | -- 20 | -- Base de datos: `control_stock` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Estructura de tabla para la tabla `agenda` 27 | -- 28 | 29 | CREATE TABLE `agenda` ( 30 | `id` int(10) UNSIGNED NOT NULL, 31 | `title` varchar(150) COLLATE utf8_spanish_ci DEFAULT NULL, 32 | `body` text COLLATE utf8_spanish_ci NOT NULL, 33 | `url` varchar(150) COLLATE utf8_spanish_ci NOT NULL, 34 | `class` varchar(45) COLLATE utf8_spanish_ci NOT NULL DEFAULT 'event-important', 35 | `start` varchar(15) COLLATE utf8_spanish_ci NOT NULL, 36 | `end` varchar(15) COLLATE utf8_spanish_ci NOT NULL, 37 | `inicio_normal` varchar(50) COLLATE utf8_spanish_ci NOT NULL, 38 | `final_normal` varchar(50) COLLATE utf8_spanish_ci NOT NULL 39 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci; 40 | 41 | -- 42 | -- Indices de la tabla `agenda` 43 | -- 44 | ALTER TABLE `agenda` 45 | ADD PRIMARY KEY (`id`), 46 | ADD UNIQUE KEY `inicio_normal` (`inicio_normal`), 47 | ADD UNIQUE KEY `final_normal` (`final_normal`); 48 | 49 | -- 50 | -- AUTO_INCREMENT de las tablas volcadas 51 | -- 52 | 53 | -- 54 | -- AUTO_INCREMENT de la tabla `agenda` 55 | -- 56 | ALTER TABLE `agenda` 57 | MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=89; 58 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 59 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 60 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 61 | -------------------------------------------------------------------------------- /fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /fonts/GOODTIME.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/GOODTIME.ttf -------------------------------------------------------------------------------- /fonts/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icodeart/Calendario-Bootstrap-php-mysql/79ef490a620d6ffc867f24170c630316c0fa56e9/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /funciones.php: -------------------------------------------------------------------------------- 1 | ',"\""); 26 | $valor = str_replace($nopermitido, "", $valor); 27 | return $valor; 28 | } 29 | 30 | // Formatear una fecha a microtime para añadir al evento, tipo 1401517498985. 31 | function _formatear($fecha) 32 | { 33 | return strtotime(substr($fecha, 6, 4)."-".substr($fecha, 3, 2)."-".substr($fecha, 0, 2)." " .substr($fecha, 10, 6)) * 1000; 34 | } 35 | ?> 36 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | query($query)or die(''); 69 | 70 | header("Location:$base_url"); 71 | 72 | 73 | // Obtenemos el ultimo id insetado 74 | $im=$conexion->query("SELECT MAX(id) AS id FROM agenda"); 75 | $row = $im->fetch_row(); 76 | $id = trim($row[0]); 77 | 78 | // para generar el link del evento 79 | $link = "$base_url"."descripcion_evento.php?id=$id"; 80 | 81 | // y actualizamos su link 82 | $query="UPDATE agenda SET url = '$link' WHERE id = $id"; 83 | 84 | // Ejecutamos nuestra sentencia sql 85 | $conexion->query($query); 86 | 87 | // redireccionamos a nuestro calendario 88 | //header("Location:$base_url"); 89 | } 90 | } 91 | 92 | ?> 93 | 94 | 95 | 96 | 97 | 98 | Calendario 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
113 |
114 | 115 |

116 |
117 | 118 | 119 | 120 |
121 |
122 | 123 | 124 | 125 | 126 |
127 |
128 |

129 | 130 |
131 |
132 |


133 |
134 |
135 | 136 |
137 | 138 | 152 |
153 | 154 | 155 | 156 | 263 | 264 | 331 | 332 | 333 | -------------------------------------------------------------------------------- /js/bootstrap-datetimepicker.js: -------------------------------------------------------------------------------- 1 | /* 2 | Version 3.0.0 3 | ========================================================= 4 | bootstrap-datetimepicker.js 5 | https://github.com/Eonasdan/bootstrap-datetimepicker 6 | ========================================================= 7 | The MIT License (MIT) 8 | 9 | Copyright (c) 2014 Jonathan Peterson 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in 19 | all copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | THE SOFTWARE. 28 | */ 29 | ; (function (factory) { 30 | if (typeof define === 'function' && define.amd) { 31 | // AMD is used - Register as an anonymous module. 32 | define(['jquery', 'moment'], factory); 33 | } else { 34 | // AMD is not used - Attempt to fetch dependencies from scope. 35 | if (!jQuery) { 36 | throw 'bootstrap-datetimepicker requires jQuery to be loaded first'; 37 | } else if (!moment) { 38 | throw 'bootstrap-datetimepicker requires moment.js to be loaded first'; 39 | } else { 40 | factory(jQuery, moment); 41 | } 42 | } 43 | } 44 | 45 | (function ($, moment) { 46 | if (typeof moment === 'undefined') { 47 | alert("momentjs is requried"); 48 | throw new Error('momentjs is required'); 49 | }; 50 | 51 | var dpgId = 0, 52 | 53 | pMoment = moment, 54 | 55 | // ReSharper disable once InconsistentNaming 56 | DateTimePicker = function (element, options) { 57 | var defaults = { 58 | pickDate: true, 59 | pickTime: true, 60 | useMinutes: true, 61 | useSeconds: false, 62 | useCurrent: true, 63 | minuteStepping: 1, 64 | minDate: new pMoment({ y: 1900 }), 65 | maxDate: new pMoment().add(100, "y"), 66 | showToday: true, 67 | collapse: true, 68 | language: "es-ES", 69 | defaultDate: "", 70 | disabledDates: false, 71 | enabledDates: false, 72 | icons: {}, 73 | useStrict: false, 74 | direction: "auto", 75 | sideBySide: false, 76 | daysOfWeekDisabled: false 77 | }, 78 | 79 | icons = { 80 | time: 'glyphicon glyphicon-time', 81 | date: 'glyphicon glyphicon-calendar', 82 | up: 'glyphicon glyphicon-chevron-up', 83 | down: 'glyphicon glyphicon-chevron-down' 84 | }, 85 | 86 | picker = this, 87 | 88 | init = function () { 89 | 90 | var icon = false, i, dDate, longDateFormat; 91 | picker.options = $.extend({}, defaults, options); 92 | picker.options.icons = $.extend({}, icons, picker.options.icons); 93 | 94 | picker.element = $(element); 95 | 96 | dataToOptions(); 97 | 98 | if (!(picker.options.pickTime || picker.options.pickDate)) 99 | throw new Error('Must choose at least one picker'); 100 | 101 | picker.id = dpgId++; 102 | pMoment.lang(picker.options.language); 103 | picker.date = pMoment(); 104 | picker.unset = false; 105 | picker.isInput = picker.element.is('input'); 106 | picker.component = false; 107 | 108 | if (picker.element.hasClass('input-group')) { 109 | if (picker.element.find('.datepickerbutton').size() == 0) {//in case there is more then one 'input-group-addon' Issue #48 110 | picker.component = picker.element.find("[class^='input-group-']"); 111 | } 112 | else { 113 | picker.component = picker.element.find('.datepickerbutton'); 114 | } 115 | } 116 | picker.format = picker.options.format; 117 | 118 | longDateFormat = pMoment()._lang._longDateFormat; 119 | 120 | if (!picker.format) { 121 | picker.format = (picker.options.pickDate ? longDateFormat.L : ''); 122 | if (picker.options.pickDate && picker.options.pickTime) picker.format += ' '; 123 | picker.format += (picker.options.pickTime ? longDateFormat.LT : ''); 124 | if (picker.options.useSeconds) { 125 | if (~longDateFormat.LT.indexOf(' A')) { 126 | picker.format = picker.format.split(" A")[0] + ":ss A"; 127 | } 128 | else { 129 | picker.format += ':ss'; 130 | } 131 | } 132 | } 133 | picker.use24hours = picker.format.toLowerCase().indexOf("a") < 1; 134 | 135 | if (picker.component) icon = picker.component.find('span'); 136 | 137 | if (picker.options.pickTime) { 138 | if (icon) icon.addClass(picker.options.icons.time); 139 | } 140 | if (picker.options.pickDate) { 141 | if (icon) { 142 | icon.removeClass(picker.options.icons.time); 143 | icon.addClass(picker.options.icons.date); 144 | } 145 | } 146 | 147 | picker.widget = $(getTemplate()).appendTo('body'); 148 | 149 | if (picker.options.useSeconds && !picker.use24hours) { 150 | picker.widget.width(300); 151 | } 152 | 153 | picker.minViewMode = picker.options.minViewMode || 0; 154 | if (typeof picker.minViewMode === 'string') { 155 | switch (picker.minViewMode) { 156 | case 'months': 157 | picker.minViewMode = 1; 158 | break; 159 | case 'years': 160 | picker.minViewMode = 2; 161 | break; 162 | default: 163 | picker.minViewMode = 0; 164 | break; 165 | } 166 | } 167 | picker.viewMode = picker.options.viewMode || 0; 168 | if (typeof picker.viewMode === 'string') { 169 | switch (picker.viewMode) { 170 | case 'months': 171 | picker.viewMode = 1; 172 | break; 173 | case 'years': 174 | picker.viewMode = 2; 175 | break; 176 | default: 177 | picker.viewMode = 0; 178 | break; 179 | } 180 | } 181 | 182 | picker.options.disabledDates = indexGivenDates(picker.options.disabledDates); 183 | picker.options.enabledDates = indexGivenDates(picker.options.enabledDates); 184 | 185 | picker.startViewMode = picker.viewMode; 186 | picker.setMinDate(picker.options.minDate); 187 | picker.setMaxDate(picker.options.maxDate); 188 | fillDow(); 189 | fillMonths(); 190 | fillHours(); 191 | fillMinutes(); 192 | fillSeconds(); 193 | update(); 194 | showMode(); 195 | attachDatePickerEvents(); 196 | if (picker.options.defaultDate !== "" && getPickerInput().val() == "") picker.setValue(picker.options.defaultDate); 197 | if (picker.options.minuteStepping !== 1) { 198 | var rMinutes = picker.date.minutes(); 199 | var rInterval = picker.options.minuteStepping; 200 | picker.date.minutes((Math.round(rMinutes / rInterval) * rInterval) % 60) 201 | .seconds(0); 202 | } 203 | }, 204 | 205 | getPickerInput = function () { 206 | if (picker.isInput) { 207 | return picker.element; 208 | } else { 209 | return dateStr = picker.element.find('input'); 210 | } 211 | }, 212 | 213 | dataToOptions = function () { 214 | var eData 215 | if (picker.element.is('input')) { 216 | eData = picker.element.data(); 217 | } 218 | else { 219 | eData = picker.element.data(); 220 | } 221 | if (eData.dateFormat !== undefined) picker.options.format = eData.dateFormat; 222 | if (eData.datePickdate !== undefined) picker.options.pickDate = eData.datePickdate; 223 | if (eData.datePicktime !== undefined) picker.options.pickTime = eData.datePicktime; 224 | if (eData.dateUseminutes !== undefined) picker.options.useMinutes = eData.dateUseminutes; 225 | if (eData.dateUseseconds !== undefined) picker.options.useSeconds = eData.dateUseseconds; 226 | if (eData.dateUsecurrent !== undefined) picker.options.useCurrent = eData.dateUsecurrent; 227 | if (eData.dateMinutestepping !== undefined) picker.options.minuteStepping = eData.dateMinutestepping; 228 | if (eData.dateMindate !== undefined) picker.options.minDate = eData.dateMindate; 229 | if (eData.dateMaxdate !== undefined) picker.options.maxDate = eData.dateMaxdate; 230 | if (eData.dateShowtoday !== undefined) picker.options.showToday = eData.dateShowtoday; 231 | if (eData.dateCollapse !== undefined) picker.options.collapse = eData.dateCollapse; 232 | if (eData.dateLanguage !== undefined) picker.options.language = eData.dateLanguage; 233 | if (eData.dateDefaultdate !== undefined) picker.options.defaultDate = eData.dateDefaultdate; 234 | if (eData.dateDisableddates !== undefined) picker.options.disabledDates = eData.dateDisableddates; 235 | if (eData.dateEnableddates !== undefined) picker.options.enabledDates = eData.dateEnableddates; 236 | if (eData.dateIcons !== undefined) picker.options.icons = eData.dateIcons; 237 | if (eData.dateUsestrict !== undefined) picker.options.useStrict = eData.dateUsestrict; 238 | if (eData.dateDirection !== undefined) picker.options.direction = eData.dateDirection; 239 | if (eData.dateSidebyside !== undefined) picker.options.sideBySide = eData.dateSidebyside; 240 | }, 241 | 242 | place = function () { 243 | var position = 'absolute', 244 | offset = picker.component ? picker.component.offset() : picker.element.offset(), $window = $(window); 245 | picker.width = picker.component ? picker.component.outerWidth() : picker.element.outerWidth(); 246 | offset.top = offset.top + picker.element.outerHeight(); 247 | 248 | var placePosition; 249 | if (picker.options.direction === 'up') { 250 | placePosition = 'top' 251 | } else if (picker.options.direction === 'bottom') { 252 | placePosition = 'bottom' 253 | } else if (picker.options.direction === 'auto') { 254 | if (offset.top + picker.widget.height() > $window.height() + $window.scrollTop() && picker.widget.height() + picker.element.outerHeight() < offset.top) { 255 | placePosition = 'top'; 256 | } else { 257 | placePosition = 'bottom'; 258 | } 259 | }; 260 | if (placePosition === 'top') { 261 | offset.top -= picker.widget.height() + picker.element.outerHeight() + 15; 262 | picker.widget.addClass('top').removeClass('bottom'); 263 | } else { 264 | offset.top += 1; 265 | picker.widget.addClass('bottom').removeClass('top'); 266 | } 267 | 268 | if (picker.options.width !== undefined) { 269 | picker.widget.width(picker.options.width); 270 | } 271 | 272 | if (picker.options.orientation === 'left') { 273 | picker.widget.addClass('left-oriented'); 274 | offset.left = offset.left - picker.widget.width() + 20; 275 | } 276 | 277 | if (isInFixed()) { 278 | position = 'fixed'; 279 | offset.top -= $window.scrollTop(); 280 | offset.left -= $window.scrollLeft(); 281 | } 282 | 283 | if ($window.width() < offset.left + picker.widget.outerWidth()) { 284 | offset.right = $window.width() - offset.left - picker.width; 285 | offset.left = 'auto'; 286 | picker.widget.addClass('pull-right'); 287 | } else { 288 | offset.right = 'auto'; 289 | picker.widget.removeClass('pull-right'); 290 | } 291 | 292 | picker.widget.css({ 293 | position: position, 294 | top: offset.top, 295 | left: offset.left, 296 | right: offset.right 297 | }); 298 | }, 299 | 300 | notifyChange = function (oldDate, eventType) { 301 | if (pMoment(picker.date).isSame(pMoment(oldDate))) return; 302 | picker.element.trigger({ 303 | type: 'dp.change', 304 | date: pMoment(picker.date), 305 | oldDate: pMoment(oldDate) 306 | }); 307 | 308 | if (eventType !== 'change') 309 | picker.element.change(); 310 | }, 311 | 312 | notifyError = function (date) { 313 | picker.element.trigger({ 314 | type: 'dp.error', 315 | date: pMoment(date) 316 | }); 317 | }, 318 | 319 | update = function (newDate) { 320 | pMoment.lang(picker.options.language); 321 | var dateStr = newDate; 322 | if (!dateStr) { 323 | dateStr = getPickerInput().val() 324 | if (dateStr) picker.date = pMoment(dateStr, picker.format, picker.options.useStrict); 325 | if (!picker.date) picker.date = pMoment(); 326 | } 327 | picker.viewDate = pMoment(picker.date).startOf("month"); 328 | fillDate(); 329 | fillTime(); 330 | }, 331 | 332 | fillDow = function () { 333 | pMoment.lang(picker.options.language); 334 | var html = $(''), weekdaysMin = pMoment.weekdaysMin(), i; 335 | if (pMoment()._lang._week.dow == 0) { // starts on Sunday 336 | for (i = 0; i < 7; i++) { 337 | html.append('' + weekdaysMin[i] + ''); 338 | } 339 | } else { 340 | for (i = 1; i < 8; i++) { 341 | if (i == 7) { 342 | html.append('' + weekdaysMin[0] + ''); 343 | } else { 344 | html.append('' + weekdaysMin[i] + ''); 345 | } 346 | } 347 | } 348 | picker.widget.find('.datepicker-days thead').append(html); 349 | }, 350 | 351 | fillMonths = function () { 352 | pMoment.lang(picker.options.language); 353 | var html = '', i = 0, monthsShort = pMoment.monthsShort(); 354 | while (i < 12) { 355 | html += '' + monthsShort[i++] + ''; 356 | } 357 | picker.widget.find('.datepicker-months td').append(html); 358 | }, 359 | 360 | fillDate = function () { 361 | pMoment.lang(picker.options.language); 362 | var year = picker.viewDate.year(), 363 | month = picker.viewDate.month(), 364 | startYear = picker.options.minDate.year(), 365 | startMonth = picker.options.minDate.month(), 366 | endYear = picker.options.maxDate.year(), 367 | endMonth = picker.options.maxDate.month(), 368 | prevMonth, nextMonth, html = [], row, clsName, i, days, yearCont, currentYear, months = pMoment.months(); 369 | 370 | picker.widget.find('.datepicker-days').find('.disabled').removeClass('disabled'); 371 | picker.widget.find('.datepicker-months').find('.disabled').removeClass('disabled'); 372 | picker.widget.find('.datepicker-years').find('.disabled').removeClass('disabled'); 373 | 374 | picker.widget.find('.datepicker-days th:eq(1)').text( 375 | months[month] + ' ' + year); 376 | 377 | prevMonth = pMoment(picker.viewDate).subtract("months", 1); 378 | days = prevMonth.daysInMonth(); 379 | prevMonth.date(days).startOf('week'); 380 | if ((year == startYear && month <= startMonth) || year < startYear) { 381 | picker.widget.find('.datepicker-days th:eq(0)').addClass('disabled'); 382 | } 383 | if ((year == endYear && month >= endMonth) || year > endYear) { 384 | picker.widget.find('.datepicker-days th:eq(2)').addClass('disabled'); 385 | } 386 | 387 | nextMonth = pMoment(prevMonth).add(42, "d"); 388 | while (prevMonth.isBefore(nextMonth)) { 389 | if (prevMonth.weekday() === pMoment().startOf('week').weekday()) { 390 | row = $(''); 391 | html.push(row); 392 | } 393 | clsName = ''; 394 | if (prevMonth.year() < year || (prevMonth.year() == year && prevMonth.month() < month)) { 395 | clsName += ' old'; 396 | } else if (prevMonth.year() > year || (prevMonth.year() == year && prevMonth.month() > month)) { 397 | clsName += ' new'; 398 | } 399 | if (prevMonth.isSame(pMoment({ y: picker.date.year(), M: picker.date.month(), d: picker.date.date() }))) { 400 | clsName += ' active'; 401 | } 402 | if (isInDisableDates(prevMonth) || !isInEnableDates(prevMonth)) { 403 | clsName += ' enable'; 404 | } 405 | if (picker.options.showToday === true) { 406 | if (prevMonth.isSame(pMoment(), 'day')) { 407 | clsName += ' today'; 408 | } 409 | } 410 | if (picker.options.daysOfWeekDisabled) { 411 | for (i in picker.options.daysOfWeekDisabled) { 412 | if (prevMonth.day() == picker.options.daysOfWeekDisabled[i]) { 413 | clsName += ' disabled'; 414 | break; 415 | } 416 | } 417 | } 418 | 419 | row.append('' + prevMonth.date() + ''); 420 | prevMonth.add(1, "d"); 421 | } 422 | picker.widget.find('.datepicker-days tbody').empty().append(html); 423 | currentYear = picker.date.year(), months = picker.widget.find('.datepicker-months') 424 | .find('th:eq(1)').text(year).end().find('span').removeClass('active'); 425 | if (currentYear === year) { 426 | months.eq(picker.date.month()).addClass('active'); 427 | } 428 | if (currentYear - 1 < startYear) { 429 | picker.widget.find('.datepicker-months th:eq(0)').addClass('disabled'); 430 | } 431 | if (currentYear + 1 > endYear) { 432 | picker.widget.find('.datepicker-months th:eq(2)').addClass('disabled'); 433 | } 434 | for (i = 0; i < 12; i++) { 435 | if ((year == startYear && startMonth > i) || (year < startYear)) { 436 | $(months[i]).addClass('disabled'); 437 | } else if ((year == endYear && endMonth < i) || (year > endYear)) { 438 | $(months[i]).addClass('disabled'); 439 | } 440 | } 441 | 442 | html = ''; 443 | year = parseInt(year / 10, 10) * 10; 444 | yearCont = picker.widget.find('.datepicker-years').find( 445 | 'th:eq(1)').text(year + '-' + (year + 9)).end().find('td'); 446 | picker.widget.find('.datepicker-years').find('th').removeClass('disabled'); 447 | if (startYear > year) { 448 | picker.widget.find('.datepicker-years').find('th:eq(0)').addClass('disabled'); 449 | } 450 | if (endYear < year + 9) { 451 | picker.widget.find('.datepicker-years').find('th:eq(2)').addClass('disabled'); 452 | } 453 | year -= 1; 454 | for (i = -1; i < 11; i++) { 455 | html += '' + year + ''; 456 | year += 1; 457 | } 458 | yearCont.html(html); 459 | }, 460 | 461 | fillHours = function () { 462 | pMoment.lang(picker.options.language); 463 | var table = picker.widget.find('.timepicker .timepicker-hours table'), html = '', current, i, j; 464 | table.parent().hide(); 465 | if (picker.use24hours) { 466 | current = 0; 467 | for (i = 0; i < 6; i += 1) { 468 | html += ''; 469 | for (j = 0; j < 4; j += 1) { 470 | html += '' + padLeft(current.toString()) + ''; 471 | current++; 472 | } 473 | html += ''; 474 | } 475 | } 476 | else { 477 | current = 1; 478 | for (i = 0; i < 3; i += 1) { 479 | html += ''; 480 | for (j = 0; j < 4; j += 1) { 481 | html += '' + padLeft(current.toString()) + ''; 482 | current++; 483 | } 484 | html += ''; 485 | } 486 | } 487 | table.html(html); 488 | }, 489 | 490 | fillMinutes = function () { 491 | var table = picker.widget.find('.timepicker .timepicker-minutes table'), html = '', current = 0, i, j, step = picker.options.minuteStepping; 492 | table.parent().hide(); 493 | if (step = 1) step = 5; 494 | for (i = 0; i < Math.ceil(60 / step / 4) ; i++) { 495 | html += ''; 496 | for (j = 0; j < 4; j += 1) { 497 | if (current < 60) { 498 | html += '' + padLeft(current.toString()) + ''; 499 | current += step; 500 | } else { 501 | html += ''; 502 | } 503 | } 504 | html += ''; 505 | } 506 | table.html(html); 507 | }, 508 | 509 | fillSeconds = function () { 510 | var table = picker.widget.find('.timepicker .timepicker-seconds table'), html = '', current = 0, i, j; 511 | table.parent().hide(); 512 | for (i = 0; i < 3; i++) { 513 | html += ''; 514 | for (j = 0; j < 4; j += 1) { 515 | html += '' + padLeft(current.toString()) + ''; 516 | current += 5; 517 | } 518 | html += ''; 519 | } 520 | table.html(html); 521 | }, 522 | 523 | fillTime = function () { 524 | if (!picker.date) return; 525 | var timeComponents = picker.widget.find('.timepicker span[data-time-component]'), 526 | hour = picker.date.hours(), 527 | period = 'AM'; 528 | if (!picker.use24hours) { 529 | if (hour >= 12) period = 'PM'; 530 | if (hour === 0) hour = 12; 531 | else if (hour != 12) hour = hour % 12; 532 | picker.widget.find('.timepicker [data-action=togglePeriod]').text(period); 533 | } 534 | timeComponents.filter('[data-time-component=hours]').text(padLeft(hour)); 535 | timeComponents.filter('[data-time-component=minutes]').text(padLeft(picker.date.minutes())); 536 | timeComponents.filter('[data-time-component=seconds]').text(padLeft(picker.date.second())); 537 | }, 538 | 539 | click = function (e) { 540 | e.stopPropagation(); 541 | e.preventDefault(); 542 | picker.unset = false; 543 | var target = $(e.target).closest('span, td, th'), month, year, step, day, oldDate = pMoment(picker.date); 544 | if (target.length === 1) { 545 | if (!target.is('.disabled')) { 546 | switch (target[0].nodeName.toLowerCase()) { 547 | case 'th': 548 | switch (target[0].className) { 549 | case 'switch': 550 | showMode(1); 551 | break; 552 | case 'prev': 553 | case 'next': 554 | step = dpGlobal.modes[picker.viewMode].navStep; 555 | if (target[0].className === 'prev') step = step * -1; 556 | picker.viewDate.add(step, dpGlobal.modes[picker.viewMode].navFnc); 557 | fillDate(); 558 | break; 559 | } 560 | break; 561 | case 'span': 562 | if (target.is('.month')) { 563 | month = target.parent().find('span').index(target); 564 | picker.viewDate.month(month); 565 | } else { 566 | year = parseInt(target.text(), 10) || 0; 567 | picker.viewDate.year(year); 568 | } 569 | if (picker.viewMode === picker.minViewMode) { 570 | picker.date = pMoment({ 571 | y: picker.viewDate.year(), 572 | M: picker.viewDate.month(), 573 | d: picker.viewDate.date(), 574 | h: picker.date.hours(), 575 | m: picker.date.minutes(), 576 | s: picker.date.seconds() 577 | }); 578 | notifyChange(oldDate, e.type); 579 | set(); 580 | } 581 | showMode(-1); 582 | fillDate(); 583 | break; 584 | case 'td': 585 | if (target.is('.day')) { 586 | day = parseInt(target.text(), 10) || 1; 587 | month = picker.viewDate.month(); 588 | year = picker.viewDate.year(); 589 | if (target.is('.old')) { 590 | if (month === 0) { 591 | month = 11; 592 | year -= 1; 593 | } else { 594 | month -= 1; 595 | } 596 | } else if (target.is('.new')) { 597 | if (month == 11) { 598 | month = 0; 599 | year += 1; 600 | } else { 601 | month += 1; 602 | } 603 | } 604 | picker.date = pMoment({ 605 | y: year, 606 | M: month, 607 | d: day, 608 | h: picker.date.hours(), 609 | m: picker.date.minutes(), 610 | s: picker.date.seconds() 611 | } 612 | ); 613 | picker.viewDate = pMoment({ 614 | y: year, M: month, d: Math.min(28, day) 615 | }); 616 | fillDate(); 617 | set(); 618 | notifyChange(oldDate, e.type); 619 | } 620 | break; 621 | } 622 | } 623 | } 624 | }, 625 | 626 | actions = { 627 | incrementHours: function () { 628 | checkDate("add", "hours", 1); 629 | }, 630 | 631 | incrementMinutes: function () { 632 | checkDate("add", "minutes", picker.options.minuteStepping); 633 | }, 634 | 635 | incrementSeconds: function () { 636 | checkDate("add", "seconds", 1); 637 | }, 638 | 639 | decrementHours: function () { 640 | checkDate("subtract", "hours", 1); 641 | }, 642 | 643 | decrementMinutes: function () { 644 | checkDate("subtract", "minutes", picker.options.minuteStepping); 645 | }, 646 | 647 | decrementSeconds: function () { 648 | checkDate("subtract", "seconds", 1); 649 | }, 650 | 651 | togglePeriod: function () { 652 | var hour = picker.date.hours(); 653 | if (hour >= 12) hour -= 12; 654 | else hour += 12; 655 | picker.date.hours(hour); 656 | }, 657 | 658 | showPicker: function () { 659 | picker.widget.find('.timepicker > div:not(.timepicker-picker)').hide(); 660 | picker.widget.find('.timepicker .timepicker-picker').show(); 661 | }, 662 | 663 | showHours: function () { 664 | picker.widget.find('.timepicker .timepicker-picker').hide(); 665 | picker.widget.find('.timepicker .timepicker-hours').show(); 666 | }, 667 | 668 | showMinutes: function () { 669 | picker.widget.find('.timepicker .timepicker-picker').hide(); 670 | picker.widget.find('.timepicker .timepicker-minutes').show(); 671 | }, 672 | 673 | showSeconds: function () { 674 | picker.widget.find('.timepicker .timepicker-picker').hide(); 675 | picker.widget.find('.timepicker .timepicker-seconds').show(); 676 | }, 677 | 678 | selectHour: function (e) { 679 | var period = picker.widget.find('.timepicker [data-action=togglePeriod]').text(), hour = parseInt($(e.target).text(), 10); 680 | if (period == "PM") hour += 12 681 | picker.date.hours(hour); 682 | actions.showPicker.call(picker); 683 | }, 684 | 685 | selectMinute: function (e) { 686 | picker.date.minutes(parseInt($(e.target).text(), 10)); 687 | actions.showPicker.call(picker); 688 | }, 689 | 690 | selectSecond: function (e) { 691 | picker.date.seconds(parseInt($(e.target).text(), 10)); 692 | actions.showPicker.call(picker); 693 | } 694 | }, 695 | 696 | doAction = function (e) { 697 | var oldDate = pMoment(picker.date), action = $(e.currentTarget).data('action'), rv = actions[action].apply(picker, arguments); 698 | stopEvent(e); 699 | if (!picker.date) picker.date = pMoment({ y: 1970 }); 700 | set(); 701 | fillTime(); 702 | notifyChange(oldDate, e.type); 703 | return rv; 704 | }, 705 | 706 | stopEvent = function (e) { 707 | e.stopPropagation(); 708 | e.preventDefault(); 709 | }, 710 | 711 | change = function (e) { 712 | pMoment.lang(picker.options.language); 713 | var input = $(e.target), oldDate = pMoment(picker.date), newDate = pMoment(input.val(), picker.format, picker.options.useStrict); 714 | if (newDate.isValid() && !isInDisableDates(newDate) && isInEnableDates(newDate)) { 715 | update(); 716 | picker.setValue(newDate); 717 | notifyChange(oldDate, e.type); 718 | set(); 719 | } 720 | else { 721 | picker.viewDate = oldDate; 722 | notifyChange(oldDate, e.type); 723 | notifyError(newDate); 724 | picker.unset = true; 725 | } 726 | }, 727 | 728 | showMode = function (dir) { 729 | if (dir) { 730 | picker.viewMode = Math.max(picker.minViewMode, Math.min(2, picker.viewMode + dir)); 731 | } 732 | var f = dpGlobal.modes[picker.viewMode].clsName; 733 | picker.widget.find('.datepicker > div').hide().filter('.datepicker-' + dpGlobal.modes[picker.viewMode].clsName).show(); 734 | }, 735 | 736 | attachDatePickerEvents = function () { 737 | var $this, $parent, expanded, closed, collapseData; 738 | picker.widget.on('click', '.datepicker *', $.proxy(click, this)); // this handles date picker clicks 739 | picker.widget.on('click', '[data-action]', $.proxy(doAction, this)); // this handles time picker clicks 740 | picker.widget.on('mousedown', $.proxy(stopEvent, this)); 741 | if (picker.options.pickDate && picker.options.pickTime) { 742 | picker.widget.on('click.togglePicker', '.accordion-toggle', function (e) { 743 | e.stopPropagation(); 744 | $this = $(this); 745 | $parent = $this.closest('ul'); 746 | expanded = $parent.find('.in'); 747 | closed = $parent.find('.collapse:not(.in)'); 748 | 749 | if (expanded && expanded.length) { 750 | collapseData = expanded.data('collapse'); 751 | if (collapseData && collapseData.date - transitioning) return; 752 | expanded.collapse('hide'); 753 | closed.collapse('show'); 754 | $this.find('span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date); 755 | picker.element.find('.input-group-addon span').toggleClass(picker.options.icons.time + ' ' + picker.options.icons.date); 756 | } 757 | }); 758 | } 759 | if (picker.isInput) { 760 | picker.element.on({ 761 | 'focus': $.proxy(picker.show, this), 762 | 'change': $.proxy(change, this), 763 | 'blur': $.proxy(picker.hide, this) 764 | }); 765 | } else { 766 | picker.element.on({ 767 | 'change': $.proxy(change, this) 768 | }, 'input'); 769 | if (picker.component) { 770 | picker.component.on('click', $.proxy(picker.show, this)); 771 | } else { 772 | picker.element.on('click', $.proxy(picker.show, this)); 773 | } 774 | } 775 | }, 776 | 777 | attachDatePickerGlobalEvents = function () { 778 | $(window).on( 779 | 'resize.datetimepicker' + picker.id, $.proxy(place, this)); 780 | if (!picker.isInput) { 781 | $(document).on( 782 | 'mousedown.datetimepicker' + picker.id, $.proxy(picker.hide, this)); 783 | } 784 | }, 785 | 786 | detachDatePickerEvents = function () { 787 | picker.widget.off('click', '.datepicker *', picker.click); 788 | picker.widget.off('click', '[data-action]'); 789 | picker.widget.off('mousedown', picker.stopEvent); 790 | if (picker.options.pickDate && picker.options.pickTime) { 791 | picker.widget.off('click.togglePicker'); 792 | } 793 | if (picker.isInput) { 794 | picker.element.off({ 795 | 'focus': picker.show, 796 | 'change': picker.change 797 | }); 798 | } else { 799 | picker.element.off({ 800 | 'change': picker.change 801 | }, 'input'); 802 | if (picker.component) { 803 | picker.component.off('click', picker.show); 804 | } else { 805 | picker.element.off('click', picker.show); 806 | } 807 | } 808 | }, 809 | 810 | detachDatePickerGlobalEvents = function () { 811 | $(window).off('resize.datetimepicker' + picker.id); 812 | if (!picker.isInput) { 813 | $(document).off('mousedown.datetimepicker' + picker.id); 814 | } 815 | }, 816 | 817 | isInFixed = function () { 818 | if (picker.element) { 819 | var parents = picker.element.parents(), inFixed = false, i; 820 | for (i = 0; i < parents.length; i++) { 821 | if ($(parents[i]).css('position') == 'fixed') { 822 | inFixed = true; 823 | break; 824 | } 825 | } 826 | ; 827 | return inFixed; 828 | } else { 829 | return false; 830 | } 831 | }, 832 | 833 | set = function () { 834 | pMoment.lang(picker.options.language); 835 | var formatted = '', input; 836 | if (!picker.unset) formatted = pMoment(picker.date).format(picker.format); 837 | getPickerInput().val(formatted); 838 | picker.element.data('date', formatted); 839 | if (!picker.options.pickTime) picker.hide(); 840 | }, 841 | 842 | checkDate = function (direction, unit, amount) { 843 | pMoment.lang(picker.options.language); 844 | var newDate; 845 | if (direction == "add") { 846 | newDate = pMoment(picker.date); 847 | if (newDate.hours() == 23) newDate.add(amount, unit); 848 | newDate.add(amount, unit); 849 | } 850 | else { 851 | newDate = pMoment(picker.date).subtract(amount, unit); 852 | } 853 | if (isInDisableDates(pMoment(newDate.subtract(amount, unit))) || isInDisableDates(newDate)) { 854 | notifyError(newDate.format(picker.format)); 855 | return; 856 | } 857 | 858 | if (direction == "add") { 859 | picker.date.add(amount, unit); 860 | } 861 | else { 862 | picker.date.subtract(amount, unit); 863 | } 864 | picker.unset = false; 865 | }, 866 | 867 | isInDisableDates = function (date) { 868 | pMoment.lang(picker.options.language); 869 | if (date.isAfter(picker.options.maxDate) || date.isBefore(picker.options.minDate)) return true; 870 | if (picker.options.disabledDates === false) { 871 | return false; 872 | } 873 | return picker.options.disabledDates[pMoment(date).format("YYYY-MM-DD")] === true; 874 | }, 875 | isInEnableDates = function (date) { 876 | pMoment.lang(picker.options.language); 877 | if (picker.options.enabledDates === false) { 878 | return true; 879 | } 880 | return picker.options.enabledDates[pMoment(date).format("YYYY-MM-DD")] === true; 881 | }, 882 | 883 | indexGivenDates = function (givenDatesArray) { 884 | // Store given enabledDates and disabledDates as keys. 885 | // This way we can check their existence in O(1) time instead of looping through whole array. 886 | // (for example: picker.options.enabledDates['2014-02-27'] === true) 887 | var givenDatesIndexed = {}; 888 | var givenDatesCount = 0; 889 | for (i = 0; i < givenDatesArray.length; i++) { 890 | dDate = pMoment(givenDatesArray[i]); 891 | if (dDate.isValid()) { 892 | givenDatesIndexed[dDate.format("YYYY-MM-DD")] = true; 893 | givenDatesCount++; 894 | } 895 | } 896 | if (givenDatesCount > 0) { 897 | return givenDatesIndexed; 898 | } 899 | return false; 900 | }, 901 | 902 | padLeft = function (string) { 903 | string = string.toString(); 904 | if (string.length >= 2) return string; 905 | else return '0' + string; 906 | }, 907 | 908 | getTemplate = function () { 909 | if (picker.options.pickDate && picker.options.pickTime) { 910 | var ret = ''; 911 | ret = ''; 929 | return ret; 930 | } else if (picker.options.pickTime) { 931 | return ( 932 | '' 935 | ); 936 | } else { 937 | return ( 938 | '' 941 | ); 942 | } 943 | }, 944 | 945 | dpGlobal = { 946 | modes: [ 947 | { 948 | clsName: 'days', 949 | navFnc: 'month', 950 | navStep: 1 951 | }, 952 | { 953 | clsName: 'months', 954 | navFnc: 'year', 955 | navStep: 1 956 | }, 957 | { 958 | clsName: 'years', 959 | navFnc: 'year', 960 | navStep: 10 961 | }], 962 | headTemplate: 963 | '' + 964 | '' + 965 | '‹›' + 966 | '' + 967 | '', 968 | contTemplate: 969 | '' 970 | }, 971 | 972 | tpGlobal = { 973 | hourTemplate: '', 974 | minuteTemplate: '', 975 | secondTemplate: '' 976 | }; 977 | 978 | dpGlobal.template = 979 | '
' + 980 | '' + dpGlobal.headTemplate + '
' + 981 | '
' + 982 | '
' + 983 | '' + dpGlobal.headTemplate + dpGlobal.contTemplate + '
' + 984 | '
' + 985 | '
' + 986 | '' + dpGlobal.headTemplate + dpGlobal.contTemplate + '
' + 987 | '
'; 988 | 989 | tpGlobal.getTemplate = function () { 990 | return ( 991 | '
' + 992 | '' + 993 | '' + 994 | '' + 995 | '' + 996 | '' + 997 | (picker.options.useSeconds ? 998 | '' : '') + 999 | (picker.use24hours ? '' : '') + 1000 | '' + 1001 | '' + 1002 | ' ' + 1003 | '' + 1004 | ' ' + 1005 | (picker.options.useSeconds ? 1006 | '' : '') + 1007 | (picker.use24hours ? '' : '' + 1008 | '') + 1009 | '' + 1010 | '' + 1011 | '' + 1012 | '' + 1013 | '' + 1014 | (picker.options.useSeconds ? 1015 | '' : '') + 1016 | (picker.use24hours ? '' : '') + 1017 | '' + 1018 | '
' + (picker.options.useMinutes ? '' : '') + '
' + tpGlobal.hourTemplate + ':' + (picker.options.useMinutes ? tpGlobal.minuteTemplate : '00') + ':' + tpGlobal.secondTemplate + '
' + (picker.options.useMinutes ? '' : '') + '
' + 1019 | '
' + 1020 | '
' + 1021 | '
' + 1022 | '
' + 1023 | '
' + 1024 | '
' + 1025 | '
' + 1026 | (picker.options.useSeconds ? 1027 | '
' : '') 1028 | ); 1029 | }; 1030 | 1031 | picker.destroy = function () { 1032 | detachDatePickerEvents(); 1033 | detachDatePickerGlobalEvents(); 1034 | picker.widget.remove(); 1035 | picker.element.removeData('DateTimePicker'); 1036 | if (picker.component) 1037 | picker.component.removeData('DateTimePicker'); 1038 | }; 1039 | 1040 | picker.show = function (e) { 1041 | if (picker.options.useCurrent === true) { 1042 | if (getPickerInput().val() == '') { 1043 | picker.setValue(pMoment().format(picker.format)) 1044 | }; 1045 | } 1046 | picker.widget.show(); 1047 | picker.height = picker.component ? picker.component.outerHeight() : picker.element.outerHeight(); 1048 | place(); 1049 | picker.element.trigger({ 1050 | type: 'dp.show', 1051 | date: pMoment(picker.date) 1052 | }); 1053 | attachDatePickerGlobalEvents(); 1054 | if (e) { 1055 | stopEvent(e); 1056 | } 1057 | }, 1058 | 1059 | picker.disable = function () { 1060 | var input = picker.element.find('input'); 1061 | if (input.prop('disabled')) return; 1062 | 1063 | input.prop('disabled', true); 1064 | detachDatePickerEvents(); 1065 | }, 1066 | 1067 | picker.enable = function () { 1068 | var input = picker.element.find('input'); 1069 | if (!input.prop('disabled')) return; 1070 | 1071 | input.prop('disabled', false); 1072 | attachDatePickerEvents(); 1073 | }, 1074 | 1075 | picker.hide = function (event) { 1076 | if (event && $(event.target).is(picker.element.attr("id"))) 1077 | return; 1078 | // Ignore event if in the middle of a picker transition 1079 | var collapse = picker.widget.find('.collapse'), i, collapseData; 1080 | for (i = 0; i < collapse.length; i++) { 1081 | collapseData = collapse.eq(i).data('collapse'); 1082 | if (collapseData && collapseData.date - transitioning) 1083 | return; 1084 | } 1085 | picker.widget.hide(); 1086 | picker.viewMode = picker.startViewMode; 1087 | showMode(); 1088 | picker.element.trigger({ 1089 | type: 'dp.hide', 1090 | date: pMoment(picker.date) 1091 | }); 1092 | detachDatePickerGlobalEvents(); 1093 | }, 1094 | 1095 | picker.setValue = function (newDate) { 1096 | pMoment.lang(picker.options.language); 1097 | if (!newDate) { 1098 | picker.unset = true; 1099 | set(); 1100 | } else { 1101 | picker.unset = false; 1102 | } 1103 | if (!pMoment.isMoment(newDate)) newDate = pMoment(newDate); 1104 | if (newDate.isValid()) { 1105 | picker.date = newDate; 1106 | set(); 1107 | picker.viewDate = pMoment({ y: picker.date.year(), M: picker.date.month() }); 1108 | fillDate(); 1109 | fillTime(); 1110 | } 1111 | else { 1112 | notifyError(newDate); 1113 | } 1114 | }, 1115 | 1116 | picker.getDate = function () { 1117 | if (picker.unset) return null; 1118 | return picker.date; 1119 | }, 1120 | 1121 | picker.setDate = function (date) { 1122 | var oldDate = pMoment(picker.date); 1123 | if (!date) { 1124 | picker.setValue(null); 1125 | } else { 1126 | picker.setValue(date); 1127 | } 1128 | notifyChange(oldDate, "function"); 1129 | }, 1130 | 1131 | picker.setDisabledDates = function (dates) { 1132 | picker.options.disabledDates = indexGivenDates(dates); 1133 | if (picker.viewDate) update(); 1134 | }, 1135 | picker.setEnabledDates = function (dates) { 1136 | picker.options.enabledDates = indexGivenDates(dates); 1137 | if (picker.viewDate) update(); 1138 | }, 1139 | 1140 | picker.setMaxDate = function (date) { 1141 | if (date == undefined) return; 1142 | picker.options.maxDate = pMoment(date); 1143 | if (picker.viewDate) update(); 1144 | }, 1145 | 1146 | picker.setMinDate = function (date) { 1147 | if (date == undefined) return; 1148 | picker.options.minDate = pMoment(date); 1149 | if (picker.viewDate) update(); 1150 | }; 1151 | 1152 | init(); 1153 | }; 1154 | 1155 | $.fn.datetimepicker = function (options) { 1156 | return this.each(function () { 1157 | var $this = $(this), data = $this.data('DateTimePicker'); 1158 | if (!data) $this.data('DateTimePicker', new DateTimePicker(this, options)); 1159 | }); 1160 | }; 1161 | })); 1162 | -------------------------------------------------------------------------------- /js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.1.1 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); -------------------------------------------------------------------------------- /js/calendar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bootstrap based calendar full view. 3 | * 4 | * https://github.com/Serhioromano/bootstrap-calendar 5 | * 6 | * User: Sergey Romanov 7 | */ 8 | "use strict"; 9 | 10 | Date.prototype.getWeek = function() { 11 | var onejan = new Date(this.getFullYear(), 0, 1); 12 | return Math.ceil((((this.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7); 13 | }; 14 | Date.prototype.getMonthFormatted = function() { 15 | var month = this.getMonth() + 1; 16 | return month < 10 ? '0' + month : month; 17 | }; 18 | Date.prototype.getDateFormatted = function() { 19 | var date = this.getDate(); 20 | return date < 10 ? '0' + date : date; 21 | }; 22 | if(!String.prototype.format) { 23 | String.prototype.format = function() { 24 | var args = arguments; 25 | return this.replace(/{(\d+)}/g, function(match, number) { 26 | return typeof args[number] != 'undefined' ? args[number] : match; 27 | }); 28 | }; 29 | } 30 | if(!String.prototype.formatNum) { 31 | String.prototype.formatNum = function(decimal) { 32 | var r = "" + this; 33 | while(r.length < decimal) 34 | r = "0" + r; 35 | return r; 36 | }; 37 | } 38 | 39 | (function($) { 40 | 41 | var defaults = { 42 | // Width of the calendar 43 | width: '100%', 44 | // Initial view (can be 'month', 'week', 'day') 45 | view: 'month', 46 | // Initial date. No matter month, week or day this will be a starting point. Can be 'now' or a date in format 'yyyy-mm-dd' 47 | day: 'now', 48 | // Day Start time and end time with time intervals. Time split 10, 15 or 30. 49 | time_start: '06:00', 50 | time_end: '22:00', 51 | time_split: '30', 52 | // Source of events data. It can be one of the following: 53 | // - URL to return JSON list of events in special format. 54 | // {success:1, result: [....]} or for error {success:0, error:'Something terrible happened'} 55 | // events: [...] as described in events property description 56 | // The start and end variables will be sent to this url 57 | // - A function that received the start and end date, and that 58 | // returns an array of events (as described in events property description) 59 | // - An array containing the events 60 | events_source: '', 61 | // Path to templates should end with slash /. It can be as relative 62 | // /component/bootstrap-calendar/tmpls/ 63 | // or absolute 64 | // http://localhost/component/bootstrap-calendar/tmpls/ 65 | tmpl_path: 'tmpls/', 66 | tmpl_cache: true, 67 | classes: { 68 | months: { 69 | inmonth: 'cal-day-inmonth', 70 | outmonth: 'cal-day-outmonth', 71 | saturday: 'cal-day-weekend', 72 | sunday: 'cal-day-weekend', 73 | holidays: 'cal-day-holiday', 74 | today: 'cal-day-today' 75 | }, 76 | week: { 77 | workday: 'cal-day-workday', 78 | saturday: 'cal-day-weekend', 79 | sunday: 'cal-day-weekend', 80 | holidays: 'cal-day-holiday', 81 | today: 'cal-day-today' 82 | } 83 | }, 84 | // ID of the element of modal window. If set, events URLs will be opened in modal windows. 85 | modal: null, 86 | // modal handling setting, one of "iframe", "ajax" or "template" 87 | modal_type: "iframe", 88 | // function to set modal title, will be passed the event as a parameter 89 | modal_title: null, 90 | views: { 91 | year: { 92 | slide_events: 1, 93 | enable: 1 94 | }, 95 | month: { 96 | slide_events: 1, 97 | enable: 1 98 | }, 99 | week: { 100 | enable: 1 101 | }, 102 | day: { 103 | enable: 1 104 | } 105 | }, 106 | merge_holidays: false, 107 | // ------------------------------------------------------------ 108 | // CALLBACKS. Events triggered by calendar class. You can use 109 | // those to affect you UI 110 | // ------------------------------------------------------------ 111 | onAfterEventsLoad: function(events) { 112 | // Inside this function 'this' is the calendar instance 113 | }, 114 | onBeforeEventsLoad: function(next) { 115 | // Inside this function 'this' is the calendar instance 116 | next(); 117 | }, 118 | onAfterViewLoad: function(view) { 119 | // Inside this function 'this' is the calendar instance 120 | }, 121 | // ------------------------------------------------------------- 122 | // INTERNAL USE ONLY. DO NOT ASSIGN IT WILL BE OVERRIDDEN ANYWAY 123 | // ------------------------------------------------------------- 124 | events: [], 125 | templates: { 126 | year: '', 127 | month: '', 128 | week: '', 129 | day: '' 130 | }, 131 | stop_cycling: false 132 | }; 133 | 134 | var defaults_extended = { 135 | first_day: 2, 136 | holidays: { 137 | // January 1 138 | '01-01': "New Year's Day", 139 | // Third (+3*) Monday (1) in January (01) 140 | '01+3*1': "Birthday of Dr. Martin Luther King, Jr.", 141 | // Third (+3*) Monday (1) in February (02) 142 | '02+3*1': "Washington's Birthday", 143 | // Last (-1*) Monday (1) in May (05) 144 | '05-1*1': "Memorial Day", 145 | // July 4 146 | '04-07': "Independence Day", 147 | // First (+1*) Monday (1) in September (09) 148 | '09+1*1': "Labor Day", 149 | // Second (+2*) Monday (1) in October (10) 150 | '10+2*1': "Columbus Day", 151 | // November 11 152 | '11-11': "Veterans Day", 153 | // Fourth (+4*) Thursday (4) in November (11) 154 | '11+4*4': "Thanksgiving Day", 155 | // December 25 156 | '25-12': "Christmas" 157 | } 158 | }; 159 | 160 | var strings = { 161 | error_noview: 'Calendar: View {0} not found', 162 | error_dateformat: 'Calendar: Wrong date format {0}. Should be either "now" or "yyyy-mm-dd"', 163 | error_loadurl: 'Calendar: Event URL is not set', 164 | error_where: 'Calendar: Wrong navigation direction {0}. Can be only "next" or "prev" or "today"', 165 | error_timedevide: 'Calendar: Time split parameter should divide 60 without decimals. Something like 10, 15, 30', 166 | 167 | no_events_in_day: 'No events in this day.', 168 | 169 | title_year: '{0}', 170 | title_month: '{0} {1}', 171 | title_week: 'week {0} of {1}', 172 | title_day: '{0} {1} {2}, {3}', 173 | 174 | week: 'Week {0}', 175 | all_day: 'All day', 176 | time: 'Time', 177 | events: 'Events', 178 | before_time: 'Ends before timeline', 179 | after_time: 'Starts after timeline', 180 | 181 | 182 | m0: 'January', 183 | m1: 'February', 184 | m2: 'March', 185 | m3: 'April', 186 | m4: 'May', 187 | m5: 'June', 188 | m6: 'July', 189 | m7: 'August', 190 | m8: 'September', 191 | m9: 'October', 192 | m10: 'November', 193 | m11: 'December', 194 | 195 | ms0: 'Jan', 196 | ms1: 'Feb', 197 | ms2: 'Mar', 198 | ms3: 'Apr', 199 | ms4: 'May', 200 | ms5: 'Jun', 201 | ms6: 'Jul', 202 | ms7: 'Aug', 203 | ms8: 'Sep', 204 | ms9: 'Oct', 205 | ms10: 'Nov', 206 | ms11: 'Dec', 207 | 208 | d0: 'Sunday', 209 | d1: 'Monday', 210 | d2: 'Tuesday', 211 | d3: 'Wednesday', 212 | d4: 'Thursday', 213 | d5: 'Friday', 214 | d6: 'Saturday' 215 | }; 216 | 217 | var browser_timezone = ''; 218 | try { 219 | if($.type(window.jstz) == 'object' && $.type(jstz.determine) == 'function') { 220 | browser_timezone = jstz.determine().name(); 221 | if($.type(browser_timezone) !== 'string') { 222 | browser_timezone = ''; 223 | } 224 | } 225 | } 226 | catch(e) { 227 | } 228 | 229 | function buildEventsUrl(events_url, data) { 230 | var separator, key, url; 231 | url = events_url; 232 | separator = (events_url.indexOf('?') < 0) ? '?' : '&'; 233 | for(key in data) { 234 | url += separator + key + '=' + encodeURIComponent(data[key]); 235 | separator = '&'; 236 | } 237 | return url; 238 | } 239 | 240 | function getExtentedOption(cal, option_name) { 241 | var fromOptions = (cal.options[option_name] != null) ? cal.options[option_name] : null; 242 | var fromLanguage = (cal.locale[option_name] != null) ? cal.locale[option_name] : null; 243 | if((option_name == 'holidays') && cal.options.merge_holidays) { 244 | var holidays = {}; 245 | $.extend(true, holidays, fromLanguage ? fromLanguage : defaults_extended.holidays); 246 | if(fromOptions) { 247 | $.extend(true, holidays, fromOptions); 248 | } 249 | return holidays; 250 | } 251 | else { 252 | if(fromOptions != null) { 253 | return fromOptions; 254 | } 255 | if(fromLanguage != null) { 256 | return fromLanguage; 257 | } 258 | return defaults_extended[option_name]; 259 | } 260 | } 261 | 262 | function getHolidays(cal, year) { 263 | var hash = []; 264 | var holidays_def = getExtentedOption(cal, 'holidays'); 265 | for(var k in holidays_def) { 266 | hash.push(k + ':' + holidays_def[k]); 267 | } 268 | hash.push(year); 269 | hash = hash.join('|'); 270 | if(hash in getHolidays.cache) { 271 | return getHolidays.cache[hash]; 272 | } 273 | var holidays = []; 274 | $.each(holidays_def, function(key, name) { 275 | var firstDay = null, lastDay = null, failed = false; 276 | $.each(key.split('>'), function(i, chunk) { 277 | var m, date = null; 278 | if(m = /^(\d\d)-(\d\d)$/.exec(chunk)) { 279 | date = new Date(year, parseInt(m[2], 10) - 1, parseInt(m[1], 10)); 280 | } 281 | else if(m = /^(\d\d)-(\d\d)-(\d\d\d\d)$/.exec(chunk)) { 282 | if(parseInt(m[3], 10) == year) { 283 | date = new Date(year, parseInt(m[2], 10) - 1, parseInt(m[1], 10)); 284 | } 285 | } 286 | else if(m = /^easter(([+\-])(\d+))?$/.exec(chunk)) { 287 | date = getEasterDate(year, m[1] ? parseInt(m[1], 10) : 0); 288 | } 289 | else if(m = /^(\d\d)([+\-])([1-5])\*([0-6])$/.exec(chunk)) { 290 | var month = parseInt(m[1], 10) - 1; 291 | var direction = m[2]; 292 | var offset = parseInt(m[3]); 293 | var weekday = parseInt(m[4]); 294 | switch(direction) { 295 | case '+': 296 | var d = new Date(year, month, 1 - 7); 297 | while(d.getDay() != weekday) { 298 | d = new Date(d.getFullYear(), d.getMonth(), d.getDate() + 1); 299 | } 300 | date = new Date(d.getFullYear(), d.getMonth(), d.getDate() + 7 * offset); 301 | break; 302 | case '-': 303 | var d = new Date(year, month + 1, 0 + 7); 304 | while(d.getDay() != weekday) { 305 | d = new Date(d.getFullYear(), d.getMonth(), d.getDate() - 1); 306 | } 307 | date = new Date(d.getFullYear(), d.getMonth(), d.getDate() - 7 * offset); 308 | break; 309 | } 310 | } 311 | if(!date) { 312 | warn('Unknown holiday: ' + key); 313 | failed = true; 314 | return false; 315 | } 316 | switch(i) { 317 | case 0: 318 | firstDay = date; 319 | break; 320 | case 1: 321 | if(date.getTime() <= firstDay.getTime()) { 322 | warn('Unknown holiday: ' + key); 323 | failed = true; 324 | return false; 325 | } 326 | lastDay = date; 327 | break; 328 | default: 329 | warn('Unknown holiday: ' + key); 330 | failed = true; 331 | return false; 332 | } 333 | }); 334 | if(!failed) { 335 | var days = []; 336 | if(lastDay) { 337 | for(var date = new Date(firstDay.getTime()); date.getTime() <= lastDay.getTime(); date.setDate(date.getDate() + 1)) { 338 | days.push(new Date(date.getTime())); 339 | } 340 | } 341 | else { 342 | days.push(firstDay); 343 | } 344 | holidays.push({name: name, days: days}); 345 | } 346 | }); 347 | getHolidays.cache[hash] = holidays; 348 | return getHolidays.cache[hash]; 349 | } 350 | 351 | getHolidays.cache = {}; 352 | 353 | function warn(message) { 354 | if($.type(window.console) == 'object' && $.type(window.console.warn) == 'function') { 355 | window.console.warn('[Bootstrap-Calendar] ' + message); 356 | } 357 | } 358 | 359 | function Calendar(params, context) { 360 | this.options = $.extend(true, {position: {start: new Date(), end: new Date()}}, defaults, params); 361 | this.setLanguage(this.options.language); 362 | this.context = context; 363 | 364 | context.css('width', this.options.width).addClass('cal-context'); 365 | 366 | this.view(); 367 | return this; 368 | } 369 | 370 | Calendar.prototype.setOptions = function(object) { 371 | $.extend(this.options, object); 372 | if('language' in object) { 373 | this.setLanguage(object.language); 374 | } 375 | if('modal' in object) { 376 | this._update_modal(); 377 | } 378 | } 379 | 380 | Calendar.prototype.setLanguage = function(lang) { 381 | if(window.calendar_languages && (lang in window.calendar_languages)) { 382 | this.locale = $.extend(true, {}, strings, calendar_languages[lang]); 383 | this.options.language = lang; 384 | } else { 385 | this.locale = strings; 386 | delete this.options.language; 387 | } 388 | } 389 | 390 | Calendar.prototype._render = function() { 391 | this.context.html(''); 392 | this._loadTemplate(this.options.view); 393 | this.stop_cycling = false; 394 | 395 | var data = {}; 396 | data.cal = this; 397 | data.day = 1; 398 | 399 | // Getting list of days in a week in correct order. Works for month and week views 400 | if(getExtentedOption(this, 'first_day') == 1) { 401 | data.months = [this.locale.d1, this.locale.d2, this.locale.d3, this.locale.d4, this.locale.d5, this.locale.d6, this.locale.d0] 402 | } else { 403 | data.months = [this.locale.d0, this.locale.d1, this.locale.d2, this.locale.d3, this.locale.d4, this.locale.d5, this.locale.d6] 404 | } 405 | 406 | // Get all events between start and end 407 | var start = parseInt(this.options.position.start.getTime()); 408 | var end = parseInt(this.options.position.end.getTime()); 409 | 410 | data.events = this.getEventsBetween(start, end); 411 | 412 | switch(this.options.view) { 413 | case 'month': 414 | break; 415 | case 'week': 416 | this._calculate_hour_minutes(data); 417 | break; 418 | case 'day': 419 | this._calculate_hour_minutes(data); 420 | break; 421 | } 422 | 423 | data.start = new Date(this.options.position.start.getTime()); 424 | data.lang = this.locale; 425 | 426 | this.context.append(this.options.templates[this.options.view](data)); 427 | this._update(); 428 | }; 429 | 430 | Calendar.prototype._calculate_hour_minutes = function(data) { 431 | var $self = this; 432 | data.in_hour = 60 / parseInt(this.options.time_split); 433 | data.hour_split = parseInt(this.options.time_split); 434 | 435 | if(!/^\d+$/.exec(data.in_hour) || this.options.time_split > 30) { 436 | $.error(this.locale.error_timedevide); 437 | } 438 | 439 | var time_start = this.options.time_start.split(":"); 440 | var time_end = this.options.time_end.split(":"); 441 | 442 | data.hours = (parseInt(time_end[0]) - parseInt(time_start[0])); 443 | var lines = data.hours * data.in_hour; 444 | var ms_per_line = (60000 * parseInt(this.options.time_split)); 445 | 446 | var start = new Date(this.options.position.start.getTime()); 447 | start.setHours(time_start[0]); 448 | start.setMinutes(time_start[1]); 449 | var end = new Date(this.options.position.start.getTime()); 450 | end.setHours(time_end[0]); 451 | end.setMinutes(time_end[1]); 452 | 453 | data.all_day = []; 454 | data.by_hour = []; 455 | data.after_time = []; 456 | data.before_time = []; 457 | $.each(data.events, function(k, e) { 458 | var s = new Date(parseInt(e.start)); 459 | var f = new Date(parseInt(e.end)); 460 | 461 | e.start_hour = s.getHours().toString().formatNum(2) + ':' + s.getMinutes().toString().formatNum(2); 462 | e.end_hour = f.getHours().toString().formatNum(2) + ':' + f.getMinutes().toString().formatNum(2); 463 | 464 | if(e.start < start.getTime()) { 465 | warn(1); 466 | e.start_hour = s.getDate() + ' ' + $self.locale['ms' + s.getMonth()] + ' ' + e.start_hour; 467 | } 468 | 469 | if(e.end > end.getTime()) { 470 | warn(1); 471 | e.end_hour = f.getDate() + ' ' + $self.locale['ms' + f.getMonth()] + ' ' + e.end_hour; 472 | } 473 | 474 | if(e.start < start.getTime() && e.end > end.getTime()) { 475 | data.all_day.push(e); 476 | return; 477 | } 478 | 479 | if(e.end < start.getTime()) { 480 | data.before_time.push(e); 481 | return; 482 | } 483 | 484 | if(e.start > end.getTime()) { 485 | data.after_time.push(e); 486 | return; 487 | } 488 | 489 | var event_start = start.getTime() - e.start; 490 | 491 | if(event_start >= 0) { 492 | e.top = 0; 493 | } else { 494 | e.top = Math.abs(event_start) / ms_per_line; 495 | } 496 | 497 | var lines_left = lines - e.top; 498 | var lines_in_event = (e.end - e.start) / ms_per_line; 499 | if(event_start >= 0) { 500 | lines_in_event = (e.end - start.getTime()) / ms_per_line; 501 | } 502 | 503 | 504 | e.lines = lines_in_event; 505 | if(lines_in_event > lines_left) { 506 | e.lines = lines_left; 507 | } 508 | 509 | data.by_hour.push(e); 510 | }); 511 | 512 | //var d = new Date('2013-03-14 13:20:00'); 513 | //warn(d.getTime()); 514 | }; 515 | 516 | Calendar.prototype._hour = function(hour, part) { 517 | var time_start = this.options.time_start.split(":"); 518 | 519 | var hour = "" + (parseInt(time_start[0]) + hour); 520 | var minute = "" + (this.options.time_split * part); 521 | 522 | return hour.formatNum(2) + ":" + minute.formatNum(2); 523 | } 524 | 525 | Calendar.prototype._week = function(event) { 526 | this._loadTemplate('week-days'); 527 | 528 | var t = {}; 529 | var start = parseInt(this.options.position.start.getTime()); 530 | var end = parseInt(this.options.position.end.getTime()); 531 | var events = []; 532 | var self = this; 533 | var first_day = getExtentedOption(this, 'first_day'); 534 | 535 | $.each(this.getEventsBetween(start, end), function(k, event) { 536 | event.start_day = new Date(parseInt(event.start)).getDay(); 537 | if(first_day == 1) { 538 | event.start_day = (event.start_day + 6) % 7; 539 | } 540 | if((event.end - event.start) <= 86400000) { 541 | event.days = 1; 542 | } else { 543 | event.days = ((event.end - event.start) / 86400000); 544 | } 545 | 546 | if(event.start < start) { 547 | 548 | event.days = event.days - ((start - event.start) / 86400000); 549 | event.start_day = 0; 550 | } 551 | 552 | event.days = Math.ceil(event.days); 553 | 554 | if(event.start_day + event.days > 7) { 555 | event.days = 7 - (event.start_day); 556 | } 557 | 558 | events.push(event); 559 | }); 560 | t.events = events; 561 | t.cal = this; 562 | return self.options.templates['week-days'](t); 563 | } 564 | 565 | Calendar.prototype._month = function(month) { 566 | this._loadTemplate('year-month'); 567 | 568 | var t = {cal: this}; 569 | var newmonth = month + 1; 570 | t.data_day = this.options.position.start.getFullYear() + '-' + (newmonth < 10 ? '0' + newmonth : newmonth) + '-' + '01'; 571 | t.month_name = this.locale['m' + month]; 572 | 573 | var curdate = new Date(this.options.position.start.getFullYear(), month, 1, 0, 0, 0); 574 | t.start = parseInt(curdate.getTime()); 575 | t.end = parseInt(new Date(this.options.position.start.getFullYear(), month + 1, 1, 0, 0, 0).getTime()); 576 | t.events = this.getEventsBetween(t.start, t.end); 577 | return this.options.templates['year-month'](t); 578 | } 579 | 580 | Calendar.prototype._day = function(week, day) { 581 | this._loadTemplate('month-day'); 582 | 583 | var t = {tooltip: '', cal: this}; 584 | var cls = this.options.classes.months.outmonth; 585 | 586 | var firstday = this.options.position.start.getDay(); 587 | if(getExtentedOption(this, 'first_day') == 2) { 588 | firstday++; 589 | } else { 590 | firstday = (firstday == 0 ? 7 : firstday); 591 | } 592 | 593 | day = (day - firstday) + 1; 594 | var curdate = new Date(this.options.position.start.getFullYear(), this.options.position.start.getMonth(), day, 0, 0, 0); 595 | 596 | // if day of the current month 597 | if(day > 0) { 598 | cls = this.options.classes.months.inmonth; 599 | } 600 | // stop cycling table rows; 601 | var daysinmonth = (new Date(this.options.position.end.getTime() - 1)).getDate(); 602 | if((day + 1) > daysinmonth) { 603 | this.stop_cycling = true; 604 | } 605 | // if day of the next month 606 | if(day > daysinmonth) { 607 | day = day - daysinmonth; 608 | cls = this.options.classes.months.outmonth; 609 | } 610 | 611 | cls = $.trim(cls + " " + this._getDayClass("months", curdate)); 612 | 613 | if(day <= 0) { 614 | var daysinprevmonth = (new Date(this.options.position.start.getFullYear(), this.options.position.start.getMonth(), 0)).getDate(); 615 | day = daysinprevmonth - Math.abs(day); 616 | cls += ' cal-month-first-row'; 617 | } 618 | 619 | var holiday = this._getHoliday(curdate); 620 | if(holiday !== false) { 621 | t.tooltip = holiday; 622 | } 623 | 624 | t.data_day = curdate.getFullYear() + '-' + curdate.getMonthFormatted() + '-' + (day < 10 ? '0' + day : day); 625 | t.cls = cls; 626 | t.day = day; 627 | 628 | t.start = parseInt(curdate.getTime()); 629 | t.end = parseInt(t.start + 86400000); 630 | t.events = this.getEventsBetween(t.start, t.end); 631 | return this.options.templates['month-day'](t); 632 | } 633 | 634 | Calendar.prototype._getHoliday = function(date) { 635 | var result = false; 636 | $.each(getHolidays(this, date.getFullYear()), function() { 637 | var found = false; 638 | $.each(this.days, function() { 639 | if(this.toDateString() == date.toDateString()) { 640 | found = true; 641 | return false; 642 | } 643 | }); 644 | if(found) { 645 | result = this.name; 646 | return false; 647 | } 648 | }); 649 | return result; 650 | }; 651 | 652 | Calendar.prototype._getHolidayName = function(date) { 653 | var holiday = this._getHoliday(date); 654 | return (holiday === false) ? "" : holiday; 655 | }; 656 | 657 | Calendar.prototype._getDayClass = function(class_group, date) { 658 | var self = this; 659 | var addClass = function(which, to) { 660 | var cls; 661 | cls = (self.options.classes && (class_group in self.options.classes) && (which in self.options.classes[class_group])) ? self.options.classes[class_group][which] : ""; 662 | if((typeof(cls) == "string") && cls.length) { 663 | to.push(cls); 664 | } 665 | }; 666 | var classes = []; 667 | if(date.toDateString() == (new Date()).toDateString()) { 668 | addClass("today", classes); 669 | } 670 | var holiday = this._getHoliday(date); 671 | if(holiday !== false) { 672 | addClass("holidays", classes); 673 | } 674 | switch(date.getDay()) { 675 | case 0: 676 | addClass("sunday", classes); 677 | break; 678 | case 6: 679 | addClass("saturday", classes); 680 | break; 681 | } 682 | return classes.join(" "); 683 | }; 684 | 685 | Calendar.prototype.view = function(view) { 686 | if(view) { 687 | if(!this.options.views[view].enable) { 688 | return; 689 | } 690 | this.options.view = view; 691 | } 692 | 693 | 694 | this._init_position(); 695 | this._loadEvents(); 696 | this._render(); 697 | 698 | this.options.onAfterViewLoad.call(this, this.options.view); 699 | }; 700 | 701 | Calendar.prototype.navigate = function(where, next) { 702 | var to = $.extend({}, this.options.position); 703 | if(where == 'next') { 704 | switch(this.options.view) { 705 | case 'year': 706 | to.start.setFullYear(this.options.position.start.getFullYear() + 1); 707 | break; 708 | case 'month': 709 | to.start.setMonth(this.options.position.start.getMonth() + 1); 710 | break; 711 | case 'week': 712 | to.start.setDate(this.options.position.start.getDate() + 7); 713 | break; 714 | case 'day': 715 | to.start.setDate(this.options.position.start.getDate() + 1); 716 | break; 717 | } 718 | } else if(where == 'prev') { 719 | switch(this.options.view) { 720 | case 'year': 721 | to.start.setFullYear(this.options.position.start.getFullYear() - 1); 722 | break; 723 | case 'month': 724 | to.start.setMonth(this.options.position.start.getMonth() - 1); 725 | break; 726 | case 'week': 727 | to.start.setDate(this.options.position.start.getDate() - 7); 728 | break; 729 | case 'day': 730 | to.start.setDate(this.options.position.start.getDate() - 1); 731 | break; 732 | } 733 | } else if(where == 'today') { 734 | to.start.setTime(new Date().getTime()); 735 | } 736 | else { 737 | $.error(this.locale.error_where.format(where)) 738 | } 739 | this.options.day = to.start.getFullYear() + '-' + to.start.getMonthFormatted() + '-' + to.start.getDateFormatted(); 740 | this.view(); 741 | if(_.isFunction(next)) { 742 | next(); 743 | } 744 | }; 745 | 746 | Calendar.prototype._init_position = function() { 747 | var year, month, day; 748 | 749 | if(this.options.day == 'now') { 750 | var date = new Date(); 751 | year = date.getFullYear(); 752 | month = date.getMonth(); 753 | day = date.getDate(); 754 | } else if(this.options.day.match(/^\d{4}-\d{2}-\d{2}$/g)) { 755 | var list = this.options.day.split('-'); 756 | year = parseInt(list[0], 10); 757 | month = parseInt(list[1], 10) - 1; 758 | day = parseInt(list[2], 10); 759 | } 760 | else { 761 | $.error(this.locale.error_dateformat.format(this.options.day)); 762 | } 763 | 764 | switch(this.options.view) { 765 | case 'year': 766 | this.options.position.start.setTime(new Date(year, 0, 1).getTime()); 767 | this.options.position.end.setTime(new Date(year + 1, 0, 1).getTime()); 768 | break; 769 | case 'month': 770 | this.options.position.start.setTime(new Date(year, month, 1).getTime()); 771 | this.options.position.end.setTime(new Date(year, month + 1, 1).getTime()); 772 | break; 773 | case 'day': 774 | this.options.position.start.setTime(new Date(year, month, day).getTime()); 775 | this.options.position.end.setTime(new Date(year, month, day + 1).getTime()); 776 | break; 777 | case 'week': 778 | var curr = new Date(year, month, day); 779 | var first; 780 | if(getExtentedOption(this, 'first_day') == 1) { 781 | first = curr.getDate() - ((curr.getDay() + 6) % 7); 782 | } 783 | else { 784 | first = curr.getDate() - curr.getDay(); 785 | } 786 | this.options.position.start.setTime(new Date(year, month, first).getTime()); 787 | this.options.position.end.setTime(new Date(year, month, first + 7).getTime()); 788 | break; 789 | default: 790 | $.error(this.locale.error_noview.format(this.options.view)) 791 | } 792 | return this; 793 | }; 794 | 795 | Calendar.prototype.getTitle = function() { 796 | var p = this.options.position.start; 797 | switch(this.options.view) { 798 | case 'year': 799 | return this.locale.title_year.format(p.getFullYear()); 800 | break; 801 | case 'month': 802 | return this.locale.title_month.format(this.locale['m' + p.getMonth()], p.getFullYear()); 803 | break; 804 | case 'week': 805 | return this.locale.title_week.format(p.getWeek(), p.getFullYear()); 806 | break; 807 | case 'day': 808 | return this.locale.title_day.format(this.locale['d' + p.getDay()], p.getDate(), this.locale['m' + p.getMonth()], p.getFullYear()); 809 | break; 810 | } 811 | return; 812 | }; 813 | 814 | Calendar.prototype.isToday = function() { 815 | var now = new Date().getTime(); 816 | 817 | return ((now > this.options.position.start) && (now < this.options.position.end)); 818 | } 819 | 820 | Calendar.prototype.getStartDate = function() { 821 | return this.options.position.start; 822 | } 823 | 824 | Calendar.prototype.getEndDate = function() { 825 | return this.options.position.end; 826 | } 827 | 828 | Calendar.prototype._loadEvents = function() { 829 | var self = this; 830 | var source = null; 831 | if('events_source' in this.options && this.options.events_source !== '') { 832 | source = this.options.events_source; 833 | } 834 | else if('events_url' in this.options) { 835 | source = this.options.events_url; 836 | warn('The events_url option is DEPRECATED and it will be REMOVED in near future. Please use events_source instead.'); 837 | } 838 | var loader; 839 | switch($.type(source)) { 840 | case 'function': 841 | loader = function() { 842 | return source(self.options.position.start, self.options.position.end, browser_timezone); 843 | }; 844 | break; 845 | case 'array': 846 | loader = function() { 847 | return [].concat(source); 848 | }; 849 | break; 850 | case 'string': 851 | if(source.length) { 852 | loader = function() { 853 | var events = []; 854 | var params = {from: self.options.position.start.getTime(), to: self.options.position.end.getTime()}; 855 | if(browser_timezone.length) { 856 | params.browser_timezone = browser_timezone; 857 | } 858 | $.ajax({ 859 | url: buildEventsUrl(source, params), 860 | dataType: 'json', 861 | type: 'GET', 862 | async: false 863 | }).done(function(json) { 864 | if(!json.success) { 865 | $.error(json.error); 866 | } 867 | if(json.result) { 868 | events = json.result; 869 | } 870 | }); 871 | return events; 872 | }; 873 | } 874 | break; 875 | } 876 | if(!loader) { 877 | $.error(this.locale.error_loadurl); 878 | } 879 | this.options.onBeforeEventsLoad.call(this, function() { 880 | self.options.events = loader(); 881 | self.options.events.sort(function(a, b) { 882 | var delta; 883 | delta = a.start - b.start; 884 | if(delta == 0) { 885 | delta = a.end - b.end; 886 | } 887 | return delta; 888 | }); 889 | self.options.onAfterEventsLoad.call(self, self.options.events); 890 | }); 891 | }; 892 | 893 | Calendar.prototype._loadTemplate = function(name) { 894 | if(this.options.templates[name]) { 895 | return; 896 | } 897 | var self = this; 898 | $.ajax({ 899 | url: this.options.tmpl_path + name + '.html', 900 | dataType: 'html', 901 | type: 'GET', 902 | async: false, 903 | cache: this.options.tmpl_cache 904 | }).done(function(html) { 905 | self.options.templates[name] = _.template(html); 906 | }); 907 | }; 908 | 909 | 910 | Calendar.prototype._update = function() { 911 | var self = this; 912 | 913 | $('*[data-toggle="tooltip"]').tooltip({container: 'body'}); 914 | 915 | $('*[data-cal-date]').click(function() { 916 | var view = $(this).data('cal-view'); 917 | self.options.day = $(this).data('cal-date'); 918 | self.view(view); 919 | }); 920 | $('.cal-cell').dblclick(function() { 921 | var view = $('[data-cal-date]', this).data('cal-view'); 922 | self.options.day = $('[data-cal-date]', this).data('cal-date'); 923 | self.view(view); 924 | }); 925 | 926 | this['_update_' + this.options.view](); 927 | 928 | this._update_modal(); 929 | 930 | }; 931 | 932 | Calendar.prototype._update_modal = function() { 933 | var self = this; 934 | 935 | $('a[data-event-id]', this.context).unbind('click'); 936 | 937 | if(!self.options.modal) { 938 | return; 939 | } 940 | 941 | var modal = $(self.options.modal); 942 | 943 | if(!modal.length) { 944 | return; 945 | } 946 | 947 | var ifrm = null; 948 | if(self.options.modal_type == "iframe") { 949 | ifrm = $(document.createElement("iframe")) 950 | .attr({ 951 | width: "100%", 952 | frameborder: "0" 953 | }); 954 | } 955 | 956 | 957 | $('a[data-event-id]', this.context).on('click', function(event) { 958 | event.preventDefault(); 959 | event.stopPropagation(); 960 | 961 | var url = $(this).attr('href'); 962 | var id = $(this).data("event-id"); 963 | var event = _.find(self.options.events, function(event) { 964 | return event.id == id 965 | }); 966 | 967 | if(self.options.modal_type == "iframe") { 968 | ifrm.attr('src', url); 969 | $('.modal-body', modal).html(ifrm); 970 | } 971 | 972 | if(!modal.data('handled.bootstrap-calendar') || (modal.data('handled.bootstrap-calendar') && modal.data('handled.event-id') != event.id)) { 973 | modal 974 | .on('show.bs.modal', function() { 975 | var modal_body = $(this).find('.modal-body'); 976 | switch(self.options.modal_type) { 977 | case "iframe" : 978 | var height = modal_body.height() - parseInt(modal_body.css('padding-top'), 10) - parseInt(modal_body.css('padding-bottom'), 10); 979 | $(this).find('iframe').height(Math.max(height, 50)); 980 | break; 981 | 982 | case "ajax": 983 | $.ajax({url: url, dataType: "html", async: false, success: function(data) { 984 | modal_body.html(data); 985 | }}); 986 | break; 987 | 988 | case "template": 989 | self._loadTemplate("modal"); 990 | // also serve calendar instance to underscore template to be able to access current language strings 991 | modal_body.html(self.options.templates["modal"]({"event": event, "calendar": self})) 992 | break; 993 | } 994 | 995 | // set the title of the bootstrap modal 996 | if(_.isFunction(self.options.modal_title)) { 997 | modal.find("h3").html(self.options.modal_title(event)); 998 | } 999 | }) 1000 | .data('handled.bootstrap-calendar', true).data('handled.event-id', event.id); 1001 | } 1002 | modal.modal('show'); 1003 | }); 1004 | }; 1005 | 1006 | Calendar.prototype._update_day = function() { 1007 | $('#cal-day-panel').height($('#cal-day-panel-hour').height()); 1008 | }; 1009 | 1010 | Calendar.prototype._update_week = function() { 1011 | }; 1012 | 1013 | Calendar.prototype._update_year = function() { 1014 | this._update_month_year(); 1015 | }; 1016 | 1017 | Calendar.prototype._update_month = function() { 1018 | this._update_month_year(); 1019 | 1020 | var self = this; 1021 | 1022 | var week = $(document.createElement('div')).attr('id', 'cal-week-box'); 1023 | var start = this.options.position.start.getFullYear() + '-' + this.options.position.start.getMonthFormatted() + '-'; 1024 | $('.cal-month-box .cal-row-fluid') 1025 | .on('mouseenter', function() { 1026 | var p = new Date(self.options.position.start); 1027 | var child = $('.cal-cell1:first-child .cal-month-day', this); 1028 | var day = (child.hasClass('cal-month-first-row') ? 1 : $('[data-cal-date]', child).text()); 1029 | p.setDate(parseInt(day)); 1030 | day = (day < 10 ? '0' + day : day); 1031 | week.html(self.locale.week.format(p.getWeek())); 1032 | week.attr('data-cal-week', start + day).show().appendTo(child); 1033 | }) 1034 | .on('mouseleave', function() { 1035 | week.hide(); 1036 | }) 1037 | ; 1038 | 1039 | week.click(function() { 1040 | self.options.day = $(this).data('cal-week'); 1041 | self.view('week'); 1042 | }); 1043 | 1044 | $('a.event').mouseenter(function() { 1045 | $('a[data-event-id="' + $(this).data('event-id') + '"]').closest('.cal-cell1').addClass('day-highlight dh-' + $(this).data('event-class')); 1046 | }); 1047 | $('a.event').mouseleave(function() { 1048 | $('div.cal-cell1').removeClass('day-highlight dh-' + $(this).data('event-class')); 1049 | }); 1050 | }; 1051 | 1052 | Calendar.prototype._update_month_year = function() { 1053 | if(!this.options.views[this.options.view].slide_events) { 1054 | return; 1055 | } 1056 | var self = this; 1057 | var activecell = 0; 1058 | var downbox = $(document.createElement('div')).attr('id', 'cal-day-tick').html(''); 1059 | 1060 | $('.cal-month-day, .cal-year-box .span3') 1061 | .on('mouseenter', function() { 1062 | if($('.events-list', this).length == 0) return; 1063 | if($(this).children('[data-cal-date]').text() == self.activecell) return; 1064 | downbox.show().appendTo(this); 1065 | }) 1066 | .on('mouseleave', function() { 1067 | downbox.hide(); 1068 | }) 1069 | .on('click', function(event) { 1070 | if($('.events-list', this).length == 0) return; 1071 | if($(this).children('[data-cal-date]').text() == self.activecell) return; 1072 | showEventsList(event, downbox, slider, self); 1073 | }) 1074 | ; 1075 | 1076 | var slider = $(document.createElement('div')).attr('id', 'cal-slide-box'); 1077 | slider.hide().click(function(event) { 1078 | event.stopPropagation(); 1079 | }); 1080 | 1081 | this._loadTemplate('events-list'); 1082 | 1083 | downbox.click(function(event) { 1084 | showEventsList(event, $(this), slider, self); 1085 | }); 1086 | }; 1087 | 1088 | Calendar.prototype.getEventsBetween = function(start, end) { 1089 | var events = []; 1090 | $.each(this.options.events, function() { 1091 | if((parseInt(this.start) < end || this.start == null) && (parseInt(this.end) >= start || this.end == null)) { 1092 | events.push(this); 1093 | } 1094 | }); 1095 | return events; 1096 | }; 1097 | 1098 | function showEventsList(event, that, slider, self) { 1099 | 1100 | event.stopPropagation(); 1101 | 1102 | var that = $(that); 1103 | var cell = that.closest('.cal-cell'); 1104 | var row = cell.closest('.cal-before-eventlist'); 1105 | var tick_position = cell.data('cal-row'); 1106 | 1107 | that.fadeOut('fast'); 1108 | 1109 | slider.slideUp('fast', function() { 1110 | var event_list = $('.events-list', cell); 1111 | slider.html(self.options.templates['events-list']({ 1112 | cal: self, 1113 | events: self.getEventsBetween(parseInt(event_list.data('cal-start')), parseInt(event_list.data('cal-end'))) 1114 | })); 1115 | row.after(slider); 1116 | self.activecell = $('[data-cal-date]', cell).text(); 1117 | $('#cal-slide-tick').addClass('tick' + tick_position).show(); 1118 | slider.slideDown('fast', function() { 1119 | $('body').one('click', function() { 1120 | slider.slideUp('fast'); 1121 | self.activecell = 0; 1122 | }); 1123 | }); 1124 | }); 1125 | 1126 | $('a.event-item').mouseenter(function() { 1127 | $('a[data-event-id="' + $(this).data('event-id') + '"]').closest('.cal-cell1').addClass('day-highlight dh-' + $(this).data('event-class')); 1128 | }); 1129 | $('a.event-item').mouseleave(function() { 1130 | $('div.cal-cell1').removeClass('day-highlight dh-' + $(this).data('event-class')); 1131 | }); 1132 | 1133 | self._update_modal(); 1134 | } 1135 | 1136 | function getEasterDate(year, offsetDays) { 1137 | var a = year % 19; 1138 | var b = Math.floor(year / 100); 1139 | var c = year % 100; 1140 | var d = Math.floor(b / 4); 1141 | var e = b % 4; 1142 | var f = Math.floor((b + 8) / 25); 1143 | var g = Math.floor((b - f + 1) / 3); 1144 | var h = (19 * a + b - d - g + 15) % 30; 1145 | var i = Math.floor(c / 4); 1146 | var k = c % 4; 1147 | var l = (32 + 2 * e + 2 * i - h - k) % 7; 1148 | var m = Math.floor((a + 11 * h + 22 * l) / 451); 1149 | var n0 = (h + l + 7 * m + 114) 1150 | var n = Math.floor(n0 / 31) - 1; 1151 | var p = n0 % 31 + 1; 1152 | return new Date(year, n, p + (offsetDays ? offsetDays : 0), 0, 0, 0); 1153 | } 1154 | 1155 | $.fn.calendar = function(params) { 1156 | return new Calendar(params, this); 1157 | } 1158 | }(jQuery)); 1159 | -------------------------------------------------------------------------------- /js/es-ES.js: -------------------------------------------------------------------------------- 1 | if(!window.calendar_languages) { 2 | window.calendar_languages = {}; 3 | } 4 | window.calendar_languages['es-ES'] = { 5 | error_noview: 'Calendario: Vista {0} no encontrada', 6 | error_dateformat: 'Calendario: Formato de fecha inválido {0}. Debe ser "now" o "yyyy-mm-dd"', 7 | error_loadurl: 'Calendario: URL de carga de eventos no configurada', 8 | error_where: 'Calendario: Dirección de navegación incorrecta {0}. Los valores correctos son "next" o "prev" o "today"', 9 | error_timedevide: 'Calendario: parámetro para el separador de hora debe dividir 60 por un entero. Por ejemplo 10, 15, 30', 10 | 11 | no_events_in_day: 'No hay eventos hoy', 12 | 13 | title_year: 'Año {0}', 14 | title_month: '{0} {1}', 15 | title_week: 'Semana {0} del {1}', 16 | title_day: '{0} {1} {2} {3}', 17 | 18 | week: 'Semana {0}', 19 | all_day: 'Todo el día', 20 | time: 'Tiempo', 21 | events: 'Desarrollos', 22 | before_time: 'Tiempo antes de la cinta final', 23 | after_time: 'Fin después de una cinta temporal', 24 | 25 | m0: 'Enero', 26 | m1: 'Febrero', 27 | m2: 'Marzo', 28 | m3: 'Abril', 29 | m4: 'Mayo', 30 | m5: 'Junio', 31 | m6: 'Julio', 32 | m7: 'Agosto', 33 | m8: 'Septiembre', 34 | m9: 'Octubre', 35 | m10: 'Noviembre', 36 | m11: 'Diciembre', 37 | 38 | ms0: 'Ene', 39 | ms1: 'Feb', 40 | ms2: 'Mar', 41 | ms3: 'Abr', 42 | ms4: 'May', 43 | ms5: 'Jun', 44 | ms6: 'Jul', 45 | ms7: 'Ago', 46 | ms8: 'Sep', 47 | ms9: 'Oct', 48 | ms10: 'Nov', 49 | ms11: 'Dic', 50 | 51 | d0: 'Domingo', 52 | d1: 'Lunes', 53 | d2: 'Martes', 54 | d3: 'Miércoles', 55 | d4: 'Jueves', 56 | d5: 'Viernes', 57 | d6: 'Sábado', 58 | 59 | easter: 'Pascuas', 60 | easterMonday: 'Lunes de Pascuas', 61 | 62 | first_day: 1, 63 | 64 | holidays: { 65 | '01-01': "Año Nuevo", 66 | '06-01': "Día de Reyes", 67 | '19-03': "San José", 68 | 'easter-3': "Jueves Santo", 69 | 'easter-2': "Viernes Santo", 70 | 'easter': "Pascua", 71 | 'easter+1': "Lunes de Pascua", 72 | '01-05': "Día del Trabajador", 73 | '15-08': "Asunción", 74 | '12-10': "Fiesta Nacional de España", 75 | '01-11': "Día de todos los Santos", 76 | '06-12': "Día de la Constitución", 77 | '08-12': "Inmaculada Concepción", 78 | '25-12': "Navidad" 79 | } 80 | }; 81 | -------------------------------------------------------------------------------- /js/underscore-min.js: -------------------------------------------------------------------------------- 1 | (function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); -------------------------------------------------------------------------------- /obtener_eventos.php: -------------------------------------------------------------------------------- 1 | query($sql)->num_rows) 30 | { 31 | 32 | // creamos un array 33 | $datos = array(); 34 | 35 | //guardamos en un array multidimensional todos los datos de la consulta 36 | $i=0; 37 | 38 | // Ejecutamos nuestra sentencia sql 39 | $e = $conexion->query($sql); 40 | 41 | while($row=$e->fetch_array()) // realizamos un ciclo while para traer los agenda encontrados en la base de dato 42 | { 43 | // Alimentamos el array con los datos de los agenda 44 | $datos[$i] = $row; 45 | $i++; 46 | } 47 | 48 | // Transformamos los datos encontrado en la BD al formato JSON 49 | echo json_encode( 50 | array( 51 | "success" => 1, 52 | "result" => $datos 53 | ) 54 | ); 55 | 56 | } 57 | else 58 | { 59 | // Si no existen agenda mostramos este mensaje. 60 | echo "No hay datos"; 61 | } 62 | 63 | 64 | ?> 65 | -------------------------------------------------------------------------------- /tmpls/day.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
<%= cal.locale.time %>
4 |
<%= cal.locale.events %>
5 |
6 | <% if(all_day.length) {%> 7 |
8 |
<%= cal.locale.all_day %>
9 |
10 | <% _.each(all_day, function(event){ %> 11 |
12 | <%= event.title %> 13 |
14 | <% }); %> 15 |
16 |
17 | <% }; %> 18 | <% if(before_time.length) {%> 19 |
20 |
<%= cal.locale.before_time %>
21 |
22 | <% _.each(before_time, function(event){ %> 23 |
24 | <%= event.end_hour %> 25 | <%= event.title %> 26 |
27 | <% }); %> 28 |
29 |
30 | <% }; %> 31 |
32 | <% _.each(by_hour, function(event){ %> 33 |
34 | <%= event.start_hour %> - <%= event.end_hour %> 35 | <%= event.title %> 36 |
37 | <% }); %> 38 | 39 |
40 | <% for(i = 0; i < hours; i++){ %> 41 |
42 | <% for(l = 0; l < in_hour; l++){ %> 43 |
44 |
<%= cal._hour(i, l) %>
45 |
46 |
47 | <% }; %> 48 |
49 | <% }; %> 50 |
51 |
52 | <% if(after_time.length) {%> 53 |
54 |
<%= cal.locale.after_time %>
55 |
56 | <% _.each(after_time, function(event){ %> 57 |
58 | <%= event.start_hour %> 59 | <%= event.title %> 60 |
61 | <% }); %> 62 |
63 |
64 | <% }; %> 65 |
-------------------------------------------------------------------------------- /tmpls/events-list.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 13 |
14 | -------------------------------------------------------------------------------- /tmpls/modal.html: -------------------------------------------------------------------------------- 1 | <% event.date_start = new Date(parseInt(event.start)); 2 | event.date_end = new Date(parseInt(event.end)); %> 3 |
4 | Starts on <%= event.date_start.getDate() %> <%= calendar.locale["m" + event.date_start.getMonth()] %> <%= event.date_start.getFullYear() %>, at <%= event.date_start.getHours() %>:<%= event.date_start.getMinutes() %>
5 | Ends on <%= event.date_end.getDate() %> <%= calendar.locale["m" + event.date_end.getMonth()] %> <%= event.date_end.getFullYear() %> at <%= event.date_end.getHours() %>:<%= event.date_end.getMinutes() %>
6 |
7 | 8 |
9 | More info 10 |
11 | -------------------------------------------------------------------------------- /tmpls/month-day.html: -------------------------------------------------------------------------------- 1 |
2 | <%= day %> 3 | <% if (events.length > 0) { %> 4 |
5 | <% _.each(events, function(event) { %> 6 | 9 | <% }); %> 10 |
11 | <% } %> 12 |
13 | -------------------------------------------------------------------------------- /tmpls/month.html: -------------------------------------------------------------------------------- 1 |
2 | <% _.each(months, function(name){ %> 3 |
<%= name %>
4 | <% }) %> 5 |
6 |
7 | <% for(i = 0; i < 6; i++) { %> 8 | <% if(cal.stop_cycling == true) break; %> 9 |
10 |
<%= cal._day(i, day++) %>
11 |
<%= cal._day(i, day++) %>
12 |
<%= cal._day(i, day++) %>
13 |
<%= cal._day(i, day++) %>
14 |
<%= cal._day(i, day++) %>
15 |
<%= cal._day(i, day++) %>
16 |
<%= cal._day(i, day++) %>
17 |
18 | <% } %> 19 |
-------------------------------------------------------------------------------- /tmpls/week-days.html: -------------------------------------------------------------------------------- 1 | <% _.each(events, function(event){ %> 2 |
3 | 6 |
7 | <% }); %> 8 | -------------------------------------------------------------------------------- /tmpls/week.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <% _.each(months, function(name) { %> 10 |
<%= name %>
11 | <%= start.getDate() %> <%= cal.locale['ms' + start.getMonth()] %> 12 |
13 | <% start.setDate(start.getDate() + 1); %> 14 | <% }) %> 15 |
16 |
17 | <%= cal._week() %> 18 |
19 | -------------------------------------------------------------------------------- /tmpls/year-month.html: -------------------------------------------------------------------------------- 1 | <%= month_name %> 2 | <% if (events.length > 0) { %> 3 | <%= events.length %> 4 |
5 | <% _.each(events, function(event) { %> 6 | 9 | <% }); %> 10 |
11 | <% } %> 12 | -------------------------------------------------------------------------------- /tmpls/year.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
<%= cal._month(0) %>
4 |
<%= cal._month(1) %>
5 |
<%= cal._month(2) %>
6 |
<%= cal._month(3) %>
7 |
8 |
9 |
<%= cal._month(4) %>
10 |
<%= cal._month(5) %>
11 |
<%= cal._month(6) %>
12 |
<%= cal._month(7) %>
13 |
14 |
15 |
<%= cal._month(8) %>
16 |
<%= cal._month(9) %>
17 |
<%= cal._month(10) %>
18 |
<%= cal._month(11) %>
19 |
20 |
21 | --------------------------------------------------------------------------------