Hupso Share Buttons for Twitter, Facebook & Google+ - Version 3.9.14

Version Description

  • Color picker now supports touch devices
  • Fixed some strict PHP warnings
Download this release

Release Info

Developer kasal
Plugin Icon 128x128 Hupso Share Buttons for Twitter, Facebook & Google+
Version 3.9.14
Comparing to
See all releases

Code changes from version 3.9.13 to 3.9.14

js/jscolor/arrow.gif ADDED
Binary file
js/jscolor/cross.gif ADDED
Binary file
js/jscolor/hs.png ADDED
Binary file
js/jscolor/hv.png ADDED
Binary file
js/jscolor/jscolor.js CHANGED
@@ -1,11 +1,11 @@
1
  /**
2
  * jscolor, JavaScript Color Picker
3
  *
4
- * @version 1.4.0
5
  * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
  * @author Jan Odvarko, http://odvarko.cz
7
  * @created 2008-06-15
8
- * @updated 2012-07-06
9
  * @link http://jscolor.com
10
  */
11
 
@@ -318,10 +318,10 @@ var jscolor = {
318
  },
319
 
320
 
321
- /*
322
- * Usage example:
323
- * var myColor = new jscolor.color(myInputElement)
324
- */
325
 
326
  color : function(target, prop) {
327
 
@@ -627,6 +627,21 @@ var jscolor = {
627
  dispatchImmediateChange();
628
  }
629
  };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  p.padM.onmouseup =
631
  p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
632
  p.padM.onmousedown = function(e) {
@@ -635,17 +650,43 @@ var jscolor = {
635
  case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
636
  case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
637
  }
 
638
  holdPad=true;
639
  setPad(e);
640
  dispatchImmediateChange();
641
  };
 
 
 
 
 
 
 
 
 
 
 
 
642
  p.sldM.onmouseup =
643
  p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
644
  p.sldM.onmousedown = function(e) {
 
645
  holdSld=true;
646
  setSld(e);
647
  dispatchImmediateChange();
648
  };
 
 
 
 
 
 
 
 
 
 
 
 
649
 
650
  // picker
651
  var dims = getPickerDims(THIS);
@@ -896,7 +937,8 @@ var jscolor = {
896
  styleElement = jscolor.fetchElement(this.styleElement);
897
  var
898
  holdPad = false,
899
- holdSld = false;
 
900
  var
901
  leaveValue = 1<<0,
902
  leaveStyle = 1<<1,
1
  /**
2
  * jscolor, JavaScript Color Picker
3
  *
4
+ * @version 1.4.1
5
  * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
  * @author Jan Odvarko, http://odvarko.cz
7
  * @created 2008-06-15
8
+ * @updated 2013-04-08
9
  * @link http://jscolor.com
10
  */
11
 
318
  },
319
 
320
 
321
+ //
322
+ // Usage example:
323
+ // var myColor = new jscolor.color(myInputElement)
324
+ //
325
 
326
  color : function(target, prop) {
327
 
627
  dispatchImmediateChange();
628
  }
629
  };
630
+ if('ontouchstart' in window) { // if touch device
631
+ p.box.addEventListener('touchmove', function(e) {
632
+ var event={
633
+ 'offsetX': e.touches[0].pageX-touchOffset.X,
634
+ 'offsetY': e.touches[0].pageY-touchOffset.Y
635
+ };
636
+ if (holdPad || holdSld) {
637
+ holdPad && setPad(event);
638
+ holdSld && setSld(event);
639
+ dispatchImmediateChange();
640
+ }
641
+ e.stopPropagation(); // prevent move "view" on broswer
642
+ e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
643
+ }, false);
644
+ }
645
  p.padM.onmouseup =
646
  p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
647
  p.padM.onmousedown = function(e) {
650
  case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
651
  case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
652
  }
653
+ holdSld=false;
654
  holdPad=true;
655
  setPad(e);
656
  dispatchImmediateChange();
657
  };
