Plugin Directory

Changeset 1824833


Ignore:
Timestamp:
02/19/2018 09:01:53 PM (8 years ago)
Author:
norewp
Message:

New on load module, enhancement and tweaks.

Location:
modal-for-elementor
Files:
22 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • modal-for-elementor/trunk/css/popup.css

    r1795334 r1824833  
    1919        overflow-y: scroll !important;
    2020        overflow-x: hidden !important;
     21    }
     22}
     23
     24@media screen and (max-width: 1024px) {
     25    .modal {
     26        display: block;
     27        vertical-align: middle;
     28        width: 100%;
     29        margin: 0 auto;
     30        padding-top: 80px;
     31    }
     32   
     33    .modal.modal-onload {
     34        display: none;
    2135    }
    2236}
     
    5468    top: 0;
    5569}
     70
     71.modal-backdrop {
     72    display: none;
     73}
     74
     75.modal-footer .nothanks {
     76    background-color: #ffffff;
     77    color: #333333;
     78    padding: 8px 12px;
     79    cursor: pointer;
     80}
  • modal-for-elementor/trunk/js/popup.js

    r1675427 r1824833  
     1var isMobile = {
     2    Android: function() {
     3        return navigator.userAgent.match(/Android/i);
     4    },
     5    BlackBerry: function() {
     6        return navigator.userAgent.match(/BlackBerry/i);
     7    },
     8    iOS: function() {
     9        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
     10    },
     11    Opera: function() {
     12        return navigator.userAgent.match(/Opera Mini/i);
     13    },
     14    Windows: function() {
     15        return navigator.userAgent.match(/IEMobile/i);
     16    },
     17    any: function() {
     18        return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
     19    }
     20};
     21
    122jQuery(document).ready(function($){
    223    $('.modal-popup').click(function(){
  • modal-for-elementor/trunk/modal-for-elementor.php

    r1796990 r1824833  
    33* Plugin Name: PopBox For Elementor
    44* Description: Create content-rich popboxes for your site using the power of Elementor Page Builder
    5 * Version: 1.0.5
     5* Version: 1.0.6
    66* Author: Zulfikar Nore
    77* Author URI: https://designsbynore.com/
     
    1313if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    1414
    15 define( 'MODAL_ELEMENTOR_VERSION', '1.0.5' );
     15define( 'MODAL_ELEMENTOR_VERSION', '1.0.6' );
    1616
    1717define( 'MODAL_ELEMENTOR__FILE__', __FILE__ );
     
    119119        );
    120120    }
    121    
     121    wp_enqueue_script( 'jquery-cookie', plugin_dir_url( __FILE__ ) . 'js/jquery.cookie.js', array( 'jquery' ), null, false );
    122122    wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'js/bootstrap.js', array( 'jquery' ), null, true );
    123123    wp_enqueue_script( 'modal-popup-js', plugin_dir_url( __FILE__ ) . 'js/popup.js', array( 'jquery', 'bootstrap' ), null, true );
     124   
    124125}
    125126
  • modal-for-elementor/trunk/plugin.php

    r1772412 r1824833  
    33
    44use ElementorModal\Widgets\ElementorModal;
     5use ElementorModal\Widgets\ElementorModalLoad;
    56
    67if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     
    2627    private function includes() {
    2728        require __DIR__ . '/widgets/popup.php';
     29        require __DIR__ . '/widgets/popup-load.php';
    2830    }
    2931
    3032    private function register_widget() {
    3133        \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
     34        \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModalLoad() );
    3235        \Elementor\Plugin::instance()->elements_manager->add_category(
    3336            'norewp-elements',
    3437            [
    35                 'title' => 'NoreWP\'s Elementor Modules',
     38                'title' => __( 'NoreWP\'s Elementor Modules', 'modal-for-elementor' ),
    3639                'icon' => 'fa fa-plug'
    3740            ],
  • modal-for-elementor/trunk/readme.txt

    r1796990 r1824833  
    55Requires at least: 4.4
    66Tested up to: 4.9
    7 Stable tag: 1.0.5
     7Stable tag: 1.0.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Add a modal widget for Elementor Page Builder.
     11Adds a popup modal widget for Elementor Page Builder.
    1212
    1313== Description ==
    1414
    15 NOTE: Modal For Elementor is now PopBox For Elementor and development will now be continued by Zulfikar Nore of NoreWP :)
    16 
    1715PopBox for Elementor allows the creation of beautiful templates with Elementor Page Builder for use with the included Popbox overlay script.
    1816
    19 An Admin menu will be added on your Wordpress Dashboard sidepane named PopBoxes. This is the custom post type (CPT) you'll use to create the content of the PopBox.
     17An Admin menu will be added on your Wordpress Dashboard sidepane named PopBoxes. This is the custom post type (CPT) you'll use to create the content of the PopBoxs.
    2018
    2119A custom module will also be added to Elementor Page Builder edit screen to be used for the customization of the trigger button embedded on your page.
    2220Simply select one of the PopBox content created via the CPT to be shown when the trigger button is clicked.
    2321
    24 Brief video on setup (Sorry for the lack of sound): https://youtu.be/M3B9aLLTXKY
     22WP Elevation Studio Troy Dean shows us how to use PopBox for Elementor to create easy and stunning popup forms:
     23
     24https://www.youtube.com/watch?v=IFOGbLsAgo4
    2525
    2626
     
    3333
    3434== Changelog ==
     35
     36= 1.0.6 =
     37* NEW: Added On Page load popup module - does not fire on mobile devices.   
     38* NEW: Added a Switch control to load the stop Video propagation script when the popup is closed.
     39* EXPERIMENTAL: Track PopBox button click event through Google Analytics - needs testing and feedback.
     40* NEW: Regenerated a new pot file easier plugin translation       
     41* TWEAKS: Minor CSS tweaks
     42
    3543= 1.0.5 =
    3644* FIX: PHP Error of undefined variable $close
  • modal-for-elementor/trunk/widgets/popup.php

    r1796990 r1824833  
    2424    }
    2525    public function get_title() {
    26         return __( 'PopBox', 'modal-for-elementor' );
     26        return __( 'PopBox: On Click', 'modal-for-elementor' );
    2727    }
    2828    public function get_icon() {
     
    189189       
    190190        $this->add_control(
     191            'ga_track_event_on',
     192            [
     193                'label' => __( 'Turn on GA Track Event?', 'modal-for-elementor' ),
     194                'type' => Controls_Manager::SWITCHER,
     195                'default' => '',
     196                'label_on' => 'YES',
     197                'label_off' => 'NO',
     198                'return_value' => 'yes',
     199                'description' => __( 'Track the PopBox button click event throught Google Analytics.', 'modal-for-elementor' ),
     200            ]
     201        );
     202       
     203        $this->add_control(
     204            'ga_tracking_info',
     205            [
     206                'label' => __( 'EXPERIMENTAL: Feedback on results & if working or not will be greatly appreciated!', 'modal-for-elementor' ),
     207                'type' => Controls_Manager::RAW_HTML,
     208                'condition' => [
     209                    'ga_track_event_on' => 'yes',
     210                ],
     211            ]
     212        );
     213       
     214        $this->add_control(
     215            'ga_track_event',
     216            [
     217                'label' => __( 'Google Track Text', 'modal-for-elementor' ),
     218                'type' => Controls_Manager::TEXT,
     219                'default' => __( 'PopBox Button Clicked', 'modal-for-elementor' ),
     220                'description' => __( 'Enter text to be sent to Google Analytics as part of the button click event - the PopBox title would be ideal!', 'modal-for-elementor' ),
     221                'condition' => [
     222                    'ga_track_event_on' => 'yes',
     223                ],
     224            ]
     225        );
     226       
     227        $this->add_control(
     228            'ga_tracking_notes',
     229            [
     230                'label' => __( 'NOTE: You need to have Google Analytics enabled for this to work!', 'modal-for-elementor' ),
     231                'type' => Controls_Manager::RAW_HTML,
     232                'condition' => [
     233                    'ga_track_event_on' => 'yes',
     234                ],
     235            ]
     236        );
     237       
     238        $this->add_control(
    191239            'view',
    192240            [
     
    201249            'section_popup',
    202250            [
    203                 'label' => __( 'Modal Content', 'modal-for-elementor' ),
     251                'label' => __( 'PopBox Content', 'modal-for-elementor' ),
    204252            ]
    205253        );
     
    211259                'default' => $this->get_popups()['first_popup'],
    212260                'options' => $this->get_popups()['popups'],
     261            ]
     262        );
     263       
     264        $this->add_control(
     265            'modal_has_video',
     266            [
     267                'label' => __( 'Video Content?', 'modal-for-elementor' ),
     268                'type' => Controls_Manager::SWITCHER,
     269                'default' => '',
     270                'label_on' => 'YES',
     271                'label_off' => 'NO',
     272                'return_value' => 'yes',
     273                'description' => __( 'Does the PopBox content contain a video? Setting this to Yes will stop the video from playing when the popup is closed.', 'modal-for-elementor' ),
    213274            ]
    214275        );
     
    447508
    448509        $this->end_controls_tab();
     510       
     511        $this->end_controls_tabs();
    449512
    450513        $this->end_controls_section();
     
    651714    }
    652715    protected function render() {
    653         $settings = $this->get_settings();
    654         $close = $settings['close_text'];
     716        $settings   = $this->get_settings();
     717        $close      = $settings['close_text'];     
     718        $has_video  = $settings['modal_has_video'];
     719        $ga_track   = $settings['ga_track_event'];
     720       
    655721        $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) );
     722       
    656723        if ( $selectedPopup->have_posts() ) {
    657724           
     
    681748            <!-- PopBox trigger button -->
    682749            <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
    683                 <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
     750                <a <?php echo $this->get_render_attribute_string( 'button' ); ?> onclick="ga('send', 'event', 'modal-popup-<?php echo $selectedPopup->post->ID; ?>', 'Click', '<?php echo $ga_track; ?>');" >
    684751                    <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>>
    685752                        <?php if ( ! empty( $settings['icon'] ) ) : ?>
     
    713780                </div>
    714781            </div>
    715             <script type="text/javascript">
    716                 (function($) {
    717                     $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {   
    718                         var $if = $(e.delegateTarget).find('iframe');
    719                         var src = $if.attr("src");
    720                         $if.attr("src", '/empty.html');
    721                         $if.attr("src", src);
    722                     });
    723                 })(jQuery);
    724             </script>
     782            <?php
     783            if ( $has_video ) { ?>
     784                <script type="text/javascript">
     785                    (function($) {
     786                        $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {   
     787                            var $if = $(e.delegateTarget).find('iframe');
     788                            var src = $if.attr("src");
     789                            $if.attr("src", '/empty.html');
     790                            $if.attr("src", src);
     791                        });
     792                    })(jQuery);
     793                </script>
    725794            <!-- PopBox -->
    726             <?php
     795            <?php }
    727796            wp_reset_postdata();
    728797           
Note: See TracChangeset for help on using the changeset viewer.