Skip to content

Commit a6c5ed0

Browse files
author
Joe Hawes
committed
v0.9.29 Release
commit 4140a919ab8400106f51204e14d0a58e6b7eab1d Author: Joe Hawes <> Date: Wed Nov 1 09:54:31 2023 -0700 Updated version number & readme commit 68376e8b745f9729ab3fb8e8b103fb21df7846da Author: Joe Hawes <> Date: Wed Nov 1 09:49:28 2023 -0700 Line Opacity Working commit 2f6c3c0 Author: Joe Hawes <> Date: Wed Nov 1 07:47:28 2023 -0700 Update version number commit 99995be Author: Joe Hawes <> Date: Wed Nov 1 07:45:53 2023 -0700 Updated text commit 1f95f5b Author: Joe Hawes <[email protected]> Date: Wed Nov 1 06:57:11 2023 -0700 map_width basics
1 parent cc03d32 commit a6c5ed0

File tree

14 files changed

+87
-31
lines changed

14 files changed

+87
-31
lines changed

Waymark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: Waymark
55
Plugin URI: https://www.waymark.dev/
66
Description: Mapping with WordPress made easy. With Waymark enabled, click on the "Maps" link in the sidebar to create and edit Maps. Once you are happy with your Map, copy the Waymark shortcode and add it to your content.
7-
Version: 0.9.28.7
7+
Version: 0.9.29
88
Text Domain: waymark
99
Author: Joe Hawes
1010
Author URI: https://www.morehawes.co.uk/

