Changeset 1824833
- Timestamp:
- 02/19/2018 09:01:53 PM (8 years ago)
- Location:
- modal-for-elementor
- Files:
-
- 22 added
- 1 deleted
- 6 edited
-
tags/1.0.6 (added)
-
tags/1.0.6/css (added)
-
tags/1.0.6/css/bootstrap.css (added)
-
tags/1.0.6/css/popup.css (added)
-
tags/1.0.6/css/rtl.popup.css (added)
-
tags/1.0.6/js (added)
-
tags/1.0.6/js/bootstrap.js (added)
-
tags/1.0.6/js/jquery.cookie.js (added)
-
tags/1.0.6/js/popup.js (added)
-
tags/1.0.6/languages (added)
-
tags/1.0.6/languages/lm-modal-he_IL.mo (added)
-
tags/1.0.6/languages/lm-modal-he_IL.po (added)
-
tags/1.0.6/languages/modal-for-elementor.pot (added)
-
tags/1.0.6/modal-for-elementor.php (added)
-
tags/1.0.6/plugin.php (added)
-
tags/1.0.6/readme.txt (added)
-
tags/1.0.6/widgets (added)
-
tags/1.0.6/widgets/popup-load.php (added)
-
tags/1.0.6/widgets/popup.php (added)
-
trunk/css/popup.css (modified) (2 diffs)
-
trunk/js/jquery.cookie.js (added)
-
trunk/js/popup.js (modified) (1 diff)
-
trunk/languages/lm-modal.pot (deleted)
-
trunk/languages/modal-for-elementor.pot (added)
-
trunk/modal-for-elementor.php (modified) (3 diffs)
-
trunk/plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/widgets/popup-load.php (added)
-
trunk/widgets/popup.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modal-for-elementor/trunk/css/popup.css
r1795334 r1824833 19 19 overflow-y: scroll !important; 20 20 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; 21 35 } 22 36 } … … 54 68 top: 0; 55 69 } 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 1 var 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 1 22 jQuery(document).ready(function($){ 2 23 $('.modal-popup').click(function(){ -
modal-for-elementor/trunk/modal-for-elementor.php
r1796990 r1824833 3 3 * Plugin Name: PopBox For Elementor 4 4 * Description: Create content-rich popboxes for your site using the power of Elementor Page Builder 5 * Version: 1.0. 55 * Version: 1.0.6 6 6 * Author: Zulfikar Nore 7 7 * Author URI: https://designsbynore.com/ … … 13 13 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly 14 14 15 define( 'MODAL_ELEMENTOR_VERSION', '1.0. 5' );15 define( 'MODAL_ELEMENTOR_VERSION', '1.0.6' ); 16 16 17 17 define( 'MODAL_ELEMENTOR__FILE__', __FILE__ ); … … 119 119 ); 120 120 } 121 121 wp_enqueue_script( 'jquery-cookie', plugin_dir_url( __FILE__ ) . 'js/jquery.cookie.js', array( 'jquery' ), null, false ); 122 122 wp_enqueue_script( 'bootstrap', plugin_dir_url( __FILE__ ) . 'js/bootstrap.js', array( 'jquery' ), null, true ); 123 123 wp_enqueue_script( 'modal-popup-js', plugin_dir_url( __FILE__ ) . 'js/popup.js', array( 'jquery', 'bootstrap' ), null, true ); 124 124 125 } 125 126 -
modal-for-elementor/trunk/plugin.php
r1772412 r1824833 3 3 4 4 use ElementorModal\Widgets\ElementorModal; 5 use ElementorModal\Widgets\ElementorModalLoad; 5 6 6 7 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly … … 26 27 private function includes() { 27 28 require __DIR__ . '/widgets/popup.php'; 29 require __DIR__ . '/widgets/popup-load.php'; 28 30 } 29 31 30 32 private function register_widget() { 31 33 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() ); 34 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModalLoad() ); 32 35 \Elementor\Plugin::instance()->elements_manager->add_category( 33 36 'norewp-elements', 34 37 [ 35 'title' => 'NoreWP\'s Elementor Modules',38 'title' => __( 'NoreWP\'s Elementor Modules', 'modal-for-elementor' ), 36 39 'icon' => 'fa fa-plug' 37 40 ], -
modal-for-elementor/trunk/readme.txt
r1796990 r1824833 5 5 Requires at least: 4.4 6 6 Tested up to: 4.9 7 Stable tag: 1.0. 57 Stable tag: 1.0.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Add amodal widget for Elementor Page Builder.11 Adds a popup modal widget for Elementor Page Builder. 12 12 13 13 == Description == 14 14 15 NOTE: Modal For Elementor is now PopBox For Elementor and development will now be continued by Zulfikar Nore of NoreWP :)16 17 15 PopBox for Elementor allows the creation of beautiful templates with Elementor Page Builder for use with the included Popbox overlay script. 18 16 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 .17 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 PopBoxs. 20 18 21 19 A 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. 22 20 Simply select one of the PopBox content created via the CPT to be shown when the trigger button is clicked. 23 21 24 Brief video on setup (Sorry for the lack of sound): https://youtu.be/M3B9aLLTXKY 22 WP Elevation Studio Troy Dean shows us how to use PopBox for Elementor to create easy and stunning popup forms: 23 24 https://www.youtube.com/watch?v=IFOGbLsAgo4 25 25 26 26 … … 33 33 34 34 == 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 35 43 = 1.0.5 = 36 44 * FIX: PHP Error of undefined variable $close -
modal-for-elementor/trunk/widgets/popup.php
r1796990 r1824833 24 24 } 25 25 public function get_title() { 26 return __( 'PopBox ', 'modal-for-elementor' );26 return __( 'PopBox: On Click', 'modal-for-elementor' ); 27 27 } 28 28 public function get_icon() { … … 189 189 190 190 $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( 191 239 'view', 192 240 [ … … 201 249 'section_popup', 202 250 [ 203 'label' => __( ' ModalContent', 'modal-for-elementor' ),251 'label' => __( 'PopBox Content', 'modal-for-elementor' ), 204 252 ] 205 253 ); … … 211 259 'default' => $this->get_popups()['first_popup'], 212 260 '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' ), 213 274 ] 214 275 ); … … 447 508 448 509 $this->end_controls_tab(); 510 511 $this->end_controls_tabs(); 449 512 450 513 $this->end_controls_section(); … … 651 714 } 652 715 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 655 721 $selectedPopup = new WP_Query( array( 'p' => $settings['popup'], 'post_type' => 'elementor-popup' ) ); 722 656 723 if ( $selectedPopup->have_posts() ) { 657 724 … … 681 748 <!-- PopBox trigger button --> 682 749 <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; ?>');" > 684 751 <span <?php echo $this->get_render_attribute_string( 'content-wrapper' ); ?>> 685 752 <?php if ( ! empty( $settings['icon'] ) ) : ?> … … 713 780 </div> 714 781 </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> 725 794 <!-- PopBox --> 726 <?php 795 <?php } 727 796 wp_reset_postdata(); 728 797
Note: See TracChangeset
for help on using the changeset viewer.