Skip Navigation

[Resolved] Change the Spinner that CRED uses

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by smileBeda 4 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1810083

Summary of details

In file /cred-frontend-editor/public/js/frontend.js the URL of the spinner is defined with loadingSpinnerImagePath line 36.
That would need some sort of filter applied, to allow us setting another URL of the spinner.

Or, a way to reset the .src attribute with JS (selector.src = "value") because in the same file, line 319 the spinner is appended to selector_to_append (the submit button).

#1813475

Hi Beda,

Thank you for waiting and sorry about the delay in getting back on this.

During testing on my website, I wasn't able to modify the form's AJAX spinner either, without adding changes in the plugin's file.

If you're open to such a solution, you can follow these steps:

1. In your active theme's "functions.php" file, you can include some function to define a script variable value, that holds the new image's path:

Example:


function your_function() {
    echo '<script id="cred_custom-AJAX-icon">
var cred_frontend_custom_AJAX_icon = {"url":"<em><u>hidden link</u></em>"};
</script>';
}
add_action( 'wp_footer', 'your_function' );

Note: for this example, I'm just using a hardcoded image's path, but you can generate it dynamically as needed.

2. Next, in the same "/cred-frontend-editor/public/js/frontend.js" file, you can update the function starting from line# 315, to check for this new var "cred_frontend_custom_AJAX_icon" and use it, if it is set:


startLoading: function( $selector_to_append, site_url ) {
        var $body = jQuery("body");
        $body.addClass("wpt-loading");
        if(typeof cred_frontend_custom_AJAX_icon === 'undefined') {
            var loading_icon = site_url + this.loadingSpinnerImagePath;
        }
        else
        {
            var loading_icon = cred_frontend_custom_AJAX_icon.url;
        }
        
        $selector_to_append.after('<span class="' + this.loadingSpinnerClass + '" style="margin-left:5px;"><img class="cred-form-loading-spinner-image" src="' + loading_icon + '"></span>');
    },

I hope this helps.

regards,
Waqar

#1813903

Editing core plugin files isn’t an option if we stay within serious and common rules of WordPress development

I’ll just create my own form for this, and deeply re-evaluate when/if to recommend toolset at all.

Given I know how Feature requests are „evaluated“ at toolset I’ll also not build on the false hope that the submitted request and the dozens of forum tickets requesting precisely this feature will ever be considered.

Thanks!