Version Description
- 2012/09/04
- lightbox script changed from jQuery UI Dialog to fancyBox2
- added "show map title on lightbox" option
- significant speed improvements
- preparations for lightbox skins
Download this release
Release Info
Developer | WebFactory |
Plugin | Google Maps Widget – Ultimate Google Maps Plugin |
Version | 0.3 |
Comparing to | |
See all releases |
Code changes from version 0.23 to 0.3
- css/gmw.css +274 -0
- gmw-widget.php +19 -2
- google-maps-widget.php +18 -12
- images/blank.gif +0 -0
- images/fancybox_loading.gif +0 -0
- images/fancybox_overlay.png +0 -0
- images/fancybox_sprite.png +0 -0
- js/gmw.js +7 -26
- js/jquery.cookie.js +1 -1
- js/jquery.fancybox.pack.js +44 -0
- readme.txt +21 -7
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
css/gmw.css
ADDED
@@ -0,0 +1,274 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Google Maps Widget
|
3 |
+
* (c) Web factory Ltd, 2012
|
4 |
+
*/
|
5 |
+
|
6 |
+
.gmw-header, .gmw-footer {
|
7 |
+
padding: 5px;
|
8 |
+
}
|
9 |
+
|
10 |
+
|
11 |
+
/*! fancyBox v2.1.0 fancyapps.com | fancyapps.com/fancybox/#license */
|
12 |
+
.fancybox-wrap,
|
13 |
+
.fancybox-skin,
|
14 |
+
.fancybox-outer,
|
15 |
+
.fancybox-inner,
|
16 |
+
.fancybox-image,
|
17 |
+
.fancybox-wrap iframe,
|
18 |
+
.fancybox-wrap object,
|
19 |
+
.fancybox-nav,
|
20 |
+
.fancybox-nav span,
|
21 |
+
.fancybox-tmp
|
22 |
+
{
|
23 |
+
padding: 0;
|
24 |
+
margin: 0;
|
25 |
+
border: 0;
|
26 |
+
outline: none;
|
27 |
+
vertical-align: top;
|
28 |
+
}
|
29 |
+
|
30 |
+
.fancybox-wrap {
|
31 |
+
position: absolute;
|
32 |
+
top: 0;
|
33 |
+
left: 0;
|
34 |
+
z-index: 98020;
|
35 |
+
}
|
36 |
+
|
37 |
+
.fancybox-skin {
|
38 |
+
position: relative;
|
39 |
+
background: #f9f9f9;
|
40 |
+
color: #444;
|
41 |
+
text-shadow: none;
|
42 |
+
-webkit-border-radius: 4px;
|
43 |
+
-moz-border-radius: 4px;
|
44 |
+
border-radius: 4px;
|
45 |
+
}
|
46 |
+
|
47 |
+
.fancybox-opened {
|
48 |
+
z-index: 98030;
|
49 |
+
}
|
50 |
+
|
51 |
+
.fancybox-opened .fancybox-skin {
|
52 |
+
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
53 |
+
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
54 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
55 |
+
}
|
56 |
+
|
57 |
+
.fancybox-outer, .fancybox-inner {
|
58 |
+
position: relative;
|
59 |
+
}
|
60 |
+
|
61 |
+
.fancybox-inner {
|
62 |
+
overflow: hidden;
|
63 |
+
}
|
64 |
+
|
65 |
+
.fancybox-type-iframe .fancybox-inner {
|
66 |
+
-webkit-overflow-scrolling: touch;
|
67 |
+
}
|
68 |
+
|
69 |
+
.fancybox-error {
|
70 |
+
color: #444;
|
71 |
+
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
72 |
+
margin: 0;
|
73 |
+
padding: 15px;
|
74 |
+
white-space: nowrap;
|
75 |
+
}
|
76 |
+
|
77 |
+
.fancybox-image, .fancybox-iframe {
|
78 |
+
display: block;
|
79 |
+
width: 100%;
|
80 |
+
height: 100%;
|
81 |
+
}
|
82 |
+
|
83 |
+
.fancybox-image {
|
84 |
+
max-width: 100%;
|
85 |
+
max-height: 100%;
|
86 |
+
}
|
87 |
+
|
88 |
+
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
|
89 |
+
background-image: url('../images/fancybox_sprite.png');
|
90 |
+
}
|
91 |
+
|
92 |
+
#fancybox-loading {
|
93 |
+
position: fixed;
|
94 |
+
top: 50%;
|
95 |
+
left: 50%;
|
96 |
+
margin-top: -22px;
|
97 |
+
margin-left: -22px;
|
98 |
+
background-position: 0 -108px;
|
99 |
+
opacity: 0.8;
|
100 |
+
cursor: pointer;
|
101 |
+
z-index: 98060;
|
102 |
+
}
|
103 |
+
|
104 |
+
#fancybox-loading div {
|
105 |
+
width: 44px;
|
106 |
+
height: 44px;
|
107 |
+
background: url('../images/fancybox_loading.gif') center center no-repeat;
|
108 |
+
}
|
109 |
+
|
110 |
+
.fancybox-close {
|
111 |
+
position: absolute;
|
112 |
+
top: -18px;
|
113 |
+
right: -18px;
|
114 |
+
width: 36px;
|
115 |
+
height: 36px;
|
116 |
+
cursor: pointer;
|
117 |
+
z-index: 98040;
|
118 |
+
}
|
119 |
+
|
120 |
+
.fancybox-nav {
|
121 |
+
position: absolute;
|
122 |
+
top: 0;
|
123 |
+
width: 40%;
|
124 |
+
height: 100%;
|
125 |
+
cursor: pointer;
|
126 |
+
text-decoration: none;
|
127 |
+
background: transparent url('../images/blank.gif'); /* helps IE */
|
128 |
+
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
129 |
+
z-index: 98040;
|
130 |
+
}
|
131 |
+
|
132 |
+
.fancybox-prev {
|
133 |
+
left: 0;
|
134 |
+
}
|
135 |
+
|
136 |
+
.fancybox-next {
|
137 |
+
right: 0;
|
138 |
+
}
|
139 |
+
|
140 |
+
.fancybox-nav span {
|
141 |
+
position: absolute;
|
142 |
+
top: 50%;
|
143 |
+
width: 36px;
|
144 |
+
height: 34px;
|
145 |
+
margin-top: -18px;
|
146 |
+
cursor: pointer;
|
147 |
+
z-index: 98040;
|
148 |
+
visibility: hidden;
|
149 |
+
}
|
150 |
+
|
151 |
+
.fancybox-prev span {
|
152 |
+
left: 10px;
|
153 |
+
background-position: 0 -36px;
|
154 |
+
}
|
155 |
+
|
156 |
+
.fancybox-next span {
|
157 |
+
right: 10px;
|
158 |
+
background-position: 0 -72px;
|
159 |
+
}
|
160 |
+
|
161 |
+
.fancybox-nav:hover span {
|
162 |
+
visibility: visible;
|
163 |
+
}
|
164 |
+
|
165 |
+
.fancybox-tmp {
|
166 |
+
position: absolute;
|
167 |
+
top: -9999px;
|
168 |
+
left: -9999px;
|
169 |
+
visibility: hidden;
|
170 |
+
}
|
171 |
+
|
172 |
+
/* Overlay helper */
|
173 |
+
|
174 |
+
.fancybox-lock {
|
175 |
+
overflow: hidden;
|
176 |
+
}
|
177 |
+
|
178 |
+
.fancybox-overlay {
|
179 |
+
position: absolute;
|
180 |
+
top: 0;
|
181 |
+
left: 0;
|
182 |
+
overflow: hidden;
|
183 |
+
display: none;
|
184 |
+
z-index: 98010;
|
185 |
+
background: url('../images/fancybox_overlay.png');
|
186 |
+
}
|
187 |
+
|
188 |
+
.fancybox-overlay-fixed {
|
189 |
+
position: fixed;
|
190 |
+
bottom: 0;
|
191 |
+
right: 0;
|
192 |
+
}
|
193 |
+
|
194 |
+
.fancybox-lock .fancybox-overlay {
|
195 |
+
overflow: auto;
|
196 |
+
overflow-y: scroll;
|
197 |
+
}
|
198 |
+
|
199 |
+
/* Title helper */
|
200 |
+
|
201 |
+
.fancybox-title {
|
202 |
+
visibility: hidden;
|
203 |
+
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
204 |
+
position: relative;
|
205 |
+
text-shadow: none;
|
206 |
+
z-index: 98050;
|
207 |
+
/* top: 0;
|
208 |
+
bottom: auto; */
|
209 |
+
}
|
210 |
+
|
211 |
+
.fancybox-title-new {
|
212 |
+
position: absolute;
|
213 |
+
top: -36px;
|
214 |
+
left: 0;
|
215 |
+
visibility: hidden;
|
216 |
+
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
|
217 |
+
position: relative;
|
218 |
+
text-shadow: none;
|
219 |
+
z-index: 98050;
|
220 |
+
}
|
221 |
+
|
222 |
+
.fancybox-opened .fancybox-title {
|
223 |
+
visibility: visible;
|
224 |
+
}
|
225 |
+
|
226 |
+
.fancybox-title-float-wrap {
|
227 |
+
position: absolute;
|
228 |
+
bottom: 0;
|
229 |
+
right: 50%;
|
230 |
+
margin-bottom: -35px;
|
231 |
+
z-index: 98050;
|
232 |
+
text-align: center;
|
233 |
+
}
|
234 |
+
|
235 |
+
.fancybox-title-float-wrap-new {
|
236 |
+
position: absolute;
|
237 |
+
z-index: 98030;
|
238 |
+
}
|
239 |
+
|
240 |
+
.fancybox-title-float-wrap .child {
|
241 |
+
display: inline-block;
|
242 |
+
margin-right: -100%;
|
243 |
+
padding: 2px 20px;
|
244 |
+
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
|
245 |
+
background: rgba(0, 0, 0, 0.8);
|
246 |
+
-webkit-border-radius: 15px;
|
247 |
+
-moz-border-radius: 15px;
|
248 |
+
border-radius: 15px;
|
249 |
+
text-shadow: 0 1px 2px #222;
|
250 |
+
color: #FFF;
|
251 |
+
font-weight: bold;
|
252 |
+
line-height: 24px;
|
253 |
+
white-space: nowrap;
|
254 |
+
}
|
255 |
+
|
256 |
+
.fancybox-title-outside-wrap {
|
257 |
+
position: relative;
|
258 |
+
margin-top: 10px;
|
259 |
+
color: #fff;
|
260 |
+
}
|
261 |
+
|
262 |
+
.fancybox-title-inside-wrap {
|
263 |
+
padding-top: 10px;
|
264 |
+
}
|
265 |
+
|
266 |
+
.fancybox-title-over-wrap {
|
267 |
+
position: absolute;
|
268 |
+
bottom: 0;
|
269 |
+
left: 0;
|
270 |
+
color: #fff;
|
271 |
+
padding: 10px;
|
272 |
+
background: #000;
|
273 |
+
background: rgba(0, 0, 0, .8);
|
274 |
+
}
|
gmw-widget.php
CHANGED
@@ -28,6 +28,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
28 |
'lightbox_type' => 'roadmap',
|
29 |
'lightbox_zoom' => '14',
|
30 |
'lightbox_bubble' => '1',
|
|
|
|
|
31 |
'lightbox_header' => '',
|
32 |
'lightbox_footer' => ''));
|
33 |
|
@@ -46,6 +48,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
46 |
$lightbox_type = $instance['lightbox_type'];
|
47 |
$lightbox_zoom = $instance['lightbox_zoom'];
|
48 |
$lightbox_bubble = $instance['lightbox_bubble'];
|
|
|
|
|
49 |
|
50 |
$map_types_thumb = array(array('val' => 'roadmap', 'label' => 'Road'),
|
51 |
array('val' => 'satellite', 'label' => 'Satellite'),
|
@@ -78,6 +82,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
78 |
$zoom_levels[] = array('val' => $tmp, 'label' => $tmp);
|
79 |
}
|
80 |
$zoom_levels[] = array('val' => '21', 'label' => '21 - street view');
|
|
|
|
|
81 |
|
82 |
echo '<p><label for="' . $this->get_field_id('title') . '">Title:</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" /></p>';
|
83 |
echo '<p><label for="' . $this->get_field_id('address') . '">Address:</label><input class="widefat" id="' . $this->get_field_id('address') . '" name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" /></p>';
|
@@ -128,10 +134,19 @@ class GoogleMapsWidget extends WP_Widget {
|
|
128 |
GMW::create_select_options($zoom_levels, $lightbox_zoom);
|
129 |
echo '</select></p>';
|
130 |
|
|
|
|
|
|
|
|
|
|
|
131 |
echo '<p><label for="' . $this->get_field_id('lightbox_bubble') . '">Show Address Bubble: </label>';
|
132 |
echo '<input ' . checked('1', $lightbox_bubble, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_bubble') . '" name="' . $this->get_field_name('lightbox_bubble') . '">';
|
133 |
echo '</p>';
|
134 |
|
|
|
|
|
|
|
|
|
135 |
echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">Header Text:</label>';
|
136 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. $lightbox_header . '</textarea></p>';
|
137 |
|
@@ -140,6 +155,7 @@ class GoogleMapsWidget extends WP_Widget {
|
|
140 |
|
141 |
echo '</div>'; // lightbox tab
|
142 |
echo '</div>'; // tabs
|
|
|
143 |
}
|
144 |
|
145 |
function update($new_instance, $old_instance) {
|
@@ -157,7 +173,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
157 |
$instance['lightbox_type'] = $new_instance['lightbox_type'];
|
158 |
$instance['thumb_zoom'] = $new_instance['thumb_zoom'];
|
159 |
$instance['lightbox_zoom'] = $new_instance['lightbox_zoom'];
|
160 |
-
$instance['lightbox_bubble'] = (
|
|
|
161 |
$instance['lightbox_footer'] = $new_instance['lightbox_footer'];
|
162 |
$instance['lightbox_header'] = $new_instance['lightbox_header'];
|
163 |
|
@@ -168,7 +185,7 @@ class GoogleMapsWidget extends WP_Widget {
|
|
168 |
$out = $tmp = '';
|
169 |
|
170 |
extract($args, EXTR_SKIP);
|
171 |
-
self::$widgets[] = array('title' => $instance['title'],
|
172 |
'width' => $instance['lightbox_width'],
|
173 |
'height' => $instance['lightbox_height'],
|
174 |
'footer' => $instance['lightbox_footer'],
|
28 |
'lightbox_type' => 'roadmap',
|
29 |
'lightbox_zoom' => '14',
|
30 |
'lightbox_bubble' => '1',
|
31 |
+
'lightbox_skin' => '',
|
32 |
+
'lightbox_title' => '1',
|
33 |
'lightbox_header' => '',
|
34 |
'lightbox_footer' => ''));
|
35 |
|
48 |
$lightbox_type = $instance['lightbox_type'];
|
49 |
$lightbox_zoom = $instance['lightbox_zoom'];
|
50 |
$lightbox_bubble = $instance['lightbox_bubble'];
|
51 |
+
$lightbox_title = $instance['lightbox_title'];
|
52 |
+
$lightbox_skin = $instance['lightbox_skin'];
|
53 |
|
54 |
$map_types_thumb = array(array('val' => 'roadmap', 'label' => 'Road'),
|
55 |
array('val' => 'satellite', 'label' => 'Satellite'),
|
82 |
$zoom_levels[] = array('val' => $tmp, 'label' => $tmp);
|
83 |
}
|
84 |
$zoom_levels[] = array('val' => '21', 'label' => '21 - street view');
|
85 |
+
|
86 |
+
$lightbox_skins[] = array('val' => '', 'label' => 'Default');
|
87 |
|
88 |
echo '<p><label for="' . $this->get_field_id('title') . '">Title:</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" /></p>';
|
89 |
echo '<p><label for="' . $this->get_field_id('address') . '">Address:</label><input class="widefat" id="' . $this->get_field_id('address') . '" name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" /></p>';
|
134 |
GMW::create_select_options($zoom_levels, $lightbox_zoom);
|
135 |
echo '</select></p>';
|
136 |
|
137 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_skin') . '">Skin: </label>';
|
138 |
+
echo '<select id="' . $this->get_field_id('lightbox_skin') . '" name="' . $this->get_field_name('lightbox_skin') . '">';
|
139 |
+
GMW::create_select_options($lightbox_skins, $lightbox_skin);
|
140 |
+
echo '</select></p>';
|
141 |
+
|
142 |
echo '<p><label for="' . $this->get_field_id('lightbox_bubble') . '">Show Address Bubble: </label>';
|
143 |
echo '<input ' . checked('1', $lightbox_bubble, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_bubble') . '" name="' . $this->get_field_name('lightbox_bubble') . '">';
|
144 |
echo '</p>';
|
145 |
|
146 |
+
echo '<p><label for="' . $this->get_field_id('lightbox_title') . '">Show Title Below Lightbox: </label>';
|
147 |
+
echo '<input ' . checked('1', $lightbox_title, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_title') . '" name="' . $this->get_field_name('lightbox_title') . '">';
|
148 |
+
echo '</p>';
|
149 |
+
|
150 |
echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">Header Text:</label>';
|
151 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. $lightbox_header . '</textarea></p>';
|
152 |
|
155 |
|
156 |
echo '</div>'; // lightbox tab
|
157 |
echo '</div>'; // tabs
|
158 |
+
echo '<p><i>If you like the plugin give us a shout <a title="WebFactory on Twitter" target="_blank" href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>. Thanks!</i></p>';
|
159 |
}
|
160 |
|
161 |
function update($new_instance, $old_instance) {
|
173 |
$instance['lightbox_type'] = $new_instance['lightbox_type'];
|
174 |
$instance['thumb_zoom'] = $new_instance['thumb_zoom'];
|
175 |
$instance['lightbox_zoom'] = $new_instance['lightbox_zoom'];
|
176 |
+
$instance['lightbox_bubble'] = isset($new_instance['lightbox_bubble']);
|
177 |
+
$instance['lightbox_title'] = isset($new_instance['lightbox_title']);
|
178 |
$instance['lightbox_footer'] = $new_instance['lightbox_footer'];
|
179 |
$instance['lightbox_header'] = $new_instance['lightbox_header'];
|
180 |
|
185 |
$out = $tmp = '';
|
186 |
|
187 |
extract($args, EXTR_SKIP);
|
188 |
+
self::$widgets[] = array('title' => ($instance['lightbox_title']? $instance['title']: ''),
|
189 |
'width' => $instance['lightbox_width'],
|
190 |
'height' => $instance['lightbox_height'],
|
191 |
'footer' => $instance['lightbox_footer'],
|
google-maps-widget.php
CHANGED
@@ -4,7 +4,7 @@ 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.
|
8 |
Author URI: http://www.webfactoryltd.com/
|
9 |
*/
|
10 |
|
@@ -13,8 +13,10 @@ if (!function_exists('add_action')) {
|
|
13 |
die('Please don\'t open this file directly!');
|
14 |
}
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
|
19 |
class GMW {
|
20 |
function init() {
|
@@ -86,6 +88,8 @@ class GMW {
|
|
86 |
$widgets = GoogleMapsWidget::$widgets;
|
87 |
|
88 |
if (!$widgets) {
|
|
|
|
|
89 |
return;
|
90 |
}
|
91 |
|
@@ -95,13 +99,15 @@ class GMW {
|
|
95 |
} else {
|
96 |
$iwloc = 'near';
|
97 |
}
|
98 |
-
$
|
|
|
|
|
99 |
if ($widget['header']) {
|
100 |
-
$out .= '<div class="gmw-header"
|
101 |
}
|
102 |
$out .= '<div class="gmw-map"></div>';
|
103 |
if ($widget['footer']) {
|
104 |
-
$out .= '<div class="gmw-footer"
|
105 |
}
|
106 |
$out .= "</div>\n";
|
107 |
} // foreach $widgets
|
@@ -113,9 +119,9 @@ class GMW {
|
|
113 |
// enqueue frontend scripts if necessary
|
114 |
function enqueue_scripts() {
|
115 |
if (is_active_widget(false, false, 'googlemapswidget', true)) {
|
116 |
-
wp_enqueue_style('
|
117 |
-
wp_enqueue_script('
|
118 |
-
wp_enqueue_script('gmw', plugins_url('/js/gmw.js', __FILE__), array('jquery'),
|
119 |
}
|
120 |
} // enqueue_scripts
|
121 |
|
@@ -126,9 +132,9 @@ class GMW {
|
|
126 |
$plugin_url = plugin_dir_url(__FILE__);
|
127 |
|
128 |
wp_enqueue_script('jquery-ui-tabs');
|
129 |
-
wp_enqueue_script('sn-cookie', $plugin_url . 'js/jquery.cookie.js', array('jquery'),
|
130 |
-
wp_enqueue_script('gmw-admin', $plugin_url . 'js/gmw-admin.js', array(),
|
131 |
-
wp_enqueue_style('gmw-admin', $plugin_url . 'css/gmw-admin.css', array(),
|
132 |
} // if
|
133 |
} // admin_enqueue_scripts
|
134 |
|
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.3
|
8 |
Author URI: http://www.webfactoryltd.com/
|
9 |
*/
|
10 |
|
13 |
die('Please don\'t open this file directly!');
|
14 |
}
|
15 |
|
16 |
+
|
17 |
+
define('GMW_VER', '0.2');
|
18 |
+
require 'gmw-widget.php';
|
19 |
+
|
20 |
|
21 |
class GMW {
|
22 |
function init() {
|
88 |
$widgets = GoogleMapsWidget::$widgets;
|
89 |
|
90 |
if (!$widgets) {
|
91 |
+
wp_dequeue_script('gmw');
|
92 |
+
wp_dequeue_script('gmw-fancybox');
|
93 |
return;
|
94 |
}
|
95 |
|
99 |
} else {
|
100 |
$iwloc = 'near';
|
101 |
}
|
102 |
+
$map_url = 'http://maps.google.co.uk/maps?hl=en&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t=' . $widget['type'] . '&q=' . urlencode($widget['address']) . '&z=' . urlencode($widget['zoom']) . '';
|
103 |
+
|
104 |
+
$out .= '<div class="gmw-dialog" style="display: none;" data-map-height="' . $widget['height'] . '" data-map-width="' . $widget['width'] . '" data-iframe-url="' . $map_url . '" id="dialog-' . $widget['id'] . '" title="' . $widget['title'] . '">';
|
105 |
if ($widget['header']) {
|
106 |
+
$out .= '<div class="gmw-header"><i>' . do_shortcode($widget['header']) . '</i></div>';
|
107 |
}
|
108 |
$out .= '<div class="gmw-map"></div>';
|
109 |
if ($widget['footer']) {
|
110 |
+
$out .= '<div class="gmw-footer"><i>' . do_shortcode($widget['footer']) . '</i></div>';
|
111 |
}
|
112 |
$out .= "</div>\n";
|
113 |
} // foreach $widgets
|
119 |
// enqueue frontend scripts if necessary
|
120 |
function enqueue_scripts() {
|
121 |
if (is_active_widget(false, false, 'googlemapswidget', true)) {
|
122 |
+
wp_enqueue_style('gmw', plugins_url('/css/gmw.css', __FILE__), array(), GMW_VER);
|
123 |
+
wp_enqueue_script('gmw-fancybox', plugins_url('/js/jquery.fancybox.pack.js', __FILE__), array('jquery'), GMW_VER, true);
|
124 |
+
wp_enqueue_script('gmw', plugins_url('/js/gmw.js', __FILE__), array('jquery'), GMW_VER, true);
|
125 |
}
|
126 |
} // enqueue_scripts
|
127 |
|
132 |
$plugin_url = plugin_dir_url(__FILE__);
|
133 |
|
134 |
wp_enqueue_script('jquery-ui-tabs');
|
135 |
+
wp_enqueue_script('sn-cookie', $plugin_url . 'js/jquery.cookie.js', array('jquery'), GMW_VER, true);
|
136 |
+
wp_enqueue_script('gmw-admin', $plugin_url . 'js/gmw-admin.js', array(), GMW_VER, true);
|
137 |
+
wp_enqueue_style('gmw-admin', $plugin_url . 'css/gmw-admin.css', array(), GMW_VER);
|
138 |
} // if
|
139 |
} // admin_enqueue_scripts
|
140 |
|
images/blank.gif
ADDED
Binary file
|
images/fancybox_loading.gif
ADDED
Binary file
|
images/fancybox_overlay.png
ADDED
Binary file
|
images/fancybox_sprite.png
ADDED
Binary file
|
js/gmw.js
CHANGED
@@ -8,33 +8,14 @@ jQuery(function($) {
|
|
8 |
dialog = $($(this).attr('href'));
|
9 |
map_width = dialog.attr('data-map-width');
|
10 |
map_height = dialog.attr('data-map-height');
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
return false;
|
15 |
});
|
16 |
-
|
17 |
-
$('.gmw-dialog').dialog({ 'dialogClass': 'wp-dialog',
|
18 |
-
'modal': true,
|
19 |
-
'resizable': false,
|
20 |
-
'zIndex': 9999,
|
21 |
-
'hide': 'fade',
|
22 |
-
'open': function(event, ui) { renderMap(event, ui); fixDialogClose(event, ui); },
|
23 |
-
'show': 'fade',
|
24 |
-
'autoOpen': false,
|
25 |
-
'closeOnEscape': true
|
26 |
-
});
|
27 |
-
}); // onload
|
28 |
-
|
29 |
-
function renderMap(event, ui) {
|
30 |
-
dialog_id = '#' + event.target.id;
|
31 |
-
map_url = jQuery(dialog_id).attr('data-iframe-url');
|
32 |
-
map_width = jQuery(dialog_id).attr('data-map-width');
|
33 |
-
map_height = jQuery(dialog_id).attr('data-map-height');
|
34 |
-
|
35 |
-
jQuery('.gmw-map', dialog_id).html('<iframe width="' + map_width + '" height="' + map_height + '" src="' + map_url + '"></iframe>');
|
36 |
-
} // renderMap
|
37 |
-
|
38 |
-
function fixDialogClose(event, ui) {
|
39 |
-
jQuery('.ui-widget-overlay').on('click', function(){ jQuery('.gmw-dialog').dialog('close'); });
|
40 |
-
} // fixDialogClose
|
8 |
dialog = $($(this).attr('href'));
|
9 |
map_width = dialog.attr('data-map-width');
|
10 |
map_height = dialog.attr('data-map-height');
|
11 |
+
map_url = dialog.attr('data-iframe-url');
|
12 |
+
map_title = dialog.attr('title');
|
13 |
|
14 |
+
var content = $(dialog.html());
|
15 |
+
content.filter('.gmw-map').html('<iframe width="' + map_width + 'px" height="' + map_height + 'px" src="' + map_url + '"></iframe>');
|
16 |
+
|
17 |
+
$.fancybox( {'type': 'html', 'content': content, 'title': map_title, 'autoSize': true, 'minWidth': map_width, 'minHeight': map_height } );
|
18 |
|
19 |
return false;
|
20 |
});
|
21 |
+
}); // onload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/jquery.cookie.js
CHANGED
@@ -86,4 +86,4 @@ jQuery.cookie = function (key, value, options) {
|
|
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 |
-
};
|
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 |
+
};
|
js/jquery.fancybox.pack.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*! fancyBox v2.1.0 fancyapps.com | fancyapps.com/fancybox/#license */
|
2 |
+
(function(u,p,f,q){var o=f(u),n=f(p),b=f.fancybox=function(){b.open.apply(this,arguments)},z=null,m=p.createTouch!==q,x=function(a){return a&&a.hasOwnProperty&&a instanceof f},s=function(a){return a&&"string"===f.type(a)},C=function(a){return s(a)&&0<a.indexOf("%")},k=function(a,c){var e=parseInt(a,10);c&&C(a)&&(e*=b.getViewport()[c]/100);return Math.ceil(e)},v=function(a,b){return k(a,b)+"px"};f.extend(b,{version:"2.1.0",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,
|
3 |
+
maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!m,autoCenter:!m,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},
|
4 |
+
prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0"'+
|
5 |
+
(f.browser.msie?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",
|
6 |
+
openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{closeClick:!0,speedOut:200,showEarly:!0,css:{}},title:{type:"float"}},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},
|
7 |
+
group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,c){if(a&&(f.isPlainObject(c)||(c={}),!1!==b.close(!0)))return f.isArray(a)||(a=x(a)?f(a).get():[a]),f.each(a,function(e,d){var j={},g,h,i,l,k;"object"===f.type(d)&&(d.nodeType&&(d=f(d)),x(d)?(j={href:d.attr("href"),title:d.attr("title"),isDom:!0,element:d},f.metadata&&
|
8 |
+
f.extend(!0,j,d.metadata())):j=d);g=c.href||j.href||(s(d)?d:null);h=c.title!==q?c.title:j.title||"";l=(i=c.content||j.content)?"html":c.type||j.type;!l&&j.isDom&&(l=d.data("fancybox-type"),l||(l=(l=d.prop("class").match(/fancybox\.(\w+)/))?l[1]:null));if(s(g)&&(l||(b.isImage(g)?l="image":b.isSWF(g)?l="swf":"#"===g.charAt(0)?l="inline":s(d)&&(l="html",i=d)),"ajax"===l))k=g.split(/\s+/,2),g=k.shift(),k=k.shift();i||("inline"===l?g?i=f(s(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):j.isDom&&(i=d):"html"===l?
|
9 |
+
i=g:!l&&(!g&&j.isDom)&&(l="inline",i=d));f.extend(j,{href:g,type:l,content:i,title:h,selector:k});a[e]=j}),b.opts=f.extend(!0,{},b.defaults,c),c.keys!==q&&(b.opts.keys=c.keys?f.extend({},b.defaults.keys,c.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0).trigger("onReset").remove(),b.current||
|
10 |
+
b.trigger("afterClose"),b.coming=null)},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),"fixed"===b.wrap.css("position")&&b.wrap.css(b._getPosition(!0)),b.transitions[b.current.closeMethod]()))},play:function(a){var c=function(){clearTimeout(b.player.timer)},
|
11 |
+
e=function(){c();b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},d=function(){c();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":d,"beforeLoad.player":c}),e(),b.trigger("onPlayStart")}else d()},next:function(a){var c=b.current;
|
12 |
+
c&&(s(a)||(a=c.direction.next),b.jumpto(c.index+1,a,"next"))},prev:function(a){var c=b.current;c&&(s(a)||(a=c.direction.prev),b.jumpto(c.index-1,a,"prev"))},jumpto:function(a,c,e){var d=b.current;if(d&&(a=k(a),b.direction=c||d.direction[a>=d.index?"next":"prev"],b.router=e||"jumpto",d.loop&&(0>a&&(a=d.group.length+a%d.group.length),a%=d.group.length),d.group[a]!==q))b.cancel(),b._start(a)},reposition:function(a,c){var e;b.isOpen&&(e=b._getPosition(c),a&&"scroll"===a.type?(delete e.position,b.wrap.stop(!0,
|
13 |
+
!0).animate(e,200)):b.wrap.css(e))},update:function(a){var c=a&&a.type,e=!c||"orientationchange"===c;e&&(clearTimeout(z),z=null);if(b.isOpen&&!z){if(e||m)b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate");z=setTimeout(function(){var d=b.current;if(d){b.wrap.removeClass("fancybox-tmp");c!=="scroll"&&b._setDimension();c==="scroll"&&d.canShrink||b.reposition(a);b.trigger("onUpdate");z=null}},m?500:e?20:300)}},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?
|
14 |
+
a:!b.current.fitToView,b.update())},hideLoading:function(){n.unbind("keypress.fb");f("#fancybox-loading").remove()},showLoading:function(){var a,c;b.hideLoading();n.bind("keypress.fb",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");b.defaults.fixed||(c=b.getViewport(),a.css({position:"absolute",top:0.5*c.h+c.y,left:0.5*c.w+c.x}))},getViewport:function(){var a=b.current?b.current.locked:!1,
|
15 |
+
c={x:o.scrollLeft(),y:o.scrollTop()};a?(c.w=a[0].clientWidth,c.h=a[0].clientHeight):(c.w=m&&u.innerWidth?u.innerWidth:o.width(),c.h=m&&u.innerHeight?u.innerHeight:o.height());return c},unbindEvents:function(){b.wrap&&x(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");o.unbind(".fb")},bindEvents:function(){var a=b.current,c;a&&(o.bind("orientationchange.fb"+(m?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(c=a.keys)&&n.bind("keydown.fb",function(e){var d=e.which||e.keyCode,j=e.target||
|
16 |
+
e.srcElement;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!j||!j.type&&!f(j).is("[contenteditable]")))&&f.each(c,function(c,j){if(1<a.group.length&&j[d]!==q)return b[c](j[d]),e.preventDefault(),!1;if(-1<f.inArray(d,j))return b[c](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(c,d,j,g){for(var h=f(c.target||null),i=!1;h.length&&!i&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)i=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
|
17 |
+
(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==d&&!i&&1<b.group.length&&!a.canShrink){if(0<g||0<j)b.prev(0<g?"down":"left");else if(0>g||0>j)b.next(0>g?"up":"right");c.preventDefault()}}))},trigger:function(a,c){var e,d=c||b.coming||b.current;if(d){f.isFunction(d[a])&&(e=d[a].apply(d,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;"onCancel"===a&&!b.isOpened&&(b.isActive=!1);d.helpers&&f.each(d.helpers,
|
18 |
+
function(c,e){if(e&&b.helpers[c]&&f.isFunction(b.helpers[c][a]))b.helpers[c][a](e,d)});f.event.trigger(a+".fb")}},isImage:function(a){return s(a)&&a.match(/\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$/i)},isSWF:function(a){return s(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var c={},e,d,a=k(a);e=b.group[a]||null;if(!e)return!1;c=f.extend(!0,{},b.opts,e);e=c.margin;d=c.padding;"number"===f.type(e)&&(c.margin=[e,e,e,e]);"number"===f.type(d)&&(c.padding=[d,d,d,d]);c.modal&&f.extend(!0,c,
|
19 |
+
{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});c.autoSize&&(c.autoWidth=c.autoHeight=!0);"auto"===c.width&&(c.autoWidth=!0);"auto"===c.height&&(c.autoHeight=!0);c.group=b.group;c.index=a;b.coming=c;if(!1===b.trigger("beforeLoad"))b.coming=null;else{d=c.type;e=c.href;if(!d)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===d||"swf"===d)c.autoHeight=c.autoWidth=
|
20 |
+
!1,c.scrolling="visible";"image"===d&&(c.aspectRatio=!0);"iframe"===d&&m&&(c.scrolling="scroll");c.wrap=f(c.tpl.wrap).addClass("fancybox-"+(m?"mobile":"desktop")+" fancybox-type-"+d+" fancybox-tmp "+c.wrapCSS).appendTo(c.parent);f.extend(c,{skin:f(".fancybox-skin",c.wrap),outer:f(".fancybox-outer",c.wrap),inner:f(".fancybox-inner",c.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){c.skin.css("padding"+b,v(c.padding[a]))});b.trigger("onReady");if("inline"===d||"html"===d){if(!c.content||
|
21 |
+
!c.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===d?b._loadImage():"ajax"===d?b._loadAjax():"iframe"===d?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width;b.coming.height=this.height;
|
22 |
+
b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;(a.complete===q||!a.complete)&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(c,e){"success"===e&&(a.content=c,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,c=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",
|
23 |
+
m?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),c.one("load",function(){f(this).data("ready",1);m||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=c.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,c=b.current,
|
24 |
+
e=a.length,d=c.preload?Math.min(c.preload,e-1):0,f,g;for(g=1;g<=d;g+=1)f=a[(c.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,c=b.current,e,d,j,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,c))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{c&&(b.trigger("beforeChange",c),c.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove(),"fixed"===c.wrap.css("position")&&c.wrap.css(b._getPosition(!0)));
|
25 |
+
b.unbindEvents();e=a.content;d=a.type;j=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:c});g=a.href;switch(d){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):x(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
|
26 |
+
false)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e=e+('<param name="'+a+'" value="'+b+'"></param>');h=h+(" "+a+'="'+b+'"')}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!x(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
|
27 |
+
a.inner.css("overflow","yes"===j?"scroll":"no"===j?"hidden":j);b._setDimension();a.wrap.removeClass("fancybox-tmp");a.pos=f.extend({},a.dim,b._getPosition(!0));b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(c.prevMethod)b.transitions[c.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),c=0,e=!1,d=!1,e=b.wrap,j=b.skin,g=b.inner,h=
|
28 |
+
b.current,d=h.width,i=h.height,l=h.minWidth,t=h.minHeight,m=h.maxWidth,n=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,w=h.margin,o=w[1]+w[3],p=w[0]+w[2],x,r,u,A,y,D,z,B,E;e.add(j).add(g).width("auto").height("auto");w=j.outerWidth(!0)-j.width();x=j.outerHeight(!0)-j.height();r=o+w;u=p+x;A=C(d)?(a.w-r)*k(d)/100:d;y=C(i)?(a.h-u)*k(i)/100:i;if("iframe"===h.type){if(E=h.content,h.autoHeight&&1===E.data("ready"))try{E[0].contentWindow.document.location&&(g.width(A).height(9999),D=E.contents().find("body"),
|
29 |
+
q&&D.css("overflow-x","hidden"),y=D.height())}catch(F){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(A),h.autoHeight||g.height(y),h.autoWidth&&(A=g.width()),h.autoHeight&&(y=g.height()),g.removeClass("fancybox-tmp");d=k(A);i=k(y);B=A/y;l=k(C(l)?k(l,"w")-r:l);m=k(C(m)?k(m,"w")-r:m);t=k(C(t)?k(t,"h")-u:t);n=k(C(n)?k(n,"h")-u:n);D=m;z=n;o=a.w-o;p=a.h-p;if(h.aspectRatio){if(d>m&&(d=m,i=d/B),i>n&&(i=n,d=i*B),d<l&&(d=l,i=d/B),i<t)i=t,d=i*B}else d=Math.max(l,Math.min(d,
|
30 |
+
m)),i=Math.max(t,Math.min(i,n));if(h.fitToView)if(m=Math.min(a.w-r,m),n=Math.min(a.h-u,n),g.width(k(d)).height(k(i)),e.width(k(d+w)),a=e.width(),r=e.height(),h.aspectRatio)for(;(a>o||r>p)&&(d>l&&i>t)&&!(19<c++);)i=Math.max(t,Math.min(n,i-10)),d=i*B,d<l&&(d=l,i=d/B),d>m&&(d=m,i=d/B),g.width(k(d)).height(k(i)),e.width(k(d+w)),a=e.width(),r=e.height();else d=Math.max(l,Math.min(d,d-(a-o))),i=Math.max(t,Math.min(i,i-(r-p)));q&&("auto"===s&&i<y&&d+w+q<o)&&(d+=q);g.width(k(d)).height(k(i));e.width(k(d+
|
31 |
+
w));a=e.width();r=e.height();e=(a>o||r>p)&&d>l&&i>t;d=h.aspectRatio?d<D&&i<z&&d<A&&i<y:(d<D||i<z)&&(d<A||i<y);f.extend(h,{dim:{width:v(a),height:v(r)},origWidth:A,origHeight:y,canShrink:e,canExpand:d,wPadding:w,hPadding:x,wrapSpace:r-j.outerHeight(!0),skinSpace:j.height()-i});!E&&(h.autoHeight&&i>t&&i<n&&!d)&&g.height("auto")},_getPosition:function(a){var c=b.current,e=b.getViewport(),d=c.margin,f=b.wrap.width()+d[1]+d[3],g=b.wrap.height()+d[0]+d[2],d={position:"absolute",top:d[0],left:d[3]};c.autoCenter&&
|
32 |
+
c.fixed&&!a&&g<=e.h&&f<=e.w?d.position="fixed":c.locked||(d.top+=e.y,d.left+=e.x);d.top=v(Math.max(d.top,d.top+(e.h-g)*c.topRatio));d.left=v(Math.max(d.left,d.left+(e.w-f)*c.leftRatio));return d},_afterZoomIn:function(){var a=b.current;a&&((b.isOpen=b.isOpened=!0,b.wrap.addClass("fancybox-opened").css("overflow","visible"),b.reposition(),(a.closeClick||a.nextClick)&&b.inner.css("cursor","pointer").bind("click.fb",function(c){if(!f(c.target).is("a")&&!f(c.target).parent().is("a"))b[a.closeClick?"close":
|
33 |
+
"next"]()}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",b.close),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1)?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(){var a=b.current;f(".fancybox-wrap").stop(!0).trigger("onReset").remove();
|
34 |
+
f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,c=a.element,e=a.orig,d={},f=50,g=50,h=a.hPadding,i=a.wPadding,l=b.getViewport();!e&&(a.isDom&&c.is(":visible"))&&(e=c.find("img:first"),e.length||(e=c));x(e)?(d=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(d.top=l.y+(l.h-g)*a.topRatio,d.left=l.x+(l.w-f)*
|
35 |
+
a.leftRatio);a.locked&&(d.top-=l.y,d.left-=l.x);return d={top:v(d.top-h*a.topRatio),left:v(d.left-i*a.leftRatio),width:v(f+i),height:v(g+h)}},step:function(a,c){var e,d,f=c.prop;d=b.current;var g=d.wrapSpace,h=d.skinSpace;if("width"===f||"height"===f)e=c.end===c.start?1:(a-c.start)/(c.end-c.start),b.isClosing&&(e=1-e),d="width"===f?d.wPadding:d.hPadding,d=a-d,b.skin[f](k("width"===f?d:d-g*e)),b.inner[f](k("width"===f?d:d-g*e-h*e))},zoomIn:function(){var a=b.current,c=a.pos,e=a.openEffect,d="elastic"===
|
36 |
+
e,j=f.extend({opacity:1},c);delete j.position;d?(c=this.getOrigPosition(),a.openOpacity&&(c.opacity=0.1)):"fade"===e&&(c.opacity=0.1);b.wrap.css(c).animate(j,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:d?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,c=a.closeEffect,e="elastic"===c,d={opacity:0.1};e&&(d=this.getOrigPosition(),a.closeOpacity&&(d.opacity=0.1));b.wrap.animate(d,{duration:"none"===c?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,
|
37 |
+
complete:b._afterZoomOut})},changeIn:function(){var a=b.current,c=a.nextEffect,e=a.pos,d={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===c&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=v(k(e[g])-200),d[g]="+=200px"):(e[g]=v(k(e[g])+200),d[g]="-=200px"));"none"===c?b._afterZoomIn():b.wrap.css(e).animate(d,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,c=a.prevEffect,e={opacity:0.1},d=b.direction;"elastic"===c&&
|
38 |
+
(e["down"===d||"up"===d?"top":"left"]=("up"===d||"left"===d?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===c?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={overlay:null,update:function(){var a="100%",b;this.overlay.width(a).height("100%");f.browser.msie?(b=Math.max(p.documentElement.offsetWidth,p.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>o.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,
|
39 |
+
b){f(".fancybox-overlay").stop(!0,!0);this.overlay||f.extend(this,{overlay:f('<div class="fancybox-overlay"></div>').appendTo(b.parent),margin:n.height()>o.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,el:p.all&&!p.querySelector?f("html"):f("body")});b.fixed&&!m&&(this.overlay.addClass("fancybox-overlay-fixed"),b.autoCenter&&(this.overlay.append(b.wrap),b.locked=this.overlay));!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,c){var e=
|
40 |
+
this.overlay.unbind(".fb").width("auto").height("auto").css(a.css);a.closeClick&&e.bind("click.fb",function(a){f(a.target).hasClass("fancybox-overlay")&&b.close()});c.fixed&&!m?c.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",k(this.margin)+c.scrollbarWidth)):this.update();e.show()},onUpdate:function(a,b){(!b.fixed||m)&&this.update()},afterClose:function(a){var c=this,a=a.speedOut||0;c.overlay&&!b.isActive&&c.overlay.fadeOut(a||0,function(){f("body").css("margin-right",
|
41 |
+
c.margin);c.el.removeClass("fancybox-lock");c.overlay.remove();c.overlay=null})}};b.helpers.title={beforeShow:function(a){var c=b.current.title,e=a.type;if(s(c)&&""!==f.trim(c)){c=f('<div class="fancybox-title fancybox-title-'+e+'-wrap">'+c+"</div>");switch(e){case "inside":e=b.skin;break;case "outside":e=b.wrap;break;case "over":e=b.inner;break;default:e=b.skin,c.appendTo("body").width(c.width()).wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(k(c.css("margin-bottom")))}"top"===
|
42 |
+
a.position?c.prependTo(e):c.appendTo(e)}}};f.fn.fancybox=function(a){var c,e=f(this),d=this.selector||"",j=function(g){var h=f(this).blur(),i=c,j,k;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(j=a.groupAttr||"data-fancybox-group",k=h.attr(j),k||(j="rel",k=h.get(0)[j]),k&&(""!==k&&"nofollow"!==k)&&(h=d.length?f(d):e,h=h.filter("["+j+'="'+k+'"]'),i=h.index(this)),a.index=i,!1!==b.open(h,a)&&g.preventDefault())},a=a||{};c=a.index||0;!d||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",
|
43 |
+
j):n.undelegate(d,"click.fb-start").delegate(d+":not('.fancybox-item, .fancybox-nav')","click.fb-start",j);return this};n.ready(function(){f.scrollbarWidth===q&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===q){var a=f.support,c=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===c[0].offsetTop||
|
44 |
+
15===c[0].offsetTop;c.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);
|
readme.txt
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
=== Google Maps Widget ===
|
2 |
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¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
|
4 |
-
Tags: google maps, maps, gmaps, widget, lightbox, map, google map
|
5 |
License: GPLv2 or later
|
6 |
Requires at least: 3.2
|
7 |
Tested up to: 3.4.1
|
8 |
-
Stable tag: 0.
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
More features, videos and demos are coming
|
15 |
|
16 |
**General widget options**
|
17 |
|
@@ -32,17 +32,24 @@ More features, videos and demos are coming in a few days! Till then here's the w
|
|
32 |
* map type - road, satellite, map or hybrid
|
33 |
* zoom level
|
34 |
* show/hide address bubble
|
|
|
35 |
* header text
|
36 |
* footer text
|
37 |
|
38 |
-
There are no additional JS libraries included; GMW uses jQuery and jQuery UI Dialog bundled with WP. There are also no extra CSS files included. We do plan to add them in the future to provide map and dialog themes.
|
39 |
-
|
40 |
> If you need a Google Maps shortcode plugin you might be interested in purchasing our premium <a title="5sec Google Maps" href="http://5sec-gmap.webfactoryltd.com/">5sec Google Maps</a> plugin.
|
41 |
|
|
|
|
|
42 |
== Installation ==
|
43 |
|
44 |
Follow the usual routine;
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
1. Download the plugin.
|
47 |
2. Unzip it and upload to wp-content/plugin/
|
48 |
3. Open WP admin - Plugins and click "Activate" next to the plugin
|
@@ -69,6 +76,13 @@ If you can figure it out open a thread in the support forums.
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
= 0.22 =
|
73 |
* 2012/08/31
|
74 |
* Fixed small JS related GUI bug
|
@@ -102,7 +116,7 @@ If you can figure it out open a thread in the support forums.
|
|
102 |
== Upgrade Notice ==
|
103 |
|
104 |
= 0.2 =
|
105 |
-
Due to variable name
|
106 |
|
107 |
= 0.1x =
|
108 |
Upgrade without any fear :)
|
1 |
=== Google Maps Widget ===
|
2 |
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¤cy_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.4.1
|
8 |
+
Stable tag: 0.3
|
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 |
|
12 |
== Description ==
|
13 |
|
14 |
+
More features, videos and demos are coming up on a daily basis! Till then here are the widget's features. Give us a shout <a href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>.
|
15 |
|
16 |
**General widget options**
|
17 |
|
32 |
* map type - road, satellite, map or hybrid
|
33 |
* zoom level
|
34 |
* show/hide address bubble
|
35 |
+
* show/hide map title
|
36 |
* header text
|
37 |
* footer text
|
38 |
|
|
|
|
|
39 |
> If you need a Google Maps shortcode plugin you might be interested in purchasing our premium <a title="5sec Google Maps" href="http://5sec-gmap.webfactoryltd.com/">5sec Google Maps</a> plugin.
|
40 |
|
41 |
+
The plugin was voted on the <a href="http://themesplugins.com/Plugin-detail/google-maps-widget-google-map-free-plugin-for-wordpress/" title="Top 100 WordPressian plugin">Top 100 List</a> by WordPressian.
|
42 |
+
|
43 |
== Installation ==
|
44 |
|
45 |
Follow the usual routine;
|
46 |
|
47 |
+
1. Open WP admin - Plugins - Add New
|
48 |
+
2. Enter "Google Maps Widget" under search and hit Enter
|
49 |
+
3. Plugin will show up as the first on the list, click "Install Now"
|
50 |
+
|
51 |
+
Or if needed, upload manually;
|
52 |
+
|
53 |
1. Download the plugin.
|
54 |
2. Unzip it and upload to wp-content/plugin/
|
55 |
3. Open WP admin - Plugins and click "Activate" next to the plugin
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 0.3 =
|
80 |
+
* 2012/09/04
|
81 |
+
* lightbox script changed from jQuery UI Dialog to <a href="http://fancyapps.com/fancybox/">fancyBox2</a>
|
82 |
+
* added "show map title on lightbox" option
|
83 |
+
* significant speed improvements
|
84 |
+
* preparations for lightbox skins
|
85 |
+
|
86 |
= 0.22 =
|
87 |
* 2012/08/31
|
88 |
* Fixed small JS related GUI bug
|
116 |
== Upgrade Notice ==
|
117 |
|
118 |
= 0.2 =
|
119 |
+
Due to variable name changes footer text will be reset
|
120 |
|
121 |
= 0.1x =
|
122 |
Upgrade without any fear :)
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|