WordPress Share Buttons Plugin – AddThis - Version 3.0.3

Version Description

  • Bug fix: Style tags are now allowed in Custom Code box.
Download this release

Release Info

Developer srijith.v
Plugin Icon 128x128 WordPress Share Buttons Plugin – AddThis
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

addthis_post_metabox.php CHANGED
@@ -39,6 +39,7 @@ class addthis_post_metabox{
39
 
40
  function save_post($post_id)
41
  {
 
42
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
43
  return;
44
 
@@ -51,8 +52,9 @@ class addthis_post_metabox{
51
  }
52
  else
53
  {
 
54
  $custom_fields = get_post_custom($post_id);
55
- if (! isset ($custom_fields['addthis_exclude'][0]) )
56
  {
57
  add_post_meta($post_id, 'addthis_exclude', 'true');
58
  }
39
 
40
  function save_post($post_id)
41
  {
42
+ global $post;
43
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
44
  return;
45
 
52
  }
53
  else
54
  {
55
+ delete_post_meta($post_id, 'addthis_exclude');
56
  $custom_fields = get_post_custom($post_id);
57
+ if (! isset ($custom_fields['addthis_exclude'][0]) && ($post->post_type=="post") )
58
  {
59
  add_post_meta($post_id, 'addthis_exclude', 'true');
60
  }
addthis_settings_functions.php CHANGED
@@ -13,9 +13,9 @@ function _get_style_options()
13
  * AddThis replacement for kses
14
  *
15
  */
16
- function addthis_kses($string)
17
  {
18
- global $allowedposttags;
19
  $mytags = $allowedposttags;
20
  $mytags['a'][ 'gplusonesize' ] = array();
21
  $mytags['a'][ 'gplusonecount' ]= array();
@@ -60,7 +60,8 @@ function addthis_kses($string)
60
  $new_string = preg_replace( $post_pattern, $pretags, $new_temp_string);
61
  // Add in our %s so that the url and title get added properly
62
 
63
-
 
64
  return $new_string;
65
  }
66
  /**
13
  * AddThis replacement for kses
14
  *
15
  */
16
+ function addthis_kses($string, $customstyles)
17
  {
18
+ global $allowedposttags;
19
  $mytags = $allowedposttags;
20
  $mytags['a'][ 'gplusonesize' ] = array();
21
  $mytags['a'][ 'gplusonecount' ]= array();
60
  $new_string = preg_replace( $post_pattern, $pretags, $new_temp_string);
61
  // Add in our %s so that the url and title get added properly
62
 
63
+ $new_string = substr_replace($new_string, $customstyles, 4, 0);
64
+
65
  return $new_string;
66
  }
67
  /**
addthis_sidebar_widget.php CHANGED
@@ -41,7 +41,7 @@ class AddThisSidebarWidget extends WP_Widget {
41
  printf(apply_filters('addthis_sidebar_style_output', $addthis_new_styles[$instance['style']]['src']), '');
42
 
43
  echo $after_widget;
44
-
45
  }
46
 
47
  /**
41
  printf(apply_filters('addthis_sidebar_style_output', $addthis_new_styles[$instance['style']]['src']), '');
42
 
43
  echo $after_widget;
44
+ echo "<style type='text/css'>.addthis_toolbox, .addthis_button {float:left;width:100%;margin:0 0 15px 0;} .addthis_button_tweet {min-width: 83px;float:left;}</style>";
45
  }
46
 
47
  /**
addthis_social_widget.php CHANGED
@@ -23,7 +23,7 @@
23
  * Plugin Name: AddThis Social Bookmarking Widget
24
  * Plugin URI: http://www.addthis.com
25
  * Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
26
- * Version: 3.0.2
27
  *
28
  * Author: The AddThis Team
29
  * Author URI: http://www.addthis.com/blog
@@ -46,8 +46,8 @@ function addthis_early(){
46
 
47
 
48
  define( 'addthis_style_default' , 'fb_tw_p1_sc');
49
- define( 'ADDTHIS_PLUGIN_VERSION' , '3.0.2');
50
- define( 'ADDTHIS_PRODUCT_VERSION' , 'wpp-3.0.2');
51
  define( 'ADDTHIS_ATVERSION', '300');
52
  define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
53
  define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
@@ -82,9 +82,9 @@ $addthis_new_styles = array(
82
 
83
  'fb_tw_p1_sc' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>' , 'img' => 'horizontal_share_rect.png' , 'name' => 'Like, Tweet, +1, Share', 'above' => '', 'below' => ''
84
  ), // facebook tweet plus 1 share counter
85
- 'large_toolbox' => array( 'src' => '<div class="addthis_toolbox addthis_default_style addthis_32x32_style" %s ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>', 'img' => 'toolbox-large.png', 'name' => 'Large Toolbox', 'above' => 'hidden ', 'below' => 'hidden'
86
  ), // 32x32
87
- 'small_toolbox' => array( 'src' => '<div class="addthis_toolbox addthis_default_style addthis_" %s ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>', 'img' => 'toolbox-small.png', 'name' => 'Small Toolbox', 'above' => 'hidden ', 'below' => ''
88
  ), // 32x32
89
  'plus_one_share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style" %s ><a class="addthis_button_google_plusone" g:plusone:size="medium" ></a><a class="addthis_counter addthis_pill_style"></a></div>', 'img' => 'plusone-share.gif', 'name' => 'Plus One and Share Counter', 'above'=> 'hidden', 'below'=>'hidden' , 'defaultHide' => true
90
  ), // +1
@@ -394,6 +394,18 @@ function addthis_custom_toolbox($options, $url, $title)
394
  {
395
  $button .= '<a class="addthis_button_compact"></a>';
396
  }
 
 
 
 
 
 
 
 
 
 
 
 
397
 
398
  $button .= '</div>';
399
 
@@ -897,7 +909,13 @@ elseif ($data['above'] == 'custom_string')
897
  {
898
 
899
  $options['above'] = 'custom_string';
900
- $options['above_custom_string'] = addthis_kses($data['above_custom_string']);
 
 
 
 
 
 
901
 
902
  }
903
 
@@ -926,7 +944,13 @@ elseif ($data['below'] == 'custom')
926
  elseif ($data['below'] == 'custom_string')
927
  {
928
  $options['below'] = 'custom_string';
929
- $options['below_custom_string'] = addthis_kses($data['below_custom_string']);
 
 
 
 
 
 
930
  }
931
 
932
 
@@ -1986,7 +2010,7 @@ function addthis_plugin_options_php4() {
1986
  <th><h2>Display Options</h2></th>
1987
  </tr>
1988
  <tr valign="top">
1989
- <td colspan="2">For more details on the following options, see <a href="//addthis.com/customization">our customization documentation</a>.</td>
1990
  </tr>
1991
  <tr valign="top">
1992
  <th scope="row"><?php _e("Custom service list:", 'addthis_trans_domain' ); ?><br /><span class='description'><?php _e(
@@ -2059,11 +2083,13 @@ function addthis_plugin_options_php4() {
2059
  </tr>
2060
  <tr valign="top">
2061
  <th scope="row"><?php _e("addthis_config values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
2062
- <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_config_json]" /><?php echo $addthis_config_json; ?></textarea></td>
 
2063
  </tr>
2064
  <tr valign="top">
2065
  <th scope="row"><?php _e("addthis_share values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
2066
- <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_share_json]" /><?php echo $addthis_share_json; ?></textarea></td>
 
2067
  </tr>
2068
  </table>
2069
  <div class='clear'>&nbsp;</div>
@@ -2083,7 +2109,7 @@ function addthis_plugin_options_php4() {
2083
 
2084
 
2085
  ?>
2086
- <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" />
2087
  <a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview" id="preview" ><?php _e('Preview'); ?></a>
2088
  </p>
2089
 
23
  * Plugin Name: AddThis Social Bookmarking Widget
24
  * Plugin URI: http://www.addthis.com
25
  * Description: Help your visitor promote your site! The AddThis Social Bookmarking Widget allows any visitor to bookmark your site easily with many popular services. Sign up for an AddThis.com account to see how your visitors are sharing your content--which services they're using for sharing, which content is shared the most, and more. It's all free--even the pretty charts and graphs.
26
+ * Version: 3.0.3
27
  *
28
  * Author: The AddThis Team
29
  * Author URI: http://www.addthis.com/blog
46
 
47
 
48
  define( 'addthis_style_default' , 'fb_tw_p1_sc');
49
+ define( 'ADDTHIS_PLUGIN_VERSION' , '3.0.3');
50
+ define( 'ADDTHIS_PRODUCT_VERSION' , 'wpp-3.0.3');
51
  define( 'ADDTHIS_ATVERSION', '300');
52
  define( 'ADDTHIS_ATVERSION_MANUAL_UPDATE', -1);
53
  define( 'ADDTHIS_ATVERSION_AUTO_UPDATE', 0);
82
 
83
  'fb_tw_p1_sc' => array( 'src' => '<div class="addthis_toolbox addthis_default_style " %s ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>' , 'img' => 'horizontal_share_rect.png' , 'name' => 'Like, Tweet, +1, Share', 'above' => '', 'below' => ''
84
  ), // facebook tweet plus 1 share counter
85
+ 'large_toolbox' => array( 'src' => '<div class="addthis_toolbox addthis_default_style addthis_32x32_style" %s ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>', 'img' => 'toolbox-large.png', 'name' => 'Large Toolbox', 'above' => 'hidden ', 'below' => 'hidden'
86
  ), // 32x32
87
+ 'small_toolbox' => array( 'src' => '<div class="addthis_toolbox addthis_default_style addthis_" %s ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a><a class="addthis_counter addthis_bubble_style"></a></div>', 'img' => 'toolbox-small.png', 'name' => 'Small Toolbox', 'above' => 'hidden ', 'below' => ''
88
  ), // 32x32
89
  'plus_one_share_counter' => array( 'src' => '<div class="addthis_toolbox addthis_default_style" %s ><a class="addthis_button_google_plusone" g:plusone:size="medium" ></a><a class="addthis_counter addthis_pill_style"></a></div>', 'img' => 'plusone-share.gif', 'name' => 'Plus One and Share Counter', 'above'=> 'hidden', 'below'=>'hidden' , 'defaultHide' => true
90
  ), // +1
394
  {
395
  $button .= '<a class="addthis_button_compact"></a>';
396
  }
397
+
398
+ if (isset($options['counter']) && ($options['counter'] != "") && ($options['counter'] !== false))
399
+ {
400
+ if ($options['counter'] === true)
401
+ { //no style was specified
402
+ $button .= '<a class="addthis_counter"></a>';
403
+ }
404
+ else
405
+ { //a specific style was specified such as pill_style or bubble_style
406
+ $button .= '<a class="addthis_counter addthis_'.$options['counter'].'"></a>';
407
+ }
408
+ }
409
 
410
  $button .= '</div>';
411
 
909
  {
910
 
911
  $options['above'] = 'custom_string';
912
+ if (strpos($data['above_custom_string'], "style=") != false) {
913
+ $custom_style = explode('style=', $data['above_custom_string']);
914
+ $custom_style = explode('>', $custom_style[1]);
915
+ $custom_style = explode(' ', $custom_style[0]);
916
+ $above_custom_styles = " style=$custom_style[0]";
917
+ }
918
+ $options['above_custom_string'] = addthis_kses($data['above_custom_string'], $above_custom_styles);
919
 
920
  }
921
 
944
  elseif ($data['below'] == 'custom_string')
945
  {
946
  $options['below'] = 'custom_string';
947
+ if (strpos($data['below_custom_string'], "style=") != false) {
948
+ $custom_style = explode('style=', $data['below_custom_string']);
949
+ $custom_style = explode('>', $custom_style[1]);
950
+ $custom_style = explode(' ', $custom_style[0]);
951
+ $below_custom_styles = " style=$custom_style[0]";
952
+ }
953
+ $options['below_custom_string'] = addthis_kses($data['below_custom_string'], $below_custom_styles);
954
  }
955
 
956
 
2010
  <th><h2>Display Options</h2></th>
2011
  </tr>
2012
  <tr valign="top">
2013
+ <td colspan="2">For more details on the following options, see <a href="//support.addthis.com/customer/portal/articles/381263-addthis-client-api">our customization documentation</a>.</td>
2014
  </tr>
2015
  <tr valign="top">
2016
  <th scope="row"><?php _e("Custom service list:", 'addthis_trans_domain' ); ?><br /><span class='description'><?php _e(
2083
  </tr>
2084
  <tr valign="top">
2085
  <th scope="row"><?php _e("addthis_config values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
2086
+ <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_config_json]" id="addthis-config-json"/><?php echo $addthis_config_json; ?></textarea></td>
2087
+ <td id="config-error" style="display: none;color: red;float: left;margin-top: 25px;width: 150px;">Invalid JSON format</td>
2088
  </tr>
2089
  <tr valign="top">
2090
  <th scope="row"><?php _e("addthis_share values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain' ); ?></th>
2091
+ <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_share_json]" id="addthis-share-json" /><?php echo $addthis_share_json; ?></textarea></td>
2092
+ <td id="share-error" style="display: none;color: red;float: left;margin-top: 25px;width: 150px;">Invalid JSON format</td>
2093
  </tr>
2094
  </table>
2095
  <div class='clear'>&nbsp;</div>
2109
 
2110
 
2111
  ?>
2112
+ <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" id="submit-button"/>
2113
  <a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview" id="preview" ><?php _e('Preview'); ?></a>
2114
  </p>
2115
 
css/options-page.css CHANGED
@@ -10,6 +10,7 @@ h3.page-title {
10
  ul.nav-tab-wrapper {
11
  height: 57px;
12
  border-bottom: 1px solid #ccc;
 
13
  }
14
  ul.nav-tab-wrapper li:first-child {
15
  margin-left: 10px;
@@ -19,7 +20,7 @@ ul.nav-tab-wrapper li {
19
  border-bottom: none;
20
  padding: 14px 24px;
21
  margin: 0;
22
- border-bottom: 1px solid #CCCCCC;
23
  }
24
  ul.nav-tab-wrapper li a{
25
  text-decoration:none;
@@ -37,6 +38,7 @@ ul.nav-tab-wrapper li.ui-tabs-selected{
37
  border-right: 1px solid #ccc;
38
  border-bottom: 1px solid #fff;
39
  padding-bottom: 13px;
 
40
  }
41
  li.ui-tabs-active{
42
  -moz-border-radius: 5px 5px 0 0 !important;
10
  ul.nav-tab-wrapper {
11
  height: 57px;
12
  border-bottom: 1px solid #ccc;
13
+ margin-bottom: 0;
14
  }
15
  ul.nav-tab-wrapper li:first-child {
16
  margin-left: 10px;
20
  border-bottom: none;
21
  padding: 14px 24px;
22
  margin: 0;
23
+ /*border-bottom: 1px solid #CCCCCC;*/
24
  }
25
  ul.nav-tab-wrapper li a{
26
  text-decoration:none;
38
  border-right: 1px solid #ccc;
39
  border-bottom: 1px solid #fff;
40
  padding-bottom: 13px;
41
+ height: 29px;
42
  }
43
  li.ui-tabs-active{
44
  -moz-border-radius: 5px 5px 0 0 !important;
includes/addthis_addjs.php CHANGED
@@ -17,7 +17,8 @@ Class AddThis_addjs{
17
  'AddThis Social Bookmarking Widget' => array('http://wordpress.org/extend/plugins/addthis/', 'Share') ,
18
  'AddThis Follow Widget' => array('http://wordpress.org/extend/plugins/addthis-follow/', 'Follow'),
19
  // 'AddThis Trending Content Widget' => array('http://wordpress.org/extend/plugins/addthis-trending', 'Trending' ),
20
- 'AddThis Welcome Bar' => array('http://wordpress.org/extend/plugins/addthis-welcome/', 'Welcome'),
 
21
  );
22
  private $_atInstalled = array();
23
 
@@ -93,7 +94,12 @@ Class AddThis_addjs{
93
  $this->addWidgetToJs();
94
  $this->addAfterToJs();
95
  echo $this->jsToAdd;
 
96
  $this->_js_added = true;
 
 
 
 
97
  }
98
  }
99
 
@@ -124,7 +130,7 @@ Class AddThis_addjs{
124
  }
125
 
126
  function check_for_footer(){
127
- $url = home_url();
128
  $response = wp_remote_get( $url, array( 'sslverify' => false ) );
129
  $code = (int) wp_remote_retrieve_response_code( $response );
130
  if ( $code == 200 ) {
@@ -135,7 +141,10 @@ Class AddThis_addjs{
135
  }
136
 
137
  function maybe_add_footer_comment(){
138
- add_action( 'wp_footer', array($this, 'test_footer' ), 99999 ); // Some obscene priority, make sure we run last
 
 
 
139
  }
140
 
141
  function test_footer(){
@@ -148,7 +157,12 @@ Class AddThis_addjs{
148
  }
149
 
150
  function addAfterScript($newData){
151
- $this->jsAfterAdd .= $newData;
 
 
 
 
 
152
  }
153
 
154
  function addWidgetToJs(){
@@ -156,7 +170,7 @@ Class AddThis_addjs{
156
  }
157
 
158
  function addAfterToJs(){
159
- if (! empty($this->jsAfterAdd));
160
  $this->jsToAdd .= '<script type="text/javascript">' . $this->jsAfterAdd . '</script>';
161
  }
162
 
@@ -229,11 +243,8 @@ Class AddThis_addjs{
229
  else if ($i == ($count -2))
230
  $string .= ' and ';
231
  else if ($i == ($count -1))
232
- $string .= ' plugins available.';
233
-
234
  }
235
-
236
-
237
  }
238
 
239
  return '<p class="addthis_more_promo">' .$string . '</p>';
17
  'AddThis Social Bookmarking Widget' => array('http://wordpress.org/extend/plugins/addthis/', 'Share') ,
18
  'AddThis Follow Widget' => array('http://wordpress.org/extend/plugins/addthis-follow/', 'Follow'),
19
  // 'AddThis Trending Content Widget' => array('http://wordpress.org/extend/plugins/addthis-trending', 'Trending' ),
20
+ 'AddThis Welcome Bar' => array('http://wordpress.org/extend/plugins/addthis-welcome/', 'Welcome'),
21
+ 'AddThis Social Sign In' => array('http://wordpress.org/extend/plugins/addthis-social-sign-in/', 'SSI'),
22
  );
23
  private $_atInstalled = array();
24
 
94
  $this->addWidgetToJs();
95
  $this->addAfterToJs();
96
  echo $this->jsToAdd;
97
+ echo '<style type="text/css">.entry-content .addthis_toolbox {margin:0 0 10px 0;} .addthis_button_tweet {min-width: 83px;float:left;}</style>';
98
  $this->_js_added = true;
99
+ $this->jsToAdd = false;
100
+ } else {
101
+ $this->addAfterToJs();
102
+ echo $this->jsToAdd;
103
  }
104
  }
105
 
130
  }
131
 
132
  function check_for_footer(){
133
+ $url = add_query_arg( array( 'attest' => 'true') , get_option('home'));
134
  $response = wp_remote_get( $url, array( 'sslverify' => false ) );
135
  $code = (int) wp_remote_retrieve_response_code( $response );
136
  if ( $code == 200 ) {
141
  }
142
 
143
  function maybe_add_footer_comment(){
144
+ if ( $_GET['attest'] = 'true' )
145
+ {
146
+ add_action( 'wp_footer', array($this, 'test_footer' ), 99999 ); // Some obscene priority, make sure we run last
147
+ }
148
  }
149
 
150
  function test_footer(){
157
  }
158
 
159
  function addAfterScript($newData){
160
+ if ( $this->_js_added != true )
161
+ {
162
+ $this->jsAfterAdd .= $newData;
163
+ } else {
164
+ $this->jsAfterAdd = $newData;
165
+ }
166
  }
167
 
168
  function addWidgetToJs(){
170
  }
171
 
172
  function addAfterToJs(){
173
+ if (! empty($this->jsAfterAdd))
174
  $this->jsToAdd .= '<script type="text/javascript">' . $this->jsAfterAdd . '</script>';
175
  }
176
 
243
  else if ($i == ($count -2))
244
  $string .= ' and ';
245
  else if ($i == ($count -1))
246
+ $string .= ' plugins available.';
 
247
  }
 
 
248
  }
249
 
250
  return '<p class="addthis_more_promo">' .$string . '</p>';
js/options-page.32.js CHANGED
@@ -1,4 +1,6 @@
1
- jQuery(document).ready(function($) {
 
 
2
  $( "#tabs" ).tabs();
3
  var thickDims, tbWidth, tbHeight;
4
  thickDims = function() {
@@ -289,4 +291,74 @@ jQuery(document).ready(function($) {
289
  addthis_validation_message.next().hide();
290
  }
291
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  });
1
+ jQuery(document).ready(function($) {
2
+ $( "#config-error" ).hide();
3
+ $( "#share-error" ).hide();
4
  $( "#tabs" ).tabs();
5
  var thickDims, tbWidth, tbHeight;
6
  thickDims = function() {
291
  addthis_validation_message.next().hide();
292
  }
293
  });
294
+
295
+ $('#addthis-config-json').focusout(function() {
296
+ var error = 0;
297
+ if ($('#addthis-config-json').val() != " ") {
298
+ try {
299
+ var addthis_config_json = jQuery.parseJSON($('#addthis-config-json').val());
300
+ }
301
+ catch (e) {
302
+ error = 1;
303
+ }
304
+ }
305
+ if (error == 0) {
306
+ $('#config-error').hide();
307
+ return true;
308
+ }
309
+ else {
310
+ $('#config-error').show();
311
+ return false;
312
+ }
313
+ });
314
+
315
+ $('#addthis-share-json').focusout(function() {
316
+ var error = 0;
317
+ if ($('#addthis-share-json').val() != " ") {
318
+ try {
319
+ var addthis_share_json = jQuery.parseJSON($('#addthis-share-json').val());
320
+ }
321
+ catch (e) {
322
+ error = 1;
323
+ }
324
+ }
325
+ if (error == 0) {
326
+ $('#share-error').hide();
327
+ return true;
328
+ }
329
+ else {
330
+ $('#share-error').show();
331
+ return false;
332
+ }
333
+ });
334
+
335
+ $('#submit-button').click(function() {
336
+ $('#config-error').hide();
337
+ $('#share-error').hide();
338
+ var error = 0;
339
+ if ($('#addthis-config-json').val() != " ") {
340
+ try {
341
+ var addthis_config_json = jQuery.parseJSON($('#addthis-config-json').val());
342
+ }
343
+ catch (e) {
344
+ $('#config-error').show();
345
+ error = 1;
346
+ }
347
+ }
348
+ if ($('#addthis-share-json').val() != " ") {
349
+ try {
350
+ var addthis_share_json = jQuery.parseJSON($('#addthis-share-json').val());
351
+ }
352
+ catch (e) {
353
+ $('#share-error').show();
354
+ error = 1;
355
+ }
356
+ }
357
+ if (error == 0) {
358
+ return true;
359
+ }
360
+ else {
361
+ return false;
362
+ }
363
+ });
364
  });
js/options-page.js CHANGED
@@ -1,4 +1,6 @@
1
  jQuery(document).ready(function($) {
 
 
2
  $( "#tabs" ).tabs();
3
  var thickDims, tbWidth, tbHeight;
4
  thickDims = function() {
@@ -98,12 +100,12 @@ jQuery(document).ready(function($) {
98
 
99
  var show_above = $('input[name="addthis_settings[show_above]"]');
100
  var show_below = $('input[name="addthis_settings[show_below]"]');
101
- if ( show_above.prop('checked') != "undefined" && show_above.prop('checked') == true)
102
  {
103
  $('.above_option').toggleClass('hide');
104
  }
105
 
106
- if ( show_below.prop('checked') != "undefined" && show_below.prop('checked') == true)
107
  {
108
  $('.below_option').toggleClass('hide');
109
  }
@@ -119,7 +121,7 @@ jQuery(document).ready(function($) {
119
 
120
  var aboveCustom = $('#above_custom_button');
121
  var aboveCustomShow = function(){
122
- if ( aboveCustom.prop('checked') != 'undefined' && aboveCustom.prop('checked') == true)
123
  {
124
  $('.above_option_custom').removeClass('hidden');
125
  }
@@ -130,7 +132,7 @@ jQuery(document).ready(function($) {
130
  };
131
  var belowCustom = $('#below_custom_button');
132
  var belowCustomShow = function(){
133
- if ( belowCustom.prop('checked') != 'undefined' && belowCustom.prop('checked') == true)
134
  {
135
  $('.below_option_custom').removeClass('hidden');
136
  }
@@ -142,7 +144,7 @@ jQuery(document).ready(function($) {
142
 
143
  var aboveCustomString = $('#above_custom_string');
144
  var aboveCustomStringShow = function(){
145
- if ( aboveCustomString.prop('checked') != 'undefined' && aboveCustomString.prop('checked') == true)
146
  {
147
  $('.above_custom_string_input').removeClass('hidden');
148
  }
@@ -153,7 +155,7 @@ jQuery(document).ready(function($) {
153
  };
154
  var belowCustomString = $('#below_custom_string');
155
  var belowCustomStringShow = function(){
156
- if ( belowCustomString.attr('checked') != 'undefined' && belowCustomString.attr('checked') == true)
157
  {
158
  $('.below_custom_string_input').removeClass('hidden');
159
  }
@@ -289,4 +291,73 @@ jQuery(document).ready(function($) {
289
  addthis_validation_message.next().hide();
290
  }
291
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
  });
1
  jQuery(document).ready(function($) {
2
+ $( "#config-error" ).hide();
3
+ $( "#share-error" ).hide();
4
  $( "#tabs" ).tabs();
5
  var thickDims, tbWidth, tbHeight;
6
  thickDims = function() {
100
 
101
  var show_above = $('input[name="addthis_settings[show_above]"]');
102
  var show_below = $('input[name="addthis_settings[show_below]"]');
103
+ if ( $('#input[name="addthis_settings[show_above]"]').is(':checked'))
104
  {
105
  $('.above_option').toggleClass('hide');
106
  }
107
 
108
+ if ( $('#input[name="addthis_settings[show_below]"]').is(':checked'))
109
  {
110
  $('.below_option').toggleClass('hide');
111
  }
121
 
122
  var aboveCustom = $('#above_custom_button');
123
  var aboveCustomShow = function(){
124
+ if ( $('#above_custom_button').is(':checked'))
125
  {
126
  $('.above_option_custom').removeClass('hidden');
127
  }
132
  };
133
  var belowCustom = $('#below_custom_button');
134
  var belowCustomShow = function(){
135
+ if ( $('#below_custom_button').is(':checked'))
136
  {
137
  $('.below_option_custom').removeClass('hidden');
138
  }
144
 
145
  var aboveCustomString = $('#above_custom_string');
146
  var aboveCustomStringShow = function(){
147
+ if ( $('#above_custom_string').is(':checked'))
148
  {
149
  $('.above_custom_string_input').removeClass('hidden');
150
  }
155
  };
156
  var belowCustomString = $('#below_custom_string');
157
  var belowCustomStringShow = function(){
158
+ if ( $('#below_custom_string').is(':checked'))
159
  {
160
  $('.below_custom_string_input').removeClass('hidden');
161
  }
291
  addthis_validation_message.next().hide();
292
  }
293
  });
294
+
295
+ $('#addthis-config-json').focusout(function() {alert('ji');
296
+ var error = 0;
297
+ if ($('#addthis-config-json').val() != " ") {
298
+ try {
299
+ var addthis_config_json = jQuery.parseJSON($('#addthis-config-json').val());
300
+ }
301
+ catch (e) {
302
+ $('#config-error').show();
303
+ error = 1;
304
+ }
305
+ }
306
+ if (error == 0) {
307
+ return true;
308
+ }
309
+ else {
310
+ return false;
311
+ }
312
+ });
313
+
314
+ $('#addthis-share-json').focusout(function() {alert('hi');
315
+ var error = 0;
316
+ if ($('#addthis-share-json').val() != " ") {
317
+ try {
318
+ var addthis_share_json = jQuery.parseJSON($('#addthis-share-json').val());
319
+ }
320
+ catch (e) {
321
+ error = 1;
322
+ }
323
+ }
324
+ if (error == 0) {
325
+ $('#share-error').hide();
326
+ return true;
327
+ }
328
+ else {
329
+ $('#share-error').show();
330
+ return false;
331
+ }
332
+ });
333
+
334
+ $('#submit-button').click(function() {
335
+ $('#config-error').hide();
336
+ $('#share-error').hide();
337
+ var error = 0;
338
+ if ($('#addthis-config-json').val() != " ") {
339
+ try {
340
+ var addthis_config_json = jQuery.parseJSON($('#addthis-config-json').val());
341
+ }
342
+ catch (e) {
343
+ $('#config-error').show();
344
+ error = 1;
345
+ }
346
+ }
347
+ if ($('#addthis-share-json').val() != " ") {
348
+ try {
349
+ var addthis_share_json = jQuery.parseJSON($('#addthis-share-json').val());
350
+ }
351
+ catch (e) {
352
+ $('#share-error').show();
353
+ error = 1;
354
+ }
355
+ }
356
+ if (error == 0) {
357
+ return true;
358
+ }
359
+ else {
360
+ return false;
361
+ }
362
+ });
363
  });
readme.txt CHANGED
@@ -1,20 +1,18 @@
1
- === AddThis ===
2
  Contributors: srijith.v, solchea, jorbin, _mjk_, addthis_paul, joesullivan
3
  Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
- Stable tag: 3.0.2
7
 
8
- The AddThis Social Bookmarking Widget allows any visitor to bookmark and share your site easily with over 330 popular services.
9
 
10
  == Description ==
11
- Get more traffic back to your site by installing the AddThis WordPress plugin. With AddThis, your users can promote your content by sharing to 330 of the most popular social networking and bookmarking sites (like Facebook, Twitter, Digg, StumbleUpon and MySpace). We also support address bar sharing in modern browsers. Our button is small, unobtrusive, quick to load and recognized all over the web.
12
 
13
  Optionally, sign up for a free AddThis.com account to see how your visitors are sharing your content: which services they're using for sharing, which content is shared the most, and more.
14
 
15
- We also have plugins available for <a href='http://wordpress.org/extend/plugins/addthis-follow/'>increasing followers on social networks</a>, <a href='http://wordpress.org/extend/plugins/addthis-welcome/'>welcoming users based on social behavior</a>, and <a href='http://wordpress.org/extend/plugins/addthis-social-sign-in'>adding social authentication</a> to your WordPress blog.
16
-
17
- Help make AddThis even better by taking this <a href='http://www.surveymonkey.com/s/53FDFRF'>short customer survey.</a>
18
 
19
  <a href="http://www.addthis.com/blog">AddThis Blog</a> | <a href="http://www.addthis.com/privacy">Privacy Policy</a>
20
 
@@ -78,6 +76,9 @@ In the screen options you can enable the AddThis meta box. Check the box and sa
78
  PHP 5+ is preferred; PHP 4 is supported.
79
 
80
  == Changelog ==
 
 
 
81
  = 3.0.2 =
82
  * Bug fix: Conflict with WpSuperCache resolved
83
  * Wordpress 3.5 style conflicts resolved
@@ -215,6 +216,9 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
215
 
216
  == Upgrade Notice ==
217
 
 
 
 
218
  = 3.0.2 =
219
  Bug fixes.
220
 
1
+ === Share Buttons by AddThis ===
2
  Contributors: srijith.v, solchea, jorbin, _mjk_, addthis_paul, joesullivan
3
  Tags: share, addthis, social, bookmark, sharing, bookmarking, widget,AddThis, addtoany, aim, bookmark, buzz, del.icio.us, Digg,e-mail, email, Facebook, google bookmarks, google buzz, myspace,network, NewsVine, Reddit, Share, share this, sharethis, social, socialize, stumbleupon, twitter, windows live, yahoo buzz, pintrest, widget
4
  Requires at least: 2.9
5
  Tested up to: 3.5
6
+ Stable tag: 3.0.3
7
 
8
+ AddThis Share Buttons help drive traffic to your site by helping visitors share, bookmark and email your content to over 330 services.
9
 
10
  == Description ==
11
+ Get more traffic back to your site by installing the AddThis WordPress plugin. With AddThis, your users can promote your content by sharing to over 330 of the most popular social networking and bookmarking sites (like Facebook, Twitter, Pinterest, Google+ and LinkedIn). We also support address bar sharing in modern browsers. Our button is small, unobtrusive, quick to load and recognized all over the web.
12
 
13
  Optionally, sign up for a free AddThis.com account to see how your visitors are sharing your content: which services they're using for sharing, which content is shared the most, and more.
14
 
15
+ We also have plugins available for <a href='http://wordpress.org/extend/plugins/addthis-follow/'>increasing followers on social networks</a>, <a href='http://wordpress.org/extend/plugins/addthis-welcome/'>welcoming users based on social behavior</a>, <a href='http://wordpress.org/extend/plugins/addthis-social-sign-in'>adding social authentication</a> and <a href='http://wordpress.org/extend/plugins/addthis-trending-content/'>showing your trending content</a> to your WordPress blog.
 
 
16
 
17
  <a href="http://www.addthis.com/blog">AddThis Blog</a> | <a href="http://www.addthis.com/privacy">Privacy Policy</a>
18
 
76
  PHP 5+ is preferred; PHP 4 is supported.
77
 
78
  == Changelog ==
79
+ = 3.0.3 =
80
+ * Bug fix: Style tags are now allowed in Custom Code box.
81
+
82
  = 3.0.2 =
83
  * Bug fix: Conflict with WpSuperCache resolved
84
  * Wordpress 3.5 style conflicts resolved
216
 
217
  == Upgrade Notice ==
218
 
219
+ = 3.0.3 =
220
+ Bug fixes.
221
+
222
  = 3.0.2 =
223
  Bug fixes.
224