Skip to content

Commit

Permalink
Merge pull request #459 from bmlt-enabled/adding-min_zoom-and-max_zoo…
Browse files Browse the repository at this point in the history
…m-to-shortcode

Adding min zoom and max zoom to shortcode
  • Loading branch information
otrok7 authored Jan 15, 2024
2 parents ac26c14 + 6e9c0d2 commit 47c0424
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crouton.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Description: A tabbed based display for showing meeting information.
Author: bmlt-enabled
Author URI: https://bmlt.app
Version: 3.18.2
Version: 3.18.3
*/
/* Disallow direct access to the plugin file */
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
Expand Down
6 changes: 5 additions & 1 deletion croutonjs/meetingMap/meeting_map.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class Controller
'map_search_coordinate_search' => '',
'map_search_zoom' => '',
'center_me' => '',
'goto' => ''
'goto' => '',
'min_zoom' => '6',
'max_zoom' => '17'
);
public $options = array();

Expand Down Expand Up @@ -210,6 +212,8 @@ private function createJavascriptConfig($options)
$ret .= 'lat:"'.$options['lat'].'",';
$ret .= 'lng:"'.$options['lng'].'",';
$ret .= 'zoom:"'.$options['zoom'].'",';
$ret .= 'minZoom:"'.$options['min_zoom'].'",';
$ret .= 'maxZoom:"'.$options['max_zoom'].'",';
if (!empty($options['center_me'])) {
$ret .= 'centerMe:"'.$options['center_me'].'",';
}
Expand Down
8 changes: 4 additions & 4 deletions croutonjs/src/js/crouton-default-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ var croutonDefaultTemplates = {
"{{#isNotTemporarilyClosed this}}",
" {{#unless (hasFormats 'VM' this)}}",
" <div>",
" <a id='map-button' class='btn btn-primary btn-xs'",
" href='https://www.google.com/maps/search/?api=1&query={{this.latitude}},{{this.longitude}}&q={{this.latitude}},{{this.longitude}}'",
" target='_blank' rel='noopener noreferrer'>",
" <span class='glyphicon glyphicon-map-marker'></span> {{this.map_word}}</a>",
" <a onclick='crouton.meetingModal({{this.id_bigint}})' id='map-button' class='btn btn-primary btn-xs'>",
" <span class='glyphicon glyphicon-search' aria-hidden='true'></span>",
" {{getWord 'meeting details'}}",
" </a>",
" </div>",
" <div class='geo hide'>{{this.latitude}},{{this.longitude}}</div>",
" {{/unless}}",
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: na, meeting list, meeting finder, maps, recovery, addiction, webservant, b
Requires at least: 4.0
Required PHP: 8.0
Tested up to: 6.4.2
Stable tag: 3.18.2
Stable tag: 3.18.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
crouton implements a Tabbed UI for BMLT.
Expand Down Expand Up @@ -36,6 +36,10 @@ https://demo.bmlt.app/crouton

== Changelog ==

= 3.18.3 =
* Added min_zoom and max_zoom to the shortcode.
* Changed default template to bring up meeting details rather than going directly to google.

= 3.18.2 =
* Bug fix release

Expand Down

0 comments on commit 47c0424

Please sign in to comment.