├── .gitignore ├── LICENSE ├── css ├── jQRangeSlider-5.7.2 │ └── classic-min.css └── style.css ├── images ├── favicon.ico ├── hillary-logo.png ├── hrc4.gif ├── octicon-location-active.png ├── octicon-location-active.svg ├── octicon-location.png ├── octicon-location.svg └── preview.png ├── index.html ├── js ├── d3.v3.min.js ├── event-map.js ├── jQDateRangeSlider-withRuler-5.7.2.min.js ├── jquery.touchSwipe-1.6.18.min.js ├── underscore-min.js └── zipcode.js └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Faraday 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /css/jQRangeSlider-5.7.2/classic-min.css: -------------------------------------------------------------------------------- 1 | .ui-rangeSlider{height:22px}.ui-rangeSlider .ui-rangeSlider-innerBar{height:16px;margin:3px 6px;background:#DDD}.ui-rangeSlider .ui-rangeSlider-handle{width:6px;height:22px;background:#AAA;background:rgba(100,100,100,.3);cursor:col-resize}.ui-rangeSlider .ui-rangeSlider-bar{margin:1px 0;background:#CCC;background:rgba(100,100,150,.2);height:20px;cursor:move;cursor:grab;cursor:-moz-grab}.ui-rangeSlider .ui-rangeSlider-bar.ui-draggable-dragging{cursor:-moz-grabbing;cursor:grabbing}.ui-rangeSlider-arrow{height:16px;margin:2px 0;width:16px;background-repeat:no-repeat}.ui-rangeSlider-arrow.ui-rangeSlider-leftArrow{background-image:url(icons-classic/resultset_previous.png);background-position:center left}.ui-rangeSlider-arrow.ui-rangeSlider-rightArrow{background-image:url(icons-classic/resultset_next.png);background-position:center right}.ui-rangeSlider-arrow-inner{display:none}.ui-rangeSlider-container{height:22px}.ui-rangeSlider-withArrows .ui-rangeSlider-container{margin:0 11px}.ui-rangeSlider-noArrow .ui-rangeSlider-container{margin:0}.ui-rangeSlider-label{margin:0 2px 2px;background-image:url(icons-classic/label.png);background-position:bottom center;background-repeat:no-repeat;white-space:nowrap;bottom:20px;padding:3px 6px 7px;cursor:col-resize}.ui-rangeSlider-label-inner{display:none}input.ui-editRangeSlider-inputValue{width:3em;vertical-align:middle;text-align:center} -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /*********** reset ***********/ 2 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}.clearfix{overflow: auto;zoom: 1;}*,*:before,*:after{box-sizing: border-box;} 3 | 4 | html, body { 5 | width: 100%; 6 | height: 100%; 7 | padding: 0; 8 | margin: 0; 9 | font-family: 'Helvetica Neue', Helvetica, sans-serif; 10 | line-height: 1.4; 11 | color: #333; 12 | } 13 | 14 | .icon { 15 | display: inline-block; 16 | fill: currentColor; 17 | } 18 | 19 | /*********** header styles ***********/ 20 | 21 | .header { 22 | padding: 20px; 23 | } 24 | .header h1 { 25 | margin: 0 auto 20px; 26 | width: 70px; 27 | height: 0; 28 | padding-top: 59px; 29 | overflow: hidden; 30 | background: url("../images/hillary-logo.png"); 31 | background-size: 100%; 32 | } 33 | 34 | /*********** text group styles ***********/ 35 | 36 | #events { 37 | width: 40%; 38 | height: 100%; 39 | } 40 | #events .state { 41 | display: none; 42 | padding: 20px; 43 | padding-bottom: 0; 44 | } 45 | #events.start .start-wrapper, 46 | #events.event .event-wrapper, 47 | #events.error .error-wrapper, 48 | #events.search-error .search-error-wrapper { 49 | display: block; 50 | } 51 | #events h2 { 52 | font-weight: bold; 53 | font-size: 24px; 54 | margin-bottom: 20px; 55 | } 56 | 57 | /*********** map styles ***********/ 58 | 59 | #map { 60 | width: 60%; 61 | height: 100%; 62 | } 63 | #map { 64 | position: fixed; 65 | right: 0; 66 | top: 0; 67 | border-left: 1px solid #ccc; 68 | } 69 | #map-search { 70 | position: absolute; 71 | top: 0; 72 | right: 0; 73 | z-index: 1; 74 | background: whitesmoke; 75 | padding: 5px 10px; 76 | border-left: 1px solid #ccc; 77 | border-bottom: 1px solid #ccc; 78 | font-size: 14px; 79 | line-height: 2em; 80 | } 81 | #map-search input { 82 | font-size: 20px; 83 | margin: 0 7px 0px 0; 84 | height: 15px; 85 | } 86 | .disabled { 87 | opacity: .5; 88 | pointer-events: none; 89 | } 90 | .leaflet-popup-content { 91 | margin: 20px; 92 | } 93 | .leaflet-container a.leaflet-popup-close-button { 94 | top: 18px; 95 | right: 16px; 96 | } 97 | .leaflet-popup-content .rsvp { 98 | padding-left: 23px; 99 | margin-top: 15px; 100 | } 101 | .leaflet-popup-content .rsvp a { 102 | float: none !important; 103 | } 104 | 105 | /*********** searchbox styles ***********/ 106 | 107 | #searchbox { 108 | display: table; 109 | } 110 | #searchbox .search-column { 111 | position: relative; 112 | display: table-cell; 113 | width: 1%; 114 | white-space: nowrap; 115 | vertical-align: middle; 116 | } 117 | #searchbox .search-primary { 118 | width: 99%; 119 | } 120 | #searchbox input[type="text"] { 121 | overflow: hidden; 122 | text-overflow: ellipsis; 123 | height: 44px; 124 | width: 100%; 125 | background: #fff; 126 | border: 2px solid #ccc; 127 | border-radius: 5px; 128 | padding: 0 9px; 129 | font-size: 19px; 130 | } 131 | #searchbox input[type="text"]:focus { 132 | border-color: #12a8e0; 133 | outline: 0; 134 | } 135 | #searchbox .search-button { 136 | font-weight: bold; 137 | font-size: 19px; 138 | padding: 0 18px; 139 | color: #fff; 140 | height: 44px; 141 | background: #12a8e0; 142 | border: 0; 143 | border-radius: 5px; 144 | margin-left: 8px; 145 | cursor: pointer; 146 | } 147 | #searchbox .search-button:focus, 148 | #searchbox .search-button:hover { 149 | background: #0d8ebe; 150 | outline: 0; 151 | } 152 | #searchbox .clear-button { 153 | display: none; 154 | position: absolute; 155 | cursor: pointer; 156 | color: #fff; 157 | background: #12a8e0; 158 | border: 0; 159 | border-radius: 50%; 160 | right: 10px; 161 | top: 10px; 162 | height: 24px; 163 | width: 24px; 164 | padding-top: 4px;\ 165 | } 166 | #searchbox .clear-button:hover, 167 | #searchbox .clear-button:focus { 168 | background: #0d8ebe; 169 | outline: 0; 170 | } 171 | 172 | /*********** autocomplete dropdown styles ***********/ 173 | 174 | .autocomplete { 175 | position: absolute; 176 | width: 100%; 177 | background: #fff; 178 | z-index: 10; 179 | } 180 | .suggestion { 181 | border: 2px solid #ddd; 182 | border-bottom: 0; 183 | padding: 8px 0 8px 10px; 184 | color: #808080; 185 | cursor: pointer; 186 | overflow: hidden; 187 | text-overflow: ellipsis; 188 | } 189 | .suggestion:first-child { 190 | border-top-left-radius: 5px; 191 | border-top-right-radius: 5px; 192 | } 193 | .suggestion:last-child { 194 | border-bottom-left-radius: 5px; 195 | border-bottom-right-radius: 5px; 196 | border-bottom: 2px solid #ddd; 197 | } 198 | .suggestion.selected { 199 | color: #000; 200 | background: #ddd; 201 | } 202 | .suggestion:hover { 203 | color: #000; 204 | background: #eee; 205 | } 206 | 207 | /*********** event search results styles ***********/ 208 | 209 | .event-list { 210 | margin-left: -20px; 211 | margin-right: -20px; 212 | } 213 | .list-event { 214 | padding: 20px; 215 | border-top: 2px solid #eee; 216 | } 217 | .list-event.selected { 218 | border: 2px dotted #254da3; 219 | } 220 | .list-event:nth-child(odd) { 221 | background: #f7f7f7; 222 | } 223 | .list-event h3 { 224 | font-weight: bold; 225 | font-size: 22px; 226 | margin-bottom: 12px; 227 | } 228 | .list-event h3, .list-event .location { 229 | cursor: pointer; 230 | } 231 | .list-event .rsvp, 232 | .leaflet-popup-content .rsvp a { 233 | float: right; 234 | color: #fff; 235 | text-transform: uppercase; 236 | text-decoration: none; 237 | font-size: 12px; 238 | font-weight: bold; 239 | padding: 8px 10px; 240 | background: #12a8e0; 241 | border-radius: 4px; 242 | } 243 | .list-event .rsvp:hover, 244 | .leaflet-popup-content .rsvp a:hover { 245 | background: #0d8eBe; 246 | } 247 | .location, 248 | .time { 249 | padding-left: 23px; 250 | margin-bottom: 8px; 251 | } 252 | .list-event .icon, 253 | .leaflet-popup-content .icon { 254 | float: left; 255 | } 256 | 257 | .list-event .description { 258 | font-size: 14px; 259 | color: #555; 260 | } 261 | 262 | .icon-calendar { 263 | margin-left: -23px; 264 | margin-top: 2px; 265 | } 266 | .icon-location { 267 | margin-left: -21px; 268 | margin-top: 3px; 269 | } 270 | .leaflet-popup-content .icon-calendar, 271 | .leaflet-popup-content .icon-location { 272 | margin-top: 0; 273 | } 274 | .description { 275 | margin-top: 12px; 276 | padding-left: 23px; 277 | font-size: 12px; 278 | color: #717171; 279 | line-height: 1.8; 280 | } 281 | .leaflet-popup-content h2 { 282 | max-width: 275px; 283 | font-weight: bold; 284 | font-size: 18px; 285 | } 286 | 287 | .marker-highlight, .marker-highlight.marker-cluster-small { 288 | background-color: #254da3; 289 | border-radius: 20px; 290 | } 291 | 292 | /*********** date slider styles ***********/ 293 | .ui-rangeSlider-label { 294 | background-image: none; 295 | font-size: 12px; 296 | font-weight: bold; 297 | padding-bottom: 12px; 298 | } 299 | .ui-rangeSlider .ui-ruler-scale { 300 | position:absolute; 301 | top:-9px; 302 | left:0; 303 | bottom:0; 304 | right:0; 305 | } 306 | 307 | .ui-rangeSlider .ui-ruler-tick { 308 | float: left; 309 | margin-top: 5px; 310 | } 311 | 312 | .ui-rangeSlider .ui-ruler-scale0 .ui-ruler-tick-inner { 313 | color: #666; 314 | font-size: 12px; 315 | margin-top:1px; 316 | border-left: 1px solid white; 317 | height:29px; 318 | padding-left:2px; 319 | position:relative; 320 | } 321 | 322 | .ui-rangeSlider .ui-ruler-scale0 .ui-ruler-tick-label { 323 | position:absolute; 324 | bottom: 6px; 325 | } 326 | 327 | .ui-rangeSlider .ui-ruler-scale1 .ui-ruler-tick-inner { 328 | border-left:1px solid white; 329 | margin-top: 25px; 330 | height: 5px; 331 | } 332 | 333 | .ui-rangeSlider .ui-ruler-scale0 .ui-ruler-tick-inner .ui-ruler-tick-label { 334 | margin-left: 40%; 335 | } 336 | 337 | .ui-rangeSlider .ui-rangeSlider-bar{ 338 | background: rgba(12,87,161,.2); 339 | } 340 | 341 | .ui-rangeSlider{ 342 | height:32px; 343 | } 344 | 345 | .ui-rangeSlider .ui-rangeSlider-innerBar{ 346 | height:26px; 347 | } 348 | 349 | .ui-rangeSlider .ui-rangeSlider-bar{ 350 | height:25px; 351 | margin:3px 0; 352 | } 353 | 354 | .ui-rangeSlider-container{ 355 | height:32px; 356 | } 357 | 358 | .ui-rangeSlider .ui-rangeSlider-handle { 359 | margin-top: 3px; 360 | width:10px; 361 | height:26px; 362 | background: transparent; 363 | cursor:col-resize; 364 | } 365 | 366 | .ui-rangeSlider-leftHandle { 367 | border-left: 3px solid #000; 368 | } 369 | 370 | .ui-rangeSlider-rightHandle { 371 | border-right: 3px solid #000; 372 | } 373 | 374 | #mobile { 375 | display: none; 376 | } 377 | 378 | /*********** mobile ***********/ 379 | @media all and (max-width: 720px) { 380 | #mobile { 381 | display: block; 382 | } 383 | .search-mobile { 384 | position: relative; 385 | background: #fff url("../images/hillary-logo.png") no-repeat scroll 2% 50% / 16px 16px; 386 | box-sizing: border-box; 387 | width: 75%; 388 | height: 52px; 389 | border-bottom: 1px solid transparent; 390 | padding: 12px 12px 12px 30px; 391 | top: 10px; 392 | margin-left: auto; 393 | margin-right: auto; 394 | box-shadow: 0 1px 5px rgba(0,0,0,0.65); 395 | } 396 | .search-mobile input { 397 | border: 0; 398 | display: inline-block; 399 | font-size: 14px; 400 | width: 80%; 401 | vertical-align: middle; 402 | } 403 | .search-mobile .icon { 404 | margin-top: 5px; 405 | margin-bottom: 5px; 406 | vertical-align: bottom; 407 | color: #333; 408 | position: absolute; 409 | right: 20px; 410 | } 411 | 412 | .search-mobile .icon-x { 413 | display: none; 414 | } 415 | .search-mobile .icon-search.active { 416 | color: #254da3; 417 | } 418 | .search-mobile .search-box { 419 | display: block; 420 | margin: 0; 421 | vertical-align: baseline; 422 | background: transparent; 423 | } 424 | .autocomplete { 425 | margin-top: 18px; 426 | margin-left: -30px; 427 | } 428 | #events .header, #events .state { 429 | display: none; 430 | } 431 | #events { 432 | display: none; /* for now FIXME */ 433 | } 434 | #map { 435 | width: 100%; 436 | } 437 | #map-search { 438 | display: none; 439 | } 440 | .leaflet-popup-pane { 441 | display: none; 442 | } 443 | 444 | #detail { 445 | max-height: 40%; 446 | min-height: 20%; 447 | width: 100%; 448 | position: absolute; 449 | bottom: 0; 450 | background-color: #fff; 451 | overflow: hidden; 452 | padding: 0; 453 | margin: 0; 454 | display: none; 455 | } 456 | 457 | #detail .event-list { 458 | margin: 0; 459 | } 460 | .description { 461 | visibility: hidden; 462 | } 463 | .swipe { 464 | overflow: hidden; 465 | visibility: hidden; 466 | position: relative; 467 | } 468 | .swipe-wrap { 469 | overflow: hidden; 470 | position: relative; 471 | } 472 | .swipe-wrap > div { 473 | float: left; 474 | width: 100%; 475 | position: relative; 476 | overflow-y: auto; 477 | } 478 | .list-event { 479 | top: 0px !important 480 | } 481 | .list-event .rsvp { 482 | font-size: 22px; 483 | margin-left: 12px; 484 | } 485 | .list-event h3, .list-event .location { 486 | cursor: default; 487 | } 488 | } 489 | -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/favicon.ico -------------------------------------------------------------------------------- /images/hillary-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/hillary-logo.png -------------------------------------------------------------------------------- /images/hrc4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/hrc4.gif -------------------------------------------------------------------------------- /images/octicon-location-active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/octicon-location-active.png -------------------------------------------------------------------------------- /images/octicon-location-active.svg: -------------------------------------------------------------------------------- 1 | 2 | 67 | -------------------------------------------------------------------------------- /images/octicon-location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/octicon-location.png -------------------------------------------------------------------------------- /images/octicon-location.svg: -------------------------------------------------------------------------------- 1 | 2 | 67 | -------------------------------------------------------------------------------- /images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DevProgress/hrc-events/9c7870ac25f2a536df57e7fa1c4ad97b4c97f372/images/preview.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 24 | 25 | HRC Events Near You 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 55 |
56 |
57 |

Hillary Events Map

58 | 59 | 82 | 83 |
84 |

#ImWithHer, somewhere near you. Get started by searching for your location, and the map will display upcoming events in your area.

85 |
86 |
87 | 88 |
89 |
90 |
91 |
92 |
93 | 94 |
95 |

Events Near You

96 |
97 |
98 | 99 |
100 |

No events in this area

101 |

It looks there are no events in the area you’ve selected. Try a wider search, or host your own!

102 |
103 |
104 |

We couldn’t find your place.

105 |

We weren't able to find any locations that matched your search, please try again.

106 |
107 |
108 |
109 | 112 |
113 | 114 |
115 |
116 | 125 |
126 |
127 | 128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 155 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /js/event-map.js: -------------------------------------------------------------------------------- 1 | var welcomeMessage = '````````` ````````` ' + '\n' + 2 | '.ddddddddd- .shddddddd. ' + '\n' + 3 | '.ddddddddd- .ooshddddd. ' + '\n' + 4 | '.ddddddddd- .ooooshddd. ' + '\n' + 5 | '.ddddddddd- .ooooooshd. ' + '\n' + 6 | '.yyyyyyyyy:........:oooooooos- ' + '\n' + 7 | '`ooooooooooooooooooooooooooooo/` ' + '\n' + 8 | '`ooooooooooooooooooooooooooooooo/` ' + '\n' + 9 | '`ooooooooooooooooooooooooooooooo/` ' + '\n' + 10 | '`ooooooooooooooooooooooooooooo/` ' + '\n' + 11 | '.yyyyyyyyy:........:oooooooos- ' + '\n' + 12 | '.ddddddddd- .ooooooshd. ' + '\n' + 13 | '.ddddddddd- .ooooshddd. ' + '\n' + 14 | '.ddddddddd- .ooshddddd. ' + '\n' + 15 | '.ddddddddd- .shddddddd. ' + '\n' + 16 | '````````` ````````` ' + '\n' + 17 | 'Greetings, inquisitive visitor! Come join us at https://devprogress.us/' 18 | 19 | console.log(welcomeMessage) 20 | 21 | var eventsMap = function() { 22 | var map, 23 | markersById = {}, 24 | markerGroup = L.markerClusterGroup({ 25 | showCoverageOnHover: false, 26 | animate: false, 27 | disableClusteringAtZoom: 13 28 | }), 29 | standardIcon = L.icon({ 30 | iconUrl: 'images/octicon-location.png', 31 | iconSize: [32, 32], // size of the icon 32 | iconAnchor: [16, 32], // point of the icon which will correspond to marker's location 33 | popupAnchor: [0, -36] // point from which the popup should open relative to the iconAnchor 34 | }), 35 | activeIcon = L.icon({ 36 | iconUrl: 'images/octicon-location-active.png', 37 | iconSize: [32, 32], // size of the icon 38 | iconAnchor: [16, 32], // point of the icon which will correspond to marker's location 39 | popupAnchor: [0, -36] // point from which the popup should open relative to the iconAnchor 40 | }), 41 | markerGroupIds = {}, 42 | activeMarker = null, 43 | popupMarker = null, 44 | keyIndex = -1, 45 | xhr, 46 | hash, 47 | searchedLocation, 48 | currentDate = new Date(), 49 | earliestTime = encodeURIComponent(currentDate.toISOString()); 50 | allEvents = [], 51 | minDate = new Date(), 52 | maxDate = new Date(minDate.getTime()+(28*1000*60*60*24)), 53 | setup = false, 54 | swipe = null, 55 | searchInput = 'search-input'; 56 | 57 | var iso = d3.time.format.utc("%Y-%m-%dT%H:%M:%SZ"), 58 | wholeDate = d3.time.format("%b %-d %-I:%M %p"), 59 | dateFormat = d3.time.format("%b %-d"), 60 | hourFormat = d3.time.format("%-I:%M%p"); 61 | 62 | var eventsApp = { 63 | init : function() { 64 | this.setUpMap(); 65 | this.setUpEventHandlers(); 66 | this.tryForAutoLocation(); 67 | this.setUpDateSlider(); 68 | }, 69 | setUpMap : function() { 70 | var ts = (new Date()).getTime(); 71 | L.mapbox.accessToken = 'pk.eyJ1IjoiaHJjLWV2ZW50cyIsImEiOiJjaXNxcnZ5aWgwMmE4MnRtMTBib2JoMWF2In0.yLt9Q6B-IZ2FFQ-KPg3rxg'; 72 | map = L.mapbox.map('map'); 73 | var layer = L.mapbox.styleLayer('mapbox://styles/hrc-events/cisqrwrb300252xpj5ux74kr5').addTo(map); 74 | 75 | // disable default state to preference user location: 76 | //map.setView([40.645159, -73.948441], 10); 77 | hash = new L.Hash(map); 78 | 79 | map.on("dragend",function(){ 80 | if (!eventsApp.moveUpdate()) return; 81 | var meters = map.getBounds().getNorthEast().distanceTo(map.getBounds().getSouthWest()), 82 | miles = meters*0.000621371, 83 | center = map.getCenter(); 84 | searchedLocation = [center.lat, center.lng]; 85 | eventsApp.doEventSearch(center.lat, center.lng, miles/2, false); 86 | }); 87 | map.on("load", function(event) { 88 | console.log("load elapsed="+((new Date()).getTime()-ts)); 89 | }); 90 | layer.on("tileload", function(e) { 91 | console.log("tileload elapsed="+((new Date()).getTime() - ts)); 92 | if (document.getElementById("zipcode")) { 93 | return; // already loaded 94 | } 95 | var script = document.createElement("script"); 96 | script.src = "js/zipcode.js"; 97 | script.id = "zipcode"; 98 | document.getElementsByTagName("head")[0].appendChild(script); 99 | }); 100 | }, 101 | setUpEventHandlers : function() { 102 | d3.select("#radius-select").on("change",function(){ 103 | eventsApp.doEventSearch(searchedLocation[0], searchedLocation[1], eventsApp.getRadius(), true); 104 | }); 105 | d3.select("#move-update").on("change",function(){ 106 | d3.select(".radius-wrapper") 107 | .classed("disabled",document.getElementById('move-update').checked); 108 | }); 109 | d3.select("#search-input").on("keyup",function(){ 110 | eventsApp.processKeyup(d3.event); 111 | }); 112 | d3.select("#mobile-search-input").on("keyup",function(){ 113 | eventsApp.processKeyup(d3.event); 114 | }); 115 | d3.selectAll(".clear-button").on("click",function(){ 116 | eventsApp.clearSearchBox(); 117 | }); 118 | }, 119 | isSmallScreen: function() { 120 | return document.documentElement.clientWidth <= 720; 121 | }, 122 | markerIndex: function(id) { 123 | var markerList = $("#mobile .list-event"); 124 | return markerList.index($('#mobile .list-event[data-id="'+id+'"]')); 125 | }, 126 | moveUpdate: function() { 127 | return $('#move-update:visible').length === 0 || $('#move-update').is(':checked'); 128 | }, 129 | tryForAutoLocation : function() { 130 | // determine if leaflet hash is present or if the browser can't be located 131 | var loadUrl = window.location.href 132 | if (!navigator.geolocation || loadUrl.indexOf('#') > -1) { 133 | var hashParse = hash.parseHash(loadUrl.split('#')[1]) 134 | defaultLocation = [hashParse.center.lat, hashParse.center.lng]; 135 | eventsApp.doEventSearch(defaultLocation[0], defaultLocation[1], eventsApp.getRadius(), true); 136 | return; 137 | } 138 | navigator.geolocation.getCurrentPosition(function(position) { 139 | eventsApp.showMap(position.coords.latitude, position.coords.longitude, 10); 140 | searchedLocation = [position.coords.latitude, position.coords.longitude]; 141 | eventsApp.doEventSearch(searchedLocation[0], searchedLocation[1], eventsApp.getRadius(), true); 142 | }, function error(msg) { 143 | eventsApp.showMap(39.833333, -98.583333, 3); 144 | }, 145 | // if the browser has a cached location thats not more than one hour 146 | // old, we'll just use that to make the page go faster. 147 | {maximumAge: 1000 * 3600}); 148 | }, 149 | showMap: function(lat, lng, zoom) { 150 | // setting the view will fire a moveend event 151 | // we don't want to do an event search, with zoom to markers 152 | map.setView(L.latLng(lat, lng), zoom); 153 | }, 154 | setUpDateSlider: function() { 155 | var thisMonth = new Date(); 156 | thisMonth.setDate(1); 157 | var now = new Date(); 158 | var boundsMax = new Date(2016, 10, 30); 159 | var defaultMax = maxDate; 160 | if (defaultMax > boundsMax) { 161 | defaultMax = boundsMax; 162 | } 163 | var months = [ 164 | 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 165 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' 166 | ]; 167 | jQuery('#dateSlider').dateRangeSlider({ 168 | arrows: false, 169 | bounds: { 170 | min: thisMonth, 171 | max: boundsMax 172 | }, 173 | defaultValues: { 174 | min: now, 175 | max: defaultMax 176 | }, 177 | formatter: function(val) { 178 | return months[val.getMonth()] +' ' + val.getDate(); 179 | }, 180 | scales: [{ 181 | first: function(value){ return value; }, 182 | end: function(value) {return value; }, 183 | next: function(value){ 184 | var next = new Date(value); 185 | return new Date(next.setMonth(value.getMonth() + 1)); 186 | }, 187 | label: function(value){ 188 | return months[value.getMonth()]; 189 | } 190 | }], 191 | valueLabels: 'show' 192 | }); 193 | var self = this; 194 | $('#dateSlider').on('valuesChanged', function(e, data) { 195 | // set min/max dates 196 | minDate = data.values.min; 197 | maxDate = data.values.max; 198 | self.drawEvents(); 199 | }); 200 | }, 201 | formatDate : function(startDate, endDate) { 202 | var start = iso.parse(startDate), 203 | end = endDate ? iso.parse(endDate) : null; 204 | if (end && dateFormat(start) == dateFormat(end)) 205 | var dateString = dateFormat(start) + ", " + hourFormat(start) + " - " + hourFormat(end); 206 | else 207 | var dateString = wholeDate(start) + (end ? (" - " + wholeDate(end)) : ""); 208 | return '' + dateString; 209 | }, 210 | formatLocation: function(p) { 211 | return '' 212 | + (p.name ? p.name + ", " : "") + p.address1 + " " + p.address2 213 | + " " + p.city + " " + p.postalCode; 214 | }, 215 | addMarkers : function(features) { 216 | var newMarkers = []; 217 | var visible = {}; 218 | features.forEach(function(f) { 219 | var marker = markersById[f.lookupId]; 220 | // make new marker if not already created 221 | if (!marker) { 222 | marker = L.marker(L.latLng(f.locations[0].latitude, f.locations[0].longitude), {icon: standardIcon}); 223 | marker.eventId = f.lookupId; 224 | // DEBUGGING RE: EVENT STATUS 225 | if (f.locations[0].status !== 'verified' || f.status !== 'confirmed') { 226 | //console.log(f) 227 | } 228 | var rsvpUrl = 'https://www.hillaryclinton.com/events/view/' + f.lookupId; 229 | marker.bindPopup( 230 | "

"+f.name+"

" 231 | +eventsApp.formatDate(f.startDate, f.endDate) 232 | +"

"+eventsApp.formatLocation(f.locations[0]) 233 | +"

"+f.description 234 | +"

rsvp

" 235 | ); 236 | marker.on('click', function(e) { 237 | eventsApp.clickMarker(e.target, e.originalEvent.clientY); 238 | }); 239 | marker.on('popupopen', function(/*e*/) { 240 | eventsApp.setPopupMarker(this); 241 | }); 242 | marker.on('popupclose', function(/*e*/) { 243 | eventsApp.setPopupMarker(null); 244 | }); 245 | markersById[f.lookupId] = marker; 246 | } 247 | // not already visible 248 | if (!markerGroupIds[f.lookupId]) { 249 | markerGroupIds[f.lookupId] = true; 250 | newMarkers.push(marker); 251 | } 252 | visible[f.lookupId] = marker; 253 | }); 254 | // remove currently visible markers not in features 255 | var removeMarkers = []; 256 | Object.keys(markerGroupIds).forEach(function(id) { 257 | if (markerGroupIds[id] && !visible[id]) { 258 | removeMarkers.push(markersById[id]); 259 | markerGroupIds[id] = false; 260 | } 261 | }); 262 | if (newMarkers.length || removeMarkers.length) { 263 | if (newMarkers.length) { 264 | markerGroup.addLayers(newMarkers); 265 | } 266 | if (removeMarkers.length) { 267 | markerGroup.removeLayers(removeMarkers); 268 | } 269 | } 270 | if (!map.hasLayer(markerGroup)) { 271 | map.addLayer(markerGroup); 272 | } 273 | if (setup && (eventsApp.moveUpdate() || !visible)) { 274 | return; 275 | } 276 | }, 277 | clickMarker: function(marker, clickY) { 278 | if (eventsApp.isSmallScreen()) { 279 | // if marker is outside of middle third, center it 280 | var position = clickY/document.documentElement.clientHeight; 281 | if (position < 0.33 || position > 0.6) { 282 | map.panTo(marker.getLatLng()); 283 | } 284 | eventsApp.highlightMarker(marker); 285 | // open details to this marker 286 | $("#detail").show(); 287 | var index = eventsApp.markerIndex(marker.eventId); 288 | if (!swipe) { 289 | swipe = Swipe(document.getElementById("slider"), { 290 | startSlide: index, 291 | disableScroll: false, 292 | callback: function(index, elem) { 293 | var marker = markersById[$(elem).attr("data-id")]; 294 | eventsApp.swipeToMarker(marker); 295 | } 296 | }); 297 | } else { 298 | swipe.slide(index, 100); 299 | } 300 | } else { 301 | var el = $('.list-event[data-id="'+marker.eventId+'"]'); 302 | $(".list-event").removeClass("selected"); 303 | $(el).addClass("selected"); 304 | var offset = el.offset(); 305 | if (offset) { 306 | $('html, body').animate({ 307 | scrollTop: offset.top 308 | }, 1000); 309 | } 310 | } 311 | }, 312 | getRadius : function() { 313 | var sel = document.getElementById('radius-select'); 314 | return sel.options[sel.selectedIndex].value; 315 | }, 316 | processKeyup : function(event) { 317 | searchInput = event.target.id; 318 | var inputDiv = document.getElementById(searchInput); 319 | var val = inputDiv.value; 320 | 321 | d3.select(".clear-button").style("display","inline-block"); 322 | if (val && val.length) { 323 | d3.select("#mobile .icon-search").style("display", "none"); 324 | d3.select("#mobile .icon-x").style("display", "inline-block"); 325 | } 326 | 327 | if (!val || !val.length) { 328 | d3.select("#mobile .icon-search").style("color", "#333333"); 329 | d3.select("#mobile .icon-x").style("display", "none"); 330 | eventsApp.clearSearchBox(); 331 | } else if (event.keyCode == 40) { //arrow down 332 | keyIndex = Math.min(keyIndex+1, d3.selectAll(".suggestion")[0].length-1); 333 | eventsApp.selectSuggestion(); 334 | 335 | } else if (event.keyCode == 38) { //arrow up 336 | keyIndex = Math.max(keyIndex-1, 0); 337 | eventsApp.selectSuggestion(); 338 | 339 | } else if (event.keyCode == 13) { //enter 340 | eventsApp.onSubmit(val); 341 | 342 | } else if (event.keyCode != 8 && (event.keyCode < 48 || event.keyCode > 90)) { 343 | // restrict autocomplete to 0-9,a-z character input, excluding delete 344 | return; 345 | 346 | } else { 347 | // general case of typing to filter list and get autocomplete suggestions 348 | keyIndex = -1; 349 | eventsApp.throttledDoSuggestion(val); 350 | } 351 | }, 352 | selectSuggestion : function() { 353 | // for handling keyboard input on the autocomplete list 354 | var currentList = d3.selectAll(".suggestion"); 355 | currentList.each(function(d, i){ 356 | if (i == keyIndex) { 357 | document.getElementById(searchInput).value = d.name ? d.name : d.properties.label; 358 | } 359 | }).classed("selected",function(d,i){ return i == keyIndex; }); 360 | }, 361 | doSuggestion : function(query) { 362 | if (xhr) xhr.abort(); 363 | xhr = d3.json("https://search.mapzen.com/v1/autocomplete?text="+query+"&layers=region,locality,neighbourhood&boundary.country=USA&api_key=search-Ff4Gs8o", function(err, results) { 364 | var events = results.features; 365 | // add a zip code result at the top 366 | if (Number(query) && query.length == 5) { 367 | events.unshift({ 368 | properties : { 369 | label : "Zip Code: "+query 370 | }, 371 | name : query 372 | }); 373 | } 374 | eventsApp.showSuggestions(events); 375 | }); 376 | }, 377 | showSuggestions : function(data) { 378 | var selector = ".autocomplete"; 379 | if (searchInput === "mobile-search-input") { 380 | selector += ".mobile"; 381 | } 382 | var suggestion = d3.select(selector) 383 | .selectAll(".suggestion").data(data); 384 | suggestion.enter().append("div").attr("class","suggestion"); 385 | suggestion.exit().remove(); 386 | suggestion.text(function(d){ return d.properties.label; }) 387 | .on("click",function(d){ 388 | var name = d.name ? d.name : d.properties.label; 389 | document.getElementById(searchInput).value = name; 390 | eventsApp.onSubmit(name); 391 | }); 392 | }, 393 | clearSearchBox : function() { 394 | // triggered by "x" click or an empty search box 395 | document.getElementById(searchInput).value = ""; 396 | d3.select(".clear-button").style("display","none"); 397 | d3.selectAll(".suggestion").remove(); 398 | }, 399 | onSubmit: function(query) { 400 | d3.selectAll(".suggestion").remove(); 401 | if (Number(query) && query.length == 5) { // try to identify zip codes 402 | searchedLocation = zip_to_lat[query]; 403 | if (!searchedLocation) { 404 | d3.select("#events").attr("class","search-error"); 405 | return; 406 | } 407 | map.setView(searchedLocation, 12); 408 | eventsApp.doEventSearch(searchedLocation[0],searchedLocation[1], eventsApp.getRadius(), true); 409 | } else 410 | d3.json("https://search.mapzen.com/v1/search?text="+query+"&boundary.country=USA&api_key=search-Ff4Gs8o", function(error, json) { 411 | if (!json.features.length) { 412 | d3.select("#events").attr("class","search-error"); 413 | return; 414 | } 415 | 416 | var selected = json.features[0], 417 | searchedLocation = [selected.geometry.coordinates[1], selected.geometry.coordinates[0]]; 418 | 419 | map.setView(searchedLocation, 12); 420 | eventsApp.doEventSearch(searchedLocation[0],searchedLocation[1], eventsApp.getRadius(), true); 421 | }); 422 | }, 423 | drawEvents: function(fitBounds) { 424 | // events happening at NYC City Hall have a fake location, are not actually happening there, and should not be shown 425 | var minDt = iso(minDate); 426 | var maxDt = iso(maxDate); 427 | var eventsToShow = _.reject(allEvents, function(event) { 428 | if (event.locations[0].latitude == "40.7127837" && event.locations[0].longitude == "-74.0059413") { 429 | return false; 430 | } 431 | return (event.startDate < minDt || event.startDate > maxDt); 432 | }); 433 | eventsApp.addMarkers(eventsToShow); 434 | if (fitBounds) { 435 | var group = new L.featureGroup(); 436 | eventsToShow.forEach(function(ev) { 437 | group.addLayer(markersById[ev.lookupId]); 438 | }); 439 | if (group.getLayers().length) { 440 | map.fitBounds(group.getBounds(), { maxZoom : 12}); 441 | } 442 | } 443 | d3.select("#events").attr("class",eventsToShow.length ? "event" : "error"); 444 | 445 | // sort by location (naive implementation): 446 | // from an initial point (random / first in list), 447 | // calculate the distance of each other point and sort by distance. 448 | try { 449 | // each event should have 1 element in `locations`. 450 | var startingLocation = eventsToShow[0].locations[0]; 451 | 452 | function calcDistance(loc1, loc2) { 453 | // coordinates are decimals as strings 454 | var lat1 = Number(loc1.latitude); 455 | var lat2 = Number(loc2.latitude); 456 | var lng1 = Number(loc1.longitude); 457 | var lng2 = Number(loc2.longitude); 458 | return Math.sqrt( Math.pow(lat2 - lat1, 2) + Math.pow(lng2 - lng1, 2) ); 459 | } 460 | 461 | // add a distance property to each event 462 | eventsToShow.forEach(function(ev) { 463 | ev.sortDistance = calcDistance(ev.locations[0], startingLocation); 464 | }); 465 | eventsToShow.sort(function(a, b) { return b.sortDistance - a.sortDistance; }) 466 | } catch (err) { 467 | console.error('Error sorting by distance', err); 468 | } 469 | 470 | var titles = _.countBy(eventsToShow, function(ev) { 471 | return ev.name; 472 | }); 473 | eventsToShow.forEach(function(ev) { 474 | if (titles[ev.name] > 1) { 475 | ev.name += " ("+dateFormat(iso.parse(ev.startDate))+")"; 476 | } 477 | }); 478 | var events = d3.selectAll(".event-list").selectAll(".list-event") 479 | .data(eventsToShow, function(d) { return d.lookupId; }); 480 | var entering = events.enter().append("div") 481 | .attr("class","list-event") 482 | .attr("data-id", function(d) { return d.lookupId; }); 483 | entering.append("a").attr("class","rsvp noSwipe").text("RSVP"); 484 | entering.append("h3"); 485 | entering.append("p").attr("class","time"); 486 | entering.append("p").attr("class","location"); 487 | entering.append("p").attr("class","description"); 488 | events.exit().remove(); 489 | events.select("h3").text(function(d, i){ return d.name; }) 490 | .attr("class", "zoom-marker"); 491 | events.select(".time").html(function(d){ 492 | return eventsApp.formatDate(d.startDate, d.endDate); 493 | }); 494 | events.select(".location") 495 | .html(function(d){ 496 | return eventsApp.formatLocation(d.locations[0]); 497 | }) 498 | .attr("class", "location zoom-marker"); 499 | events.select(".description").text(function(d){ return d.description; }); 500 | events.select(".rsvp").attr("href",function(d){ return "https://www.hillaryclinton.com/events/view/"+d.lookupId; }); 501 | var width = document.documentElement.clientWidth; 502 | // re-create swipe with newly populated list of events 503 | if (swipe) { 504 | swipe.kill(); 505 | swipe = null; 506 | } 507 | $(".zoom-marker").on("click", function() { 508 | var id = $(this).closest(".list-event").attr("data-id"); 509 | eventsApp.zoomToMarker(markersById[id]); 510 | }); 511 | $(".event-wrapper .list-event").hover( 512 | function() { 513 | var id = $(this).attr("data-id"); 514 | eventsApp.highlightMarker(markersById[id]); 515 | }, 516 | function() { 517 | eventsApp.unhighlightActiveMarker(); 518 | } 519 | ); 520 | $("#mobile .list-event").click(function() { 521 | $("#detail").hide(); 522 | }); 523 | var startY = 0; 524 | $("#mobile .list-event").on("touchstart", function(ev) { 525 | startY = ev.originalEvent.touches[0].pageY; 526 | }); 527 | $("#mobile .list-event").on("touchmove", function(ev) { 528 | var details = $(ev.target).closest(".list-event"); 529 | var current = details.css("top") || "0px"; 530 | current = parseInt(current.replace("px", "")); 531 | var newY = current + ev.originalEvent.touches[0].pageY - startY; 532 | // don't move top of .list-event lower than top of details pane 533 | // don't move bottom of .list-event higher than bottom of details pane 534 | if (newY > 0) { 535 | return; 536 | } 537 | var minY = $('#detail').height() - details.height() - 20; 538 | newY = Math.max(newY, minY); 539 | details.css("top", (newY)+"px"); 540 | }); 541 | $("#dateSlider").dateRangeSlider("resize"); 542 | }, 543 | 544 | highlightMarker: function(marker) { 545 | // reset previously active marker icon 546 | if (activeMarker) { 547 | activeMarker.setIcon(standardIcon); 548 | } 549 | $('.leaflet-marker-icon').removeClass('marker-highlight'); 550 | activeMarker = marker; 551 | if (!marker) { 552 | return; 553 | } 554 | var parent = markerGroup.getVisibleParent(marker); 555 | if (parent === marker) { // single marker 556 | marker.setIcon(activeIcon); 557 | // bring this marker to the top 558 | marker.setZIndexOffset(1000); 559 | } else if (parent) { // cluster group 560 | $(parent._icon).addClass('marker-highlight'); 561 | } 562 | }, 563 | 564 | unhighlightMarker: function(marker) { 565 | if (!marker) { 566 | return; 567 | } 568 | $('.leaflet-marker-icon').removeClass('marker-highlight'); 569 | marker.setIcon(standardIcon); 570 | // put it back to original z-index 571 | marker.setZIndexOffset(-1000); 572 | }, 573 | 574 | unhighlightActiveMarker: function() { 575 | if (!activeMarker) { 576 | return; 577 | } 578 | eventsApp.unhighlightMarker(activeMarker); 579 | activeMarker = null; 580 | }, 581 | 582 | setPopupMarker: function(marker) { 583 | popupMarker = marker; 584 | }, 585 | swipeToMarker: function(marker) { 586 | if (!marker) { 587 | return; 588 | } 589 | var parent = markerGroup.getVisibleParent(marker); 590 | if (parent && parent !== marker) { // cluster group 591 | parent.spiderfy(); 592 | } 593 | eventsApp.highlightMarker(marker); 594 | var markerPos = map.latLngToContainerPoint(marker.getLatLng()); 595 | var detailTop = $("#detail").offset().top; 596 | // hidden below details 597 | if (!markerPos || markerPos.y < 0 || markerPos.y > detailTop) { 598 | map.setView(marker.getLatLng()); 599 | } 600 | }, 601 | zoomToMarker: function(marker) { 602 | // if there's a marker with open popup, close it 603 | // unless it's the one we're zooming to 604 | if (popupMarker && (!marker || marker.eventId !== popupMarker.eventId) ) { 605 | popupMarker.closePopup(); 606 | popupMarker = null; 607 | } 608 | if (!marker) { 609 | return; 610 | } 611 | var parent = markerGroup.getVisibleParent(marker); 612 | if (parent === marker) { // single marker 613 | map.setView(marker.getLatLng(), 13); // clustering disabled 614 | // bring this marker to the top 615 | marker.setZIndexOffset(1000); 616 | } else if (parent) { // cluster group 617 | markerGroup.zoomToShowLayer(marker); 618 | parent.spiderfy(); 619 | } 620 | if (activeMarker) { 621 | // put it back to original z-index 622 | activeMarker.setZIndexOffset(-1000); 623 | activeMarker.setIcon(standardIcon); 624 | } 625 | marker.setIcon(activeIcon); 626 | activeMarker = marker; 627 | }, 628 | 629 | doEventSearch : function(lat, lng, radius, fitBounds) { 630 | // shameful hack to work around all the NYC City Hall events; 631 | // by retrieving 500 results and ignoring the NYC City Hall ones we get reasonable 632 | // behavior for Manhattan users. 633 | var self = this; 634 | $("#details").hide(); 635 | d3.json("https://www.hillaryclinton.com/api/events/events?lat="+lat+"&lng="+lng+"&radius="+radius+"&earliestTime="+earliestTime+"&status=confirmed&visibility=public&perPage=500&onepage=1&_=1457303591599", function(error, json){ 636 | allEvents = json.events; 637 | // uncomment to debug duplicates 638 | /*var dupes = [] [] 639 | for (var e = 0; e < allEvents.length; e++) { 640 | if (allEvents[e].locations[0].name == 'Downtown Campaign Office' && allEvents[e].startDate.substring(0, 10) == '2016-08-29') { 641 | dupes.push(allEvents[e]); 642 | } 643 | } 644 | console.log(dupes)*/ 645 | // bump the radius until an event is found within 150mi 646 | if (allEvents.length < 1 && radius <= 150) { 647 | radius = radius*2; 648 | console.log('too small - bumping to ' + radius + ' miles'); 649 | eventsApp.doEventSearch(lat, lng, radius, fitBounds); 650 | return; 651 | } 652 | self.drawEvents(fitBounds); 653 | }); 654 | } 655 | }; 656 | eventsApp.throttledDoSuggestion = _.throttle(eventsApp.doSuggestion, 50); 657 | return eventsApp; 658 | }; 659 | -------------------------------------------------------------------------------- /js/jQDateRangeSlider-withRuler-5.7.2.min.js: -------------------------------------------------------------------------------- 1 | /*! jQRangeSlider 5.7.2 - 2016-01-18 - Copyright (C) Guillaume Gautreau 2012 - MIT and GPLv3 licenses.*/!function(a,b){"use strict";a.widget("ui.rangeSliderMouseTouch",a.ui.mouse,{enabled:!0,_mouseInit:function(){var b=this;a.ui.mouse.prototype._mouseInit.apply(this),this._mouseDownEvent=!1,this.element.bind("touchstart."+this.widgetName,function(a){return b._touchStart(a)})},_mouseDestroy:function(){a(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName,this._touchEndDelegate),a.ui.mouse.prototype._mouseDestroy.apply(this)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){this._mouseDestroy(),a.ui.mouse.prototype.destroy.apply(this),this._mouseInit=null},_touchStart:function(b){if(!this.enabled)return!1;b.which=1,b.preventDefault(),this._fillTouchEvent(b);var c=this,d=this._mouseDownEvent;this._mouseDown(b),d!==this._mouseDownEvent&&(this._touchEndDelegate=function(a){c._touchEnd(a)},this._touchMoveDelegate=function(a){c._touchMove(a)},a(document).bind("touchmove."+this.widgetName,this._touchMoveDelegate).bind("touchend."+this.widgetName,this._touchEndDelegate))},_mouseDown:function(b){return this.enabled?a.ui.mouse.prototype._mouseDown.apply(this,[b]):!1},_touchEnd:function(b){this._fillTouchEvent(b),this._mouseUp(b),a(document).unbind("touchmove."+this.widgetName,this._touchMoveDelegate).unbind("touchend."+this.widgetName,this._touchEndDelegate),this._mouseDownEvent=!1,a(document).trigger("mouseup")},_touchMove:function(a){return a.preventDefault(),this._fillTouchEvent(a),this._mouseMove(a)},_fillTouchEvent:function(a){var b;b="undefined"==typeof a.targetTouches&&"undefined"==typeof a.changedTouches?a.originalEvent.targetTouches[0]||a.originalEvent.changedTouches[0]:a.targetTouches[0]||a.changedTouches[0],a.pageX=b.pageX,a.pageY=b.pageY,a.which=1}})}(jQuery),function(a,b){"use strict";a.widget("ui.rangeSliderDraggable",a.ui.rangeSliderMouseTouch,{cache:null,options:{containment:null},_create:function(){a.ui.rangeSliderMouseTouch.prototype._create.apply(this),setTimeout(a.proxy(this._initElementIfNotDestroyed,this),10)},destroy:function(){this.cache=null,a.ui.rangeSliderMouseTouch.prototype.destroy.apply(this)},_initElementIfNotDestroyed:function(){this._mouseInit&&this._initElement()},_initElement:function(){this._mouseInit(),this._cache()},_setOption:function(b,c){"containment"===b&&(null===c||0===a(c).length?this.options.containment=null:this.options.containment=a(c))},_mouseStart:function(a){return this._cache(),this.cache.click={left:a.pageX,top:a.pageY},this.cache.initialOffset=this.element.offset(),this._triggerMouseEvent("mousestart"),!0},_mouseDrag:function(a){var b=a.pageX-this.cache.click.left;return b=this._constraintPosition(b+this.cache.initialOffset.left),this._applyPosition(b),this._triggerMouseEvent("sliderDrag"),!1},_mouseStop:function(){this._triggerMouseEvent("stop")},_constraintPosition:function(a){return 0!==this.element.parent().length&&null!==this.cache.parent.offset&&(a=Math.min(a,this.cache.parent.offset.left+this.cache.parent.width-this.cache.width.outer),a=Math.max(a,this.cache.parent.offset.left)),a},_applyPosition:function(a){this._cacheIfNecessary();var b={top:this.cache.offset.top,left:a};this.element.offset({left:a}),this.cache.offset=b},_cacheIfNecessary:function(){null===this.cache&&this._cache()},_cache:function(){this.cache={},this._cacheMargins(),this._cacheParent(),this._cacheDimensions(),this.cache.offset=this.element.offset()},_cacheMargins:function(){this.cache.margin={left:this._parsePixels(this.element,"marginLeft"),right:this._parsePixels(this.element,"marginRight"),top:this._parsePixels(this.element,"marginTop"),bottom:this._parsePixels(this.element,"marginBottom")}},_cacheParent:function(){if(null!==this.options.parent){var a=this.element.parent();this.cache.parent={offset:a.offset(),width:a.width()}}else this.cache.parent=null},_cacheDimensions:function(){this.cache.width={outer:this.element.outerWidth(),inner:this.element.width()}},_parsePixels:function(a,b){return parseInt(a.css(b),10)||0},_triggerMouseEvent:function(a){var b=this._prepareEventData();this.element.trigger(a,b)},_prepareEventData:function(){return{element:this.element,offset:this.cache.offset||null}}})}(jQuery),function(a,b){"use strict";a.widget("ui.rangeSlider",{options:{bounds:{min:0,max:100},defaultValues:{min:20,max:50},wheelMode:null,wheelSpeed:4,arrows:!0,valueLabels:"show",formatter:null,durationIn:0,durationOut:400,delayOut:200,range:{min:!1,max:!1},step:!1,scales:!1,enabled:!0,symmetricPositionning:!1},_values:null,_valuesChanged:!1,_initialized:!1,bar:null,leftHandle:null,rightHandle:null,innerBar:null,container:null,arrows:null,labels:null,changing:{min:!1,max:!1},changed:{min:!1,max:!1},ruler:null,_create:function(){this._setDefaultValues(),this.labels={left:null,right:null,leftDisplayed:!0,rightDisplayed:!0},this.arrows={left:null,right:null},this.changing={min:!1,max:!1},this.changed={min:!1,max:!1},this._createElements(),this._bindResize(),setTimeout(a.proxy(this.resize,this),1),setTimeout(a.proxy(this._initValues,this),1)},_setDefaultValues:function(){this._values={min:this.options.defaultValues.min,max:this.options.defaultValues.max}},_bindResize:function(){var b=this;this._resizeProxy=function(a){b.resize(a)},a(window).resize(this._resizeProxy)},_initWidth:function(){this.container.css("width",this.element.width()-this.container.outerWidth(!0)+this.container.width()),this.innerBar.css("width",this.container.width()-this.innerBar.outerWidth(!0)+this.innerBar.width())},_initValues:function(){this._initialized=!0,this.values(this._values.min,this._values.max)},_setOption:function(a,b){this._setWheelOption(a,b),this._setArrowsOption(a,b),this._setLabelsOption(a,b),this._setLabelsDurations(a,b),this._setFormatterOption(a,b),this._setBoundsOption(a,b),this._setRangeOption(a,b),this._setStepOption(a,b),this._setScalesOption(a,b),this._setEnabledOption(a,b),this._setPositionningOption(a,b)},_validProperty:function(a,b,c){return null===a||"undefined"==typeof a[b]?c:a[b]},_setStepOption:function(a,b){"step"===a&&(this.options.step=b,this._leftHandle("option","step",b),this._rightHandle("option","step",b),this._changed(!0))},_setScalesOption:function(a,b){"scales"===a&&(b===!1||null===b?(this.options.scales=!1,this._destroyRuler()):b instanceof Array&&(this.options.scales=b,this._updateRuler()))},_setRangeOption:function(a,b){"range"===a&&(this._bar("option","range",b),this.options.range=this._bar("option","range"),this._changed(!0))},_setBoundsOption:function(a,b){"bounds"===a&&"undefined"!=typeof b.min&&"undefined"!=typeof b.max&&this.bounds(b.min,b.max)},_setWheelOption:function(a,b){("wheelMode"===a||"wheelSpeed"===a)&&(this._bar("option",a,b),this.options[a]=this._bar("option",a))},_setLabelsOption:function(a,b){if("valueLabels"===a){if("hide"!==b&&"show"!==b&&"change"!==b)return;this.options.valueLabels=b,"hide"!==b?(this._createLabels(),this._leftLabel("update"),this._rightLabel("update")):this._destroyLabels()}},_setFormatterOption:function(a,b){"formatter"===a&&null!==b&&"function"==typeof b&&"hide"!==this.options.valueLabels&&(this._leftLabel("option","formatter",b),this.options.formatter=this._rightLabel("option","formatter",b))},_setArrowsOption:function(a,b){"arrows"!==a||b!==!0&&b!==!1||b===this.options.arrows||(b===!0?(this.element.removeClass("ui-rangeSlider-noArrow").addClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","block"),this.arrows.right.css("display","block"),this.options.arrows=!0):b===!1&&(this.element.addClass("ui-rangeSlider-noArrow").removeClass("ui-rangeSlider-withArrows"),this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.options.arrows=!1),this._initWidth())},_setLabelsDurations:function(a,b){if("durationIn"===a||"durationOut"===a||"delayOut"===a){if(parseInt(b,10)!==b)return;null!==this.labels.left&&this._leftLabel("option",a,b),null!==this.labels.right&&this._rightLabel("option",a,b),this.options[a]=b}},_setEnabledOption:function(a,b){"enabled"===a&&this.toggle(b)},_setPositionningOption:function(a,b){"symmetricPositionning"===a&&(this._rightHandle("option",a,b),this.options[a]=this._leftHandle("option",a,b))},_createElements:function(){"absolute"!==this.element.css("position")&&this.element.css("position","relative"),this.element.addClass("ui-rangeSlider"),this.container=a("
").css("position","absolute").appendTo(this.element),this.innerBar=a("
").css("position","absolute").css("top",0).css("left",0),this._createHandles(),this._createBar(),this.container.prepend(this.innerBar),this._createArrows(),"hide"!==this.options.valueLabels?this._createLabels():this._destroyLabels(),this._updateRuler(),this.options.enabled||this._toggle(this.options.enabled)},_createHandle:function(b){return a("
")[this._handleType()](b).bind("sliderDrag",a.proxy(this._changing,this)).bind("stop",a.proxy(this._changed,this))},_createHandles:function(){this.leftHandle=this._createHandle({isLeft:!0,bounds:this.options.bounds,value:this._values.min,step:this.options.step,symmetricPositionning:this.options.symmetricPositionning}).appendTo(this.container),this.rightHandle=this._createHandle({isLeft:!1,bounds:this.options.bounds,value:this._values.max,step:this.options.step,symmetricPositionning:this.options.symmetricPositionning}).appendTo(this.container)},_createBar:function(){this.bar=a("
").prependTo(this.container).bind("sliderDrag scroll zoom",a.proxy(this._changing,this)).bind("stop",a.proxy(this._changed,this)),this._bar({leftHandle:this.leftHandle,rightHandle:this.rightHandle,values:{min:this._values.min,max:this._values.max},type:this._handleType(),range:this.options.range,wheelMode:this.options.wheelMode,wheelSpeed:this.options.wheelSpeed}),this.options.range=this._bar("option","range"),this.options.wheelMode=this._bar("option","wheelMode"),this.options.wheelSpeed=this._bar("option","wheelSpeed")},_createArrows:function(){this.arrows.left=this._createArrow("left"),this.arrows.right=this._createArrow("right"),this.options.arrows?this.element.addClass("ui-rangeSlider-withArrows"):(this.arrows.left.css("display","none"),this.arrows.right.css("display","none"),this.element.addClass("ui-rangeSlider-noArrow"))},_createArrow:function(b){var c,d=a("
").append("
").addClass("ui-rangeSlider-"+b+"Arrow").css("position","absolute").css(b,0).appendTo(this.element);return c="right"===b?a.proxy(this._scrollRightClick,this):a.proxy(this._scrollLeftClick,this),d.bind("mousedown touchstart",c),d},_proxy:function(a,b,c){var d=Array.prototype.slice.call(c);return a&&a[b]?a[b].apply(a,d):null},_handleType:function(){return"rangeSliderHandle"},_barType:function(){return"rangeSliderBar"},_bar:function(){return this._proxy(this.bar,this._barType(),arguments)},_labelType:function(){return"rangeSliderLabel"},_leftLabel:function(){return this._proxy(this.labels.left,this._labelType(),arguments)},_rightLabel:function(){return this._proxy(this.labels.right,this._labelType(),arguments)},_leftHandle:function(){return this._proxy(this.leftHandle,this._handleType(),arguments)},_rightHandle:function(){return this._proxy(this.rightHandle,this._handleType(),arguments)},_getValue:function(a,b){return b===this.rightHandle&&(a-=b.outerWidth()),a*(this.options.bounds.max-this.options.bounds.min)/(this.container.innerWidth()-b.outerWidth(!0))+this.options.bounds.min},_trigger:function(a){var b=this;setTimeout(function(){b.element.trigger(a,{label:b.element,values:b.values()})},1)},_changing:function(){this._updateValues()&&(this._trigger("valuesChanging"),this._valuesChanged=!0)},_deactivateLabels:function(){"change"===this.options.valueLabels&&(this._leftLabel("option","show","hide"),this._rightLabel("option","show","hide"))},_reactivateLabels:function(){"change"===this.options.valueLabels&&(this._leftLabel("option","show","change"),this._rightLabel("option","show","change"))},_changed:function(a){a===!0&&this._deactivateLabels(),(this._updateValues()||this._valuesChanged)&&(this._trigger("valuesChanged"),a!==!0&&this._trigger("userValuesChanged"),this._valuesChanged=!1),a===!0&&this._reactivateLabels()},_updateValues:function(){var a=this._leftHandle("value"),b=this._rightHandle("value"),c=this._min(a,b),d=this._max(a,b),e=c!==this._values.min||d!==this._values.max;return this._values.min=this._min(a,b),this._values.max=this._max(a,b),e},_min:function(a,b){return Math.min(a,b)},_max:function(a,b){return Math.max(a,b)},_createLabel:function(b,c){var d;return null===b?(d=this._getLabelConstructorParameters(b,c),b=a("
").appendTo(this.element)[this._labelType()](d)):(d=this._getLabelRefreshParameters(b,c),b[this._labelType()](d)),b},_getLabelConstructorParameters:function(a,b){return{handle:b,handleType:this._handleType(),formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getLabelRefreshParameters:function(){return{formatter:this._getFormatter(),show:this.options.valueLabels,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}},_getFormatter:function(){return this.options.formatter===!1||null===this.options.formatter?this._defaultFormatter:this.options.formatter},_defaultFormatter:function(a){return Math.round(a)},_destroyLabel:function(a){return null!==a&&(a[this._labelType()]("destroy"),a.remove(),a=null),a},_createLabels:function(){this.labels.left=this._createLabel(this.labels.left,this.leftHandle),this.labels.right=this._createLabel(this.labels.right,this.rightHandle),this._leftLabel("pair",this.labels.right)},_destroyLabels:function(){this.labels.left=this._destroyLabel(this.labels.left),this.labels.right=this._destroyLabel(this.labels.right)},_stepRatio:function(){return this._leftHandle("stepRatio")},_scrollRightClick:function(a){return this.options.enabled?(a.preventDefault(),this._bar("startScroll"),this._bindStopScroll(),void this._continueScrolling("scrollRight",4*this._stepRatio(),1)):!1},_continueScrolling:function(a,b,c,d){if(!this.options.enabled)return!1;this._bar(a,c),d=d||5,d--;var e=this,f=16,g=Math.max(1,4/this._stepRatio());this._scrollTimeout=setTimeout(function(){0===d&&(b>f?b=Math.max(f,b/1.5):c=Math.min(g,2*c),d=5),e._continueScrolling(a,b,c,d)},b)},_scrollLeftClick:function(a){return this.options.enabled?(a.preventDefault(),this._bar("startScroll"),this._bindStopScroll(),void this._continueScrolling("scrollLeft",4*this._stepRatio(),1)):!1},_bindStopScroll:function(){var b=this;this._stopScrollHandle=function(a){a.preventDefault(),b._stopScroll()},a(document).bind("mouseup touchend",this._stopScrollHandle)},_stopScroll:function(){a(document).unbind("mouseup touchend",this._stopScrollHandle),this._stopScrollHandle=null,this._bar("stopScroll"),clearTimeout(this._scrollTimeout)},_createRuler:function(){this.ruler=a("
").appendTo(this.innerBar)},_setRulerParameters:function(){this.ruler.ruler({min:this.options.bounds.min,max:this.options.bounds.max,scales:this.options.scales})},_destroyRuler:function(){null!==this.ruler&&a.fn.ruler&&(this.ruler.ruler("destroy"),this.ruler.remove(),this.ruler=null)},_updateRuler:function(){this._destroyRuler(),this.options.scales!==!1&&a.fn.ruler&&(this._createRuler(),this._setRulerParameters())},values:function(a,b){var c;if("undefined"!=typeof a&&"undefined"!=typeof b){if(!this._initialized)return this._values.min=a,this._values.max=b,this._values;this._deactivateLabels(),c=this._bar("values",a,b),this._changed(!0),this._reactivateLabels()}else c=this._bar("values",a,b);return c},min:function(a){return this._values.min=this.values(a,this._values.max).min,this._values.min},max:function(a){return this._values.max=this.values(this._values.min,a).max,this._values.max},bounds:function(a,b){return this._isValidValue(a)&&this._isValidValue(b)&&b>a&&(this._setBounds(a,b),this._updateRuler(),this._changed(!0)),this.options.bounds},_isValidValue:function(a){return"undefined"!=typeof a&&parseFloat(a)===a},_setBounds:function(a,b){this.options.bounds={min:a,max:b},this._leftHandle("option","bounds",this.options.bounds),this._rightHandle("option","bounds",this.options.bounds),this._bar("option","bounds",this.options.bounds)},zoomIn:function(a){this._bar("zoomIn",a)},zoomOut:function(a){this._bar("zoomOut",a)},scrollLeft:function(a){this._bar("startScroll"),this._bar("scrollLeft",a),this._bar("stopScroll")},scrollRight:function(a){this._bar("startScroll"),this._bar("scrollRight",a),this._bar("stopScroll")},resize:function(){this.container&&(this._initWidth(),this._leftHandle("update"),this._rightHandle("update"),this._bar("update"))},enable:function(){this.toggle(!0)},disable:function(){this.toggle(!1)},toggle:function(a){a===b&&(a=!this.options.enabled),this.options.enabled!==a&&this._toggle(a)},_toggle:function(a){this.options.enabled=a,this.element.toggleClass("ui-rangeSlider-disabled",!a);var b=a?"enable":"disable";this._bar(b),this._leftHandle(b),this._rightHandle(b),this._leftLabel(b),this._rightLabel(b)},destroy:function(){this.element.removeClass("ui-rangeSlider-withArrows ui-rangeSlider-noArrow ui-rangeSlider-disabled"),this._destroyWidgets(),this._destroyElements(),this.element.removeClass("ui-rangeSlider"),this.options=null,a(window).unbind("resize",this._resizeProxy),this._resizeProxy=null,this._bindResize=null,a.Widget.prototype.destroy.apply(this,arguments)},_destroyWidget:function(a){this["_"+a]("destroy"),this[a].remove(),this[a]=null},_destroyWidgets:function(){this._destroyWidget("bar"),this._destroyWidget("leftHandle"),this._destroyWidget("rightHandle"),this._destroyRuler(),this._destroyLabels()},_destroyElements:function(){this.container.remove(),this.container=null,this.innerBar.remove(),this.innerBar=null,this.arrows.left.remove(),this.arrows.right.remove(),this.arrows=null}})}(jQuery),function(a,b){"use strict";a.widget("ui.rangeSliderHandle",a.ui.rangeSliderDraggable,{currentMove:null,margin:0,parentElement:null,options:{isLeft:!0,bounds:{min:0,max:100},range:!1,value:0,step:!1},_value:0,_left:0,_create:function(){a.ui.rangeSliderDraggable.prototype._create.apply(this),this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-handle").toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft),this.element.append("
"),this._value=this._constraintValue(this.options.value)},destroy:function(){this.element.empty(),a.ui.rangeSliderDraggable.prototype.destroy.apply(this)},_setOption:function(b,c){"isLeft"!==b||c!==!0&&c!==!1||c===this.options.isLeft?"step"===b&&this._checkStep(c)?(this.options.step=c,this.update()):"bounds"===b?(this.options.bounds=c,this.update()):"range"===b&&this._checkRange(c)?(this.options.range=c,this.update()):"symmetricPositionning"===b&&(this.options.symmetricPositionning=c===!0,this.update()):(this.options.isLeft=c,this.element.toggleClass("ui-rangeSlider-leftHandle",this.options.isLeft).toggleClass("ui-rangeSlider-rightHandle",!this.options.isLeft),this._position(this._value),this.element.trigger("switch",this.options.isLeft)),a.ui.rangeSliderDraggable.prototype._setOption.apply(this,[b,c])},_checkRange:function(a){return a===!1||!this._isValidValue(a.min)&&!this._isValidValue(a.max)},_isValidValue:function(a){return"undefined"!=typeof a&&a!==!1&&parseFloat(a)!==a},_checkStep:function(a){return a===!1||parseFloat(a)===a},_initElement:function(){a.ui.rangeSliderDraggable.prototype._initElement.apply(this),0===this.cache.parent.width||null===this.cache.parent.width?setTimeout(a.proxy(this._initElementIfNotDestroyed,this),500):(this._position(this._value),this._triggerMouseEvent("initialize"))},_bounds:function(){return this.options.bounds},_cache:function(){a.ui.rangeSliderDraggable.prototype._cache.apply(this),this._cacheParent()},_cacheParent:function(){var a=this.element.parent();this.cache.parent={element:a,offset:a.offset(),padding:{left:this._parsePixels(a,"paddingLeft")},width:a.width()}},_position:function(a){var b=this._getPositionForValue(a);this._applyPosition(b)},_constraintPosition:function(a){var b=this._getValueForPosition(a);return this._getPositionForValue(b)},_applyPosition:function(b){a.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[b]),this._left=b,this._setValue(this._getValueForPosition(b)),this._triggerMouseEvent("moving")},_prepareEventData:function(){var b=a.ui.rangeSliderDraggable.prototype._prepareEventData.apply(this);return b.value=this._value,b},_setValue:function(a){a!==this._value&&(this._value=a)},_constraintValue:function(a){if(a=Math.min(a,this._bounds().max),a=Math.max(a,this._bounds().min),a=this._round(a),this.options.range!==!1){var b=this.options.range.min||!1,c=this.options.range.max||!1;b!==!1&&(a=Math.max(a,this._round(b))),c!==!1&&(a=Math.min(a,this._round(c))),a=Math.min(a,this._bounds().max),a=Math.max(a,this._bounds().min)}return a},_round:function(a){return this.options.step!==!1&&this.options.step>0?Math.round(a/this.options.step)*this.options.step:a},_getPositionForValue:function(a){if(!this.cache||!this.cache.parent||null===this.cache.parent.offset)return 0;a=this._constraintValue(a);var b=(a-this.options.bounds.min)/(this.options.bounds.max-this.options.bounds.min),c=this.cache.parent.width,d=this.cache.parent.offset.left,e=this.options.isLeft?0:this.cache.width.outer;return this.options.symmetricPositionning?b*(c-2*this.cache.width.outer)+d+e:b*c+d-e},_getValueForPosition:function(a){var b=this._getRawValueForPositionAndBounds(a,this.options.bounds.min,this.options.bounds.max);return this._constraintValue(b)},_getRawValueForPositionAndBounds:function(a,b,c){var d,e,f=null===this.cache.parent.offset?0:this.cache.parent.offset.left;return this.options.symmetricPositionning?(a-=this.options.isLeft?0:this.cache.width.outer,d=this.cache.parent.width-2*this.cache.width.outer):(a+=this.options.isLeft?0:this.cache.width.outer,d=this.cache.parent.width),0===d?this._value:(e=(a-f)/d,e*(c-b)+b)},value:function(a){return"undefined"!=typeof a&&(this._cache(),a=this._constraintValue(a),this._position(a)),this._value},update:function(){this._cache();var a=this._constraintValue(this._value),b=this._getPositionForValue(a);a!==this._value?(this._triggerMouseEvent("updating"),this._position(a),this._triggerMouseEvent("update")):b!==this.cache.offset.left&&(this._triggerMouseEvent("updating"),this._position(a),this._triggerMouseEvent("update"))},position:function(a){return"undefined"!=typeof a&&(this._cache(),a=this._constraintPosition(a),this._applyPosition(a)),this._left},add:function(a,b){return a+b},substract:function(a,b){return a-b},stepsBetween:function(a,b){return this.options.step===!1?b-a:(b-a)/this.options.step},multiplyStep:function(a,b){return a*b},moveRight:function(a){var b;return this.options.step===!1?(b=this._left,this.position(this._left+a),this._left-b):(b=this._value,this.value(this.add(b,this.multiplyStep(this.options.step,a))),this.stepsBetween(b,this._value))},moveLeft:function(a){return-this.moveRight(-a)},stepRatio:function(){if(this.options.step===!1)return 1;var a=(this.options.bounds.max-this.options.bounds.min)/this.options.step;return this.cache.parent.width/a}})}(jQuery),function(a,b){"use strict";function c(a,b){return"undefined"==typeof a?b||!1:a}a.widget("ui.rangeSliderBar",a.ui.rangeSliderDraggable,{options:{leftHandle:null,rightHandle:null,bounds:{min:0,max:100},type:"rangeSliderHandle",range:!1,drag:function(){},stop:function(){},values:{min:0,max:20},wheelSpeed:4,wheelMode:null},_values:{min:0,max:20},_waitingToInit:2,_wheelTimeout:!1,_create:function(){a.ui.rangeSliderDraggable.prototype._create.apply(this),this.element.css("position","absolute").css("top",0).addClass("ui-rangeSlider-bar"),this.options.leftHandle.bind("initialize",a.proxy(this._onInitialized,this)).bind("mousestart",a.proxy(this._cache,this)).bind("stop",a.proxy(this._onHandleStop,this)),this.options.rightHandle.bind("initialize",a.proxy(this._onInitialized,this)).bind("mousestart",a.proxy(this._cache,this)).bind("stop",a.proxy(this._onHandleStop,this)),this._bindHandles(),this._values=this.options.values,this._setWheelModeOption(this.options.wheelMode)},destroy:function(){this.options.leftHandle.unbind(".bar"),this.options.rightHandle.unbind(".bar"),this.options=null,a.ui.rangeSliderDraggable.prototype.destroy.apply(this)},_setOption:function(a,b){"range"===a?this._setRangeOption(b):"wheelSpeed"===a?this._setWheelSpeedOption(b):"wheelMode"===a&&this._setWheelModeOption(b)},_setRangeOption:function(a){if(("object"!=typeof a||null===a)&&(a=!1),a!==!1||this.options.range!==!1){if(a!==!1){var b=c(a.min,this.options.range.min),d=c(a.max,this.options.range.max);this.options.range={min:b,max:d}}else this.options.range=!1;this._setLeftRange(),this._setRightRange()}},_setWheelSpeedOption:function(a){"number"==typeof a&&0!==a&&(this.options.wheelSpeed=a)},_setWheelModeOption:function(a){(null===a||a===!1||"zoom"===a||"scroll"===a)&&(this.options.wheelMode!==a&&this.element.parent().unbind("mousewheel.bar"),this._bindMouseWheel(a),this.options.wheelMode=a)},_bindMouseWheel:function(b){"zoom"===b?this.element.parent().bind("mousewheel.bar",a.proxy(this._mouseWheelZoom,this)):"scroll"===b&&this.element.parent().bind("mousewheel.bar",a.proxy(this._mouseWheelScroll,this))},_setLeftRange:function(){if(this.options.range===!1)return!1;var a=this._values.max,b={min:!1,max:!1};"undefined"!=typeof this.options.range.min&&this.options.range.min!==!1?b.max=this._leftHandle("substract",a,this.options.range.min):b.max=!1,"undefined"!=typeof this.options.range.max&&this.options.range.max!==!1?b.min=this._leftHandle("substract",a,this.options.range.max):b.min=!1,this._leftHandle("option","range",b)},_setRightRange:function(){var a=this._values.min,b={min:!1,max:!1};"undefined"!=typeof this.options.range.min&&this.options.range.min!==!1?b.min=this._rightHandle("add",a,this.options.range.min):b.min=!1,"undefined"!=typeof this.options.range.max&&this.options.range.max!==!1?b.max=this._rightHandle("add",a,this.options.range.max):b.max=!1,this._rightHandle("option","range",b)},_deactivateRange:function(){this._leftHandle("option","range",!1),this._rightHandle("option","range",!1)},_reactivateRange:function(){this._setRangeOption(this.options.range)},_onInitialized:function(){this._waitingToInit--,0===this._waitingToInit&&this._initMe()},_initMe:function(){this._cache(),this.min(this._values.min),this.max(this._values.max);var a=this._leftHandle("position"),b=this._rightHandle("position")+this.options.rightHandle.width();this.element.offset({left:a}),this.element.css("width",b-a)},_leftHandle:function(){return this._handleProxy(this.options.leftHandle,arguments)},_rightHandle:function(){return this._handleProxy(this.options.rightHandle,arguments)},_handleProxy:function(a,b){var c=Array.prototype.slice.call(b);return a[this.options.type].apply(a,c)},_cache:function(){a.ui.rangeSliderDraggable.prototype._cache.apply(this),this._cacheHandles()},_cacheHandles:function(){this.cache.rightHandle={},this.cache.rightHandle.width=this.options.rightHandle.width(),this.cache.rightHandle.offset=this.options.rightHandle.offset(),this.cache.leftHandle={},this.cache.leftHandle.offset=this.options.leftHandle.offset()},_mouseStart:function(b){a.ui.rangeSliderDraggable.prototype._mouseStart.apply(this,[b]),this._deactivateRange()},_mouseStop:function(b){a.ui.rangeSliderDraggable.prototype._mouseStop.apply(this,[b]),this._cacheHandles(),this._values.min=this._leftHandle("value"),this._values.max=this._rightHandle("value"),this._reactivateRange(),this._leftHandle().trigger("stop"),this._rightHandle().trigger("stop")},_onDragLeftHandle:function(a,b){if(this._cacheIfNecessary(),b.element[0]===this.options.leftHandle[0]){if(this._switchedValues())return this._switchHandles(),void this._onDragRightHandle(a,b);this._values.min=b.value,this.cache.offset.left=b.offset.left,this.cache.leftHandle.offset=b.offset,this._positionBar()}},_onDragRightHandle:function(a,b){if(this._cacheIfNecessary(),b.element[0]===this.options.rightHandle[0]){if(this._switchedValues())return this._switchHandles(),void this._onDragLeftHandle(a,b);this._values.max=b.value,this.cache.rightHandle.offset=b.offset,this._positionBar()}},_positionBar:function(){var a=this.cache.rightHandle.offset.left+this.cache.rightHandle.width-this.cache.leftHandle.offset.left;this.cache.width.inner=a,this.element.css("width",a).offset({left:this.cache.leftHandle.offset.left})},_onHandleStop:function(){this._setLeftRange(),this._setRightRange()},_switchedValues:function(){if(this.min()>this.max()){var a=this._values.min;return this._values.min=this._values.max,this._values.max=a,!0}return!1},_switchHandles:function(){var a=this.options.leftHandle;this.options.leftHandle=this.options.rightHandle,this.options.rightHandle=a,this._leftHandle("option","isLeft",!0),this._rightHandle("option","isLeft",!1),this._bindHandles(),this._cacheHandles()},_bindHandles:function(){this.options.leftHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",a.proxy(this._onDragLeftHandle,this)),this.options.rightHandle.unbind(".bar").bind("sliderDrag.bar update.bar moving.bar",a.proxy(this._onDragRightHandle,this))},_constraintPosition:function(b){var c,d={};return d.left=a.ui.rangeSliderDraggable.prototype._constraintPosition.apply(this,[b]),d.left=this._leftHandle("position",d.left),c=this._rightHandle("position",d.left+this.cache.width.outer-this.cache.rightHandle.width),d.width=c-d.left+this.cache.rightHandle.width,d},_applyPosition:function(b){a.ui.rangeSliderDraggable.prototype._applyPosition.apply(this,[b.left]),this.element.width(b.width)},_mouseWheelZoom:function(b,c,d,e){if(!this.enabled)return!1;var f=this._values.min+(this._values.max-this._values.min)/2,g={},h={};return this.options.range===!1||this.options.range.min===!1?(g.max=f,h.min=f):(g.max=f-this.options.range.min/2,h.min=f+this.options.range.min/2),this.options.range!==!1&&this.options.range.max!==!1&&(g.min=f-this.options.range.max/2,h.max=f+this.options.range.max/2),this._leftHandle("option","range",g),this._rightHandle("option","range",h),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(a.proxy(this._wheelStop,this),200),this.zoomIn(e*this.options.wheelSpeed),!1},_mouseWheelScroll:function(b,c,d,e){return this.enabled?(this._wheelTimeout===!1?this.startScroll():clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(a.proxy(this._wheelStop,this),200),this.scrollLeft(e*this.options.wheelSpeed),!1):!1},_wheelStop:function(){this.stopScroll(),this._wheelTimeout=!1},min:function(a){return this._leftHandle("value",a)},max:function(a){return this._rightHandle("value",a)},startScroll:function(){this._deactivateRange()},stopScroll:function(){this._reactivateRange(),this._triggerMouseEvent("stop"),this._leftHandle().trigger("stop"),this._rightHandle().trigger("stop")},scrollLeft:function(a){return a=a||1,0>a?this.scrollRight(-a):(a=this._leftHandle("moveLeft",a),this._rightHandle("moveLeft",a),this.update(),void this._triggerMouseEvent("scroll"))},scrollRight:function(a){return a=a||1,0>a?this.scrollLeft(-a):(a=this._rightHandle("moveRight",a),this._leftHandle("moveRight",a),this.update(),void this._triggerMouseEvent("scroll"))},zoomIn:function(a){if(a=a||1,0>a)return this.zoomOut(-a);var b=this._rightHandle("moveLeft",a);a>b&&(b/=2,this._rightHandle("moveRight",b)),this._leftHandle("moveRight",b),this.update(),this._triggerMouseEvent("zoom")},zoomOut:function(a){if(a=a||1,0>a)return this.zoomIn(-a);var b=this._rightHandle("moveRight",a);a>b&&(b/=2,this._rightHandle("moveLeft",b)),this._leftHandle("moveLeft",b),this.update(),this._triggerMouseEvent("zoom")},values:function(a,b){if("undefined"!=typeof a&&"undefined"!=typeof b){var c=Math.min(a,b),d=Math.max(a,b); 2 | this._deactivateRange(),this.options.leftHandle.unbind(".bar"),this.options.rightHandle.unbind(".bar"),this._values.min=this._leftHandle("value",c),this._values.max=this._rightHandle("value",d),this._bindHandles(),this._reactivateRange(),this.update()}return{min:this._values.min,max:this._values.max}},update:function(){this._values.min=this.min(),this._values.max=this.max(),this._cache(),this._positionBar()}})}(jQuery),function(a,b){"use strict";function c(b,c,d,e){this.label1=b,this.label2=c,this.type=d,this.options=e,this.handle1=this.label1[this.type]("option","handle"),this.handle2=this.label2[this.type]("option","handle"),this.cache=null,this.left=b,this.right=c,this.moving=!1,this.initialized=!1,this.updating=!1,this.Init=function(){this.BindHandle(this.handle1),this.BindHandle(this.handle2),"show"===this.options.show?(setTimeout(a.proxy(this.PositionLabels,this),1),this.initialized=!0):setTimeout(a.proxy(this.AfterInit,this),1e3),this._resizeProxy=a.proxy(this.onWindowResize,this),a(window).resize(this._resizeProxy)},this.Destroy=function(){this._resizeProxy&&(a(window).unbind("resize",this._resizeProxy),this._resizeProxy=null,this.handle1.unbind(".positionner"),this.handle1=null,this.handle2.unbind(".positionner"),this.handle2=null,this.label1=null,this.label2=null,this.left=null,this.right=null),this.cache=null},this.AfterInit=function(){this.initialized=!0},this.Cache=function(){"none"!==this.label1.css("display")&&(this.cache={},this.cache.label1={},this.cache.label2={},this.cache.handle1={},this.cache.handle2={},this.cache.offsetParent={},this.CacheElement(this.label1,this.cache.label1),this.CacheElement(this.label2,this.cache.label2),this.CacheElement(this.handle1,this.cache.handle1),this.CacheElement(this.handle2,this.cache.handle2),this.CacheElement(this.label1.offsetParent(),this.cache.offsetParent))},this.CacheIfNecessary=function(){null===this.cache?this.Cache():(this.CacheWidth(this.label1,this.cache.label1),this.CacheWidth(this.label2,this.cache.label2),this.CacheHeight(this.label1,this.cache.label1),this.CacheHeight(this.label2,this.cache.label2),this.CacheWidth(this.label1.offsetParent(),this.cache.offsetParent))},this.CacheElement=function(a,b){this.CacheWidth(a,b),this.CacheHeight(a,b),b.offset=a.offset(),b.margin={left:this.ParsePixels("marginLeft",a),right:this.ParsePixels("marginRight",a)},b.border={left:this.ParsePixels("borderLeftWidth",a),right:this.ParsePixels("borderRightWidth",a)}},this.CacheWidth=function(a,b){b.width=a.width(),b.outerWidth=a.outerWidth()},this.CacheHeight=function(a,b){b.outerHeightMargin=a.outerHeight(!0)},this.ParsePixels=function(a,b){return parseInt(b.css(a),10)||0},this.BindHandle=function(b){b.bind("updating.positionner",a.proxy(this.onHandleUpdating,this)),b.bind("update.positionner",a.proxy(this.onHandleUpdated,this)),b.bind("moving.positionner",a.proxy(this.onHandleMoving,this)),b.bind("stop.positionner",a.proxy(this.onHandleStop,this))},this.PositionLabels=function(){if(this.CacheIfNecessary(),null!==this.cache){var a=this.GetRawPosition(this.cache.label1,this.cache.handle1),b=this.GetRawPosition(this.cache.label2,this.cache.handle2);this.label1[d]("option","isLeft")?this.ConstraintPositions(a,b):this.ConstraintPositions(b,a),this.PositionLabel(this.label1,a.left,this.cache.label1),this.PositionLabel(this.label2,b.left,this.cache.label2)}},this.PositionLabel=function(a,b,c){var d,e,f,g=this.cache.offsetParent.offset.left+this.cache.offsetParent.border.left;g-b>=0?(a.css("right",""),a.offset({left:b})):(d=g+this.cache.offsetParent.width,e=b+c.margin.left+c.outerWidth+c.margin.right,f=d-e,a.css("left",""),a.css("right",f))},this.ConstraintPositions=function(a,b){(a.centerb.outerLeft||a.center>b.center&&b.outerRight>a.outerLeft)&&(a=this.getLeftPosition(a,b),b=this.getRightPosition(a,b))},this.getLeftPosition=function(a,b){var c=(b.center+a.center)/2,d=c-a.cache.outerWidth-a.cache.margin.right+a.cache.border.left;return a.left=d,a},this.getRightPosition=function(a,b){var c=(b.center+a.center)/2;return b.left=c+b.cache.margin.left+b.cache.border.left,b},this.ShowIfNecessary=function(){"show"===this.options.show||this.moving||!this.initialized||this.updating||(this.label1.stop(!0,!0).fadeIn(this.options.durationIn||0),this.label2.stop(!0,!0).fadeIn(this.options.durationIn||0),this.moving=!0)},this.HideIfNeeded=function(){this.moving===!0&&(this.label1.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut||0),this.label2.stop(!0,!0).delay(this.options.delayOut||0).fadeOut(this.options.durationOut||0),this.moving=!1)},this.onHandleMoving=function(a,b){this.ShowIfNecessary(),this.CacheIfNecessary(),this.UpdateHandlePosition(b),this.PositionLabels()},this.onHandleUpdating=function(){this.updating=!0},this.onHandleUpdated=function(){this.updating=!1,this.cache=null},this.onHandleStop=function(){this.HideIfNeeded()},this.onWindowResize=function(){this.cache=null},this.UpdateHandlePosition=function(a){null!==this.cache&&(a.element[0]===this.handle1[0]?this.UpdatePosition(a,this.cache.handle1):this.UpdatePosition(a,this.cache.handle2))},this.UpdatePosition=function(a,b){b.offset=a.offset,b.value=a.value},this.GetRawPosition=function(a,b){var c=b.offset.left+b.outerWidth/2,d=c-a.outerWidth/2,e=d+a.outerWidth-a.border.left-a.border.right,f=d-a.margin.left-a.border.left,g=b.offset.top-a.outerHeightMargin;return{left:d,outerLeft:f,top:g,right:e,outerRight:f+a.outerWidth+a.margin.left+a.margin.right,cache:a,center:c}},this.Init()}a.widget("ui.rangeSliderLabel",a.ui.rangeSliderMouseTouch,{options:{handle:null,formatter:!1,handleType:"rangeSliderHandle",show:"show",durationIn:0,durationOut:500,delayOut:500,isLeft:!1},cache:null,_positionner:null,_valueContainer:null,_innerElement:null,_value:null,_create:function(){this.options.isLeft=this._handle("option","isLeft"),this.element.addClass("ui-rangeSlider-label").css("position","absolute").css("display","block"),this._createElements(),this._toggleClass(),this.options.handle.bind("moving.label",a.proxy(this._onMoving,this)).bind("update.label",a.proxy(this._onUpdate,this)).bind("switch.label",a.proxy(this._onSwitch,this)),"show"!==this.options.show&&this.element.hide(),this._mouseInit()},destroy:function(){this.options.handle.unbind(".label"),this.options.handle=null,this._valueContainer=null,this._innerElement=null,this.element.empty(),this._positionner&&(this._positionner.Destroy(),this._positionner=null),a.ui.rangeSliderMouseTouch.prototype.destroy.apply(this)},_createElements:function(){this._valueContainer=a("
").appendTo(this.element),this._innerElement=a("
").appendTo(this.element)},_handle:function(){var a=Array.prototype.slice.apply(arguments);return this.options.handle[this.options.handleType].apply(this.options.handle,a)},_setOption:function(a,b){"show"===a?this._updateShowOption(b):("durationIn"===a||"durationOut"===a||"delayOut"===a)&&this._updateDurations(a,b),this._setFormatterOption(a,b)},_setFormatterOption:function(a,b){"formatter"===a&&("function"==typeof b||b===!1)&&(this.options.formatter=b,this._display(this._value))},_updateShowOption:function(a){this.options.show=a,"show"!==this.options.show?(this.element.hide(),this._positionner.moving=!1):(this.element.show(),this._display(this.options.handle[this.options.handleType]("value")),this._positionner.PositionLabels()),this._positionner.options.show=this.options.show},_updateDurations:function(a,b){parseInt(b,10)===b&&(this._positionner.options[a]=b,this.options[a]=b)},_display:function(a){this.options.formatter===!1?this._displayText(Math.round(a)):this._displayText(this.options.formatter(a)),this._value=a},_displayText:function(a){this._valueContainer.text(a)},_toggleClass:function(){this.element.toggleClass("ui-rangeSlider-leftLabel",this.options.isLeft).toggleClass("ui-rangeSlider-rightLabel",!this.options.isLeft)},_positionLabels:function(){this._positionner.PositionLabels()},_mouseDown:function(a){this.options.handle.trigger(a)},_mouseUp:function(a){this.options.handle.trigger(a)},_mouseMove:function(a){this.options.handle.trigger(a)},_onMoving:function(a,b){this._display(b.value)},_onUpdate:function(){"show"===this.options.show&&this.update()},_onSwitch:function(a,b){this.options.isLeft=b,this._toggleClass(),this._positionLabels()},pair:function(a){null===this._positionner&&(this._positionner=new c(this.element,a,this.widgetName,{show:this.options.show,durationIn:this.options.durationIn,durationOut:this.options.durationOut,delayOut:this.options.delayOut}),a[this.widgetName]("positionner",this._positionner))},positionner:function(a){return"undefined"!=typeof a&&(this._positionner=a),this._positionner},update:function(){this._positionner.cache=null,this._display(this._handle("value")),"show"===this.options.show&&this._positionLabels()}})}(jQuery),function(a,b){"use strict";a.widget("ui.dateRangeSlider",a.ui.rangeSlider,{options:{bounds:{min:new Date(2010,0,1).valueOf(),max:new Date(2012,0,1).valueOf()},defaultValues:{min:new Date(2010,1,11).valueOf(),max:new Date(2011,1,11).valueOf()}},_create:function(){a.ui.rangeSlider.prototype._create.apply(this),this.element.addClass("ui-dateRangeSlider")},destroy:function(){this.element.removeClass("ui-dateRangeSlider"),a.ui.rangeSlider.prototype.destroy.apply(this)},_setDefaultValues:function(){this._values={min:this.options.defaultValues.min.valueOf(),max:this.options.defaultValues.max.valueOf()}},_setRulerParameters:function(){this.ruler.ruler({min:new Date(this.options.bounds.min.valueOf()),max:new Date(this.options.bounds.max.valueOf()),scales:this.options.scales})},_setOption:function(b,c){("defaultValues"===b||"bounds"===b)&&"undefined"!=typeof c&&null!==c&&this._isValidDate(c.min)&&this._isValidDate(c.max)?a.ui.rangeSlider.prototype._setOption.apply(this,[b,{min:c.min.valueOf(),max:c.max.valueOf()}]):a.ui.rangeSlider.prototype._setOption.apply(this,this._toArray(arguments))},_handleType:function(){return"dateRangeSliderHandle"},option:function(b){if("bounds"===b||"defaultValues"===b){var c=a.ui.rangeSlider.prototype.option.apply(this,arguments);return{min:new Date(c.min),max:new Date(c.max)}}return a.ui.rangeSlider.prototype.option.apply(this,this._toArray(arguments))},_defaultFormatter:function(a){var b=a.getMonth()+1,c=a.getDate();return""+a.getFullYear()+"-"+(10>b?"0"+b:b)+"-"+(10>c?"0"+c:c)},_getFormatter:function(){var a=this.options.formatter;return(this.options.formatter===!1||null===this.options.formatter)&&(a=this._defaultFormatter),function(a){return function(b){return a(new Date(b))}}(a)},values:function(b,c){var d=null;return d=this._isValidDate(b)&&this._isValidDate(c)?a.ui.rangeSlider.prototype.values.apply(this,[b.valueOf(),c.valueOf()]):a.ui.rangeSlider.prototype.values.apply(this,this._toArray(arguments)),{min:new Date(d.min),max:new Date(d.max)}},min:function(b){return this._isValidDate(b)?new Date(a.ui.rangeSlider.prototype.min.apply(this,[b.valueOf()])):new Date(a.ui.rangeSlider.prototype.min.apply(this))},max:function(b){return this._isValidDate(b)?new Date(a.ui.rangeSlider.prototype.max.apply(this,[b.valueOf()])):new Date(a.ui.rangeSlider.prototype.max.apply(this))},bounds:function(b,c){var d;return d=this._isValidDate(b)&&this._isValidDate(c)?a.ui.rangeSlider.prototype.bounds.apply(this,[b.valueOf(),c.valueOf()]):a.ui.rangeSlider.prototype.bounds.apply(this,this._toArray(arguments)),{min:new Date(d.min),max:new Date(d.max)}},_isValidDate:function(a){return"undefined"!=typeof a&&a instanceof Date},_toArray:function(a){return Array.prototype.slice.call(a)}})}(jQuery),function(a,b){"use strict";a.widget("ui.dateRangeSliderHandle",a.ui.rangeSliderHandle,{_steps:!1,_boundsValues:{},_create:function(){this._createBoundsValues(),a.ui.rangeSliderHandle.prototype._create.apply(this)},_getValueForPosition:function(a){var b=this._getRawValueForPositionAndBounds(a,this.options.bounds.min.valueOf(),this.options.bounds.max.valueOf());return this._constraintValue(new Date(b))},_setOption:function(b,c){return"step"===b?(this.options.step=c,this._createSteps(),void this.update()):(a.ui.rangeSliderHandle.prototype._setOption.apply(this,[b,c]),void("bounds"===b&&this._createBoundsValues()))},_createBoundsValues:function(){this._boundsValues={min:this.options.bounds.min.valueOf(),max:this.options.bounds.max.valueOf()}},_bounds:function(){return this._boundsValues},_createSteps:function(){if(this.options.step===!1||!this._isValidStep())return void(this._steps=!1);var a=new Date(this.options.bounds.min.valueOf()),b=new Date(this.options.bounds.max.valueOf()),c=a,d=0,e=new Date;for(this._steps=[];b>=c&&(1===d||e.valueOf()!==c.valueOf());)e=c,this._steps.push(c.valueOf()),c=this._addStep(a,d,this.options.step),d++;e.valueOf()===c.valueOf()&&(this._steps=!1)},_isValidStep:function(){return"object"==typeof this.options.step},_addStep:function(a,b,c){var d=new Date(a.valueOf());return d=this._addThing(d,"FullYear",b,c.years),d=this._addThing(d,"Month",b,c.months),d=this._addThing(d,"Date",b,7*c.weeks),d=this._addThing(d,"Date",b,c.days),d=this._addThing(d,"Hours",b,c.hours),d=this._addThing(d,"Minutes",b,c.minutes),d=this._addThing(d,"Seconds",b,c.seconds)},_addThing:function(a,b,c,d){return 0===c||0===(d||0)?a:(a["set"+b](a["get"+b]()+c*(d||0)),a)},_round:function(a){if(this._steps===!1)return a;for(var b,c,d=this.options.bounds.max.valueOf(),e=this.options.bounds.min.valueOf(),f=Math.max(0,(a-e)/(d-e)),g=Math.floor(this._steps.length*f);this._steps[g]>a;)g--;for(;g+1=this._steps.length-1?this._steps[this._steps.length-1]:0===g?this._steps[0]:(b=this._steps[g],c=this._steps[g+1],c-a>a-b?b:c)},update:function(){this._createBoundsValues(),this._createSteps(),a.ui.rangeSliderHandle.prototype.update.apply(this)},add:function(a,b){return this._addStep(new Date(a),1,b).valueOf()},substract:function(a,b){return this._addStep(new Date(a),-1,b).valueOf()},stepsBetween:function(a,b){if(this.options.step===!1)return b-a;var c=Math.min(a,b),d=Math.max(a,b),e=0,f=!1,g=a>b;for(this.add(c,this.options.step)-c<0&&(f=!0);d>c;)f?d=this.add(d,this.options.step):c=this.add(c,this.options.step),e++;return g?-e:e},multiplyStep:function(a,b){var c={};for(var d in a)a.hasOwnProperty(d)&&(c[d]=a[d]*b);return c},stepRatio:function(){if(this.options.step===!1)return 1;var a=this._steps.length;return this.cache.parent.width/a}})}(jQuery),function(a){"use strict";var b={first:function(a){return a},next:function(a){return a+1},format:function(){},label:function(a){return Math.round(a)},stop:function(){return!1}};a.widget("ui.ruler",{options:{min:0,max:100,scales:[]},_create:function(){this.element.addClass("ui-ruler"),this._createScales()},destroy:function(){this.element.removeClass("ui-ruler"),this.element.empty()},_regenerate:function(){this.element.empty(),this._createScales()},_setOption:function(a,b){return"min"===a||"max"===a&&b!==this.options[a]?(this.options[a]=b,void this._regenerate()):"scales"===a&&b instanceof Array?(this.options.scales=b,void this._regenerate()):void 0},_createScales:function(){if(this.options.max!==this.options.min)for(var a=0;a").appendTo(this.element);f.addClass("ui-ruler-scale"+d),this._createTicks(f,e)},_createTicks:function(a,b){var c,d,e,f=b.first(this.options.min,this.options.max),g=this.options.max-this.options.min,h=!0;do c=f,f=b.next(c),d=(Math.min(f,this.options.max)-Math.max(c,this.options.min))/g,e=this._createTick(c,f,b),a.append(e),e.css("width",100*d+"%"),h&&c>this.options.min&&e.css("margin-left",100*(c-this.options.min)/g+"%"),h=!1;while(!this._stop(b,f))},_stop:function(a,b){return a.stop(b)||b>=this.options.max},_createTick:function(b,c,d){var e=a("
"),f=a("
").appendTo(e),g=a("").appendTo(f);return g.text(d.label(b,c)),d.format(e,b,c),e}})}(jQuery); -------------------------------------------------------------------------------- /js/jquery.touchSwipe-1.6.18.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * @fileOverview TouchSwipe - jQuery Plugin 3 | * @version 1.6.18 4 | * 5 | * @author Matt Bryson http://www.github.com/mattbryson 6 | * @see https://github.com/mattbryson/TouchSwipe-Jquery-Plugin 7 | * @see http://labs.rampinteractive.co.uk/touchSwipe/ 8 | * @see http://plugins.jquery.com/project/touchSwipe 9 | * @license 10 | * Copyright (c) 2010-2015 Matt Bryson 11 | * Dual licensed under the MIT or GPL Version 2 licenses. 12 | * 13 | */ 14 | !function(factory){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],factory):factory("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function($){"use strict";function init(options){return!options||void 0!==options.allowPageScroll||void 0===options.swipe&&void 0===options.swipeStatus||(options.allowPageScroll=NONE),void 0!==options.click&&void 0===options.tap&&(options.tap=options.click),options||(options={}),options=$.extend({},$.fn.swipe.defaults,options),this.each(function(){var $this=$(this),plugin=$this.data(PLUGIN_NS);plugin||(plugin=new TouchSwipe(this,options),$this.data(PLUGIN_NS,plugin))})}function TouchSwipe(element,options){function touchStart(jqEvent){if(!(getTouchInProgress()||$(jqEvent.target).closest(options.excludedElements,$element).length>0)){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(!event.pointerType||"mouse"!=event.pointerType||0!=options.fallbackToMouseEvents){var ret,touches=event.touches,evt=touches?touches[0]:event;return phase=PHASE_START,touches?fingerCount=touches.length:options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),distance=0,direction=null,currentDirection=null,pinchDirection=null,duration=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,pinchDistance=0,maximumsMap=createMaximumsData(),cancelMultiFingerRelease(),createFingerData(0,evt),!touches||fingerCount===options.fingers||options.fingers===ALL_FINGERS||hasPinches()?(startTime=getTimeStamp(),2==fingerCount&&(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)),(options.swipeStatus||options.pinchStatus)&&(ret=triggerHandler(event,phase))):ret=!1,ret===!1?(phase=PHASE_CANCEL,triggerHandler(event,phase),ret):(options.hold&&(holdTimeout=setTimeout($.proxy(function(){$element.trigger("hold",[event.target]),options.hold&&(ret=options.hold.call($element,event,event.target))},this),options.longTapThreshold)),setTouchInProgress(!0),null)}}}function touchMove(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;if(phase!==PHASE_END&&phase!==PHASE_CANCEL&&!inMultiFingerRelease()){var ret,touches=event.touches,evt=touches?touches[0]:event,currentFinger=updateFingerData(evt);if(endTime=getTimeStamp(),touches&&(fingerCount=touches.length),options.hold&&clearTimeout(holdTimeout),phase=PHASE_MOVE,2==fingerCount&&(0==startTouchesDistance?(createFingerData(1,touches[1]),startTouchesDistance=endTouchesDistance=calculateTouchesDistance(fingerData[0].start,fingerData[1].start)):(updateFingerData(touches[1]),endTouchesDistance=calculateTouchesDistance(fingerData[0].end,fingerData[1].end),pinchDirection=calculatePinchDirection(fingerData[0].end,fingerData[1].end)),pinchZoom=calculatePinchZoom(startTouchesDistance,endTouchesDistance),pinchDistance=Math.abs(startTouchesDistance-endTouchesDistance)),fingerCount===options.fingers||options.fingers===ALL_FINGERS||!touches||hasPinches()){if(direction=calculateDirection(currentFinger.start,currentFinger.end),currentDirection=calculateDirection(currentFinger.last,currentFinger.end),validateDefaultEvent(jqEvent,currentDirection),distance=calculateDistance(currentFinger.start,currentFinger.end),duration=calculateDuration(),setMaxDistance(direction,distance),ret=triggerHandler(event,phase),!options.triggerOnTouchEnd||options.triggerOnTouchLeave){var inBounds=!0;if(options.triggerOnTouchLeave){var bounds=getbounds(this);inBounds=isInBounds(currentFinger.end,bounds)}!options.triggerOnTouchEnd&&inBounds?phase=getNextPhase(PHASE_MOVE):options.triggerOnTouchLeave&&!inBounds&&(phase=getNextPhase(PHASE_END)),phase!=PHASE_CANCEL&&phase!=PHASE_END||triggerHandler(event,phase)}}else phase=PHASE_CANCEL,triggerHandler(event,phase);ret===!1&&(phase=PHASE_CANCEL,triggerHandler(event,phase))}}function touchEnd(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent,touches=event.touches;if(touches){if(touches.length&&!inMultiFingerRelease())return startMultiFingerRelease(event),!0;if(touches.length&&inMultiFingerRelease())return!0}return inMultiFingerRelease()&&(fingerCount=fingerCountAtRelease),endTime=getTimeStamp(),duration=calculateDuration(),didSwipeBackToCancel()||!validateSwipeDistance()?(phase=PHASE_CANCEL,triggerHandler(event,phase)):options.triggerOnTouchEnd||options.triggerOnTouchEnd===!1&&phase===PHASE_MOVE?(options.preventDefaultEvents!==!1&&jqEvent.preventDefault(),phase=PHASE_END,triggerHandler(event,phase)):!options.triggerOnTouchEnd&&hasTap()?(phase=PHASE_END,triggerHandlerForGesture(event,phase,TAP)):phase===PHASE_MOVE&&(phase=PHASE_CANCEL,triggerHandler(event,phase)),setTouchInProgress(!1),null}function touchCancel(){fingerCount=0,endTime=0,startTime=0,startTouchesDistance=0,endTouchesDistance=0,pinchZoom=1,cancelMultiFingerRelease(),setTouchInProgress(!1)}function touchLeave(jqEvent){var event=jqEvent.originalEvent?jqEvent.originalEvent:jqEvent;options.triggerOnTouchLeave&&(phase=getNextPhase(PHASE_END),triggerHandler(event,phase))}function removeListeners(){$element.unbind(START_EV,touchStart),$element.unbind(CANCEL_EV,touchCancel),$element.unbind(MOVE_EV,touchMove),$element.unbind(END_EV,touchEnd),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave),setTouchInProgress(!1)}function getNextPhase(currentPhase){var nextPhase=currentPhase,validTime=validateSwipeTime(),validDistance=validateSwipeDistance(),didCancel=didSwipeBackToCancel();return!validTime||didCancel?nextPhase=PHASE_CANCEL:!validDistance||currentPhase!=PHASE_MOVE||options.triggerOnTouchEnd&&!options.triggerOnTouchLeave?!validDistance&¤tPhase==PHASE_END&&options.triggerOnTouchLeave&&(nextPhase=PHASE_CANCEL):nextPhase=PHASE_END,nextPhase}function triggerHandler(event,phase){var ret,touches=event.touches;return(didSwipe()||hasSwipes())&&(ret=triggerHandlerForGesture(event,phase,SWIPE)),(didPinch()||hasPinches())&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,PINCH)),didDoubleTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,DOUBLE_TAP):didLongTap()&&ret!==!1?ret=triggerHandlerForGesture(event,phase,LONG_TAP):didTap()&&ret!==!1&&(ret=triggerHandlerForGesture(event,phase,TAP)),phase===PHASE_CANCEL&&touchCancel(event),phase===PHASE_END&&(touches?touches.length||touchCancel(event):touchCancel(event)),ret}function triggerHandlerForGesture(event,phase,gesture){var ret;if(gesture==SWIPE){if($element.trigger("swipeStatus",[phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection]),options.swipeStatus&&(ret=options.swipeStatus.call($element,event,phase,direction||null,distance||0,duration||0,fingerCount,fingerData,currentDirection),ret===!1))return!1;if(phase==PHASE_END&&validateSwipe()){if(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),$element.trigger("swipe",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipe&&(ret=options.swipe.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection),ret===!1))return!1;switch(direction){case LEFT:$element.trigger("swipeLeft",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeLeft&&(ret=options.swipeLeft.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case RIGHT:$element.trigger("swipeRight",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeRight&&(ret=options.swipeRight.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case UP:$element.trigger("swipeUp",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeUp&&(ret=options.swipeUp.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection));break;case DOWN:$element.trigger("swipeDown",[direction,distance,duration,fingerCount,fingerData,currentDirection]),options.swipeDown&&(ret=options.swipeDown.call($element,event,direction,distance,duration,fingerCount,fingerData,currentDirection))}}}if(gesture==PINCH){if($element.trigger("pinchStatus",[phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchStatus&&(ret=options.pinchStatus.call($element,event,phase,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData),ret===!1))return!1;if(phase==PHASE_END&&validatePinch())switch(pinchDirection){case IN:$element.trigger("pinchIn",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchIn&&(ret=options.pinchIn.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData));break;case OUT:$element.trigger("pinchOut",[pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData]),options.pinchOut&&(ret=options.pinchOut.call($element,event,pinchDirection||null,pinchDistance||0,duration||0,fingerCount,pinchZoom,fingerData))}}return gesture==TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),hasDoubleTap()&&!inDoubleTap()?(doubleTapStartTime=getTimeStamp(),singleTapTimeout=setTimeout($.proxy(function(){doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target))},this),options.doubleTapThreshold)):(doubleTapStartTime=null,$element.trigger("tap",[event.target]),options.tap&&(ret=options.tap.call($element,event,event.target)))):gesture==DOUBLE_TAP?phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),clearTimeout(holdTimeout),doubleTapStartTime=null,$element.trigger("doubletap",[event.target]),options.doubleTap&&(ret=options.doubleTap.call($element,event,event.target))):gesture==LONG_TAP&&(phase!==PHASE_CANCEL&&phase!==PHASE_END||(clearTimeout(singleTapTimeout),doubleTapStartTime=null,$element.trigger("longtap",[event.target]),options.longTap&&(ret=options.longTap.call($element,event,event.target)))),ret}function validateSwipeDistance(){var valid=!0;return null!==options.threshold&&(valid=distance>=options.threshold),valid}function didSwipeBackToCancel(){var cancelled=!1;return null!==options.cancelThreshold&&null!==direction&&(cancelled=getMaxDistance(direction)-distance>=options.cancelThreshold),cancelled}function validatePinchDistance(){return null!==options.pinchThreshold?pinchDistance>=options.pinchThreshold:!0}function validateSwipeTime(){var result;return result=options.maxTimeThreshold?!(duration>=options.maxTimeThreshold):!0}function validateDefaultEvent(jqEvent,direction){if(options.preventDefaultEvents!==!1)if(options.allowPageScroll===NONE)jqEvent.preventDefault();else{var auto=options.allowPageScroll===AUTO;switch(direction){case LEFT:(options.swipeLeft&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case RIGHT:(options.swipeRight&&auto||!auto&&options.allowPageScroll!=HORIZONTAL)&&jqEvent.preventDefault();break;case UP:(options.swipeUp&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case DOWN:(options.swipeDown&&auto||!auto&&options.allowPageScroll!=VERTICAL)&&jqEvent.preventDefault();break;case NONE:}}}function validatePinch(){var hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),hasCorrectDistance=validatePinchDistance();return hasCorrectFingerCount&&hasEndPoint&&hasCorrectDistance}function hasPinches(){return!!(options.pinchStatus||options.pinchIn||options.pinchOut)}function didPinch(){return!(!validatePinch()||!hasPinches())}function validateSwipe(){var hasValidTime=validateSwipeTime(),hasValidDistance=validateSwipeDistance(),hasCorrectFingerCount=validateFingers(),hasEndPoint=validateEndPoint(),didCancel=didSwipeBackToCancel(),valid=!didCancel&&hasEndPoint&&hasCorrectFingerCount&&hasValidDistance&&hasValidTime;return valid}function hasSwipes(){return!!(options.swipe||options.swipeStatus||options.swipeLeft||options.swipeRight||options.swipeUp||options.swipeDown)}function didSwipe(){return!(!validateSwipe()||!hasSwipes())}function validateFingers(){return fingerCount===options.fingers||options.fingers===ALL_FINGERS||!SUPPORTS_TOUCH}function validateEndPoint(){return 0!==fingerData[0].end.x}function hasTap(){return!!options.tap}function hasDoubleTap(){return!!options.doubleTap}function hasLongTap(){return!!options.longTap}function validateDoubleTap(){if(null==doubleTapStartTime)return!1;var now=getTimeStamp();return hasDoubleTap()&&now-doubleTapStartTime<=options.doubleTapThreshold}function inDoubleTap(){return validateDoubleTap()}function validateTap(){return(1===fingerCount||!SUPPORTS_TOUCH)&&(isNaN(distance)||distanceoptions.longTapThreshold&&DOUBLE_TAP_THRESHOLD>distance}function didTap(){return!(!validateTap()||!hasTap())}function didDoubleTap(){return!(!validateDoubleTap()||!hasDoubleTap())}function didLongTap(){return!(!validateLongTap()||!hasLongTap())}function startMultiFingerRelease(event){previousTouchEndTime=getTimeStamp(),fingerCountAtRelease=event.touches.length+1}function cancelMultiFingerRelease(){previousTouchEndTime=0,fingerCountAtRelease=0}function inMultiFingerRelease(){var withinThreshold=!1;if(previousTouchEndTime){var diff=getTimeStamp()-previousTouchEndTime;diff<=options.fingerReleaseThreshold&&(withinThreshold=!0)}return withinThreshold}function getTouchInProgress(){return!($element.data(PLUGIN_NS+"_intouch")!==!0)}function setTouchInProgress(val){$element&&(val===!0?($element.bind(MOVE_EV,touchMove),$element.bind(END_EV,touchEnd),LEAVE_EV&&$element.bind(LEAVE_EV,touchLeave)):($element.unbind(MOVE_EV,touchMove,!1),$element.unbind(END_EV,touchEnd,!1),LEAVE_EV&&$element.unbind(LEAVE_EV,touchLeave,!1)),$element.data(PLUGIN_NS+"_intouch",val===!0))}function createFingerData(id,evt){var f={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return f.start.x=f.last.x=f.end.x=evt.pageX||evt.clientX,f.start.y=f.last.y=f.end.y=evt.pageY||evt.clientY,fingerData[id]=f,f}function updateFingerData(evt){var id=void 0!==evt.identifier?evt.identifier:0,f=getFingerData(id);return null===f&&(f=createFingerData(id,evt)),f.last.x=f.end.x,f.last.y=f.end.y,f.end.x=evt.pageX||evt.clientX,f.end.y=evt.pageY||evt.clientY,f}function getFingerData(id){return fingerData[id]||null}function setMaxDistance(direction,distance){direction!=NONE&&(distance=Math.max(distance,getMaxDistance(direction)),maximumsMap[direction].distance=distance)}function getMaxDistance(direction){return maximumsMap[direction]?maximumsMap[direction].distance:void 0}function createMaximumsData(){var maxData={};return maxData[LEFT]=createMaximumVO(LEFT),maxData[RIGHT]=createMaximumVO(RIGHT),maxData[UP]=createMaximumVO(UP),maxData[DOWN]=createMaximumVO(DOWN),maxData}function createMaximumVO(dir){return{direction:dir,distance:0}}function calculateDuration(){return endTime-startTime}function calculateTouchesDistance(startPoint,endPoint){var diffX=Math.abs(startPoint.x-endPoint.x),diffY=Math.abs(startPoint.y-endPoint.y);return Math.round(Math.sqrt(diffX*diffX+diffY*diffY))}function calculatePinchZoom(startDistance,endDistance){var percent=endDistance/startDistance*1;return percent.toFixed(2)}function calculatePinchDirection(){return 1>pinchZoom?OUT:IN}function calculateDistance(startPoint,endPoint){return Math.round(Math.sqrt(Math.pow(endPoint.x-startPoint.x,2)+Math.pow(endPoint.y-startPoint.y,2)))}function calculateAngle(startPoint,endPoint){var x=startPoint.x-endPoint.x,y=endPoint.y-startPoint.y,r=Math.atan2(y,x),angle=Math.round(180*r/Math.PI);return 0>angle&&(angle=360-Math.abs(angle)),angle}function calculateDirection(startPoint,endPoint){if(comparePoints(startPoint,endPoint))return NONE;var angle=calculateAngle(startPoint,endPoint);return 45>=angle&&angle>=0?LEFT:360>=angle&&angle>=315?LEFT:angle>=135&&225>=angle?RIGHT:angle>45&&135>angle?DOWN:UP}function getTimeStamp(){var now=new Date;return now.getTime()}function getbounds(el){el=$(el);var offset=el.offset(),bounds={left:offset.left,right:offset.left+el.outerWidth(),top:offset.top,bottom:offset.top+el.outerHeight()};return bounds}function isInBounds(point,bounds){return point.x>bounds.left&&point.xbounds.top&&point.y=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).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.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=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 m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":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}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); 6 | //# sourceMappingURL=underscore-min.map -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ## HRC Event Map 2 | 3 | ### Demo 4 | [Check out the site here](https://devprogress.us/hrc-events/) 5 | 6 | ![on search](images/hrc4.gif) 7 | 8 | ### Contributing 9 | Check out the [list of issues](https://github.com/DevProgress/hrc-events/issues) for available tasks, or add any hitches or bugs you think we've missed. 10 | 11 | ### Developing 12 | Clone repo, run `python -m SimpleHTTPServer 8888` and go to `http://127.0.0.1:8888/` --------------------------------------------------------------------------------