PluginProbe
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI / 6.0.3
AutomatorWP – No-Code Workflow Automation, Integration & Webhooks Plugin, now with AI v6.0.3
6.0.3 6.0.2 6.0.1 6.0.0 5.8.6 5.8.5 5.8.4 5.8.3 5.8.2 5.8.1 5.8.0 5.7.9.2 5.7.9.1 5.7.8 5.7.9 5.7.6 5.7.7 5.7.5 5.7.4 5.7.3 5.7.2 5.7.1 trunk 5.6.0 5.6.1 All 34 releases
← All changes | libraries/ct/assets/js/ct.js +51 -0 5.7.2 → 6.0.3 View file →
@@ -1,0 +1,51 @@
1 +(function ( $ ) {
2 +
3 + // EDIT
4 +
5 + // On click ct save, show spinner
6 + $("#publishing-action #ct-save").on("click", function(e) {
7 + var $this = $(this);
8 +
9 + if( $this.prop('disabled') === true ) {
10 + return;
11 + }
12 +
13 + $this.closest('#publishing-action').find('.spinner').addClass('is-active');
14 + $this.hide();
15 + $this.closest('#publishing-action').find('#ct-save-disabled').show();
16 + });
17 +
18 + // On click ct add, show spinner
19 + $("#ct_add_form #ct-add").on("click", function(e) {
20 + var $this = $(this);
21 +
22 + if( $this.prop('disabled') === true ) {
23 + return;
24 + }
25 +
26 + var any_error = false;
27 +
28 + $this.closest('form').find('input[required="1"]').each(function() {
29 + var field = $(this);
30 +
31 + if( field.val() === '' ) {
32 + field.parent().addClass('form-required form-invalid');
33 + any_error = true;
34 + }
35 + })
36 +
37 + if( any_error ) {
38 + return;
39 + }
40 +
41 + $this.closest('.submit').find('.spinner').addClass('is-active');
42 + $this.hide();
43 + $this.closest('.submit').find('#ct-add-disabled').show();
44 + });
45 +
46 + $("body").on("keyup", ".form-required.form-invalid input, .form-required.form-invalid textarea", function(e) {
47 + $(this).parent().removeClass('form-required');
48 + $(this).parent().removeClass('form-invalid');
49 + });
50 +
51 +})( jQuery );