Plugin Directory

Changeset 1135874


Ignore:
Timestamp:
04/16/2015 04:43:26 AM (11 years ago)
Author:
endual
Message:

Updates for multipost pages, responsive design fix, CSS font fix, email creation updates. Bump to version 1.2.0

Location:
wp-customer-feedback/trunk
Files:
3 edited

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()});
     1jQuery(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  
    66Requires at least: 3.3
    77Tested up to: 4.2
    8 Stable tag: 1.1.1
     8Stable tag: 1.2.0
    99License: GPLv2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    100100[get-feedback color="blue" title="How did you find us?" delay="5"]
    101101
    102 = Why can't I see the feedback panel on the home page? =
     102= Why am I seeing the wrong feedback question? =
    103103
    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.
     104WP 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.
    105105
    106106== Screenshots ==
     
    111111
    112112== Changelog ==
     113
     114= 1.2.0 =
     115Added ability to show with non full page posts
     116Minor panel responsive design fix
     117Fixed CSS font variable issue
     118Updated email header
     119Stripping slashes from email body
     120Maintain linebreaks in feedback body
    113121
    114122= 1.1.1 =
  • wp-customer-feedback/trunk/wp-customer-feedback.php

    r1130346 r1135874  
    55 * Plugin URI: http://endual.com/wp-customer-feedback/
    66 * Description: Simple way to get user feedback for your site
    7  * Version: 1.1.1
     7 * Version: 1.2.0
    88 * Author: Adrian Gray
    99 * Author URI: http://endual.com/about-adrian-gray/
     
    4545    }
    4646    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);
    4848  }
    4949
    5050
    5151  function feedback_cb( $atts, $content ) {
    52     if ( !is_singular() ) {
    53       return;
    54     }
     52
     53    if ( isset($hasBeenCalled) ) { return; }
     54    static $hasBeenCalled = TRUE;
    5555
    5656    $atts = shortcode_atts(
     
    7171    $cookie = setcookie('wp-customer-feedback');
    7272    if ( isset( $_POST['comment'] ) ) {
    73       $comment = sanitize_text_field( $_POST["comment"] );
     73      $comment = implode( "\n", array_map( 'sanitize_text_field', explode( "\n", $_POST['comment'] ) ) );
    7474      $email = sanitize_text_field( $_POST["email"] );
    7575      if ( $email == '' ) {
     
    8080      $message .= "----------------------------\n";
    8181      $message .= "comment:\n\n";
    82       $message .= $comment;
     82      $message .= stripslashes($comment);
    8383      $to = get_option( 'admin_email' );
     84      $header = 'From: '.get_bloginfo('name').' <'.get_option( 'admin_email' ).'>';
    8485      $subject = 'New feedback for ' . get_option( 'blogname' );
    85       wp_mail($to, $subject, $message);
     86      wp_mail($to, $subject, $message, $header);
    8687    }
    8788    die();
Note: See TracChangeset for help on using the changeset viewer.