diff options
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy')
4 files changed, 15 insertions, 18 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharedaddy.php b/plugins/jetpack/modules/sharedaddy/sharedaddy.php index ffd7bbc4..18c04d38 100644 --- a/plugins/jetpack/modules/sharedaddy/sharedaddy.php +++ b/plugins/jetpack/modules/sharedaddy/sharedaddy.php @@ -200,7 +200,7 @@ function sharing_restrict_to_single( $services ) { } function sharing_init() { - if ( get_option( 'sharedaddy_disable_resources' ) ) { + if ( Jetpack_Options::get_option_and_ensure_autoload( 'sharedaddy_disable_resources', '0' ) ) { add_filter( 'sharing_js', 'sharing_disable_js' ); remove_action( 'wp_head', 'sharing_add_header', 1 ); } diff --git a/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/plugins/jetpack/modules/sharedaddy/sharing-sources.php index 1fc6cef0..4e6f421b 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-sources.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-sources.php @@ -329,15 +329,13 @@ abstract class Sharing_Source { $opts = implode( ',', $opts ); ?> <script type="text/javascript"> - var windowOpen; - jQuery(document).on( 'ready post-load', function(){ - jQuery( 'a.share-<?php echo $name; ?>' ).on( 'click', function() { - if ( 'undefined' !== typeof windowOpen ){ // If there's another sharing window open, close it. - windowOpen.close(); - } - windowOpen = window.open( jQuery(this).attr( 'href' ), 'wpcom<?php echo $name; ?>', '<?php echo $opts; ?>' ); - return false; - }); + var windowOpen; + jQuery(document.body).on('click', 'a.share-<?php echo $name; ?>', function() { + if ( 'undefined' !== typeof windowOpen ){ // If there's another sharing window open, close it. + windowOpen.close(); + } + windowOpen = window.open( jQuery(this).attr( 'href' ), 'wpcom<?php echo $name; ?>', '<?php echo $opts; ?>' ); + return false; }); </script> <?php @@ -1518,7 +1516,7 @@ class Share_Pinterest extends Sharing_Source { </script> <?php elseif ( 'buttonPin' != $this->get_widget_type() ) : ?> <script type="text/javascript"> - jQuery(document).on('ready', function(){ + jQuery(document).ready( function(){ jQuery('body').on('click', 'a.share-pinterest', function(e){ e.preventDefault(); // Load Pinterest Bookmarklet code @@ -1590,7 +1588,7 @@ class Share_Pocket extends Sharing_Source { function jetpack_sharing_pocket_init() { jQuery.getScript( 'https://widgets.getpocket.com/v1/j/btn.js?v=1' ); } - jQuery( document ).on( 'ready', jetpack_sharing_pocket_init ); + jQuery( document ).ready( jetpack_sharing_pocket_init ); jQuery( document.body ).on( 'post-load', jetpack_sharing_pocket_init ); </script> <?php @@ -1641,7 +1639,7 @@ class Jetpack_Share_WhatsApp extends Sharing_Source { } public function get_display( $post ) { - return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode( get_permalink( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) ); + return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode( $this->get_share_url( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) ); } } diff --git a/plugins/jetpack/modules/sharedaddy/sharing.css b/plugins/jetpack/modules/sharedaddy/sharing.css index 06845483..ab8f6592 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.css +++ b/plugins/jetpack/modules/sharedaddy/sharing.css @@ -77,7 +77,6 @@ body.highlander-dark h3.sd-title:before { .sd-social-official .sd-content>ul>li .digg_button >a { /* official Digg button no longer works, needs cleaning */ text-decoration: none !important; display: inline-block; - margin: 0 5px 5px 0; font-size: 12px; font-family: "Open Sans", sans-serif; font-weight: normal; @@ -182,7 +181,7 @@ body.highlander-dark h3.sd-title:before { } .sd-content ul li { - margin: 0 !important; + margin: 0 5px 5px 0; padding: 0; } diff --git a/plugins/jetpack/modules/sharedaddy/sharing.js b/plugins/jetpack/modules/sharedaddy/sharing.js index ac287a24..34913e81 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing.js +++ b/plugins/jetpack/modules/sharedaddy/sharing.js @@ -72,7 +72,7 @@ if ( sharing_js_options && sharing_js_options.counts ) { } for ( url in data ) { - if ( ! data.hasOwnProperty( url ) || ! data[ url ].shares ) { + if ( ! data.hasOwnProperty( url ) || ! data[ url ].share.share_count ) { continue; } @@ -82,7 +82,7 @@ if ( sharing_js_options && sharing_js_options.counts ) { continue; } - WPCOMSharing.inject_share_count( 'sharing-facebook-' + WPCOM_sharing_counts[ permalink ], data[ url ].shares ); + WPCOMSharing.inject_share_count( 'sharing-facebook-' + WPCOM_sharing_counts[ permalink ], data[ url ].share.share_count ); } }, update_linkedin_count : function( data ) { @@ -129,7 +129,7 @@ var updateLinkedInCount = function( data ) { } ); $body = $( document.body ).on( 'post-load', WPCOMSharing_do ); - $( document ).on( 'ready', function() { + $( document ).ready( function() { $sharing_email = $( '#sharing_email' ); $body.append( $sharing_email ); WPCOMSharing_do(); |