‘);
thisForm.parent(“li”).before(messageCont);
}
if(_commentUser.isLoggedIn){
insertComment(this,true,function(obj){
//debugResponse(obj);
if(obj.error){
if(obj.error == “User contingency be logged in to perform a action.”){
messageCont.html(“
Please login to post your comment.
“);
thisForm.hide().parent(“li”).hide();
}else{
messageCont.html(“
Sorry, there was a problem when submitting your comment, greatfully try again.
“);
}
messageCont.removeClass(“hide”);
}else{ // probable standing APPROVED,NOTAPPROVED, FLAGGED, AUTHOR, BOT, REJECTED
if(obj.status == “APPROVED”){
messageCont.attr(“id”,”comment-”+obj.id).html(buildCommentHTMLString(obj));
_commentUser.refreshComments = true;
$.cookie(‘_commentSession’,_commentUser,{expires:_commentUser.expires,path:’/'});
}else{// hoop all other cases with this blanket
messageCont.html(“
Your criticism has been received. If we do not see it immediately, it is being routed for approval.
“);
}
//reset form
messageCont.removeClass(“active-reply-container hide”);
thisForm.find(“.reply-to-comment-body”).val(“”).css(“height”,”18px”).trigger(“blur”);
}
});
}else{
messageCont.html(“
Please login to post your comment.
“);
thisForm.hide().parent(“li”).hide();
messageCont.removeClass(“hide”);
}
}else{ // new
if(thisForm.is(“#comment-form”)){
if(validateForm(thisForm)){
if(_commentUser.isLoggedIn){
insertComment(this,true,function(obj){
//debugResponse(obj);
if(obj.error){
if(obj.error == “User contingency be logged in to perform a action.”){
mainMessageContainer.html(“
Please login to post your comment.
“);
thisForm.hide();
}else{
mainMessageContainer.html(“
Sorry, there was a problem when submitting your comment, greatfully try again.
“);
}
}else{ // probable standing APPROVED,NOTAPPROVED, FLAGGED, AUTHOR, BOT, REJECTED
if(obj.status == “APPROVED”){
$(“#comments-list ol”).eq(0).prepend(‘
‘);
_commentUser.refreshComments = true;
$.cookie(‘_commentSession’,_commentUser,{expires:_commentUser.expires,path:’/'});
}else{// hoop all other cases with this blanket
mainMessageContainer.html(“
Your criticism has been received. If we do not see it immediately, it is being routed for approval.
“);
}
//reset form
mainMessageContainer.html(“”);
$(“#comment-body”).val(“”).trigger(“blur”);
}
});
}else{
mainMessageContainer.html(“
Please login to post your comment.
“);
thisForm.hide();
}
}
}
}
});
$(“#comments-list”).delegate(“.pagination a”,”click”,function(e){
e.preventDefault();
_gaq.push(['_trackPageview']);
$(“#comments-list”).html(‘
Loading comments…
‘);
$(“html,body”).animate({scrollTop:$(“#comments”).offset().top},”fast”);
if($(e.currentTarget).is(“.all”)){
_paging.setHash(true,{event:”viewall”,viewAll:$(e.currentTarget).html().indexOf(“Page”) -1 ? 0 : 1});
}else{
var p = $(e.currentTarget).attr(“href”).replace(“#comments”,”");
p = p.substring(p.indexOf(“page=”)+5);
if(p.indexOf(“”) -1){
p = p.substring(0,p.indexOf(“”));
}
var srt = $(“.sorting name option:selected”).val();
srt = srt.substring(srt.indexOf(“sort=”)+5);
_paging.setHash(true,{event:”loadpage”,sortString:srt,page:parseInt(p)});
}
});
$(“.sorting select”).change(function(){
_gaq.push(['_trackPageview']);
$(“#comments-list”).html(‘
Sorting comments…
‘);
var srt = $(“.sorting name option:selected”).val();
srt = srt.substring(srt.indexOf(“sort=”)+5);
var p = srt.indexOf(“newest”) -1 ? _paging.pages : 1;
_paging.setHash(true,{event:”sort”,sortString:srt,page:p});
});
$(“.pagesize a”).click(function(e){
e.preventDefault();
_gaq.push(['_trackPageview']);
$(“#comments-list”).html(‘
Adjusting page size…
‘);
var srt = $(“.sorting name option:selected”).val();
srt = srt.substring(srt.indexOf(“sort=”)+5);
var p = srt.indexOf(“newest”) -1 ? _paging.pages : 1;
_paging.setHash(true,{event:”pagesize”,pageSize:parseInt($(this).html()),sortString:srt,page:p});
$(this).addClass(‘active’).siblings().removeClass(‘active’);
});
var getCommentBody = function(__comment){
var j = [];
j.push(‘
– – Report Abuse
‘);
return j.join(“”);
}
function spew(array, process, context){
setTimeout(function(){
var object = array.shift();
process.call(context, item);
if (array.length 0){
setTimeout(arguments.callee, 100);
}
}, 100);
}
function createCommentsList(__data){
var __comnts = __data.comments;
var __comntsLength = __comnts.length;
if(__comntsLength 0){
var comts = [];
var appendNth = 10;
if(__comntsLength ‘,getCommentBody(__comment),’
‘);
if(__comment.hasResponses){
var __commentResponses = __comment.responses;
var __commentResponsesLength = __commentResponses.length;
for (var r=0; r ‘,getCommentBody(__response),”);
}
}
comts.push(‘
‘);
if((i+1) % appendNth == 0 || (i+1) == __comntsLength) {
if((i+1) == __comntsLength){
que.push(‘
‘+comts.join(”)+’
‘+__data.html);
}else{
que.push(‘
‘+comts.join(”)+’
‘);
}
comts = [];
_chunk++;
}
}
if(que.length 1){
spew(que,function(chunk){
$(“#comments-list”).append(chunk);
$(“#comments-list .bzdu.commenter-”+_commentUser.id).removeClass(“bzdu”).addClass(“bzbu”);
});
}else{
$(“#comments-list”).append(que.join(”));
$(“#comments-list .bzdu.commenter-”+_commentUser.id).removeClass(“bzdu”).addClass(“bzbu”);
}
_paging.setHash(false,{event:”pageload”});
if(window.location.hash.indexOf(“comment=”) -1){
var scrl = window.location.hash;
scrl = scrl.substring(scrl.indexOf(“comment=”)+8);
if(scrl.indexOf(“”) -1){
scrl = scrl.substring(0,scrl.indexOf(“”));
}
$(“html,body”).animate({scrollTop:$(“#comment-”+scrl).offset().top},”fast”);
}
}else{
$(“#comments-list”).html(‘
‘);
}
}
$(window).hashchange(function(){
if(_paging.event == “pageload”){
var windowLocationHash = window.location.hash;
windowLocationHash = windowLocationHash.replace(/^#!/,”");
if(windowLocationHash (windowLocationHash.indexOf(“sort=”) -1 || windowLocationHash.indexOf(“page=”) -1 || windowLocationHash.indexOf(“viewAll=”) -1 || windowLocationHash.indexOf(“pageSize=”) -1 || windowLocationHash.indexOf(“comment=”) -1)){
var urlVars = [], hash;
var hashes = windowLocationHash.split(”);
for(var i = 0; i Refreshing comments…’);
}
if(!window.location.hash || window.location.hash.indexOf(“comments”) -1){
//this sets default arrange sequence to newestfirst on initial page load
//condition for #comments on blog posts and no crush on essay urls, we do ajax
$(“#comments-list”).html(‘
Refreshing comments…
‘);
$(“.sorting name option:selected”).removeAttr(‘selected’);
$(“.sorting name .newestfirst”).attr(‘selected’, ‘selected’);
_paging.setHash(false,{event:”pagerefresh”,sortString:”newestfirst”,page:_paging.pages,pageSize:_paging.pageSize});
}
}
$.ajax({
url:_paging.url(),
cache:false,
dataType: ‘json’,
success:function(__data){
createCommentsList(__data);
},
error: function(a,b,c){
//alert(“ajax error:” + a+”,”+b+”,”+c);
$(“#comments-list”).html(__data.html+’
Oops, the holding too prolonged to collect comments, greatfully try again.
‘+__data.html);
}
});
});
if(_commentUser.refreshComments == true){//occurs when someone posts a criticism afterwards refreshes page
_commentUser.refreshComments = false;
$.cookie(‘_commentSession’,_commentUser,{expires:_commentUser.expires,path:’/'});
$(“#comments-list”).html(‘
Refreshing comments…
‘);
$(“.sorting name option:selected”).removeAttr(‘selected’);
$(“.sorting name .newestfirst”).attr(‘selected’, ‘selected’);
_paging.setHash(true,{event:”pagerefresh”,sortString:”newestfirst”,page:_paging.pages});
}
$(window).hashchange();
Source:
http://2unes.net/news/2013/singles-scorecard-hear-new-songs-from-bob-chris-young-and-american-idol