diff --git a/cp-ajax-comments-page.dev.js b/cp-ajax-comments-page.dev.js index beef4eb..5433ecc 100644 --- a/cp-ajax-comments-page.dev.js +++ b/cp-ajax-comments-page.dev.js @@ -3,7 +3,7 @@ CommentPress AJAX Comment Submission (in page) =============================================================== AUTHOR : Christian Wach -LAST MODIFIED : 16/09/2010 +LAST MODIFIED : 25/07/2012 DEPENDENCIES : jquery.js --------------------------------------------------------------- NOTES @@ -140,9 +140,9 @@ jQuery(document).ready(function($) { cpac_nice_append( response, - parent_id + ' .children:first li:last', + parent_id + ' .children:first > li:last', child_list, - parent_id + ' .children:first li:last' + parent_id + ' .children:first > li:last' ); } else { @@ -151,7 +151,7 @@ jQuery(document).ready(function($) { response, parent_id + ' .children:first', parent_id, - parent_id + ' .children:first li:last' + parent_id + ' .children:first > li:last' ); } @@ -164,9 +164,9 @@ jQuery(document).ready(function($) { cpac_nice_append( response, - 'ol.commentlist:first li:last', + 'ol.commentlist:first > li:last', comm_list, - 'ol.commentlist:first li:last' + 'ol.commentlist:first > li:last' ); } else { @@ -175,7 +175,7 @@ jQuery(document).ready(function($) { response, 'ol.commentlist:first', 'div.comments_container', - 'ol.commentlist:first li:last' + 'ol.commentlist:first > li:last' ); } @@ -201,7 +201,7 @@ jQuery(document).ready(function($) { - + /** * @description: do comment append @@ -210,6 +210,10 @@ jQuery(document).ready(function($) { */ function cpac_nice_append( response, content, target, last ) { + // test for undefined, which may happen on replies to comments + // which have lost their original context + if ( response === undefined || response === null ) { return; } + response.find(content) .hide() .appendTo(target); @@ -231,10 +235,14 @@ jQuery(document).ready(function($) { */ function cpac_nice_prepend( response, content, target, last ) { + // test for undefined, which may happen on replies to comments + // which have lost their original context + if ( response === undefined || response === null ) { return; } + response.find(content) .hide() .prependTo(target); - + // clean up cpac_cleanup( content, last ); @@ -254,7 +262,7 @@ jQuery(document).ready(function($) { // get the id of the last list item var last_id = jQuery(last).attr('id'); - + // construct new comment id var new_comm_id = '#comment-' + last_id.split('-')[2]; var comment = jQuery(new_comm_id); @@ -405,6 +413,7 @@ jQuery(document).ready(function($) { // get our data as object var response = jQuery(data); + //console.log( data ); // add comment cpac_add_comment( response ); diff --git a/cp-ajax-comments-page.js b/cp-ajax-comments-page.js index 4db37b2..cf16bf0 100644 --- a/cp-ajax-comments-page.js +++ b/cp-ajax-comments-page.js @@ -1 +1 @@ -if("undefined"!==typeof CommentpressAjaxSettings){var cpac_live=CommentpressAjaxSettings.cpac_live;var cpac_ajax_url=CommentpressAjaxSettings.cpac_ajax_url;var cpac_spinner_url=CommentpressAjaxSettings.cpac_spinner_url;var cpac_post_id=CommentpressAjaxSettings.cpac_post_id}var cpac_submitting=false;jQuery(document).ready(function(g){var e,f;function i(){jQuery("#respond_title").after('
');jQuery("#commentform").after(''+cpac_lang[0]+'');jQuery("#loading").hide();e=jQuery("#commentform");f=jQuery("#error");f.hide()}i();function c(){jQuery("#loading").hide();jQuery("#submit").removeAttr("disabled");jQuery("#submit").show();addComment.enableForm();cpac_submitting=false}function b(j){var m=e.find("#comment_parent").val();var o=jQuery("ol.commentlist:first");if(m!="0"){var n="#li-comment-"+m;var l=jQuery(n+" > .children:first");if(l[0]){h(j,n+" .children:first li:last",l,n+" .children:first li:last")}else{h(j,n+" .children:first",n,n+" .children:first li:last")}}else{if(o[0]){h(j,"ol.commentlist:first li:last",o,"ol.commentlist:first li:last")}else{h(j,"ol.commentlist:first","div.comments_container","ol.commentlist:first li:last")}}cp_enable_comment_permalink_clicks();var k=j.find("div.comments_container h3");jQuery("div.comments_container h3").replaceWith(k);e.find("#comment").val("")}function h(j,l,m,k){j.find(l).hide().appendTo(m);a(l,k)}function d(j,l,m,k){j.find(l).hide().prependTo(m);a(l,k)}function a(l,k){var j=jQuery(k).attr("id");var m="#comment-"+j.split("-")[2];var n=jQuery(m);addComment.cancelForm();n.css("background","#c2d8bc");jQuery(l).slideDown("slow",function(){jQuery.scrollTo(n,{duration:cp_scroll_speed,axis:"y",offset:cp_get_header_offset(),onAfter:function(){n.animate({backgroundColor:"#ffffff"},1000,function(){n.css("background","transparent")})}})})}jQuery("#commentform").live("submit",function(j){cpac_submitting=true;f.hide();if(e.find("#author")[0]){if(e.find("#author").val()==""){f.html(''+cpac_lang[1]+"");f.show();cpac_submitting=false;return false}if(e.find("#email").val()==""){f.html(''+cpac_lang[2]+"");f.show();cpac_submitting=false;return false}var k=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!k.test(e.find("#email").val())){f.html(''+cpac_lang[3]+"");f.show();if(j.preventDefault){j.preventDefault()}cpac_submitting=false;return false}}if(cp_tinymce=="1"){tinyMCE.triggerSave();addComment.disableForm()}if(e.find("#comment").val()==""){f.html(''+cpac_lang[4]+"");f.show();addComment.enableForm();cpac_submitting=false;return false}jQuery(this).ajaxSubmit({beforeSubmit:function(){jQuery("#loading").show();jQuery("#submit").attr("disabled","disabled");jQuery("#submit").hide()},error:function(l){f.empty();var m=l.responseText.match(/

(.*)<\/p>/);f.html(''+m[1]+"");f.show();c();return false},success:function(m){try{var l=jQuery(m);b(l);c()}catch(n){c();alert(cpac_lang[6]+"\n\n"+n)}}});return false})}); \ No newline at end of file +if("undefined"!==typeof CommentpressAjaxSettings){var cpac_live=CommentpressAjaxSettings.cpac_live;var cpac_ajax_url=CommentpressAjaxSettings.cpac_ajax_url;var cpac_spinner_url=CommentpressAjaxSettings.cpac_spinner_url;var cpac_post_id=CommentpressAjaxSettings.cpac_post_id}var cpac_submitting=false;jQuery(document).ready(function(g){var e,f;function i(){jQuery("#respond_title").after('

');jQuery("#commentform").after(''+cpac_lang[0]+'');jQuery("#loading").hide();e=jQuery("#commentform");f=jQuery("#error");f.hide()}i();function c(){jQuery("#loading").hide();jQuery("#submit").removeAttr("disabled");jQuery("#submit").show();addComment.enableForm();cpac_submitting=false}function b(j){var m=e.find("#comment_parent").val();var o=jQuery("ol.commentlist:first");if(m!="0"){var n="#li-comment-"+m;var l=jQuery(n+" > .children:first");if(l[0]){h(j,n+" .children:first > li:last",l,n+" .children:first > li:last")}else{h(j,n+" .children:first",n,n+" .children:first > li:last")}}else{if(o[0]){h(j,"ol.commentlist:first > li:last",o,"ol.commentlist:first > li:last")}else{h(j,"ol.commentlist:first","div.comments_container","ol.commentlist:first > li:last")}}cp_enable_comment_permalink_clicks();var k=j.find("div.comments_container h3");jQuery("div.comments_container h3").replaceWith(k);e.find("#comment").val("")}function h(j,l,m,k){if(j===undefined||j===null){return}j.find(l).hide().appendTo(m);a(l,k)}function d(j,l,m,k){if(j===undefined||j===null){return}j.find(l).hide().prependTo(m);a(l,k)}function a(l,k){var j=jQuery(k).attr("id");var m="#comment-"+j.split("-")[2];var n=jQuery(m);addComment.cancelForm();n.css("background","#c2d8bc");jQuery(l).slideDown("slow",function(){jQuery.scrollTo(n,{duration:cp_scroll_speed,axis:"y",offset:cp_get_header_offset(),onAfter:function(){n.animate({backgroundColor:"#ffffff"},1000,function(){n.css("background","transparent")})}})})}jQuery("#commentform").live("submit",function(j){cpac_submitting=true;f.hide();if(e.find("#author")[0]){if(e.find("#author").val()==""){f.html(''+cpac_lang[1]+"");f.show();cpac_submitting=false;return false}if(e.find("#email").val()==""){f.html(''+cpac_lang[2]+"");f.show();cpac_submitting=false;return false}var k=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!k.test(e.find("#email").val())){f.html(''+cpac_lang[3]+"");f.show();if(j.preventDefault){j.preventDefault()}cpac_submitting=false;return false}}if(cp_tinymce=="1"){tinyMCE.triggerSave();addComment.disableForm()}if(e.find("#comment").val()==""){f.html(''+cpac_lang[4]+"");f.show();addComment.enableForm();cpac_submitting=false;return false}jQuery(this).ajaxSubmit({beforeSubmit:function(){jQuery("#loading").show();jQuery("#submit").attr("disabled","disabled");jQuery("#submit").hide()},error:function(l){f.empty();var m=l.responseText.match(/

(.*)<\/p>/);f.html(''+m[1]+"");f.show();c();return false},success:function(m){try{var l=jQuery(m);b(l);c()}catch(n){c();alert(cpac_lang[6]+"\n\n"+n)}}});return false})}); \ No newline at end of file diff --git a/cp-ajax-comments.dev.js b/cp-ajax-comments.dev.js index 09b58fd..c8d4729 100644 --- a/cp-ajax-comments.dev.js +++ b/cp-ajax-comments.dev.js @@ -3,14 +3,14 @@ CommentPress AJAX Comment Submission =============================================================== AUTHOR : Christian Wach -LAST MODIFIED : 16/09/2010 +LAST MODIFIED : 25/07/2012 DEPENDENCIES : jquery.js --------------------------------------------------------------- NOTES This script enables AJAX comment posting when the CommentPress theme is active. -Based on the 'Ajax Comment Posting' WordPress plugin (version 2.0) +Based loosely on the 'Ajax Comment Posting' WordPress plugin (version 2.0) --------------------------------------------------------------- */ @@ -493,9 +493,9 @@ jQuery(document).ready(function($) { cpac_nice_append( response, - parent_id + ' > ol.children:first li:last', + parent_id + ' > ol.children:first > li:last', child_list, - parent_id + ' > ol.children:first li:last' + parent_id + ' > ol.children:first > li:last' ); } else { @@ -504,7 +504,7 @@ jQuery(document).ready(function($) { response, parent_id + ' > ol.children:first', parent_id, - parent_id + ' > ol.children:first li:last' + parent_id + ' > ol.children:first > li:last' ); } @@ -520,9 +520,9 @@ jQuery(document).ready(function($) { cpac_nice_append( response, - para_id + ' > ol.commentlist:first li:last', + para_id + ' > ol.commentlist:first > li:last', comm_list, - para_id + ' > ol.commentlist:first li:last' + para_id + ' > ol.commentlist:first > li:last' ); } else { @@ -531,7 +531,7 @@ jQuery(document).ready(function($) { response, para_id + ' > ol.commentlist:first', para_id, - para_id + ' > ol.commentlist:first li:last' + para_id + ' > ol.commentlist:first > li:last' ); } diff --git a/cp-ajax-comments.js b/cp-ajax-comments.js index b193d36..10a2e62 100644 --- a/cp-ajax-comments.js +++ b/cp-ajax-comments.js @@ -1 +1 @@ -if("undefined"!==typeof CommentpressAjaxSettings){var cpac_live=CommentpressAjaxSettings.cpac_live;var cpac_ajax_url=CommentpressAjaxSettings.cpac_ajax_url;var cpac_spinner_url=CommentpressAjaxSettings.cpac_spinner_url;var cpac_post_id=CommentpressAjaxSettings.cpac_post_id}var cpac_submitting=false;function cpac_ajax_callback(data){var diff=parseInt(data.cpac_comment_count)-parseInt(CommentpressAjaxSettings.cpac_comment_count);if(diff>0){for(var i=1;i<=diff;i++){var comment=eval("data.cpac_new_comment_"+i);cpac_add_new_comment(jQuery(comment.markup),comment.text_sig,comment.parent,comment.id);CommentpressAjaxSettings.cpac_comment_count++}}}function cpac_add_new_comment(o,m,g,f){var n=jQuery("div.comments_container");if(n.find("#li-comment-"+f)[0]){return}var b="#para_wrapper-"+m;var i="#para_heading-"+m;var k=jQuery(b+" ol.commentlist:first");if(g!="0"){var h="#li-comment-"+g;var e=jQuery(h+" > ol.children:first");if(e[0]){o.hide().css("background","#c2d8bc").appendTo(e).slideDown("fast",function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})})}else{o.wrap('

    ').parent().css("background","#c2d8bc").hide().appendTo(h).slideDown("fast",function(){o.parent().animate({backgroundColor:"#ffffff"},1000,function(){o.parent().css("background","transparent")})})}}else{if(k[0]){o.hide().css("background","#c2d8bc").appendTo(k).slideDown("fast",function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})})}else{o.wrap('
      ').parent().css("background","#c2d8bc").hide().prependTo(b).slideDown("fast",function(){o.parent().animate({backgroundColor:"#ffffff"},1000,function(){o.parent().css("background","transparent")})})}}var j=n.find(i+" a");var l=j.text().split(" ");var c=parseInt(l[0]);c++;l[0]=c;l[1]="Comments";if(c==1){l[1]="Comment"}j.text(l.join(" "));j.css("background","#c2d8bc");j.animate({backgroundColor:"#EFEFEF"},1000);var c=c.toString();var a="#textblock-"+m;var d=a+" span small";jQuery(d).html(c);if(c=="1"){jQuery(a+" span.commenticonbox a.para_permalink").addClass("has_comments");jQuery(d).css("visibility","visible")}cp_enable_comment_permalink_clicks();cp_setup_comment_headers()}function cpac_ajax_update(){if(cpac_submitting){return}jQuery.post(cpac_ajax_url,{action:"cpac_get_new_comments",last_count:CommentpressAjaxSettings.cpac_comment_count,post_id:cpac_post_id},function(a,b){if(b=="success"){cpac_ajax_callback(a)}},"json")}function cpac_ajax_updater(a){if(a=="1"){CommentpressAjaxSettings.interval=window.setInterval(cpac_ajax_update,5000)}else{window.clearInterval(CommentpressAjaxSettings.interval)}}jQuery(document).ready(function(g){cpac_ajax_updater(cpac_live);var e,f;function i(){jQuery("#respond_title").after('
      ');jQuery("#commentform").after(''+cpac_lang[0]+'');jQuery("#loading").hide();e=jQuery("#commentform");f=jQuery("#error");f.hide()}i();function c(){jQuery("#loading").hide();jQuery("#submit").removeAttr("disabled");jQuery("#submit").show();addComment.enableForm();cpac_submitting=false}function b(m){var t=e.find("#text_signature").val();var o=e.find("#comment_parent").val();var k="#para_wrapper-"+t;var p="#para_heading-"+t;if(o!="0"){var q="#li-comment-"+o;var n=jQuery(q+" > ol.children:first");if(n[0]){h(m,q+" > ol.children:first li:last",n,q+" > ol.children:first li:last")}else{h(m,q+" > ol.children:first",q,q+" > ol.children:first li:last")}}else{var s=jQuery(k+" > ol.commentlist:first");if(s[0]){h(m,k+" > ol.commentlist:first li:last",s,k+" > ol.commentlist:first li:last")}else{d(m,k+" > ol.commentlist:first",k,k+" > ol.commentlist:first li:last")}}jQuery("#respond").slideUp("fast",function(){addComment.cancelForm()});var r=m.find(p);jQuery(p).replaceWith(r);var l=r.text().split(" ")[0];j(t,l);cp_enable_comment_permalink_clicks();cp_setup_comment_headers();e.find("#comment").val("")}function h(k,m,n,l){if(k===undefined||k===null){return}k.find(m).hide().appendTo(n);a(m,l)}function d(k,m,n,l){if(k===undefined||k===null){return}k.find(m).hide().prependTo(n);a(m,l)}function a(m,l){var k=jQuery(l).attr("id");var n="#comment-"+k.split("-")[2];var o=jQuery(n);o.css("background","#c2d8bc");jQuery(m).slideDown("slow",function(){jQuery("#comments_sidebar .sidebar_contents_wrapper").scrollTo(o,{duration:cp_scroll_speed,axis:"y",onAfter:function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})}})})}function j(n,l){var l=l.toString();var k="#textblock-"+n;var m=k+" span small";jQuery(m).html(l);if(l=="1"){jQuery(k+" span.commenticonbox a.para_permalink").addClass("has_comments");jQuery(m).css("visibility","visible")}if(n!=""){var o=jQuery(k);cp_scroll_page(o)}else{cp_scroll_to_top(0,cp_scroll_speed)}}jQuery("#commentform").live("submit",function(k){cpac_submitting=true;f.hide();if(e.find("#author")[0]){if(e.find("#author").val()==""){f.html(''+cpac_lang[1]+"");f.show();cpac_submitting=false;return false}if(e.find("#email").val()==""){f.html(''+cpac_lang[2]+"");f.show();cpac_submitting=false;return false}var l=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!l.test(e.find("#email").val())){f.html(''+cpac_lang[3]+"");f.show();if(k.preventDefault){k.preventDefault()}cpac_submitting=false;return false}}if(cp_tinymce=="1"){tinyMCE.triggerSave();addComment.disableForm()}if(e.find("#comment").val()==""){f.html(''+cpac_lang[4]+"");f.show();addComment.enableForm();cpac_submitting=false;return false}jQuery(this).ajaxSubmit({beforeSubmit:function(){jQuery("#loading").show();jQuery("#submit").attr("disabled","disabled");jQuery("#submit").hide()},error:function(m){f.empty();var n=m.responseText.match(/

      (.*)<\/p>/);f.html(''+n[1]+"");f.show();c();return false},success:function(n){try{var m=jQuery(n);b(m);c()}catch(o){c();alert(cpac_lang[6]+"\n\n"+o)}}});return false})}); \ No newline at end of file +if("undefined"!==typeof CommentpressAjaxSettings){var cpac_live=CommentpressAjaxSettings.cpac_live;var cpac_ajax_url=CommentpressAjaxSettings.cpac_ajax_url;var cpac_spinner_url=CommentpressAjaxSettings.cpac_spinner_url;var cpac_post_id=CommentpressAjaxSettings.cpac_post_id}var cpac_submitting=false;function cpac_ajax_callback(data){var diff=parseInt(data.cpac_comment_count)-parseInt(CommentpressAjaxSettings.cpac_comment_count);if(diff>0){for(var i=1;i<=diff;i++){var comment=eval("data.cpac_new_comment_"+i);cpac_add_new_comment(jQuery(comment.markup),comment.text_sig,comment.parent,comment.id);CommentpressAjaxSettings.cpac_comment_count++}}}function cpac_add_new_comment(o,m,g,f){var n=jQuery("div.comments_container");if(n.find("#li-comment-"+f)[0]){return}var b="#para_wrapper-"+m;var i="#para_heading-"+m;var k=jQuery(b+" ol.commentlist:first");if(g!="0"){var h="#li-comment-"+g;var e=jQuery(h+" > ol.children:first");if(e[0]){o.hide().css("background","#c2d8bc").appendTo(e).slideDown("fast",function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})})}else{o.wrap('

        ').parent().css("background","#c2d8bc").hide().appendTo(h).slideDown("fast",function(){o.parent().animate({backgroundColor:"#ffffff"},1000,function(){o.parent().css("background","transparent")})})}}else{if(k[0]){o.hide().css("background","#c2d8bc").appendTo(k).slideDown("fast",function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})})}else{o.wrap('
          ').parent().css("background","#c2d8bc").hide().prependTo(b).slideDown("fast",function(){o.parent().animate({backgroundColor:"#ffffff"},1000,function(){o.parent().css("background","transparent")})})}}var j=n.find(i+" a");var l=j.text().split(" ");var c=parseInt(l[0]);c++;l[0]=c;l[1]="Comments";if(c==1){l[1]="Comment"}j.text(l.join(" "));j.css("background","#c2d8bc");j.animate({backgroundColor:"#EFEFEF"},1000);var c=c.toString();var a="#textblock-"+m;var d=a+" span small";jQuery(d).html(c);if(c=="1"){jQuery(a+" span.commenticonbox a.para_permalink").addClass("has_comments");jQuery(d).css("visibility","visible")}cp_enable_comment_permalink_clicks();cp_setup_comment_headers()}function cpac_ajax_update(){if(cpac_submitting){return}jQuery.post(cpac_ajax_url,{action:"cpac_get_new_comments",last_count:CommentpressAjaxSettings.cpac_comment_count,post_id:cpac_post_id},function(a,b){if(b=="success"){cpac_ajax_callback(a)}},"json")}function cpac_ajax_updater(a){if(a=="1"){CommentpressAjaxSettings.interval=window.setInterval(cpac_ajax_update,5000)}else{window.clearInterval(CommentpressAjaxSettings.interval)}}jQuery(document).ready(function(g){cpac_ajax_updater(cpac_live);var e,f;function i(){jQuery("#respond_title").after('
          ');jQuery("#commentform").after(''+cpac_lang[0]+'');jQuery("#loading").hide();e=jQuery("#commentform");f=jQuery("#error");f.hide()}i();function c(){jQuery("#loading").hide();jQuery("#submit").removeAttr("disabled");jQuery("#submit").show();addComment.enableForm();cpac_submitting=false}function b(m){var t=e.find("#text_signature").val();var o=e.find("#comment_parent").val();var k="#para_wrapper-"+t;var p="#para_heading-"+t;if(o!="0"){var q="#li-comment-"+o;var n=jQuery(q+" > ol.children:first");if(n[0]){h(m,q+" > ol.children:first > li:last",n,q+" > ol.children:first > li:last")}else{h(m,q+" > ol.children:first",q,q+" > ol.children:first > li:last")}}else{var s=jQuery(k+" > ol.commentlist:first");if(s[0]){h(m,k+" > ol.commentlist:first > li:last",s,k+" > ol.commentlist:first > li:last")}else{d(m,k+" > ol.commentlist:first",k,k+" > ol.commentlist:first > li:last")}}jQuery("#respond").slideUp("fast",function(){addComment.cancelForm()});var r=m.find(p);jQuery(p).replaceWith(r);var l=r.text().split(" ")[0];j(t,l);cp_enable_comment_permalink_clicks();cp_setup_comment_headers();e.find("#comment").val("")}function h(k,m,n,l){if(k===undefined||k===null){return}k.find(m).hide().appendTo(n);a(m,l)}function d(k,m,n,l){if(k===undefined||k===null){return}k.find(m).hide().prependTo(n);a(m,l)}function a(m,l){var k=jQuery(l).attr("id");var n="#comment-"+k.split("-")[2];var o=jQuery(n);o.css("background","#c2d8bc");jQuery(m).slideDown("slow",function(){jQuery("#comments_sidebar .sidebar_contents_wrapper").scrollTo(o,{duration:cp_scroll_speed,axis:"y",onAfter:function(){o.animate({backgroundColor:"#ffffff"},1000,function(){o.css("background","transparent")})}})})}function j(n,l){var l=l.toString();var k="#textblock-"+n;var m=k+" span small";jQuery(m).html(l);if(l=="1"){jQuery(k+" span.commenticonbox a.para_permalink").addClass("has_comments");jQuery(m).css("visibility","visible")}if(n!=""){var o=jQuery(k);cp_scroll_page(o)}else{cp_scroll_to_top(0,cp_scroll_speed)}}jQuery("#commentform").live("submit",function(k){cpac_submitting=true;f.hide();if(e.find("#author")[0]){if(e.find("#author").val()==""){f.html(''+cpac_lang[1]+"");f.show();cpac_submitting=false;return false}if(e.find("#email").val()==""){f.html(''+cpac_lang[2]+"");f.show();cpac_submitting=false;return false}var l=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!l.test(e.find("#email").val())){f.html(''+cpac_lang[3]+"");f.show();if(k.preventDefault){k.preventDefault()}cpac_submitting=false;return false}}if(cp_tinymce=="1"){tinyMCE.triggerSave();addComment.disableForm()}if(e.find("#comment").val()==""){f.html(''+cpac_lang[4]+"");f.show();addComment.enableForm();cpac_submitting=false;return false}jQuery(this).ajaxSubmit({beforeSubmit:function(){jQuery("#loading").show();jQuery("#submit").attr("disabled","disabled");jQuery("#submit").hide()},error:function(m){f.empty();var n=m.responseText.match(/

          (.*)<\/p>/);f.html(''+n[1]+"");f.show();c();return false},success:function(n){try{var m=jQuery(n);b(m);c()}catch(o){c();alert(cpac_lang[6]+"\n\n"+o)}}});return false})}); \ No newline at end of file diff --git a/cp-ajax-comments.php b/cp-ajax-comments.php index e3a778e..3773cd7 100644 --- a/cp-ajax-comments.php +++ b/cp-ajax-comments.php @@ -2,7 +2,7 @@ /* Plugin Name: Commentpress Ajaxified -Version: 1.0.1 +Version: 1.0.2 Plugin URI: http://www.futureofthebook.org/commentpress/ Description: This plugin allows comments to be posted without leaving or refreshing the page as well as a number of other enhancements. Please note: this plugin only works with the official Commentpress theme. For Wordpress Multisite: do not network activate this plugin. For more information see the Commentpress Plugin docs. Author: Institute for the Future of the Book diff --git a/readme.txt b/readme.txt index 734bbdd..d65782a 100644 --- a/readme.txt +++ b/readme.txt @@ -32,6 +32,9 @@ TBA == Changelog == += 1.0.2 = +* Now allows lists in comments + = 1.0.1 = * Now works under https conditions