PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 5.1.1
Hustle – Email Marketing, Lead Generation, Optins, Popups v5.1.1
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / wpmu-lib / view / pointer.php
wordpress-popup / lib / wpmu-lib / view Last commit date
list.php 9 years ago pointer.php 9 years ago
pointer.php
101 lines
1 <?php
2 /**
3 * Code-snippet for WordPress pointers.
4 * Used in function lib3()->html->pointer()
5 *
6 * @since 1.0.0
7 *
8 * Variables:
9 * - $pointer_id
10 * - $html_el
11 * - $title
12 * - $body
13 * - $once
14 * - $modal
15 * - $blur
16 */
17
18 $class = 'wpmui-pointer prepared';
19 if ( ! empty( $title ) ) {
20 $title = '<h3>' . $title . '</h3>';
21 } else {
22 $title = '';
23 $class .= ' no-title';
24 }
25
26 $code = sprintf(
27 '<div class="%3$s">%1$s<p>%2$s</p></div>',
28 $title,
29 $body,
30 esc_attr( $class )
31 );
32
33 // Remove linebreaks to avoid JS errors
34 $code = str_replace( array("\r", "\n"), '', $code );
35
36 ?>
37 <script>
38 jQuery(document).ready(function() {
39 var wpcontent = jQuery( '#wpbody' ),
40 body = jQuery( 'body' );
41
42 if ( jQuery().pointer !== undefined ) {
43 var target = jQuery( '<?php echo $html_el; ?>' );
44 if ( ! target.length ) { return; }
45 target = target.first();
46
47 <?php if ( $blur ) : ?>
48 wpcontent.addClass( 'wpmui-blur' );
49 <?php else : ?>
50 body.addClass( 'no-blur' );
51 <?php endif; ?>
52
53 <?php if ( $modal ) : ?>
54 var modal = wpmUi._make_modal( 'light' );
55 if ( undefined !== modal ) {
56 modal.on( 'click', function( ev ) {
57 target.pointer( 'close' );
58 });
59 } else {
60 wpmUi._close_modal();
61 }
62 <?php endif; ?>
63
64 // Insert the pointer HTML code
65 target.pointer({
66 content: '<?php echo $code; ?>',
67 position: {
68 edge: 'left',
69 align: 'center'
70 },
71 close: function() {
72 <?php if ( $blur ) : ?>
73 wpcontent.removeClass( 'wpmui-blur' );
74 <?php else : ?>
75 body.removeClass( 'no-blur' );
76 <?php endif; ?>
77
78 <?php if ( $modal ) : ?>
79 wpmUi._close_modal();
80 <?php endif; ?>
81
82 <?php if ( $once ) : ?>
83 jQuery.post( ajaxurl, {
84 pointer: '<?php echo esc_js( $pointer_id ) ?>',
85 action: 'dismiss-wp-pointer'
86 });
87 <?php endif; ?>
88 }
89 }).pointer('open');
90
91 // Modify the default pointer style
92 jQuery( '.wpmui-pointer.prepared' ).each(function() {
93 var me = jQuery(this),
94 ptr = me.closest('.wp-pointer');
95 me.removeClass('prepared');
96 ptr.addClass( me.attr( 'class' ) );
97 me.removeClass('wpmui-pointer');
98 });
99 }
100 });
101 </script>