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 / free-dashboard / admin.js
wordpress-popup / lib / free-dashboard Last commit date
admin.css 9 years ago admin.js 9 years ago module.php 9 years ago
admin.js
131 lines
1 jQuery(function() {
2 var el_notice = jQuery( ".frash-notice" ),
3 type = el_notice.find( "input[name=type]" ).val(),
4 plugin_id = el_notice.find( "input[name=plugin_id]" ).val(),
5 url_wp = el_notice.find( "input[name=url_wp]" ).val(),
6 drip_plugin = el_notice.find( "input[name=drip_plugin]" ).val(),
7 inp_email = el_notice.find( "input[name=email]" )
8 btn_act = el_notice.find( ".frash-notice-act" ),
9 btn_dismiss = el_notice.find( ".frash-notice-dismiss" )
10 ajax_data = {};
11
12 ajax_data.plugin_id = plugin_id;
13 ajax_data.type = type;
14
15 function init_email() {
16 if ( ! inp_email.length ) { return; }
17
18 // Adjust the size of the email field to its contents.
19 function adjust_email_size() {
20 var width, tmp = jQuery( "<span></span>" );
21
22 tmp.addClass( "input-field" ).text( inp_email.val() );
23 tmp.appendTo( "body" );
24 width = parseInt( tmp.width() );
25 tmp.remove();
26
27 inp_email.width( width + 34 );
28 }
29
30 function email_keycheck( ev ) {
31 if ( 13 === ev.keyCode ) {
32 btn_act.click();
33 } else {
34 adjust_email_size();
35 }
36 }
37
38 inp_email.keyup( email_keycheck ).focus().select();
39 adjust_email_size();
40 }
41
42 // Display the notice after the page was loaded.
43 function initialize() {
44 el_notice.fadeIn( 500 );
45 init_email();
46 }
47
48 // Hide the notice after a CTA button was clicked
49 function remove_notice() {
50 el_notice.fadeTo( 100 , 0, function() {
51 el_notice.slideUp( 100, function() {
52 el_notice.remove();
53 });
54 });
55 }
56
57 // Open a tab to rate the plugin.
58 function act_rate() {
59 var url = url_wp.replace( /\/plugins\//, "/support/view/plugin-reviews/" ) + "?rate=5#postform",
60 link = jQuery( '<a href="' + url + '" target="_blank">Rate</a>' );
61
62 link.appendTo( "body" );
63 link[0].click();
64 link.remove();
65 }
66
67 // Submit the user to our email list.
68 function act_email() {
69 var email = inp_email.val();
70
71 // First create a new subscriber.
72 _dcq.push([
73 "identify",
74 { email: email }
75 ]);
76
77 // Then trigger the specified rule.
78 _dcq.push([
79 "track",
80 "Free plugin email course",
81 {"Plugin": drip_plugin}
82 ]);
83 }
84
85 // Notify WordPress about the users choice and close the message.
86 function notify_wordpress( action, message ) {
87 el_notice.attr( "data-message", message );
88 el_notice.addClass( "loading" );
89
90 ajax_data.action = action;
91 jQuery.post(
92 window.ajaxurl,
93 ajax_data,
94 remove_notice
95 );
96 }
97
98 // Handle click on the primary CTA button.
99 // Either open the wp.org page or submit the email address.
100 btn_act.click(function( ev ) {
101 ev.preventDefault();
102
103 switch ( type ) {
104 case 'rate': act_rate(); break;
105 case 'email': act_email(); break;
106 }
107
108 notify_wordpress( "frash_act", btn_act.data( "msg" ) );
109 });
110
111 // Dismiss the notice without any action.
112 btn_dismiss.click(function( ev ) {
113 ev.preventDefault();
114
115 notify_wordpress( "frash_dismiss", btn_dismiss.data( "msg" ) );
116 });
117
118 window.setTimeout( initialize, 500 );
119 });
120
121 // Drip integration
122 var _dcq = _dcq || [];
123 var _dcs = _dcs || {};
124
125 _dcs.account = '6994213';
126 var dc = document.createElement( 'script' );
127 dc.type = 'text/javascript'; dc.async = true;
128 dc.src = '//tag.getdrip.com/6994213.js';
129 var s = document.getElementsByTagName('script')[0];
130 s.parentNode.insertBefore(dc, s);
131 // End of drip integration