658
+ if('ontouchstart' in window) {
659
+ p.padM.addEventListener('touchstart', function(e) {
660
+ touchOffset={
661
+ 'X': e.target.offsetParent.offsetLeft,
662
+ 'Y': e.target.offsetParent.offsetTop
663
+ };
664
+ this.onmousedown({
665
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
666
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
667
+ });
668
+ });
669
+ }
670
  p.sldM.onmouseup =
671
  p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
672
  p.sldM.onmousedown = function(e) {
673
+ holdPad=false;
674
  holdSld=true;
675
  setSld(e);
676
  dispatchImmediateChange();
677
  };
678
+ if('ontouchstart' in window) {
679
+ p.sldM.addEventListener('touchstart', function(e) {
680
+ touchOffset={
681
+ 'X': e.target.offsetParent.offsetLeft,
682
+ 'Y': e.target.offsetParent.offsetTop
683
+ };
684
+ this.onmousedown({
685
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
686
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
687
+ });
688
+ });
689
+ }
690
 
691
  // picker
692
  var dims = getPickerDims(THIS);
937
  styleElement = jscolor.fetchElement(this.styleElement);
938
  var
939
  holdPad = false,
940
+ holdSld = false,
941
+ touchOffset = {};
942
  var
943
  leaveValue = 1<<0,
944
  leaveStyle = 1<<1,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.hupso.com/
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
- Stable tag: 3.9.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -72,6 +72,14 @@ You can configure share buttons in plugin settings.
72
 
73
  From the Wordpress Administration click on "Settings" and then click on "Hupso Share Buttons".
74
 
 
 
 
 
 
 
 
 
75
  = How can I hide/show share buttons for specific posts? =
76
 
77
  You can hide share buttons for specific post using shortcode `[hupso_hide]`. Add `[hupso_hide]` anywhere in your post's text and buttons will be hidden.
@@ -182,7 +190,6 @@ Add this CSS to your style.css file:
182
  = How can I use counters under posts and share toolbar in sidebar? =
