Version Description
use localisation from translate.wordpress.org in preference to local plugin copy; bump version of Google Maps API to 3.24
=
Download this release
Release Info
Developer | webaware |
Plugin | Flexible Map |
Version | 1.11.0 |
Comparing to | |
See all releases |
Code changes from version 1.10.1 to 1.11.0
- changelog.md +9 -0
- flexible-map.php +3 -3
- includes/class.FlxMapAdmin.php +28 -6
- includes/class.FlxMapLocalisation.php +160 -0
- includes/class.FlxMapPlugin.php +22 -62
- js/.jshintrc +0 -16
- js/flexible-map.js +2 -2
- js/flexible-map.min.js +1 -6
- languages/wp-flexible-map-de_DE.mo +0 -0
- languages/wp-flexible-map-fr_FR.mo +0 -0
- languages/wp-flexible-map-it_IT.mo +0 -0
- languages/wp-flexible-map-ko_KR.mo +0 -0
- languages/wp-flexible-map-nb_NO.mo +0 -0
- languages/wp-flexible-map-nl_NL.mo +0 -0
- languages/wp-flexible-map-sv_SE.mo +0 -0
- languages/wp-flexible-map.pot +9 -9
- readme.txt +19 -29
- screenshot-1.jpg +0 -0
- screenshot-2.png +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.png +0 -0
changelog.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2 |
|
3 |
## Changelog
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
### 1.10.1, 2015-11-29
|
6 |
|
7 |
* fixed: NextGEN Gallery breaks localisation of maps by messing with order of `wp_print_footer_scripts` calls
|
2 |
|
3 |
## Changelog
|
4 |
|
5 |
+
### 1.11.0, 2016-06-05
|
6 |
+
|
7 |
+
* fixed: monitor changes to invisible containers, not just non-displayed containers (thanks, [zetoun17](https://profiles.wordpress.org/zetoun17/)!)
|
8 |
+
* fixed: "FlexibleMap is not defined" error when `isajax="1"` used without calling `flexmap_load_scripts()` (per the [FAQ](https://en-au.wordpress.org/plugins/wp-flexible-map/faq/))
|
9 |
+
* added: ask [Autoptimize](https://wordpress.org/plugins/autoptimize/) to leave our inline script alone, to reduce the number of cached script files
|
10 |
+
* changed: use localisation from [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/wp-flexible-map) in preference to local plugin copy
|
11 |
+
* changed: translations updated from translate.wordpress.org
|
12 |
+
* changed: bump version of Google Maps API to 3.24
|
13 |
+
|
14 |
### 1.10.1, 2015-11-29
|
15 |
|
16 |
* fixed: NextGEN Gallery breaks localisation of maps by messing with order of `wp_print_footer_scripts` calls
|
flexible-map.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Flexible Map
|
4 |
Plugin URI: http://flexible-map.webaware.net.au/
|
5 |
Description: Embed Google Maps shortcodes in pages and posts, either by centre coordinates or street address, or by URL to a Google Earth KML file. <a href="http://flexible-map.webaware.net.au/manual/getting-started/">Get started</a> with a simple shortcode. See the <a href="http://flexible-map.webaware.net.au/manual/attribute-reference/">complete attribute reference</a> for more details.
|
6 |
-
Version: 1.
|
7 |
Author: WebAware
|
8 |
Author URI: http://webaware.com.au/
|
9 |
Text Domain: wp-flexible-map
|
@@ -11,7 +11,7 @@ Domain Path: /languages/
|
|
11 |
*/
|
12 |
|
13 |
/*
|
14 |
-
copyright (c) 2011-
|
15 |
|
16 |
This program is free software; you can redistribute it and/or
|
17 |
modify it under the terms of the GNU General Public License
|
@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
|
|
36 |
define('FLXMAP_PLUGIN_FILE', __FILE__);
|
37 |
define('FLXMAP_PLUGIN_ROOT', dirname(__FILE__) . '/');
|
38 |
define('FLXMAP_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__));
|
39 |
-
define('FLXMAP_PLUGIN_VERSION', '1.
|
40 |
|
41 |
// shortcode tags
|
42 |
define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
|
3 |
Plugin Name: Flexible Map
|
4 |
Plugin URI: http://flexible-map.webaware.net.au/
|
5 |
Description: Embed Google Maps shortcodes in pages and posts, either by centre coordinates or street address, or by URL to a Google Earth KML file. <a href="http://flexible-map.webaware.net.au/manual/getting-started/">Get started</a> with a simple shortcode. See the <a href="http://flexible-map.webaware.net.au/manual/attribute-reference/">complete attribute reference</a> for more details.
|
6 |
+
Version: 1.11.0
|
7 |
Author: WebAware
|
8 |
Author URI: http://webaware.com.au/
|
9 |
Text Domain: wp-flexible-map
|
11 |
*/
|
12 |
|
13 |
/*
|
14 |
+
copyright (c) 2011-2016 WebAware Pty Ltd (email : support@webaware.com.au)
|
15 |
|
16 |
This program is free software; you can redistribute it and/or
|
17 |
modify it under the terms of the GNU General Public License
|
36 |
define('FLXMAP_PLUGIN_FILE', __FILE__);
|
37 |
define('FLXMAP_PLUGIN_ROOT', dirname(__FILE__) . '/');
|
38 |
define('FLXMAP_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__));
|
39 |
+
define('FLXMAP_PLUGIN_VERSION', '1.11.0');
|
40 |
|
41 |
// shortcode tags
|
42 |
define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
|
includes/class.FlxMapAdmin.php
CHANGED
@@ -9,16 +9,21 @@ if (!defined('ABSPATH')) {
|
|
9 |
*/
|
10 |
class FlxMapAdmin {
|
11 |
|
12 |
-
protected $plugin;
|
13 |
-
|
14 |
/**
|
15 |
* @param FlxMapPlugin $plugin
|
16 |
*/
|
17 |
-
public function __construct(
|
18 |
-
$this
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -37,4 +42,21 @@ class FlxMapAdmin {
|
|
37 |
return $links;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
9 |
*/
|
10 |
class FlxMapAdmin {
|
11 |
|
|
|
|
|
12 |
/**
|
13 |
* @param FlxMapPlugin $plugin
|
14 |
*/
|
15 |
+
public function __construct() {
|
16 |
+
add_action('admin_init', array($this, 'adminInit'));
|
17 |
+
add_filter('plugins_update_check_locales', array($this, 'updateCheckLocales'));
|
18 |
+
}
|
19 |
|
20 |
+
/**
|
21 |
+
* after admin init action
|
22 |
+
*/
|
23 |
+
public function adminInit() {
|
24 |
+
if (current_user_can('manage_options')) {
|
25 |
+
add_filter('plugin_row_meta', array($this, 'addPluginDetailsLinks'), 10, 2);
|
26 |
+
}
|
27 |
}
|
28 |
|
29 |
/**
|
42 |
return $links;
|
43 |
}
|
44 |
|
45 |
+
/**
|
46 |
+
* inject wanted translation locales for plugins, so that we can get up-to-date translations from translate.wordpress.org
|
47 |
+
* @param array $locales
|
48 |
+
* @return array
|
49 |
+
*/
|
50 |
+
public function updateCheckLocales($locales) {
|
51 |
+
if (!class_exists('FlxMapLocalisation', false)) {
|
52 |
+
require FLXMAP_PLUGIN_ROOT . 'includes/class.FlxMapLocalisation.php';
|
53 |
+
}
|
54 |
+
$localisation = new FlxMapLocalisation();
|
55 |
+
$langPacks = $localisation->getGlobalMapLocales();
|
56 |
+
|
57 |
+
$combined = array_unique(array_merge($locales, $langPacks));
|
58 |
+
|
59 |
+
return $combined;
|
60 |
+
}
|
61 |
+
|
62 |
}
|
includes/class.FlxMapLocalisation.php
ADDED
@@ -0,0 +1,160 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* class for managing the plugin
|
9 |
+
*/
|
10 |
+
class FlxMapLocalisation {
|
11 |
+
|
12 |
+
const TEXT_DOMAIN = 'wp-flexible-map';
|
13 |
+
const TRANSIENT_LANGPACKS = 'flexible_map_langpacks';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* get localisations for map scripts, ignoring admin localisations
|
17 |
+
* @param array $locales
|
18 |
+
* @return array
|
19 |
+
*/
|
20 |
+
public function getLocalisations($locales) {
|
21 |
+
$i18n = array();
|
22 |
+
|
23 |
+
$langPacks = array(); // record list of locales for language pack update fetches
|
24 |
+
|
25 |
+
foreach (array_keys($locales) as $locale) {
|
26 |
+
$moLocale = self::getMoLocale($locale);
|
27 |
+
$mofile = self::getMofilePath($moLocale);
|
28 |
+
|
29 |
+
$langPacks[] = $moLocale;
|
30 |
+
|
31 |
+
// check for specific locale first, e.g. 'zh-CN', then for generic locale, e.g. 'zh'
|
32 |
+
// (backwards compatibility)
|
33 |
+
if (!$mofile && strlen($locale) > 2) {
|
34 |
+
$locale = substr($locale, 0, 2);
|
35 |
+
$moLocale = self::getMoLocale($locale);
|
36 |
+
$mofile = self::getMofilePath($moLocale);
|
37 |
+
}
|
38 |
+
|
39 |
+
if ($mofile) {
|
40 |
+
$mo = new MO();
|
41 |
+
if ($mo->import_from_file($mofile)) {
|
42 |
+
$strings = self::getMoStrings($mofile);
|
43 |
+
if (!empty($strings)) {
|
44 |
+
$i18n[$locale] = $strings;
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
if (!empty($langPacks)) {
|
51 |
+
$this->updateGlobalMapLocales($langPacks);
|
52 |
+
}
|
53 |
+
|
54 |
+
return $i18n;
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* translate locale code to .mo file code, for backwards compatibility with earlier versions of plugin
|
59 |
+
* @param string $locale
|
60 |
+
* @return string
|
61 |
+
*/
|
62 |
+
protected static function getMoLocale($locale) {
|
63 |
+
// map old two-character language-only locales that now need to target language_country translations
|
64 |
+
static $upgradeMap = array(
|
65 |
+
'bg' => 'bg_BG', 'cs' => 'cs_CZ', 'da' => 'da_DK', 'de' => 'de_DE',
|
66 |
+
'es' => 'es_ES', 'fa' => 'fa_IR', 'fr' => 'fr_FR', 'gl' => 'gl_ES',
|
67 |
+
'he' => 'he_IL', 'hi' => 'hi_IN', 'hu' => 'hu_HU', 'id' => 'id_ID',
|
68 |
+
'is' => 'is_IS', 'it' => 'it_IT', 'ko' => 'ko_KR', 'lt' => 'lt_LT',
|
69 |
+
'mk' => 'mk_MK', 'ms' => 'ms_MY', 'mt' => 'mt_MT', 'nb' => 'nb_NO',
|
70 |
+
'nl' => 'nl_NL', 'pl' => 'pl_PL', 'pt' => 'pt_PT', 'ro' => 'ro_RO',
|
71 |
+
'ru' => 'ru_RU', 'sk' => 'sk_SK', 'sl' => 'sl_SL', 'sr' => 'sr_RS',
|
72 |
+
'sv' => 'sv_SE', 'ta' => 'ta_IN', 'tr' => 'tr_TR', 'zh' => 'zh_CN',
|
73 |
+
);
|
74 |
+
|
75 |
+
if (isset($upgradeMap[$locale])) {
|
76 |
+
// upgrade old two-character language-only locales
|
77 |
+
return $upgradeMap[$locale];
|
78 |
+
}
|
79 |
+
|
80 |
+
// revert locale name to WordPress locale name as used in .mo files
|
81 |
+
return strtr($locale, '-', '_');
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* get full path to .mo file
|
86 |
+
* @param string $moLocale
|
87 |
+
* @return string|bool returns false if it doesn't exist
|
88 |
+
*/
|
89 |
+
protected static function getMofilePath($moLocale) {
|
90 |
+
// try translation packs downloaded from translate.wordpress.org first
|
91 |
+
$path = sprintf('%s/plugins/%s-%s.mo', WP_LANG_DIR, self::TEXT_DOMAIN, $moLocale);
|
92 |
+
if (is_readable($path)) {
|
93 |
+
return $path;
|
94 |
+
}
|
95 |
+
|
96 |
+
// try local packs delivered with the plugin
|
97 |
+
$path = sprintf('%slanguages/%s-%s.mo', FLXMAP_PLUGIN_ROOT, self::TEXT_DOMAIN, $moLocale);
|
98 |
+
if (is_readable($path)) {
|
99 |
+
return $path;
|
100 |
+
}
|
101 |
+
|
102 |
+
return false;
|
103 |
+
}
|
104 |
+
|
105 |
+
/**
|
106 |
+
* get strings from .mo file
|
107 |
+
* @param string $mofile
|
108 |
+
* @return array
|
109 |
+
*/
|
110 |
+
protected static function getMoStrings($mofile) {
|
111 |
+
$strings = array();
|
112 |
+
|
113 |
+
$mo = new MO();
|
114 |
+
if ($mo->import_from_file($mofile)) {
|
115 |
+
// pull all translation strings into a simplified format for our script
|
116 |
+
// TODO: handle plurals (not yet needed, don't have any)
|
117 |
+
foreach ($mo->entries as $original => $translation) {
|
118 |
+
// skip admin-side strings, identified by context
|
119 |
+
if ($translation->context === 'plugin details links') {
|
120 |
+
continue;
|
121 |
+
}
|
122 |
+
|
123 |
+
$strings[$original] = $translation->translations[0];
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
return $strings;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* get locales used by maps across site (or multisite network)
|
132 |
+
* for global language updates from translate.wordpress.org
|
133 |
+
* @return array
|
134 |
+
*/
|
135 |
+
public function getGlobalMapLocales() {
|
136 |
+
$langPacks = get_site_transient(self::TRANSIENT_LANGPACKS);
|
137 |
+
|
138 |
+
if (!is_array($langPacks)) {
|
139 |
+
$langPacks = array();
|
140 |
+
}
|
141 |
+
|
142 |
+
return $langPacks;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* add locales to history of locales used by maps across site (or multisite network)
|
147 |
+
* for global language updates from translate.wordpress.org
|
148 |
+
* @param array $locales
|
149 |
+
*/
|
150 |
+
protected function updateGlobalMapLocales($locales) {
|
151 |
+
$langPacks = $this->getGlobalMapLocales();
|
152 |
+
$diff = array_diff($locales, $langPacks);
|
153 |
+
|
154 |
+
if (!empty($diff)) {
|
155 |
+
$langPacks = array_merge($langPacks, $diff);
|
156 |
+
set_site_transient(self::TRANSIENT_LANGPACKS, $langPacks, WEEK_IN_SECONDS);
|
157 |
+
}
|
158 |
+
}
|
159 |
+
|
160 |
+
}
|
includes/class.FlxMapPlugin.php
CHANGED
@@ -41,7 +41,7 @@ class FlxMapPlugin {
|
|
41 |
if (is_admin()) {
|
42 |
// kick off the admin handling
|
43 |
require FLXMAP_PLUGIN_ROOT . 'includes/class.FlxMapAdmin.php';
|
44 |
-
new FlxMapAdmin(
|
45 |
}
|
46 |
else {
|
47 |
// non-admin actions and filters for this plugin
|
@@ -84,7 +84,7 @@ class FlxMapPlugin {
|
|
84 |
*/
|
85 |
public function enqueueScripts() {
|
86 |
// allow others to override the Google Maps API URL
|
87 |
-
$args = apply_filters('flexmap_google_maps_api_args', array('v' => '3.
|
88 |
$apiURL = apply_filters('flexmap_google_maps_api_url', add_query_arg($args, 'https://maps.google.com/maps/api/js'));
|
89 |
if (!empty($apiURL)) {
|
90 |
wp_register_script('google-maps', $apiURL, false, null, true);
|
@@ -111,70 +111,25 @@ class FlxMapPlugin {
|
|
111 |
* load any enqueued locales and map types as localisations on the main script
|
112 |
*/
|
113 |
public function justInTimeLocalisation() {
|
|
|
|
|
114 |
if (!empty($this->locales)) {
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
// map old two-character language-only locales that now need to target language_country translations
|
119 |
-
$upgradeMap = array(
|
120 |
-
'bg' => 'bg_BG', 'cs' => 'cs_CZ', 'da' => 'da_DK', 'de' => 'de_DE',
|
121 |
-
'es' => 'es_ES', 'fa' => 'fa_IR', 'fr' => 'fr_FR', 'gl' => 'gl_ES',
|
122 |
-
'he' => 'he_IL', 'hi' => 'hi_IN', 'hu' => 'hu_HU', 'id' => 'id_ID',
|
123 |
-
'is' => 'is_IS', 'it' => 'it_IT', 'ko' => 'ko_KR', 'lt' => 'lt_LT',
|
124 |
-
'mk' => 'mk_MK', 'ms' => 'ms_MY', 'mt' => 'mt_MT', 'nb' => 'nb_NO',
|
125 |
-
'nl' => 'nl_NL', 'pl' => 'pl_PL', 'pt' => 'pt_PT', 'ro' => 'ro_RO',
|
126 |
-
'ru' => 'ru_RU', 'sk' => 'sk_SK', 'sl' => 'sl_SL', 'sr' => 'sr_RS',
|
127 |
-
'sv' => 'sv_SE', 'ta' => 'ta_IN', 'tr' => 'tr_TR', 'zh' => 'zh_CN',
|
128 |
-
);
|
129 |
-
|
130 |
-
foreach (array_keys($this->locales) as $locale) {
|
131 |
-
// check for specific locale first, e.g. 'zh-CN', then for generic locale, e.g. 'zh'
|
132 |
-
foreach (array($locale, substr($locale, 0, 2)) as $locale) {
|
133 |
-
if (isset($upgradeMap[$locale])) {
|
134 |
-
// upgrade old two-character language-only locales
|
135 |
-
$moLocale = $upgradeMap[$locale];
|
136 |
-
}
|
137 |
-
else {
|
138 |
-
// revert locale name to WordPress locale name as used in .mo files
|
139 |
-
$moLocale = strtr($locale, '-', '_');
|
140 |
-
}
|
141 |
-
|
142 |
-
// compose full path to .mo file
|
143 |
-
$mofile = sprintf('%slanguages/%s-%s.mo', FLXMAP_PLUGIN_ROOT, $domain, $moLocale);
|
144 |
-
|
145 |
-
if (is_readable($mofile)) {
|
146 |
-
$mo = new MO();
|
147 |
-
if ($mo->import_from_file($mofile)) {
|
148 |
-
// pull all translation strings into a simplified format for our script
|
149 |
-
// TODO: handle plurals (not yet needed, don't have any)
|
150 |
-
$strings = array();
|
151 |
-
foreach ($mo->entries as $original => $translation) {
|
152 |
-
// skip admin-side strings, identified by context
|
153 |
-
if ($translation->context == 'plugin details links') {
|
154 |
-
continue;
|
155 |
-
}
|
156 |
-
|
157 |
-
$strings[$original] = $translation->translations[0];
|
158 |
-
}
|
159 |
-
$i18n[$locale] = $strings;
|
160 |
-
break;
|
161 |
-
}
|
162 |
-
}
|
163 |
-
}
|
164 |
}
|
165 |
-
|
166 |
-
|
167 |
-
$localise = array();
|
168 |
if (!empty($i18n)) {
|
169 |
$localise['i18n'] = $i18n;
|
170 |
}
|
171 |
-
|
172 |
-
$localise['mapTypes'] = $this->mapTypes;
|
173 |
-
}
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
178 |
}
|
179 |
}
|
180 |
|
@@ -476,9 +431,14 @@ HTML;
|
|
476 |
$script = apply_filters('flexmap_shortcode_script', $script, $attrs);
|
477 |
|
478 |
if ((defined('DOING_AJAX') && DOING_AJAX) || (isset($attrs['isajax']) && self::isYes($attrs['isajax']))) {
|
|
|
|
|
|
|
|
|
|
|
479 |
// wrap it up for AJAX load, no event trigger
|
480 |
$html .= <<<HTML
|
481 |
-
<script>
|
482 |
/* <![CDATA[ */
|
483 |
var $varID = (function() {
|
484 |
$script return f;
|
@@ -491,7 +451,7 @@ HTML;
|
|
491 |
else {
|
492 |
// wrap it up for standard page load, with "content ready" trigger
|
493 |
$html .= <<<HTML
|
494 |
-
<script>
|
495 |
/* <![CDATA[ */
|
496 |
(function(w, fn) {
|
497 |
if (w.addEventListener) w.addEventListener("DOMContentLoaded", fn, false);
|
41 |
if (is_admin()) {
|
42 |
// kick off the admin handling
|
43 |
require FLXMAP_PLUGIN_ROOT . 'includes/class.FlxMapAdmin.php';
|
44 |
+
new FlxMapAdmin();
|
45 |
}
|
46 |
else {
|
47 |
// non-admin actions and filters for this plugin
|
84 |
*/
|
85 |
public function enqueueScripts() {
|
86 |
// allow others to override the Google Maps API URL
|
87 |
+
$args = apply_filters('flexmap_google_maps_api_args', array('v' => '3.24'));
|
88 |
$apiURL = apply_filters('flexmap_google_maps_api_url', add_query_arg($args, 'https://maps.google.com/maps/api/js'));
|
89 |
if (!empty($apiURL)) {
|
90 |
wp_register_script('google-maps', $apiURL, false, null, true);
|
111 |
* load any enqueued locales and map types as localisations on the main script
|
112 |
*/
|
113 |
public function justInTimeLocalisation() {
|
114 |
+
$localise = array();
|
115 |
+
|
116 |
if (!empty($this->locales)) {
|
117 |
+
if (!class_exists('FlxMapLocalisation', false)) {
|
118 |
+
require FLXMAP_PLUGIN_ROOT . 'includes/class.FlxMapLocalisation.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
+
$localisation = new FlxMapLocalisation();
|
121 |
+
$i18n = $localisation->getLocalisations($this->locales);
|
|
|
122 |
if (!empty($i18n)) {
|
123 |
$localise['i18n'] = $i18n;
|
124 |
}
|
125 |
+
}
|
|
|
|
|
126 |
|
127 |
+
if (!empty($this->mapTypes)) {
|
128 |
+
$localise['mapTypes'] = $this->mapTypes;
|
129 |
+
}
|
130 |
+
|
131 |
+
if (!empty($localise)) {
|
132 |
+
wp_localize_script('flxmap', 'flxmap', $localise);
|
133 |
}
|
134 |
}
|
135 |
|
431 |
$script = apply_filters('flexmap_shortcode_script', $script, $attrs);
|
432 |
|
433 |
if ((defined('DOING_AJAX') && DOING_AJAX) || (isset($attrs['isajax']) && self::isYes($attrs['isajax']))) {
|
434 |
+
// ensure that the required scripts are on the page already
|
435 |
+
if (!wp_script_is('flxmap', 'done')) {
|
436 |
+
wp_print_scripts('flxmap');
|
437 |
+
}
|
438 |
+
|
439 |
// wrap it up for AJAX load, no event trigger
|
440 |
$html .= <<<HTML
|
441 |
+
<script data-noptimize="1">
|
442 |
/* <![CDATA[ */
|
443 |
var $varID = (function() {
|
444 |
$script return f;
|
451 |
else {
|
452 |
// wrap it up for standard page load, with "content ready" trigger
|
453 |
$html .= <<<HTML
|
454 |
+
<script data-noptimize="1">
|
455 |
/* <![CDATA[ */
|
456 |
(function(w, fn) {
|
457 |
if (w.addEventListener) w.addEventListener("DOMContentLoaded", fn, false);
|
js/.jshintrc
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"es3": true,
|
3 |
-
"immed": true,
|
4 |
-
"latedef": "nofunc",
|
5 |
-
"nonew": true,
|
6 |
-
"undef": true,
|
7 |
-
"unused": true,
|
8 |
-
|
9 |
-
// globals
|
10 |
-
"browser": true,
|
11 |
-
"globals": {
|
12 |
-
"flxmap": false,
|
13 |
-
"google": false,
|
14 |
-
"module": false
|
15 |
-
}
|
16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/flexible-map.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
/*!
|
2 |
JavaScript for the WordPress plugin wp-flexible-map
|
3 |
-
copyright (c) 2011-
|
4 |
http://flexible-map.webaware.net.au/
|
5 |
*/
|
6 |
|
@@ -263,7 +263,7 @@ FlexibleMap.prototype = (function() {
|
|
263 |
|
264 |
function isHidden(element) {
|
265 |
var style = window.getComputedStyle(element);
|
266 |
-
return style.display === "none";
|
267 |
}
|
268 |
|
269 |
// only need to watch and act if the parent container is hidden from display
|
1 |
/*!
|
2 |
JavaScript for the WordPress plugin wp-flexible-map
|
3 |
+
copyright (c) 2011-2016 WebAware Pty Ltd, released under LGPL v2.1
|
4 |
http://flexible-map.webaware.net.au/
|
5 |
*/
|
6 |
|
263 |
|
264 |
function isHidden(element) {
|
265 |
var style = window.getComputedStyle(element);
|
266 |
+
return style.display === "none" || style.visibility === "hidden";
|
267 |
}
|
268 |
|
269 |
// only need to watch and act if the parent container is hidden from display
|
js/flexible-map.min.js
CHANGED
@@ -1,6 +1 @@
|
|
1 |
-
/*!
|
2 |
-
JavaScript for the WordPress plugin wp-flexible-map
|
3 |
-
copyright (c) 2011-2015 WebAware Pty Ltd, released under LGPL v2.1
|
4 |
-
http://flexible-map.webaware.net.au/
|
5 |
-
*/
|
6 |
-
function FlexibleMap(){"use strict";var a,b,c,d,e,f,g=!1;this.getMap=function(){return a},this.getCenter=function(){return b},this.setCenter=function(c){b=c,a.setCenter(b)},this.setMarkerLocation=function(a){c=a},this.getMarkerLocation=function(){return c},this.setMarkerPoint=function(a){d=a},this.getMarkerPoint=function(){return d},this.setMarkerInfowin=function(a){e=a},this.getMarkerInfowin=function(){return e},this.getKmlLayer=function(){return f},this.redrawOnce=function(){g||(g=!0,this.redraw())},this.showMap=function(c,d){b=new google.maps.LatLng(d[0],d[1]);var e,f={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,"default":google.maps.ZoomControlStyle.DEFAULT},g=f.small;return this.zoomControlStyle in f&&(g=f[this.zoomControlStyle]),e={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:this.zoomControl,zoomControlOptions:{style:g},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:b,zoom:this.zoom},this.mapTypeIds&&(e.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}),a=new google.maps.Map(document.getElementById(c),e),this.mapTypeId in this.mapTypes&&a.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map),a},this.loadKmlMap=function(c){return f=new google.maps.KmlLayer({map:a,url:c}),google.maps.event.addListenerOnce(f,"defaultviewport_changed",function(){b=f.getDefaultViewport().getCenter()}),f},!this.localised&&"flxmap"in window&&this.localise(),this.mapTypeId=google.maps.MapTypeId.ROADMAP,this.mapTypeControl=!0,this.scaleControl=!1,this.panControl=!1,this.zoomControl=!0,this.zoomControlStyle="small",this.streetViewControl=!1,this.scrollwheel=!1,this.draggable=!0,this.dblclickZoom=!0,this.zoom=16,this.markerTitle="",this.markerDescription="",this.markerHTML="",this.markerLink="",this.markerLinkTarget="",this.markerLinkText=!1,this.markerIcon="",this.markerShowInfo=!0,this.markerDirections=!1,this.markerDirectionsShow=!1,this.markerDirectionsDefault="",this.markerAddress="",this.targetFix=!0,this.dirService=!1,this.dirRenderer=!1,this.dirDraggable=!1,this.dirSuppressMarkers=!1,this.dirShowSteps=!0,this.dirShowSearch=!0,this.dirTravelMode="driving",this.dirUnitSystem=void 0,this.region="",this.locale="en",this.localeActive=!1,this.kmlcache="none"}FlexibleMap.prototype=function(){"use strict";function a(a,b){var c,d,e,f=/^(\d+)\s*(minute|hour|day)s?$/.exec(b);if(f){switch(c=(new Date).getTime(),e=+f[1],f[2]){case"minute":5>e&&(e=5),d=c/(6e4*e);break;case"hour":d=c/(36e5*e);break;case"day":d=c/(864e5*e);break;default:d=!1}d&&(d=Math.floor(d),a+=(a.indexOf("?")>-1?"&":"?")+"nocache="+d)}return a}var b,c,d;document.addEventListener?(b=function(a,b,c){a.addEventListener(b,c,!1)},c=function(a){a.stopPropagation(),a.preventDefault()}):document.attachEvent&&(b=function(a,b,c){a.attachEvent("on"+b,function(){c.call(a,window.event)})},c=function(a){a.cancelBubble=!0,a.returnValue=0}),d="undefined"!=typeof MutationObserver?function(a,b){function c(a){var b=window.getComputedStyle(a);return"none"===b.display}var d,e=document.getElementById(b),f=e.parentNode;c(f)&&(d=new MutationObserver(function(b,d){c(f)||(a.redrawOnce(),d.disconnect())}),d.observe(f,{attributes:!0,attributeFilter:["style"]}))}:function(){};var e=function(){function a(a){var b=a.charCodeAt(0),c=b.toString(16);return 256>b?"\\x"+("00"+c).slice(-2):"\\u"+("0000"+c).slice(-4)}return function(b){return b.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,a)}}();return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:!1,localise:function(){var a,b;if("i18n"in flxmap&&(FlexibleMap.prototype.i18n=flxmap.i18n),"mapTypes"in flxmap){b=flxmap.mapTypes;for(a in b)b[a]._styled_map=new google.maps.StyledMapType(b[a].styles,b[a].options);FlexibleMap.prototype.mapTypes=b}FlexibleMap.prototype.localised=!0},setlocale:function(a){return this.locale=a,a in this.i18n?this.localeActive=a:(a=a.substr(0,2),a in this.i18n?this.localeActive=a:this.localeActive=!1),this.localeActive},gettext:function(a){var b=this.localeActive;return b&&a in this.i18n[b]?this.i18n[b][a]:a},showKML:function(f,g,h){"undefined"!=typeof h&&(this.zoom=h);var i=this,j=document.getElementById(f),k=j.getAttribute("data-flxmap"),l=this.showMap(f,[0,0]),m=this.loadKmlMap(a(g,this.kmlcache));d(this,f),"undefined"!=typeof h&&google.maps.event.addListenerOnce(l,"zoom_changed",function(){l.setZoom(h),i.zoom=h}),(this.markerDirections||this.markerDirectionsShow)&&this.startDirService(l),google.maps.event.addListener(m,"click",function(a){var b=a.featureData;if(!b._flxmapOnce){if(b._flxmapOnce=!0,i.targetFix&&b.description){var c=/ target="_blank"/gi;b.description=b.description.replace(c,""),b.infoWindowHtml=b.infoWindowHtml.replace(c,"")}if(i.markerDirections){var d=a.latLng,f=d.lat()+","+d.lng()+",'"+e(b.name)+"',true",g='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+k+".showDirections("+f+'); return false;">'+i.gettext("Directions")+"</a>";b.infoWindowHtml=b.infoWindowHtml.replace(/<\/div><\/div>$/i,g+"</div></div>")}}}),window.opera&&this.markerDirections&&b(j,"click",function(a){a.target.getAttribute("data-flxmap-fix-opera")&&c(a)})},showMarker:function(a,e,f){var g=this.showMap(a,e),h=new google.maps.LatLng(f[0],f[1]),i=new google.maps.Marker({map:g,position:h,icon:this.markerIcon});if(this.setMarkerPoint(i),this.setMarkerLocation(h),d(this,a),this.markerTitle||(this.markerTitle=this.markerAddress),this.markerTitle||this.markerHTML||this.markerDescription||this.markerLink||this.markerDirections){var j,k,l,m,n,o,p=this,q=document.createElement("DIV");if(q.className="flxmap-infowin",n=document.createElement("DIV"),n.className="flxmap-marker-title",this.markerTitle&&(n.appendChild(document.createTextNode(this.markerTitle)),i.setTitle(this.markerTitle)),q.appendChild(n),this.markerHTML&&(n=document.createElement("DIV"),n.innerHTML=this.markerHTML,q.appendChild(n)),this.markerDescription||this.markerLink){if(n=document.createElement("DIV"),n.className="flxmap-marker-link",this.markerDescription){for(l=this.markerDescription.split("\n"),j=0,k=l.length;k>j;j++)j>0&&n.appendChild(document.createElement("BR")),n.appendChild(document.createTextNode(l[j]));this.markerLink&&n.appendChild(document.createElement("BR"))}this.markerLink&&(o=document.createElement("A"),o.href=this.markerLink,this.markerLinkTarget&&(o.target=this.markerLinkTarget),o.appendChild(document.createTextNode(this.markerLinkText||this.gettext("Click for details"))),n.appendChild(o)),q.appendChild(n)}this.markerDirections&&(n=document.createElement("DIV"),n.className="flxmap-directions-link",o=document.createElement("A"),o.href="#",o.dataLatitude=f[0],o.dataLongitude=f[1],b(o,"click",function(a){c(a),p.showDirections(this.dataLatitude,this.dataLongitude,!0)}),o.appendChild(document.createTextNode(this.gettext("Directions"))),n.appendChild(o),q.appendChild(n)),m=new google.maps.InfoWindow({content:q}),this.setMarkerInfowin(m),this.markerShowInfo&&google.maps.event.addListenerOnce(g,"tilesloaded",function(){m.open(g,i)}),google.maps.event.addListener(i,"click",function(){m.open(g,i)});var r=function(){p.updateGoogleLink()};google.maps.event.addListener(g,"idle",r),google.maps.event.addListener(g,"center_changed",r),google.maps.event.addListenerOnce(g,"tilesloaded",r)}(this.markerDirections||this.markerDirectionsShow)&&(this.startDirService(g),this.markerDirectionsShow&&this.showDirections(f[0],f[1],!1))},showAddress:function(a,b){var c=this,d=new google.maps.Geocoder;this.markerAddress=b,""===this.markerTitle&&(this.markerTitle=b),d.geocode({address:b,region:this.region},function(b,d){if(d==google.maps.GeocoderStatus.OK){var e=b[0].geometry.location,f=[e.lat(),e.lng()];c.showMarker(a,f,f)}else window.alert("Map address returns error: "+d)})},updateGoogleLink:function(){if("querySelectorAll"in document)try{for(var a=this.getMap().getDiv(),b=this.getMarkerLocation(),c=a.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),d=0,e=c.length,f=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+b.lat()+","+b.lng());e>d;d++)c[d].href+="&mrt=loc&iwloc=A&q="+f}catch(g){}},redraw:function(){var a=this.getMap(),b=this.getKmlLayer();if(google.maps.event.trigger(a,"resize"),b)a.fitBounds(b.getDefaultViewport());else{a.setCenter(this.getCenter()),a.setZoom(this.zoom);var c=this.getMarkerInfowin();c&&c.open(a,this.getMarkerPoint())}},startDirService:function(a){this.dirService||(this.dirService=new google.maps.DirectionsService),this.dirRenderer||(this.dirRenderer=new google.maps.DirectionsRenderer({map:a,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null}))},showDirections:function(a,d,e){function f(){for(var a,d,f,h=document.getElementById(i.markerDirectionsDiv),j=document.createElement("form");d=h.lastChild;)h.removeChild(d);d=document.createElement("p"),d.appendChild(document.createTextNode(i.gettext("From")+": ")),f=document.createElement("input"),f.type="text",f.name="from",f.value=i.markerDirectionsDefault,d.appendChild(f),a=document.createElement("input"),a.type="submit",a.value=i.gettext("Get directions"),d.appendChild(a),j.appendChild(d),h.appendChild(j),"undefined"==typeof j.elements.from&&(j.elements.from=f),e&&f.focus(),b(j,"submit",function(a){c(a);var b=this.elements.from.value;/\S/.test(b)&&g(b)})}function g(b){var c=""===i.markerAddress?new google.maps.LatLng(a,d):i.markerAddress,e={origin:b,destination:c};switch(i.region&&(e.region=i.region),i.dirTravelMode){case"bicycling":e.travelMode=google.maps.TravelMode.BICYCLING;break;case"driving":e.travelMode=google.maps.TravelMode.DRIVING;break;case"transit":e.travelMode=google.maps.TravelMode.TRANSIT;break;case"walking":e.travelMode=google.maps.TravelMode.WALKING}switch(i.dirUnitSystem){case"imperial":e.unitSystem=google.maps.UnitSystem.IMPERIAL;break;case"metric":e.unitSystem=google.maps.UnitSystem.METRIC}i.dirService.route(e,h)}function h(a,b){var c=google.maps.DirectionsStatus;switch(b){case c.OK:i.dirRenderer.setDirections(a);break;case c.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case c.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case c.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case c.INVALID_REQUEST:window.alert("Invalid directions request.");break;case c.NOT_FOUND:window.alert("Origin or destination was not found.");break;default:window.alert("A directions request could not be processed due to a server error. The request may succeed if you try again.")}}var i=this;this.markerDirectionsDiv&&this.dirShowSearch&&f(),this.markerDirectionsDefault&&g(this.markerDirectionsDefault)}}}();
|
1 |
+
function FlexibleMap(){"use strict";var a,b,c,d,e,f,g=!1;this.getMap=function(){return a},this.getCenter=function(){return b},this.setCenter=function(c){b=c,a.setCenter(b)},this.setMarkerLocation=function(a){c=a},this.getMarkerLocation=function(){return c},this.setMarkerPoint=function(a){d=a},this.getMarkerPoint=function(){return d},this.setMarkerInfowin=function(a){e=a},this.getMarkerInfowin=function(){return e},this.getKmlLayer=function(){return f},this.redrawOnce=function(){g||(g=!0,this.redraw())},this.showMap=function(c,d){b=new google.maps.LatLng(d[0],d[1]);var e,f={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,"default":google.maps.ZoomControlStyle.DEFAULT},g=f.small;return this.zoomControlStyle in f&&(g=f[this.zoomControlStyle]),e={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:this.zoomControl,zoomControlOptions:{style:g},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:b,zoom:this.zoom},this.mapTypeIds&&(e.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}),a=new google.maps.Map(document.getElementById(c),e),this.mapTypeId in this.mapTypes&&a.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map),a},this.loadKmlMap=function(c){return f=new google.maps.KmlLayer({map:a,url:c}),google.maps.event.addListenerOnce(f,"defaultviewport_changed",function(){b=f.getDefaultViewport().getCenter()}),f},!this.localised&&"flxmap"in window&&this.localise(),this.mapTypeId=google.maps.MapTypeId.ROADMAP,this.mapTypeControl=!0,this.scaleControl=!1,this.panControl=!1,this.zoomControl=!0,this.zoomControlStyle="small",this.streetViewControl=!1,this.scrollwheel=!1,this.draggable=!0,this.dblclickZoom=!0,this.zoom=16,this.markerTitle="",this.markerDescription="",this.markerHTML="",this.markerLink="",this.markerLinkTarget="",this.markerLinkText=!1,this.markerIcon="",this.markerShowInfo=!0,this.markerDirections=!1,this.markerDirectionsShow=!1,this.markerDirectionsDefault="",this.markerAddress="",this.targetFix=!0,this.dirService=!1,this.dirRenderer=!1,this.dirDraggable=!1,this.dirSuppressMarkers=!1,this.dirShowSteps=!0,this.dirShowSearch=!0,this.dirTravelMode="driving",this.dirUnitSystem=void 0,this.region="",this.locale="en",this.localeActive=!1,this.kmlcache="none"}FlexibleMap.prototype=function(){"use strict";function a(a,b){var c,d,e,f=/^(\d+)\s*(minute|hour|day)s?$/.exec(b);if(f){switch(c=(new Date).getTime(),e=+f[1],f[2]){case"minute":5>e&&(e=5),d=c/(6e4*e);break;case"hour":d=c/(36e5*e);break;case"day":d=c/(864e5*e);break;default:d=!1}d&&(d=Math.floor(d),a+=(a.indexOf("?")>-1?"&":"?")+"nocache="+d)}return a}var b,c,d;document.addEventListener?(b=function(a,b,c){a.addEventListener(b,c,!1)},c=function(a){a.stopPropagation(),a.preventDefault()}):document.attachEvent&&(b=function(a,b,c){a.attachEvent("on"+b,function(){c.call(a,window.event)})},c=function(a){a.cancelBubble=!0,a.returnValue=0}),d="undefined"!=typeof MutationObserver?function(a,b){function c(a){var b=window.getComputedStyle(a);return"none"===b.display||"hidden"===b.visibility}var d,e=document.getElementById(b),f=e.parentNode;c(f)&&(d=new MutationObserver(function(b,d){c(f)||(a.redrawOnce(),d.disconnect())}),d.observe(f,{attributes:!0,attributeFilter:["style"]}))}:function(){};var e=function(){function a(a){var b=a.charCodeAt(0),c=b.toString(16);return 256>b?"\\x"+("00"+c).slice(-2):"\\u"+("0000"+c).slice(-4)}return function(b){return b.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,a)}}();return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:!1,localise:function(){var a,b;if("i18n"in flxmap&&(FlexibleMap.prototype.i18n=flxmap.i18n),"mapTypes"in flxmap){b=flxmap.mapTypes;for(a in b)b[a]._styled_map=new google.maps.StyledMapType(b[a].styles,b[a].options);FlexibleMap.prototype.mapTypes=b}FlexibleMap.prototype.localised=!0},setlocale:function(a){return this.locale=a,a in this.i18n?this.localeActive=a:(a=a.substr(0,2),this.localeActive=a in this.i18n?a:!1),this.localeActive},gettext:function(a){var b=this.localeActive;return b&&a in this.i18n[b]?this.i18n[b][a]:a},showKML:function(f,g,h){"undefined"!=typeof h&&(this.zoom=h);var i=this,j=document.getElementById(f),k=j.getAttribute("data-flxmap"),l=this.showMap(f,[0,0]),m=this.loadKmlMap(a(g,this.kmlcache));d(this,f),"undefined"!=typeof h&&google.maps.event.addListenerOnce(l,"zoom_changed",function(){l.setZoom(h),i.zoom=h}),(this.markerDirections||this.markerDirectionsShow)&&this.startDirService(l),google.maps.event.addListener(m,"click",function(a){var b=a.featureData;if(!b._flxmapOnce){if(b._flxmapOnce=!0,i.targetFix&&b.description){var c=/ target="_blank"/gi;b.description=b.description.replace(c,""),b.infoWindowHtml=b.infoWindowHtml.replace(c,"")}if(i.markerDirections){var d=a.latLng,f=d.lat()+","+d.lng()+",'"+e(b.name)+"',true",g='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+k+".showDirections("+f+'); return false;">'+i.gettext("Directions")+"</a>";b.infoWindowHtml=b.infoWindowHtml.replace(/<\/div><\/div>$/i,g+"</div></div>")}}}),window.opera&&this.markerDirections&&b(j,"click",function(a){a.target.getAttribute("data-flxmap-fix-opera")&&c(a)})},showMarker:function(a,e,f){var g=this.showMap(a,e),h=new google.maps.LatLng(f[0],f[1]),i=new google.maps.Marker({map:g,position:h,icon:this.markerIcon});if(this.setMarkerPoint(i),this.setMarkerLocation(h),d(this,a),this.markerTitle||(this.markerTitle=this.markerAddress),this.markerTitle||this.markerHTML||this.markerDescription||this.markerLink||this.markerDirections){var j,k,l,m,n,o,p=this,q=document.createElement("DIV");if(q.className="flxmap-infowin",n=document.createElement("DIV"),n.className="flxmap-marker-title",this.markerTitle&&(n.appendChild(document.createTextNode(this.markerTitle)),i.setTitle(this.markerTitle)),q.appendChild(n),this.markerHTML&&(n=document.createElement("DIV"),n.innerHTML=this.markerHTML,q.appendChild(n)),this.markerDescription||this.markerLink){if(n=document.createElement("DIV"),n.className="flxmap-marker-link",this.markerDescription){for(l=this.markerDescription.split("\n"),j=0,k=l.length;k>j;j++)j>0&&n.appendChild(document.createElement("BR")),n.appendChild(document.createTextNode(l[j]));this.markerLink&&n.appendChild(document.createElement("BR"))}this.markerLink&&(o=document.createElement("A"),o.href=this.markerLink,this.markerLinkTarget&&(o.target=this.markerLinkTarget),o.appendChild(document.createTextNode(this.markerLinkText||this.gettext("Click for details"))),n.appendChild(o)),q.appendChild(n)}this.markerDirections&&(n=document.createElement("DIV"),n.className="flxmap-directions-link",o=document.createElement("A"),o.href="#",o.dataLatitude=f[0],o.dataLongitude=f[1],b(o,"click",function(a){c(a),p.showDirections(this.dataLatitude,this.dataLongitude,!0)}),o.appendChild(document.createTextNode(this.gettext("Directions"))),n.appendChild(o),q.appendChild(n)),m=new google.maps.InfoWindow({content:q}),this.setMarkerInfowin(m),this.markerShowInfo&&google.maps.event.addListenerOnce(g,"tilesloaded",function(){m.open(g,i)}),google.maps.event.addListener(i,"click",function(){m.open(g,i)});var r=function(){p.updateGoogleLink()};google.maps.event.addListener(g,"idle",r),google.maps.event.addListener(g,"center_changed",r),google.maps.event.addListenerOnce(g,"tilesloaded",r)}(this.markerDirections||this.markerDirectionsShow)&&(this.startDirService(g),this.markerDirectionsShow&&this.showDirections(f[0],f[1],!1))},showAddress:function(a,b){var c=this,d=new google.maps.Geocoder;this.markerAddress=b,""===this.markerTitle&&(this.markerTitle=b),d.geocode({address:b,region:this.region},function(b,d){if(d==google.maps.GeocoderStatus.OK){var e=b[0].geometry.location,f=[e.lat(),e.lng()];c.showMarker(a,f,f)}else window.alert("Map address returns error: "+d)})},updateGoogleLink:function(){if("querySelectorAll"in document)try{for(var a=this.getMap().getDiv(),b=this.getMarkerLocation(),c=a.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),d=0,e=c.length,f=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+b.lat()+","+b.lng());e>d;d++)c[d].href+="&mrt=loc&iwloc=A&q="+f}catch(g){}},redraw:function(){var a=this.getMap(),b=this.getKmlLayer();if(google.maps.event.trigger(a,"resize"),b)a.fitBounds(b.getDefaultViewport());else{a.setCenter(this.getCenter()),a.setZoom(this.zoom);var c=this.getMarkerInfowin();c&&c.open(a,this.getMarkerPoint())}},startDirService:function(a){this.dirService||(this.dirService=new google.maps.DirectionsService),this.dirRenderer||(this.dirRenderer=new google.maps.DirectionsRenderer({map:a,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null}))},showDirections:function(a,d,e){function f(){for(var a,d,f,h=document.getElementById(i.markerDirectionsDiv),j=document.createElement("form");d=h.lastChild;)h.removeChild(d);d=document.createElement("p"),d.appendChild(document.createTextNode(i.gettext("From")+": ")),f=document.createElement("input"),f.type="text",f.name="from",f.value=i.markerDirectionsDefault,d.appendChild(f),a=document.createElement("input"),a.type="submit",a.value=i.gettext("Get directions"),d.appendChild(a),j.appendChild(d),h.appendChild(j),"undefined"==typeof j.elements.from&&(j.elements.from=f),e&&f.focus(),b(j,"submit",function(a){c(a);var b=this.elements.from.value;/\S/.test(b)&&g(b)})}function g(b){var c=""===i.markerAddress?new google.maps.LatLng(a,d):i.markerAddress,e={origin:b,destination:c};switch(i.region&&(e.region=i.region),i.dirTravelMode){case"bicycling":e.travelMode=google.maps.TravelMode.BICYCLING;break;case"driving":e.travelMode=google.maps.TravelMode.DRIVING;break;case"transit":e.travelMode=google.maps.TravelMode.TRANSIT;break;case"walking":e.travelMode=google.maps.TravelMode.WALKING}switch(i.dirUnitSystem){case"imperial":e.unitSystem=google.maps.UnitSystem.IMPERIAL;break;case"metric":e.unitSystem=google.maps.UnitSystem.METRIC}i.dirService.route(e,h)}function h(a,b){var c=google.maps.DirectionsStatus;switch(b){case c.OK:i.dirRenderer.setDirections(a);break;case c.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case c.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case c.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case c.INVALID_REQUEST:window.alert("Invalid directions request.");break;case c.NOT_FOUND:window.alert("Origin or destination was not found.");break;default:window.alert("A directions request could not be processed due to a server error. The request may succeed if you try again.")}}var i=this;this.markerDirectionsDiv&&this.dirShowSearch&&f(),this.markerDirectionsDefault&&g(this.markerDirectionsDefault)}}}();
|
|
|
|
|
|
|
|
|
|
languages/wp-flexible-map-de_DE.mo
CHANGED
Binary file
|
languages/wp-flexible-map-fr_FR.mo
DELETED
Binary file
|
languages/wp-flexible-map-it_IT.mo
CHANGED
Binary file
|
languages/wp-flexible-map-ko_KR.mo
DELETED
Binary file
|
languages/wp-flexible-map-nb_NO.mo
CHANGED
Binary file
|
languages/wp-flexible-map-nl_NL.mo
CHANGED
Binary file
|
languages/wp-flexible-map-sv_SE.mo
DELETED
Binary file
|
languages/wp-flexible-map.pot
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# copyright (c) 2014-
|
2 |
# This file is distributed under the same license as the plugin package.
|
3 |
#
|
4 |
#, fuzzy
|
@@ -6,36 +6,36 @@ msgid ""
|
|
6 |
msgstr ""
|
7 |
"Project-Id-Version: wp-flexible-map\n"
|
8 |
"Report-Msgid-Bugs-To: translate@webaware.com.au\n"
|
9 |
-
"POT-Creation-Date:
|
10 |
-
"PO-Revision-Date:
|
11 |
-
"Last-Translator:
|
12 |
"Language-Team: \n"
|
13 |
"Language: en_US\n"
|
14 |
"MIME-Version: 1.0\n"
|
15 |
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
"Content-Transfer-Encoding: 8bit\n"
|
17 |
|
18 |
-
#: includes/class.FlxMapAdmin.php:
|
19 |
msgctxt "plugin details links"
|
20 |
msgid "Instructions"
|
21 |
msgstr ""
|
22 |
|
23 |
-
#: includes/class.FlxMapAdmin.php:
|
24 |
msgctxt "plugin details links"
|
25 |
msgid "Get Help"
|
26 |
msgstr ""
|
27 |
|
28 |
-
#: includes/class.FlxMapAdmin.php:
|
29 |
msgctxt "plugin details links"
|
30 |
msgid "Rating"
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: includes/class.FlxMapAdmin.php:
|
34 |
msgctxt "plugin details links"
|
35 |
msgid "Translate"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: includes/class.FlxMapAdmin.php:
|
39 |
msgctxt "plugin details links"
|
40 |
msgid "Donate"
|
41 |
msgstr ""
|
1 |
+
# copyright (c) 2014-2016 WebAware Pty Ltd
|
2 |
# This file is distributed under the same license as the plugin package.
|
3 |
#
|
4 |
#, fuzzy
|
6 |
msgstr ""
|
7 |
"Project-Id-Version: wp-flexible-map\n"
|
8 |
"Report-Msgid-Bugs-To: translate@webaware.com.au\n"
|
9 |
+
"POT-Creation-Date: 2016-06-05 19:43+1000\n"
|
10 |
+
"PO-Revision-Date: 2016-06-05 19:43+1000\n"
|
11 |
+
"Last-Translator: translate@webaware.com.au\n"
|
12 |
"Language-Team: \n"
|
13 |
"Language: en_US\n"
|
14 |
"MIME-Version: 1.0\n"
|
15 |
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
"Content-Transfer-Encoding: 8bit\n"
|
17 |
|
18 |
+
#: includes/class.FlxMapAdmin.php:35
|
19 |
msgctxt "plugin details links"
|
20 |
msgid "Instructions"
|
21 |
msgstr ""
|
22 |
|
23 |
+
#: includes/class.FlxMapAdmin.php:36
|
24 |
msgctxt "plugin details links"
|
25 |
msgid "Get Help"
|
26 |
msgstr ""
|
27 |
|
28 |
+
#: includes/class.FlxMapAdmin.php:37
|
29 |
msgctxt "plugin details links"
|
30 |
msgid "Rating"
|
31 |
msgstr ""
|
32 |
|
33 |
+
#: includes/class.FlxMapAdmin.php:38
|
34 |
msgctxt "plugin details links"
|
35 |
msgid "Translate"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: includes/class.FlxMapAdmin.php:39
|
39 |
msgctxt "plugin details links"
|
40 |
msgid "Donate"
|
41 |
msgstr ""
|
readme.txt
CHANGED
@@ -6,8 +6,8 @@ Author URI: http://webaware.com.au/
|
|
6 |
Donate link: http://shop.webaware.com.au/donations/?donation_for=Flexible+Map
|
7 |
Tags: google, map, maps, google maps, shortcode, google maps shortcode, kml
|
8 |
Requires at least: 3.2.1
|
9 |
-
Tested up to: 4.5
|
10 |
-
Stable tag: 1.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
@@ -48,11 +48,14 @@ Thanks for sponsoring new features on WP Flexible Maps!
|
|
48 |
Many thanks to the generous efforts of our translators:
|
49 |
|
50 |
* Czech (cs) -- [caslavak](https://profiles.wordpress.org/caslavak/)
|
51 |
-
* Dutch (nl) -- [Ivan Beemster](http://www.lijndiensten.com/)
|
52 |
-
* French (fr) -- [mister klucha](https://profiles.wordpress.org/mister-klucha/)
|
53 |
-
* German (de) -- [Carib Design](http://www.caribdesign.com/)
|
54 |
* Greek (el) -- [Pantelis Orfanos](https://profiles.wordpress.org/ironwiller/)
|
55 |
* Hungarian (hu) -- Krisztián Vörös
|
|
|
|
|
|
|
56 |
* Norwegian: Bokmål (nb_NO) -- [neonnero](http://www.neonnero.com/)
|
57 |
* Norwegian: Nynorsk (nn_NO) -- [neonnero](http://www.neonnero.com/)
|
58 |
* Portuguese (pt_BR) -- Alexsandro Santos and Paulo Henrique
|
@@ -304,33 +307,20 @@ Either turn off CloudFlare Rocketscript :) or install the [Flxmap No Rocketscrip
|
|
304 |
|
305 |
== Upgrade Notice ==
|
306 |
|
307 |
-
= 1.
|
308 |
|
309 |
-
|
310 |
|
311 |
== Changelog ==
|
312 |
|
313 |
The full changelog can be found [on GitHub](https://github.com/webaware/flexible-map/blob/master/changelog.md). Recent entries:
|
314 |
|
315 |
-
### 1.
|
316 |
-
|
317 |
-
* fixed:
|
318 |
-
*
|
319 |
-
*
|
320 |
-
* changed:
|
321 |
-
* changed: translations
|
322 |
-
* changed:
|
323 |
-
|
324 |
-
* changed: removed "sensor" query parameter to Google Maps API; no longer required
|
325 |
-
|
326 |
-
### 1.10.0, 2015-08-23
|
327 |
-
|
328 |
-
* fixed: Brazilian Portuguese translation (thanks, Alexsandro Santos and Paulo Henrique!)
|
329 |
-
* fixed: JavaScript error on KML map marker click when marker has no description
|
330 |
-
* fixed: can show directions without having a marker title (or infowindow)
|
331 |
-
* added: `linktarget` attribute for changing where marker links open, e.g. `linktarget="_blank"`
|
332 |
-
* added: `linktext` attribute for changing marker link text
|
333 |
-
* added: `dirunitsystem` attribute for forcing directions units to metric or imperial
|
334 |
-
* added: `dirtravelmode` attribute for selecting directions by driving, bicycling, walking, or transit
|
335 |
-
* changed: bump version of Google Maps API to 3.20
|
336 |
-
* changed: always load Google Maps API on HTTPS
|
6 |
Donate link: http://shop.webaware.com.au/donations/?donation_for=Flexible+Map
|
7 |
Tags: google, map, maps, google maps, shortcode, google maps shortcode, kml
|
8 |
Requires at least: 3.2.1
|
9 |
+
Tested up to: 4.5.2
|
10 |
+
Stable tag: 1.11.0
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
48 |
Many thanks to the generous efforts of our translators:
|
49 |
|
50 |
* Czech (cs) -- [caslavak](https://profiles.wordpress.org/caslavak/)
|
51 |
+
* Dutch (nl) -- [Ivan Beemster](http://www.lijndiensten.com/) and the [Dutch translation team](https://translate.wordpress.org/locale/nl/default/wp-plugins/wp-flexible-map)
|
52 |
+
* French (fr) -- [mister klucha](https://profiles.wordpress.org/mister-klucha/) and the [French translation team](https://translate.wordpress.org/locale/fr/default/wp-plugins/wp-flexible-map)
|
53 |
+
* German (de) -- [Carib Design](http://www.caribdesign.com/) and the [German translation team](https://translate.wordpress.org/locale/de/default/wp-plugins/wp-flexible-map)
|
54 |
* Greek (el) -- [Pantelis Orfanos](https://profiles.wordpress.org/ironwiller/)
|
55 |
* Hungarian (hu) -- Krisztián Vörös
|
56 |
+
* Italian (it_IT) -- the [Italian translation team](https://translate.wordpress.org/locale/it/default/wp-plugins/wp-flexible-map)
|
57 |
+
* Korean (ko_KR) -- the [Korean translation team](https://translate.wordpress.org/locale/ko/default/wp-plugins/wp-flexible-map)
|
58 |
+
* Swedish (sv_SE) -- the [Swedish translation team](https://translate.wordpress.org/locale/sv/default/wp-plugins/wp-flexible-map)
|
59 |
* Norwegian: Bokmål (nb_NO) -- [neonnero](http://www.neonnero.com/)
|
60 |
* Norwegian: Nynorsk (nn_NO) -- [neonnero](http://www.neonnero.com/)
|
61 |
* Portuguese (pt_BR) -- Alexsandro Santos and Paulo Henrique
|
307 |
|
308 |
== Upgrade Notice ==
|
309 |
|
310 |
+
= 1.11.0 =
|
311 |
|
312 |
+
use localisation from translate.wordpress.org in preference to local plugin copy; bump version of Google Maps API to 3.24
|
313 |
|
314 |
== Changelog ==
|
315 |
|
316 |
The full changelog can be found [on GitHub](https://github.com/webaware/flexible-map/blob/master/changelog.md). Recent entries:
|
317 |
|
318 |
+
### 1.11.0, 2016-06-05
|
319 |
+
|
320 |
+
* fixed: monitor changes to invisible containers, not just non-displayed containers (thanks, [zetoun17](https://profiles.wordpress.org/zetoun17/)!)
|
321 |
+
* fixed: "FlexibleMap is not defined" error when `isajax="1"` used without calling `flexmap_load_scripts()` (per the [FAQ](https://en-au.wordpress.org/plugins/wp-flexible-map/faq/))
|
322 |
+
* added: ask [Autoptimize](https://wordpress.org/plugins/autoptimize/) to leave our inline script alone, to reduce the number of cached script files
|
323 |
+
* changed: use localisation from [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/wp-flexible-map) in preference to local plugin copy
|
324 |
+
* changed: translations updated from translate.wordpress.org
|
325 |
+
* changed: bump version of Google Maps API to 3.24
|
326 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
screenshot-1.jpg
DELETED
Binary file
|
screenshot-2.png
DELETED
Binary file
|
screenshot-3.jpg
DELETED
Binary file
|
screenshot-4.png
DELETED
Binary file
|