Changeset 1038437
- Timestamp:
- 12/04/2014 09:14:47 PM (11 years ago)
- Location:
- because/trunk
- Files:
-
- 7 edited
-
README.txt (modified) (2 diffs)
-
public/assets/css/public.css (modified) (3 diffs)
-
public/assets/js/public.js (modified) (6 diffs)
-
public/class-social-polling.php (modified) (1 diff)
-
public/includes/class-sp_comments.php (modified) (2 diffs)
-
public/includes/templates/sp_comments.php (modified) (1 diff)
-
social-polling.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
because/trunk/README.txt
r1037006 r1038437 7 7 Tested up to: 4.0 8 8 <<<<<<< .mine 9 Stable tag: 1.5. 19 Stable tag: 1.5.2 10 10 ======= 11 Stable tag: 1.5. 111 Stable tag: 1.5.2 12 12 >>>>>>> .r969865 13 13 License: GPLv2 or later … … 22 22 A more engaged community. More traffic. Better page rank. Audience insight. By better serving users, Because can better serve sites. Think of it as a new wave comment section. 23 23 24 [youtube http ://www.youtube.com/watch?v=t_3Lc1CvmiQ]24 [youtube https://www.youtube.com/watch?v=HuuabAzUpAQ] 25 25 26 26 == Installation == -
because/trunk/public/assets/css/public.css
r1037006 r1038437 518 518 } 519 519 520 <<<<<<< .mine 520 521 #commentform .comment-form-comment label{ 521 522 margin: 0 0 10px 0; … … 530 531 border-radius: 3px; 531 532 border: 1px solid #cccccc!important; 533 } 534 535 #respond .comment-characters-remaining{ 536 font-size: 14px; 532 537 } 533 538 … … 586 591 587 592 593 ======= 594 #commentform .comment-form-comment label{ 595 margin: 0 0 10px 0; 596 float: none!important; 597 } 598 599 600 #respond textarea{ 601 width: 100%!important; 602 height: auto!important; 603 padding: 3px!important; 604 border-radius: 3px; 605 border: 1px solid #cccccc!important; 606 } 607 608 609 610 /*.joindiscussion, 611 .comment-form #submit{ 612 background-color:#499bea; 613 margin:auto; 614 display:block; 615 font-size: 2em; 616 font-weight: 100; 617 width:90%; 618 letter-spacing: -0.04em; 619 color:#ffffff; 620 text-shadow: 1px 1px #666; 621 min-height:2em; 622 }*/ 623 624 .joindiscussion, .comment-form #submit{ 625 color: white!important; 626 background: #bcbcbc!important; 627 padding: 4px 8px 4px 8px!important; 628 display: inline-block!important; 629 border-radius: 3px!important; 630 border: 0!important; 631 font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif !important; 632 font-weight: 200!important; 633 line-height: 1.5!important; 634 width: 80%!important; 635 font-size: 1.4em!important; 636 text-transform: initial!important; 637 display: block!important; 638 margin: 0 auto!important; 639 margin-bottom: 10px !important; 640 box-shadow: none!important; 641 text-shadow:none!important; 642 background-image: none!important; 643 float: none!important; 644 height: auto!important; 645 text-indent: 0!important; 646 } 647 648 #respond .form-submit{ 649 margin: 10px 0 20px 0; 650 } 651 652 #submit:HOVER 653 { 654 background-color:#9F9F9F!important; 655 } 656 .form-allowed-tags{ 657 display: none!important; 658 659 } 660 661 662 >>>>>>> .r1038433 588 663 /* 589 664 //---------------------------- -
because/trunk/public/assets/js/public.js
r1037006 r1038437 117 117 success:function(data){ 118 118 119 var answer_1 = data.social_poll_answer_1; 120 121 var answer_2 = data.social_poll_answer_2; 122 123 124 var answer_1_votes = data.social_poll_answer_1.total_votes; 125 126 var answer_2_votes = data.social_poll_answer_2.total_votes; 127 var answer_1_percent = (answer_1_votes/(answer_1_votes+answer_2_votes)*100).toFixed(2); 128 var answer_2_percent = (answer_2_votes/(answer_1_votes+answer_2_votes)*100).toFixed(2); 129 130 var answer_1_text = data.social_poll_answer_1.answer_text; 131 132 var answer_2_text = data.social_poll_answer_2.answer_text; 133 134 135 136 var $results_html = '<div class="one_result_box" id="results_box_'+$post_id+'"><p><span class="results_answer_text">'+answer_1_text+'</span> :<span class="results_answer_value">'+answer_1_percent+'</span></p>' 137 138 +'<p><span class="results_answer_text">'+answer_2_text+'</span> :<span class="results_answer_value">'+answer_2_percent+'</div></p></div>'; 139 140 //$('#social_polling_see_results_wrapper').html($results_html); 141 142 143 144 //var $answer1_html = answer_1_text+' '+answer_1_votes; 145 146 //var $answer2_html = answer_2_text+' '+answer_2_votes; 147 148 149 var $answer1_html = '<h1>'+answer_1_percent+'%</h1>'; 150 151 var $answer2_html = '<h1>'+answer_2_percent+'%</h1>'; 152 153 154 155 $('#answer_1_wrapper .poll_results').html($answer1_html); 156 157 $('#answer_2_wrapper .poll_results').html($answer2_html); 158 159 160 setTimeout(function() { 161 var $comment_box_offset = $('#respond').offset().top + 'px'; 162 $("html, body").animate({ scrollTop: $comment_box_offset }, 450); 163 }, 2000); 164 165 //$('#social_polling_see_results_wrapper').html('You Already Voted'); 166 167 168 169 170 171 172 173 174 175 176 177 178 179 119 var answer_1 = data.social_poll_answer_1; 120 121 var answer_2 = data.social_poll_answer_2; 122 123 124 var answer_1_votes = data.social_poll_answer_1.total_votes; 125 126 var answer_2_votes = data.social_poll_answer_2.total_votes; 127 var answer_1_percent = (answer_1_votes/(answer_1_votes+answer_2_votes)*100).toFixed(2); 128 var answer_2_percent = (answer_2_votes/(answer_1_votes+answer_2_votes)*100).toFixed(2); 129 130 var answer_1_text = data.social_poll_answer_1.answer_text; 131 132 var answer_2_text = data.social_poll_answer_2.answer_text; 133 134 135 136 var $results_html = '<div class="one_result_box" id="results_box_'+$post_id+'"><p><span class="results_answer_text">'+answer_1_text+'</span> :<span class="results_answer_value">'+answer_1_percent+'</span></p>' 137 138 +'<p><span class="results_answer_text">'+answer_2_text+'</span> :<span class="results_answer_value">'+answer_2_percent+'</div></p></div>'; 139 140 141 var $answer1_html = '<h1>'+answer_1_percent+'%</h1>'; 142 var $answer2_html = '<h1>'+answer_2_percent+'%</h1>'; 143 144 145 146 $('#answer_1_wrapper .poll_results').html($answer1_html); 147 $('#answer_2_wrapper .poll_results').html($answer2_html); 148 149 150 setTimeout(function() { 151 var $comment_box_offset = $('#respond').offset().top + 'px'; 152 $("html, body").animate({ scrollTop: $comment_box_offset }, 450); 153 }, 1000); 154 155 // var $comment_box_offset = $('#respond').offset().top + 'px'; 156 // $("html, body").animate({ scrollTop: $comment_box_offset }, 450); 157 180 158 }//success 181 182 183 184 });//$.ajax({ 185 186 159 160 });//$.ajax({ 187 161 188 162 }//show_results 189 163 190 191 192 164 $(window).bind('mousewheel DOMMouseScroll', function(event){ 165 $("html, body").stop(); 166 }); 167 193 168 194 169 … … 354 329 355 330 356 //alert(data);357 358 //show_results($post_id);359 360 361 362 363 364 //console.log(data+ajaxurl);365 366 367 368 331 }//success 369 332 … … 432 395 433 396 434 //alert(data);435 436 //show_results($post_id);437 438 439 440 441 442 //console.log(data+ajaxurl);443 444 397 445 398 … … 482 435 //Character limit 483 436 484 jQuery('#commentform textarea#comment').keypress(function(e) {437 $('#commentform textarea#comment').keyup(function(e) { 485 438 486 439 487 440 488 jQuery('#commentform textarea#comment').attr('maxlength', 280); 489 490 491 492 var tval = jQuery('#commentform textarea#comment').val(), 493 494 tlength = tval.length, 495 496 set = 280, 497 498 remain = parseInt(set - tlength); 499 500 jQuery('#charcters_left').html(remain); 501 502 if (remain <= 0 && e.which !== 0 && e.charCode !== 0) { 503 504 jQuery('#commentform textarea').val((tval).substring(0, tlength - 1)) 505 506 } 441 $('#commentform textarea#comment').attr('maxlength', 280); 442 443 var tval = jQuery('#commentform textarea#comment').val(), 444 tlength = tval.length, 445 set = 280, 446 remain = parseInt(set - tlength); 447 448 $('#commentform .comment-characters-remaining span').text(remain); 449 450 if (remain <= 0 && e.which !== 0 && e.charCode !== 0) { 451 452 jQuery('#commentform textarea').val((tval).substring(0, tlength - 1)) 453 454 } 507 455 508 456 })//jQuery('#commentform textarea#comment').keypress(function(e) { … … 554 502 }) 555 503 504 <<<<<<< .mine 505 $('.reply-vote-share-container').mouseover(function(){ 506 clearTimeout($(this).data('timeout')); 507 }); 508 ======= 556 509 $('.reply-vote-share-container').mouseover(function(){ 557 510 clearTimeout(fadeOut); 558 511 }); 559 512 >>>>>>> .r1038433 513 514 <<<<<<< .mine 515 $('.reply-vote-share-container').mouseleave(function(){ 516 if($(this).children('.comment-social-share').css('opacity') === '1'){ 517 $(this).children('.comment-social-share').stop(); 518 var tempDiv = $(this); 519 fadeOut = setTimeout(function(){ 520 tempDiv.children('.comment-social-share').animate({ 521 opacity: 0 522 },300, function(){ 523 $(this).css('display','none'); 524 }); 525 },1000) 526 $(this).data('timeout', fadeOut); 527 } 528 ======= 560 529 $('.reply-vote-share-container').mouseleave(function(){ 561 530 if($(this).children('.comment-social-share').css('opacity') === '1'){ … … 571 540 572 541 } 542 >>>>>>> .r1038433 573 543 574 544 -
because/trunk/public/class-social-polling.php
r1032678 r1038437 92 92 add_action( 'output_social_poll_action', array( $this, 'output_social_poll' )); 93 93 94 add_filter('wp_insert_comment', array( $this, 'message_reply_email'), 2, 2 ); 94 // add_filter('wp_insert_comment', array( $this, 'message_reply_email'), 2, 2 ); 95 // add_filter('wp_insert_comment', array( $this, 'message_reply_email'), 2, 2 ); 96 95 97 // do_action( 'wp_insert_comment', $id, $comment ); 96 98 -
because/trunk/public/includes/class-sp_comments.php
r1037006 r1038437 1543 1543 }//CLASS spComments 1544 1544 1545 add_filter('comment_text', 'comment_vote_choice');1546 1547 function comment_vote_choice( $comment_text){1548 1549 $comment_ID = get_comment_ID();1545 // add_filter('comment_text', 'comment_vote_choice'); 1546 1547 // function comment_vote_choice( $comment_text){ 1548 1549 // $comment_ID = get_comment_ID(); 1550 1550 1551 $retVal = "<p";1551 // $retVal = "<span"; 1552 1552 1553 $test = get_comment_meta($comment_ID,"vote_choice",true);1554 1555 if ($test == "one"){1556 $retVal = $retVal . " class='comment_voted_a'";1557 }1558 elseif ($test == "two") {1559 $retVal = $retVal . " class='comment_voted_b'";1560 }1553 // $test = get_comment_meta($comment_ID,"vote_choice",true); 1554 1555 // if ($test == "one"){ 1556 // $retVal = $retVal . " class='comment_voted_a'"; 1557 // } 1558 // elseif ($test == "two") { 1559 // $retVal = $retVal . " class='comment_voted_b'"; 1560 // } 1561 1561 1562 $retVal = $retVal . ">$comment_text</p>"; 1563 1564 return $retVal; 1562 // $retVal = $retVal . ">$comment_text</span>"; 1563 1564 // return $retVal; 1565 // } 1566 1567 function comment_vote_choice($comment){ 1568 $vote_choice = get_comment_meta($comment->comment_ID,"vote_choice",true); 1569 if ($vote_choice == "one"){ 1570 return "comment_voted_a"; 1571 } 1572 elseif ($vote_choice == "two") { 1573 return "comment_voted_b"; 1574 } 1575 else{ 1576 return ""; 1577 } 1565 1578 } 1566 1579 … … 1661 1674 <div class="comment-collapse"> 1662 1675 1676 <<<<<<< .mine 1677 1678 <span class="<?php echo comment_vote_choice($comment); ?>"> 1663 1679 <?php comment_text() ?> 1680 </span> 1664 1681 1665 1682 1666 1683 1667 1684 1685 ======= 1686 <?php comment_text() ?> 1687 1688 1689 1690 1691 >>>>>>> .r1038433 1668 1692 <?php //Upvote DownVote Actions 1669 1693 -
because/trunk/public/includes/templates/sp_comments.php
r1023962 r1038437 90 90 if ($active){ 91 91 $args = array( 92 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" value="abcdefghj">Thanks for your vote! Want to expand on that opinion? We want to know what you think!</textarea></p>' 92 'comment_field' => '<label class="comment-characters-remaining" for"comment"><span id="characters_left">280</span> Characters Left</label> 93 <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" value="abcdefghj"> 94 Thanks for your vote! Want to expand on that opinion? We want to know what you think! 95 </textarea></p>' 93 96 ); 94 97 comment_form($args); -
because/trunk/social-polling.php
r1037006 r1038437 34 34 35 35 <<<<<<< .mine 36 * Version: 1.5. 136 * Version: 1.5.2 37 37 ======= 38 * Version: 1.5. 138 * Version: 1.5.2 39 39 >>>>>>> .r969865 40 40
Note: See TracChangeset
for help on using the changeset viewer.