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 jQuery dependency #134

Closed
joshuarrrr opened this issue Jul 28, 2020 · 4 comments
Closed

Remove jQuery dependency #134

joshuarrrr opened this issue Jul 28, 2020 · 4 comments
Assignees
Milestone

Comments

@joshuarrrr
Copy link
Contributor

We're not using it heavily, so it should be fairly straightforward to replace jQuery calls with vanilla JS.

@jase-d-ace
Copy link

does it need to be removed from anywhere besides here?

@joshuarrrr
Copy link
Contributor Author

Yeah, jQuery.find() is also used: https://github.com/Parsely/wp-parsely/search?q=jQuery&unscoped_q=jQuery

@jblz
Copy link
Contributor

jblz commented May 4, 2021

#236 got us a lot of the way there, but the recommended widget still relies on jQuery:

wp_enqueue_script( 'jquery' );
$allowed_tags = wp_kses_allowed_html( 'post' );
$title_html = $args['before_widget'] . $args['before_title'] . $title . $args['after_title'];
echo wp_kses( $title_html, $allowed_tags );
// Set up the variables.
$options = get_option( 'parsely' );
$full_url = $this->get_api_url(
$options['apikey'],
$instance['published_within'],
$instance['sort'],
$instance['boost'],
$instance['return_limit']
);
?>
<script data-cfasync="false">
// adapted from https://stackoverflow.com/questions/7486309/how-to-make-script-execution-wait-until-jquery-is-loaded
function defer(method) {
if (window.jQuery) {

@jblz jblz modified the milestones: 2.5.0, 2.6.0 May 5, 2021
@pauarge pauarge assigned jblz and pauarge and unassigned jblz Sep 17, 2021
@pauarge
Copy link
Contributor

pauarge commented Sep 20, 2021

jQuery has been removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants