gutenberg
4 years ago
admin.js
4 years ago
admin.min.js
4 years ago
deactivation-feedback.js
3 years ago
deactivation-feedback.min.js
3 years ago
editor.js
8 years ago
editor.min.js
5 years ago
evf-admin-email.js
3 years ago
evf-admin-email.min.js
3 years ago
evf-clipboard.js
8 years ago
evf-clipboard.min.js
8 years ago
evf-enhanced-select.js
3 years ago
evf-enhanced-select.min.js
3 years ago
evf-file-uploader.js
3 years ago
evf-file-uploader.min.js
3 years ago
evf-setup.js
3 years ago
evf-setup.min.js
3 years ago
extensions.js
4 years ago
extensions.min.js
4 years ago
form-builder.js
3 years ago
form-builder.min.js
3 years ago
form-template-controller.js
3 years ago
form-template-controller.min.js
3 years ago
settings.js
4 years ago
settings.min.js
4 years ago
tools.js
4 years ago
tools.min.js
4 years ago
upgrade.js
5 years ago
upgrade.min.js
5 years ago
upgrade.js
68 lines
| 1 | /* global evf_upgrade, evf_data */ |
| 2 | jQuery( function( $ ) { |
| 3 | |
| 4 | /** |
| 5 | * Upgrade actions. |
| 6 | */ |
| 7 | var evf_upgrade_actions = { |
| 8 | init: function() { |
| 9 | $( document.body ).on( 'click dragstart', '.evf-registered-item.upgrade-modal', this.field_upgrade ); |
| 10 | $( document.body ).on( 'click dragstart', '.evf-registered-item.enable-stripe-model', this.enable_stripe_model ); |
| 11 | $( document.body ).on( 'click dragstart', '.everest-forms-field-option-row.upgrade-modal', this.feature_upgrade ); |
| 12 | $( document.body ).on( 'click dragstart', '.evf-upgradable-feature, .everest-forms-btn-group span.upgrade-modal', this.feature_upgrade ); |
| 13 | }, |
| 14 | feature_upgrade: function( e ) { |
| 15 | e.preventDefault(); |
| 16 | |
| 17 | evf_upgrade_actions.upgrade_modal( $( this ).data( 'feature' ) ? $( this ).data( 'feature' ) : $( this ).text() ); |
| 18 | }, |
| 19 | field_upgrade: function( e ) { |
| 20 | e.preventDefault(); |
| 21 | |
| 22 | evf_upgrade_actions.upgrade_modal( $( this ).data( 'feature' ) ? $( this ).data( 'feature' ) : $( this ).text() + ' field' ); |
| 23 | }, |
| 24 | upgrade_modal: function( feature ) { |
| 25 | var message = evf_upgrade.upgrade_message.replace( /%name%/g, feature ); |
| 26 | |
| 27 | $.alert({ |
| 28 | title: feature + ' ' + evf_upgrade.upgrade_title, |
| 29 | icon: 'dashicons dashicons-lock', |
| 30 | content: message, |
| 31 | type: 'red', |
| 32 | boxWidth: '565px', |
| 33 | buttons: { |
| 34 | confirm: { |
| 35 | text: evf_upgrade.upgrade_button, |
| 36 | btnClass: 'btn-confirm', |
| 37 | keys: ['enter'], |
| 38 | action: function () { |
| 39 | window.open( evf_upgrade.upgrade_url, '_blank' ); |
| 40 | } |
| 41 | }, |
| 42 | cancel: { |
| 43 | text: evf_data.i18n_ok |
| 44 | } |
| 45 | } |
| 46 | }); |
| 47 | }, |
| 48 | enable_stripe_model: function( e ) { |
| 49 | e.preventDefault(); |
| 50 | $.alert({ |
| 51 | title: evf_upgrade.enable_stripe_title, |
| 52 | content: evf_upgrade.enable_stripe_message, |
| 53 | icon: 'dashicons dashicons-info', |
| 54 | type: 'blue', |
| 55 | buttons : { |
| 56 | confirm : { |
| 57 | text: evf_data.i18n_close, |
| 58 | btnClass: 'btn-confirm', |
| 59 | keys: ['enter'] |
| 60 | } |
| 61 | } |
| 62 | }); |
| 63 | } |
| 64 | }; |
| 65 | |
| 66 | evf_upgrade_actions.init(); |
| 67 | }); |
| 68 |