diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 01537bb5..d59dc11a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ __Note:__ GitHub is for *bug reports and contributions only* - if you have a support question or a request for a customization don't post here. Use [WordPress.org](http://wordpress.org/support/plugin/sportspress) for community support, and for customizations we recommend one of the following services: - [Elto](https://www.elto.com/) -- [Codeable](https://codeable.io/) +- [Codeable](https://codeable.io/ambassadors/themeboy/) ## Getting Started @@ -34,4 +34,4 @@ At this point you're waiting on us to merge your pull request. We'll review all * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) -* [SportsPress plugin page on WordPress.org](http://wordpress.org/plugins/sportspress/) \ No newline at end of file +* [SportsPress plugin page on WordPress.org](http://wordpress.org/plugins/sportspress/) diff --git a/assets/css/Control.Geocoder.css b/assets/css/Control.Geocoder.css new file mode 100644 index 00000000..00c32255 --- /dev/null +++ b/assets/css/Control.Geocoder.css @@ -0,0 +1,126 @@ +.leaflet-control-geocoder { + border-radius: 4px; + background: white; + min-width: 26px; + min-height: 26px; +} + +.leaflet-touch .leaflet-control-geocoder { + min-width: 30px; + min-height: 30px; +} + +.leaflet-control-geocoder a, +.leaflet-control-geocoder .leaflet-control-geocoder-icon { + border-bottom: none; + display: inline-block; +} + +.leaflet-control-geocoder .leaflet-control-geocoder-alternatives a { + width: inherit; + height: inherit; + line-height: inherit; +} + +.leaflet-control-geocoder a:hover, +.leaflet-control-geocoder .leaflet-control-geocoder-icon:hover { + border-bottom: none; + display: inline-block; +} + +.leaflet-control-geocoder-form { + display: none; + vertical-align: middle; +} +.leaflet-control-geocoder-expanded .leaflet-control-geocoder-form { + display: inline-block; +} +.leaflet-control-geocoder-form input { + font-size: 120%; + border: 0; + background-color: transparent; + width: 246px; +} + +.leaflet-control-geocoder-icon { + border-radius: 4px; + width: 26px; + height: 26px; + border: none; + background-color: white; + background-image: url(images/geocoder.png); + background-repeat: no-repeat; + background-position: center; + cursor: pointer; +} + +.leaflet-touch .leaflet-control-geocoder-icon { + width: 30px; + height: 30px; +} + +.leaflet-control-geocoder-throbber .leaflet-control-geocoder-icon { + background-image: url(images/throbber.gif); +} + +.leaflet-control-geocoder-form-no-error { + display: none; +} + +.leaflet-control-geocoder-form input:focus { + outline: none; +} + +.leaflet-control-geocoder-form button { + display: none; +} +.leaflet-control-geocoder-error { + margin-top: 8px; + margin-left: 8px; + display: block; + color: #444; +} +.leaflet-control-geocoder-alternatives { + display: block; + width: 272px; + list-style: none; + padding: 0; + margin: 0; +} + +.leaflet-control-geocoder-alternatives-minimized { + display: none; + height: 0; +} +.leaflet-control-geocoder-alternatives li { + white-space: nowrap; + display: block; + overflow: hidden; + padding: 5px 8px; + text-overflow: ellipsis; + border-bottom: 1px solid #ccc; + cursor: pointer; +} + +.leaflet-control-geocoder-alternatives li a, +.leaflet-control-geocoder-alternatives li a:hover { + width: inherit; + height: inherit; + line-height: inherit; + background: inherit; + border-radius: inherit; + text-align: left; +} + +.leaflet-control-geocoder-alternatives li:last-child { + border-bottom: none; +} +.leaflet-control-geocoder-alternatives li:hover, +.leaflet-control-geocoder-selected { + background-color: #f5f5f5; +} +.leaflet-control-geocoder-address-detail { +} +.leaflet-control-geocoder-address-context { + color: #666; +} diff --git a/assets/css/icons.css b/assets/css/icons.css index 3ed7a013..3d33a296 100644 --- a/assets/css/icons.css +++ b/assets/css/icons.css @@ -1,12 +1,12 @@ /* SportsPress icons */ @font-face { font-family: 'sportspress'; - src:url('../fonts/sportspress.eot?ddphik'); - src:url('../fonts/sportspress.eot?#iefixddphik') format('embedded-opentype'), - url('../fonts/sportspress.woff2?ddphik') format('woff2'), - url('../fonts/sportspress.ttf?ddphik') format('truetype'), - url('../fonts/sportspress.woff?ddphik') format('woff'), - url('../fonts/sportspress.svg?ddphik#sportspress') format('svg'); + src:url('../fonts/sportspress.eot?ddphik2'); + src:url('../fonts/sportspress.eot?#iefixddphik2') format('embedded-opentype'), + url('../fonts/sportspress.woff2?ddphik2') format('woff2'), + url('../fonts/sportspress.ttf?ddphik2') format('truetype'), + url('../fonts/sportspress.woff?ddphik2') format('woff'), + url('../fonts/sportspress.svg?ddphik2#sportspress') format('svg'); font-weight: normal; font-style: normal; } @@ -93,6 +93,9 @@ .sp-icon-racing-flag:before { content: "\e611"; } +.sp-icon-volleyball:before { + content: "\e612"; +} /* Performance Icons - Sports (Alt) */ .sp-icon-soccerball-alt:before { diff --git a/assets/css/images/geocoder.png b/assets/css/images/geocoder.png new file mode 100644 index 00000000..d82a0170 Binary files /dev/null and b/assets/css/images/geocoder.png differ diff --git a/assets/css/images/layers-2x.png b/assets/css/images/layers-2x.png new file mode 100644 index 00000000..200c333d Binary files /dev/null and b/assets/css/images/layers-2x.png differ diff --git a/assets/css/images/layers.png b/assets/css/images/layers.png new file mode 100644 index 00000000..1a72e578 Binary files /dev/null and b/assets/css/images/layers.png differ diff --git a/assets/css/images/marker-icon-2x.png b/assets/css/images/marker-icon-2x.png new file mode 100644 index 00000000..88f9e501 Binary files /dev/null and b/assets/css/images/marker-icon-2x.png differ diff --git a/assets/css/images/marker-icon.png b/assets/css/images/marker-icon.png new file mode 100644 index 00000000..950edf24 Binary files /dev/null and b/assets/css/images/marker-icon.png differ diff --git a/assets/css/images/marker-shadow.png b/assets/css/images/marker-shadow.png new file mode 100644 index 00000000..9fd29795 Binary files /dev/null and b/assets/css/images/marker-shadow.png differ diff --git a/assets/css/images/throbber.gif b/assets/css/images/throbber.gif new file mode 100644 index 00000000..c0c52a06 Binary files /dev/null and b/assets/css/images/throbber.gif differ diff --git a/assets/css/leaflet.css b/assets/css/leaflet.css new file mode 100644 index 00000000..017fa0e4 --- /dev/null +++ b/assets/css/leaflet.css @@ -0,0 +1,640 @@ +/* required styles */ + +.leaflet-pane, +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-tile-container, +.leaflet-pane > svg, +.leaflet-pane > canvas, +.leaflet-zoom-box, +.leaflet-image-layer, +.leaflet-layer { + position: absolute; + left: 0; + top: 0; + } +.leaflet-container { + overflow: hidden; + } +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + -webkit-user-drag: none; + } +/* Prevents IE11 from highlighting tiles in blue */ +.leaflet-tile::selection { + background: transparent; +} +/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ +.leaflet-safari .leaflet-tile { + image-rendering: -webkit-optimize-contrast; + } +/* hack that prevents hw layers "stretching" when loading new tiles */ +.leaflet-safari .leaflet-tile-container { + width: 1600px; + height: 1600px; + -webkit-transform-origin: 0 0; + } +.leaflet-marker-icon, +.leaflet-marker-shadow { + display: block; + } +/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ +/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ +.leaflet-container .leaflet-overlay-pane svg, +.leaflet-container .leaflet-marker-pane img, +.leaflet-container .leaflet-shadow-pane img, +.leaflet-container .leaflet-tile-pane img, +.leaflet-container img.leaflet-image-layer, +.leaflet-container .leaflet-tile { + max-width: none !important; + max-height: none !important; + } + +.leaflet-container.leaflet-touch-zoom { + -ms-touch-action: pan-x pan-y; + touch-action: pan-x pan-y; + } +.leaflet-container.leaflet-touch-drag { + -ms-touch-action: pinch-zoom; + /* Fallback for FF which doesn't support pinch-zoom */ + touch-action: none; + touch-action: pinch-zoom; +} +.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { + -ms-touch-action: none; + touch-action: none; +} +.leaflet-container { + -webkit-tap-highlight-color: transparent; +} +.leaflet-container a { + -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); +} +.leaflet-tile { + filter: inherit; + visibility: hidden; + } +.leaflet-tile-loaded { + visibility: inherit; + } +.leaflet-zoom-box { + width: 0; + height: 0; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 800; + } +/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ +.leaflet-overlay-pane svg { + -moz-user-select: none; + } + +.leaflet-pane { z-index: 400; } + +.leaflet-tile-pane { z-index: 200; } +.leaflet-overlay-pane { z-index: 400; } +.leaflet-shadow-pane { z-index: 500; } +.leaflet-marker-pane { z-index: 600; } +.leaflet-tooltip-pane { z-index: 650; } +.leaflet-popup-pane { z-index: 700; } + +.leaflet-map-pane canvas { z-index: 100; } +.leaflet-map-pane svg { z-index: 200; } + +.leaflet-vml-shape { + width: 1px; + height: 1px; + } +.lvml { + behavior: url(#default#VML); + display: inline-block; + position: absolute; + } + + +/* control positioning */ + +.leaflet-control { + position: relative; + z-index: 800; + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } +.leaflet-top, +.leaflet-bottom { + position: absolute; + z-index: 1000; + pointer-events: none; + } +.leaflet-top { + top: 0; + } +.leaflet-right { + right: 0; + } +.leaflet-bottom { + bottom: 0; + } +.leaflet-left { + left: 0; + } +.leaflet-control { + float: left; + clear: both; + } +.leaflet-right .leaflet-control { + float: right; + } +.leaflet-top .leaflet-control { + margin-top: 10px; + } +.leaflet-bottom .leaflet-control { + margin-bottom: 10px; + } +.leaflet-left .leaflet-control { + margin-left: 10px; + } +.leaflet-right .leaflet-control { + margin-right: 10px; + } + + +/* zoom and fade animations */ + +.leaflet-fade-anim .leaflet-tile { + will-change: opacity; + } +.leaflet-fade-anim .leaflet-popup { + opacity: 0; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } +.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { + opacity: 1; + } +.leaflet-zoom-animated { + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + will-change: transform; + } +.leaflet-zoom-anim .leaflet-zoom-animated { + -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); + -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); + transition: transform 0.25s cubic-bezier(0,0,0.25,1); + } +.leaflet-zoom-anim .leaflet-tile, +.leaflet-pan-anim .leaflet-tile { + -webkit-transition: none; + -moz-transition: none; + transition: none; + } + +.leaflet-zoom-anim .leaflet-zoom-hide { + visibility: hidden; + } + + +/* cursors */ + +.leaflet-interactive { + cursor: pointer; + } +.leaflet-grab { + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; + } +.leaflet-crosshair, +.leaflet-crosshair .leaflet-interactive { + cursor: crosshair; + } +.leaflet-popup-pane, +.leaflet-control { + cursor: auto; + } +.leaflet-dragging .leaflet-grab, +.leaflet-dragging .leaflet-grab .leaflet-interactive, +.leaflet-dragging .leaflet-marker-draggable { + cursor: move; + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; + } + +/* marker & overlays interactivity */ +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-image-layer, +.leaflet-pane > svg path, +.leaflet-tile-container { + pointer-events: none; + } + +.leaflet-marker-icon.leaflet-interactive, +.leaflet-image-layer.leaflet-interactive, +.leaflet-pane > svg path.leaflet-interactive, +svg.leaflet-image-layer.leaflet-interactive path { + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } + +/* visual tweaks */ + +.leaflet-container { + background: #ddd; + outline: 0; + } +.leaflet-container a { + color: #0078A8; + } +.leaflet-container a.leaflet-active { + outline: 2px solid orange; + } +.leaflet-zoom-box { + border: 2px dotted #38f; + background: rgba(255,255,255,0.5); + } + + +/* general typography */ +.leaflet-container { + font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif; + } + + +/* general toolbar styles */ + +.leaflet-bar { + box-shadow: 0 1px 5px rgba(0,0,0,0.65); + border-radius: 4px; + } +.leaflet-bar a, +.leaflet-bar a:hover { + background-color: #fff; + border-bottom: 1px solid #ccc; + width: 26px; + height: 26px; + line-height: 26px; + display: block; + text-align: center; + text-decoration: none; + color: black; + } +.leaflet-bar a, +.leaflet-control-layers-toggle { + background-position: 50% 50%; + background-repeat: no-repeat; + display: block; + } +.leaflet-bar a:hover { + background-color: #f4f4f4; + } +.leaflet-bar a:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.leaflet-bar a:last-child { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom: none; + } +.leaflet-bar a.leaflet-disabled { + cursor: default; + background-color: #f4f4f4; + color: #bbb; + } + +.leaflet-touch .leaflet-bar a { + width: 30px; + height: 30px; + line-height: 30px; + } +.leaflet-touch .leaflet-bar a:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px; + } +.leaflet-touch .leaflet-bar a:last-child { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + } + +/* zoom control */ + +.leaflet-control-zoom-in, +.leaflet-control-zoom-out { + font: bold 18px 'Lucida Console', Monaco, monospace; + text-indent: 1px; + } + +.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { + font-size: 22px; + } + + +/* layers control */ + +.leaflet-control-layers { + box-shadow: 0 1px 5px rgba(0,0,0,0.4); + background: #fff; + border-radius: 5px; + } +.leaflet-control-layers-toggle { + background-image: url(images/layers.png); + width: 36px; + height: 36px; + } +.leaflet-retina .leaflet-control-layers-toggle { + background-image: url(images/layers-2x.png); + background-size: 26px 26px; + } +.leaflet-touch .leaflet-control-layers-toggle { + width: 44px; + height: 44px; + } +.leaflet-control-layers .leaflet-control-layers-list, +.leaflet-control-layers-expanded .leaflet-control-layers-toggle { + display: none; + } +.leaflet-control-layers-expanded .leaflet-control-layers-list { + display: block; + position: relative; + } +.leaflet-control-layers-expanded { + padding: 6px 10px 6px 6px; + color: #333; + background: #fff; + } +.leaflet-control-layers-scrollbar { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 5px; + } +.leaflet-control-layers-selector { + margin-top: 2px; + position: relative; + top: 1px; + } +.leaflet-control-layers label { + display: block; + } +.leaflet-control-layers-separator { + height: 0; + border-top: 1px solid #ddd; + margin: 5px -10px 5px -6px; + } + +/* Default icon URLs */ +.leaflet-default-icon-path { + background-image: url(images/marker-icon.png); + } + + +/* attribution and scale controls */ + +.leaflet-container .leaflet-control-attribution { + background: #fff; + background: rgba(255, 255, 255, 0.7); + margin: 0; + } +.leaflet-control-attribution, +.leaflet-control-scale-line { + padding: 0 5px; + color: #333; + } +.leaflet-control-attribution a { + text-decoration: none; + } +.leaflet-control-attribution a:hover { + text-decoration: underline; + } +.leaflet-container .leaflet-control-attribution, +.leaflet-container .leaflet-control-scale { + font-size: 11px; + } +.leaflet-left .leaflet-control-scale { + margin-left: 5px; + } +.leaflet-bottom .leaflet-control-scale { + margin-bottom: 5px; + } +.leaflet-control-scale-line { + border: 2px solid #777; + border-top: none; + line-height: 1.1; + padding: 2px 5px 1px; + font-size: 11px; + white-space: nowrap; + overflow: hidden; + -moz-box-sizing: border-box; + box-sizing: border-box; + + background: #fff; + background: rgba(255, 255, 255, 0.5); + } +.leaflet-control-scale-line:not(:first-child) { + border-top: 2px solid #777; + border-bottom: none; + margin-top: -2px; + } +.leaflet-control-scale-line:not(:first-child):not(:last-child) { + border-bottom: 2px solid #777; + } + +.leaflet-touch .leaflet-control-attribution, +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + box-shadow: none; + } +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + border: 2px solid rgba(0,0,0,0.2); + background-clip: padding-box; + } + + +/* popup */ + +.leaflet-popup { + position: absolute; + text-align: center; + margin-bottom: 20px; + } +.leaflet-popup-content-wrapper { + padding: 1px; + text-align: left; + border-radius: 12px; + } +.leaflet-popup-content { + margin: 13px 19px; + line-height: 1.4; + } +.leaflet-popup-content p { + margin: 18px 0; + } +.leaflet-popup-tip-container { + width: 40px; + height: 20px; + position: absolute; + left: 50%; + margin-left: -20px; + overflow: hidden; + pointer-events: none; + } +.leaflet-popup-tip { + width: 17px; + height: 17px; + padding: 1px; + + margin: -10px auto 0; + + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + } +.leaflet-popup-content-wrapper, +.leaflet-popup-tip { + background: white; + color: #333; + box-shadow: 0 3px 14px rgba(0,0,0,0.4); + } +.leaflet-container a.leaflet-popup-close-button { + position: absolute; + top: 0; + right: 0; + padding: 4px 4px 0 0; + border: none; + text-align: center; + width: 18px; + height: 14px; + font: 16px/14px Tahoma, Verdana, sans-serif; + color: #c3c3c3; + text-decoration: none; + font-weight: bold; + background: transparent; + } +.leaflet-container a.leaflet-popup-close-button:hover { + color: #999; + } +.leaflet-popup-scrolled { + overflow: auto; + border-bottom: 1px solid #ddd; + border-top: 1px solid #ddd; + } + +.leaflet-oldie .leaflet-popup-content-wrapper { + -ms-zoom: 1; + } +.leaflet-oldie .leaflet-popup-tip { + width: 24px; + margin: 0 auto; + + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); + } +.leaflet-oldie .leaflet-popup-tip-container { + margin-top: -1px; + } + +.leaflet-oldie .leaflet-control-zoom, +.leaflet-oldie .leaflet-control-layers, +.leaflet-oldie .leaflet-popup-content-wrapper, +.leaflet-oldie .leaflet-popup-tip { + border: 1px solid #999; + } + + +/* div icon */ + +.leaflet-div-icon { + background: #fff; + border: 1px solid #666; + } + + +/* Tooltip */ +/* Base styles for the element that has a tooltip */ +.leaflet-tooltip { + position: absolute; + padding: 6px; + background-color: #fff; + border: 1px solid #fff; + border-radius: 3px; + color: #222; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + pointer-events: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.4); + } +.leaflet-tooltip.leaflet-clickable { + cursor: pointer; + pointer-events: auto; + } +.leaflet-tooltip-top:before, +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + position: absolute; + pointer-events: none; + border: 6px solid transparent; + background: transparent; + content: ""; + } + +/* Directions */ + +.leaflet-tooltip-bottom { + margin-top: 6px; +} +.leaflet-tooltip-top { + margin-top: -6px; +} +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-top:before { + left: 50%; + margin-left: -6px; + } +.leaflet-tooltip-top:before { + bottom: 0; + margin-bottom: -12px; + border-top-color: #fff; + } +.leaflet-tooltip-bottom:before { + top: 0; + margin-top: -12px; + margin-left: -6px; + border-bottom-color: #fff; + } +.leaflet-tooltip-left { + margin-left: -6px; +} +.leaflet-tooltip-right { + margin-left: 6px; +} +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + top: 50%; + margin-top: -6px; + } +.leaflet-tooltip-left:before { + right: 0; + margin-right: -12px; + border-left-color: #fff; + } +.leaflet-tooltip-right:before { + left: 0; + margin-left: -12px; + border-right-color: #fff; + } diff --git a/assets/css/menu.css b/assets/css/menu.css index 38a302ba..9e11a486 100644 --- a/assets/css/menu.css +++ b/assets/css/menu.css @@ -103,6 +103,9 @@ .sp-icon-list:before { content: "\f163" } +.sp-icon-location:before { + content: "\f231"; +} .sp-icon-matrix:before { content: "\f314"; } @@ -235,6 +238,9 @@ .sp-icon-racing-flag:before { content: "\e611"; } +.sp-icon-volleyball:before { + content: "\e612"; +} /* Performance Icons - Sports (Alt) */ .sp-icon-soccerball-alt:before { @@ -331,7 +337,7 @@ margin: 3px 0; } -.sp-icon-color-box input[type=text] { +.sp-color-box-for-icon input[type=text] { color: #fff; } diff --git a/assets/css/sportspress-rtl.css b/assets/css/sportspress-rtl.css index ec1a05ad..8973571f 100644 --- a/assets/css/sportspress-rtl.css +++ b/assets/css/sportspress-rtl.css @@ -31,13 +31,27 @@ } /* League Table and Player List */ -.sp-league-table .data-name .team-logo, .sp-player-list .data-name .player-photo, .sp-player-list .data-name .player-flag { margin-right: 0; margin-left: 0.5em; } +/* Event Performance (Icons) */ +.sp-event-performance-teams .sp-template-event-performance-icons { + float: right; + clear: right; + padding-right: 0; + padding-left: 10px; +} + +.sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) { + float: left; + clear: left; + padding-left: 0; + padding-right: 10px; +} + /* Event Calendar */ .sp-event-calendar #next { text-align: left; diff --git a/assets/css/sportspress.css b/assets/css/sportspress.css index 0ec66c6d..dbd116de 100644 --- a/assets/css/sportspress.css +++ b/assets/css/sportspress.css @@ -104,6 +104,7 @@ .sp-data-table thead .sorting_asc_disabled, .sp-data-table thead .sorting_desc_disabled { cursor: pointer; + position: relative; } .sp-data-table tbody a { text-decoration: none; @@ -112,6 +113,7 @@ .sp-data-table .sorting_asc:after, .sp-data-table .sorting_desc:after { font-family: dashicons; + margin: 0 -.2em; } .sp-data-table .sorting:after { content: "\f156"; @@ -133,6 +135,10 @@ .sp-data-table .data-rank { width: 1px; } +.sp-data-table .sp-checkbox { + font-family: sportspress; + vertical-align: bottom; +} /* Post Content */ .sp-post-content { @@ -203,16 +209,21 @@ line-height: 2em; } .sp-player-list .data-name .player-photo, -.sp-player-list .data-name .player-flag { +.sp-player-list .data-name .player-flag, +.sp-player-list .data-team .team-logo { width: 2em; height: 2em; - margin-right: 0.5em; display: inline-block; vertical-align: middle; text-align: center; } +.sp-player-list .data-name .player-photo, +.sp-player-list .data-name .player-flag { + margin-right: 0.5em; +} .sp-player-list .data-name .player-photo img, -.sp-player-list .data-name .player-flag img { +.sp-player-list .data-name .player-flag img, +.sp-player-list .data-team .team-logo img { width: auto; height: auto; max-width: 2em; @@ -448,6 +459,10 @@ clear: both; } +span.sp_event_spec_label { + font-weight: bold; +} + /* Event Logos Block */ .sp-template-event-logos-block .team-logo { float: none; diff --git a/assets/fonts/sportspress.eot b/assets/fonts/sportspress.eot index cd072e1e..85160f5b 100755 Binary files a/assets/fonts/sportspress.eot and b/assets/fonts/sportspress.eot differ diff --git a/assets/fonts/sportspress.svg b/assets/fonts/sportspress.svg index 2fe3fcf8..9fa07f92 100755 --- a/assets/fonts/sportspress.svg +++ b/assets/fonts/sportspress.svg @@ -7,6 +7,9 @@ + + + @@ -19,6 +22,7 @@ + @@ -46,6 +50,7 @@ + diff --git a/assets/fonts/sportspress.ttf b/assets/fonts/sportspress.ttf index eb011b3d..13e11cc3 100755 Binary files a/assets/fonts/sportspress.ttf and b/assets/fonts/sportspress.ttf differ diff --git a/assets/fonts/sportspress.woff b/assets/fonts/sportspress.woff index f6a503a6..7192f5d5 100755 Binary files a/assets/fonts/sportspress.woff and b/assets/fonts/sportspress.woff differ diff --git a/assets/fonts/sportspress.woff2 b/assets/fonts/sportspress.woff2 index a6b4c7f2..715f6e2b 100755 Binary files a/assets/fonts/sportspress.woff2 and b/assets/fonts/sportspress.woff2 differ diff --git a/assets/images/flags/glp.png b/assets/images/flags/glp.png new file mode 100644 index 00000000..576c038f Binary files /dev/null and b/assets/images/flags/glp.png differ diff --git a/assets/images/flags/grl.png b/assets/images/flags/grl.png new file mode 100644 index 00000000..1adea9eb Binary files /dev/null and b/assets/images/flags/grl.png differ diff --git a/assets/images/flags/guf.png b/assets/images/flags/guf.png new file mode 100644 index 00000000..576c038f Binary files /dev/null and b/assets/images/flags/guf.png differ diff --git a/assets/images/flags/mtq.png b/assets/images/flags/mtq.png new file mode 100644 index 00000000..deefcae6 Binary files /dev/null and b/assets/images/flags/mtq.png differ diff --git a/assets/images/flags/pyf.png b/assets/images/flags/pyf.png new file mode 100644 index 00000000..96663c64 Binary files /dev/null and b/assets/images/flags/pyf.png differ diff --git a/assets/images/flags/reu.png b/assets/images/flags/reu.png new file mode 100644 index 00000000..576c038f Binary files /dev/null and b/assets/images/flags/reu.png differ diff --git a/assets/images/flags/sxm.png b/assets/images/flags/sxm.png new file mode 100644 index 00000000..f7383931 Binary files /dev/null and b/assets/images/flags/sxm.png differ diff --git a/assets/js/Control.Geocoder.min.js b/assets/js/Control.Geocoder.min.js new file mode 100644 index 00000000..3c5c4ffd --- /dev/null +++ b/assets/js/Control.Geocoder.min.js @@ -0,0 +1,10 @@ +/* @preserve + * Leaflet Control Geocoder 1.13.0 + * https://github.com/perliedman/leaflet-control-geocoder + * + * Copyright (c) 2012 sa3m (https://github.com/sa3m) + * Copyright (c) 2018 Per Liedman + * All rights reserved. + */ +this.L=this.L||{},this.L.Control=this.L.Control||{},this.L.Control.Geocoder=function(d){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var a=0,i=/[&<>"'`]/g,r=/[&<>"'`]/,t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};function l(e){return t[e]}function o(e,t,o,s,n){var i="_l_geocoder_"+a++;t[n||"callback"]=i,window[i]=d.Util.bind(o,s);var r=document.createElement("script");r.type="text/javascript",r.src=e+c(t),r.id=i,document.getElementsByTagName("head")[0].appendChild(r)}function u(e,t,o){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState){var t;if(200!==s.status&&304!==s.status)t="";else if("string"==typeof s.response)try{t=JSON.parse(s.response)}catch(e){t=s.response}else t=s.response;o(t)}},s.open("GET",e+c(t),!0),s.responseType="json",s.setRequestHeader("Accept","application/json"),s.send(null)}function n(e,n){return e.replace(/\{ *([\w_]+) *\}/g,function(e,t){var o,s=n[t];return void 0===s?s="":"function"==typeof s&&(s=s(n)),null==(o=s)?"":o?(o=""+o,r.test(o)?o.replace(i,l):o):o+""})}function c(e,t,o){var s=[];for(var n in e){var i=encodeURIComponent(o?n.toUpperCase():n),r=e[n];if(d.Util.isArray(r))for(var a=0;a",app_code:"",geocodingQueryParams:{},reverseQueryParams:{},reverseGeocodeProxRadius:null},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s={searchtext:e,gen:9,app_id:this.options.app_id,app_code:this.options.app_code,jsonattributes:1};s=d.Util.extend(s,this.options.geocodingQueryParams),this.getJSON(this.options.geocodeUrl,s,t,o)},reverse:function(e,t,o,s){var n=this.options.reverseGeocodeProxRadius?this.options.reverseGeocodeProxRadius:null,i=n?","+encodeURIComponent(n):"",r={prox:encodeURIComponent(e.lat)+","+encodeURIComponent(e.lng)+i,mode:"retrieveAddresses",app_id:this.options.app_id,app_code:this.options.app_code,gen:9,jsonattributes:1};r=d.Util.extend(r,this.options.reverseQueryParams),this.getJSON(this.options.reverseGeocodeUrl,r,o,s)},getJSON:function(e,t,r,a){u(e,t,function(e){var t,o,s,n=[];if(e.response.view&&e.response.view.length)for(var i=0;i<=e.response.view[0].result.length-1;i++)t=e.response.view[0].result[i].location,o=d.latLng(t.displayPosition.latitude,t.displayPosition.longitude),s=d.latLngBounds(d.latLng(t.mapView.topLeft.latitude,t.mapView.topLeft.longitude),d.latLng(t.mapView.bottomRight.latitude,t.mapView.bottomRight.longitude)),n[i]={name:t.address.label,properties:t.address,bbox:s,center:o};r.call(a,n)})}});var m=d.Class.extend({options:{next:void 0,sizeInMeters:1e4},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,t,o){var s,n;if((s=e.match(/^([NS])\s*(\d{1,3}(?:\.\d*)?)\W*([EW])\s*(\d{1,3}(?:\.\d*)?)$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*parseFloat(s[2]),(/E/i.test(s[3])?1:-1)*parseFloat(s[4])):(s=e.match(/^(\d{1,3}(?:\.\d*)?)\s*([NS])\W*(\d{1,3}(?:\.\d*)?)\s*([EW])$/))?n=d.latLng((/N/i.test(s[2])?1:-1)*parseFloat(s[1]),(/E/i.test(s[4])?1:-1)*parseFloat(s[3])):(s=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60)),(/E/i.test(s[4])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60))):(s=e.match(/^(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([NS])\W*(\d{1,3})°?\s*(\d{1,3}(?:\.\d*)?)?['′]?\s*([EW])$/))?n=d.latLng((/N/i.test(s[3])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60)),(/E/i.test(s[6])?1:-1)*(parseFloat(s[4])+parseFloat(s[5]/60))):(s=e.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?$/))?n=d.latLng((/N/i.test(s[1])?1:-1)*(parseFloat(s[2])+parseFloat(s[3]/60+parseFloat(s[4]/3600))),(/E/i.test(s[5])?1:-1)*(parseFloat(s[6])+parseFloat(s[7]/60)+parseFloat(s[8]/3600))):(s=e.match(/^(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]\s*([NS])\W*(\d{1,3})°?\s*(\d{1,2})['′]?\s*(\d{1,3}(?:\.\d*)?)?["″]?\s*([EW])$/))?n=d.latLng((/N/i.test(s[4])?1:-1)*(parseFloat(s[1])+parseFloat(s[2]/60+parseFloat(s[3]/3600))),(/E/i.test(s[8])?1:-1)*(parseFloat(s[5])+parseFloat(s[6]/60)+parseFloat(s[7]/3600))):(s=e.match(/^\s*([+-]?\d+(?:\.\d*)?)\s*[\s,]\s*([+-]?\d+(?:\.\d*)?)\s*$/))&&(n=d.latLng(parseFloat(s[1]),parseFloat(s[2]))),n){var i=[{name:e,center:n,bbox:n.toBounds(this.options.sizeInMeters)}];t.call(o,i)}else this.options.next&&this.options.next.geocode(e,t,o)}});var v=d.Class.extend({options:{serviceUrl:"https://api.mapbox.com/geocoding/v5/mapbox.places/",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this.options.geocodingQueryParams.access_token=e,this.options.reverseQueryParams.access_token=e},geocode:function(e,l,c){var t=this.options.geocodingQueryParams;void 0!==t.proximity&&void 0!==t.proximity.lat&&void 0!==t.proximity.lng&&(t.proximity=t.proximity.lng+","+t.proximity.lat),u(this.options.serviceUrl+encodeURIComponent(e)+".json",t,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++){t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o);for(var r={text:t.text,address:t.address},a=0;a<(t.context||[]).length;a++){r[t.context[a].id.split(".")[0]]=t.context[a].text,t.context[a].short_code&&(r.countryShortCode=t.context[a].short_code)}n[i]={name:t.place_name,bbox:s,center:o,properties:r}}l.call(c,n)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,r,a){u(this.options.serviceUrl+encodeURIComponent(e.lng)+","+encodeURIComponent(e.lat)+".json",this.options.reverseQueryParams,function(e){var t,o,s,n=[];if(e.features&&e.features.length)for(var i=0;i<=e.features.length-1;i++)t=e.features[i],o=d.latLng(t.center.reverse()),s=t.bbox?d.latLngBounds(d.latLng(t.bbox.slice(0,2).reverse()),d.latLng(t.bbox.slice(2,4).reverse())):d.latLngBounds(o,o),n[i]={name:t.place_name,bbox:s,center:o};r.call(a,n)})}});var f=d.Class.extend({options:{serviceUrl:"https://www.mapquestapi.com/geocoding/v1"},initialize:function(e,t){this._key=decodeURIComponent(e),d.Util.setOptions(this,t)},_formatName:function(){var e,t=[];for(e=0;e",apiKey:"",serviceUrl:"https://neutrinoapi.com/"},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,n,i){u(this.options.serviceUrl+"geocode-address",{apiKey:this.options.apiKey,userId:this.options.userId,address:e.split(/\s+/).join(".")},function(e){var t,o,s=[];e.locations&&(e.geometry=e.locations[0],t=d.latLng(e.geometry.latitude,e.geometry.longitude),o=d.latLngBounds(t,t),s[0]={name:e.geometry.address,bbox:o,center:t}),n.call(i,s)})},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(n,e,i,r){u(this.options.serviceUrl+"geocode-reverse",{apiKey:this.options.apiKey,userId:this.options.userId,latitude:n.lat,longitude:n.lng},function(e){var t,o,s=[];200==e.status.status&&e.found&&(t=d.latLng(n.lat,n.lng),o=d.latLngBounds(t,t),s[0]={name:e.address,bbox:o,center:t}),i.call(r,s)})}});var b=d.Class.extend({options:{serviceUrl:"https://nominatim.openstreetmap.org/",geocodingQueryParams:{},reverseQueryParams:{},htmlTemplate:function(e){var t,o=e.address,s=[];return(o.road||o.building)&&s.push("{building} {road} {house_number}"),(o.city||o.town||o.village||o.hamlet)&&(t=0{postcode} {city} {town} {village} {hamlet}')),(o.state||o.country)&&(t=0{state} {country}')),n(s.join("
"),o)}},initialize:function(e){d.Util.setOptions(this,e)},geocode:function(e,i,r){u(this.options.serviceUrl+"search",d.extend({q:e,limit:5,format:"json",addressdetails:1},this.options.geocodingQueryParams),d.bind(function(e){for(var t=[],o=e.length-1;0<=o;o--){for(var s=e[o].boundingbox,n=0;n<4;n++)s[n]=parseFloat(s[n]);t[o]={icon:e[o].icon,name:e[o].display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e[o]):void 0,bbox:d.latLngBounds([s[0],s[2]],[s[1],s[3]]),center:d.latLng(e[o].lat,e[o].lon),properties:e[o]}}i.call(r,t)},this))},reverse:function(e,t,s,n){u(this.options.serviceUrl+"reverse",d.extend({lat:e.lat,lon:e.lng,zoom:Math.round(Math.log(t/256)/Math.log(2)),addressdetails:1,format:"json"},this.options.reverseQueryParams),d.bind(function(e){var t,o=[];e&&e.lat&&e.lon&&(t=d.latLng(e.lat,e.lon),o.push({name:e.display_name,html:this.options.htmlTemplate?this.options.htmlTemplate(e):void 0,center:t,bounds:d.latLngBounds(t,t),properties:e})),s.call(n,o)},this))}});var y=d.Class.extend({options:{OpenLocationCode:void 0,codeLength:void 0},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){try{var s=this.options.OpenLocationCode.decode(e),n={name:e,center:d.latLng(s.latitudeCenter,s.longitudeCenter),bbox:d.latLngBounds(d.latLng(s.latitudeLo,s.longitudeLo),d.latLng(s.latitudeHi,s.longitudeHi))};t.call(o,[n])}catch(e){console.warn(e),t.call(o,[])}},reverse:function(e,t,o,s){try{var n={name:this.options.OpenLocationCode.encode(e.lat,e.lng,this.options.codeLength),center:d.latLng(e.lat,e.lng),bbox:d.latLngBounds(d.latLng(e.lat,e.lng),d.latLng(e.lat,e.lng))};o.call(s,[n])}catch(e){console.warn(e),o.call(s,[])}}});var L=d.Class.extend({options:{serviceUrl:"https://api.opencagedata.com/geocode/v1/json",geocodingQueryParams:{},reverseQueryParams:{}},initialize:function(e,t){d.setOptions(this,t),this._accessToken=e},geocode:function(e,r,a){var t={key:this._accessToken,q:e};t=d.extend(t,this.options.geocodingQueryParams),u(this.options.serviceUrl,t,function(e){var t,o,s,n=[];if(e.results&&e.results.length)for(var i=0;ithis._lastSuggest&&(this._lastSuggest=e.geocoding.timestamp,t.call(o,s._parseResults(e,"bbox")))},this))},reverse:function(e,t,o,s){var n=this;u(this.options.serviceUrl+"/reverse",d.extend({api_key:this._apiKey,"point.lat":e.lat,"point.lon":e.lng},this.options.reverseQueryParams),function(e){o.call(s,n._parseResults(e,"bounds"))})},_parseResults:function(e,i){var r=[];return d.geoJson(e,{pointToLayer:function(e,t){return d.circleMarker(t)},onEachFeature:function(e,t){var o,s,n={};t.getBounds?s=(o=t.getBounds()).getCenter():o=t.feature.bbox?(s=t.getLatLng(),d.latLngBounds(d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(0,2)),d.GeoJSON.coordsToLatLng(t.feature.bbox.slice(2,4)))):(s=t.getLatLng(),d.latLngBounds(s,s)),n.name=t.feature.properties.label,n.center=s,n[i]=o,n.properties=t.feature.properties,r.push(n)}}),r}});function e(e,t){return new x(e,t)}var U=x,C=e,k=x,w=e,D=k.extend({options:{serviceUrl:"https://api.openrouteservice.org/geocode"}});var P=d.Class.extend({options:{serviceUrl:"https://photon.komoot.de/api/",reverseUrl:"https://photon.komoot.de/reverse/",nameProperties:["name","street","suburb","hamlet","town","city","state","country"]},initialize:function(e){d.setOptions(this,e)},geocode:function(e,t,o){var s=d.extend({q:e},this.options.geocodingQueryParams);u(this.options.serviceUrl,s,d.bind(function(e){t.call(o,this._decodeFeatures(e))},this))},suggest:function(e,t,o){return this.geocode(e,t,o)},reverse:function(e,t,o,s){var n=d.extend({lat:e.lat,lon:e.lng},this.options.reverseQueryParams);u(this.options.reverseUrl,n,d.bind(function(e){o.call(s,this._decodeFeatures(e))},this))},_decodeFeatures:function(e){var t,o,s,n,i,r,a=[];if(e&&e.features)for(t=0;t=this.options.suggestMinLength?this._suggestTimeout=setTimeout(d.bind(function(){this._geocode(!0)},this),this.options.suggestTimeout):this._clearResults())}});return d.Util.extend(T,R),d.Util.extend(d.Control,{Geocoder:T,geocoder:function(e){return new T(e)}}),T}(L); +//# sourceMappingURL=Control.Geocoder.min.js.map diff --git a/assets/js/Control.Geocoder.min.js.map b/assets/js/Control.Geocoder.min.js.map new file mode 100644 index 00000000..84c1d466 --- /dev/null +++ b/assets/js/Control.Geocoder.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Control.Geocoder.min.js","sources":["../src/util.js","../src/geocoders/arcgis.js","../src/geocoders/bing.js","../src/geocoders/google.js","../src/geocoders/here.js","../src/geocoders/latlng.js","../src/geocoders/mapbox.js","../src/geocoders/mapquest.js","../src/geocoders/neutrino.js","../src/geocoders/nominatim.js","../src/geocoders/open-location-code.js","../src/geocoders/opencage.js","../src/geocoders/pelias.js","../src/geocoders/photon.js","../src/geocoders/what3words.js","../src/control.js","../src/index.js"],"sourcesContent":["import L from 'leaflet';\nvar lastCallbackId = 0;\n\n// Adapted from handlebars.js\n// https://github.com/wycats/handlebars.js/\nvar badChars = /[&<>\"'`]/g;\nvar possible = /[&<>\"'`]/;\nvar escape = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n\nfunction escapeChar(chr) {\n return escape[chr];\n}\n\nexport function htmlEscape(string) {\n if (string == null) {\n return '';\n } else if (!string) {\n return string + '';\n }\n\n // Force a string conversion as this will be done by the append regardless and\n // the regex test will do this transparently behind the scenes, causing issues if\n // an object's to string has escaped characters in it.\n string = '' + string;\n\n if (!possible.test(string)) {\n return string;\n }\n return string.replace(badChars, escapeChar);\n}\n\nexport function jsonp(url, params, callback, context, jsonpParam) {\n var callbackId = '_l_geocoder_' + lastCallbackId++;\n params[jsonpParam || 'callback'] = callbackId;\n window[callbackId] = L.Util.bind(callback, context);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url + getParamString(params);\n script.id = callbackId;\n document.getElementsByTagName('head')[0].appendChild(script);\n}\n\nexport function getJSON(url, params, callback) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState !== 4) {\n return;\n }\n var message;\n if (xmlHttp.status !== 200 && xmlHttp.status !== 304) {\n message = '';\n } else if (typeof xmlHttp.response === 'string') {\n // IE doesn't parse JSON responses even with responseType: 'json'.\n try {\n message = JSON.parse(xmlHttp.response);\n } catch (e) {\n // Not a JSON response\n message = xmlHttp.response;\n }\n } else {\n message = xmlHttp.response;\n }\n callback(message);\n };\n xmlHttp.open('GET', url + getParamString(params), true);\n xmlHttp.responseType = 'json';\n xmlHttp.setRequestHeader('Accept', 'application/json');\n xmlHttp.send(null);\n}\n\nexport function template(str, data) {\n return str.replace(/\\{ *([\\w_]+) *\\}/g, function(str, key) {\n var value = data[key];\n if (value === undefined) {\n value = '';\n } else if (typeof value === 'function') {\n value = value(data);\n }\n return htmlEscape(value);\n });\n}\n\nexport function getParamString(obj, existingUrl, uppercase) {\n var params = [];\n for (var i in obj) {\n var key = encodeURIComponent(uppercase ? i.toUpperCase() : i);\n var value = obj[i];\n if (!L.Util.isArray(value)) {\n params.push(key + '=' + encodeURIComponent(value));\n } else {\n for (var j = 0; j < value.length; j++) {\n params.push(key + '=' + encodeURIComponent(value[j]));\n }\n }\n }\n return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var ArcGis = L.Class.extend({\n options: {\n service_url: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer'\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n SingleLine: query,\n outFields: 'Addr_Type',\n forStorage: false,\n maxLocations: 10,\n f: 'json'\n };\n\n if (this._key && this._key.length) {\n params.token = this._key;\n }\n\n getJSON(\n this.options.service_url + '/findAddressCandidates',\n L.extend(params, this.options.geocodingQueryParams),\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n\n if (data.candidates && data.candidates.length) {\n for (var i = 0; i <= data.candidates.length - 1; i++) {\n loc = data.candidates[i];\n latLng = L.latLng(loc.location.y, loc.location.x);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.extent.ymax, loc.extent.xmax),\n L.latLng(loc.extent.ymin, loc.extent.xmin)\n );\n results[i] = {\n name: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n location: encodeURIComponent(location.lng) + ',' + encodeURIComponent(location.lat),\n distance: 100,\n f: 'json'\n };\n\n getJSON(this.options.service_url + '/reverseGeocode', params, function(data) {\n var result = [],\n loc;\n\n if (data && !data.error) {\n loc = L.latLng(data.location.y, data.location.x);\n result.push({\n name: data.address.Match_addr,\n center: loc,\n bounds: L.latLngBounds(loc, loc)\n });\n }\n\n cb.call(context, result);\n });\n }\n});\n\nexport function arcgis(accessToken, options) {\n return new ArcGis(accessToken, options);\n}\n","import L from 'leaflet';\nimport { jsonp } from '../util';\n\nexport var Bing = L.Class.extend({\n initialize: function(key) {\n this.key = key;\n },\n\n geocode: function(query, cb, context) {\n jsonp(\n 'https://dev.virtualearth.net/REST/v1/Locations',\n {\n query: query,\n key: this.key\n },\n function(data) {\n var results = [];\n if (data.resourceSets.length > 0) {\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n },\n\n reverse: function(location, scale, cb, context) {\n jsonp(\n '//dev.virtualearth.net/REST/v1/Locations/' + location.lat + ',' + location.lng,\n {\n key: this.key\n },\n function(data) {\n var results = [];\n for (var i = data.resourceSets[0].resources.length - 1; i >= 0; i--) {\n var resource = data.resourceSets[0].resources[i],\n bbox = resource.bbox;\n results[i] = {\n name: resource.name,\n bbox: L.latLngBounds([bbox[0], bbox[1]], [bbox[2], bbox[3]]),\n center: L.latLng(resource.point.coordinates)\n };\n }\n cb.call(context, results);\n },\n this,\n 'jsonp'\n );\n }\n});\n\nexport function bing(key) {\n return new Bing(key);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Google = L.Class.extend({\n options: {\n serviceUrl: 'https://maps.googleapis.com/maps/api/geocode/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(key, options) {\n this._key = key;\n L.setOptions(this, options);\n // Backwards compatibility\n this.options.serviceUrl = this.options.service_url || this.options.serviceUrl;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n address: query\n };\n\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n latlng: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng)\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n if (this._key && this._key.length) {\n params.key = this._key;\n }\n\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.results && data.results.length) {\n for (var i = 0; i <= data.results.length - 1; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry.location);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.geometry.viewport.northeast),\n L.latLng(loc.geometry.viewport.southwest)\n );\n results[i] = {\n name: loc.formatted_address,\n bbox: latLngBounds,\n center: latLng,\n properties: loc.address_components\n };\n }\n }\n\n cb.call(context, results);\n });\n }\n});\n\nexport function google(key, options) {\n return new Google(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\nexport var HERE = L.Class.extend({\n options: {\n geocodeUrl: 'https://geocoder.api.here.com/6.2/geocode.json',\n reverseGeocodeUrl: 'https://reverse.geocoder.api.here.com/6.2/reversegeocode.json',\n app_id: '',\n app_code: '',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n reverseGeocodeProxRadius: null\n },\n initialize: function(options) {\n L.setOptions(this, options);\n },\n geocode: function(query, cb, context) {\n var params = {\n searchtext: query,\n gen: 9,\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.geocodingQueryParams);\n this.getJSON(this.options.geocodeUrl, params, cb, context);\n },\n reverse: function(location, scale, cb, context) {\n var _proxRadius = this.options.reverseGeocodeProxRadius\n ? this.options.reverseGeocodeProxRadius\n : null;\n var proxRadius = _proxRadius ? ',' + encodeURIComponent(_proxRadius) : '';\n var params = {\n prox: encodeURIComponent(location.lat) + ',' + encodeURIComponent(location.lng) + proxRadius,\n mode: 'retrieveAddresses',\n app_id: this.options.app_id,\n app_code: this.options.app_code,\n gen: 9,\n jsonattributes: 1\n };\n params = L.Util.extend(params, this.options.reverseQueryParams);\n this.getJSON(this.options.reverseGeocodeUrl, params, cb, context);\n },\n getJSON: function(url, params, cb, context) {\n getJSON(url, params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.response.view && data.response.view.length) {\n for (var i = 0; i <= data.response.view[0].result.length - 1; i++) {\n loc = data.response.view[0].result[i].location;\n latLng = L.latLng(loc.displayPosition.latitude, loc.displayPosition.longitude);\n latLngBounds = L.latLngBounds(\n L.latLng(loc.mapView.topLeft.latitude, loc.mapView.topLeft.longitude),\n L.latLng(loc.mapView.bottomRight.latitude, loc.mapView.bottomRight.longitude)\n );\n results[i] = {\n name: loc.address.label,\n properties: loc.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n cb.call(context, results);\n });\n }\n});\nexport function here(options) {\n return new HERE(options);\n}\n","import L from 'leaflet';\n\nexport var LatLng = L.Class.extend({\n options: {\n // the next geocoder to use\n next: undefined,\n sizeInMeters: 10000\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var match;\n var center;\n // regex from https://github.com/openstreetmap/openstreetmap-website/blob/master/app/controllers/geocoder_controller.rb\n if ((match = query.match(/^([NS])\\s*(\\d{1,3}(?:\\.\\d*)?)\\W*([EW])\\s*(\\d{1,3}(?:\\.\\d*)?)$/))) {\n // [NSEW] decimal degrees\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * parseFloat(match[2]),\n (/E/i.test(match[3]) ? 1 : -1) * parseFloat(match[4])\n );\n } else if (\n (match = query.match(/^(\\d{1,3}(?:\\.\\d*)?)\\s*([NS])\\W*(\\d{1,3}(?:\\.\\d*)?)\\s*([EW])$/))\n ) {\n // decimal degrees [NSEW]\n center = L.latLng(\n (/N/i.test(match[2]) ? 1 : -1) * parseFloat(match[1]),\n (/E/i.test(match[4]) ? 1 : -1) * parseFloat(match[3])\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?$/\n ))\n ) {\n // [NSEW] degrees, decimal minutes\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) * (parseFloat(match[2]) + parseFloat(match[3] / 60)),\n (/E/i.test(match[4]) ? 1 : -1) * (parseFloat(match[5]) + parseFloat(match[6] / 60))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,3}(?:\\.\\d*)?)?['′]?\\s*([EW])$/\n ))\n ) {\n // degrees, decimal minutes [NSEW]\n center = L.latLng(\n (/N/i.test(match[3]) ? 1 : -1) * (parseFloat(match[1]) + parseFloat(match[2] / 60)),\n (/E/i.test(match[6]) ? 1 : -1) * (parseFloat(match[4]) + parseFloat(match[5] / 60))\n );\n } else if (\n (match = query.match(\n /^([NS])\\s*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?\\W*([EW])\\s*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?$/\n ))\n ) {\n // [NSEW] degrees, minutes, decimal seconds\n center = L.latLng(\n (/N/i.test(match[1]) ? 1 : -1) *\n (parseFloat(match[2]) + parseFloat(match[3] / 60 + parseFloat(match[4] / 3600))),\n (/E/i.test(match[5]) ? 1 : -1) *\n (parseFloat(match[6]) + parseFloat(match[7] / 60) + parseFloat(match[8] / 3600))\n );\n } else if (\n (match = query.match(\n /^(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]\\s*([NS])\\W*(\\d{1,3})°?\\s*(\\d{1,2})['′]?\\s*(\\d{1,3}(?:\\.\\d*)?)?[\"″]?\\s*([EW])$/\n ))\n ) {\n // degrees, minutes, decimal seconds [NSEW]\n center = L.latLng(\n (/N/i.test(match[4]) ? 1 : -1) *\n (parseFloat(match[1]) + parseFloat(match[2] / 60 + parseFloat(match[3] / 3600))),\n (/E/i.test(match[8]) ? 1 : -1) *\n (parseFloat(match[5]) + parseFloat(match[6] / 60) + parseFloat(match[7] / 3600))\n );\n } else if (\n (match = query.match(/^\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*[\\s,]\\s*([+-]?\\d+(?:\\.\\d*)?)\\s*$/))\n ) {\n center = L.latLng(parseFloat(match[1]), parseFloat(match[2]));\n }\n if (center) {\n var results = [\n {\n name: query,\n center: center,\n bbox: center.toBounds(this.options.sizeInMeters)\n }\n ];\n cb.call(context, results);\n } else if (this.options.next) {\n this.options.next.geocode(query, cb, context);\n }\n }\n});\n\nexport function latLng(options) {\n return new LatLng(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Mapbox = L.Class.extend({\n options: {\n serviceUrl: 'https://api.mapbox.com/geocoding/v5/mapbox.places/',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(accessToken, options) {\n L.setOptions(this, options);\n this.options.geocodingQueryParams.access_token = accessToken;\n this.options.reverseQueryParams.access_token = accessToken;\n },\n\n geocode: function(query, cb, context) {\n var params = this.options.geocodingQueryParams;\n if (\n params.proximity !== undefined &&\n params.proximity.lat !== undefined &&\n params.proximity.lng !== undefined\n ) {\n params.proximity = params.proximity.lng + ',' + params.proximity.lat;\n }\n getJSON(this.options.serviceUrl + encodeURIComponent(query) + '.json', params, function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n\n var properties = {\n text: loc.text,\n address: loc.address\n };\n\n for (var j = 0; j < (loc.context || []).length; j++) {\n var id = loc.context[j].id.split('.')[0];\n properties[id] = loc.context[j].text;\n\n // Get country code when available\n if (loc.context[j].short_code) {\n properties['countryShortCode'] = loc.context[j].short_code\n }\n }\n\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng,\n properties: properties\n };\n }\n }\n\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl +\n encodeURIComponent(location.lng) +\n ',' +\n encodeURIComponent(location.lat) +\n '.json',\n this.options.reverseQueryParams,\n function(data) {\n var results = [],\n loc,\n latLng,\n latLngBounds;\n if (data.features && data.features.length) {\n for (var i = 0; i <= data.features.length - 1; i++) {\n loc = data.features[i];\n latLng = L.latLng(loc.center.reverse());\n if (loc.bbox) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.bbox.slice(0, 2).reverse()),\n L.latLng(loc.bbox.slice(2, 4).reverse())\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results[i] = {\n name: loc.place_name,\n bbox: latLngBounds,\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function mapbox(accessToken, options) {\n return new Mapbox(accessToken, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var MapQuest = L.Class.extend({\n options: {\n serviceUrl: 'https://www.mapquestapi.com/geocoding/v1'\n },\n\n initialize: function(key, options) {\n // MapQuest seems to provide URI encoded API keys,\n // so to avoid encoding them twice, we decode them here\n this._key = decodeURIComponent(key);\n\n L.Util.setOptions(this, options);\n },\n\n _formatName: function() {\n var r = [],\n i;\n for (i = 0; i < arguments.length; i++) {\n if (arguments[i]) {\n r.push(arguments[i]);\n }\n }\n\n return r.join(', ');\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + '/address',\n {\n key: this._key,\n location: query,\n limit: 5,\n outFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + '/reverse',\n {\n key: this._key,\n location: location.lat + ',' + location.lng,\n outputFormat: 'json'\n },\n L.bind(function(data) {\n var results = [],\n loc,\n latLng;\n if (data.results && data.results[0].locations) {\n for (var i = data.results[0].locations.length - 1; i >= 0; i--) {\n loc = data.results[0].locations[i];\n latLng = L.latLng(loc.latLng);\n results[i] = {\n name: this._formatName(loc.street, loc.adminArea4, loc.adminArea3, loc.adminArea1),\n bbox: L.latLngBounds(latLng, latLng),\n center: latLng\n };\n }\n }\n\n cb.call(context, results);\n }, this)\n );\n }\n});\n\nexport function mapQuest(key, options) {\n return new MapQuest(key, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Neutrino = L.Class.extend({\n options: {\n userId: '',\n apiKey: '',\n serviceUrl: 'https://neutrinoapi.com/'\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n // https://www.neutrinoapi.com/api/geocode-address/\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-address',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n //get three words and make a dot based string\n address: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.locations) {\n data.geometry = data.locations[0];\n latLng = L.latLng(data.geometry['latitude'], data.geometry['longitude']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.geometry.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n // https://www.neutrinoapi.com/api/geocode-reverse/\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'geocode-reverse',\n {\n apiKey: this.options.apiKey,\n userId: this.options.userId,\n latitude: location.lat,\n longitude: location.lng\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200 && data.found) {\n latLng = L.latLng(location.lat, location.lng);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.address,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function neutrino(accessToken) {\n return new Neutrino(accessToken);\n}\n","import L from 'leaflet';\nimport { template, getJSON } from '../util';\n\nexport var Nominatim = L.Class.extend({\n options: {\n serviceUrl: 'https://nominatim.openstreetmap.org/',\n geocodingQueryParams: {},\n reverseQueryParams: {},\n htmlTemplate: function(r) {\n var a = r.address,\n className,\n parts = [];\n if (a.road || a.building) {\n parts.push('{building} {road} {house_number}');\n }\n\n if (a.city || a.town || a.village || a.hamlet) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-detail' : '';\n parts.push(\n '{postcode} {city} {town} {village} {hamlet}'\n );\n }\n\n if (a.state || a.country) {\n className = parts.length > 0 ? 'leaflet-control-geocoder-address-context' : '';\n parts.push('{state} {country}');\n }\n\n return template(parts.join('
'), a, true);\n }\n },\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n getJSON(\n this.options.serviceUrl + 'search',\n L.extend(\n {\n q: query,\n limit: 5,\n format: 'json',\n addressdetails: 1\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n var results = [];\n for (var i = data.length - 1; i >= 0; i--) {\n var bbox = data[i].boundingbox;\n for (var j = 0; j < 4; j++) bbox[j] = parseFloat(bbox[j]);\n results[i] = {\n icon: data[i].icon,\n name: data[i].display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data[i]) : undefined,\n bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),\n center: L.latLng(data[i].lat, data[i].lon),\n properties: data[i]\n };\n }\n cb.call(context, results);\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n L.extend(\n {\n lat: location.lat,\n lon: location.lng,\n zoom: Math.round(Math.log(scale / 256) / Math.log(2)),\n addressdetails: 1,\n format: 'json'\n },\n this.options.reverseQueryParams\n ),\n L.bind(function(data) {\n var result = [],\n loc;\n\n if (data && data.lat && data.lon) {\n loc = L.latLng(data.lat, data.lon);\n result.push({\n name: data.display_name,\n html: this.options.htmlTemplate ? this.options.htmlTemplate(data) : undefined,\n center: loc,\n bounds: L.latLngBounds(loc, loc),\n properties: data\n });\n }\n\n cb.call(context, result);\n }, this)\n );\n }\n});\n\nexport function nominatim(options) {\n return new Nominatim(options);\n}\n","import L from 'leaflet';\n\nexport var OpenLocationCode = L.Class.extend({\n options: {\n OpenLocationCode: undefined,\n codeLength: undefined\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n try {\n var decoded = this.options.OpenLocationCode.decode(query);\n var result = {\n name: query,\n center: L.latLng(decoded.latitudeCenter, decoded.longitudeCenter),\n bbox: L.latLngBounds(\n L.latLng(decoded.latitudeLo, decoded.longitudeLo),\n L.latLng(decoded.latitudeHi, decoded.longitudeHi)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n },\n reverse: function(location, scale, cb, context) {\n try {\n var code = this.options.OpenLocationCode.encode(\n location.lat,\n location.lng,\n this.options.codeLength\n );\n var result = {\n name: code,\n center: L.latLng(location.lat, location.lng),\n bbox: L.latLngBounds(\n L.latLng(location.lat, location.lng),\n L.latLng(location.lat, location.lng)\n )\n };\n cb.call(context, [result]);\n } catch (e) {\n console.warn(e); // eslint-disable-line no-console\n cb.call(context, []);\n }\n }\n});\n\nexport function openLocationCode(options) {\n return new OpenLocationCode(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var OpenCage = L.Class.extend({\n options: {\n serviceUrl: 'https://api.opencagedata.com/geocode/v1/json',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.setOptions(this, options);\n this._accessToken = apiKey;\n },\n\n geocode: function(query, cb, context) {\n var params = {\n key: this._accessToken,\n q: query\n };\n params = L.extend(params, this.options.geocodingQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n var params = {\n key: this._accessToken,\n q: [location.lat, location.lng].join(',')\n };\n params = L.extend(params, this.options.reverseQueryParams);\n getJSON(this.options.serviceUrl, params, function(data) {\n var results = [],\n latLng,\n latLngBounds,\n loc;\n if (data.results && data.results.length) {\n for (var i = 0; i < data.results.length; i++) {\n loc = data.results[i];\n latLng = L.latLng(loc.geometry);\n if (loc.annotations && loc.annotations.bounds) {\n latLngBounds = L.latLngBounds(\n L.latLng(loc.annotations.bounds.northeast),\n L.latLng(loc.annotations.bounds.southwest)\n );\n } else {\n latLngBounds = L.latLngBounds(latLng, latLng);\n }\n results.push({\n name: loc.formatted,\n bbox: latLngBounds,\n center: latLng\n });\n }\n }\n cb.call(context, results);\n });\n }\n});\n\nexport function opencage(apiKey, options) {\n return new OpenCage(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Pelias = L.Class.extend({\n options: {\n serviceUrl: 'https://api.geocode.earth/v1',\n geocodingQueryParams: {},\n reverseQueryParams: {}\n },\n\n initialize: function(apiKey, options) {\n L.Util.setOptions(this, options);\n this._apiKey = apiKey;\n this._lastSuggest = 0;\n },\n\n geocode: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/search',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n );\n },\n\n suggest: function(query, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/autocomplete',\n L.extend(\n {\n api_key: this._apiKey,\n text: query\n },\n this.options.geocodingQueryParams\n ),\n L.bind(function(data) {\n if (data.geocoding.timestamp > this._lastSuggest) {\n this._lastSuggest = data.geocoding.timestamp;\n cb.call(context, _this._parseResults(data, 'bbox'));\n }\n }, this)\n );\n },\n\n reverse: function(location, scale, cb, context) {\n var _this = this;\n getJSON(\n this.options.serviceUrl + '/reverse',\n L.extend(\n {\n api_key: this._apiKey,\n 'point.lat': location.lat,\n 'point.lon': location.lng\n },\n this.options.reverseQueryParams\n ),\n function(data) {\n cb.call(context, _this._parseResults(data, 'bounds'));\n }\n );\n },\n\n _parseResults: function(data, bboxname) {\n var results = [];\n L.geoJson(data, {\n pointToLayer: function(feature, latlng) {\n return L.circleMarker(latlng);\n },\n onEachFeature: function(feature, layer) {\n var result = {},\n bbox,\n center;\n\n if (layer.getBounds) {\n bbox = layer.getBounds();\n center = bbox.getCenter();\n } else if (layer.feature.bbox) {\n center = layer.getLatLng();\n bbox = L.latLngBounds(\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(0, 2)),\n L.GeoJSON.coordsToLatLng(layer.feature.bbox.slice(2, 4))\n );\n } else {\n center = layer.getLatLng();\n bbox = L.latLngBounds(center, center);\n }\n\n result.name = layer.feature.properties.label;\n result.center = center;\n result[bboxname] = bbox;\n result.properties = layer.feature.properties;\n results.push(result);\n }\n });\n return results;\n }\n});\n\nexport function pelias(apiKey, options) {\n return new Pelias(apiKey, options);\n}\nexport var GeocodeEarth = Pelias;\nexport var geocodeEarth = pelias;\n\nexport var Mapzen = Pelias; // r.i.p.\nexport var mapzen = pelias;\n\nexport var Openrouteservice = Mapzen.extend({\n options: {\n serviceUrl: 'https://api.openrouteservice.org/geocode'\n }\n});\nexport function openrouteservice(apiKey, options) {\n return new Openrouteservice(apiKey, options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var Photon = L.Class.extend({\n options: {\n serviceUrl: 'https://photon.komoot.de/api/',\n reverseUrl: 'https://photon.komoot.de/reverse/',\n nameProperties: ['name', 'street', 'suburb', 'hamlet', 'town', 'city', 'state', 'country']\n },\n\n initialize: function(options) {\n L.setOptions(this, options);\n },\n\n geocode: function(query, cb, context) {\n var params = L.extend(\n {\n q: query\n },\n this.options.geocodingQueryParams\n );\n\n getJSON(\n this.options.serviceUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(latLng, scale, cb, context) {\n var params = L.extend(\n {\n lat: latLng.lat,\n lon: latLng.lng\n },\n this.options.reverseQueryParams\n );\n\n getJSON(\n this.options.reverseUrl,\n params,\n L.bind(function(data) {\n cb.call(context, this._decodeFeatures(data));\n }, this)\n );\n },\n\n _decodeFeatures: function(data) {\n var results = [],\n i,\n f,\n c,\n latLng,\n extent,\n bbox;\n\n if (data && data.features) {\n for (i = 0; i < data.features.length; i++) {\n f = data.features[i];\n c = f.geometry.coordinates;\n latLng = L.latLng(c[1], c[0]);\n extent = f.properties.extent;\n\n if (extent) {\n bbox = L.latLngBounds([extent[1], extent[0]], [extent[3], extent[2]]);\n } else {\n bbox = L.latLngBounds(latLng, latLng);\n }\n\n results.push({\n name: this._decodeFeatureName(f),\n html: this.options.htmlTemplate ? this.options.htmlTemplate(f) : undefined,\n center: latLng,\n bbox: bbox,\n properties: f.properties\n });\n }\n }\n\n return results;\n },\n\n _decodeFeatureName: function(f) {\n return (this.options.nameProperties || [])\n .map(function(p) {\n return f.properties[p];\n })\n .filter(function(v) {\n return !!v;\n })\n .join(', ');\n }\n});\n\nexport function photon(options) {\n return new Photon(options);\n}\n","import L from 'leaflet';\nimport { getJSON } from '../util';\n\nexport var What3Words = L.Class.extend({\n options: {\n serviceUrl: 'https://api.what3words.com/v2/'\n },\n\n initialize: function(accessToken) {\n this._accessToken = accessToken;\n },\n\n geocode: function(query, cb, context) {\n //get three words and make a dot based string\n getJSON(\n this.options.serviceUrl + 'forward',\n {\n key: this._accessToken,\n addr: query.split(/\\s+/).join('.')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.geometry) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n\n cb.call(context, results);\n }\n );\n },\n\n suggest: function(query, cb, context) {\n return this.geocode(query, cb, context);\n },\n\n reverse: function(location, scale, cb, context) {\n getJSON(\n this.options.serviceUrl + 'reverse',\n {\n key: this._accessToken,\n coords: [location.lat, location.lng].join(',')\n },\n function(data) {\n var results = [],\n latLng,\n latLngBounds;\n if (data.status.status == 200) {\n latLng = L.latLng(data.geometry['lat'], data.geometry['lng']);\n latLngBounds = L.latLngBounds(latLng, latLng);\n results[0] = {\n name: data.words,\n bbox: latLngBounds,\n center: latLng\n };\n }\n cb.call(context, results);\n }\n );\n }\n});\n\nexport function what3words(accessToken) {\n return new What3Words(accessToken);\n}\n","import L from 'leaflet';\nimport { Nominatim } from './geocoders/index';\n\nexport var Geocoder = L.Control.extend({\n options: {\n showUniqueResult: true,\n showResultIcons: false,\n collapsed: true,\n expand: 'touch', // options: touch, click, anythingelse\n position: 'topright',\n placeholder: 'Search...',\n errorMessage: 'Nothing found.',\n iconLabel: 'Initiate a new search',\n queryMinLength: 1,\n suggestMinLength: 3,\n suggestTimeout: 250,\n defaultMarkGeocode: true\n },\n\n includes: L.Evented.prototype || L.Mixin.Events,\n\n initialize: function(options) {\n L.Util.setOptions(this, options);\n if (!this.options.geocoder) {\n this.options.geocoder = new Nominatim();\n }\n\n this._requestCount = 0;\n },\n\n addThrobberClass: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n removeThrobberClass: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-throbber');\n },\n\n onAdd: function(map) {\n var className = 'leaflet-control-geocoder',\n container = L.DomUtil.create('div', className + ' leaflet-bar'),\n icon = L.DomUtil.create('button', className + '-icon', container),\n form = (this._form = L.DomUtil.create('div', className + '-form', container)),\n input;\n\n this._map = map;\n this._container = container;\n\n icon.innerHTML = ' ';\n icon.type = 'button';\n icon.setAttribute('aria-label', this.options.iconLabel);\n\n input = this._input = L.DomUtil.create('input', '', form);\n input.type = 'text';\n input.value = this.options.query || '';\n input.placeholder = this.options.placeholder;\n L.DomEvent.disableClickPropagation(input);\n\n this._errorElement = L.DomUtil.create('div', className + '-form-no-error', container);\n this._errorElement.innerHTML = this.options.errorMessage;\n\n this._alts = L.DomUtil.create(\n 'ul',\n className + '-alternatives leaflet-control-geocoder-alternatives-minimized',\n container\n );\n L.DomEvent.disableClickPropagation(this._alts);\n\n L.DomEvent.addListener(input, 'keydown', this._keydown, this);\n if (this.options.geocoder.suggest) {\n L.DomEvent.addListener(input, 'input', this._change, this);\n }\n L.DomEvent.addListener(\n input,\n 'blur',\n function() {\n if (this.options.collapsed && !this._preventBlurCollapse) {\n this._collapse();\n }\n this._preventBlurCollapse = false;\n },\n this\n );\n\n if (this.options.collapsed) {\n if (this.options.expand === 'click') {\n L.DomEvent.addListener(\n container,\n 'click',\n function(e) {\n if (e.button === 0 && e.detail !== 2) {\n this._toggle();\n }\n },\n this\n );\n } else if (this.options.expand === 'touch') {\n L.DomEvent.addListener(\n container,\n L.Browser.touch ? 'touchstart mousedown' : 'mousedown',\n function(e) {\n this._toggle();\n e.preventDefault(); // mobile: clicking focuses the icon, so UI expands and immediately collapses\n e.stopPropagation();\n },\n this\n );\n } else {\n L.DomEvent.addListener(container, 'mouseover', this._expand, this);\n L.DomEvent.addListener(container, 'mouseout', this._collapse, this);\n this._map.on('movestart', this._collapse, this);\n }\n } else {\n this._expand();\n if (L.Browser.touch) {\n L.DomEvent.addListener(\n container,\n 'touchstart',\n function() {\n this._geocode();\n },\n this\n );\n } else {\n L.DomEvent.addListener(\n container,\n 'click',\n function() {\n this._geocode();\n },\n this\n );\n }\n }\n\n if (this.options.defaultMarkGeocode) {\n this.on('markgeocode', this.markGeocode, this);\n }\n\n this.on('startgeocode', this.addThrobberClass, this);\n this.on('finishgeocode', this.removeThrobberClass, this);\n this.on('startsuggest', this.addThrobberClass, this);\n this.on('finishsuggest', this.removeThrobberClass, this);\n\n L.DomEvent.disableClickPropagation(container);\n\n return container;\n },\n\n setQuery: function(string) {\n this._input.value = string;\n return this;\n },\n\n _geocodeResult: function(results, suggest) {\n if (!suggest && this.options.showUniqueResult && results.length === 1) {\n this._geocodeResultSelected(results[0]);\n } else if (results.length > 0) {\n this._alts.innerHTML = '';\n this._results = results;\n L.DomUtil.removeClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-open');\n for (var i = 0; i < results.length; i++) {\n this._alts.appendChild(this._createAlt(results[i], i));\n }\n } else {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-options-error');\n L.DomUtil.addClass(this._errorElement, 'leaflet-control-geocoder-error');\n }\n },\n\n markGeocode: function(result) {\n result = result.geocode || result;\n\n this._map.fitBounds(result.bbox);\n\n if (this._geocodeMarker) {\n this._map.removeLayer(this._geocodeMarker);\n }\n\n this._geocodeMarker = new L.Marker(result.center)\n .bindPopup(result.html || result.name)\n .addTo(this._map)\n .openPopup();\n\n return this;\n },\n\n _geocode: function(suggest) {\n var value = this._input.value;\n if (!suggest && value.length < this.options.queryMinLength) {\n return;\n }\n\n var requestCount = ++this._requestCount,\n mode = suggest ? 'suggest' : 'geocode',\n eventData = { input: value };\n\n this._lastGeocode = value;\n if (!suggest) {\n this._clearResults();\n }\n\n this.fire('start' + mode, eventData);\n this.options.geocoder[mode](\n value,\n function(results) {\n if (requestCount === this._requestCount) {\n eventData.results = results;\n this.fire('finish' + mode, eventData);\n this._geocodeResult(results, suggest);\n }\n },\n this\n );\n },\n\n _geocodeResultSelected: function(result) {\n this.fire('markgeocode', { geocode: result });\n },\n\n _toggle: function() {\n if (L.DomUtil.hasClass(this._container, 'leaflet-control-geocoder-expanded')) {\n this._collapse();\n } else {\n this._expand();\n }\n },\n\n _expand: function() {\n L.DomUtil.addClass(this._container, 'leaflet-control-geocoder-expanded');\n this._input.select();\n this.fire('expand');\n },\n\n _collapse: function() {\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-expanded');\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n this._input.blur(); // mobile: keyboard shouldn't stay expanded\n this.fire('collapse');\n },\n\n _clearResults: function() {\n L.DomUtil.addClass(this._alts, 'leaflet-control-geocoder-alternatives-minimized');\n this._selection = null;\n L.DomUtil.removeClass(this._errorElement, 'leaflet-control-geocoder-error');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-open');\n L.DomUtil.removeClass(this._container, 'leaflet-control-geocoder-options-error');\n },\n\n _createAlt: function(result, index) {\n var li = L.DomUtil.create('li', ''),\n a = L.DomUtil.create('a', '', li),\n icon = this.options.showResultIcons && result.icon ? L.DomUtil.create('img', '', a) : null,\n text = result.html ? undefined : document.createTextNode(result.name),\n mouseDownHandler = function mouseDownHandler(e) {\n // In some browsers, a click will fire on the map if the control is\n // collapsed directly after mousedown. To work around this, we\n // wait until the click is completed, and _then_ collapse the\n // control. Messy, but this is the workaround I could come up with\n // for #142.\n this._preventBlurCollapse = true;\n L.DomEvent.stop(e);\n this._geocodeResultSelected(result);\n L.DomEvent.on(\n li,\n 'click touchend',\n function() {\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n },\n this\n );\n };\n\n if (icon) {\n icon.src = result.icon;\n }\n\n li.setAttribute('data-result-index', index);\n\n if (result.html) {\n a.innerHTML = a.innerHTML + result.html;\n } else {\n a.appendChild(text);\n }\n\n // Use mousedown and not click, since click will fire _after_ blur,\n // causing the control to have collapsed and removed the items\n // before the click can fire.\n L.DomEvent.addListener(li, 'mousedown touchstart', mouseDownHandler, this);\n\n return li;\n },\n\n _keydown: function(e) {\n var _this = this,\n select = function select(dir) {\n if (_this._selection) {\n L.DomUtil.removeClass(_this._selection, 'leaflet-control-geocoder-selected');\n _this._selection = _this._selection[dir > 0 ? 'nextSibling' : 'previousSibling'];\n }\n if (!_this._selection) {\n _this._selection = _this._alts[dir > 0 ? 'firstChild' : 'lastChild'];\n }\n\n if (_this._selection) {\n L.DomUtil.addClass(_this._selection, 'leaflet-control-geocoder-selected');\n }\n };\n\n switch (e.keyCode) {\n // Escape\n case 27:\n if (this.options.collapsed) {\n this._collapse();\n } else {\n this._clearResults();\n }\n break;\n // Up\n case 38:\n select(-1);\n break;\n // Up\n case 40:\n select(1);\n break;\n // Enter\n case 13:\n if (this._selection) {\n var index = parseInt(this._selection.getAttribute('data-result-index'), 10);\n this._geocodeResultSelected(this._results[index]);\n this._clearResults();\n } else {\n this._geocode();\n }\n break;\n default:\n return;\n }\n\n L.DomEvent.preventDefault(e);\n },\n _change: function() {\n var v = this._input.value;\n if (v !== this._lastGeocode) {\n clearTimeout(this._suggestTimeout);\n if (v.length >= this.options.suggestMinLength) {\n this._suggestTimeout = setTimeout(\n L.bind(function() {\n this._geocode(true);\n }, this),\n this.options.suggestTimeout\n );\n } else {\n this._clearResults();\n }\n }\n }\n});\n\nexport function geocoder(options) {\n return new Geocoder(options);\n}\n","import L from 'leaflet';\nimport { Geocoder, geocoder } from './control';\nimport * as geocoders from './geocoders/index';\n\nL.Util.extend(Geocoder, geocoders);\nexport default Geocoder;\n\nL.Util.extend(L.Control, {\n Geocoder: Geocoder,\n geocoder: geocoder\n});\n"],"names":["lastCallbackId","badChars","possible","escape","&","<",">","\"","'","`","escapeChar","chr","jsonp","url","params","callback","context","jsonpParam","callbackId","window","L","Util","bind","script","document","createElement","type","src","getParamString","id","getElementsByTagName","appendChild","getJSON","xmlHttp","XMLHttpRequest","onreadystatechange","readyState","message","status","response","JSON","parse","e","open","responseType","setRequestHeader","send","template","str","data","replace","key","string","value","undefined","test","obj","existingUrl","uppercase","i","encodeURIComponent","toUpperCase","isArray","j","length","push","indexOf","join","ArcGis","Class","extend","options","service_url","initialize","accessToken","setOptions","this","_accessToken","geocode","query","cb","SingleLine","outFields","forStorage","maxLocations","f","_key","token","geocodingQueryParams","loc","latLng","latLngBounds","results","candidates","location","y","x","extent","ymax","xmax","ymin","xmin","name","address","bbox","center","call","suggest","reverse","scale","lng","lat","distance","result","error","Match_addr","bounds","Bing","resourceSets","resources","resource","point","coordinates","Google","serviceUrl","reverseQueryParams","geometry","viewport","northeast","southwest","formatted_address","properties","address_components","latlng","HERE","geocodeUrl","reverseGeocodeUrl","app_id","app_code","reverseGeocodeProxRadius","searchtext","gen","jsonattributes","_proxRadius","proxRadius","prox","mode","view","displayPosition","latitude","longitude","mapView","topLeft","bottomRight","label","LatLng","next","sizeInMeters","match","parseFloat","toBounds","Mapbox","access_token","proximity","features","slice","text","split","short_code","place_name","MapQuest","decodeURIComponent","_formatName","r","arguments","limit","outFormat","locations","street","adminArea4","adminArea3","adminArea1","outputFormat","Neutrino","userId","apiKey","found","Nominatim","htmlTemplate","className","a","parts","road","building","city","town","village","hamlet","state","country","q","format","addressdetails","boundingbox","icon","display_name","html","lon","zoom","Math","round","log","OpenLocationCode","codeLength","decoded","decode","latitudeCenter","longitudeCenter","latitudeLo","longitudeLo","latitudeHi","longitudeHi","console","warn","encode","OpenCage","annotations","formatted","Pelias","_apiKey","_lastSuggest","_this","api_key","_parseResults","geocoding","timestamp","point.lat","point.lon","bboxname","geoJson","pointToLayer","feature","circleMarker","onEachFeature","layer","getBounds","getCenter","getLatLng","GeoJSON","coordsToLatLng","pelias","GeocodeEarth","geocodeEarth","Mapzen","mapzen","Openrouteservice","Photon","reverseUrl","nameProperties","_decodeFeatures","c","_decodeFeatureName","map","p","filter","v","What3Words","addr","words","coords","Geocoder","Control","showUniqueResult","showResultIcons","collapsed","expand","position","placeholder","errorMessage","iconLabel","queryMinLength","suggestMinLength","suggestTimeout","defaultMarkGeocode","includes","Evented","prototype","Mixin","Events","geocoder","_requestCount","addThrobberClass","DomUtil","addClass","_container","removeThrobberClass","removeClass","onAdd","input","container","create","form","_form","_map","innerHTML","setAttribute","_input","DomEvent","disableClickPropagation","_errorElement","_alts","addListener","_keydown","_change","_preventBlurCollapse","_collapse","button","detail","_toggle","Browser","touch","preventDefault","stopPropagation","_expand","on","_geocode","markGeocode","setQuery","_geocodeResult","_geocodeResultSelected","_results","_createAlt","fitBounds","_geocodeMarker","removeLayer","Marker","bindPopup","addTo","openPopup","requestCount","eventData","_lastGeocode","_clearResults","fire","hasClass","select","blur","_selection","index","li","createTextNode","stop","dir","keyCode","parseInt","getAttribute","clearTimeout","_suggestTimeout","setTimeout","geocoders"],"mappings":";;;;;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sD,KAAKyP,UAAS,IACbzP,MACHA,KAAKL,QAAQmN,gBAGf9M,KAAK0Q,2BCtWblU,EAAEC,KAAKiD,OAAOwM,EAAUyF,GAGxBnV,EAAEC,KAAKiD,OAAOlD,EAAE2P,QAAS,CACvBD,SAAUA,EACVmB,SDuWK,SAAkB1N,GACvB,OAAO,IAAIuM,EAASvM"} \ No newline at end of file diff --git a/assets/js/admin/editor.js b/assets/js/admin/editor.js index 1e71e43e..74555b83 100644 --- a/assets/js/admin/editor.js +++ b/assets/js/admin/editor.js @@ -11,7 +11,7 @@ var p = g.split("["); var label = p.shift(); var variations = p.shift(); - var shortcodes = variations.split("|"); + var shortcodes = typeof variations!== 'undefined' ? variations.split("|") : []; var submenu = new Array(); shortcodes.forEach(function(s) { submenu.push({ diff --git a/assets/js/admin/iconpicker.js b/assets/js/admin/iconpicker.js index 04f99c60..565e9dc1 100644 --- a/assets/js/admin/iconpicker.js +++ b/assets/js/admin/iconpicker.js @@ -23,14 +23,14 @@ jQuery(document).ready(function($){ }) .click(function(){ $('.iris-picker').hide(); - $(this).closest('.sp-icon-color-box, td').find('.iris-picker').show(); + $(this).closest('.sp-color-box-for-icon, td').find('.iris-picker').show(); }); $('body').click(function() { $('.iris-picker').hide(); }); - $('.sp-icon-color-box, .colorpick').click(function(event){ + $('.sp-color-box-for-icon, .colorpick').click(function(event){ event.stopPropagation(); }); diff --git a/assets/js/admin/locationpicker.js b/assets/js/admin/locationpicker.js deleted file mode 100644 index ffd472cc..00000000 --- a/assets/js/admin/locationpicker.js +++ /dev/null @@ -1,16 +0,0 @@ -jQuery(document).ready(function($){ - $(".sp-location-picker").locationpicker({ - location: { - latitude: Number($(".sp-latitude").val()), - longitude: Number($(".sp-longitude").val()) - }, - radius: 0, - inputBinding: { - latitudeInput: $(".sp-latitude"), - longitudeInput: $(".sp-longitude"), - locationNameInput: $(".sp-address") - }, - addressFormat: null, - enableAutocomplete: true - }); -}); \ No newline at end of file diff --git a/assets/js/admin/sp-geocoder.js b/assets/js/admin/sp-geocoder.js new file mode 100644 index 00000000..00ce4039 --- /dev/null +++ b/assets/js/admin/sp-geocoder.js @@ -0,0 +1,54 @@ +//Get variables form input values +latitude = document.getElementById('term_meta[sp_latitude]').value; +longitude = document.getElementById('term_meta[sp_longitude]').value; + +//Initialize the map and add the Search control box +var map = L.map('sp-location-picker').setView([latitude, longitude], 15), + geocoder = L.Control.Geocoder.nominatim(), + control = L.Control.geocoder({ + geocoder: geocoder, + collapsed: false, + defaultMarkGeocode: false + }).addTo(map), + //Add a marker to use from the begining + marker = L.marker([latitude, longitude],{draggable: true, autoPan: true}).addTo(map); + +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' +}).addTo(map); + +//Pass the values to the fields after dragging +marker.on('dragend', function (e) { + document.getElementById('term_meta[sp_latitude]').value = marker.getLatLng().lat; + document.getElementById('term_meta[sp_longitude]').value = marker.getLatLng().lng; + geocoder.reverse(marker.getLatLng(), map.options.crs.scale(map.getZoom()), function(results) { + var r = results[0]; + if (r) { + document.getElementById('term_meta[sp_address]').value = r.name; + } + }) +}); + +//After searching +control.on('markgeocode', function(e) { + var center = e.geocode.center; + var address = e.geocode.name; + map.setView([center.lat, center.lng], 15); //Center map to the new place + map.removeLayer(marker); //Remove previous marker + marker = L.marker([center.lat, center.lng],{draggable: true, autoPan: true}).addTo(map); //Add new marker to use + //Pass the values to the fields after searching + document.getElementById('term_meta[sp_latitude]').value = center.lat; + document.getElementById('term_meta[sp_longitude]').value = center.lng; + document.getElementById('term_meta[sp_address]').value = address; + //Pass the values to the fields after dragging + marker.on('dragend', function (e) { + document.getElementById('term_meta[sp_latitude]').value = marker.getLatLng().lat; + document.getElementById('term_meta[sp_longitude]').value = marker.getLatLng().lng; + geocoder.reverse(marker.getLatLng(), map.options.crs.scale(map.getZoom()), function(results) { + var r = results[0]; + if (r) { + document.getElementById('term_meta[sp_address]').value = r.name; + } + }) + }); +}).addTo(map); \ No newline at end of file diff --git a/assets/js/admin/sp-setup-geocoder.js b/assets/js/admin/sp-setup-geocoder.js new file mode 100644 index 00000000..504b6329 --- /dev/null +++ b/assets/js/admin/sp-setup-geocoder.js @@ -0,0 +1,54 @@ +//Get variables form input values +latitude = document.getElementById('sp_latitude').value; +longitude = document.getElementById('sp_longitude').value; + +//Initialize the map and add the Search control box +var map = L.map('sp-location-picker').setView([latitude, longitude], 15), + geocoder = L.Control.Geocoder.nominatim(), + control = L.Control.geocoder({ + geocoder: geocoder, + collapsed: false, + defaultMarkGeocode: false + }).addTo(map), + //Add a marker to use from the begining + marker = L.marker([latitude, longitude],{draggable: true, autoPan: true}).addTo(map); + +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' +}).addTo(map); + +//Pass the values to the fields after dragging +marker.on('dragend', function (e) { + document.getElementById('sp_latitude').value = marker.getLatLng().lat; + document.getElementById('sp_longitude').value = marker.getLatLng().lng; + geocoder.reverse(marker.getLatLng(), map.options.crs.scale(map.getZoom()), function(results) { + var r = results[0]; + if (r) { + document.getElementById('sp_address').value = r.name; + } + }) +}); + +//After searching +control.on('markgeocode', function(e) { + var center = e.geocode.center; + var address = e.geocode.name; + map.setView([center.lat, center.lng], 15); //Center map to the new place + map.removeLayer(marker); //Remove previous marker + marker = L.marker([center.lat, center.lng],{draggable: true, autoPan: true}).addTo(map); //Add new marker to use + //Pass the values to the fields after searching + document.getElementById('sp_latitude').value = center.lat; + document.getElementById('sp_longitude').value = center.lng; + document.getElementById('sp_address').value = address; + //Pass the values to the fields after dragging + marker.on('dragend', function (e) { + document.getElementById('sp_latitude').value = marker.getLatLng().lat; + document.getElementById('sp_longitude').value = marker.getLatLng().lng; + geocoder.reverse(marker.getLatLng(), map.options.crs.scale(map.getZoom()), function(results) { + var r = results[0]; + if (r) { + document.getElementById('sp_address').value = r.name; + } + }) + }); +}).addTo(map); \ No newline at end of file diff --git a/assets/js/admin/sportspress-admin.js b/assets/js/admin/sportspress-admin.js index 893e2435..10c3f502 100644 --- a/assets/js/admin/sportspress-admin.js +++ b/assets/js/admin/sportspress-admin.js @@ -14,13 +14,16 @@ jQuery(document).ready(function($){ }); // Chosen select - $(".chosen-select").chosen({ - allow_single_deselect: true, - search_contains: true, - single_backstroke_delete: false, - disable_search_threshold: 10, - placeholder_text_multiple: localized_strings.none - }); + $(document).on("postbox-toggled", function() { + $(".chosen-select").filter(":visible").chosen({ + allow_single_deselect: true, + search_contains: true, + single_backstroke_delete: false, + disable_search_threshold: 10, + placeholder_text_multiple: localized_strings.none + }); + }).trigger("postbox-toggled"); + // Auto key placeholder $("#poststuff #title").on("keyup", function() { @@ -37,7 +40,7 @@ jQuery(document).ready(function($){ // Radio input toggle $(".sp-radio-toggle").click(function() { if($(this).data("sp-checked")) { - $(this).attr("checked", false ); + $(this).prop("checked", false ); $(this).data("sp-checked", false ); } else { $(this).data("sp-checked", true ); @@ -255,7 +258,7 @@ jQuery(document).ready(function($){ }); // Activate total stats calculator - if($(".sp-data-table .sp-total").size()) { + if($(".sp-data-table .sp-total").length) { $(".sp-data-table .sp-post td input").on("keyup", function() { $(this).closest(".sp-data-table").find(".sp-total td").eq($(this).parent().index()).find("input[data-sp-format=number][data-sp-total-type!=average]").trigger("updateTotal"); }); @@ -488,11 +491,11 @@ jQuery(document).ready(function($){ }); // Event format affects data - $(".post-type-sp_event #post-formats-select input.post-format").change(function() { + $(".post-type-sp_event #post-formats-select").change(function() { layout = $(".post-type-sp_event #post-formats-select input:checked").val(); if ( layout == "friendly" ) { - $(".sp_event-sp_league-field").show().find("select").prop("disabled", false); - $(".sp_event-sp_season-field").show().find("select").prop("disabled", false); + $(".sp_event-sp_league-field").hide().find("select").prop("disabled", true); + $(".sp_event-sp_season-field").hide().find("select").prop("disabled", true); } else { $(".sp_event-sp_league-field").show().find("select").prop("disabled", false); $(".sp_event-sp_season-field").show().find("select").prop("disabled", false); @@ -500,10 +503,10 @@ jQuery(document).ready(function($){ }); // Trigger event format change - $(".post-type-sp_event #post-formats-select input.post-format").trigger("change"); + $(".post-type-sp_event #post-formats-select").trigger("change"); // Calendar layout affects data - $(".post-type-sp_calendar #post-formats-select input.post-format").change(function() { + $(".post-type-sp_calendar #post-formats-select").change(function() { layout = $(".post-type-sp_calendar #post-formats-select input:checked").val(); $(".sp-calendar-table tr").each(function() { if ( layout == "list" ) { @@ -517,10 +520,10 @@ jQuery(document).ready(function($){ }); // Trigger calendar layout change - $(".post-type-sp_calendar #post-formats-select input.post-format").trigger("change"); + $(".post-type-sp_calendar #post-formats-select").trigger("change"); // Player list layout affects data - $(".post-type-sp_list #post-formats-select input.post-format").change(function() { + $(".post-type-sp_list #post-formats-select").change(function() { layout = $(".post-type-sp_list #post-formats-select input:checked").val(); $(".sp-player-list-table tr").each(function() { if ( layout == "list" ) { @@ -532,7 +535,7 @@ jQuery(document).ready(function($){ }); // Trigger player list layout change - $(".post-type-sp_list #post-formats-select input.post-format").trigger("change"); + $(".post-type-sp_list #post-formats-select").trigger("change"); // Configure primary result option (Ajax) $(".sp-admin-config-table").on("click", ".sp-primary-result-option", function() { diff --git a/assets/js/blocks/event-calendar.js b/assets/js/blocks/event-calendar.js new file mode 100644 index 00000000..7b749b00 --- /dev/null +++ b/assets/js/blocks/event-calendar.js @@ -0,0 +1,81 @@ +import apiFetch from '@wordpress/api-fetch'; +console.log(wp.api.collections.Posts()); + +wp.blocks.registerBlockType('sportspress/event-calendar', { + title: strings.event_calendar, + icon: 'calendar', + category: 'sportspress', + attributes: { + title: { + type: 'string' + }, + id: { + type: 'number' + }, + status: { + type: 'string' + }, + date: { + type: 'string' + }, + date_from: { + type: 'string' + }, + date_to: { + type: 'string' + }, + date_past: { + type: 'number' + }, + date_future: { + type: 'number' + }, + date_relative: { + type: 'number' + }, + day: { + type: 'string' + }, + show_all_events_link: { + type: 'number' + }, + + content: {type: 'string'}, + color: {type: 'string'} + }, + + edit: function(props) { + function updateContent(event) { + props.setAttributes({content: event.target.value}) + } + function updateColor(value) { + props.setAttributes({color: value.hex}) + } + return React.createElement( + wp.components.Panel, + {header: strings.event_calendar}, + React.createElement( + wp.components.PanelBody, + {title: strings.properties}, + React.createElement( + wp.components.TextControl, + {label: strings.title, type: "text", value: props.attributes.title} + ), + React.createElement( + wp.components.SelectControl, + {label: strings.select_calendar, options: [{label: strings.all, value: 0}].concat(posts.events.map(post => { + return {label: post.post_title, value: post.ID} + }))} + ) + ) + ); + }, + + save: function(props) { + return wp.element.createElement( + "h3", + { style: { border: "3px solid " + props.attributes.color } }, + props.attributes.content + ); + } +}) \ No newline at end of file diff --git a/assets/js/leaflet.js b/assets/js/leaflet.js new file mode 100644 index 00000000..21f499c3 --- /dev/null +++ b/assets/js/leaflet.js @@ -0,0 +1,6 @@ +/* @preserve + * Leaflet 1.7.1, a JS library for interactive maps. http://leafletjs.com + * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */ +!function(t,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports):"function"==typeof define&&define.amd?define(["exports"],i):i(t.L={})}(this,function(t){"use strict";function h(t){for(var i,e,n=1,o=arguments.length;n=this.min.x&&e.x<=this.max.x&&i.y>=this.min.y&&e.y<=this.max.y},intersects:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>=i.x&&n.x<=e.x,r=o.y>=i.y&&n.y<=e.y;return s&&r},overlaps:function(t){t=O(t);var i=this.min,e=this.max,n=t.min,o=t.max,s=o.x>i.x&&n.xi.y&&n.y=n.lat&&e.lat<=o.lat&&i.lng>=n.lng&&e.lng<=o.lng},intersects:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>=i.lat&&n.lat<=e.lat,r=o.lng>=i.lng&&n.lng<=e.lng;return s&&r},overlaps:function(t){t=N(t);var i=this._southWest,e=this._northEast,n=t.getSouthWest(),o=t.getNorthEast(),s=o.lat>i.lat&&n.lati.lng&&n.lng';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(t){return!1}}();function kt(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var Bt={ie:tt,ielt9:it,edge:et,webkit:nt,android:ot,android23:st,androidStock:at,opera:ht,chrome:ut,gecko:lt,safari:ct,phantom:_t,opera12:dt,win:pt,ie3d:mt,webkit3d:ft,gecko3d:gt,any3d:vt,mobile:yt,mobileWebkit:xt,mobileWebkit3d:wt,msPointer:Pt,pointer:Lt,touch:bt,mobileOpera:Tt,mobileGecko:Mt,retina:zt,passiveEvents:Ct,canvas:St,svg:Zt,vml:Et},At=Pt?"MSPointerDown":"pointerdown",It=Pt?"MSPointerMove":"pointermove",Ot=Pt?"MSPointerUp":"pointerup",Rt=Pt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,i,e,n){function o(t){Ut(t,r)}var s,r,a,h,u,l,c,_;function d(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Ut(t,h)}return"touchstart"===i?(u=t,l=e,c=n,_=p(function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ri(t),Ut(t,l)}),u["_leaflet_touchstart"+c]=_,u.addEventListener(At,_,!1),Dt||(document.addEventListener(At,Wt,!0),document.addEventListener(It,Ht,!0),document.addEventListener(Ot,Ft,!0),document.addEventListener(Rt,Ft,!0),Dt=!0)):"touchmove"===i?(h=e,(a=t)["_leaflet_touchmove"+n]=d,a.addEventListener(It,d,!1)):"touchend"===i&&(r=e,(s=t)["_leaflet_touchend"+n]=o,s.addEventListener(Ot,o,!1),s.addEventListener(Rt,o,!1)),this}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Ft(t){delete Nt[t.pointerId]}function Ut(t,i){for(var e in t.touches=[],Nt)t.touches.push(Nt[e]);t.changedTouches=[t],i(t)}var Vt=Pt?"MSPointerDown":Lt?"pointerdown":"touchstart",qt=Pt?"MSPointerUp":Lt?"pointerup":"touchend",Gt="_leaflet_";var Kt,Yt,Xt,Jt,$t,Qt,ti=fi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ii=fi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ei="webkitTransition"===ii||"OTransition"===ii?ii+"End":"transitionend";function ni(t){return"string"==typeof t?document.getElementById(t):t}function oi(t,i){var e,n=t.style[i]||t.currentStyle&&t.currentStyle[i];return n&&"auto"!==n||!document.defaultView||(n=(e=document.defaultView.getComputedStyle(t,null))?e[i]:null),"auto"===n?null:n}function si(t,i,e){var n=document.createElement(t);return n.className=i||"",e&&e.appendChild(n),n}function ri(t){var i=t.parentNode;i&&i.removeChild(t)}function ai(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function hi(t){var i=t.parentNode;i&&i.lastChild!==t&&i.appendChild(t)}function ui(t){var i=t.parentNode;i&&i.firstChild!==t&&i.insertBefore(t,i.firstChild)}function li(t,i){if(void 0!==t.classList)return t.classList.contains(i);var e=pi(t);return 0this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,i){this._enforcingBounds=!0;var e=this.getCenter(),n=this._limitCenter(e,this._zoom,N(t));return e.equals(n)||this.panTo(n,i),this._enforcingBounds=!1,this},panInside:function(t,i){var e,n,o=A((i=i||{}).paddingTopLeft||i.padding||[0,0]),s=A(i.paddingBottomRight||i.padding||[0,0]),r=this.getCenter(),a=this.project(r),h=this.project(t),u=this.getPixelBounds(),l=u.getSize().divideBy(2),c=O([u.min.add(o),u.max.subtract(s)]);return c.contains(h)||(this._enforcingBounds=!0,e=a.subtract(h),n=A(h.x+e.x,h.y+e.y),(h.xc.max.x)&&(n.x=a.x-e.x,0c.max.y)&&(n.y=a.y-e.y,0=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,i){for(var e,n=[],o="mouseout"===i||"mouseover"===i,s=t.target||t.srcElement,r=!1;s;){if((e=this._targets[m(s)])&&("click"===i||"preclick"===i)&&!t._simulated&&this._draggableMoved(e)){r=!0;break}if(e&&e.listens(i,!0)){if(o&&!Vi(s,t))break;if(n.push(e),o)break}if(s===this._container)break;s=s.parentNode}return n.length||r||o||!Vi(s,t)||(n=[this]),n},_handleDOMEvent:function(t){var i;this._loaded&&!Ui(t)&&("mousedown"!==(i=t.type)&&"keypress"!==i&&"keyup"!==i&&"keydown"!==i||Pi(t.target||t.srcElement),this._fireDOMEvent(t,i))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,i,e){var n;if("click"===t.type&&((n=h({},t)).type="preclick",this._fireDOMEvent(n,n.type,e)),!t._stopped&&(e=(e||[]).concat(this._findEventTargets(t,i))).length){var o=e[0];"contextmenu"===i&&o.listens(i,!0)&&Ri(t);var s,r={originalEvent:t};"keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(s=o.getLatLng&&(!o._radius||o._radius<=10),r.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=s?o.getLatLng():this.layerPointToLatLng(r.layerPoint));for(var a=0;athis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(i),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==e.animate&&!this.getSize().contains(o))&&(M(function(){this._moveStart(!0,!1)._animateZoom(t,i,!0)},this),!0)},_animateZoom:function(t,i,e,n){this._mapPane&&(e&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=i,ci(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:i,noUpdate:n}),setTimeout(p(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&_i(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M(function(){this._moveEnd(!0)},this))}});function Yi(t){return new Xi(t)}var Xi=S.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var i=this._map;return i&&i.removeControl(this),this.options.position=t,i&&i.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var i=this._container=this.onAdd(t),e=this.getPosition(),n=t._controlCorners[e];return ci(i,"leaflet-control"),-1!==e.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(ri(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",n=document.createElement("div");return n.innerHTML=e,n.firstChild},_addItem:function(t){var i,e=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((i=document.createElement("input")).type="checkbox",i.className="leaflet-control-layers-selector",i.defaultChecked=n):i=this._createRadioElement("leaflet-base-layers_"+m(this),n),this._layerControlInputs.push(i),i.layerId=m(t.layer),zi(i,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var s=document.createElement("div");return e.appendChild(s),s.appendChild(i),s.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(e),this._checkDisabledLayers(),e},_onInputClick:function(){var t,i,e=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=e.length-1;0<=s;s--)t=e[s],i=this._getLayer(t.layerId).layer,t.checked?n.push(i):t.checked||o.push(i);for(s=0;si.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),$i=Xi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var i="leaflet-control-zoom",e=si("div",i+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,i+"-in",e,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,i+"-out",e,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),e},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,i,e,n,o){var s=si("a",e,n);return s.innerHTML=t,s.href="#",s.title=i,s.setAttribute("role","button"),s.setAttribute("aria-label",i),Oi(s),zi(s,"click",Ni),zi(s,"click",o,this),zi(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,i="leaflet-disabled";_i(this._zoomInButton,i),_i(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMinZoom()||ci(this._zoomOutButton,i),!this._disabled&&t._zoom!==t.getMaxZoom()||ci(this._zoomInButton,i)}});Ki.mergeOptions({zoomControl:!0}),Ki.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new $i,this.addControl(this.zoomControl))});var Qi=Xi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var i="leaflet-control-scale",e=si("div",i),n=this.options;return this._addScales(n,i+"-line",e),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),e},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,i,e){t.metric&&(this._mScale=si("div",i,e)),t.imperial&&(this._iScale=si("div",i,e))},_update:function(){var t=this._map,i=t.getSize().y/2,e=t.distance(t.containerPointToLatLng([0,i]),t.containerPointToLatLng([this.options.maxWidth,i]));this._updateScales(e)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var i=this._getRoundNum(t),e=i<1e3?i+" m":i/1e3+" km";this._updateScale(this._mScale,e,i/t)},_updateImperial:function(t){var i,e,n,o=3.2808399*t;5280Leaflet'},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var i in(t.attributionControl=this)._container=si("div","leaflet-control-attribution"),Oi(this._container),t._layers)t._layers[i].getAttribution&&this.addAttribution(t._layers[i].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t=[];for(var i in this._attributions)this._attributions[i]&&t.push(i);var e=[];this.options.prefix&&e.push(this.options.prefix),t.length&&e.push(t.join(", ")),this._container.innerHTML=e.join(" | ")}}});Ki.mergeOptions({attributionControl:!0}),Ki.addInitHook(function(){this.options.attributionControl&&(new te).addTo(this)});Xi.Layers=Ji,Xi.Zoom=$i,Xi.Scale=Qi,Xi.Attribution=te,Yi.layers=function(t,i,e){return new Ji(t,i,e)},Yi.zoom=function(t){return new $i(t)},Yi.scale=function(t){return new Qi(t)},Yi.attribution=function(t){return new te(t)};var ie=S.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}});ie.addTo=function(t,i){return t.addHandler(i,this),this};var ee,ne={Events:Z},oe=bt?"touchstart mousedown":"mousedown",se={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},re={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},ae=E.extend({options:{clickTolerance:3},initialize:function(t,i,e,n){c(this,n),this._element=t,this._dragStartTarget=i||t,this._preventOutline=e},enable:function(){this._enabled||(zi(this._dragStartTarget,oe,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ae._dragging===this&&this.finishDrag(),Si(this._dragStartTarget,oe,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var i,e;!t._simulated&&this._enabled&&(this._moved=!1,li(this._element,"leaflet-zoom-anim")||ae._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((ae._dragging=this)._preventOutline&&Pi(this._element),xi(),Xt(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=bi(this._element),this._startPoint=new k(i.clientX,i.clientY),this._parentScale=Ti(e),zi(document,re[t.type],this._onMove,this),zi(document,se[t.type],this._onUp,this))))},_onMove:function(t){var i,e;!t._simulated&&this._enabled&&(t.touches&&1i&&(e.push(t[n]),o=n);oi.max.x&&(e|=2),t.yi.max.y&&(e|=8),e}function de(t,i,e,n){var o,s=i.x,r=i.y,a=e.x-s,h=e.y-r,u=a*a+h*h;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-e.x)*(t.y-e.y)/(n.y-e.y)+e.x&&(u=!u);return u||Oe.prototype._containsPoint.call(this,t,!0)}});var Ne=Ce.extend({initialize:function(t,i){c(this,i),this._layers={},t&&this.addData(t)},addData:function(t){var i,e,n,o=g(t)?t:t.features;if(o){for(i=0,e=o.length;iu.x&&(l=s.x+n-u.x+h.x),s.x-l-a.x<0&&(l=s.x-a.x),s.y+e+h.y>u.y&&(c=s.y+e-u.y+h.y),s.y-c-a.y<0&&(c=s.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c]))},_onCloseButtonClick:function(t){this._close(),Ni(t)},_getAnchor:function(){return A(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ki.mergeOptions({closePopupOnClick:!0}),Ki.include({openPopup:function(t,i,e){return t instanceof tn||(t=new tn(e).setContent(t)),i&&t.setLatLng(i),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Me.include({bindPopup:function(t,i){return t instanceof tn?(c(t,i),(this._popup=t)._source=this):(this._popup&&!i||(this._popup=new tn(i,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,i){return this._popup&&this._map&&(i=this._popup._prepareOpen(this,t,i),this._map.openPopup(this._popup,i)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var i=t.layer||t.target;this._popup&&this._map&&(Ni(t),i instanceof Be?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===i?this.closePopup():this.openPopup(i,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var en=Qe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Qe.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Qe.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Qe.prototype.getEvents.call(this);return bt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=si("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var i,e=this._map,n=this._container,o=e.latLngToContainerPoint(e.getCenter()),s=e.layerPointToContainerPoint(t),r=this.options.direction,a=n.offsetWidth,h=n.offsetHeight,u=A(this.options.offset),l=this._getAnchor(),c="top"===r?(i=a/2,h):"bottom"===r?(i=a/2,0):(i="center"===r?a/2:"right"===r?0:"left"===r?a:s.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oe.max.x)||!i.wrapLat&&(t.ye.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return N(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var i=this._map,e=this.getTileSize(),n=t.scaleBy(e),o=n.add(e);return[i.unproject(n,t.z),i.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var i=this._tileCoordsToNwSe(t),e=new R(i[0],i[1]);return this.options.noWrap||(e=this._map.wrapLatLngBounds(e)),e},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var i=t.split(":"),e=new k(+i[0],+i[1]);return e.z=+i[2],e},_removeTile:function(t){var i=this._tiles[t];i&&(ri(i.el),delete this._tiles[t],this.fire("tileunload",{tile:i.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ci(t,"leaflet-tile");var i=this.getTileSize();t.style.width=i.x+"px",t.style.height=i.y+"px",t.onselectstart=a,t.onmousemove=a,it&&this.options.opacity<1&&mi(t,this.options.opacity),ot&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,i){var e=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),p(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&M(p(this._tileReady,this,t,null,o)),vi(o,e),this._tiles[n]={el:o,coords:t,current:!0},i.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,i,e){i&&this.fire("tileerror",{error:i,tile:e,coords:t});var n=this._tileCoordsToKey(t);(e=this._tiles[n])&&(e.loaded=+new Date,this._map._fadeAnimated?(mi(e.el,0),z(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(e.active=!0,this._pruneTiles()),i||(ci(e.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:e.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),it||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(p(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var i=new k(this._wrapX?o(t.x,this._wrapX):t.x,this._wrapY?o(t.y,this._wrapY):t.y);return i.z=t.z,i},_pxBoundsToTileRange:function(t){var i=this.getTileSize();return new I(t.min.unscaleBy(i).floor(),t.max.unscaleBy(i).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var sn=on.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,i){this._url=t,(i=c(this,i)).detectRetina&&zt&&0')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_n={_initContainer:function(){this._container=si("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(hn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var i=t._container=cn("shape");ci(i,"leaflet-vml-shape "+(this.options.className||"")),i.coordsize="1 1",t._path=cn("path"),i.appendChild(t._path),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){var i=t._container;this._container.appendChild(i),t.options.interactive&&t.addInteractiveTarget(i)},_removePath:function(t){var i=t._container;ri(i),t.removeInteractiveTarget(i),delete this._layers[m(t)]},_updateStyle:function(t){var i=t._stroke,e=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(i=i||(t._stroke=cn("stroke")),o.appendChild(i),i.weight=n.weight+"px",i.color=n.color,i.opacity=n.opacity,n.dashArray?i.dashStyle=g(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):i.dashStyle="",i.endcap=n.lineCap.replace("butt","flat"),i.joinstyle=n.lineJoin):i&&(o.removeChild(i),t._stroke=null),n.fill?(e=e||(t._fill=cn("fill")),o.appendChild(e),e.color=n.fillColor||n.color,e.opacity=n.fillOpacity):e&&(o.removeChild(e),t._fill=null)},_updateCircle:function(t){var i=t._point.round(),e=Math.round(t._radius),n=Math.round(t._radiusY||e);this._setPath(t,t._empty()?"M0 0":"AL "+i.x+","+i.y+" "+e+","+n+" 0,23592600")},_setPath:function(t,i){t._path.v=i},_bringToFront:function(t){hi(t._container)},_bringToBack:function(t){ui(t._container)}},dn=Et?cn:J,pn=hn.extend({getEvents:function(){var t=hn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ri(this._container),Si(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){var t,i,e;this._map._animatingZoom&&this._bounds||(hn.prototype._update.call(this),i=(t=this._bounds).getSize(),e=this._container,this._svgSize&&this._svgSize.equals(i)||(this._svgSize=i,e.setAttribute("width",i.x),e.setAttribute("height",i.y)),vi(e,t.min),e.setAttribute("viewBox",[t.min.x,t.min.y,i.x,i.y].join(" ")),this.fire("update"))},_initPath:function(t){var i=t._path=dn("path");t.options.className&&ci(i,t.options.className),t.options.interactive&&ci(i,"leaflet-interactive"),this._updateStyle(t),this._layers[m(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ri(t._path),t.removeInteractiveTarget(t._path),delete this._layers[m(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var i=t._path,e=t.options;i&&(e.stroke?(i.setAttribute("stroke",e.color),i.setAttribute("stroke-opacity",e.opacity),i.setAttribute("stroke-width",e.weight),i.setAttribute("stroke-linecap",e.lineCap),i.setAttribute("stroke-linejoin",e.lineJoin),e.dashArray?i.setAttribute("stroke-dasharray",e.dashArray):i.removeAttribute("stroke-dasharray"),e.dashOffset?i.setAttribute("stroke-dashoffset",e.dashOffset):i.removeAttribute("stroke-dashoffset")):i.setAttribute("stroke","none"),e.fill?(i.setAttribute("fill",e.fillColor||e.color),i.setAttribute("fill-opacity",e.fillOpacity),i.setAttribute("fill-rule",e.fillRule||"evenodd")):i.setAttribute("fill","none"))},_updatePoly:function(t,i){this._setPath(t,$(t._parts,i))},_updateCircle:function(t){var i=t._point,e=Math.max(Math.round(t._radius),1),n="a"+e+","+(Math.max(Math.round(t._radiusY),1)||e)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(i.x-e)+","+i.y+n+2*e+",0 "+n+2*-e+",0 ";this._setPath(t,o)},_setPath:function(t,i){t._path.setAttribute("d",i)},_bringToFront:function(t){hi(t._path)},_bringToBack:function(t){ui(t._path)}});function mn(t){return Zt||Et?new pn(t):null}Et&&pn.include(_n),Ki.include({getRenderer:function(t){var i=(i=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(i)||this.addLayer(i),i},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var i=this._paneRenderers[t];return void 0===i&&(i=this._createRenderer({pane:t}),this._paneRenderers[t]=i),i},_createRenderer:function(t){return this.options.preferCanvas&&ln(t)||mn(t)}});var fn=Re.extend({initialize:function(t,i){Re.prototype.initialize.call(this,this._boundsToLatLngs(t),i)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=N(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pn.create=dn,pn.pointsToPath=$,Ne.geometryToLayer=De,Ne.coordsToLatLng=We,Ne.coordsToLatLngs=He,Ne.latLngToCoords=Fe,Ne.latLngsToCoords=Ue,Ne.getFeature=Ve,Ne.asFeature=qe,Ki.mergeOptions({boxZoom:!0});var gn=ie.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){zi(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Si(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ri(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Xt(),xi(),this._startPoint=this._map.mouseEventToContainerPoint(t),zi(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=si("div","leaflet-zoom-box",this._container),ci(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var i=new I(this._point,this._startPoint),e=i.getSize();vi(this._box,i.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(ri(this._box),_i(this._container,"leaflet-crosshair")),Jt(),wi(),Si(document,{contextmenu:Ni,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){var i;1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(p(this._resetState,this),0),i=new R(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(i).fire("boxzoomend",{boxZoomBounds:i})))},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ki.addInitHook("addHandler","boxZoom",gn),Ki.mergeOptions({doubleClickZoom:!0});var vn=ie.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var i=this._map,e=i.getZoom(),n=i.options.zoomDelta,o=t.originalEvent.shiftKey?e-n:e+n;"center"===i.options.doubleClickZoom?i.setZoom(o):i.setZoomAround(t.containerPoint,o)}});Ki.addInitHook("addHandler","doubleClickZoom",vn),Ki.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yn=ie.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new ae(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),ci(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){_i(this._map._container,"leaflet-grab"),_i(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,i=this._map;i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=N(this._map.options.maxBounds),this._offsetLimit=O(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var i,e;this._map.options.inertia&&(i=this._lastTime=+new Date,e=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(e),this._times.push(i),this._prunePositions(i)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1i.max.x&&(t.x=this._viscousLimit(t.x,i.max.x)),t.y>i.max.y&&(t.y=this._viscousLimit(t.y,i.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,i=Math.round(t/2),e=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-i+e)%t+i-e,s=(n+i+e)%t-i-e,r=Math.abs(o+e)i.getMaxZoom()&&1 0) { - radius *= 1; - options = $.extend({ - strokeColor: "#0000FF", - strokeOpacity: .35, - strokeWeight: 2, - fillColor: "#0000FF", - fillOpacity: .2 - }, options); - options.map = gmapContext.map; - options.radius = radius; - options.center = center; - gmapContext.circle = new google.maps.Circle(options); - return gmapContext.circle; - } - return null; - }, - setPosition: function(gMapContext, location, callback) { - gMapContext.location = location; - gMapContext.marker.setPosition(location); - gMapContext.map.panTo(location); - this.drawCircle(gMapContext, location, gMapContext.radius, {}); - if (gMapContext.settings.enableReverseGeocode) { - this.updateLocationName(gMapContext, callback); - } else { - if (callback) { - callback.call(this, gMapContext); - } - } - }, - locationFromLatLng: function(lnlg) { - return { - latitude: lnlg.lat(), - longitude: lnlg.lng() - }; - }, - addressByFormat: function(addresses, format) { - var result = null; - for (var i = addresses.length - 1; i >= 0; i--) { - if (addresses[i].types.indexOf(format) >= 0) { - result = addresses[i]; - } - } - return result || addresses[0]; - }, - updateLocationName: function(gmapContext, callback) { - gmapContext.geodecoder.geocode({ - latLng: gmapContext.marker.position - }, function(results, status) { - if (status == google.maps.GeocoderStatus.OK && results.length > 0) { - var address = GmUtility.addressByFormat(results, gmapContext.settings.addressFormat); - gmapContext.locationName = address.formatted_address; - gmapContext.addressComponents = GmUtility.address_component_from_google_geocode(address.address_components); - } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) { - return setTimeout(function() { - GmUtility.updateLocationName(gmapContext, callback); - }, 1e3); - } - if (callback) { - callback.call(this, gmapContext); - } - }); - }, - address_component_from_google_geocode: function(address_components) { - var result = {}; - for (var i = address_components.length - 1; i >= 0; i--) { - var component = address_components[i]; - if (component.types.indexOf("postal_code") >= 0) { - result.postalCode = component.short_name; - } else if (component.types.indexOf("street_number") >= 0) { - result.streetNumber = component.short_name; - } else if (component.types.indexOf("route") >= 0) { - result.streetName = component.short_name; - } else if (component.types.indexOf("locality") >= 0) { - result.city = component.short_name; - } else if (component.types.indexOf("sublocality") >= 0) { - result.district = component.short_name; - } else if (component.types.indexOf("administrative_area_level_1") >= 0) { - result.stateOrProvince = component.short_name; - } else if (component.types.indexOf("country") >= 0) { - result.country = component.short_name; - } - } - result.addressLine1 = [ result.streetNumber, result.streetName ].join(" ").trim(); - result.addressLine2 = ""; - return result; - } - }; - function isPluginApplied(domObj) { - return getContextForElement(domObj) != undefined; - } - function getContextForElement(domObj) { - return $(domObj).data("locationpicker"); - } - function updateInputValues(inputBinding, gmapContext) { - if (!inputBinding) return; - var currentLocation = GmUtility.locationFromLatLng(gmapContext.marker.position); - if (inputBinding.latitudeInput) { - inputBinding.latitudeInput.val(currentLocation.latitude).change(); - } - if (inputBinding.longitudeInput) { - inputBinding.longitudeInput.val(currentLocation.longitude).change(); - } - if (inputBinding.radiusInput) { - inputBinding.radiusInput.val(gmapContext.radius).change(); - } - if (inputBinding.locationNameInput) { - inputBinding.locationNameInput.val(gmapContext.locationName).change(); - } - } - function setupInputListenersInput(inputBinding, gmapContext) { - if (inputBinding) { - if (inputBinding.radiusInput) { - inputBinding.radiusInput.on("change", function(e) { - var radiusInputValue = $(this).val(); - if (!e.originalEvent || isNaN(radiusInputValue)) { - return; - } - gmapContext.radius = radiusInputValue; - GmUtility.setPosition(gmapContext, gmapContext.location, function(context) { - context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); - }); - }); - } - if (inputBinding.locationNameInput && gmapContext.settings.enableAutocomplete) { - var blur = false; - gmapContext.autocomplete = new google.maps.places.Autocomplete(inputBinding.locationNameInput.get(0), gmapContext.settings.autocompleteOptions); - google.maps.event.addListener(gmapContext.autocomplete, "place_changed", function() { - blur = false; - var place = gmapContext.autocomplete.getPlace(); - if (!place.geometry) { - gmapContext.settings.onlocationnotfound(place.name); - return; - } - GmUtility.setPosition(gmapContext, place.geometry.location, function(context) { - updateInputValues(inputBinding, context); - context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); - }); - }); - if (gmapContext.settings.enableAutocompleteBlur) { - inputBinding.locationNameInput.on("change", function(e) { - if (!e.originalEvent) { - return; - } - blur = true; - }); - inputBinding.locationNameInput.on("blur", function(e) { - if (!e.originalEvent) { - return; - } - setTimeout(function() { - var address = $(inputBinding.locationNameInput).val(); - if (address.length > 5 && blur) { - blur = false; - gmapContext.geodecoder.geocode({ - address: address - }, function(results, status) { - if (status == google.maps.GeocoderStatus.OK && results && results.length) { - GmUtility.setPosition(gmapContext, results[0].geometry.location, function(context) { - updateInputValues(inputBinding, context); - context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); - }); - } - }); - } - }, 1e3); - }); - } - } - if (inputBinding.latitudeInput) { - inputBinding.latitudeInput.on("change", function(e) { - var latitudeInputValue = $(this).val(); - if (!e.originalEvent || isNaN(latitudeInputValue)) { - return; - } - GmUtility.setPosition(gmapContext, new google.maps.LatLng(latitudeInputValue, gmapContext.location.lng()), function(context) { - context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - }); - }); - } - if (inputBinding.longitudeInput) { - inputBinding.longitudeInput.on("change", function(e) { - var longitudeInputValue = $(this).val(); - if (!e.originalEvent || isNaN(longitudeInputValue)) { - return; - } - GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.location.lat(), longitudeInputValue), function(context) { - context.settings.onchanged.apply(gmapContext.domContainer, [ GmUtility.locationFromLatLng(context.location), context.radius, false ]); - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - }); - }); - } - } - } - function autosize(gmapContext) { - google.maps.event.trigger(gmapContext.map, "resize"); - setTimeout(function() { - gmapContext.map.setCenter(gmapContext.marker.position); - }, 300); - } - function updateMap(gmapContext, $target, options) { - var settings = $.extend({}, $.fn.locationpicker.defaults, options), latNew = settings.location.latitude, lngNew = settings.location.longitude, radiusNew = settings.radius, latOld = gmapContext.settings.location.latitude, lngOld = gmapContext.settings.location.longitude, radiusOld = gmapContext.settings.radius; - if (latNew == latOld && lngNew == lngOld && radiusNew == radiusOld) return; - gmapContext.settings.location.latitude = latNew; - gmapContext.settings.location.longitude = lngNew; - gmapContext.radius = radiusNew; - GmUtility.setPosition(gmapContext, new google.maps.LatLng(gmapContext.settings.location.latitude, gmapContext.settings.location.longitude), function(context) { - setupInputListenersInput(gmapContext.settings.inputBinding, gmapContext); - context.settings.oninitialized($target); - }); - } - $.fn.locationpicker = function(options, params) { - if (typeof options == "string") { - var _targetDomElement = this.get(0); - if (!isPluginApplied(_targetDomElement)) return; - var gmapContext = getContextForElement(_targetDomElement); - switch (options) { - case "location": - if (params == undefined) { - var location = GmUtility.locationFromLatLng(gmapContext.location); - location.radius = gmapContext.radius; - location.name = gmapContext.locationName; - return location; - } else { - if (params.radius) { - gmapContext.radius = params.radius; - } - GmUtility.setPosition(gmapContext, new google.maps.LatLng(params.latitude, params.longitude), function(gmapContext) { - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - }); - } - break; - - case "subscribe": - if (params == undefined) { - return null; - } else { - var event = params.event; - var callback = params.callback; - if (!event || !callback) { - console.error('LocationPicker: Invalid arguments for method "subscribe"'); - return null; - } - google.maps.event.addListener(gmapContext.map, event, callback); - } - break; - - case "map": - if (params == undefined) { - var locationObj = GmUtility.locationFromLatLng(gmapContext.location); - locationObj.formattedAddress = gmapContext.locationName; - locationObj.addressComponents = gmapContext.addressComponents; - return { - map: gmapContext.map, - marker: gmapContext.marker, - location: locationObj - }; - } else { - return null; - } - - case "autosize": - autosize(gmapContext); - return this; - } - return null; - } - return this.each(function() { - var $target = $(this); - if (isPluginApplied(this)) { - updateMap(getContextForElement(this), $(this), options); - return; - } - var settings = $.extend({}, $.fn.locationpicker.defaults, options); - var gmapContext = new GMapContext(this, $.extend({}, { - zoom: settings.zoom, - center: new google.maps.LatLng(settings.location.latitude, settings.location.longitude), - mapTypeId: settings.mapTypeId, - mapTypeControl: false, - styles: settings.styles, - disableDoubleClickZoom: false, - scrollwheel: settings.scrollwheel, - streetViewControl: false, - radius: settings.radius, - locationName: settings.locationName, - settings: settings, - autocompleteOptions: settings.autocompleteOptions, - addressFormat: settings.addressFormat, - draggable: settings.draggable, - markerIcon: settings.markerIcon, - markerDraggable: settings.markerDraggable, - markerVisible: settings.markerVisible - }, settings.mapOptions)); - $target.data("locationpicker", gmapContext); - function displayMarkerWithSelectedArea() { - GmUtility.setPosition(gmapContext, gmapContext.marker.position, function(context) { - var currentLocation = GmUtility.locationFromLatLng(gmapContext.location); - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - context.settings.onchanged.apply(gmapContext.domContainer, [ currentLocation, context.radius, true ]); - }); - } - if (settings.markerInCenter) { - gmapContext.map.addListener("bounds_changed", function() { - if (!gmapContext.marker.dragging) { - gmapContext.marker.setPosition(gmapContext.map.center); - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - } - }); - gmapContext.map.addListener("idle", function() { - if (!gmapContext.marker.dragging) { - displayMarkerWithSelectedArea(); - } - }); - } - google.maps.event.addListener(gmapContext.marker, "drag", function(event) { - updateInputValues(gmapContext.settings.inputBinding, gmapContext); - }); - google.maps.event.addListener(gmapContext.marker, "dragend", function(event) { - displayMarkerWithSelectedArea(); - }); - GmUtility.setPosition(gmapContext, new google.maps.LatLng(settings.location.latitude, settings.location.longitude), function(context) { - updateInputValues(settings.inputBinding, gmapContext); - setupInputListenersInput(settings.inputBinding, gmapContext); - context.settings.oninitialized($target); - }); - }); - }; - $.fn.locationpicker.defaults = { - location: { - latitude: 40.7324319, - longitude: -73.82480777777776 - }, - locationName: "", - radius: 500, - zoom: 15, - mapTypeId: google.maps.MapTypeId.ROADMAP, - styles: [], - mapOptions: {}, - scrollwheel: true, - inputBinding: { - latitudeInput: null, - longitudeInput: null, - radiusInput: null, - locationNameInput: null - }, - enableAutocomplete: false, - enableAutocompleteBlur: false, - autocompleteOptions: null, - addressFormat: "postal_code", - enableReverseGeocode: true, - draggable: true, - onchanged: function(currentLocation, radius, isMarkerDropped) {}, - onlocationnotfound: function(locationName) {}, - oninitialized: function(component) {}, - markerIcon: undefined, - markerDraggable: true, - markerVisible: true - }; -})(jQuery); diff --git a/assets/js/sportspress.js b/assets/js/sportspress.js index cfef48c3..09ef3fb1 100644 --- a/assets/js/sportspress.js +++ b/assets/js/sportspress.js @@ -10,7 +10,7 @@ function sp_viewport() { (function($) { /* Header */ - if ( ! $('.sp-header').size() ) { + if ( ! $('.sp-header').length ) { $('body').prepend( '
' ); } @@ -116,4 +116,4 @@ function sp_viewport() { } }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/changelog.txt b/changelog.txt index 01ec474a..fbea05a8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,111 @@ == SportsPress Changelog == += 2.7.8 = +* Fix - Event results, box scores, and players stats not updating via REST API. + += 2.7.7 = +* Fix - Events not appearing due to filter malfunction. + += 2.7.6 = +* Feature - Add ability to bulk set events as on time. +* Fix - Players in events not being filtered by team. + += 2.7.5 = +* Tweak - Add ability to filter events by team and match day in one query. +* Tweak - Improve performance by updating leaflet script and only loading when required. +* Tweak - Add overtime notation compatibility for minutes played. +* Fix - Issue with event edit page where the scripts were not working. +* Fix - No records when format is default in event list shortcode. + += 2.7.4 = +* Tweak - Add option to display birthday, age, or both in birthdays widget. +* Fix - Player list data showing zeroes in some cases. + += 2.7.3 = +* Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary. +* Tweak - Avoid showing minutes box for subs when not needed. +* Tweak - Improve filtering speed for queries without leagues or seasons. +* Tweak - Apply reverse order setting in event lists. +* Tweak - Enable filtering a player's events played on a specific team. +* Fix - Include future events in REST API for WordPress 5.5. +* Fix - Enable updating player metrics using the REST API. +* Fix - Deprecated code for PHP 7.4. +* Fix - Elementor compatibility. +* Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. +* Localization - Adjust RTL stylesheet for event performance icons. + += 2.7.2 = +* Tweak - Sanitize delimiter field in event settings. + += 2.7.1 = +* Feature - Enable player list filtering by nationality. +* Feature - Add option to display date of birth in player lists. +* Tweak - Exclude postponed and canceled events from countdowns. +* Tweak - Apply reverse order option to event results. +* Tweak - When a team has more than one home venue, separate with commas. +* Fix - Venue address containing pluses in events. +* Fix - Event blocks showing the wrong dates when embedded within other event pages. +* Fix - Statistics not adding manual values when not based on equations. +* Fix - Event lists ignoring the format parameter. +* Fix - League table order when displaying multiple tables in team profiles. +* Fix - Error when deleting configuration columns. +* Fix - Player lists not including past players in some cases. +* Fix - Prevent error when viewing event calendar in some cases. + += 2.7 = +* Feature - New bulk actions to postpone and cancel multiple events. +* Feature - Add date of birth to player importer. +* Feature - Automatically select the home team's venue as the default venue when importing fixtures. +* Feature - Add ability to turn on comment for team profiles. +* Feature - Filter league tables by event status. +* Tweak - When an icon is used for player performance, display the icon in player lists and profiles. +* Tweak - Add title attribute for player statistic icons. +* Tweak - Default stylesheet sorting icon width. +* Fix - Icon color picker rendering issue. +* Fix - Image selector not working for player statistics. +* Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes. +* Localization - Add translation options for countdown units. + += 2.6.20 = +* Tweak - Improve compatibility with volleyball for checkbox performance. +* Preset - Update volleyball preset with additional options. + += 2.6.19 = +* Feature - Enable filtering calendars base on players. +* Feature - Add checkbox type to event performance. +* Fix - Javascript error when columns are hidden in event list. +* Fix - Notice when displaying staff in event performance table. +* Fix - Notice when event results are empty. +* Fix - Uncaught error in player class. +* Preset - Update volleyball preset using checkbox performance type. + += 2.6.18 = +* Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro. +* Fix - Headers already sent error related to default nationality module. + += 2.6.17 = +* Tweak - Only show welcome screen on major version upgrade. +* Tweak - Add filters to enable career totals calculation with extensions. +* Fix - Countdowns not reflecting timezone setting. + += 2.6.16 = +* Tweak - Add support for updated baseball extension with partial innings. +* Fix - Error displaying staff in events when offense and defense are separate tables. + += 2.6.15 = +* Important - Using Google Maps will require a SportsPress Pro license after August 31, 2019. +* Refactor - Fallback to OpenStreetMap for venue maps without SportsPress Pro. +* Feature - Option to display team logos instead of team names in player lists. +* Feature - Option to display custom specs in event blocks and event lists. +* Tweak - Improve page load speed when creating new league tables. +* Tweak - Prevent displaying events other than published or scheduled. +* Fix - Icons only appearing in the first table when player lists are grouped. +* Fix - Character encoding and CRLF errors in calendar feeds. +* Fix - Missing field location Schema error. +* Fix - Dropdowns collapsing in admin when meta boxes are hidden. +* Fix - Timezone handling in countdowns. +* Fix - Error when using special characters in admin settings. + = 2.6.14 = * Fix - API endpoints for secondary post types. diff --git a/dummy-data/players-sample.csv b/dummy-data/players-sample.csv index b43df364..6e1898be 100644 --- a/dummy-data/players-sample.csv +++ b/dummy-data/players-sample.csv @@ -1,5 +1,5 @@ -Number,Name,Positions,Teams,Leagues,Seasons,Nationality -1,Joe Allen,Goalkeeper,Eagles,Primary League|Secondary League,2014,aus -3,Steven Gerrard,Defender,Kangaroos,Primary League,2014|2013,usa -5,Daniel Sturridge,Midfielder|Forward,Sharks,Primary League|Secondary League,2014|2013,eng -6,Gabrielle Gonzalez,Forward,Kangaroos|Sharks,Primary League,2014,esp \ No newline at end of file +Number,Name,Positions,Teams,Leagues,Seasons,Nationality,DoB +1,Joe Allen,Goalkeeper,Eagles,Primary League|Secondary League,2014,aus,1983/05/05 +3,Steven Gerrard,Defender,Kangaroos,Primary League,2014|2013,usa,1970/03/10 +5,Daniel Sturridge,Midfielder|Forward,Sharks,Primary League|Secondary League,2014|2013,eng,1990/02/15 +6,Gabrielle Gonzalez,Forward,Kangaroos|Sharks,Primary League,2014,esp,1987/01/20 \ No newline at end of file diff --git a/feeds/ical.php b/feeds/ical.php index 8d66cc84..520a70b3 100644 --- a/feeds/ical.php +++ b/feeds/ical.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Feeds * @package SportsPress/Feeds - * @version 2.6.9 + * @version 2.7.5 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -29,24 +29,24 @@ $timezone = sanitize_option( 'timezone_string', get_option( 'timezone_string' ) // Get the URL $url = add_query_arg( 'feed', 'sp-ical', get_post_permalink( $post ) ); -$url = wordwrap( $url , 60, "\n\t", true ); +$url = wordwrap( $url , 60, "\r\n\t", true ); $output = -"BEGIN:VCALENDAR\n" . -"VERSION:2.0\n" . -"PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\n" . -"CALSCALE:GREGORIAN\n" . -"METHOD:PUBLISH\n" . -"URL:" . $url . "\n" . -"X-FROM-URL:" . $url . "\n" . -"NAME:" . $post->post_title . "\n" . -"X-WR-CALNAME:" . $post->post_title . "\n" . -"DESCRIPTION:" . $post->post_title . "\n" . -"X-WR-CALDESC:" . $post->post_title . "\n" . -"REFRESH-INTERVAL;VALUE=DURATION:PT2M\n" . -"X-PUBLISHED-TTL:PT2M\n" . -"TZID:" . $timezone . "\n" . -"X-WR-TIMEZONE:" . $timezone . "\n"; +"BEGIN:VCALENDAR\r\n" . +"VERSION:2.0\r\n" . +"PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\r\n" . +"CALSCALE:GREGORIAN\r\n" . +"METHOD:PUBLISH\r\n" . +"URL:" . $url . "\r\n" . +"X-FROM-URL:" . $url . "\r\n" . +"NAME:" . $post->post_title . "\r\n" . +"X-WR-CALNAME:" . $post->post_title . "\r\n" . +"DESCRIPTION:" . $post->post_title . "\r\n" . +"X-WR-CALDESC:" . $post->post_title . "\r\n" . +"REFRESH-INTERVAL;VALUE=DURATION:PT2M\r\n" . +"X-PUBLISHED-TTL:PT2M\r\n" . +"TZID:" . $timezone . "\r\n" . +"X-WR-TIMEZONE:" . $timezone . "\r\n"; // Loop through each event foreach ( $events as $event): @@ -96,7 +96,7 @@ foreach ( $events as $event): $geo = false; } } - $location = wordwrap( $location , 60, "\n\t" ); + $location = wordwrap( $location , 60, "\r\n\t" ); // Get title or write summary based on scores $results = array(); @@ -134,31 +134,36 @@ foreach ( $events as $event): } else { $summary = $event->post_title; } - + + //Convert &#[0-9]+ entities to UTF-8 + $summary = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $summary); + + $summary = apply_filters( 'sportspress_ical_feed_summary', $summary, $event ); + // Append to output string $output .= - "BEGIN:VEVENT\n" . - "SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\n" . - "UID:$event->ID\n" . - "STATUS:CONFIRMED\n" . - "DTSTAMP:19700101T000000\n". - "DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\n" . - "DTEND:" . $end->format( $date_format ) . "\n" . - "LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\n"; + "BEGIN:VEVENT\r\n" . + "SUMMARY:" . preg_replace( '/([\,;])/','\\\$1', $summary ) . "\r\n" . + "UID:$event->ID\r\n" . + "STATUS:CONFIRMED\r\n" . + "DTSTAMP:19700101T000000\r\n". + "DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\r\n" . + "DTEND:" . $end->format( $date_format ) . "\r\n" . + "LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\r\n"; if ( $description ) { - $output .= "DESCRIPTION:" . $description . "\n"; + $output .= "DESCRIPTION:" . $description . "\r\n"; } if ( $location ) { - $output .= "LOCATION:" . $location . "\n"; + $output .= "LOCATION:" . $location . "\r\n"; } if ( $geo ) { - $output .= "GEO:" . $geo . "\n"; + $output .= "GEO:" . $geo . "\r\n"; } - $output .= "END:VEVENT\n"; + $output .= "END:VEVENT\r\n"; endforeach; // End output diff --git a/includes/admin/class-sp-admin-assets.php b/includes/admin/class-sp-admin-assets.php index 05c93a98..ed45b204 100755 --- a/includes/admin/class-sp-admin-assets.php +++ b/includes/admin/class-sp-admin-assets.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin - * @version 2.6.8 + * @version 2.6.15 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -84,12 +84,6 @@ class SP_Admin_Assets { wp_register_script( 'jquery-fitvids', SP()->plugin_url() . '/assets/js/jquery.fitvids.js', array( 'jquery' ), '1.1', true ); - wp_register_script( 'google-maps', '//tboy.co/maps_js' ); - - wp_register_script( 'jquery-locationpicker', SP()->plugin_url() . '/assets/js/locationpicker.jquery.js', array( 'jquery', 'google-maps' ), '0.1.6', true ); - - wp_register_script( 'sportspress-admin-locationpicker', SP()->plugin_url() . '/assets/js/admin/locationpicker.js', array( 'jquery', 'google-maps', 'jquery-locationpicker' ), SP_VERSION, true ); - wp_register_script( 'sportspress-admin-equationbuilder', SP()->plugin_url() . '/assets/js/admin/equationbuilder.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable' ), SP_VERSION, true ); wp_register_script( 'sportspress-admin-colorpicker', SP()->plugin_url() . '/assets/js/admin/colorpicker.js', array( 'jquery', 'wp-color-picker', 'iris' ), SP_VERSION, true ); @@ -130,13 +124,6 @@ class SP_Admin_Assets { wp_enqueue_script( 'sportspress-admin-widgets' ); } - // Edit venue pages - if ( in_array( $screen->id, array( 'edit-sp_venue' ) ) ) { - wp_enqueue_script( 'google-maps' ); - wp_enqueue_script( 'jquery-locationpicker' ); - wp_enqueue_script( 'sportspress-admin-locationpicker' ); - } - // Edit color if ( in_array( $screen->id, array( 'sp_outcome' ) ) ) { wp_enqueue_script( 'sportspress-admin-colorpicker' ); diff --git a/includes/admin/class-sp-admin-dashboard.php b/includes/admin/class-sp-admin-dashboard.php index 49bcac2a..6dc7b4ab 100644 --- a/includes/admin/class-sp-admin-dashboard.php +++ b/includes/admin/class-sp-admin-dashboard.php @@ -31,6 +31,7 @@ class SP_Admin_Dashboard { * Init dashboard widgets */ public function init() { + wp_add_dashboard_widget( 'sportspress_dashboard_news', __( 'Sports News', 'sportspress' ), array( $this, 'news_widget' ), null, null, 'side' ); wp_add_dashboard_widget( 'sportspress_dashboard_status', __( 'SportsPress', 'sportspress' ), array( $this, 'status_widget' ) ); add_filter( 'dashboard_glance_items', array( $this, 'glance_items' ), 10, 1 ); } @@ -63,37 +64,61 @@ class SP_Admin_Dashboard { * Show status widget */ public function status_widget() { - ?> -
    - future ) ? $count->future : 0; - $published_count = isset( $count->publish ) ? $count->publish : 0; - $next_event = sp_get_next_event(); - if ( $next_event ): - $now = new DateTime( current_time( 'mysql', 0 ) ); - $date = new DateTime( $next_event->post_date ); - $interval = date_diff( $now, $date ); - ?> -
  • - - %s until next event', 'sportspress' ), $interval->days . ' ' . __( 'days', 'sportspress' ) . ' ' . sprintf( '%02s:%02s:%02s', $interval->h, $interval->i, $interval->s ) ); ?> - (post_title; ?>) - -
  • - -
  • - - %s event scheduled', '%s events scheduled', $scheduled_count, 'sportspress' ), $scheduled_count ); ?> - -
  • -
  • - - %s event published', '%s events published', $published_count, 'sportspress' ), $published_count ); ?> - -
  • + ?> + + get_item_quantity(5); + // Build an array of all the items, starting with element 0 (first element). + $rss_items = $rss->get_items(0, $maxitems); + } + if (!empty($maxitems)) { + ?> +
    + - + plugin_url() . '/assets/js/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true ); wp_register_script( 'jquery-tiptip', SP()->plugin_url() . '/assets/js/jquery.tipTip.min.js', array( 'jquery' ), '1.3', true ); - wp_register_script( 'google-maps', '//tboy.co/maps_js' ); wp_register_script( 'sportspress-setup', SP()->plugin_url() . '/assets/js/admin/sportspress-setup.js', array( 'jquery', 'chosen', 'jquery-tiptip' ), SP_VERSION, true ); - wp_register_script( 'jquery-locationpicker', SP()->plugin_url() . '/assets/js/locationpicker.jquery.js', array( 'jquery', 'google-maps' ), '0.1.6', true ); - wp_register_script( 'sportspress-admin-locationpicker', SP()->plugin_url() . '/assets/js/admin/locationpicker.js', array( 'jquery', 'jquery-locationpicker' ), SP_VERSION, true ); + do_action( 'sp_setup_geocoder_scripts' ); $strings = apply_filters( 'sportspress_localized_strings', array( 'none' => __( 'None', 'sportspress' ), @@ -115,8 +113,6 @@ class SP_Admin_Setup_Wizard { // Localize scripts wp_localize_script( 'sportspress-setup', 'localized_strings', $strings ); - wp_enqueue_script( 'google-maps' ); - if ( ! empty( $_POST['save_step'] ) && isset( $this->steps[ $this->step ]['handler'] ) ) { call_user_func( $this->steps[ $this->step ]['handler'] ); } @@ -517,6 +513,7 @@ class SP_Admin_Setup_Wizard { * Venue Step. */ public function sp_setup_venue() { + do_action( 'sp_setup_venue_geocoder_scripts' ); ?>

    @@ -531,11 +528,11 @@ class SP_Admin_Setup_Wizard { - -
    + +

    - - + + @@ -546,8 +543,8 @@ class SP_Admin_Setup_Wizard {

    - term_id; $term_meta = get_option( "taxonomy_$t_id" ); - $latitude = sp_array_value( $term_meta, 'sp_latitude', '40.7324319' ); - $longitude = sp_array_value( $term_meta, 'sp_longitude', '-73.82480799999996' ); + $latitude = sp_array_value( $term_meta, 'sp_latitude', '-37.8165647' ); + $longitude = sp_array_value( $term_meta, 'sp_longitude', '144.9475055' ); + $address = sp_array_value( $term_meta, 'sp_address', '' ); endif; // Sanitize latitude and longitude, fallback to default. if( ! is_numeric( $latitude) || ! is_numeric( $longitude) ): - $latitude = '40.7324319'; - $longitude = '-73.82480799999996'; + $latitude = '-37.8165647'; + $longitude = '144.9475055'; endif; ?>
    - - -

    +

    +
    + + +
    @@ -127,6 +130,7 @@ class SP_Admin_Taxonomies {
    term_id; - $term_meta = get_option( "taxonomy_$t_id" ); ?> + $term_meta = get_option( "taxonomy_$t_id" ); + $latitude = is_numeric( esc_attr( $term_meta['sp_latitude'] ) ) ? esc_attr( $term_meta['sp_latitude'] ) : ''; + $longitude = is_numeric( esc_attr( $term_meta['sp_longitude'] ) ) ? esc_attr( $term_meta['sp_longitude'] ) : ''; + $address = esc_attr( $term_meta['sp_address'] ) ? esc_attr( $term_meta['sp_address'] ) : ''; + ?> + + +

    +

    + + - -

    -

    + - + - +
      -
    • -
    • -
      + event as $name => $title ) { + ?> +
    • + +
    diff --git a/includes/admin/importers/class-sp-fixture-importer.php b/includes/admin/importers/class-sp-fixture-importer.php index a6d90953..79be47bd 100644 --- a/includes/admin/importers/class-sp-fixture-importer.php +++ b/includes/admin/importers/class-sp-fixture-importer.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Importers - * @version 2.5 + * @version 2.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -138,6 +138,11 @@ if ( class_exists( 'WP_Importer' ) ) { endif; // Update venue + if ( $venue == '' ) { + $team = reset( $teams ); + $team_object = get_page_by_title( stripslashes( $team ), OBJECT, 'sp_team' ); + $venue = sp_get_the_term_id( $team_object->ID, 'sp_venue' ); + } wp_set_object_terms( $id, $venue, 'sp_venue', false ); // Update match day diff --git a/includes/admin/importers/class-sp-player-importer.php b/includes/admin/importers/class-sp-player-importer.php index 353dd880..a480abda 100644 --- a/includes/admin/importers/class-sp-player-importer.php +++ b/includes/admin/importers/class-sp-player-importer.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Importers - * @version 2.6.9 + * @version 2.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -30,6 +30,7 @@ if ( class_exists( 'WP_Importer' ) ) { 'sp_league' => __( 'Leagues', 'sportspress' ), 'sp_season' => __( 'Seasons', 'sportspress' ), 'sp_nationality' => __( 'Nationality', 'sportspress' ), + 'post_date' => __( 'Date of Birth', 'sportspress' ), ); parent::__construct(); } @@ -51,6 +52,9 @@ if ( class_exists( 'WP_Importer' ) ) { endif; $rows = array_chunk( $array, sizeof( $columns ) ); + + // Get Date of Birth format from post vars + $date_format = ( empty( $_POST['sp_date_format'] ) ? 'yyyy/mm/dd' : $_POST['sp_date_format'] ); foreach ( $rows as $row ): @@ -69,7 +73,7 @@ if ( class_exists( 'WP_Importer' ) ) { 'sp_season', ); foreach ( $preservable_metas_keys as $p ) { - $meta[ $key ] = ''; + $meta[ $p ] = ''; } foreach ( $columns as $index => $key ): @@ -77,6 +81,27 @@ if ( class_exists( 'WP_Importer' ) ) { endforeach; $name = sp_array_value( $meta, 'post_title' ); + $date = sp_array_value( $meta, 'post_date' ); + + // Format date of birth + $date = str_replace( '/', '-', trim( $date ) ); + $date_array = explode( '-', $date ); + switch ( $date_format ): + case 'dd/mm/yyyy': + $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); + break; + case 'mm/dd/yyyy': + $date = substr( str_pad( sp_array_value( $date_array, 2, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 0, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); + break; + default: + $date = substr( str_pad( sp_array_value( $date_array, 0, '0000' ), 4, '0', STR_PAD_LEFT ), 0, 4 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 1, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ) . '-' . + substr( str_pad( sp_array_value( $date_array, 2, '00' ), 2, '0', STR_PAD_LEFT ), 0, 2 ); + endswitch; if ( ! $name ): $this->skipped++; @@ -97,6 +122,10 @@ if ( class_exists( 'WP_Importer' ) ) { } else: $args = array( 'post_type' => 'sp_player', 'post_status' => 'publish', 'post_title' => wp_strip_all_tags( $name ) ); + // Check if a DoB was set + if( '0000-00-00' !== $date ){ + $args['post_date'] = $date; + } $id = wp_insert_post( $args ); // Flag as import @@ -195,7 +224,7 @@ if ( class_exists( 'WP_Importer' ) ) { function greet() { echo '
    '; echo '

    ' . __( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ).'

    '; - echo '

    ' . sprintf( __( 'Players need to be defined with columns in a specific order (7 columns). Click here to download a sample.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/players-sample.csv' ) . '

    '; + echo '

    ' . sprintf( __( 'Players need to be defined with columns in a specific order (8 columns). Click here to download a sample.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/players-sample.csv' ) . '

    '; wp_import_upload_form( 'admin.php?import=sp_player_csv&step=1' ); echo '
    '; } @@ -210,6 +239,26 @@ if ( class_exists( 'WP_Importer' ) ) { ?> + + + +
    + + +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + $id, 'index' => $index ) ); + } + ?>
    - \ No newline at end of file diff --git a/templates/event-performance.php b/templates/event-performance.php index 684abb8b..cff616fb 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.6 + * @version 2.6.16 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -96,7 +96,7 @@ if ( is_array( $teams ) ): $formats[ $column->post_name ] = $format; } - do_action( 'sportspress_before_event_performance' ); + do_action( 'sportspress_before_event_performance', $columns ); if ( $is_individual ) { // Combined table @@ -217,6 +217,8 @@ if ( is_array( $teams ) ): } sp_get_template( 'event-performance-table.php', array( + 'id' => $id, + 'index' => $index, 'section' => $section_id, 'section_label' => $section_label, 'scrollable' => $scrollable, @@ -236,6 +238,7 @@ if ( is_array( $teams ) ): 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'primary' => 'primary' == $total ? $primary : null, 'class' => 'sp-template-event-performance-team-' . $index . ' sp-template-event-performance-section sp-template-event-performance-section-' . $section_id . ' sp-template-event-performance-team-' . $index . '-section-' . $section_id, + 'show_staff' => $show_staff, ) ); } @@ -256,9 +259,12 @@ if ( is_array( $teams ) ): } sp_get_template( 'event-performance-table.php', array( + 'id' => $id, + 'index' => $index, 'scrollable' => $scrollable, 'sortable' => $sortable, 'show_players' => $show_team_players, + 'show_staff' => $show_staff, 'show_numbers' => $show_numbers, 'show_minutes' => $show_minutes, 'show_total' => $show_total, @@ -272,14 +278,9 @@ if ( is_array( $teams ) ): 'link_posts' => $link_posts, 'performance_ids' => isset( $performance_ids ) ? $performance_ids : null, 'primary' => 'primary' == $total ? $primary : null, - ) ); } } - - if ( $show_staff ): - sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) ); - endif; } ?> Teams > Order > Reverse order" is enabled. +$reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false; +if ( $reverse_teams ) { + $data = array_reverse( $data, true ); +} + foreach( $data as $team_id => $result ): if ( $show_outcomes ): $outcomes = array(); diff --git a/templates/event-venue.php b/templates/event-venue.php index 719ef4a6..2a73de8c 100644 --- a/templates/event-venue.php +++ b/templates/event-venue.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 1.9 + * @version 2.7.1 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -29,9 +29,8 @@ foreach( $venues as $venue ): if ( $link_venues ) $name = '' . $name . ''; - $address = sp_array_value( $meta, 'sp_address', '' ); - $latitude = sp_array_value( $meta, 'sp_latitude', 0 ); - $longitude = sp_array_value( $meta, 'sp_longitude', 0 ); + $address = sp_array_value( $meta, 'sp_address', null ); + $address = urlencode( $address ); ?>

    @@ -41,14 +40,14 @@ foreach( $venues as $venue ): - + $meta ) ); ?> - + @@ -57,4 +56,4 @@ foreach( $venues as $venue ):
    \ No newline at end of file +?> diff --git a/templates/league-table.php b/templates/league-table.php index 5c35c5ae..8b5d16b4 100644 --- a/templates/league-table.php +++ b/templates/league-table.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.5.5 + * @version 2.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -48,6 +48,13 @@ if ( $show_title && false === $title && $id ): $title = get_the_title( $id ); endif; +//Check if we have event status sent from shortcode +if ( isset( $show_published_events ) ) + $table->show_published_events = $show_published_events ; + +if ( isset( $show_future_events ) ) + $table->show_future_events = $show_future_events ; + //Create a unique identifier based on the current time in microseconds $identifier = uniqid( 'table_' ); diff --git a/templates/official-details.php b/templates/official-details.php index 48be84c1..3837ce33 100644 --- a/templates/official-details.php +++ b/templates/official-details.php @@ -51,7 +51,7 @@ if ( $show_nationality ): $values = array(); foreach ( $nationalities as $nationality ): $country_name = sp_array_value( $countries, $nationality, null ); - $values[] = $country_name ? ( $show_nationality_flags ? '' . $nationality . ' ' : '' ) . $country_name : '—'; + $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $common[ __( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; diff --git a/templates/player-details.php b/templates/player-details.php index 3a2c742d..7dbf55de 100644 --- a/templates/player-details.php +++ b/templates/player-details.php @@ -51,7 +51,7 @@ if ( $show_nationality ): $values = array(); foreach ( $nationalities as $nationality ): $country_name = sp_array_value( $countries, $nationality, null ); - $values[] = $country_name ? ( $show_nationality_flags ? '' . $nationality . ' ' : '' ) . $country_name : '—'; + $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $common[ __( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; diff --git a/templates/player-events.php b/templates/player-events.php index 039695d4..ebcfb04d 100644 --- a/templates/player-events.php +++ b/templates/player-events.php @@ -15,7 +15,16 @@ if ( ! isset( $id ) ) $format = get_option( 'sportspress_player_events_format', 'blocks' ); if ( 'calendar' === $format ) sp_get_template( 'event-calendar.php', array( 'player' => $id ) ); -elseif ( 'list' === $format ) - sp_get_template( 'event-list.php', array( 'player' => $id, 'order' => 'DESC', 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ) ) ); +elseif ( 'list' === $format ) { + $args = array( + 'player' => $id, + 'title_format' => 'homeaway', + 'time_format' => 'separate', + 'columns' => array( 'event', 'time', 'results' ), + 'order' => 'DESC', + ); + $args = apply_filters( 'sp_player_events_list_args', $args ); + sp_get_template( 'event-list.php', $args ); +} else sp_get_template( 'event-fixtures-results.php', array( 'player' => $id ) ); diff --git a/templates/player-list.php b/templates/player-list.php index 46fac369..114e201c 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.6.10 + * @version 2.7.1 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -22,6 +22,7 @@ $defaults = array( 'show_title' => get_option( 'sportspress_list_show_title', 'yes' ) == 'yes' ? true : false, 'show_player_photo' => get_option( 'sportspress_list_show_photos', 'no' ) == 'yes' ? true : false, 'show_player_flag' => get_option( 'sportspress_list_show_flags', 'no' ) == 'yes' ? true : false, + 'team_format' => get_option( 'sportspress_list_team_format', 'name' ), 'link_posts' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_teams' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false, 'responsive' => get_option( 'sportspress_enable_responsive_tables', 'no' ) == 'yes' ? true : false, @@ -54,7 +55,8 @@ $list = new SP_Player_List( $id ); if ( isset( $columns ) && null !== $columns ): $list->columns = $columns; endif; -$data = $list->data( false, $leagues, $seasons, $team ); + +$data = apply_filters('sportspress_player_list_data', $list->data( false, $leagues, $seasons, $team ) , $id ); // The first row should be labels $labels = $data[0]; @@ -138,8 +140,6 @@ foreach ( $groups as $group ): foreach( $labels as $key => $label ): if ( $key !== 'number' && ( ! is_array( $columns ) || $key == 'name' || in_array( $key, $columns ) ) ) $thead .= ''. $label . ''; - if ( preg_match ( "/title=\"(.*?)\"/", $label, $new_label ) ) - $labels[$key] = $label[1]; endforeach; $thead .= '' . ''; @@ -179,7 +179,7 @@ foreach ( $groups as $group ): $nationalities = $player->nationalities(); if ( ! empty( $nationalities ) ): foreach ( $nationalities as $nationality ): - $name = '' . $nationality . '' . $name; + $name = '' . sp_flags( $nationality ) . '' . $name; endforeach; $name_class .= ' has-photo'; endif; @@ -193,8 +193,12 @@ foreach ( $groups as $group ): $tbody .= '' . $name . ''; if ( array_key_exists( 'team', $labels ) ): - $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) ); + $team = sp_array_value( $row, 'team', get_post_meta( $id, 'sp_current_team', true ) ); $team_name = $team ? sp_team_short_name( $team ) : '-'; + if ( $team_format == 'logo' && has_post_thumbnail( $team ) ){ + $logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'title' => ''.$team_name.'' ) ); + $team_name = ''; + } if ( $link_teams && false !== get_post_status( $team ) ): $team_name = '' . $team_name . ''; endif; @@ -215,8 +219,13 @@ foreach ( $groups as $group ): foreach( $labels as $key => $value ): if ( in_array( $key, array( 'number', 'name', 'team', 'position' ) ) ) continue; - if ( ! is_array( $columns ) || in_array( $key, $columns ) ) - $tbody .= '' . sp_array_value( $row, $key, '—' ) . ''; + if ( ! is_array( $columns ) || in_array( $key, $columns ) ) { + $label = $labels[$key]; + if ( preg_match ( "/title=\"(.*?)\"/", $value, $new_label ) ) { + $label = $new_label[1]; + } + $tbody .= '' . sp_array_value( $row, $key, '—' ) . ''; + } endforeach; $tbody .= ''; diff --git a/templates/staff-details.php b/templates/staff-details.php index ce04eb61..9fca30a9 100644 --- a/templates/staff-details.php +++ b/templates/staff-details.php @@ -41,7 +41,7 @@ if ( $show_nationality && $nationalities && is_array( $nationalities ) ): $nationality = sp_array_value( $legacy, $nationality, null ); endif; $country_name = sp_array_value( $countries, $nationality, null ); - $values[] = $country_name ? ( $show_nationality_flags ? '' . $nationality . ' ' : '' ) . $country_name : '—'; + $values[] = $country_name ? ( $show_nationality_flags ? sp_flags( $nationality ) : '' ) . $country_name : '—'; endforeach; $data[ __( 'Nationality', 'sportspress' ) ] = implode( '
    ', $values ); endif; diff --git a/templates/team-details.php b/templates/team-details.php index b0598e28..704586ef 100644 --- a/templates/team-details.php +++ b/templates/team-details.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.5 + * @version 2.7.1 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -36,7 +36,7 @@ endif; $terms = get_the_terms( $id, 'sp_venue' ); if ( $terms ): if ( get_option( 'sportspress_team_link_venues', 'no' ) === 'yes' ): - $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue' ); + $data[ __( 'Home', 'sportspress' ) ] = get_the_term_list( $id, 'sp_venue', '', ', ' ); else: $venues = array(); foreach ( $terms as $term ): @@ -59,4 +59,4 @@ $output .= ''; ?>
    -
    \ No newline at end of file + diff --git a/templates/venue-map.php b/templates/venue-map.php index dd07e851..1691e81d 100644 --- a/templates/venue-map.php +++ b/templates/venue-map.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.6.8 + * @version 2.7 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -12,6 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly if ( ! isset( $meta ) ) return; +if ( is_tax( 'sp_venue' ) ) + do_action ( 'sportspress_before_venue_map' ); + $address = sp_array_value( $meta, 'sp_address', null ); $address = urlencode( $address ); $latitude = sp_array_value( $meta, 'sp_latitude', null ); @@ -23,17 +26,8 @@ $maptype = strtolower( $maptype ); if ( '' === $address ) $address = '+'; if ( 'satellite' !== $maptype ) $maptype = 'roadmap'; -if ( $latitude != null && $longitude != null ): - ?> -
    - - -
    -