assets/dist/waymark-js/js/waymark-js.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7863,7 +7863,7 @@ function Waymark_Map() {
78637863
layer.setStyle({
78647864
color: type.line_colour,
78657865
weight: type.line_weight,
7866-
opacity: '0.7'
7866+
opacity: type.line_opacity
78677867
});
78687868

78697869
//Set info window
@@ -8080,6 +8080,10 @@ function Waymark_Map() {
80808080
{
80818081
'key': 'line_weight',
80828082
'default': '3'
8083+
},
8084+
{
8085+
'key': 'line_opacity',
8086+
'default': '0.7'
80838087
}
80848088
];
80858089

@@ -9763,7 +9767,8 @@ function Waymark_Map_Editor() {
97639767
case 'line' :
97649768
layer.setStyle({
97659769
color: type.line_colour,
9766-
weight: type.line_weight
9770+
weight: type.line_weight,
9771+
opacity: type.line_opacity
97679772
});
97689773

97699774
break;

assets/dist/waymark-js/js/waymark-js.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/Admin/Waymark_Settings.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,18 @@ function __construct() {
316316
'(is_numeric($param_value)) ? $param_value : 3;' //Fallback
317317
)
318318
),
319+
'line_opacity' => array(
320+
'name' => 'line_opacity',
321+
'id' => 'line_opacity',
322+
'type' => 'text',
323+
'class' => 'waymark-short-input',
324+
'title' => '<span class="waymark-invisible">' . esc_html__('Line', 'waymark') . '</span> ' . esc_html__('Opacity', 'waymark'),
325+
'default' => Waymark_Config::get_setting('lines', 'line_types', 'line_opacity'),
326+
'tip' => esc_attr__('The opacity of the Line, between 0.0 and 1.0 (e.g. "0.5").', 'waymark'),
327+
'input_processing' => array(
328+
'(is_numeric($param_value) && $param_value > 0 && $param_value <= 1) ? $param_value : 0.7;' //Fallback
329+
)
330+
),
319331
'line_display' => array(
320332
'name' => 'line_display',
321333
'id' => 'line_display',
@@ -870,10 +882,11 @@ function __construct() {
870882
'name' => 'map_height',
871883
'id' => 'map_height',
872884
'type' => 'text',
873-
'class' => 'waymark-short-input',
885+
'class' => 'waymark-short-input waymark-align-top',
874886
'title' => esc_html__('Map Height', 'waymark'),
875-
'default' => Waymark_Config::get_setting('misc', 'map_options', 'map_height'),
876-
'tip' => sprintf(esc_attr__('Specify the desired height of the Map (in pixels). The Map will automatically adjust it’s width to fill the space available to it. Pro Tip! This will affect all Maps, but you can change the height of an individual Map through the shortcode: %s', 'waymark'), '[' . Waymark_Config::get_item('shortcode') . ' map_id=&quot;1234&quot; map_height=&quot;' . Waymark_Config::get_setting('misc', 'map_options', 'map_height') . '&quot;]'),
887+
'default' => Waymark_Config::get_setting('misc', 'map_options', 'map_height'),
888+
'append' => '<br />' . sprintf(esc_attr__('Or set in Shortcode: %s', 'waymark'), '<code>[' . Waymark_Config::get_item('shortcode') . ' map_height=&quot;' . Waymark_Config::get_setting('misc', 'map_options', 'map_height') . '&quot; map_width=&quot;320&quot;]</code>'),
889+
'tip' => sprintf(esc_attr__('Specify the desired height of the Map (in pixels). Pro Tip! This will affect all Maps, but you can change the height (and width) of an individual Map through the Shortcode: %s', 'waymark'), '[' . Waymark_Config::get_item('shortcode') . ' map_id=&quot;1234&quot; map_height=&quot;' . Waymark_Config::get_setting('misc', 'map_options', 'map_height') . '&quot;]'),
877890
'input_processing' => array(
878891
'preg_replace("/[^0-9]/", "", $param_value);'
879892
),

inc/Front/Waymark_Shortcode.php

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,22 @@ function handle_shortcode($shortcode_data, $content = null) {
124124
$map_height = Waymark_Config::get_setting('misc', 'map_options', 'map_height');
125125
}
126126

127+
//Width
128+
if(array_key_exists('map_width', $shortcode_data)) {
129+
$map_width = $shortcode_data['map_width'];
130+
} else {
131+
$map_width = false;
132+
}
133+
127134
//Output HTML container
128135
$out = '<!-- START Waymark Shortcode #' . $shortcode_hash . ' -->' . "\n";
129-
$out .= '<div id="waymark-shortcode-' . $shortcode_hash . '" data-shortcode_hash="' . $shortcode_hash . '" class="waymark-shortcode waymark-container">' . "\n";
130-
136+
137+
$shortcode_style = '';
138+
if($map_width) {
139+
$shortcode_style .= 'width:' . $map_width . 'px';
140+
}
141+
142+
$out .= '<div style="' . $shortcode_style . '" id="waymark-shortcode-' . $shortcode_hash . '" data-shortcode_hash="' . $shortcode_hash . '" class="waymark-shortcode waymark-container">' . "\n";
131143

132144
//Header ?
133145
$do_header = 0;
@@ -190,10 +202,13 @@ function handle_shortcode($shortcode_data, $content = null) {
190202

191203
$out .= ' </header>' . "\n";
192204
}
193-
194-
//Map HTML Container (Initially hidden)
205+
206+
//Map HTML Container (Initially hidden, made visible by JS)
195207
$out .= ' <!-- Map -->' . "\n";
196-
$out .= ' <div style="display:none;height:' . $map_height . 'px" id="waymark-map-' . $shortcode_hash . '" class="' . $map_class . '" data-shortcode_hash="' . $shortcode_hash . '"></div>' . "\n";
208+
209+
$map_style = 'display:none;';
210+
$map_style .= 'height:' . $map_height . 'px';
211+
$out .= ' <div style="' . $map_style . '" id="waymark-map-' . $shortcode_hash . '" class="' . $map_class . '" data-shortcode_hash="' . $shortcode_hash . '"></div>' . "\n";
197212

198213
//Elevation?
199214
if(array_key_exists('show_elevation', $shortcode_data)) {
@@ -236,6 +251,9 @@ function handle_shortcode($shortcode_data, $content = null) {
236251
$out .= 'var waymark_config = jQuery.extend(true, {}, waymark_user_config);' . "\n";
237252
$out .= 'waymark_config.map_div_id = "waymark-map-' . $shortcode_hash . '";' . "\n";
238253
$out .= 'waymark_config.map_height = ' . $map_height . ";\n";
254+
if($map_width) {
255+
$out .= 'waymark_config.map_width = ' . $map_width . ";\n";
256+
}
239257

240258
// ===== Shortcode options (2/2) =====
241259

inc/Waymark_Config.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static function init() {
1111
'plugin_name' => 'Waymark',
1212
'plugin_name_short' => 'Waymark',
1313
'custom_types' => array(),
14-
'plugin_version' => '0.9.28.7',
14+
'plugin_version' => '0.9.29',
1515
'nonce_string' => 'Waymark_Nonce',
1616
'site_url' => 'https://www.waymark.dev/',
1717
'directory_url' => 'https://wordpress.org/support/plugin/waymark/',
@@ -148,6 +148,7 @@ public static function init() {
148148
'line_title' => esc_html__('Red', 'waymark') . $multi_value_seperator . esc_html__('Green', 'waymark') . $multi_value_seperator . esc_html__('Blue', 'waymark'),
149149
'line_colour' => '#d84848' . $multi_value_seperator . '#3cbc47' . $multi_value_seperator . '#487bd9',
150150
'line_weight' => '3' . $multi_value_seperator . '3' . $multi_value_seperator . '3',
151+
'line_opacity' => '0.7' . $multi_value_seperator . '0.7' . $multi_value_seperator . '0.7',
151152
'line_display' => '1' . $multi_value_seperator . '1' . $multi_value_seperator . '1',
152153
'line_submission' => '1' . $multi_value_seperator . '1' . $multi_value_seperator . '1'
153154
)

languages/waymark.pot

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the GPLv2.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Waymark 0.9.28.7\n"
5+
"Project-Id-Version: Waymark 0.9.29\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/waymark\n"
7-
"POT-Creation-Date: 2023-08-31 18:48:04+00:00\n"
7+
"POT-Creation-Date: 2023-11-01 13:54:24+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -798,10 +798,9 @@ msgstr ""
798798

799799
#: inc/Admin/Waymark_Settings.php:876
800800
msgid ""
801-
"Specify the desired height of the Map (in pixels). The Map will "
802-
"automatically adjust it’s width to fill the space available to it. Pro Tip! "
803-
"This will affect all Maps, but you can change the height of an individual "
804-
"Map through the shortcode: %s"
801+
"Specify the desired height of the Map (in pixels). Pro Tip! This will "
802+
"affect all Maps, but you can change the height of an individual Map through "
803+
"the Shortcode: %s"
805804
msgstr ""
806805

807806
#: inc/Admin/Waymark_Settings.php:888
@@ -1161,11 +1160,11 @@ msgstr ""
11611160
msgid "Action Complete"
11621161
msgstr ""
11631162

1164-
#: inc/Front/Waymark_Shortcode.php:174
1163+
#: inc/Front/Waymark_Shortcode.php:186
11651164
msgid "Details"
11661165
msgstr ""
11671166

1168-
#: inc/Front/Waymark_Shortcode.php:187
1167+
#: inc/Front/Waymark_Shortcode.php:199
11691168
msgid "More Details"
11701169
msgstr ""
11711170

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Waymark",
3-
"version": "0.9.28.7",
3+
"version": "0.9.29",
44
"description": "Waymark for WordPress",
55
"author": "Joe Hawes",
66
"main": "Gruntfile.js",

readme.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Requires at least:** 4.6
55
**Tested up to:** 6.2
66
**Requires PHP:** 5.2
7-
**Stable tag:** 0.9.28.7
7+
**Stable tag:** 0.9.29
88
**License:** GPLv2 or later
99
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -111,6 +111,11 @@ A big thank you to the following projects and their contributors. Without their
111111

112112
## Changelog ##
113113

114+
### 0.9.29 ###
115+
116+
* Added `map_width` Shortcode option, which has been requested a couple of times. Thanks for bugging me! :0)
117+
* Added Opacity Setting for Line Types (Lines > Opacity), thanks to <a href="https://wordpress.org/support/users/digbymaass/">digbymaass</a> for the <a href="https://wordpress.org/support/topic/feature-request-opacity-setting-for-lines/">suggestion</a>.
118+
114119
### 0.9.28.7 ###
115120

116121
* Meta data is now preserved when the Map is trashed/restored. Thanks to <a href="https://wordpress.org/support/users/killiandev7/">killiandev7</a> for <a href="https://wordpress.org/support/topic/feature-request-recover-map-data-after-recovering-a-deleted-map/">bringing this to my attention</a>.

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: Map maker, Maps, Location, GPX, KML, GeoJSON, OpenStreetMap, Markers, Map
44
Requires at least: 4.6
55
Tested up to: 6.2
66
Requires PHP: 5.2
7-
Stable tag: 0.9.28.7
7+
Stable tag: 0.9.29
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -97,6 +97,11 @@ A big thank you to the following projects and their contributors. Without their
9797

9898
== Changelog ==
9999

100+
= 0.9.29 =
101+
102+
* Added `map_width` Shortcode option, which has been requested a couple of times. Thanks for bugging me! :0)
103+
* Added Opacity Setting for Line Types (Lines > Opacity), thanks to <a href="https://wordpress.org/support/users/digbymaass/">digbymaass</a> for the <a href="https://wordpress.org/support/topic/feature-request-opacity-setting-for-lines/">suggestion</a>.
104+
100105
= 0.9.28.7 =
101106

102107
* Meta data is now preserved when the Map is trashed/restored. Thanks to <a href="https://wordpress.org/support/users/killiandev7/">killiandev7</a> for <a href="https://wordpress.org/support/topic/feature-request-recover-map-data-after-recovering-a-deleted-map/">bringing this to my attention</a>.

0 commit comments

Comments
 (0)