Google Reviews Widget - Version 1.5.3

Version Description

  • Bugfix: set charset collate for plugin's tables
  • Improve: extract inline init script of widget to separate js file (rplg.js), common for rich plugins
Download this release

Release Info

Developer widgetpack
Plugin Icon 128x128 Google Reviews Widget
Version 1.5.3
Comparing to
See all releases

Code changes from version 1.5.2 to 1.5.3

grw-options.php CHANGED
@@ -78,9 +78,9 @@
78
  </div>
79
  <div class="form-group">
80
  <div class="rplg-pro">
81
- <?php echo grw_i('These features available in Google Reviews Pro plugin: '); ?>
82
  <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
83
- <?php echo grw_i('Upgrade to Pro'); ?>
84
  </a>
85
  </div>
86
  </div>
@@ -156,9 +156,9 @@
156
  </div>
157
  <div class="form-group">
158
  <div class="rplg-pro">
159
- <?php echo grw_i('<b>Grid</b>, <b>Badge</b> themes and other features available in Google Reviews Pro plugin: '); ?>
160
  <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
161
- <?php echo grw_i('Upgrade to Pro'); ?>
162
  </a>
163
  </div>
164
  </div>
78
  </div>
79
  <div class="form-group">
80
  <div class="rplg-pro">
81
+ <?php echo grw_i('These features available in Google Reviews Business plugin: '); ?>
82
  <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
83
+ <?php echo grw_i('Upgrade to Business'); ?>
84
  </a>
85
  </div>
86
  </div>
156
  </div>
157
  <div class="form-group">
158
  <div class="rplg-pro">
159
+ <?php echo grw_i('<b>Grid</b>, <b>Badge</b> themes and other features available in Google Reviews Business plugin: '); ?>
160
  <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
161
+ <?php echo grw_i('Upgrade to Business'); ?>
162
  </a>
163
  </div>
164
  </div>
grw-reviews-helper.php CHANGED
@@ -123,24 +123,4 @@ function grw_trim_text($text, $size) {
123
  function grw_anchor($url, $class, $text, $open_link, $nofollow_link) {
124
  ?><a href="<?php echo $url; ?>" class="<?php echo $class; ?>" <?php if ($open_link) { ?>target="_blank"<?php } ?> <?php if ($nofollow_link) { ?>rel="nofollow"<?php } ?>><?php echo $text; ?></a><?php
125
  }
126
- ?>
127
- <script type="text/javascript">
128
- function grw_lang() {
129
- var n = navigator;
130
- return (n.language || n.systemLanguage || n.userLanguage || 'en').substr(0, 2).toLowerCase();
131
- }
132
- function grw_nextES(el) {
133
- do { el = el.nextSibling; } while (el && el.nodeType !== 1);
134
- return el;
135
- }
136
- function grw_next(el) {
137
- return el.nextElementSibling || grw_nextES(el);
138
- }
139
- document.addEventListener('DOMContentLoaded', function() {
140
- var reviewTimes = document.querySelectorAll('.wp-google-review .wp-google-time');
141
- for (var i = 0; i < reviewTimes.length; i++) {
142
- var time = reviewTimes[i].getAttribute('data-time');
143
- reviewTimes[i].innerHTML = WPacTime.getTime(parseInt(time) * 1000, grw_lang(), 'ago');
144
- }
145
- });
146
- </script>
123
  function grw_anchor($url, $class, $text, $open_link, $nofollow_link) {
124
  ?><a href="<?php echo $url; ?>" class="<?php echo $class; ?>" <?php if ($open_link) { ?>target="_blank"<?php } ?> <?php if ($nofollow_link) { ?>rel="nofollow"<?php } ?>><?php echo $text; ?></a><?php
125
  }
126
+ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
grw-reviews.php CHANGED
@@ -1,4 +1,7 @@
1
  <?php
 
 
 
2
  include_once(dirname(__FILE__) . '/grw-reviews-helper.php');
3
 
4
  $place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place_id));
1
  <?php
2
+ wp_register_script('rplg_js', plugins_url('/static/js/rplg.js', __FILE__));
3
+ wp_enqueue_script('rplg_js', plugins_url('/static/js/rplg.js', __FILE__));
4
+
5
  include_once(dirname(__FILE__) . '/grw-reviews-helper.php');
6
 
7
  $place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place_id));
grw-setting.php CHANGED
@@ -216,8 +216,8 @@ $grw_google_api_key = get_option('grw_google_api_key');
216
  </div>
217
  </div>
218
  <hr>
219
- <h4>Get More Features with Google Reviews Pro!</h4>
220
- <p><a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;">Upgrade to Google Reviews Pro or Business version</a></p>
221
  <p>* Trying to get more than 5 Google reviews</p>
222
  <p>* Google Rich Snippets (schema.org)</p>
223
  <p>* Support shortcode</p>
@@ -294,12 +294,12 @@ $grw_google_api_key = get_option('grw_google_api_key');
294
  </form>
295
  </div>
296
  <div role="tabpanel" class="tab-pane" id="mod">
297
- <h4><?php echo grw_i('Moderation available in Google Reviews Pro plugin:'); ?></h4>
298
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Pro'); ?></a>
299
  </div>
300
  <div role="tabpanel" class="tab-pane" id="shortcode">
301
- <h4><?php echo grw_i('Shortcode Builder available in Google Reviews Pro plugin:'); ?></h4>
302
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Pro'); ?></a>
303
  </div>
304
  </div>
305
  </div>
216
  </div>
217
  </div>
218
  <hr>
219
+ <h4>Get More Features with Google Reviews Business!</h4>
220
+ <p><a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;">Upgrade to Google Reviews Business</a></p>
221
  <p>* Trying to get more than 5 Google reviews</p>
222
  <p>* Google Rich Snippets (schema.org)</p>
223
  <p>* Support shortcode</p>
294
  </form>
295
  </div>
296
  <div role="tabpanel" class="tab-pane" id="mod">
297
+ <h4><?php echo grw_i('Moderation available in Google Reviews Business plugin:'); ?></h4>
298
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Business'); ?></a>
299
  </div>
300
  <div role="tabpanel" class="tab-pane" id="shortcode">
301
+ <h4><?php echo grw_i('Shortcode Builder available in Google Reviews Business plugin:'); ?></h4>
302
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Business'); ?></a>
303
  </div>
304
  </div>
305
  </div>
grw.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Reviews Widget
4
  Plugin URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
  Author: RichPlugins <support@richplugins.com>
7
- Version: 1.5.2
8
  Author URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
9
  */
10
 
