Google Maps Widget – Ultimate Google Maps Plugin - Version 0.65

Version Description

  • 2013/08/05
  • updated JS for WP v3.6
Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Google Maps Widget – Ultimate Google Maps Plugin
Version 0.65
Comparing to
See all releases

Code changes from version 0.60 to 0.65

Files changed (5) hide show
  1. google-maps-widget.php +20 -5
  2. js/gmw-admin.js +11 -6
  3. js/gmw.js +1 -1
  4. js/jquery.cookie.js +90 -84
  5. readme.txt +7 -3
google-maps-widget.php CHANGED
@@ -4,8 +4,23 @@ Plugin Name: Google Maps Widget
4
  Plugin URI: http://wordpress.org/extend/plugins/google-maps-widget/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox.
6
  Author: Web factory Ltd
7
- Version: 0.60
8
  Author URI: http://www.webfactoryltd.com/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
 
11
 
@@ -14,15 +29,15 @@ if (!function_exists('add_action')) {
14
  }
15
 
16
 
17
- define('GMW_VER', '0.60');
18
- require 'gmw-widget.php';
19
 
20
 
21
  class GMW {
22
  function init() {
23
  if (is_admin()) {
24
  // check if minimal required WP version is used
25
- self::check_wp_version(3.2);
26
 
27
  // aditional links in plugin description
28
  add_filter('plugin_action_links_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__),
@@ -78,7 +93,7 @@ class GMW {
78
 
79
  // display error message if WP version is too low
80
  function min_version_error() {
81
- echo '<div class="error"><p>Google Maps Widget <b>requires WordPress version 3.2</b> or higher to function properly. You\'re using WordPress version ' . get_bloginfo('version') . '. Please <a href="' . admin_url('update-core.php') . '">update it</a>.</p></div>';
82
  } // min_version_error
83
 
84
 
4
  Plugin URI: http://wordpress.org/extend/plugins/google-maps-widget/
5
  Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox.
6
  Author: Web factory Ltd
7
+ Version: 0.65
8
  Author URI: http://www.webfactoryltd.com/
9
+
10
+ Copyright 2013 Web factory Ltd (email : info@webfactoryltd.com)
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License, version 2, as
14
+ published by the Free Software Foundation.
15
+
16
+ This program is distributed in the hope that it will be useful,
17
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ GNU General Public License for more details.
20
+
21
+ You should have received a copy of the GNU General Public License
22
+ along with this program; if not, write to the Free Software
23
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
 
26
 
29
  }
30
 
31
 
32
+ define('GMW_VER', '0.65');
33
+ require_once 'gmw-widget.php';
34
 
35
 
36
  class GMW {
37
  function init() {
38
  if (is_admin()) {
39
  // check if minimal required WP version is used
40
+ self::check_wp_version(3.3);
41
 
42
  // aditional links in plugin description
43
  add_filter('plugin_action_links_' . basename(dirname(__FILE__)) . '/' . basename(__FILE__),
93
 
94
  // display error message if WP version is too low
95
  function min_version_error() {
96
+ echo '<div class="error"><p>Google Maps Widget <b>requires WordPress version 3.3</b> or higher to function properly. You\'re using WordPress version ' . get_bloginfo('version') . '. Please <a href="' . admin_url('update-core.php') . '">update it</a>.</p></div>';
97
  } // min_version_error
98
 
99
 
js/gmw-admin.js CHANGED
@@ -1,29 +1,34 @@
1
  /*
2
  * Google Maps Widget
3
- * (c) Web factory Ltd, 2012
4
  */
5
 
6
  jQuery(function($) {
7
  $('.gmw-tabs').each(function(i, el) {
8
  el_id = $(el).attr('id');
9
- $(el).tabs({ selected: get_active_tab(el_id),
10
- show: function(event, ui) { $.cookie($(this).attr('id'), $(this).tabs('option', 'selected'), { expires: 7 }); }
11
  });
12
  });
13
 
14
  // get active tab index from cookie
15
  function get_active_tab(el_id) {
16
  id = parseInt(0 + $.cookie(el_id), 10);
17
-
18
  return id;
19
  } // get_active_tab
20
 
 
 
 
 
 
21
  // re-tab on GUI rebuild
22
  $('div[id*="googlemapswidget"]').ajaxSuccess(function(event, request, option) {
23
  $('.gmw-tabs').each(function(i, el) {
24
  el_id = $(el).attr('id');
25
- $(el).tabs({ selected: get_active_tab(el_id),
26
- show: function(event, ui) { $.cookie($(this).attr('id'), $(this).tabs('option', 'selected'), { expires: 7 }); }
27
  });
28
  });
29
  });
1
  /*
2
  * Google Maps Widget
3
+ * (c) Web factory Ltd, 2013
4
  */
5
 
6
  jQuery(function($) {
7
  $('.gmw-tabs').each(function(i, el) {
8
  el_id = $(el).attr('id');
9
+ $(el).tabs({ active: get_active_tab(el_id),
10
+ activate: function(event, ui) { save_active_tab(this); }
11
  });
12
  });
13
 
14
  // get active tab index from cookie
15
  function get_active_tab(el_id) {
16
  id = parseInt(0 + $.cookie(el_id), 10);
17
+
18
  return id;
19
  } // get_active_tab
20
 
21
+ // save active tab index to cookie
22
+ function save_active_tab(elem) {
23
+ $.cookie($(elem).attr('id'), $(elem).tabs('option', 'active'), { expires: 30 });
24
+ } // save_active_tab
25
+
26
  // re-tab on GUI rebuild
27
  $('div[id*="googlemapswidget"]').ajaxSuccess(function(event, request, option) {
28
  $('.gmw-tabs').each(function(i, el) {
29
  el_id = $(el).attr('id');
30
+ $(el).tabs({ active: get_active_tab(el_id),
31
+ activate: function(event, ui) { save_active_tab(this); }
32
  });
33
  });
34
  });
js/gmw.js CHANGED
@@ -1,6 +1,6 @@
1
  /*
2
  * Google Maps Widget
3
- * (c) Web factory Ltd, 2012
4
  */
5
 
6
  jQuery(function($) {
1
  /*
2
  * Google Maps Widget
3
+ * (c) Web factory Ltd, 2013
4
  */
5
 
6
  jQuery(function($) {
js/jquery.cookie.js CHANGED
@@ -1,89 +1,95 @@
1
- /*jslint browser: true */ /*global jQuery: true */
2
-
3
- /**
4
- * jQuery Cookie plugin
5
- *
6
- * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
7
- * Dual licensed under the MIT and GPL licenses:
8
- * http://www.opensource.org/licenses/mit-license.php
9
- * http://www.gnu.org/licenses/gpl.html
10
  *
 
 
11
  */
 
 
 
 
 
 
 
 
 
12
 
13
- // TODO JsDoc
14
 
15
- /**
16
- * Create a cookie with the given key and value and other optional parameters.
17
- *
18
- * @example $.cookie('the_cookie', 'the_value');
19
- * @desc Set the value of a cookie.
20
- * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
21
- * @desc Create a cookie with all available options.
22
- * @example $.cookie('the_cookie', 'the_value');
23
- * @desc Create a session cookie.
24
- * @example $.cookie('the_cookie', null);
25
- * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
26
- * used when the cookie was set.
27
- *
28
- * @param String key The key of the cookie.
29
- * @param String value The value of the cookie.
30
- * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
31
- * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
32
- * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
33
- * If set to null or omitted, the cookie will be a session cookie and will not be retained
34
- * when the the browser exits.
35
- * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
36
- * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
37
- * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
38
- * require a secure protocol (like HTTPS).
39
- * @type undefined
40
- *
41
- * @name $.cookie
42
- * @cat Plugins/Cookie
43
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
44
- */
45
 
46
- /**
47
- * Get the value of a cookie with the given key.
48
- *
49
- * @example $.cookie('the_cookie');
50
- * @desc Get the value of a cookie.
51
- *
52
- * @param String key The key of the cookie.
53
- * @return The value of the cookie.
54
- * @type String
55
- *
56
- * @name $.cookie
57
- * @cat Plugins/Cookie
58
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
59
- */
60
- jQuery.cookie = function (key, value, options) {
61
-
62
- // key and value given, set cookie...
63
- if (arguments.length > 1 && (value === null || typeof value !== "object")) {
64
- options = jQuery.extend({}, options);
65
-
66
- if (value === null) {
67
- options.expires = -1;
68
- }
69
-
70
- if (typeof options.expires === 'number') {
71
- var days = options.expires, t = options.expires = new Date();
72
- t.setDate(t.getDate() + days);
73
- }
74
-
75
- return (document.cookie = [
76
- encodeURIComponent(key), '=',
77
- options.raw ? String(value) : encodeURIComponent(String(value)),
78
- options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
79
- options.path ? '; path=' + options.path : '',
80
- options.domain ? '; domain=' + options.domain : '',
81
- options.secure ? '; secure' : ''
82
- ].join(''));
83
- }
84
-
85
- // key and possibly options given, get cookie...
86
- options = value || {};
87
- var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
88
- return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
89
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Cookie Plugin v1.3.1
3
+ * https://github.com/carhartl/jquery-cookie
 
 
 
 
 
 
4
  *
5
+ * Copyright 2013 Klaus Hartl
6
+ * Released under the MIT license
7
  */
8
+ (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as anonymous module.
11
+ define(['jquery'], factory);
12
+ } else {
13
+ // Browser globals.
14
+ factory(jQuery);
15
+ }
16
+ }(function ($) {
17
 
18
+ var pluses = /\+/g;
19
 
20
+ function raw(s) {
21
+ return s;
22
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
+ function decoded(s) {
25
+ return decodeURIComponent(s.replace(pluses, ' '));
26
+ }
27
+
28
+ function converted(s) {
29
+ if (s.indexOf('"') === 0) {
30
+ // This is a quoted cookie as according to RFC2068, unescape
31
+ s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
32
+ }
33
+ try {
34
+ return config.json ? JSON.parse(s) : s;
35
+ } catch(er) {}
36
+ }
37
+
38
+ var config = $.cookie = function (key, value, options) {
39
+
40
+ // write
41
+ if (value !== undefined) {
42
+ options = $.extend({}, config.defaults, options);
43
+
44
+ if (typeof options.expires === 'number') {
45
+ var days = options.expires, t = options.expires = new Date();
46
+ t.setDate(t.getDate() + days);
47
+ }
48
+
49
+ value = config.json ? JSON.stringify(value) : String(value);
50
+
51
+ return (document.cookie = [
52
+ config.raw ? key : encodeURIComponent(key),
53
+ '=',
54
+ config.raw ? value : encodeURIComponent(value),
55
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
56
+ options.path ? '; path=' + options.path : '',
57
+ options.domain ? '; domain=' + options.domain : '',
58
+ options.secure ? '; secure' : ''
59
+ ].join(''));
60
+ }
61
+
62
+ // read
63
+ var decode = config.raw ? raw : decoded;
64
+ var cookies = document.cookie.split('; ');
65
+ var result = key ? undefined : {};
66
+ for (var i = 0, l = cookies.length; i < l; i++) {
67
+ var parts = cookies[i].split('=');
68
+ var name = decode(parts.shift());
69
+ var cookie = decode(parts.join('='));
70
+
71
+ if (key && key === name) {
72
+ result = converted(cookie);
73
+ break;
74
+ }
75
+
76
+ if (!key) {
77
+ result[name] = converted(cookie);
78
+ }
79
+ }
80
+
81
+ return result;
82
+ };
83
+
84
+ config.defaults = {};
85
+
86
+ $.removeCookie = function (key, options) {
87
+ if ($.cookie(key) !== undefined) {
88
+ // Must not alter options, thus extending a fresh object...
89
+ $.cookie(key, '', $.extend({}, options, { expires: -1 }));
90
+ return true;
91
+ }
92
+ return false;
93
+ };
94
+
95
+ }));
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: WebFactory
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40webfactoryltd%2ecom&lc=US&item_name=Google%20Maps%20Widget&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: google maps, maps, gmaps, widget, lightbox, map, google map, fancybox, fancybox2
5
  License: GPLv2 or later
6
- Requires at least: 3.2
7
- Tested up to: 3.5
8
- Stable tag: 0.60
9
 
10
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
11
 
@@ -79,6 +79,10 @@ If you can figure it out open a thread in the support forums.
79
 
80
  == Changelog ==
81
 
 
 
 
 
82
  = 0.60 =
83
  * 2013/04/06
84
  * fixed zoom bug in lightbox
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40webfactoryltd%2ecom&lc=US&item_name=Google%20Maps%20Widget&no_note=0&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
4
  Tags: google maps, maps, gmaps, widget, lightbox, map, google map, fancybox, fancybox2
5
  License: GPLv2 or later
6
+ Requires at least: 3.3
7
+ Tested up to: 3.6
8
+ Stable tag: 0.65
9
 
10
  Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
11
 
79
 
80
  == Changelog ==
81
 
82
+ = 0.65 =
83
+ * 2013/08/05
84
+ * updated JS for WP v3.6
85
+
86
  = 0.60 =
87
  * 2013/04/06
88
  * fixed zoom bug in lightbox