pop up
Signed-off-by: Jeff <jeff@gotenzing.com>
Showing
37 changed files
with
159 additions
and
611 deletions
| 1 | .swal2-popup .swal2-title | ||
| 2 | { | ||
| 3 | font-weight: normal !important; | ||
| 4 | font-size: 21px !important | ||
| 5 | } | ||
| 6 | .swal2-popup .swal2-styled:focus { | ||
| 7 | box-shadow: none !important; | ||
| 8 | } | ||
| 9 | .swal2-show { | ||
| 10 | border: none !important; | ||
| 11 | |||
| 12 | } | ||
| 13 | button.swal2-confirm.swal2-styled | ||
| 14 | { | ||
| 15 | font-size: 14px !important; | ||
| 16 | padding: 5px 25px !important; | ||
| 17 | } | ||
| 18 | h1:not(.site-title):before, h2#swal2-title:before { | ||
| 19 | content: "" !important; | ||
| 20 | height: 0; | ||
| 21 | } |
This diff is collapsed.
Click to expand it.
185 KB
31.9 KB
wp-content/plugins/popup-message-for-contact-form-7/images/jeremy-bishop-160885-unsplash.jpg
deleted
100644 → 0
14.3 KB
wp-content/plugins/popup-message-for-contact-form-7/images/pexels-photo-1191710.jpeg
deleted
100644 → 0
20.3 KB
This diff is collapsed.
Click to expand it.
| 1 | /* Display Popup when Contact Form 7 successfully submitted */ | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | document.addEventListener( 'wpcf7mailsent', function( event ) { | ||
| 6 | |||
| 7 | var currentformid = event.detail.contactFormId; | ||
| 8 | |||
| 9 | var popup_id = event.detail.apiResponse.popup_id; | ||
| 10 | //Store popup background color and search , is aveliable or not if not aveliable then it is normal color or gradient color | ||
| 11 | if( event.detail.apiResponse.popup_background_option == "bg_color") | ||
| 12 | { | ||
| 13 | var color_code = event.detail.apiResponse.popup_background_color; | ||
| 14 | |||
| 15 | } | ||
| 16 | if(event.detail.apiResponse.popup_background_option === "gradient_color") | ||
| 17 | { | ||
| 18 | var color_code = 'linear-gradient('+ event.detail.apiResponse.popup_gradient_color +','+ event.detail.apiResponse.popup_gradient_color1 +')'; | ||
| 19 | } | ||
| 20 | if(event.detail.apiResponse.popup_background_option === "image") | ||
| 21 | { | ||
| 22 | var color_code = ' url("' + event.detail.apiResponse.popup_image_color + '")right center / cover no-repeat'; | ||
| 23 | } | ||
| 24 | |||
| 25 | if (popup_id != null && popup_id != '') { | ||
| 26 | //popup box | ||
| 27 | |||
| 28 | swal({ | ||
| 29 | |||
| 30 | // set popup background color and image | ||
| 31 | |||
| 32 | background: color_code, | ||
| 33 | |||
| 34 | // set popup message | ||
| 35 | |||
| 36 | title: '<span style="color:' + event.detail.apiResponse.popup_text_color +'">'+event.detail.apiResponse.popup_message+'</span>', | ||
| 37 | |||
| 38 | confirmButtonColor: event.detail.apiResponse.popup_button_background_color, | ||
| 39 | |||
| 40 | |||
| 41 | confirmButtonText: '<span style="color:' + event.detail.apiResponse.popup_text_color +'">'+event.detail.apiResponse.popup_button_text+'</span>', | ||
| 42 | |||
| 43 | // set popup width | ||
| 44 | |||
| 45 | width: event.detail.apiResponse.m_popup_width, | ||
| 46 | |||
| 47 | //set popup duration time in seconds | ||
| 48 | |||
| 49 | timer: event.detail.apiResponse.m_popup_duration, | ||
| 50 | |||
| 51 | |||
| 52 | }) | ||
| 53 | |||
| 54 | jQuery('.swal2-modal').css('border-radius', event.detail.apiResponse.m_popup_radius+"px"); | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | }, false ); | ||
| 59 | |||
| 60 |
This diff is collapsed.
Click to expand it.
| 1 | jQuery(function($){ | ||
| 2 | /* | ||
| 3 | * Select/Upload image(s) event | ||
| 4 | */ | ||
| 5 | $('body').on('click', '.misha_upload_image_button', function(e){ | ||
| 6 | e.preventDefault(); | ||
| 7 | |||
| 8 | var button = $(this), | ||
| 9 | custom_uploader = wp.media({ | ||
| 10 | title: 'Insert image', | ||
| 11 | library : { | ||
| 12 | // uncomment the next line if you want to attach image to the current post | ||
| 13 | // uploadedTo : wp.media.view.settings.post.id, | ||
| 14 | type : 'image' | ||
| 15 | }, | ||
| 16 | button: { | ||
| 17 | text: 'Use this image' // button label text | ||
| 18 | }, | ||
| 19 | multiple: false // for multiple image selection set to true | ||
| 20 | }).on('select', function() { // it also has "open" and "close" events | ||
| 21 | var attachment = custom_uploader.state().get('selection').first().toJSON(); | ||
| 22 | $(button).removeClass('button').html('<img class="true_pre_image" src="' + attachment.url + '" style="max-width:100px;height:100px;display:block;" />').next().val(attachment.id).next().show(); | ||
| 23 | jQuery(".hidden_img").val(attachment.url); | ||
| 24 | /* if you sen multiple to true, here is some code for getting the image IDs | ||
| 25 | var attachments = frame.state().get('selection'), | ||
| 26 | attachment_ids = new Array(), | ||
| 27 | i = 0; | ||
| 28 | attachments.each(function(attachment) { | ||
| 29 | attachment_ids[i] = attachment['id']; | ||
| 30 | console.log( attachment ); | ||
| 31 | i++; | ||
| 32 | }); | ||
| 33 | */ | ||
| 34 | }) | ||
| 35 | .open(); | ||
| 36 | }); | ||
| 37 | |||
| 38 | $('body').on('click', '.misha_upload_image_button_failer', function(e){ | ||
| 39 | e.preventDefault(); | ||
| 40 | |||
| 41 | var button = $(this), | ||
| 42 | custom_uploader = wp.media({ | ||
| 43 | title: 'Insert image', | ||
| 44 | library : { | ||
| 45 | // uncomment the next line if you want to attach image to the current post | ||
| 46 | // uploadedTo : wp.media.view.settings.post.id, | ||
| 47 | type : 'image' | ||
| 48 | }, | ||
| 49 | button: { | ||
| 50 | text: 'Use this image' // button label text | ||
| 51 | }, | ||
| 52 | multiple: false // for multiple image selection set to true | ||
| 53 | }).on('select', function() { // it also has "open" and "close" events | ||
| 54 | var attachment = custom_uploader.state().get('selection').first().toJSON(); | ||
| 55 | $(button).removeClass('button').html('<img class="true_pre_image" src="' + attachment.url + '" style="max-width:100px;height:100px;display:block;" />').next().val(attachment.id).next().show(); | ||
| 56 | jQuery(".failure_hidden_img").val(attachment.url); | ||
| 57 | /* if you sen multiple to true, here is some code for getting the image IDs | ||
| 58 | var attachments = frame.state().get('selection'), | ||
| 59 | attachment_ids = new Array(), | ||
| 60 | i = 0; | ||
| 61 | attachments.each(function(attachment) { | ||
| 62 | attachment_ids[i] = attachment['id']; | ||
| 63 | console.log( attachment ); | ||
| 64 | i++; | ||
| 65 | }); | ||
| 66 | */ | ||
| 67 | }) | ||
| 68 | .open(); | ||
| 69 | }); | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Remove image event | ||
| 73 | */ | ||
| 74 | $('body').on('click', '.misha_remove_image_button', function(){ | ||
| 75 | $(this).hide().prev().val('').prev().addClass('button').html('Upload image'); | ||
| 76 | return false; | ||
| 77 | }); | ||
| 78 | |||
| 79 | }); |
This diff is collapsed.
Click to expand it.
wp-content/plugins/popup-message-for-contact-form-7/popupmessage-for-contact-form-7.php
deleted
100644 → 0
| 1 | <?php | ||
| 2 | /** | ||
| 3 | * Plugin Name: Popup Message for Contact Form 7 | ||
| 4 | * Description: This plugin will show the popup when Contact Form 7 has been submitted. | ||
| 5 | * Version: 2.0 | ||
| 6 | * Author: Ocean Infotech | ||
| 7 | * Author URI: Author's website | ||
| 8 | */ | ||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | if (!defined('ABSPATH')) { | ||
| 13 | die('-1'); | ||
| 14 | } | ||
| 15 | if (!defined('CF7POPUP_PLUGIN_NAME')) { | ||
| 16 | define('CF7POPUP_PLUGIN_NAME', 'Contact Form 7 Popup'); | ||
| 17 | } | ||
| 18 | if (!defined('CF7POPUP_PLUGIN_VERSION')) { | ||
| 19 | define('CF7POPUP_PLUGIN_VERSION', '1.0.0'); | ||
| 20 | } | ||
| 21 | if (!defined('CF7POPUP_PLUGIN_FILE')) { | ||
| 22 | define('CF7POPUP_PLUGIN_FILE', __FILE__); | ||
| 23 | } | ||
| 24 | if (!defined('CF7POPUP_PLUGIN_DIR')) { | ||
| 25 | define('CF7POPUP_PLUGIN_DIR',plugins_url('', __FILE__)); | ||
| 26 | } | ||
| 27 | if (!defined('CF7POPUP_DOMAIN')) { | ||
| 28 | define('CF7POPUP_DOMAIN', 'cf7popup'); | ||
| 29 | } | ||
| 30 | |||
| 31 | |||
| 32 | if (!class_exists('CF7POPUPMAIN')) { | ||
| 33 | |||
| 34 | class CF7POPUPMAIN { | ||
| 35 | |||
| 36 | protected static $CF7POPUPMAIN_instance; | ||
| 37 | |||
| 38 | //Load all includes files | ||
| 39 | function includes() { | ||
| 40 | include_once('popup_panel.php'); | ||
| 41 | include_once('save_popup_setting.php'); | ||
| 42 | include_once('submit_popup_settings.php'); | ||
| 43 | } | ||
| 44 | |||
| 45 | function init() { | ||
| 46 | add_action( 'admin_init', array($this, 'CF7POPUPMAIN_load_plugin'), 11 ); | ||
| 47 | add_action( 'admin_enqueue_scripts', array($this, 'CF7POPUP_load_admin_script_style')); | ||
| 48 | add_action( 'wp_enqueue_scripts', array($this, 'CF7POPUP_load_front_script_style')); | ||
| 49 | add_action( 'admin_enqueue_scripts', array($this, 'CF7POPUP_load_front_script_style')); | ||
| 50 | } | ||
| 51 | |||
| 52 | function CF7POPUPMAIN_load_plugin() { | ||
| 53 | if ( ! ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) ) { | ||
| 54 | add_action( 'admin_notices', array($this,'CF7POPUPMAIN_install_error') ); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | function CF7POPUPMAIN_install_error() { | ||
| 59 | deactivate_plugins( plugin_basename( __FILE__ ) ); | ||
| 60 | delete_transient( get_current_user_id() . 'cf7error' ); | ||
| 61 | echo '<div class="error"><p> This plugin is deactivated because it require <a href="plugin-install.php?tab=search&s=contact+form+7">Contact Form 7</a> plugin installed and activated.</p></div>'; | ||
| 62 | } | ||
| 63 | |||
| 64 | //Add JS and CSS on Backend | ||
| 65 | function CF7POPUP_load_admin_script_style() { | ||
| 66 | wp_enqueue_media(); | ||
| 67 | wp_enqueue_script( 'pmfcf-wp-media-uploader', plugins_url( 'popup-message-for-contact-form-7-pro/js/wp_media_uploader.js', __DIR__ ) ); | ||
| 68 | } | ||
| 69 | |||
| 70 | //Add JS and CSS on Frontend | ||
| 71 | function CF7POPUP_load_front_script_style() { | ||
| 72 | wp_enqueue_script( 'pmfcf-script-popupscript', plugins_url( '/js/popupscript.js', __FILE__ ) ); | ||
| 73 | wp_enqueue_script( 'pmfcf-script-sweetalert2', plugins_url( '/js/sweetalert2.all.min.js', __FILE__ ) ); | ||
| 74 | wp_enqueue_script( 'pmfcf-jscolor', plugins_url( '/js/jscolor.js', __FILE__ ) ); | ||
| 75 | wp_enqueue_style( 'pmfcf-sweetalert2-style', plugins_url( '/css/sweetalert2.min.css', __FILE__ ) ); | ||
| 76 | wp_enqueue_style( 'pmfcf-style', plugins_url( '/css/style.css', __FILE__ ) ); | ||
| 77 | } | ||
| 78 | |||
| 79 | //Plugin Rating | ||
| 80 | public static function do_activation() { | ||
| 81 | set_transient('ocinsta-first-rating', true, MONTH_IN_SECONDS); | ||
| 82 | } | ||
| 83 | |||
| 84 | public static function CF7POPUPMAIN_instance() { | ||
| 85 | if (!isset(self::$CF7POPUPMAIN_instance)) { | ||
| 86 | self::$CF7POPUPMAIN_instance = new self(); | ||
| 87 | self::$CF7POPUPMAIN_instance->init(); | ||
| 88 | self::$CF7POPUPMAIN_instance->includes(); | ||
| 89 | } | ||
| 90 | return self::$CF7POPUPMAIN_instance; | ||
| 91 | } | ||
| 92 | |||
| 93 | } | ||
| 94 | |||
| 95 | add_action('plugins_loaded', array('CF7POPUPMAIN', 'CF7POPUPMAIN_instance')); | ||
| 96 | register_activation_hook(CF7POPUP_PLUGIN_FILE, array('CF7POPUPMAIN', 'do_activation')); | ||
| 97 | } |
| 1 | === Popup Message for Contact Form 7=== | ||
| 2 | Tested up to: 5.2 | ||
| 3 | Tags: contact form 7,contact form, Error message,message popup , submit form | ||
| 4 | Donate link: https://bit.ly/2CqhQq7 | ||
| 5 | License: GPLv2 or later | ||
| 6 | License URI: http://www.gnu.org/licenses/gpl-3.0.html | ||
| 7 | |||
| 8 | CF7 Lightbox Popup Success is offering features like Add Success And Error message in to Fronted side in contact form 7 | ||
| 9 | |||
| 10 | == Description == | ||
| 11 | |||
| 12 | CF7 Lightbox Popup Success is offering features like **Add Success and Error message Popup** in to Fronted side in contact form 7. | ||
| 13 | In wordpress admin there is all setting to popup to customize background color, font size and font color. | ||
| 14 | |||
| 15 | 🔸 **[Demos](http://oceanwebguru.com/)** | ||
| 16 | |||
| 17 | > **Plugin Features** | ||
| 18 | > | ||
| 19 | > * Create popup for any Contact Form 7 form | ||
| 20 | > * Pre-Define Success Popup Template | ||
| 21 | > * Use different Success popups for different form | ||
| 22 | > * Shows Success popup when form submitted successfully | ||
| 23 | > * Customize Success Popup content | ||
| 24 | > * Customize Success Popup background color | ||
| 25 | > * Customize Success Popup font color | ||
| 26 | > * Customize Success Popup button-text | ||
| 27 | > * Customize Success Popup button color | ||
| 28 | > * Customize Success Popup Duration time | ||
| 29 | > * Customize Success Popup Background image | ||
| 30 | > * Customize Success Popup gradient colors | ||
| 31 | > * Popup is fully responsive | ||
| 32 | > * Compatible in all major browser | ||
| 33 | |||
| 34 | |||
| 35 | 🔸 **[Purchase Pro](https://www.xeeshop.com/product/contact-form-7-popup-message-pro/)** | ||
| 36 | |||
| 37 | > **Plugin Pro Features** | ||
| 38 | > | ||
| 39 | > * Create popup for any Contact Form 7 form | ||
| 40 | > * Pre-Define Success and Faild Popup Template | ||
| 41 | > * Use different Success and Faild popups for different form | ||
| 42 | > * Shows Success and Faild popup when form submitted successfully | ||
| 43 | > * Customize Success and Faild Popup content | ||
| 44 | > * Customize Success and Faild Popup background color | ||
| 45 | > * Customize Success and Faild Popup font color | ||
| 46 | > * Customize Success and Faild Popup button-text | ||
| 47 | > * Customize Success and Faild Popup button color | ||
| 48 | > * Customize Success and Faild Popup Duration time | ||
| 49 | > * Customize Success and Faild Popup Background image | ||
| 50 | > * Customize Success and Faild Popup gradient colors | ||
| 51 | > * Popup is fully responsive | ||
| 52 | > * Compatible in all major browser | ||
| 53 | > * Fast Customer Support | ||
| 54 | |||
| 55 | 🔸 **[Donation](https://bit.ly/2CqhQq7)** | ||
| 56 | |||
| 57 | |||
| 58 | **Our More Plugin** | ||
| 59 | |||
| 60 | 🔸 [**Cf7 Product List Dropdown**](https://wordpress.org/plugins/cf7-product-list-dropdown/) | ||
| 61 | 🔸 [**Popup Message for Contact Form 7**](https://wordpress.org/plugins/popup-message-for-contact-form-7/) | ||
| 62 | 🔸 [**Min and max Qty Rule Woocommerce**](https://wordpress.org/plugins/min-and-max-woocommerce-purchase-rule-by-product-category/) | ||
| 63 | 🔸 [**Post Slider**](https://wordpress.org/plugins/post-slider-by-oc/) | ||
| 64 | 🔸 [**Instagram Slider and Gallery**](https://wordpress.org/plugins/oc-instagram-slider/) | ||
| 65 | |||
| 66 | == Screenshots == | ||
| 67 | |||
| 68 | 1. screenshot-1.png | ||
| 69 | 2. screenshot-2.png | ||
| 70 | 3. screenshot-3.png | ||
| 71 | 4. screenshot-4.png | ||
| 72 | 5. screenshot-5.png |
| 1 | <?php | ||
| 2 | if (!defined('ABSPATH')) | ||
| 3 | exit; | ||
| 4 | |||
| 5 | if (!class_exists('CF7POPUP_save_menu')) { | ||
| 6 | |||
| 7 | class CF7POPUP_save_menu { | ||
| 8 | |||
| 9 | protected static $instance; | ||
| 10 | |||
| 11 | function CF7POPUP_wpcf7_after_save( $instance) { | ||
| 12 | |||
| 13 | $formid = $instance->id; | ||
| 14 | |||
| 15 | if(!empty($_POST['enabled_popup_val'])) { | ||
| 16 | $enabled_popup_id = $formid; | ||
| 17 | }else{ | ||
| 18 | $enabled_popup_id = ""; | ||
| 19 | } | ||
| 20 | |||
| 21 | if(!empty($_POST['enabled_failure_popup_val'])) { | ||
| 22 | $enabled_failure_popup_id = $formid; | ||
| 23 | }else{ | ||
| 24 | $enabled_failure_popup_id = ""; | ||
| 25 | } | ||
| 26 | |||
| 27 | // Add or Update popup general settings | ||
| 28 | |||
| 29 | update_post_meta( $formid, 'enabled-popup', $enabled_popup_id ); | ||
| 30 | |||
| 31 | $popup_message_data = sanitize_text_field($_POST['popup_message']); | ||
| 32 | update_post_meta( $formid, 'popup_message', $popup_message_data ); | ||
| 33 | |||
| 34 | $m_popup_width_data = sanitize_text_field($_POST['m_popup_width']); | ||
| 35 | update_post_meta( $formid, 'm_popup_width', $m_popup_width_data ); | ||
| 36 | |||
| 37 | $m_popup_radius = sanitize_text_field($_POST['m_popup_radius']); | ||
| 38 | update_post_meta( $formid, 'm_popup_radius', $m_popup_radius ); | ||
| 39 | |||
| 40 | $m_popup_duration_data = sanitize_text_field($_POST['m_popup_duration']); | ||
| 41 | update_post_meta( $formid, 'm_popup_duration', $m_popup_duration_data ); | ||
| 42 | |||
| 43 | $popup_templet_data = sanitize_text_field($_POST['popup_templet']); | ||
| 44 | update_post_meta( $formid, 'popup_templet', $popup_templet_data ); | ||
| 45 | |||
| 46 | if($popup_templet_data == "templet1"){ | ||
| 47 | update_post_meta( $formid, 'popup_background_option', "bg_color"); | ||
| 48 | update_post_meta( $formid, 'popup_background_color', "#34495e" ); | ||
| 49 | update_post_meta( $formid, 'popup_text_color', "#ffffff" ); | ||
| 50 | update_post_meta( $formid, 'popup_button_background_color', "#27ad5f" ); | ||
| 51 | |||
| 52 | } | ||
| 53 | if($popup_templet_data == "templet2"){ | ||
| 54 | update_post_meta( $formid, 'popup_background_option', "gradient_color"); | ||
| 55 | update_post_meta( $formid, 'popup_gradient_color', "#CD5C5C"); | ||
| 56 | update_post_meta( $formid, 'popup_gradient_color1', "#FFA07A"); | ||
| 57 | update_post_meta( $formid, 'popup_text_color', "#000000" ); | ||
| 58 | update_post_meta( $formid, 'popup_button_background_color', "#ffffff" ); | ||
| 59 | |||
| 60 | } | ||
| 61 | if($popup_templet_data == "templet3"){ | ||
| 62 | update_post_meta( $formid, 'popup_background_option', "image"); | ||
| 63 | update_post_meta( $formid, 'popup_image_color', plugins_url( 'popup-message-for-contact-form-7/images/pexels-photo-1191710.jpeg')); | ||
| 64 | update_post_meta( $formid, 'popup_text_color', "#ffffff" ); | ||
| 65 | update_post_meta( $formid, 'popup_button_background_color', "#51654e" ); | ||
| 66 | |||
| 67 | } | ||
| 68 | if($popup_templet_data == "templet4"){ | ||
| 69 | update_post_meta( $formid, 'popup_background_option', "gradient_color"); | ||
| 70 | update_post_meta( $formid, 'popup_gradient_color', "#268717"); | ||
| 71 | update_post_meta( $formid, 'popup_gradient_color1', "#A6EF9B"); | ||
| 72 | update_post_meta( $formid, 'popup_text_color', "#000000" ); | ||
| 73 | update_post_meta( $formid, 'popup_button_background_color', "#ffffff" ); | ||
| 74 | |||
| 75 | } | ||
| 76 | if($popup_templet_data == "templet5"){ | ||
| 77 | update_post_meta( $formid, 'popup_background_option', "image"); | ||
| 78 | update_post_meta( $formid, 'popup_image_color', plugins_url( 'popup-message-for-contact-form-7/images/background-brick-brickwork-268966.jpg')); | ||
| 79 | update_post_meta( $formid, 'popup_text_color', "#ffffff" ); | ||
| 80 | update_post_meta( $formid, 'popup_button_background_color', "#FF9800" ); | ||
| 81 | |||
| 82 | } | ||
| 83 | if($popup_templet_data == "custom_templet"){ | ||
| 84 | |||
| 85 | update_post_meta( $formid, 'popup_background_option', 'bg_color' ); | ||
| 86 | update_post_meta( $formid, 'popup_background_color', "#34495e" ); | ||
| 87 | update_post_meta( $formid, 'popup_text_color', "#ffffff" ); | ||
| 88 | update_post_meta( $formid, 'popup_button_background_color', "#51654e" ); | ||
| 89 | |||
| 90 | } | ||
| 91 | |||
| 92 | |||
| 93 | } | ||
| 94 | |||
| 95 | function init() { | ||
| 96 | add_action( 'wpcf7_after_save', array( $this, 'CF7POPUP_wpcf7_after_save'), 10, 1 ); | ||
| 97 | } | ||
| 98 | |||
| 99 | |||
| 100 | public static function instance() { | ||
| 101 | if (!isset(self::$instance)) { | ||
| 102 | self::$instance = new self(); | ||
| 103 | self::$instance->init(); | ||
| 104 | } | ||
| 105 | return self::$instance; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | CF7POPUP_save_menu::instance(); | ||
| 109 | } |
| 1 | <?php | ||
| 2 | if (!defined('ABSPATH')) | ||
| 3 | exit; | ||
| 4 | |||
| 5 | if (!class_exists('CF7POPUP_submit_menu')) { | ||
| 6 | |||
| 7 | class CF7POPUP_submit_menu { | ||
| 8 | |||
| 9 | protected static $instance; | ||
| 10 | |||
| 11 | function CF7POPUP_wpcf7_ajax_json_echo( $items, $result ) { | ||
| 12 | |||
| 13 | $formid = $_REQUEST['_wpcf7']; | ||
| 14 | |||
| 15 | $items["popup_id"] = get_post_meta( $formid, 'enabled-popup', true ); | ||
| 16 | |||
| 17 | $items["failure_popup_id"] = get_post_meta( $formid, 'enabled-popup-failure', true ); | ||
| 18 | |||
| 19 | // Check popup message if text is not available then it pass default text | ||
| 20 | if( ! empty(get_post_meta( $formid, 'popup_message', true ))){ | ||
| 21 | |||
| 22 | $items["popup_message"] = get_post_meta( $formid, 'popup_message', true ); | ||
| 23 | |||
| 24 | }else{ | ||
| 25 | |||
| 26 | $items["popup_message"] = "Form has been submitted successfully."; | ||
| 27 | |||
| 28 | } | ||
| 29 | |||
| 30 | // Check popup width if width is not available then it pass default width | ||
| 31 | if( ! empty(get_post_meta( $formid, 'm_popup_width', true ))){ | ||
| 32 | |||
| 33 | $items["m_popup_width"] = get_post_meta( $formid, 'm_popup_width', true ); | ||
| 34 | |||
| 35 | }else{ | ||
| 36 | |||
| 37 | $items["m_popup_width"] = "500px"; | ||
| 38 | |||
| 39 | } | ||
| 40 | |||
| 41 | // Check popup border radius if border radius is not available then it pass default border radius | ||
| 42 | if( ! empty(get_post_meta( $formid, 'm_popup_radius', true ))){ | ||
| 43 | |||
| 44 | $items["m_popup_radius"] = get_post_meta( $formid, 'm_popup_radius', true ); | ||
| 45 | |||
| 46 | }else{ | ||
| 47 | |||
| 48 | $items["m_popup_radius"] = "10px"; | ||
| 49 | |||
| 50 | } | ||
| 51 | |||
| 52 | // Check popup duration time if duration time is not available then it pass default duration time | ||
| 53 | if( ! empty(get_post_meta( $formid, 'm_popup_duration', true ))){ | ||
| 54 | |||
| 55 | $items["m_popup_duration"] = get_post_meta( $formid, 'm_popup_duration', true ); | ||
| 56 | |||
| 57 | }else{ | ||
| 58 | |||
| 59 | $items["m_popup_duration"] = "100000000000"; | ||
| 60 | |||
| 61 | } | ||
| 62 | |||
| 63 | // Check popup background option if option is not available then it pass popup background option | ||
| 64 | if( ! empty(get_post_meta( $formid, 'popup_background_option', true ))){ | ||
| 65 | |||
| 66 | $items["popup_background_option"] = get_post_meta( $formid, 'popup_background_option', true ); | ||
| 67 | |||
| 68 | }else{ | ||
| 69 | |||
| 70 | $items["popup_background_option"] = "bg_color"; | ||
| 71 | |||
| 72 | } | ||
| 73 | |||
| 74 | // Check popup background color if color is not available then it pass default color | ||
| 75 | if( ! empty(get_post_meta( $formid, 'popup_background_color', true ))){ | ||
| 76 | |||
| 77 | $items["popup_background_color"] = get_post_meta( $formid, 'popup_background_color', true ); | ||
| 78 | |||
| 79 | }else{ | ||
| 80 | |||
| 81 | $items["popup_background_color"] = "#fff"; | ||
| 82 | |||
| 83 | } | ||
| 84 | |||
| 85 | // Check popup background image if image is not available then it pass blank value | ||
| 86 | if( ! empty(get_post_meta( $formid, 'popup_image_color', true ))){ | ||
| 87 | |||
| 88 | $items["popup_image_color"] = get_post_meta( $formid, 'popup_image_color', true ); | ||
| 89 | |||
| 90 | }else{ | ||
| 91 | |||
| 92 | $items["popup_image_color"] = plugins_url( '/popup-message-for-contact-form-7/popup_img2.png'); | ||
| 93 | |||
| 94 | } | ||
| 95 | |||
| 96 | // Check popup background gradient color if gradient color is not available then it pass gradient color | ||
| 97 | if( ! empty(get_post_meta( $formid, 'popup_gradient_color', true ))){ | ||
| 98 | |||
| 99 | $items["popup_gradient_color"] = get_post_meta( $formid, 'popup_gradient_color', true ); | ||
| 100 | |||
| 101 | }else{ | ||
| 102 | |||
| 103 | $items["popup_gradient_color"] = "#fff"; | ||
| 104 | |||
| 105 | } | ||
| 106 | |||
| 107 | // Check popup background gradient color 2 if gradient color 2 is not available then it pass gradient color | ||
| 108 | if( ! empty(get_post_meta( $formid, 'popup_gradient_color1', true ))){ | ||
| 109 | |||
| 110 | $items["popup_gradient_color1"] = get_post_meta( $formid, 'popup_gradient_color1', true ); | ||
| 111 | |||
| 112 | }else{ | ||
| 113 | |||
| 114 | $items["popup_gradient_color1"] = "#FF0000"; | ||
| 115 | |||
| 116 | } | ||
| 117 | |||
| 118 | |||
| 119 | // Check popup text color if color is not available then it pass default color | ||
| 120 | if( ! empty(get_post_meta( $formid, 'popup_text_color', true ))){ | ||
| 121 | |||
| 122 | $items["popup_text_color"] = get_post_meta( $formid, 'popup_text_color', true ); | ||
| 123 | |||
| 124 | }else{ | ||
| 125 | |||
| 126 | $items["popup_text_color"] = "#000"; | ||
| 127 | |||
| 128 | } | ||
| 129 | |||
| 130 | // Check popup button text if text is not available then it pass default text | ||
| 131 | if( ! empty(get_post_meta( $formid, 'popup_button_text', true ))){ | ||
| 132 | |||
| 133 | $items["popup_button_text"] = get_post_meta( $formid, 'popup_button_text', true ); | ||
| 134 | |||
| 135 | }else{ | ||
| 136 | |||
| 137 | $items["popup_button_text"] = "Ok"; | ||
| 138 | |||
| 139 | } | ||
| 140 | |||
| 141 | // Check popup button background color if color is not available then it pass default color | ||
| 142 | if( ! empty(get_post_meta( $formid, 'popup_button_background_color', true ))){ | ||
| 143 | |||
| 144 | $items["popup_button_background_color"] = get_post_meta( $formid, 'popup_button_background_color', true ); | ||
| 145 | |||
| 146 | }else{ | ||
| 147 | |||
| 148 | $items["popup_button_background_color"] = "#3085d6"; | ||
| 149 | |||
| 150 | } | ||
| 151 | |||
| 152 | |||
| 153 | return $items; | ||
| 154 | } | ||
| 155 | |||
| 156 | function init() { | ||
| 157 | add_filter( 'wpcf7_ajax_json_echo', array( $this, 'CF7POPUP_wpcf7_ajax_json_echo'), 10, 2 ); | ||
| 158 | } | ||
| 159 | |||
| 160 | |||
| 161 | public static function instance() { | ||
| 162 | if (!isset(self::$instance)) { | ||
| 163 | self::$instance = new self(); | ||
| 164 | self::$instance->init(); | ||
| 165 | } | ||
| 166 | return self::$instance; | ||
| 167 | } | ||
| 168 | } | ||
| 169 | CF7POPUP_submit_menu::instance(); | ||
| 170 | } |
| ... | @@ -15263,6 +15263,56 @@ element.style { | ... | @@ -15263,6 +15263,56 @@ element.style { |
| 15263 | line-height: 25px; | 15263 | line-height: 25px; |
| 15264 | } | 15264 | } |
| 15265 | 15265 | ||
| 15266 | .modal-content { | ||
| 15267 | border-radius: 0px !important; | ||
| 15268 | } | ||
| 15269 | |||
| 15270 | .modal-header { | ||
| 15271 | border-bottom: 0px; | ||
| 15272 | } | ||
| 15273 | .modal-header h2, .modal-header .h2 { | ||
| 15274 | margin-top: 0px; | ||
| 15275 | } | ||
| 15276 | .modal-header .btn-close { | ||
| 15277 | top: -10px; | ||
| 15278 | position: relative; | ||
| 15279 | } | ||
| 15280 | |||
| 15281 | .modal-body { | ||
| 15282 | padding-top: 0px; | ||
| 15283 | } | ||
| 15284 | .modal-body a { | ||
| 15285 | color: #1A3668 !important; | ||
| 15286 | text-decoration: none; | ||
| 15287 | } | ||
| 15288 | .modal-body a:hover { | ||
| 15289 | text-decoration: underline; | ||
| 15290 | } | ||
| 15291 | |||
| 15292 | .modal-footer { | ||
| 15293 | border-top: 0px; | ||
| 15294 | } | ||
| 15295 | |||
| 15296 | .contest-close { | ||
| 15297 | background-color: transparent !important; | ||
| 15298 | text-transform: uppercase; | ||
| 15299 | max-width: 100px; | ||
| 15300 | float: right; | ||
| 15301 | border: 1px solid #183668 !important; | ||
| 15302 | color: #183668 !important; | ||
| 15303 | transition: ease-out 0.5s; | ||
| 15304 | margin-top: 20px; | ||
| 15305 | margin: auto; | ||
| 15306 | padding: 10px 20px; | ||
| 15307 | } | ||
| 15308 | |||
| 15309 | .contest-close:hover { | ||
| 15310 | background-color: transparent !important; | ||
| 15311 | color: #fff !important; | ||
| 15312 | box-shadow: inset 100px 0 0 0 #183668; | ||
| 15313 | transition: ease-out 0.5s; | ||
| 15314 | } | ||
| 15315 | |||
| 15266 | #wrapper-footer { | 15316 | #wrapper-footer { |
| 15267 | background-color: #183668; | 15317 | background-color: #183668; |
| 15268 | width: 100%; | 15318 | width: 100%; | ... | ... |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
| ... | @@ -65,6 +65,39 @@ $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'full' ); | ... | @@ -65,6 +65,39 @@ $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'full' ); |
| 65 | </div><!-- #content --> | 65 | </div><!-- #content --> |
| 66 | 66 | ||
| 67 | </div><!-- #<?php echo $wrapper_id; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ok. ?> --> | 67 | </div><!-- #<?php echo $wrapper_id; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ok. ?> --> |
| 68 | 68 | <div class="modal fade" id="contest_popup" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | |
| 69 | <div class="modal-dialog modal-dialog-centered"> | ||
| 70 | <div class="modal-content"> | ||
| 71 | <div class="modal-header"> | ||
| 72 | <h2 class="modal-title" id="exampleModalLabel">Thank you for your entry!</h2> | ||
| 73 | <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
| 74 | </div> | ||
| 75 | <div class="modal-body"> | ||
| 76 | 5 winners will be drawn on . If you’re one of them (fingers crossed), we’ll be in touch! For full giveaway details, go to <a href="https://stellervista.ca/giveaway-details/">Giveaway Details.</a> | ||
| 77 | |||
| 78 | </div> | ||
| 79 | <div class="modal-footer"> | ||
| 80 | <button type="button" class="contest-close" data-bs-dismiss="modal">Close</button> | ||
| 81 | </div> | ||
| 82 | </div> | ||
| 83 | </div> | ||
| 84 | </div> | ||
| 85 | <div class="modal fade" id="contact_popup" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
| 86 | <div class="modal-dialog modal-dialog-centered"> | ||
| 87 | <div class="modal-content"> | ||
| 88 | <div class="modal-header"> | ||
| 89 | <h2 class="modal-title" id="exampleModalLabel">Thank you!</h2> | ||
| 90 | <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
| 91 | </div> | ||
| 92 | <div class="modal-body"> | ||
| 93 | |||
| 94 | |||
| 95 | </div> | ||
| 96 | <div class="modal-footer"> | ||
| 97 | <button type="button" class="contest-close" data-bs-dismiss="modal">Close</button> | ||
| 98 | </div> | ||
| 99 | </div> | ||
| 100 | </div> | ||
| 101 | </div> | ||
| 69 | <?php | 102 | <?php |
| 70 | get_footer(); | 103 | get_footer(); | ... | ... |
| ... | @@ -6854,6 +6854,17 @@ | ... | @@ -6854,6 +6854,17 @@ |
| 6854 | $(this).parents('.wp-block-columns').attr("style", 'background-image:url(' + $(this).children('img').attr('src') + ');'); | 6854 | $(this).parents('.wp-block-columns').attr("style", 'background-image:url(' + $(this).children('img').attr('src') + ');'); |
| 6855 | $(this).children('img').hide(); | 6855 | $(this).children('img').hide(); |
| 6856 | }); | 6856 | }); |
| 6857 | document.addEventListener('wpcf7mailsent', function (event) { | ||
| 6858 | if ('6' == event.detail.contactFormId) { | ||
| 6859 | // Change 34 to the ID of the form | ||
| 6860 | jQuery('#contest_popup').modal('show'); //this is the bootstrap modal popup id | ||
| 6861 | } | ||
| 6862 | |||
| 6863 | if ('108' == event.detail.contactFormId) { | ||
| 6864 | // Change 34 to the ID of the form | ||
| 6865 | jQuery('#contact_popup').modal('show'); //this is the bootstrap modal popup id | ||
| 6866 | } | ||
| 6867 | }, false); | ||
| 6857 | }); | 6868 | }); |
| 6858 | 6869 | ||
| 6859 | exports.Alert = alert; | 6870 | exports.Alert = alert; | ... | ... |
This diff could not be displayed because it is too large.
This diff is collapsed.
Click to expand it.
This diff could not be displayed because it is too large.
| ... | @@ -9,5 +9,17 @@ jQuery( document ).ready(function($) { | ... | @@ -9,5 +9,17 @@ jQuery( document ).ready(function($) { |
| 9 | $(this).parents('.wp-block-columns').attr("style", 'background-image:url('+$(this).children('img').attr('src')+');') | 9 | $(this).parents('.wp-block-columns').attr("style", 'background-image:url('+$(this).children('img').attr('src')+');') |
| 10 | $(this).children('img').hide(); | 10 | $(this).children('img').hide(); |
| 11 | 11 | ||
| 12 | }) | ||
| 13 | }) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 12 | }); | ||
| 13 | |||
| 14 | document.addEventListener( 'wpcf7mailsent', function( event ) { | ||
| 15 | if ( '6' == event.detail.contactFormId ) { // Change 34 to the ID of the form | ||
| 16 | jQuery('#contest_popup').modal('show'); //this is the bootstrap modal popup id | ||
| 17 | } | ||
| 18 | if ( '108' == event.detail.contactFormId ) { // Change 34 to the ID of the form | ||
| 19 | jQuery('#contact_popup').modal('show'); //this is the bootstrap modal popup id | ||
| 20 | } | ||
| 21 | |||
| 22 | }, false ); | ||
| 23 | |||
| 24 | }) | ||
| 25 | ... | ... |
| ... | @@ -86,4 +86,54 @@ element.style { | ... | @@ -86,4 +86,54 @@ element.style { |
| 86 | color: #183668 !important; | 86 | color: #183668 !important; |
| 87 | font-size: 20px; | 87 | font-size: 20px; |
| 88 | line-height: 25px; | 88 | line-height: 25px; |
| 89 | } | ||
| 90 | |||
| 91 | .modal-content{ | ||
| 92 | border-radius: 0px !important; | ||
| 93 | } | ||
| 94 | |||
| 95 | .modal-header{ | ||
| 96 | border-bottom:0px ; | ||
| 97 | h2{ | ||
| 98 | margin-top: 0px; | ||
| 99 | } | ||
| 100 | .btn-close{ | ||
| 101 | top: -10px; | ||
| 102 | position: relative; | ||
| 103 | } | ||
| 104 | } | ||
| 105 | .modal-body { | ||
| 106 | padding-top: 0px; | ||
| 107 | a { | ||
| 108 | color:#1A3668 !important; | ||
| 109 | text-decoration: none; | ||
| 110 | } | ||
| 111 | a:hover{ | ||
| 112 | text-decoration: underline; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | |||
| 116 | |||
| 117 | |||
| 118 | .modal-footer{ | ||
| 119 | border-top:0px ; | ||
| 120 | } | ||
| 121 | |||
| 122 | .contest-close{ | ||
| 123 | background-color: transparent !important; | ||
| 124 | text-transform: uppercase; | ||
| 125 | max-width: 100px; | ||
| 126 | float: right; | ||
| 127 | border: 1px solid #183668 !important; | ||
| 128 | color: #183668 !important; | ||
| 129 | transition: ease-out 0.5s; | ||
| 130 | margin-top: 20px; | ||
| 131 | margin: auto; | ||
| 132 | padding: 10px 20px; | ||
| 133 | } | ||
| 134 | .contest-close:hover{ | ||
| 135 | background-color: transparent !important; | ||
| 136 | color: #fff !important; | ||
| 137 | box-shadow: inset 100px 0 0 0 #183668; | ||
| 138 | transition: ease-out 0.5s; | ||
| 89 | } | 139 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment