0
Reviews
';
html+= '
';
html+= '';
var smileyannotation=(data[index]['smileyannotation']);
var temp_str = smileyannotation.replace(/(]+)>)/ig,"");
if(temp_str.length >= 165){
html += html_substr( smileyannotation, 165 )+'...';
}else{
html += smileyannotation;
}
html+= '';
if(temp_str.length>=165){
html+='see more';
}
html+= '';
html+= '
';
html+= '';
html+= data[index]['smileyannotation']+'  ';
html+= '
see less'; html+= '
';
if(user_id==data[index]['user_id'])
{
html+='see less'; html+= '
';
html+= '
';
}
else
{
html+= ''+data[index]['annotation']+'
';
html+= '';
html+= '
';
html+= '';
html+= '';
html+= '';
html+= '
';
html+= ''+data[index]['annotation']+'
';
}
html+="";
html+= '';
//--@show replies on click of show reply
json_array_children=JSON.stringify(data[index]['children']);
json_array_children=json_array_children.replace(/\s+/g, '--');
if((allow_threaded_comment) && (threadlevelReply';
}
if(allow_threaded_comment &&(threadlevel ";
html+=' ';
//--@ threaded reply button
}
//like unlike button code start
var likeCount=0;
if(data[index]['likeCount'])
{
likeCount=data[index]['likeCount'];
}
html+='';
html+= '';
html+= '';
if(data[index]['userLikeDislike']==1){
html+= 'Unlike';
}
else{
html+= 'Like';
}
html+= '';
html+= '';
html+= '';
//-@ threaded LIKE COUNT
html+= '';
html+= '
';
//--end threaded reply button
html+= '"+(data[index]['children'].length)+"
';
html+= likeCount;
html+= '
';
html+= '';
html+= '';
html+='';
var dislikeCount = 0;
if(data[index]['dislikeCount'])
{
dislikeCount=data[index]['dislikeCount'];
}
html+='';
html+= '';
html+= '';
if(data[index]['userLikeDislike']==2){
html+= 'Undislike';
}
else{
html+= 'Dislike';
}
html+= '';
html+= '';
//@S Dislike Count
html+= '';
html+= ''+dislikeCount+'
';
html+= '';
//@E Dislike Count
html+='';
if(user_id==data[index]['user_id'])
{
html+= ' ';
}
//like unlike button code end
//Show comment time
html+='';
html+= data[index]['date'];
html+= data[index]['time'];
html+='';
html+='';
html+= '';
html+='
'; html+=""; html+='
';
//if parent is present then add after parent
if(parent_id!=0)
{
global_reply_annotation_id=parent_id=parent_id.replace('parentid','');
techjoomla.jQuery(html).insertAfter('#deleteComment'+parent_id);
}
else
{
global_reply_annotation_id=0;
techjoomla.jQuery('#'+likecontainerid +' div.jlike_comments').prepend(html);
}
// Create ratings
addRatingStars();
}
function ViewMore(data,callFromAscDesc)
{
techjoomla.jQuery("#caret").addClass("caret");
//if call from callFromAscDesc then delete all previous html
if(callFromAscDesc)
{
techjoomla.jQuery("#loadingCommentsProgressBar").hide();
techjoomla.jQuery('.jlike_commentingArea').remove();
renderedMoreId=[];
pageLoadAnnotaionIds='';
//commentscount
result_comment_count=0;
techjoomla.jQuery(".comments_count").html('Show '+' more');
}
else
{
techjoomla.jQuery("#progessBar").hide();
var comment_limit=5;
if(comment_limit'; html+=""; html+='
';
html+='
';
html+='';
html+=" "+user_name+"";
html+=' ';
}
//edit delete button
html+= '
';
html+= '';
html+= '';
html+= ' ';
html+= '';
html+= ' ';
html+= '
';
html+=' ';
// SMILEY BUTTON
html+= '';
html+='
';
html+= '';
html+= '';
html+= '';
//--@ threaded reply button
html+= '';
html+= '
';
// SMILEY BUTTON
//COMMENT & CANCEL BUTTON
html+= '';
html+= '';
html+= '
';
html+='';
if (owner_reply == 1)
{
html+= "";
}
else
{
html+= "";
}
html+= " ";
html+= '
';
//COMMENT & CANCEL BUTTON
html+= '';
html+= '
';
//--end threaded reply button
html+= '';
/* Show comment time */
html+='';
html+='';
html+= '
';
html+='';
html+= '
';
html+='';
html+= ''+data[index]['name']+'';
if(user_id==data[index]['user_id'])
{
html+= ' ';
html+= '
';
html+= '';
html+= '';
html+= ' ';
html+= '';
html+= ' ';
html+= '
';
} else {
html+= ' ';
}
html+= '';
html+= '
';
html+='';
var smileyannotation=(data[index]['smileyannotation']);
//var smileyannotation=nl2br(data[index]['smileyannotation']);
var temp_str = smileyannotation.replace(/(]+)>)/ig,"");
if(temp_str.length >= 165){
html += html_substr( smileyannotation, 165 )+'...';
}else{
html += smileyannotation;
}
html+= '';
if(temp_str.length>=165){
html+='see more';
}
html+= '';
html+= '
';
html+= '';
html+= data[index]['smileyannotation']+'  ';
html+= '
see less'; html+= '
';
if(user_id==data[index]['user_id'])
{
html+='see less'; html+= '
';
html+= '
';
}
else
{
html+= ''+data[index]['annotation']+'
';
html+= '';
html+= '
';
html+= '';
html+='';
html+= '';
html+= '
';
html+= ' '+data[index]['annotation']+'
';
html+= '';
}
html+= '';
html+= '';
json_array_children=JSON.stringify(data[index]['children']);
json_array_children=json_array_children.replace(/\s+/g, '--');
//~ if(allow_threaded_comment)
//~ {
//~ html+= 'Reply';
//~ }
//~
//~ if(allow_threaded_comment )
//~ {
//~ html+='
';
html+= '"+data[index]['replycount']+"
";
//~ html+=' ';
//~ }
//~ //like unlike button code start
//~ //~
//~ if(data[index]['likeCount'])
//~ var likeCount=data[index]['likeCount'];
//~ else
//~ var likeCount=0;
//~
//~ html+='';
//~ html+= '';
//~
//~ html+= '';
//~ html+= '';
//~ if(data[index]['userLikeDislike']==1){
//~ html+= 'Unlike';
//~ }
//~ else{
//~ html+= 'Like';
//~ }
//~ html+= '';
//~ html+= '';
//~
//~ html+='';
//~ html+= ''+likeCount+'
';
//~ html+= '';
//~ html+='';
//~
//~ html+='';
//~ //~ if(data[index]['dislikeCount'])
//~ var dislikeCount=data[index]['dislikeCount'];
//~ else
//~ var dislikeCount=0;
//~
//~
//~ html+='';
//~
//~ html+= '';
//~ html+= '';
//~ if(data[index]['userLikeDislike']==2){
//~ html+= 'Undislike';
//~ }
//~ else{
//~ html+= 'Dislike';
//~ }
//~ html+= '';
//~ html+= '';
//~
//~ //@S Dislike Count
//~ html+= ''+dislikeCount;
//~ html+= '';
//~ //@E Dislike Count
//~ //~ if(user_id==data[index]['user_id'])
{
html+= '
'; } jLikeSmilehtml += ' |
/g,"");
comment = comment.replace(/
/g,'\n');; comment = comment.stripTags(); //remove white sapaces to check comment is entered or not var comment_no_white_space = comment.replace(/\s+/g,''); if(comment_no_white_space.length /g,"\r\n"); //comment = comment.replace(/
/g,'\n');; comment = comment.stripTags(); //remove white sapaces to check comment is entered or not var comment_no_white_space = comment.replace(/\s+/g,''); if(comment_no_white_space.length /g,"\r\n"); //comment = comment.replace(/
/g,"");
//comment = comment.replace(/
/g,'\r\n');; //Strip tag because html not allowed in commnet comment = strip_tags(comment); if(!comment) { alert('Please enter the review.'); return false; } techjoomla.jQuery('#EditComment'+textAreaId).hide(); techjoomla.jQuery('#jlike_comment_time'+textAreaId).show(); techjoomla.jQuery('#jlike_cancel_comment_btn'+textAreaId).hide(); simely_textarea_id=textAreaId; var res=0; techjoomla.jQuery.ajax({ url:'http://www.aiiaworld.com/index.php?option=com_jlike&task=SaveComment&tmpl=component&format=row', type:'POST', dataType:'json', data: { annotation_id:annotation_id, comment:comment, note_type:2, }, success:function(data){ res=parseInt(data); if(res==1) { techjoomla.jQuery('#showlFullComment'+textAreaId).hide(); techjoomla.jQuery('#showlimited'+textAreaId).show(); //For new comment after edited techjoomla.jQuery('#showEditDeleteButton'+textAreaId).show(); techjoomla.jQuery('#showSavedComment'+textAreaId).show(); techjoomla.jQuery('#editingOptions'+textAreaId).show(); replaceSmielyAsImage(0,0); //show comment date time techjoomla.jQuery('#jlike_comment_time'+textAreaId).attr("id","jlike_comment_time"+res); techjoomla.jQuery('#jlike_comment_time'+res).show(); var d=new Date(); var day=d.getDate(); var year=d.getFullYear(); var h=d.getHours(); var m=d.getMinutes(); var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "June", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" ]; var month = monthNames[d.getMonth()]; techjoomla.jQuery('#jlike_comment_time'+res).text(day+' '+month+' '+year+' at '+h+':'+m); } } }); } /*************************************************** STRIP HTML TAGS ****************************************************/ function strip_tags(html) { //PROCESS STRING if(arguments.length ]*>/gi, ''); } else { var allowed = arguments[1]; var specified = eval("["+arguments[2]+"]"); if(allowed){ var regex='?(?!(' + specified.join('|') + '))\b[^>]*>'; html=html.replace(new RegExp(regex, 'gi'), ''); } else{ var regex='?(' + specified.join('|') + ')\b[^>]*>'; html=html.replace(new RegExp(regex, 'gi'), ''); } } //CHANGE NAME TO CLEAN JUST BECAUSE var clean_string = html; //RETURN THE CLEAN STRING return clean_string; } function replaceSmielyAsImage(method,data) { if(method) //if this function call from ViewMore() method { var comment= data; } else //call from other methods { var comment=techjoomla.jQuery("#CommentText"+simely_textarea_id).html(); //var comment= document.getElementById("CommentText"+simely_textarea_id).value; } var site_url='http://www.aiiaworld.com/'; var replacement = { ":)": '', ":-)": '', ":(": '', ":-(": '', ";)": '', ";-)": '', ";(": '', "B-)": '', "B)": '', ":D": '', ":-D": '', ":o": '', ":0": '', ":-o": '', ":-0": '', ":-3": '', }; string = escape(comment); for (var val in replacement) string = string.replace(new RegExp(escape(val), "g"), replacement[val]); string = unescape(string); if(method) { return string; } else { techjoomla.jQuery('#showlimited'+simely_textarea_id).html(string); techjoomla.jQuery('#showlFullComment'+simely_textarea_id).html(string); techjoomla.jQuery('#showSavedComment'+simely_textarea_id).html(string); } } /*replace tags as user link*/ function parsetag(comment) { var site_url='http://www.aiiaworld.com/'; var comment=techjoomla.jQuery("#CommentText"+simely_textarea_id).html(); var regex = /{profiletag([^}]*)}/; var results = comment.match(regex); var matched = null; while (matched = regex.exec(comment)) { var data = matched[1].split('|'); var profileurl = site_url+'index.php?option=com_community&view=profile&userid='+data[0]; comment = comment.replace(results, ''+data[1]+''); } techjoomla.jQuery('#showlimited'+simely_textarea_id).html(comment); techjoomla.jQuery('#showlFullComment'+simely_textarea_id).html(comment); techjoomla.jQuery('#showSavedComment'+simely_textarea_id).html(comment); } /** Method to delete the comment */ function DeleteComment(selector) { var cnfrm=confirm('Are you sure you want to delete this post?'); if(!cnfrm) return false; var elementId=techjoomla.jQuery(selector).parent().attr("id"); elementId=elementId.replace('DeleteButton',''); techjoomla.jQuery.ajax({ url:'http://www.aiiaworld.com/index.php?option=com_jlike&task=DeleteReviews&annotation_id='+elementId+'&tmpl=component&format=row', type:'GET', dataType:'json', success:function(data){ if(data) { for(var i=0;i
/g,'\r\n');; //Strip tag because html not allowed in commnet comment = strip_tags(comment); if(!comment) { alert('Please enter the review.'); return false; } techjoomla.jQuery('#EditComment'+textAreaId).hide(); techjoomla.jQuery('#jlike_comment_time'+textAreaId).show(); techjoomla.jQuery('#jlike_cancel_comment_btn'+textAreaId).hide(); simely_textarea_id=textAreaId; var res=0; techjoomla.jQuery.ajax({ url:'http://www.aiiaworld.com/index.php?option=com_jlike&task=SaveComment&tmpl=component&format=row', type:'POST', dataType:'json', data: { annotation_id:annotation_id, comment:comment, note_type:2, }, success:function(data){ res=parseInt(data); if(res==1) { techjoomla.jQuery('#showlFullComment'+textAreaId).hide(); techjoomla.jQuery('#showlimited'+textAreaId).show(); //For new comment after edited techjoomla.jQuery('#showEditDeleteButton'+textAreaId).show(); techjoomla.jQuery('#showSavedComment'+textAreaId).show(); techjoomla.jQuery('#editingOptions'+textAreaId).show(); replaceSmielyAsImage(0,0); //show comment date time techjoomla.jQuery('#jlike_comment_time'+textAreaId).attr("id","jlike_comment_time"+res); techjoomla.jQuery('#jlike_comment_time'+res).show(); var d=new Date(); var day=d.getDate(); var year=d.getFullYear(); var h=d.getHours(); var m=d.getMinutes(); var monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "June", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec" ]; var month = monthNames[d.getMonth()]; techjoomla.jQuery('#jlike_comment_time'+res).text(day+' '+month+' '+year+' at '+h+':'+m); } } }); } /*************************************************** STRIP HTML TAGS ****************************************************/ function strip_tags(html) { //PROCESS STRING if(arguments.length ]*>/gi, ''); } else { var allowed = arguments[1]; var specified = eval("["+arguments[2]+"]"); if(allowed){ var regex='?(?!(' + specified.join('|') + '))\b[^>]*>'; html=html.replace(new RegExp(regex, 'gi'), ''); } else{ var regex='?(' + specified.join('|') + ')\b[^>]*>'; html=html.replace(new RegExp(regex, 'gi'), ''); } } //CHANGE NAME TO CLEAN JUST BECAUSE var clean_string = html; //RETURN THE CLEAN STRING return clean_string; } function replaceSmielyAsImage(method,data) { if(method) //if this function call from ViewMore() method { var comment= data; } else //call from other methods { var comment=techjoomla.jQuery("#CommentText"+simely_textarea_id).html(); //var comment= document.getElementById("CommentText"+simely_textarea_id).value; } var site_url='http://www.aiiaworld.com/'; var replacement = { ":)": '', ":-)": '', ":(": '', ":-(": '', ";)": '', ";-)": '', ";(": '', "B-)": '', "B)": '', ":D": '', ":-D": '', ":o": '', ":0": '', ":-o": '', ":-0": '', ":-3": '', }; string = escape(comment); for (var val in replacement) string = string.replace(new RegExp(escape(val), "g"), replacement[val]); string = unescape(string); if(method) { return string; } else { techjoomla.jQuery('#showlimited'+simely_textarea_id).html(string); techjoomla.jQuery('#showlFullComment'+simely_textarea_id).html(string); techjoomla.jQuery('#showSavedComment'+simely_textarea_id).html(string); } } /*replace tags as user link*/ function parsetag(comment) { var site_url='http://www.aiiaworld.com/'; var comment=techjoomla.jQuery("#CommentText"+simely_textarea_id).html(); var regex = /{profiletag([^}]*)}/; var results = comment.match(regex); var matched = null; while (matched = regex.exec(comment)) { var data = matched[1].split('|'); var profileurl = site_url+'index.php?option=com_community&view=profile&userid='+data[0]; comment = comment.replace(results, ''+data[1]+''); } techjoomla.jQuery('#showlimited'+simely_textarea_id).html(comment); techjoomla.jQuery('#showlFullComment'+simely_textarea_id).html(comment); techjoomla.jQuery('#showSavedComment'+simely_textarea_id).html(comment); } /** Method to delete the comment */ function DeleteComment(selector) { var cnfrm=confirm('Are you sure you want to delete this post?'); if(!cnfrm) return false; var elementId=techjoomla.jQuery(selector).parent().attr("id"); elementId=elementId.replace('DeleteButton',''); techjoomla.jQuery.ajax({ url:'http://www.aiiaworld.com/index.php?option=com_jlike&task=DeleteReviews&annotation_id='+elementId+'&tmpl=component&format=row', type:'GET', dataType:'json', success:function(data){ if(data) { for(var i=0;i