@@ -13,7 +13,7 @@ require(ABSPATH . 'wp-includes/version.php');
13
  include_once(dirname(__FILE__) . '/api/urlopen.php');
14
  include_once(dirname(__FILE__) . '/helper/debug.php');
15
 
16
- define('GRW_VERSION', '1.5.2');
17
  define('GRW_GOOGLE_PLACE_API', 'https://maps.googleapis.com/maps/api/place/');
18
  define('GRW_GOOGLE_AVATAR', 'https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg');
19
  define('GRW_PLUGIN_URL', plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
@@ -96,6 +96,8 @@ function grw_install($allow_db_install=true) {
96
  function grw_install_db() {
97
  global $wpdb;
98
 
 
 
99
  $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_place (".
100
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
101
  "place_id VARCHAR(80) NOT NULL,".
@@ -109,7 +111,7 @@ function grw_install_db() {
109
  "updated BIGINT(20),".
110
  "PRIMARY KEY (`id`),".
111
  "UNIQUE INDEX grp_place_id (`place_id`)".
112
- ");");
113
 
114
  $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_review (".
115
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
@@ -125,7 +127,7 @@ function grw_install_db() {
125
  "PRIMARY KEY (`id`),".
126
  "UNIQUE INDEX grp_google_review_hash (`hash`),".
127
  "INDEX grp_google_place_id (`google_place_id`)".
128
- ");");
129
  }
130
 
131
  function grw_reset_db() {
@@ -240,7 +242,7 @@ function grw_save_reviews($place, $min_filter = 0) {
240
 
241
  $google_place_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place->place_id));
242
  if ($google_place_id) {
243
- $wpdb->update($wpdb->prefix . 'grp_google_place', array('rating' => $place->rating), array('ID' => $google_place_id));
244
  } else {
245
  $wpdb->insert($wpdb->prefix . 'grp_google_place', array(
246
  'place_id' => $place->place_id,
4
  Plugin URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
  Author: RichPlugins <support@richplugins.com>
7
+ Version: 1.5.3
8
  Author URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
9
  */
10
 
13
  include_once(dirname(__FILE__) . '/api/urlopen.php');
14
  include_once(dirname(__FILE__) . '/helper/debug.php');
15
 
16
+ define('GRW_VERSION', '1.5.3');
17
  define('GRW_GOOGLE_PLACE_API', 'https://maps.googleapis.com/maps/api/place/');
18
  define('GRW_GOOGLE_AVATAR', 'https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg');
19
  define('GRW_PLUGIN_URL', plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
96
  function grw_install_db() {
97
  global $wpdb;
98
 
99
+ $charset_collate = $wpdb->get_charset_collate();
100
+
101
  $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_place (".
102
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
103
  "place_id VARCHAR(80) NOT NULL,".
111
  "updated BIGINT(20),".
112
  "PRIMARY KEY (`id`),".
113
  "UNIQUE INDEX grp_place_id (`place_id`)".
114
+ ") " . $charset_collate . ";");
115
 
116
  $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_review (".
117
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
127
  "PRIMARY KEY (`id`),".
128
  "UNIQUE INDEX grp_google_review_hash (`hash`),".
129
  "INDEX grp_google_place_id (`google_place_id`)".
130
+ ") " . $charset_collate . ";");
131
  }
132
 
133
  function grw_reset_db() {
242
 
243
  $google_place_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place->place_id));
244
  if ($google_place_id) {
245
+ $wpdb->update($wpdb->prefix . 'grp_google_place', array('name' => $place->name, 'rating' => $place->rating), array('ID' => $google_place_id));
246
  } else {
247
  $wpdb->insert($wpdb->prefix . 'grp_google_place', array(
248
  'place_id' => $place->place_id,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://richplugins.com/google-reviews-pro-wordpress-plugin
4
  Tags: google, google reviews, google business reviews, google place review, Google Places, google places reviews, google review widget, google review, google map reviews, map reviews, review, reviews, google reviews widget, google plus reviews, g+ reviews, comment, comments, sidebar, widget, richplugins, facebook, facebook reviews, facebook page reviews, facebook business reviews, google reviews pro, yelp, yelp reviews, yelp business reviews
5
  Requires at least: 2.8
6
  Tested up to: 4.7
7
- Stable tag: 1.5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ Google Reviews Widget show Google Places Reviews on your WordPress website to in
12
 
13
  == Description ==
14
 
15
- > > To get more unique features we have <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin">Pro and Business version</a> plugin
16
 
17
  This plugin display Google Business Reviews on your websites in sidebar widget. A unique feature of the plugin is that it save all reviews in WordPress database and have no depend on any services like Google to show these reviews.
18
 
@@ -34,16 +34,16 @@ This plugin display Google Business Reviews on your websites in sidebar widget.
34
  * Zero load time regardless of your site
35
  * Works even if Google is unavailable
36
 
37
- = Get More Features with Google Reviews Pro! =
38
 
39
- [Upgrade to Google Reviews Pro](https://richplugins.com/google-reviews-pro-wordpress-plugin)
40
 
41
  * Trying to get more than 5 Google reviews
42
  * Google Rich Snippets (schema.org)
43
  * Support shortcode
44
  * Powerful <b>Shortcode Builder</b>
45
  * Grid theme to show G+ reviews in testimonials section
46
- * Google Trust Badge (right/left fixed or inner)
47
  * 'Write a review' button to available leave Google review directly on your website
48
  * Trim long reviews with "read more" link
49
  * Show/hide business photo and avatars
@@ -74,6 +74,10 @@ Why limit your reviews to just Google Reviews? Check out our other free business
74
 
75
  == Changelog ==
76
 
 
 
 
 
77
  = 1.5.2 =
78
  * Full refactoring of widget code
79
  * Bugfix: widget options check
4
  Tags: google, google reviews, google business reviews, google place review, Google Places, google places reviews, google review widget, google review, google map reviews, map reviews, review, reviews, google reviews widget, google plus reviews, g+ reviews, comment, comments, sidebar, widget, richplugins, facebook, facebook reviews, facebook page reviews, facebook business reviews, google reviews pro, yelp, yelp reviews, yelp business reviews
5
  Requires at least: 2.8
6
  Tested up to: 4.7
7
+ Stable tag: 1.5.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ > > To get more unique features we have <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin">Business version</a> of plugin
16
 
17
  This plugin display Google Business Reviews on your websites in sidebar widget. A unique feature of the plugin is that it save all reviews in WordPress database and have no depend on any services like Google to show these reviews.
18
 
34
  * Zero load time regardless of your site
35
  * Works even if Google is unavailable
36
 
37
+ = Get More Features with Google Reviews Business! =
38
 
39
+ [Upgrade to Google Reviews Business](https://richplugins.com/google-reviews-pro-wordpress-plugin)
40
 
41
  * Trying to get more than 5 Google reviews
42
  * Google Rich Snippets (schema.org)
43
  * Support shortcode
44
  * Powerful <b>Shortcode Builder</b>
45
  * Grid theme to show G+ reviews in testimonials section
46
+ * Google Trust Badge (right/left fixed or inner label)
47
  * 'Write a review' button to available leave Google review directly on your website
48
  * Trim long reviews with "read more" link
49
  * Show/hide business photo and avatars
74
 
75
  == Changelog ==
76
 
77
+ = 1.5.3 =
78
+ * Bugfix: set charset collate for plugin's tables
79
+ * Improve: extract inline init script of widget to separate js file (rplg.js), common for rich plugins
80
+
81
  = 1.5.2 =
82
  * Full refactoring of widget code
83
  * Bugfix: widget options check
static/css/google-review.css CHANGED
@@ -1 +1 @@
1
- .wpac,.wpac h1,.wpac h2,.wpac h3,.wpac h4,.wpac h5,.wpac h6,.wpac p,.wpac td,.wpac dl,.wpac tr,.wpac dt,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac table,.wpac th,.wpac tbody,.wpac tfoot,.wpac caption,.wpac thead,.wpac ul,.wpac li,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac li,.wpac strong,.wpac legend,.wpac em,.wpac s,.wpac cite,.wpac span,.wpac input,.wpac sup,.wpac label,.wpac dfn,.wpac object,.wpac big,.wpac q,.wpac font,.wpac samp,.wpac acronym,.wpac small,.wpac img,.wpac strike,.wpac code,.wpac sub,.wpac ins,.wpac textarea,.wpac var,.wpac a,.wpac abbr,.wpac applet,.wpac del,.wpac kbd,.wpac tt,.wpac b,.wpac i,.wpac hr{background-attachment:scroll!important;background-color:transparent!important;background-image:none!important;background-position:0 0!important;background-repeat:repeat!important;border-color:black!important;border-color:currentColor!important;border-radius:0!important;border-style:none!important;border-width:medium!important;bottom:auto!important;clear:none!important;clip:auto!important;color:inherit!important;counter-increment:none!important;counter-reset:none!important;cursor:auto!important;direction:inherit!important;display:inline;float:none!important;font-family:inherit!important;font-size:inherit!important;font-style:inherit!important;font-variant:normal!important;font-weight:inherit!important;height:auto;left:auto!important;letter-spacing:normal!important;line-height:inherit!important;list-style-type:inherit!important;list-style-position:outside!important;list-style-image:none!important;margin:0!important;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:1;outline:invert none medium!important;overflow:visible!important;padding:0!important;position:static!important;quotes:"" ""!important;right:auto!important;table-layout:auto!important;text-align:inherit!important;text-decoration:inherit!important;text-indent:0!important;text-transform:none!important;top:auto!important;unicode-bidi:normal!important;vertical-align:baseline!important;visibility:inherit!important;white-space:normal!important;width:auto!important;word-spacing:normal!important;z-index:auto!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;box-sizing:border-box!important;text-shadow:none!important;-webkit-transition:none!important;transition:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.wpac,.wpac h3,.wpac h5,.wpac p,.wpac h1,.wpac dl,.wpac dt,.wpac h6,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac h2,.wpac caption,.wpac h4,.wpac ul,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac textarea,.wpac hr{display:block}.wpac table{display:table}.wpac tbody{display:table-row-group}.wpac tr{display:table-row}.wpac td{display:table-cell}.wpac ul{list-style-type:none!important}.wpac li{display:list-item;min-height:auto!important;min-width:auto!important}.wpac a,.wpac a *,.wpac input[type=submit],.wpac input[type=radio],.wpac input[type=checkbox],.wpac select{cursor:pointer!important}.wpac a:hover{text-decoration:none!important}.wpac button,.wpac input[type=submit]{height:auto!important;text-align:center!important}.wpac input[type=hidden]{display:none}.wpac select{-webkit-appearance:menulist!important;-moz-appearance:menulist!important;appearance:menulist!important}.wpac input[type=checkbox]{-webkit-appearance:checkbox!important;-moz-appearance:checkbox!important;appearance:checkbox!important}.wpac input[type="checkbox"]:before,.wpac input[type="checkbox"]:after{content:none!important;border:0!important}.wpac input[type=radio]{-webkit-appearance:radio!important;-moz-appearance:radio!important;appearance:radio!important}.wpac input[type="radio"]:before,.wpac input[type="radio"]:after{content:none!important;border:0!important}.wpac li:before,.wpac li:after{content:""!important}.wpac input,.wpac select{vertical-align:middle!important}.wpac select,.wpac textarea,.wpac input{border:1px solid #ccc!important}.wpac table{border-collapse:collapse!important;border-spacing:0!important}.wpac *[dir=rtl]{direction:rtl!important}.wpac img{border:0!important}.wpac svg{vertical-align:middle!important;-moz-box-sizing:content-box!important;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.wpac{font-size:14px!important;line-height:20px!important;direction:ltr!important;text-align:left!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important;color:#333!important;font-style:normal!important;font-weight:normal!important;text-decoration:none!important;list-style-type:disc!important}.wpac .wp-sheet{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:1999999000!important;transition:all .2s ease-in-out!important}@media(max-width:460px){.wpac .wp-sheet{width:100%!important}}.wpac .wp-sheet-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:48px!important;background:#fff!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:1999999002!important}.wpac .wp-sheet-head-inner{position:absolute!important;left:20px!important;top:0!important;width:100%!important;height:100%!important;line-height:48px!important;z-index:1999999000!important}.wpac .wp-sheet-head-close{position:relative!important;height:49px!important;float:right!important;color:#aaa!important;font-size:28px!important;line-height:48px!important;margin:0 20px 0 15px!important;z-index:1999999001!important;transition:all .2s ease-in-out!important}.wpac .wp-sheet-head-close:hover{color:#555!important}.wpac .wp-sheet-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:1999999000!important}.wpac .wp-sheet-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;opacity:0!important;overflow-y:auto!important;z-index:1999999001!important;transition:all .2s ease-in-out!important;-webkit-transform:translateZ(0)!important}.wpac .wp-sheet-content.wp-sheet-ready{opacity:1.0!important}.wpac .wp-sheet-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wpac .wp-sheet-footer{position:absolute!important;bottom:0!important;right:0!important;left:1px!important;width:100%!important;z-index:1999999002!important;background:rgba(250,250,251,.98)!important}.wp-gr .wp-google-badge{display:inline-block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge-fixed{position:fixed!important;right:30px!important;bottom:30px!important;max-width:none!important;z-index:2147482999!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge *{cursor:pointer!important}.wp-gr .wp-google-border{width:100%!important;height:6px!important;background:#4fce6a!important;border-radius:2px 2px 0 0!important;}.wp-gr .wp-google-badge-btn{position:relative!important;padding:10px!important;background:#fff!important;transition:all .2s ease-in-out!important;border-radius:2px!important;}.wp-gr .wp-google-badge-btn:hover{background:#f3f3f5!important}.wp-gr .wp-google-logo{position:absolute!important;top:10px!important}.wp-gr .wp-google-badge-score{display:inline-block;margin:0 0 0 4px!important;vertical-align:middle!important;}.wp-gr .wp-google-rating{color:#e7711b!important;font-size:20px!important;margin:0 6px 0 0!important;vertical-align:middle!important}.wp-gr .wp-google-stars .wp-star{padding:0 4px 0 0!important;line-height:22px!important}.wp-gr .wp-google-powered{margin:6px 0 0!important}.wp-gr .wp-google-form .wp-google-reviews{padding:16px 16px 0!important}.wp-gr .wp-google-review{margin-top:15px!important}.wp-gr .wp-google-left{display:table-cell!important;padding-right:10px!important;vertical-align:top!important}.wp-gr .wp-google-left img{border:none!important;float:left!important;height:50px!important;width:50px!important;margin-right:5px!important;border-radius:50%!important}.wp-gr .wp-google-reviews img{border-radius:50%!important}.wp-gr .wp-google-right{display:table-cell!important;vertical-align:top!important;width:10000px!important}.wp-gr .wp-google-place .wp-star svg{width:18px!important;height:18px!important}.wp-gr .wp-google-review .wp-star svg{width:16px!important;height:16px!important}.wp-gr .wp-google-name{color:black!important;font-size:100%!important;font-weight:bold!important;margin:0 0 2px!important;padding-right:6px!important;text-decoration:none!important}.wp-gr a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr .wp-google-time{color:#999!important;font-size:13px!important}.wp-gr .wp-google-text{color:#222!important;font-size:13px!important;line-height:18px!important;max-width:100%!important;overflow:hidden!important;white-space:pre-wrap!important}.wp-gr .wp-google-text .wp-google-stars{padding-right:7px!important}.wp-gr .wp-more{display:none}.wp-gr .wp-more-toggle{color:#136aaf!important;cursor:pointer!important;text-decoration:underline!important}.wp-gr .wp-google-url{display:block;margin:10px 0!important;color:#2c7cff!important;text-align:center!important}.wp-gr .wp-google-form{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:2147483000!important}@media(max-width:460px){.wp-gr .wp-google-form{width:100%!important}}.wp-gr .wp-google-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:80px!important;background:#fff!important;padding:10px 16px!important;overflow:hidden!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:2147483002!important}.wp-gr .wp-google-head-inner{z-index:2147483000!important;position:absolute!important;left:20px!important;top:20px!important;width:100%!important;height:100%!important;pointer-events:none!important}.wp-gr .wp-google-close{padding:0!important;cursor:pointer!important;outline:0!important;border:0!important;background:0 0!important;min-height:0!important;width:auto!important;float:right!important;font-size:32px!important;font-weight:500!important;line-height:.6!important;color:#999!important;-webkit-appearance:none!important}.wp-gr .wp-google-close:hover{color:#555!important}.wp-gr .wp-google-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:2147483000!important}.wp-gr .wp-google-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;overflow-y:auto!important;z-index:2147483001!important;-webkit-transform:translateZ(0)!important}.wp-gr .wp-google-content{top:80px!important;bottom:48px!important}.wp-gr .wp-google-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wp-gr .wp-google-footer{position:absolute!important;bottom:0!important;right:0!important;width:100%!important;height:48px!important;text-align:center!important;z-index:2147483002!important;background:#fff!important;box-shadow:0 -1px 2px 0 rgba(0,0,0,.06)!important;-moz-text-align-last:center!important;text-align-last:center!important}.wp-gr .wp-google-footer img{float:right!important;padding:16px!important}.wp-gr .wp-dark .wp-google-name{color:#eee!important}.wp-gr .wp-dark .wp-google-time{color:#bbb!important}.wp-gr .wp-dark .wp-google-text{color:#ececec!important}.wp-gr.wpac .wp-google-name{font-size:100%!important}.wp-gr.wpac .wp-google-hide{display:none}.wp-gr.wpac .wp-google-name a{color:#333!important;font-size:100%!important;text-decoration:none!important}.wp-gr.wpac .wp-google-left img{width:50px!important;height:50px!important;border-radius:50%!important}.wp-gr.wpac a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr.wpac .wp-google-place .wp-star svg{width:18px;height:18px}.wp-gr.wpac .wp-google-review .wp-google-stars{display:inline-block;margin-right:4px!important}.wp-gr.wpac .wp-google-review .wp-star svg{width:16px;height:16px}.wp-gr.wpac .wp-dark .wp-google-name a{color:#eee!important}.wp-gr .wp-google-richsnippet{color:#999!important;font-size:12px!important;line-height:16px!important;margin-top:6px!important;border-top:1px solid #eee!important;padding-top:4px!important;}
1
+ .wpac,.wpac h1,.wpac h2,.wpac h3,.wpac h4,.wpac h5,.wpac h6,.wpac p,.wpac td,.wpac dl,.wpac tr,.wpac dt,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac table,.wpac th,.wpac tbody,.wpac tfoot,.wpac caption,.wpac thead,.wpac ul,.wpac li,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac li,.wpac strong,.wpac legend,.wpac em,.wpac s,.wpac cite,.wpac span,.wpac input,.wpac sup,.wpac label,.wpac dfn,.wpac object,.wpac big,.wpac q,.wpac font,.wpac samp,.wpac acronym,.wpac small,.wpac img,.wpac strike,.wpac code,.wpac sub,.wpac ins,.wpac textarea,.wpac var,.wpac a,.wpac abbr,.wpac applet,.wpac del,.wpac kbd,.wpac tt,.wpac b,.wpac i,.wpac hr{background-attachment:scroll!important;background-color:transparent!important;background-image:none!important;background-position:0 0!important;background-repeat:repeat!important;border-color:black!important;border-color:currentColor!important;border-radius:0!important;border-style:none!important;border-width:medium!important;bottom:auto!important;clear:none!important;clip:auto!important;color:inherit!important;counter-increment:none!important;counter-reset:none!important;cursor:auto!important;direction:inherit!important;display:inline;float:none!important;font-family:inherit!important;font-size:inherit!important;font-style:inherit!important;font-variant:normal!important;font-weight:inherit!important;height:auto;left:auto!important;letter-spacing:normal!important;line-height:inherit!important;list-style-type:inherit!important;list-style-position:outside!important;list-style-image:none!important;margin:0!important;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:1;outline:invert none medium!important;overflow:visible!important;padding:0!important;position:static!important;quotes:"" ""!important;right:auto!important;table-layout:auto!important;text-align:inherit!important;text-decoration:inherit!important;text-indent:0!important;text-transform:none!important;top:auto!important;unicode-bidi:normal!important;vertical-align:baseline!important;visibility:inherit!important;white-space:normal!important;width:auto!important;word-spacing:normal!important;z-index:auto!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;box-sizing:border-box!important;text-shadow:none!important;-webkit-transition:none!important;transition:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.wpac,.wpac h3,.wpac h5,.wpac p,.wpac h1,.wpac dl,.wpac dt,.wpac h6,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac h2,.wpac caption,.wpac h4,.wpac ul,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac textarea,.wpac hr{display:block}.wpac table{display:table}.wpac tbody{display:table-row-group}.wpac tr{display:table-row}.wpac td{display:table-cell}.wpac ul{list-style-type:none!important}.wpac li{display:list-item;min-height:auto!important;min-width:auto!important}.wpac a,.wpac a *,.wpac input[type=submit],.wpac input[type=radio],.wpac input[type=checkbox],.wpac select{cursor:pointer!important}.wpac a:hover{text-decoration:none!important}.wpac button,.wpac input[type=submit]{height:auto!important;text-align:center!important}.wpac input[type=hidden]{display:none}.wpac select{-webkit-appearance:menulist!important;-moz-appearance:menulist!important;appearance:menulist!important}.wpac input[type=checkbox]{-webkit-appearance:checkbox!important;-moz-appearance:checkbox!important;appearance:checkbox!important}.wpac input[type="checkbox"]:before,.wpac input[type="checkbox"]:after{content:none!important;border:0!important}.wpac input[type=radio]{-webkit-appearance:radio!important;-moz-appearance:radio!important;appearance:radio!important}.wpac input[type="radio"]:before,.wpac input[type="radio"]:after{content:none!important;border:0!important}.wpac li:before,.wpac li:after{content:""!important}.wpac input,.wpac select{vertical-align:middle!important}.wpac select,.wpac textarea,.wpac input{border:1px solid #ccc!important}.wpac table{border-collapse:collapse!important;border-spacing:0!important}.wpac *[dir=rtl]{direction:rtl!important}.wpac img{border:0!important}.wpac svg{vertical-align:middle!important;-moz-box-sizing:content-box!important;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.wpac{font-size:14px!important;line-height:20px!important;direction:ltr!important;text-align:left!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important;color:#333!important;font-style:normal!important;font-weight:normal!important;text-decoration:none!important;list-style-type:disc!important}.wpac .wp-sheet{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:1999999000!important;transition:all .2s ease-in-out!important}@media(max-width:460px){.wpac .wp-sheet{width:100%!important}}.wpac .wp-sheet-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:48px!important;background:#fff!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:1999999002!important}.wpac .wp-sheet-head-inner{position:absolute!important;left:20px!important;top:0!important;width:100%!important;height:100%!important;line-height:48px!important;z-index:1999999000!important}.wpac .wp-sheet-head-close{position:relative!important;height:49px!important;float:right!important;color:#aaa!important;font-size:28px!important;line-height:48px!important;margin:0 20px 0 15px!important;z-index:1999999001!important;transition:all .2s ease-in-out!important}.wpac .wp-sheet-head-close:hover{color:#555!important}.wpac .wp-sheet-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:1999999000!important}.wpac .wp-sheet-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;opacity:0!important;overflow-y:auto!important;z-index:1999999001!important;transition:all .2s ease-in-out!important;-webkit-transform:translateZ(0)!important}.wpac .wp-sheet-content.wp-sheet-ready{opacity:1.0!important}.wpac .wp-sheet-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wpac .wp-sheet-footer{position:absolute!important;bottom:0!important;right:0!important;left:1px!important;width:100%!important;z-index:1999999002!important;background:rgba(250,250,251,.98)!important}.wp-gr .wp-google-badge{display:inline-block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge-fixed{position:fixed!important;right:30px!important;bottom:30px!important;max-width:none!important;z-index:2147482999!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge_left-fixed{position:fixed!important;left:30px!important;bottom:30px!important;max-width:none!important;z-index:2147482999!important}.wp-gr .wp-google-badge *{cursor:pointer!important}.wp-gr .wp-google-border{width:100%!important;height:6px!important;background:#4fce6a!important;border-radius:2px 2px 0 0!important;}.wp-gr .wp-google-badge-btn{position:relative!important;padding:10px!important;background:#fff!important;transition:all .2s ease-in-out!important;border-radius:2px!important;}.wp-gr .wp-google-badge-btn:hover{background:#f3f3f5!important}.wp-gr .wp-google-logo{position:absolute!important;top:10px!important}.wp-gr .wp-google-badge-score{display:inline-block;margin:0 0 0 4px!important;vertical-align:middle!important;}.wp-gr .wp-google-rating{color:#e7711b!important;font-size:20px!important;margin:0 6px 0 0!important;vertical-align:middle!important}.wp-gr .wp-google-stars .wp-star{padding:0 4px 0 0!important;line-height:22px!important}.wp-gr .wp-google-powered{margin:6px 0 0!important}.wp-gr .wp-google-form .wp-google-reviews{padding:16px 16px 0!important}.wp-gr .wp-google-review{margin-top:15px!important}.wp-gr .wp-google-left{display:table-cell!important;padding-right:10px!important;vertical-align:top!important}.wp-gr .wp-google-left img{border:none!important;float:left!important;height:50px!important;width:50px!important;margin-right:5px!important;border-radius:50%!important}.wp-gr .wp-google-reviews img{border-radius:50%!important}.wp-gr .wp-google-right{display:table-cell!important;vertical-align:top!important;width:10000px!important}.wp-gr .wp-google-place .wp-star svg{width:18px!important;height:18px!important}.wp-gr .wp-google-review .wp-star svg{width:16px!important;height:16px!important}.wp-gr .wp-google-name{color:black!important;font-size:100%!important;font-weight:bold!important;margin:0 0 2px!important;padding-right:6px!important;text-decoration:none!important}.wp-gr a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr .wp-google-time{color:#999!important;font-size:13px!important}.wp-gr .wp-google-text{color:#222!important;font-size:13px!important;line-height:18px!important;max-width:100%!important;overflow:hidden!important;white-space:pre-wrap!important}.wp-gr .wp-google-text .wp-google-stars{padding-right:7px!important}.wp-gr .wp-more{display:none}.wp-gr .wp-more-toggle{color:#136aaf!important;cursor:pointer!important;text-decoration:underline!important}.wp-gr .wp-google-url{display:block;margin:10px 0!important;color:#2c7cff!important;text-align:center!important}.wp-gr .wp-google-form{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:2147483000!important}.wp-gr .wp-google-form.wp-google-form-left{left:0!important;}@media(max-width:460px){.wp-gr .wp-google-form{width:100%!important}}.wp-gr .wp-google-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:80px!important;background:#fff!important;padding:10px 16px!important;overflow:hidden!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:2147483002!important}.wp-gr .wp-google-head-inner{z-index:2147483000!important;position:absolute!important;left:20px!important;top:20px!important;width:100%!important;height:100%!important;pointer-events:none!important}.wp-gr .wp-google-close{padding:0!important;cursor:pointer!important;outline:0!important;border:0!important;background:0 0!important;min-height:0!important;width:auto!important;float:right!important;font-size:32px!important;font-weight:500!important;line-height:.6!important;color:#999!important;-webkit-appearance:none!important}.wp-gr .wp-google-close:hover{color:#555!important}.wp-gr .wp-google-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:2147483000!important}.wp-gr .wp-google-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;overflow-y:auto!important;z-index:2147483001!important;-webkit-transform:translateZ(0)!important}.wp-gr .wp-google-content{top:80px!important;bottom:48px!important}.wp-gr .wp-google-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wp-gr .wp-google-footer{position:absolute!important;bottom:0!important;right:0!important;width:100%!important;height:48px!important;text-align:center!important;z-index:2147483002!important;background:#fff!important;box-shadow:0 -1px 2px 0 rgba(0,0,0,.06)!important;-moz-text-align-last:center!important;text-align-last:center!important}.wp-gr .wp-google-footer img{float:right!important;padding:16px!important}.wp-gr .wp-dark .wp-google-name{color:#eee!important}.wp-gr .wp-dark .wp-google-time{color:#bbb!important}.wp-gr .wp-dark .wp-google-text{color:#ececec!important}.wp-gr.wpac .wp-google-name{font-size:100%!important}.wp-gr.wpac .wp-google-hide{display:none}.wp-gr.wpac .wp-google-name a{color:#333!important;font-size:100%!important;text-decoration:none!important}.wp-gr.wpac .wp-google-left img{width:50px!important;height:50px!important;border-radius:50%!important}.wp-gr.wpac a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr.wpac .wp-google-place .wp-star svg{width:18px;height:18px}.wp-gr.wpac .wp-google-review .wp-google-stars{display:inline-block;margin-right:4px!important}.wp-gr.wpac .wp-google-review .wp-star svg{width:16px;height:16px}.wp-gr.wpac .wp-dark .wp-google-name a{color:#eee!important}.wp-gr .wp-google-richsnippet{color:#999!important;font-size:12px!important;line-height:16px!important;margin-top:6px!important;border-top:1px solid #eee!important;padding-top:4px!important;}
static/css/grw-setting.css CHANGED
@@ -46,6 +46,14 @@ a:hover {
46
  background-color: #999;
47
  }
48
 
 
 
 
 
 
 
 
 
49
  .twitter > iframe {
50
  vertical-align: bottom !important;
51
  }
@@ -54,8 +62,7 @@ a:hover {
54
  vertical-align: bottom !important;
55
  }
56
 
57
- #grw-shortcode,
58
- #grw-mod-shortcode {
59
  width: 100%;
60
  overflow: auto;
61
  border: 0;
46
  background-color: #999;
47
  }
48
 
49
+ .version.pro {
50
+ background-color: #00bf54;
51
+ }
52
+
53
+ .version.business {
54
+ background-color: #2196f3;
55
+ }
56
+
57
  .twitter > iframe {
58
  vertical-align: bottom !important;
59
  }
62
  vertical-align: bottom !important;
63
  }
64
 
65
+ .grw-shortcode {
 
66
  width: 100%;
67
  overflow: auto;
68
  border: 0;
static/js/grw-finder.js CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  function grw_init(data) {
2
 
3
  var el = document.querySelector('#' + data.widgetId);
@@ -13,7 +16,7 @@ function grw_init(data) {
13
  }
14
 
15
  if (/^ChIJ.*$/.test(queryEl.value)) {
16
- jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
17
  placeid: queryEl.value,
18
  grw_wpnonce: jQuery('#grw_nonce').val()
19
  }, function(place) {
@@ -25,7 +28,134 @@ function grw_init(data) {
25
  return false;
26
  });
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  jQuery(document).ready(function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  $('.rplg-options-toggle', el).unbind('click').click(function () {
30
  $(this).toggleClass('toggled');
31
  $(this).next().slideToggle();
@@ -34,7 +164,7 @@ function grw_init(data) {
34
  }
35
 
36
  function grw_textsearch(el, query, cb) {
37
- jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_search', {
38
  query: query,
39
  grw_wpnonce: jQuery('#grw_nonce').val()
40
  }, function(places) {
@@ -60,7 +190,7 @@ function grw_addPlaces(el, places, cb) {
60
 
61
  if (places.length == 1) {
62
  placeEl.className = 'grw-place grw-active media';
63
- jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
64
  placeid: place.place_id,
65
  grw_wpnonce: jQuery('#grw_nonce').val()
66
  }, function(place) {
@@ -87,7 +217,7 @@ function grw_selectPlace(el, place_id, placeEl, cb) {
87
  WPacFastjs.remcl(activeEl, 'grw-active');
88
  WPacFastjs.addcl(placeEl, 'grw-active');
89
 
90
- jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
91
  placeid: place_id,
92
  grw_wpnonce: jQuery('#grw_nonce').val()
93
  }, function(place) {
@@ -132,7 +262,7 @@ function grw_saveReviews(el, place, cb) {
132
 
133
  WPacFastjs.on(saveBtn, 'click', function() {
134
  saveBtn.disabled = true;
135
- jQuery.post(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_save', {
136
  placeid: place.place_id,
137
  grw_wpnonce: jQuery('#grw_nonce').val()
138
  }, function(res) {
@@ -142,12 +272,9 @@ function grw_saveReviews(el, place, cb) {
142
  el.querySelector('.grw-google-place-name').value = place.name;
143
  el.querySelector('.grw-google-place-id').value = place.place_id;
144
 
145
- var insideEl = WPacFastjs.parents(el, 'widget-inside');
146
- if (insideEl) {
147
- var controlEl = insideEl.querySelector('.widget-control-actions');
148
- if (controlEl) {
149
- grw_show_tooltip(controlEl, 'Please don\'t forget to <b>Save</b> the widget.');
150
- }
151
  }
152
 
153
  cb && cb(el, place);
@@ -167,11 +294,11 @@ function grw_renderPlace(place) {
167
  '<span class="grw-grating">' + place.rating + '</span>' +
168
  '<span class="grw-gstars"></span>' +
169
  '</div>' +
170
- '<small class="text-muted">' + place.formatted_address + '</small>' +
171
  '</div>';
172
  }
173
 
174
- function grw_renderReview(review) {
175
  return '' +
176
  '<div class="media-left">' +
177
  '<img class="media-object" src="' + review.profile_photo_url + '" alt="' + review.author_name + '" ' +
@@ -185,6 +312,13 @@ function grw_renderReview(review) {
185
  '<div class="grw-gtext">' +
186
  '<span class="grw-gstars"></span> ' + grw_small_text(review.text) +
187
  '</div>' +
 
 
 
 
 
 
 
188
  '</div>';
189
  }
190
 
@@ -223,4 +357,8 @@ function grw_small_text(text) {
223
  'onclick="this.previousSibling.style=\'\';this.textContent=\'\';" ' +
224
  'style="color:#136aaf;cursor:pointer;text-decoration:underline">read more</span>' +
225
  '{{?}}'))(params);
 
 
 
 
226
  }
1
+ /*
2
+ * Init Google Places finder for Widget or Shortcode
3
+ */
4
  function grw_init(data) {
5
 
6
  var el = document.querySelector('#' + data.widgetId);
16
  }
17
 
18
  if (/^ChIJ.*$/.test(queryEl.value)) {
19
+ jQuery.get(grw_request_url('reviews'), {
20
  placeid: queryEl.value,
21
  grw_wpnonce: jQuery('#grw_nonce').val()
22
  }, function(place) {
28
  return false;
29
  });
30
 
31
+ grw_jquery_init(el, data.cb);
32
+ }
33
+
34
+ /*
35
+ * Init Google Places moderation
36
+ */
37
+ function grw_mod_init(data) {
38
+
39
+ var el = document.querySelector('#' + data.widgetId);
40
+ if (!el) return;
41
+
42
+ jQuery.get(grw_request_url('places'), {
43
+ grw_wpnonce: jQuery('#grw_nonce').val()
44
+ }, function(res) {
45
+
46
+ var placesEl = el.querySelector('.wp-places');
47
+ if (res.places.length < 1) {
48
+ placesEl.innerHTML = 'There are no Places yet';
49
+ return;
50
+ } else {
51
+ placesEl.innerHTML = '';
52
+ }
53
+
54
+ WPacFastjs.each(res.places, function(place) {
55
+ var placeEl = document.createElement('div');
56
+ placeEl.className = 'grw-place media';
57
+ placeEl.innerHTML = grw_renderPlace(place);
58
+ placeEl.title = place.formatted_address;
59
+ placesEl.appendChild(placeEl);
60
+
61
+ var stars = placeEl.querySelector('.grw-gstars');
62
+ stars.innerHTML = WPacStars.rating_render(place.rating, 14, 'e7711b');
63
+
64
+ WPacFastjs.on(placeEl, 'click', function() {
65
+ var activeEl = placeEl.parentNode.querySelector('.grw-active');
66
+ WPacFastjs.remcl(activeEl, 'grw-active');
67
+ WPacFastjs.addcl(placeEl, 'grw-active');
68
+
69
+ jQuery.get(grw_request_url('place_reviews'), {
70
+ google_place_id: place.id,
71
+ grw_wpnonce: jQuery('#grw_nonce').val()
72
+ }, function(res) {
73
+
74
+ var reviewsEl = el.querySelector('.wp-reviews');
75
+ if (res.reviews.length < 1) {
76
+ reviewsEl.innerHTML = 'There are no reviews yet for selected Place';
77
+ return;
78
+ } else {
79
+ reviewsEl.innerHTML = '';
80
+ }
81
+
82
+ el.querySelector('.grw-google-place-name').value = place.name;
83
+ el.querySelector('.grw-google-place-id').value = place.place_id;
84
+
85
+ WPacFastjs.show2(el.querySelector('#mod-reviews'));
86
+ WPacFastjs.show2(el.querySelector('#mod-shortcode-builder'));
87
+
88
+ data.cb && data.cb();
89
+
90
+ WPacFastjs.each(res.reviews, function(review) {
91
+ var reviewEl = document.createElement('div');
92
+ reviewEl.className = 'grw-place media';
93
+ reviewEl.innerHTML = grw_renderReview(review, true);
94
+ reviewsEl.appendChild(reviewEl);
95
+
96
+ var stars = reviewEl.querySelector('.grw-gstars');
97
+ stars.innerHTML = WPacStars.rating_render(review.rating, 14, 'e7711b');
98
+
99
+ WPacFastjs.on2(reviewEl, '.wp-google-delete', 'click', function() {
100
+ if (confirm('Are you sure to delete this review?')) {
101
+ jQuery.post(grw_request_url('delete_review'), {
102
+ google_review_id: review.id,
103
+ grw_wpnonce: jQuery('#grw_nonce').val()
104
+ }, function(res) {
105
+ if (res.status == 'success') {
106
+ WPacFastjs.rm(reviewEl);
107
+ }
108
+ }, 'json');
109
+ }
110
+ return false;
111
+ });
112
+ });
113
+
114
+ }, 'json');
115
+
116
+ return false;
117
+ });
118
+ });
119
+ }, 'json');
120
+
121
+ grw_jquery_init(el, data.cb);
122
+ }
123
+
124
+ /*
125
+ * Init photo upload link and options toggles
126
+ */
127
+ function grw_jquery_init(el, cb) {
128
+
129
  jQuery(document).ready(function($) {
130
+
131
+ var file_frame;
132
+ $('.grw-place-photo-btn', el).on('click', function(e) {
133
+ e.preventDefault();
134
+ if (file_frame) {
135
+ file_frame.open();
136
+ return;
137
+ }
138
+
139
+ file_frame = wp.media.frames.file_frame = wp.media({
140
+ title: $(this).data('uploader_title'),
141
+ button: {text: $(this).data('uploader_button_text')},
142
+ multiple: false
143
+ });
144
+
145
+ file_frame.on('select', function() {
146
+ var place_photo_hidden = $('.grw-place-photo', el),
147
+ place_photo_img = $('.grw-place-photo-img', el);
148
+ attachment = file_frame.state().get('selection').first().toJSON();
149
+ place_photo_hidden.val(attachment.url);
150
+ place_photo_img.attr('src', attachment.url);
151
+ place_photo_img.show();
152
+
153
+ cb && cb();
154
+ });
155
+ file_frame.open();
156
+ return false;
157
+ });
158
+
159
  $('.rplg-options-toggle', el).unbind('click').click(function () {
160
  $(this).toggleClass('toggled');
161
  $(this).next().slideToggle();
164
  }
165
 
166
  function grw_textsearch(el, query, cb) {
167
+ jQuery.get(grw_request_url('search'), {
168
  query: query,
169
  grw_wpnonce: jQuery('#grw_nonce').val()
170
  }, function(places) {
190
 
191
  if (places.length == 1) {
192
  placeEl.className = 'grw-place grw-active media';
193
+ jQuery.get(grw_request_url('reviews'), {
194
  placeid: place.place_id,
195
  grw_wpnonce: jQuery('#grw_nonce').val()
196
  }, function(place) {
217
  WPacFastjs.remcl(activeEl, 'grw-active');
218
  WPacFastjs.addcl(placeEl, 'grw-active');
219
 
220
+ jQuery.get(grw_request_url('reviews'), {
221
  placeid: place_id,
222
  grw_wpnonce: jQuery('#grw_nonce').val()
223
  }, function(place) {
262
 
263
  WPacFastjs.on(saveBtn, 'click', function() {
264
  saveBtn.disabled = true;
265
+ jQuery.post(grw_request_url('save'), {
266
  placeid: place.place_id,
267
  grw_wpnonce: jQuery('#grw_nonce').val()
268
  }, function(res) {
272
  el.querySelector('.grw-google-place-name').value = place.name;
273
  el.querySelector('.grw-google-place-id').value = place.place_id;
274
 
275
+ var controlEl = el.parentNode.parentNode.querySelector('.widget-control-actions');
276
+ if (controlEl) {
277
+ grw_show_tooltip(controlEl, 'Please don\'t forget to <b>Save</b> the widget.');
 
 
 
278
  }
279
 
280
  cb && cb(el, place);
294
  '<span class="grw-grating">' + place.rating + '</span>' +
295
  '<span class="grw-gstars"></span>' +
296
  '</div>' +
297
+ '<small class="text-muted">' + (place.formatted_address || place.address) + '</small>' +
298
  '</div>';
299
  }
300
 
301
+ function grw_renderReview(review, withDeleteBtn) {
302
  return '' +
303
  '<div class="media-left">' +
304
  '<img class="media-object" src="' + review.profile_photo_url + '" alt="' + review.author_name + '" ' +
312
  '<div class="grw-gtext">' +
313
  '<span class="grw-gstars"></span> ' + grw_small_text(review.text) +
314
  '</div>' +
315
+ (withDeleteBtn ?
316
+ '<a class="wp-google-delete" href="#">' +
317
+ '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="14" height="14" viewBox="0 0 1792 1792">' +
318
+ '<path d="M704 1376v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm256 0v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm256 0v-704q0-14-9-23t-23-9h-64q-14 0-23 9t-9 23v704q0 14 9 23t23 9h64q14 0 23-9t9-23zm-544-992h448l-48-117q-7-9-17-11h-317q-10 2-17 11zm928 32v64q0 14-9 23t-23 9h-96v948q0 83-47 143.5t-113 60.5h-832q-66 0-113-58.5t-47-141.5v-952h-96q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h309l70-167q15-37 54-63t79-26h320q40 0 79 26t54 63l70 167h309q14 0 23 9t9 23z" fill="#666"></path>' +
319
+ '</svg> ' +
320
+ 'Delete' +
321
+ '</a>' : '' ) +
322
  '</div>';
323
  }
324
 
357
  'onclick="this.previousSibling.style=\'\';this.textContent=\'\';" ' +
358
  'style="color:#136aaf;cursor:pointer;text-decoration:underline">read more</span>' +
359
  '{{?}}'))(params);
360
+ }
361
+
362
+ function grw_request_url(action) {
363
+ return grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_' + action + '&v=' + new Date().getTime();
364
  }
static/js/rplg.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function rplg_next_reviews(name, pagin) {
2
+ var parent = this.parentNode,
3
+ selector = '.wp-' + name + '-review.wp-' + name + '-hide';
4
+ reviews = parent.querySelectorAll(selector);
5
+ for (var i = 0; i < pagin && i < reviews.length; i++) {
6
+ reviews[i] && (reviews[i].className = reviews[i].className.replace('wp-' + name + '-hide', ' '));
7
+ }
8
+ reviews = parent.querySelectorAll(selector);
9
+ if (reviews.length < 1) {
10
+ parent.removeChild(this);
11
+ }
12
+ return false;
13
+ }
14
+
15
+ function rplg_leave_review_window() {
16
+ _rplg_popup(this.getAttribute('href'), 620, 500);
17
+ return false;
18
+ }
19
+
20
+ function _rplg_lang() {
21
+ var n = navigator;
22
+ return (n.language || n.systemLanguage || n.userLanguage || 'en').substr(0, 2).toLowerCase();
23
+ }
24
+
25
+ function _rplg_popup(url, width, height, prms, top, left) {
26
+ top = top || (screen.height/2)-(height/2);
27
+ left = left || (screen.width/2)-(width/2);
28
+ return window.open(url, '', 'location=1,status=1,resizable=yes,width='+width+',height='+height+',top='+top+',left='+left);
29
+ }
30
+
31
+ document.addEventListener('DOMContentLoaded', function() {
32
+ var reviewTimes = document.querySelectorAll('.wpac [data-time]');
33
+ for (var i = 0; i < reviewTimes.length; i++) {
34
+ var clss = reviewTimes[i].className, time;
35
+ if (clss.indexOf('google') > -1) {
36
+ time = parseInt(reviewTimes[i].getAttribute('data-time'));
37
+ time *= 1000;
38
+ } else if (clss.indexOf('facebook') > -1) {
39
+ time = new Date(reviewTimes[i].getAttribute('data-time').replace(/\+\d+$/, '')).getTime();
40
+ } else {
41
+ time = new Date(reviewTimes[i].getAttribute('data-time').replace(/ /, 'T')).getTime();
42
+ }
43
+ reviewTimes[i].innerHTML = WPacTime.getTime(time, _rplg_lang(), 'ago');
44
+ }
45
+ });