File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,49 @@ jQuery(function ($) {
98
98
}
99
99
} ) ;
100
100
101
+ // License key.
102
+ jQuery ( '.fz-license-section #license_key' ) . on ( 'input' , function ( ) {
103
+ const licenseKey = jQuery ( this ) . val ( ) ;
104
+ if ( licenseKey !== '' ) {
105
+ jQuery ( '#check_ti_license' ) . removeAttr ( 'disabled' ) ;
106
+ } else {
107
+ jQuery ( '#check_ti_license' ) . attr ( 'disabled' , true ) ;
108
+ }
109
+ jQuery ( '.fz-license-section input[name="license_key"]' ) . val ( licenseKey ) ;
110
+ } ) ;
111
+
112
+ jQuery ( '.fz-license-section #check_ti_license' ) . on ( 'click' , function ( e ) {
113
+ e . preventDefault ( ) ;
114
+ const _this = jQuery ( this ) ;
115
+ _this . attr ( 'disabled' , true ) . addClass ( 'fz-checking' ) ;
116
+
117
+ _this . parents ( '.fz-license-section' ) . find ( '.feedzy-api-error' ) . remove ( ) ;
118
+
119
+ const LicenseData = _this
120
+ . parent ( '.fz-input-group-btn' )
121
+ . find ( 'input' )
122
+ . serialize ( ) ;
123
+
124
+ jQuery . post (
125
+ ajaxurl ,
126
+ LicenseData ,
127
+ function ( response ) {
128
+ if ( ! response . success ) {
129
+ jQuery (
130
+ '<p class="feedzy-api-error">' +
131
+ response . message +
132
+ '</p>'
133
+ ) . insertAfter (
134
+ jQuery ( '.fz-license-section' ) . find ( '.help-text' )
135
+ ) ;
136
+ _this . removeAttr ( 'disabled' ) . removeClass ( 'fz-checking' ) ;
137
+ } else {
138
+ window . location . reload ( ) ;
139
+ }
140
+ } ,
141
+ 'json'
142
+ ) ;
143
+ } ) ;
101
144
snackbarNotice ( ) ;
102
145
103
146
const initializeAutoCatActions = ( ) => {
You can’t perform that action at this time.
0 commit comments