Version Description
- Fixed: removed wp_set_script_translations for older WP versions
- Changed: internal separation of media and editor classes
Download this release
Release Info
Developer | chrisvrichardson |
Plugin | MapPress Easy Google Maps |
Version | 2.54.1 |
Comparing to | |
See all releases |
Code changes from version 2.54 to 2.54.1
- js/mappress_editor.min.js +1 -1
- js/mappress_media.min.js +1 -0
- languages/mappress-google-maps-for-wordpress.pot +4 -4
- mappress.php +8 -7
- readme.txt +5 -1
js/mappress_editor.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var mapp=window.mapp||{};+function(n){mapp.
|
1 |
+
var mapp=window.mapp||{};+function(n){mapp.Editor=function(t){this.drawingManager=null;this.map=t;this.poiEditor=null;this.sel=n(".mapp-edit");var i=this;this.initialize=function(){this.map.display();this.poiEditor=new mapp.PoiEditor(this.map);this.initDrawingManager();n(this.map.places).off("search.mapp");n(this.map.places).on("search.mapp",function(n,t){i.insertPoi(t)});this.sel.on("click","[data-mapp-editor]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-editor");i[r]()})};this.close=function(){this.map.close()};this.insertPoi=function(n){var t;if(n)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.close(),n.geometry){var i=n.formatted_address?n.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,r=n.name==i?"":i,t=new mapp.Poi({address:i,body:r,iconid:this.poiEditor.lastIcon,point:n.geometry.location,title:n.name,viewport:n.geometry.viewport?n.geometry.viewport:null});this.map.insertPoi(t);t.center()}else n.overlay&&(t=new mapp.Poi({body:"",iconid:n.type=="marker"?null:"poly",overlay:n.overlay,title:n.type=="marker"?n.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:n.type=="marker"?null:n.type}),this.map.insertPoi(t))};this.initDrawingManager=function(){};this.layer=function(){var n=window.prompt(mappl10n.layer);n&&i.insertPoi(n)};this.initialize.apply(this)};mapp.PoiEditor=function(t){this.map=t;this.poi=null;this.sel=null;this.lastIcon=null;var i=this;this.initialize=function(){this.sel=n(this.map.iw.getContent());n(this.map).on("mapp.open",function(n,t){i.render(t)});n(this.map).on("mapp.close",function(){i.mce(!1)});this.sel.on("click","[data-mapp-poi]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-poi");i[r]()});this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",function(){var t=n(this).hasClass("mapp-poi-visual");i.mce(t)});this.sel.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),i.save())});this.sel.on("change","[data-mapp-iconpicker]",function(){i.poi.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));i.lastIcon=i.poi.iconid;i.map.renderList()});this.sel.on("change","[data-mapp-colorpicker]",function(){i.poi.setTemplateColors(n("[data-mapp-colorpicker]").attr("data-mapp-color"),n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),n("[data-mapp-colorpicker]").attr("data-mapp-weight"));i.map.renderList()})};this.cancel=function(){this.map.close()};this.initMCE=function(){var n,t,i;typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(n="en",typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,n=typeof t.language!="undefined"?t.language:"en"),i={mode:"none",height:"75px",convert_urls:!1,language:n,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""},tinyMCE.init(i),this.mce(!0))};this.mce=function(t){var r=t?"mceAddEditor":"mceRemoveEditor";typeof tinyMCE!="undefined"&&tinyMCE.execCommand(r,!1,"mapp-poi-body");n(".mapp-poi-visual, .mapp-poi-html",i.sel).removeClass("mapp-active");t?n(".mapp-poi-visual",i.sel).addClass("mapp-active"):n(".mapp-poi-html",i.sel).addClass("mapp-active")};this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.close(),this.map.removePoi(this.poi))};this.render=function(t){this.poi=t;n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh");this.initMCE()};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();this.poi.title=n(".mapp-poi-title").val();this.poi.body=n(".mapp-poi-body").val();this.map.renderList();this.map.close()};this.initialize.apply(this)}}(jQuery)
|
js/mappress_media.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var mapp=window.mapp||{};+function(n){mapp.Media=function(){this.editor=null;this.map=null;this.settings={editable:!0,name:"mapp0"};this.sel=n(".mapp-media");this.items=null;var t=this;this.initialize=function(){this.find();this.sel.on("change",".mapp-media-list-type",function(){var i=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-search").val("");n(".mapp-media-search").toggle(i=="all");t.find()});this.sel.on("keydown",".mapp-media-search",function(n){if(n.which==13)return!1});this.sel.on("input",".mapp-media-search",function(){t.find()});this.sel.on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media");t[r]()});this.sel.on("click",".mapp-media-list .mapp-item",function(){n(".mapp-media-list .mapp-item",this.sel).removeClass("mapp-active");n(this).addClass("mapp-active")});this.sel.on("click",".mapp-media-list [data-mapp-media-list]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media-list"),u=n(this).closest(".mapp-item"),f=u.attr("data-mapp-mapid");return t[r](f),!1});this.sel.on("change",".mapp-media-viewport",function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())});n(".mapp-media-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n(".mapp-media-width").val(i);n(".mapp-media-height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){t.save()});n(".mapp-media-title").keydown(function(n){n.which==13&&(n.preventDefault(),t.save())})};this.add=function(){var n=new mapp.Map({},this.settings);n.width=mappl10n.options.sizes[mappl10n.options.size].width;n.height=mappl10n.options.sizes[mappl10n.options.size].height;t.open(n)};this.cancel=function(){t.closeEditor()};this.closeEditor=function(){this.editor.close();this.map=null;this.editor=null;n(".mapp-media-edit-panel").hide();n(".mapp-media-list-panel").show()};this.edit=function(n){mapp.Map.ajaxGet(n,function(n){var i=new mapp.Map(n,t.settings);t.open(i)})};this.find=function(){var t=this;this.items!==null?this.renderList():(n(".spinner",this.sel).css("visibility","visible"),mapp.lib.ajax({type:"GET",data:{action:"mapp_find",nonce:mappl10n.options.nonce},callback:function(i){i.status=="OK"&&(n(".spinner",this.sel).css("visibility","hidden"),t.items=_.sortBy(i.data,"post_title"),t.renderList())}}))};this.insert=function(n){n=n?n:this.map.mapid;var t='[mappress mapid="'+n+'"]';send_to_editor(t)};this.open=function(t){this.map=t;n(".mapp-edit",this.sel).html(mapp.lib.template("edit-map"));var i=this.map.mapid;i?n(".mapp-media-mapid").text(i):n(".mapp-media-mapid").text("");n(".mapp-media-title").val(this.map.title);n(".mapp-media-width").val(this.map.width);n(".mapp-media-height").val(this.map.height);n(".mapp-media-viewport").prop("checked",!!(this.map.center&&this.map.zoom));n(".mapp-media-edit-panel").show();n(".mapp-media-list-panel").hide();this.editor=new mapp.Editor(this.map)};this.remove=function(n){if(confirm(mappl10n.delete_map_prompt)){var t=_.findIndex(this.items,{mapid:n});t>-1&&(this.items.splice(t,1),mapp.Map.ajaxDelete(n),this.renderList())}};this.renderList=function(){var t=null,i=400,r=null,u=n(".mapp-media-list-type",this.sel).val(),f=n(".mapp-media-search",this.sel).val().toLowerCase();t=u=="all"?_.filter(this.items,function(n){return n.post_title&&n.post_title.toLowerCase().indexOf(f)!=-1||n.map_title&&n.map_title.toLowerCase().indexOf(f)!=-1}):_.filter(this.items,function(n){return n.postid==mappl10n.options.postid});t.length>i?(r=mappl10n.more.replace("%d",i).replace("%d",t.length),t=t.slice(0,i)):r="";n(".mapp-media-list",this.sel).html(mapp.lib.template("media-list",{items:t,type:u,more:r}))};this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-media-title").val()),this.map.width=n(".mapp-media-width").val(),this.map.height=n(".mapp-media-height").val(),n(".mapp-media-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave(function(){var i=t.map.mapid?t.map.mapid.toString():null,r=_.findIndex(t.items,function(n){return n.mapid==i});r==-1?t.items.unshift({mapid:i,map_title:t.map.title,postid:mappl10n.options.postid,post_title:n("#title").val()||n("#post-title-0").val()}):t.items[r].map_title=t.map.title;t.renderList();t.closeEditor()}))};this.initialize.apply(this)}}(jQuery)
|
languages/mappress-google-maps-for-wordpress.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MapPress Maps for WordPress 2.54\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-04-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
@@ -173,7 +173,7 @@ msgid "MapPress Settings"
|
|
173 |
msgstr ""
|
174 |
|
175 |
#: mappress.php:318
|
176 |
-
#: mappress.php:
|
177 |
msgid "Version"
|
178 |
msgstr ""
|
179 |
|
@@ -258,7 +258,7 @@ msgstr ""
|
|
258 |
msgid "Satellite Streets"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: mappress.php:
|
262 |
msgid "Settings"
|
263 |
msgstr ""
|
264 |
|
2 |
# This file is distributed under the same license as the MapPress Maps for WordPress plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MapPress Maps for WordPress 2.54.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-04-11T17:04:34+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
|
173 |
msgstr ""
|
174 |
|
175 |
#: mappress.php:318
|
176 |
+
#: mappress.php:825
|
177 |
msgid "Version"
|
178 |
msgstr ""
|
179 |
|
258 |
msgid "Satellite Streets"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: mappress.php:604
|
262 |
msgid "Settings"
|
263 |
msgstr ""
|
264 |
|
mappress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
|
|
4 |
Plugin URI: https://www.mappresspro.com/mappress
|
5 |
Author URI: https://www.mappresspro.com/chris-contact
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
-
Version: 2.54
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
@@ -35,7 +35,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
|
|
35 |
}
|
36 |
|
37 |
class Mappress {
|
38 |
-
const VERSION = '2.54';
|
39 |
|
40 |
static
|
41 |
$baseurl,
|
@@ -533,8 +533,7 @@ class Mappress {
|
|
533 |
|
534 |
// Editor
|
535 |
wp_register_script('mappress-editor', $js . "/mappress_editor$min.js", array('jquery', 'jquery-ui-position', 'jquery-ui-sortable'), self::$version, $footer);
|
536 |
-
|
537 |
-
//gtv
|
538 |
wp_register_script('mappress-gt', $js . "/mappress_gt$min.js", array('jquery', 'mappress', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), self::$version, false);
|
539 |
|
540 |
// Autocomplete
|
@@ -548,8 +547,8 @@ class Mappress {
|
|
548 |
}
|
549 |
|
550 |
// I18N
|
551 |
-
|
552 |
-
|
553 |
}
|
554 |
|
555 |
static function scripts_enqueue($type = null) {
|
@@ -572,8 +571,10 @@ class Mappress {
|
|
572 |
if ($type == 'settings')
|
573 |
wp_enqueue_script('mappress-settings');
|
574 |
|
575 |
-
if ($type == 'editor')
|
576 |
wp_enqueue_script('mappress-editor');
|
|
|
|
|
577 |
|
578 |
// mappress.js includes loader, so must come after editor
|
579 |
wp_enqueue_script('mappress');
|
4 |
Plugin URI: https://www.mappresspro.com/mappress
|
5 |
Author URI: https://www.mappresspro.com/chris-contact
|
6 |
Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
|
7 |
+
Version: 2.54.1
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
35 |
}
|
36 |
|
37 |
class Mappress {
|
38 |
+
const VERSION = '2.54.1';
|
39 |
|
40 |
static
|
41 |
$baseurl,
|
533 |
|
534 |
// Editor
|
535 |
wp_register_script('mappress-editor', $js . "/mappress_editor$min.js", array('jquery', 'jquery-ui-position', 'jquery-ui-sortable'), self::$version, $footer);
|
536 |
+
wp_register_script('mappress-media', $js . "/mappress_media$min.js", array('jquery'), self::$version, $footer);
|
|
|
537 |
wp_register_script('mappress-gt', $js . "/mappress_gt$min.js", array('jquery', 'mappress', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), self::$version, false);
|
538 |
|
539 |
// Autocomplete
|
547 |
}
|
548 |
|
549 |
// I18N
|
550 |
+
if (function_exists('wp_set_script_translation'))
|
551 |
+
wp_set_script_translations('mappress-gt', 'mappress-google-maps-for-wordpress', self::$baseurl . '/languages');
|
552 |
}
|
553 |
|
554 |
static function scripts_enqueue($type = null) {
|
571 |
if ($type == 'settings')
|
572 |
wp_enqueue_script('mappress-settings');
|
573 |
|
574 |
+
if ($type == 'editor') {
|
575 |
wp_enqueue_script('mappress-editor');
|
576 |
+
wp_enqueue_script('mappress-media');
|
577 |
+
}
|
578 |
|
579 |
// mappress.js includes loader, so must come after editor
|
580 |
wp_enqueue_script('mappress');
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: leaflet, openstreetmap, osm, mapbox, map box, google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.4
|
7 |
-
Stable tag: 2.54
|
8 |
|
9 |
== Description ==
|
10 |
MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
|
@@ -86,6 +86,10 @@ Please see the plugin documentation pages:
|
|
86 |
|
87 |
== Changelog ==
|
88 |
|
|
|
|
|
|
|
|
|
89 |
= 2.54 =
|
90 |
* Changed: Google map type control is hidden in frontend, visible only in editor
|
91 |
* Changed: scrollwheel zoom and keyboard shortcuts are now enabled by default (to match Google API defaults)
|
4 |
Tags: leaflet, openstreetmap, osm, mapbox, map box, google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 2.54.1
|
8 |
|
9 |
== Description ==
|
10 |
MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
|
86 |
|
87 |
== Changelog ==
|
88 |
|
89 |
+
= 2.54.1 =
|
90 |
+
* Fixed: removed wp_set_script_translations for older WP versions
|
91 |
+
* Changed: internal separation of media and editor classes
|
92 |
+
|
93 |
= 2.54 =
|
94 |
* Changed: Google map type control is hidden in frontend, visible only in editor
|
95 |
* Changed: scrollwheel zoom and keyboard shortcuts are now enabled by default (to match Google API defaults)
|