183
  You can use Hupso WP plugin for counters on top/bottom of every post and use raw HTML code for sidebar widget. Go to [Hupso Share Buttons homepage](http://www.hupso.com/share/) and generate HTML code for share buttons. In WP admin, go to Appearance->Widgets and create new text widget (drag and drop it to sidebar) and paste HTML code inside it.
184
 
185
-
186
  = How can I show share buttons inside template files? =
187
 
188
  Add this PHP code inside template files at position where you want to show share buttons: `echo do_shortcode('[hupso]');`
@@ -228,14 +235,6 @@ From Settings screen you are able to choose: button type (share button, share to
228
 
229
  Please look at *Screenshots* for more information.
230
 
231
- = Are share buttons using Javascript? =
232
-
233
- Yes. Javascript is required for sharing buttons to function properly and it must be enabled. Menu/toolbar/preview interface for share buttons is loaded at run-time from our servers so we can add minor enhancements and fix browser bugs the moment they are discovered without forcing you to upgrade the plugin all the time. Some button images are loaded from your local Wordpress installation and some from our servers. Counters load javascript code from Twitter, Facebook, Google, Linkedin, Pinterest or from other social services that are selected.
234
-
235
- = Are share buttons free? =
236
-
237
- Yes. Thay are free and will always be free. And you do not need to open any account to use them.
238
-
239
  = When will floating toolbars be available? =
240
 
241
  [Hupso Share Buttons](http://www.hupso.com/share/) provide other button types including floating toolbars. We plan to implement those in next versions of this plugin.
@@ -266,6 +265,10 @@ Please send bug reports and suggestion using [this feedback form](http://www.hup
266
 
267
  == Changelog ==
268
 
 
 
 
 
269
  = 3.9.13 =
270
  * Bugfix for excerpts
271
 
4
  Tags: twitter, facebook, google, social sharing, share buttons, social share buttons, share icons, stumbleupon, addthis, sharethis, sexybookmarks, addtoany
5
  Requires at least: 2.8
6
  Tested up to: 3.5.1
7
+ Stable tag: 3.9.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
72
 
73
  From the Wordpress Administration click on "Settings" and then click on "Hupso Share Buttons".
74
 
75
+ = Are share buttons free? =
76
+
77
+ Yes. Thay are free and will always be free. And you do not need to open any account to use them.
78
+
79
+ = Are share buttons using Javascript? =
80
+
81
+ Yes. Javascript is required for sharing buttons to function properly and it must be enabled. Counters load javascript code from Twitter, Facebook, Google, Linkedin, Pinterest or from other social services that are selected. Interface for share buttons is loaded from our servers via javascript at run-time. This enables us to add minor enhancements and fix browser bugs the moment they are discovered without forcing you to upgrade the plugin all the time. Some button images are loaded from your local Wordpress installation and some from our servers.
82
+
83
  = How can I hide/show share buttons for specific posts? =
84
 
85
  You can hide share buttons for specific post using shortcode `[hupso_hide]`. Add `[hupso_hide]` anywhere in your post's text and buttons will be hidden.
190
  = How can I use counters under posts and share toolbar in sidebar? =
191
  You can use Hupso WP plugin for counters on top/bottom of every post and use raw HTML code for sidebar widget. Go to [Hupso Share Buttons homepage](http://www.hupso.com/share/) and generate HTML code for share buttons. In WP admin, go to Appearance->Widgets and create new text widget (drag and drop it to sidebar) and paste HTML code inside it.
192
 
 
193
  = How can I show share buttons inside template files? =
194
 
195
  Add this PHP code inside template files at position where you want to show share buttons: `echo do_shortcode('[hupso]');`
235
 
236
  Please look at *Screenshots* for more information.
237
 
 
 
 
 
 
 
 
 
238
  = When will floating toolbars be available? =
239
 
240
  [Hupso Share Buttons](http://www.hupso.com/share/) provide other button types including floating toolbars. We plan to implement those in next versions of this plugin.
265
 
266
  == Changelog ==
267
 
268
+ = 3.9.14 =
269
+ * Color picker now supports touch devices
270
+ * Fixed some strict PHP warnings
271
+
272
  = 3.9.13 =
273
  * Bugfix for excerpts
274
 
share-buttons-hupso.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
- Version: 3.9.13
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,7 +12,7 @@ Domain Path: /languages
12
  */
13
 
14
  global $HUPSO_VERSION;
15
- $HUPSO_VERSION = '3.9.13';
16
 
17
  $hupso_dev = '';
18
  $hupso_state = 'normal';
@@ -199,7 +199,7 @@ function hupso_set_facebook_thumbnail() {
199
  $thumb_image = get_header_image();
200
  break;
201
  case 'featured':
202
- if ( ( function_exists('has_post_thumbnail') ) && ( has_post_thumbnail( $post->ID ) ) ) {
203
  $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
204
  $thumb_image = $thumb_image_temp[0];
205
  }
@@ -211,7 +211,7 @@ function hupso_set_facebook_thumbnail() {
211
  $thumb_image = '';
212
  break;
213
  case 'fch': /* featured, custom, header */
214
- if ( ( function_exists('has_post_thumbnail') ) && ( has_post_thumbnail( $post->ID ) ) ) {
215
  $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
216
  $thumb_image = $thumb_image_temp[0];
217
  break;
@@ -945,7 +945,7 @@ function hupso_admin_settings_save() {
945
  }
946
  $b_size = str_replace( 'button', '', $hupso_button_size);
947
  if ($b_size != 'custom') {
948
- list($width, $height) = split('x', $b_size);
949
  }
950
 
951
  /* save share button custom URL */
@@ -1217,7 +1217,7 @@ function hupso_the_content( $content ) {
1217
  }
1218
 
1219
  /* Do not show share buttons on password protected pages, but show it inside widget */
1220
- $pass = $GLOBALS['post']->post_password;
1221
  $hupso_password_protected = get_option( 'hupso_password_protected', '0');
1222
  if ( $hupso_state == 'normal' ) {
1223
  if ($pass != '') {
@@ -1291,8 +1291,8 @@ function hupso_the_content( $content ) {
1291
  $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
1292
  $hupso_counters_lang = get_option( 'hupso_counters_lang', 'en_US' );
1293
 
1294
- $post_url = get_permalink($GLOBALS['post']->ID);
1295
- $post_title = @$GLOBALS['post']->post_title;
1296
 
1297
  if ( ( $hupso_state == 'widget' ) || ( $hupso_state == 'shortcodes' ) ) {
1298
  if ( isset($_SERVER['HTTPS']) ) {
@@ -1304,10 +1304,7 @@ function hupso_the_content( $content ) {
1304
  $post_url = $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
1305
  $post_title = '';
1306
  }
1307
-
1308
-
1309
 
1310
-
1311
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1312
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1313
 
3
  Plugin Name: Hupso Share Buttons for Twitter, Facebook & Google+
4
  Plugin URI: http://www.hupso.com/share/
5
  Description: Add simple social sharing buttons to your articles. Your visitors will be able to easily share your content on the most popular social networks: Twitter, Facebook, Google Plus, Linkedin, StumbleUpon, Digg, Reddit, Bebo and Delicous. These services are used by millions of people every day, so sharing your content there will increase traffic to your website.
6
+ Version: 3.9.14
7
  Author: kasal
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
13
 
14
  global $HUPSO_VERSION;
15
+ $HUPSO_VERSION = '3.9.14';
16
 
17
  $hupso_dev = '';
18
  $hupso_state = 'normal';
199
  $thumb_image = get_header_image();
200
  break;
201
  case 'featured':
202
+ if ( ( function_exists('has_post_thumbnail') ) && ( isset( $post ) && has_post_thumbnail( $post->ID ) ) ) {
203
  $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
204
  $thumb_image = $thumb_image_temp[0];
205
  }
211
  $thumb_image = '';
212
  break;
213
  case 'fch': /* featured, custom, header */
214
+ if ( ( function_exists('has_post_thumbnail') ) && ( isset( $post ) && has_post_thumbnail( $post->ID ) ) ) {
215
  $thumb_image_temp = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
216
  $thumb_image = $thumb_image_temp[0];
217
  break;
945
  }
946
  $b_size = str_replace( 'button', '', $hupso_button_size);
947
  if ($b_size != 'custom') {
948
+ list($width, $height) = explode('x', $b_size, 2);
949
  }
950
 
951
  /* save share button custom URL */
1217
  }
1218
 
1219
  /* Do not show share buttons on password protected pages, but show it inside widget */
1220
+ $pass = ( isset( $GLOBALS['post'] ) ? $GLOBALS['post']->post_password : '' );
1221
  $hupso_password_protected = get_option( 'hupso_password_protected', '0');
1222
  if ( $hupso_state == 'normal' ) {
1223
  if ($pass != '') {
1291
  $hupso_twitter_via = get_option( 'hupso_twitter_via', '' );
1292
  $hupso_counters_lang = get_option( 'hupso_counters_lang', 'en_US' );
1293
 
1294
+ $post_url = ( isset($GLOBALS['post']) ? get_permalink($GLOBALS['post']->ID) : get_permalink() );
1295
+ $post_title = ( isset( $GLOBALS['post'] ) ? $GLOBALS['post']->post_title : '' );
1296
 
1297
  if ( ( $hupso_state == 'widget' ) || ( $hupso_state == 'shortcodes' ) ) {
1298
  if ( isset($_SERVER['HTTPS']) ) {
1304
  $post_url = $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
1305
  $post_title = '';
1306
  }
 
 
1307
 
 
1308
  $hupso_page_url = get_option( 'hupso_page_url', '' );
1309
  $hupso_page_title = stripslashes(get_option( 'hupso_page_title', '' ));
1310