Changeset 263443 for spectacula-threaded-comments
- Timestamp:
- 07/14/2010 11:22:43 AM (16 years ago)
- Location:
- spectacula-threaded-comments/trunk
- Files:
-
- 5 edited
-
includes/spec-ajax.php (modified) (1 diff)
-
js/commenting.js (modified) (11 diffs)
-
js/commenting.min.js (modified) (1 diff)
-
style/comments-dark.css (modified) (9 diffs)
-
style/comments.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
spectacula-threaded-comments/trunk/includes/spec-ajax.php
r263193 r263443 107 107 $json[ $comment->comment_ID ][ 'comment_ID' ] = $comment->comment_ID; 108 108 $json[ $comment->comment_ID ][ 'comment_parent' ] = $comment->comment_parent; 109 $json[ $comment->comment_ID ][ 'comment_type' ] = empty( $comment->comment_type ) ? 'comment' : $comment->comment_type; 109 110 $json[ $comment->comment_ID ][ 'comment_post_ID' ] = $comment->comment_post_ID; 110 111 $json[ $comment->comment_ID ][ 'comment_approved' ] = $comment->comment_approved; -
spectacula-threaded-comments/trunk/js/commenting.js
r263286 r263443 90 90 // Rather than remove all the mark up for a deleted comment we'll just fold it up and empty it. 91 91 deleteComment: function( comment_ID, action ) { 92 var comment_exists = jQuery( 'ul#commentlist li#comment-' + comment_ID ).length;92 var comment_exists = jQuery( 'ul#commentlist li#comment-' + comment_ID + ', #trackback-list li#comment-' + comment_ID ).length; 93 93 94 94 if ( ! comment_exists ) … … 98 98 return true; 99 99 100 jQuery( ' ul#commentlistli#comment-' + comment_ID + ' > .comment-body' ).slideUp( 'slow', function( ) {100 jQuery( 'li#comment-' + comment_ID + ' > .comment-body' ).slideUp( 'slow', function( ) { 101 101 jQuery( this ).text( 'Deleted comment' ).slideDown( ).parent( 'li#comment-' + comment_ID ).addClass( 'deleted' ); 102 102 } ); … … 105 105 }, 106 106 107 newComment: function( html, comment_ID, parent_ID, scroll_to ) {108 var comment_exists = jQuery( 'ul#commentlist li#comment-' + comment_ID ).length, depth_class;107 newComment: function( html, comment_ID, parent_ID, scroll_to, comment_type ) { 108 var comment_exists = jQuery( 'ul#commentlist li#comment-' + comment_ID + ', #trackback-list li#comment-' + comment_ID ).length, depth_class; 109 109 110 110 // If comment is already there then lets remove the needs approval message. … … 115 115 } ); 116 116 // Undelete a comment 117 if ( jQuery( ' ul#commentlistli#comment-' + comment_ID ).hasClass( 'deleted' ) ) {118 jQuery( ' ul#commentlistli#comment-' + comment_ID + ' > .comment-body' ).slideUp( 'slow', function( ) {117 if ( jQuery( 'li#comment-' + comment_ID ).hasClass( 'deleted' ) ) { 118 jQuery( 'li#comment-' + comment_ID + ' > .comment-body' ).slideUp( 'slow', function( ) { 119 119 jQuery( this ).html( jQuery( html ).find( '.comment-body' ).html( ) ).slideDown( 'slow' ); 120 120 } ).removeClass( 'deleted' ); … … 125 125 126 126 // We're replying so we have to do something different 127 if ( parent_ID > 0 && jQuery( 'ul#commentlist li#comment-' + parent_ID ).length ) {127 if ( comment_type == 'comment' && parent_ID > 0 && jQuery( 'ul#commentlist li#comment-' + parent_ID ).length ) { 128 128 129 129 // Check there is a child UL to attach stuff to. … … 156 156 addComment.toggleToggleText( jQuery( '#comment-' + comment_ID ).closest( 'li:has(div.toggle)' ).children( '.toggle' ) ); 157 157 } else { 158 if ( commentingL10n.order === 'desc' ) 158 if ( comment_type !== 'comment' && jQuery( '#trackback-list' ).length ) { 159 jQuery( '#trackback-list' ).append( jQuery( html ).hide( ).addClass( 'rolledup' ) ); 160 } else if ( commentingL10n.order === 'desc' ) 159 161 jQuery( 'li#respond' ).after( jQuery( html ).hide( ).addClass( 'rolledup' ) ); 160 162 else … … 164 166 addComment.addToggles( ); 165 167 166 jQuery( 'ul#commentlist ' ).find( '.rolledup' ).slideDown( 500, function( ){168 jQuery( 'ul#commentlist, ul#trackback-list' ).find( '.rolledup' ).slideDown( 500, function( ){ 167 169 // Our comment is in place, now let us scroll to it once unrolled. 168 170 if ( scroll_to ) 169 171 jQuery.scrollTo( jQuery( '#comment-' + comment_ID ), { duration: 500 } ); 170 172 } ).removeClass( 'rolledup' ); 173 174 if ( comment_type !== 'comment' && jQuery( '#trackback-list' ).length ) 175 addComment.trackbackToggle( 400 ) 171 176 172 177 return true; … … 251 256 //addComment.myComments[] = d.comment_ID; 252 257 253 addComment.newComment( d.html, d.comment_ID, d.comment_parent, true );258 addComment.newComment( d.html, d.comment_ID, d.comment_parent, true, 'comment' ); 254 259 // Kill anything in the comment form and reset the reply button 255 260 addComment.cancelReply( ); … … 344 349 345 350 if ( d[i].action === 'approve' && d[i].html !== undefined && d[i].html !== null && d[i].html !== '' ) { 346 addComment.newComment( d[i].html, d[i].comment_ID, d[i].comment_parent, false );351 addComment.newComment( d[i].html, d[i].comment_ID, d[i].comment_parent, false, d[i].comment_type ); 347 352 } else { 348 353 addComment.deleteComment( d[i].comment_ID, d[i].action ); … … 351 356 } 352 357 } ); 358 }, 359 360 trackbackToggle: function( max_height ) { 361 362 if ( jQuery( '#trackback-list' ).height( ) > ( max_height > 0 ? max_height : 400 ) && ! jQuery( '#trackback-list' ).prev( '.trackback-toggle' ).length ) { 363 jQuery( '#trackback-list' ) 364 .hide( ) 365 .before( '<div class="trackback-toggle"><span class="toggle-text">' + commentingL10n.tb_show + '</span></div>' ) 366 .prev( '.trackback-toggle' ) 367 .click( function( ){ 368 jQuery( this ).toggleClass( 'active' ).next( '#trackback-list' ).slideToggle( 'fast', function( ){ 369 jQuery( this ) 370 .prev( '.trackback-toggle' ) 371 .children( '.toggle-text' ) 372 .text( jQuery( this ).css( 'display' ) === 'none' ? commentingL10n.tb_show : commentingL10n.tb_hide ); 373 } ); 374 } ); 375 } 376 353 377 }, 354 378 … … 396 420 397 421 // Hide trackbacks from view if they take up too much space. Too much is 400px in my opinion but then I don't really like them. :P 398 if ( $( '#trackback-list' ).height( ) > 400 ) { 399 $( '#trackback-list' ) 400 //.css( { height: $( '#trackback-list' ).height( ) } ) 401 .hide( ) 402 .before( '<div class="trackback-toggle"><span class="toggle-text">' + commentingL10n.tb_show + '</span></div>' ) 403 .prev( '.trackback-toggle' ) 404 .click( function( ){ 405 $( this ).toggleClass( 'active' ).next( '#trackback-list' ).slideToggle( 'fast', function( ){ 406 $( this ) 407 .prev( '.trackback-toggle' ) 408 .children( '.toggle-text' ) 409 .text( $( this ).css( 'display' ) === 'none' ? commentingL10n.tb_show : commentingL10n.tb_hide ); 410 } ); 411 } ); 412 } 422 addComment.trackbackToggle( 400 ); 413 423 414 424 // Hide trackbacks that show up in the comment stream. -
spectacula-threaded-comments/trunk/js/commenting.min.js
r263286 r263443 1 addComment={interval:0,replying:0,action_id:0,showOne:commentingL10n.rpl_show_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),hideOne:commentingL10n.rpl_hide_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),showMany:commentingL10n.rpl_show_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),hideMany:commentingL10n.rpl_hide_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),moveForm:function(c,b,d,a){var e=jQuery("#"+c+" > .comment-body .comment-meta").next().text(),f=jQuery("#"+c+" > .comment-body cite.fn").text();if(addComment.replying){addComment.cancelReply()}addComment.replying=b;jQuery("#comment-form #comment").focus().before(jQuery('<blockquote class="reply-quote"><cite>'+f+"</cite><p>"+(e.length>130?e.substring(0,129)+"…":e)+"</p></blockquote>").hide()).prev(".reply-quote").slideDown();jQuery("#comment-form input#comment_parent").attr({value:b});jQuery("#"+c+" > .comment-body ").find(".comment-reply-link").hide();jQuery("#comment-form #cancel-comment-reply-link").show();if(typeof jQuery.scrollTo=="function"){jQuery.scrollTo(jQuery("#respond"),{duration:500})}return false},cancelReply:function(){if(addComment.replying!==0){addComment.replying=0;jQuery("#comment-form .reply-quote").slideUp(500,function(){jQuery(this).remove()});jQuery("#comment-form input#comment_parent").attr({value:0});jQuery("#comment-form #cancel-comment-reply-link").hide();jQuery("#commentlist").find(".comment-reply-link").show()}jQuery("#comment-form .submit").attr({disabled:""}).removeClass("disabled");addComment.startInterval(true)},commentDepth:function(b){var a;if(b){a=jQuery("li#comment-"+b).attr("class").match(/\bdepth-(\d+)\b/i);return[1]!==undefined&&parseInt(a[1],10)>0?parseInt(a[1],10):1}else{return 0}},error:function(a){if(typeof a!=="string"){return false}jQuery("#comment-form .textarea-border").after(jQuery('<div class="error">'+a+"</div>").hide()).next(".error").slideDown("slow",function(){var b=jQuery(this);jQuery(this).css("FILTER","");jQuery(this)[0].style.filter="";setTimeout(function(){jQuery(b).slideUp("slow",function(){jQuery(this).remove()})},5000)});return true},deleteComment:function(b,c){var a=jQuery("ul#commentlist li#comment-"+b ).length;if(!a){return true}if(c=="unapprove"&&jQuery("ul#commentlist li#comment-"+b+" > .comment-body:has( .moderation )")){return true}jQuery("ul#commentlist li#comment-"+b+" > .comment-body").slideUp("slow",function(){jQuery(this).text("Deleted comment").slideDown().parent("li#comment-"+b).addClass("deleted")});return true},newComment:function(b,c,f,e){var a=jQuery("ul#commentlist li#comment-"+c).length,d;if(a){jQuery("ul#commentlist li#comment-"+c).find(".moderation").slideUp("slow",function(){jQuery(this).remove()});if(jQuery("ul#commentlist li#comment-"+c).hasClass("deleted")){jQuery("ul#commentlist li#comment-"+c+" > .comment-body").slideUp("slow",function(){jQuery(this).html(jQuery(b).find(".comment-body").html()).slideDown("slow")}).removeClass("deleted")}return true}if(f>0&&jQuery("ul#commentlist li#comment-"+f).length){if(!jQuery("ul#commentlist li#comment-"+f+" > ul.children").length){jQuery("ul#commentlist li#comment-"+f+" > div.comment-body").after('<ul class="children"></ul>')}jQuery("ul#commentlist li#comment-"+f+" > ul.children").append(jQuery(b).hide().addClass("rolledup"));d=jQuery("li#comment-"+f).attr("class").match(/(?:\s|^)depth-(\d+)\s?/i);if(d[1]!==null&&d[1].match(/\d+/)){jQuery("ul#commentlist li#comment-"+c).removeClass("depth-1 depth-2 depth-3 depth-4 depth-5 depth-6 depth-7 depth-8 depth-9 depth-10").addClass("depth-"+(parseInt(d[1],10)+1));if((parseInt(d[1],10)+1)>=commentingL10n.max_depth){jQuery("ul#commentlist li#comment-"+c+" > div.comment-body .comment-reply-link").remove()}}if(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").hasClass("hidden")){jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").removeClass("hidden").next("ul.children").slideDown("fast",function(){jQuery(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}addComment.toggleToggleText(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle"))}else{if(commentingL10n.order==="desc"){jQuery("li#respond").after(jQuery(b).hide().addClass("rolledup"))}else{jQuery("li#respond").before(jQuery(b).hide().addClass("rolledup"))}}addComment.addToggles();jQuery("ul#commentlist").find(".rolledup").slideDown(500,function(){if(e){jQuery.scrollTo(jQuery("#comment-"+c),{duration:500})}}).removeClass("rolledup");return true},submit:function(b){var a=false;jQuery(b).find(".vital").each(function(){var c=jQuery(this).attr("value");if(c===undefined||c===""){a=true;jQuery(this).addClass("oops");setTimeout(function(){jQuery("#comment-form .vital").removeClass("oops")},6000)}else{jQuery(this).removeClass("oops")}});if(a){addComment.error(commentingL10n.err_txt_mis);return false}addComment.startInterval(false);jQuery(b).ajaxSubmit({beforeSubmit:function(c){jQuery("#comment-form .submit").attr({disabled:"disabled"}).addClass("disabled")},type:"POST",data:{_spec_ajax:"Why are you looking at this POST data?",action:"new_comment_added",depth:addComment.commentDepth(addComment.replying)},error:function(c,d){var f;if(c.status===500){f=jQuery(c.responseText).text().replace(/(\s+|\t|\r\n|\n|\r)+/g," ");if(f===""||f===undefined){f=c.status+" "+c.statusText}addComment.error(f)}else{if(typeof d==="string"){addComment.error(d)}else{addComment.error("Oops!")}}addComment.cancelReply()},success:function(c){var g;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}addComment.cancelReply();return}addComment.newComment(g.html,g.comment_ID,g.comment_parent,true);addComment.cancelReply();jQuery("#comment-form #comment").val("")}});return false},addToggles:function(a){jQuery("#commentlist li.depth-"+commentingL10n.nest_depth+" > ul.children").each(function(){if(!jQuery(this).prev("div.toggle").length){jQuery(this).before(jQuery('<div class="toggle"></div>').hide().css({opacity:0}));jQuery(this).prev("div.toggle").show().fadeTo("slow",1,function(){jQuery(this).css("FILTER","");jQuery(this)[0].style.filter=""})}if(a===true){jQuery(this).hide().prev("div.toggle").addClass("hidden")}addComment.toggleToggleText(jQuery(this).prev("div.toggle"))})},toggleToggleText:function(a){if(typeof a!=="object"&&typeof a==="string"){a=jQuery(a)}a.each(function(){var c=jQuery(this).prev("div.comment-body").find("cite.fn").text(),b=jQuery(this).next("ul.children").find("li.comment").length;if(jQuery(this).hasClass("hidden")){jQuery(this).html(b==1?addComment.showOne:addComment.showMany)}else{jQuery(this).html(b==1?addComment.hideOne:addComment.hideMany)}jQuery(this).find(".post-count").text(b);jQuery(this).find(".poster-name").text(c!=""?c:commentingL10n.unknown)});return true},startInterval:function(a){if(a===true){if(undefined!==commentingL10n.update&&commentingL10n.update==1){addComment.interval=setInterval(function(){addComment.getCommentUpdates()},parseInt(commentingL10n.polling,10)>=10?commentingL10n.polling*1000:10000)}}else{clearInterval(addComment.interval)}},getCommentUpdates:function(){var a={_spec_ajax:"Why is everyone looking at me",action:"get_comment_changes",action_id:addComment.action_id,time:commentingL10n.time,post_id:commentingL10n.post_id};jQuery.post(commentingL10n.ajax_url,a,function(c){var g,b;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}return}if(g!==null&&g!==undefined){for(b in g){commentingL10n.time=g[b].log_date!==null?g[b].log_date:g[b].comment_date;addComment.action_id=g[b].action_id!==null?g[b].action_id:0;if(g[b].action==="approve"&&g[b].html!==undefined&&g[b].html!==null&&g[b].html!==""){addComment.newComment(g[b].html,g[b].comment_ID,g[b].comment_parent,false)}else{addComment.deleteComment(g[b].comment_ID,g[b].action)}}}})},_init:function(){jQuery(document).ready(function(a){addComment.startInterval(true);a.ajaxSetup({cache:false,timeout:(commentingL10n.polling*1000)-2000});a("form#comment-form").submit(function(){addComment.submit(this);return false});a("#cancel-comment-reply-link").click(function(){addComment.cancelReply();return false});addComment.addToggles(true);a("#commentlist div.toggle").live("click",function(){if(a(this).hasClass("hidden")){a(this).removeClass("hidden").next("ul.children").slideDown("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}else{a(this).addClass("hidden").next("ul.children").slideUp("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"top left"})})}addComment.toggleToggleText(jQuery(this))});if(a("#trackback-list").height()>400){a("#trackback-list").hide().before('<div class="trackback-toggle"><span class="toggle-text">'+commentingL10n.tb_show+"</span></div>").prev(".trackback-toggle").click(function(){a(this).toggleClass("active").next("#trackback-list").slideToggle("fast",function(){a(this).prev(".trackback-toggle").children(".toggle-text").text(a(this).css("display")==="none"?commentingL10n.tb_show:commentingL10n.tb_hide)})})}a("#commentlist li.pingback > .comment-body, #commentlist li.trackback > .comment-body").each(function(){var b=commentingL10n.tb_from.replace("%s",'<span class="tb-from">'+a(this).find("cite.fn").text()+"</span>");a(this).hide().before('<div class="trackback-toggle"></div>').prev(".trackback-toggle").html(b).click(function(){a(this).next(".comment-body").slideToggle("fast")})});a("#commentlist .comment-link").live("click",function(){var d=a(this).attr("href"),c=a(this).text(),b=a('<div class="comment-link-display"><span>'+c+'</span><input type="text" value="'+d+'" /></div>');a("body").append(b).find(".comment-link-display").css({position:"absolute",top:(a(this).offset().top-27)+"px",left:(a(this).offset().left+5)+"px",zIndex:100,opacity:0}).fadeTo("fast",1,function(){a(this).find("input").blur(function(){a(this).parents(".comment-link-display").fadeTo("fast",0,function(){a(this).remove()})});a(this).find("input").focus()});return false});a(".comment-link-display input").live("focus",function(){this.select()})})}};addComment._init();1 addComment={interval:0,replying:0,action_id:0,showOne:commentingL10n.rpl_show_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),hideOne:commentingL10n.rpl_hide_1.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),showMany:commentingL10n.rpl_show_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),hideMany:commentingL10n.rpl_hide_2.replace("%name%",'<span class="poster-name"></span>').replace("%count%",'<span class="post-count"> </span>'),moveForm:function(c,b,d,a){var e=jQuery("#"+c+" > .comment-body .comment-meta").next().text(),f=jQuery("#"+c+" > .comment-body cite.fn").text();if(addComment.replying){addComment.cancelReply()}addComment.replying=b;jQuery("#comment-form #comment").focus().before(jQuery('<blockquote class="reply-quote"><cite>'+f+"</cite><p>"+(e.length>130?e.substring(0,129)+"…":e)+"</p></blockquote>").hide()).prev(".reply-quote").slideDown();jQuery("#comment-form input#comment_parent").attr({value:b});jQuery("#"+c+" > .comment-body ").find(".comment-reply-link").hide();jQuery("#comment-form #cancel-comment-reply-link").show();if(typeof jQuery.scrollTo=="function"){jQuery.scrollTo(jQuery("#respond"),{duration:500})}return false},cancelReply:function(){if(addComment.replying!==0){addComment.replying=0;jQuery("#comment-form .reply-quote").slideUp(500,function(){jQuery(this).remove()});jQuery("#comment-form input#comment_parent").attr({value:0});jQuery("#comment-form #cancel-comment-reply-link").hide();jQuery("#commentlist").find(".comment-reply-link").show()}jQuery("#comment-form .submit").attr({disabled:""}).removeClass("disabled");addComment.startInterval(true)},commentDepth:function(b){var a;if(b){a=jQuery("li#comment-"+b).attr("class").match(/\bdepth-(\d+)\b/i);return[1]!==undefined&&parseInt(a[1],10)>0?parseInt(a[1],10):1}else{return 0}},error:function(a){if(typeof a!=="string"){return false}jQuery("#comment-form .textarea-border").after(jQuery('<div class="error">'+a+"</div>").hide()).next(".error").slideDown("slow",function(){var b=jQuery(this);jQuery(this).css("FILTER","");jQuery(this)[0].style.filter="";setTimeout(function(){jQuery(b).slideUp("slow",function(){jQuery(this).remove()})},5000)});return true},deleteComment:function(b,c){var a=jQuery("ul#commentlist li#comment-"+b+", #trackback-list li#comment-"+b).length;if(!a){return true}if(c=="unapprove"&&jQuery("ul#commentlist li#comment-"+b+" > .comment-body:has( .moderation )")){return true}jQuery("li#comment-"+b+" > .comment-body").slideUp("slow",function(){jQuery(this).text("Deleted comment").slideDown().parent("li#comment-"+b).addClass("deleted")});return true},newComment:function(b,c,g,f,e){var a=jQuery("ul#commentlist li#comment-"+c+", #trackback-list li#comment-"+c).length,d;if(a){jQuery("ul#commentlist li#comment-"+c).find(".moderation").slideUp("slow",function(){jQuery(this).remove()});if(jQuery("li#comment-"+c).hasClass("deleted")){jQuery("li#comment-"+c+" > .comment-body").slideUp("slow",function(){jQuery(this).html(jQuery(b).find(".comment-body").html()).slideDown("slow")}).removeClass("deleted")}return true}if(e=="comment"&&g>0&&jQuery("ul#commentlist li#comment-"+g).length){if(!jQuery("ul#commentlist li#comment-"+g+" > ul.children").length){jQuery("ul#commentlist li#comment-"+g+" > div.comment-body").after('<ul class="children"></ul>')}jQuery("ul#commentlist li#comment-"+g+" > ul.children").append(jQuery(b).hide().addClass("rolledup"));d=jQuery("li#comment-"+g).attr("class").match(/(?:\s|^)depth-(\d+)\s?/i);if(d[1]!==null&&d[1].match(/\d+/)){jQuery("ul#commentlist li#comment-"+c).removeClass("depth-1 depth-2 depth-3 depth-4 depth-5 depth-6 depth-7 depth-8 depth-9 depth-10").addClass("depth-"+(parseInt(d[1],10)+1));if((parseInt(d[1],10)+1)>=commentingL10n.max_depth){jQuery("ul#commentlist li#comment-"+c+" > div.comment-body .comment-reply-link").remove()}}if(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").hasClass("hidden")){jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle").removeClass("hidden").next("ul.children").slideDown("fast",function(){jQuery(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}addComment.toggleToggleText(jQuery("#comment-"+c).closest("li:has(div.toggle)").children(".toggle"))}else{if(e!=="comment"&&jQuery("#trackback-list").length){jQuery("#trackback-list").append(jQuery(b).hide().addClass("rolledup"))}else{if(commentingL10n.order==="desc"){jQuery("li#respond").after(jQuery(b).hide().addClass("rolledup"))}else{jQuery("li#respond").before(jQuery(b).hide().addClass("rolledup"))}}}addComment.addToggles();jQuery("ul#commentlist, ul#trackback-list").find(".rolledup").slideDown(500,function(){if(f){jQuery.scrollTo(jQuery("#comment-"+c),{duration:500})}}).removeClass("rolledup");if(e!=="comment"&&jQuery("#trackback-list").length){addComment.trackbackToggle(400)}return true},submit:function(b){var a=false;jQuery(b).find(".vital").each(function(){var c=jQuery(this).attr("value");if(c===undefined||c===""){a=true;jQuery(this).addClass("oops");setTimeout(function(){jQuery("#comment-form .vital").removeClass("oops")},6000)}else{jQuery(this).removeClass("oops")}});if(a){addComment.error(commentingL10n.err_txt_mis);return false}addComment.startInterval(false);jQuery(b).ajaxSubmit({beforeSubmit:function(c){jQuery("#comment-form .submit").attr({disabled:"disabled"}).addClass("disabled")},type:"POST",data:{_spec_ajax:"Why are you looking at this POST data?",action:"new_comment_added",depth:addComment.commentDepth(addComment.replying)},error:function(c,d){var f;if(c.status===500){f=jQuery(c.responseText).text().replace(/(\s+|\t|\r\n|\n|\r)+/g," ");if(f===""||f===undefined){f=c.status+" "+c.statusText}addComment.error(f)}else{if(typeof d==="string"){addComment.error(d)}else{addComment.error("Oops!")}}addComment.cancelReply()},success:function(c){var g;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}addComment.cancelReply();return}addComment.newComment(g.html,g.comment_ID,g.comment_parent,true,"comment");addComment.cancelReply();jQuery("#comment-form #comment").val("")}});return false},addToggles:function(a){jQuery("#commentlist li.depth-"+commentingL10n.nest_depth+" > ul.children").each(function(){if(!jQuery(this).prev("div.toggle").length){jQuery(this).before(jQuery('<div class="toggle"></div>').hide().css({opacity:0}));jQuery(this).prev("div.toggle").show().fadeTo("slow",1,function(){jQuery(this).css("FILTER","");jQuery(this)[0].style.filter=""})}if(a===true){jQuery(this).hide().prev("div.toggle").addClass("hidden")}addComment.toggleToggleText(jQuery(this).prev("div.toggle"))})},toggleToggleText:function(a){if(typeof a!=="object"&&typeof a==="string"){a=jQuery(a)}a.each(function(){var c=jQuery(this).prev("div.comment-body").find("cite.fn").text(),b=jQuery(this).next("ul.children").find("li.comment").length;if(jQuery(this).hasClass("hidden")){jQuery(this).html(b==1?addComment.showOne:addComment.showMany)}else{jQuery(this).html(b==1?addComment.hideOne:addComment.hideMany)}jQuery(this).find(".post-count").text(b);jQuery(this).find(".poster-name").text(c!=""?c:commentingL10n.unknown)});return true},startInterval:function(a){if(a===true){if(undefined!==commentingL10n.update&&commentingL10n.update==1){addComment.interval=setInterval(function(){addComment.getCommentUpdates()},parseInt(commentingL10n.polling,10)>=10?commentingL10n.polling*1000:10000)}}else{clearInterval(addComment.interval)}},getCommentUpdates:function(){var a={_spec_ajax:"Why is everyone looking at me",action:"get_comment_changes",action_id:addComment.action_id,time:commentingL10n.time,post_id:commentingL10n.post_id};jQuery.post(commentingL10n.ajax_url,a,function(c){var g,b;try{g=JSON.parse(c)}catch(f){if(typeof c==="string"){addComment.error(c)}else{addComment.error("Oops!")}return}if(g!==null&&g!==undefined){for(b in g){commentingL10n.time=g[b].log_date!==null?g[b].log_date:g[b].comment_date;addComment.action_id=g[b].action_id!==null?g[b].action_id:0;if(g[b].action==="approve"&&g[b].html!==undefined&&g[b].html!==null&&g[b].html!==""){addComment.newComment(g[b].html,g[b].comment_ID,g[b].comment_parent,false,g[b].comment_type)}else{addComment.deleteComment(g[b].comment_ID,g[b].action)}}}})},trackbackToggle:function(a){if(jQuery("#trackback-list").height()>(a>0?a:400)&&!jQuery("#trackback-list").prev(".trackback-toggle").length){jQuery("#trackback-list").hide().before('<div class="trackback-toggle"><span class="toggle-text">'+commentingL10n.tb_show+"</span></div>").prev(".trackback-toggle").click(function(){jQuery(this).toggleClass("active").next("#trackback-list").slideToggle("fast",function(){jQuery(this).prev(".trackback-toggle").children(".toggle-text").text(jQuery(this).css("display")==="none"?commentingL10n.tb_show:commentingL10n.tb_hide)})})}},_init:function(){jQuery(document).ready(function(a){addComment.startInterval(true);a.ajaxSetup({cache:false,timeout:(commentingL10n.polling*1000)-2000});a("form#comment-form").submit(function(){addComment.submit(this);return false});a("#cancel-comment-reply-link").click(function(){addComment.cancelReply();return false});addComment.addToggles(true);a("#commentlist div.toggle").live("click",function(){if(a(this).hasClass("hidden")){a(this).removeClass("hidden").next("ul.children").slideDown("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"bottom right"})})}else{a(this).addClass("hidden").next("ul.children").slideUp("fast",function(){a(this).prev("div.toggle").css({backgroundPosition:"top left"})})}addComment.toggleToggleText(jQuery(this))});addComment.trackbackToggle(400);a("#commentlist li.pingback > .comment-body, #commentlist li.trackback > .comment-body").each(function(){var b=commentingL10n.tb_from.replace("%s",'<span class="tb-from">'+a(this).find("cite.fn").text()+"</span>");a(this).hide().before('<div class="trackback-toggle"></div>').prev(".trackback-toggle").html(b).click(function(){a(this).next(".comment-body").slideToggle("fast")})});a("#commentlist .comment-link").live("click",function(){var d=a(this).attr("href"),c=a(this).text(),b=a('<div class="comment-link-display"><span>'+c+'</span><input type="text" value="'+d+'" /></div>');a("body").append(b).find(".comment-link-display").css({position:"absolute",top:(a(this).offset().top-27)+"px",left:(a(this).offset().left+5)+"px",zIndex:100,opacity:0}).fadeTo("fast",1,function(){a(this).find("input").blur(function(){a(this).parents(".comment-link-display").fadeTo("fast",0,function(){a(this).remove()})});a(this).find("input").focus()});return false});a(".comment-link-display input").live("focus",function(){this.select()})})}};addComment._init(); -
spectacula-threaded-comments/trunk/style/comments-dark.css
r263286 r263443 53 53 } 54 54 55 #comments ul#trackback-list { 56 display: block; 57 } 58 55 59 #comments .trackback-toggle, 56 60 #comments ul#commentlist div.toggle, 57 61 #comments ul#commentlist li .comment-body { 58 62 background-color: #222; 59 border: solid 1px #444;63 border: dotted 1px #444; 60 64 color: #ddd; 61 65 padding: 9px; … … 70 74 #comment-form .error { 71 75 background-color: #422; 72 border: solid 1px #522;76 border: dotted 1px #522; 73 77 margin-top: 5px; 74 78 color: #ddd; … … 192 196 #comments .comment-form-row input, 193 197 #comment-form .textarea-border { 194 border: solid 1px #444;198 border: dotted 1px #444; 195 199 background-color: #333; 196 200 … … 260 264 -webkit-border-radius: 2px; 261 265 262 background-color: # fff;263 color:# 000;266 background-color: #000; 267 color:#fff; 264 268 } 265 269 266 270 a.page-numbers:focus, 267 271 a.page-numbers:hover { 268 background-color: # ccc;269 color: # 333;272 background-color: #f00; 273 color: #600; 270 274 } 271 275 … … 292 296 293 297 .current { 294 background-color:# ccc;295 color:# 999;298 background-color:#333; 299 color:#666; 296 300 } 297 301 298 302 .pageLinks .page-numbers, #comment-pagination span.current { 299 background-color:# eee;300 color:# ccc;303 background-color:#333; 304 color:#666; 301 305 } 302 306 303 307 .pageLinks a .page-numbers, 304 308 #comment-pagination .page-numbers { 305 color:# 666;306 background-color: # ddd;309 color:#ddd; 310 background-color: #333; 307 311 text-decoration:none; 308 312 } … … 310 314 #comment-pagination span.dots,#comment-pagination a.prev,#comment-pagination a.next { 311 315 background-color:transparent; 312 color: # 333;316 color: #ddd; 313 317 } 314 318 … … 376 380 padding-bottom: 10px; 377 381 margin-bottom: 15px; 378 border-bottom: solid 1px #DFDFDF;382 border-bottom: dotted 1px #444; 379 383 } 380 384 381 385 #comment-form blockquote { 382 border-left:0.325em solid # dfdfdf;386 border-left:0.325em solid #444; 383 387 font-style:italic; 384 388 margin:0 6%; … … 405 409 padding: 5px 10px; 406 410 background-color: #333; 407 border: solid 1px #444;411 border: dotted 1px #444; 408 412 cursor: pointer; 409 413 … … 423 427 .comment-link-display input { 424 428 background-color: #333; 425 border: solid 1px #555;429 border: dotted 1px #555; 426 430 color: #ccc; 427 431 cursor: text; -
spectacula-threaded-comments/trunk/style/comments.css
r263286 r263443 53 53 } 54 54 55 #comments ul#trackback-list { 56 display: block; 57 } 58 55 59 #comments .trackback-toggle, 56 60 #comments ul#commentlist div.toggle,
Note: See TracChangeset
for help on using the changeset viewer.