Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused JS logic in email sharing #6339

Merged
merged 2 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/sharedaddy/sharing-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,9 @@ function sharing_add_footer() {
);
wp_localize_script( 'sharing-js', 'sharing_js_options', $sharing_js_options);
}
}

function sharing_add_footer_scripts_inline() {
$sharer = new Sharing_Service();
$enabled = $sharer->get_blog_services();
foreach ( array_merge( $enabled['visible'], $enabled['hidden'] ) AS $service ) {
Expand Down Expand Up @@ -773,7 +775,12 @@ function sharing_display( $text = '', $echo = false ) {
$ver = '20141212';
}
wp_register_script( 'sharing-js', plugin_dir_url( __FILE__ ).'sharing.js', array( 'jquery' ), $ver );

// Enqueue scripts for the footer
add_action( 'wp_footer', 'sharing_add_footer' );

// Print inline scripts that depend on jQuery
add_action( 'wp_footer', 'sharing_add_footer_scripts_inline', 25 );
}
}

Expand Down
1 change: 0 additions & 1 deletion modules/sharedaddy/sharing-sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ public function display_footer() {

<?php endif; ?>
<input type="text" id="jetpack-source_f_name" name="source_f_name" class="input" value="" size="25" autocomplete="off" />
<script>jQuery( document ).ready( function(){ document.getElementById('jetpack-source_f_name').value = '' });</script>
<?php
/**
* Fires when the Email sharing dialog is loaded.
Expand Down