Changeset 1135874
- Timestamp:
- 04/16/2015 04:43:26 AM (11 years ago)
- Location:
- wp-customer-feedback/trunk
- Files:
-
- 3 edited
-
js/feedback.js (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wp-customer-feedback.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-customer-feedback/trunk/js/feedback.js
r1130346 r1135874 1 jQuery(document).ready(function(e){var n,t,a,i,r,c, p,o,l,f,d;return r=!1,i=!1,n=function(){var n,t,a;return a=endual.title,n=endual.color,this.delay=1e3*endual.delay,t='<div id="cfbp-panel">',t+='<form accept-charset="UTF-8" action="" data-remote="true" id="wp-cfbp" method="post">',t+='<div class="cfbp-rating-header">',t+="<h3 id='cfbp-title'>"+a+"</h3>",t+='<div class="cfbp-close">X</div>',t+="</div>",t+='<div class="cfbp-comment">',t+='<textarea name="comment" placeholder="'+a+'"></textarea>',t+='<input class="cfbp-email" type="email" name="email" placeholder="Your email address?"></textarea>',t+='<input class="cfbp-rating-submit" name="commit" type="submit" value="Submit">',t+="</div>",t+="</form>",t+="</div>",e("body").append(t),e(".cfbp-rating-header").css({background:n}),e("<style type='text/css'> .hilite{ color:"+n+";} .checked{ color:"+n+";}</style>").appendTo("head")},o=function(){return c(),e(window).on("resize",p),e(window).on("scroll",p),e("#cfbp-panel .cfbp-rating-header").click(function(){return l()}),e("#cfbp-panel .cfbp-close").click(function(e){return e.stopPropagation(),d()}),e("#cfbp-panel .cfbp-close").hide(),e("#wp-cfbp").submit(function(){var n,a;return a=e("#wp-cfbp").serializeArray(),n={},e.map(a,function(e){return n[e.name]=e.value}),n.action="process_form_data",e.post(endual.ajaxurl,n,t),!1})},c=function(){var n,t;return t=e(window).innerHeight()+2,n=e(window).width()-400,e("#cfbp-panel").css({transform:"translate( "+n+"px, "+t+"px )"}),f()},f=function(){var n;return n=e(window).innerHeight()-30,e("#cfbp-panel").delay(this.delay).animate({top:"-32"},600,"swing",function(){return r=!0})},d=function(){var n;if(i)return i=!1,r=!1,e("#cfbp-panel .cfbp-close").hide(),n=e(window).innerHeight()-30,e("#cfbp-panel").animate({top:"-32"},600,"swing",function(){return r=!1})},p=function(){var n,t;if(i||r)return t=e(window).innerHeight()-30,r&&(t+=32),n=e(window).width()-400,e("#cfbp-panel").css({transform:"translate( "+n+"px, "+t+"px )"})},l=function(){var n;if(!i)return i=!0,e("#cfbp-panel .cfbp-close").show(),n=258,e("#cfbp-panel").animate({top:"-="+n},600)},t=function(){var n;return e("#cfbp-panel .cfbp-comment").html("<br /><br /><p>Thanks for the feedback!</p>"),n=e(window).innerHeight()+2,e("#cfbp-panel").animate({top:"+=130"},600).delay(3e3).animate({top:"+=200"},600,"swing",a),e(window).off("resize",p)},a=function(){return e("#cfbp-panel").hide()},n(),o()});1 jQuery(document).ready(function(e){var n,t,a,i,r,c,o,p,l,f,d,u,s,b,m;return l=!1,p=!1,n=30,a=300,t=400,i=function(){var n,t,a;return a=endual.title,n=endual.color,this.delay=1e3*endual.delay,t='<div id="cfbp-panel">',t+='<form accept-charset="UTF-8" action="" data-remote="true" id="wp-cfbp" method="post">',t+='<div class="cfbp-rating-header">',t+="<h3 id='cfbp-title'>"+a+"</h3>",t+='<div class="cfbp-close">X</div>',t+="</div>",t+='<div class="cfbp-comment">',t+='<textarea name="comment" placeholder="'+a+'"></textarea>',t+='<input class="cfbp-email" type="email" name="email" placeholder="Your email address?"></textarea>',t+='<input class="cfbp-rating-submit" name="commit" type="submit" value="Submit">',t+="</div>",t+="</form>",t+="</div>",e("body").append(t),e(".cfbp-rating-header").css({background:n}),e("<style type='text/css'> .hilite{ color:"+n+";} .checked{ color:"+n+";}</style>").appendTo("head")},u=function(){return f(),e(window).on("resize",d),e(window).on("scroll",d),e("#cfbp-panel .cfbp-rating-header").click(function(){return s()}),e("#cfbp-panel .cfbp-close").click(function(e){return e.stopPropagation(),m()}),e("#cfbp-panel .cfbp-close").hide(),e("#wp-cfbp").submit(function(){var n,t;return t=e("#wp-cfbp").serializeArray(),n={},e.map(t,function(e){return n[e.name]=e.value}),n.action="process_form_data",e.post(endual.ajaxurl,n,r),!1})},f=function(){var n,t;return t=e(window).innerHeight()+2,n=c(),e("#cfbp-panel").css({transform:"translate( "+n+"px, "+t+"px )"}),b()},c=function(){var n;return n=e(window).width()-t<0?(e(window).width()-a)/2+a:t,e(window).width()-n},b=function(){var t;return t=e(window).innerHeight()-n,e("#cfbp-panel").delay(this.delay).animate({top:"-32"},600,"swing",function(){return l=!0})},m=function(){var t;if(p)return p=!1,l=!1,e("#cfbp-panel .cfbp-close").hide(),t=e(window).innerHeight()-n,e("#cfbp-panel").animate({top:"-32"},600,"swing",function(){return l=!1})},d=function(){var t,a;if(p||l)return a=e(window).innerHeight()-n,l&&(a+=32),t=c(),e("#cfbp-panel").css({transform:"translate( "+t+"px, "+a+"px )"})},s=function(){var n;if(!p)return p=!0,e("#cfbp-panel .cfbp-close").show(),n=258,e("#cfbp-panel").animate({top:"-="+n},600)},r=function(){var n;return e("#cfbp-panel .cfbp-comment").html("<br /><br /><p>Thanks for the feedback!</p>"),n=e(window).innerHeight()+2,e("#cfbp-panel").animate({top:"+=130"},600).delay(3e3).animate({top:"+=200"},600,"swing",o),e(window).off("resize",d)},o=function(){return e("#cfbp-panel").hide()},i(),u()}); -
wp-customer-feedback/trunk/readme.txt
r1130346 r1135874 6 6 Requires at least: 3.3 7 7 Tested up to: 4.2 8 Stable tag: 1. 1.18 Stable tag: 1.2.0 9 9 License: GPLv2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 100 100 [get-feedback color="blue" title="How did you find us?" delay="5"] 101 101 102 = Why can't I see the feedback panel on the home page? =102 = Why am I seeing the wrong feedback question? = 103 103 104 The panel only displays on specific pages or posts - it won't show on a list of posts. If you set the homepage to display a page, and add [get-feedback] to the page, you should see the feedback panel.104 WP Customer Feedback uses the first request finds for a feedback panel. When you show a list of posts, such as with a blog, WP Customer Feeback will use the first relevant shortcode it finds. Which is considered 'first' depends on how the posts are show, but it is usually the first post created. 105 105 106 106 == Screenshots == … … 111 111 112 112 == Changelog == 113 114 = 1.2.0 = 115 Added ability to show with non full page posts 116 Minor panel responsive design fix 117 Fixed CSS font variable issue 118 Updated email header 119 Stripping slashes from email body 120 Maintain linebreaks in feedback body 113 121 114 122 = 1.1.1 = -
wp-customer-feedback/trunk/wp-customer-feedback.php
r1130346 r1135874 5 5 * Plugin URI: http://endual.com/wp-customer-feedback/ 6 6 * Description: Simple way to get user feedback for your site 7 * Version: 1. 1.17 * Version: 1.2.0 8 8 * Author: Adrian Gray 9 9 * Author URI: http://endual.com/about-adrian-gray/ … … 45 45 } 46 46 wp_enqueue_style( 'endual-feedback', plugins_url( '/css/feedback.css', __FILE__ ) ); 47 wp_register_script( 'endual-feedback', plugins_url( '/js/feedback.js', __FILE__ ), array( 'jquery' ), '1. 1.1', true);47 wp_register_script( 'endual-feedback', plugins_url( '/js/feedback.js', __FILE__ ), array( 'jquery' ), '1.2.0', true); 48 48 } 49 49 50 50 51 51 function feedback_cb( $atts, $content ) { 52 if ( !is_singular() ) { 53 return;54 }52 53 if ( isset($hasBeenCalled) ) { return; } 54 static $hasBeenCalled = TRUE; 55 55 56 56 $atts = shortcode_atts( … … 71 71 $cookie = setcookie('wp-customer-feedback'); 72 72 if ( isset( $_POST['comment'] ) ) { 73 $comment = sanitize_text_field( $_POST["comment"]);73 $comment = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $_POST['comment'] ) ) ); 74 74 $email = sanitize_text_field( $_POST["email"] ); 75 75 if ( $email == '' ) { … … 80 80 $message .= "----------------------------\n"; 81 81 $message .= "comment:\n\n"; 82 $message .= $comment;82 $message .= stripslashes($comment); 83 83 $to = get_option( 'admin_email' ); 84 $header = 'From: '.get_bloginfo('name').' <'.get_option( 'admin_email' ).'>'; 84 85 $subject = 'New feedback for ' . get_option( 'blogname' ); 85 wp_mail($to, $subject, $message );86 wp_mail($to, $subject, $message, $header); 86 87 } 87 88 die();
Note: See TracChangeset
for help on using the changeset viewer.