Better comments
closed
R
Ramaka
That is pity. - But then other users can no longer vote. Our users keep asking for it.
Angela Gaida
Ramaka: I know, but since there is a workaround via Custom JS we wouldn't tackle this anyway. Please see the comment from Jan Priebe for that workaround.
Angela Gaida
closed
We won't take on this issue in the foreseeable future, therefore I'll close it.
R
Ramaka
Has anyone already tried the code. Can I set it up with some VBA (Excel) programming. Our users miss the reverse order.
Angela Gaida
under review
J
Jan Priebe
Regarding sorting of comments: We have implemented this easily with a JS code snippet as this was a big demand especially for pages / blogs with lots of comments. Could share this if you want
Angela Gaida
Jan Priebe: That really would be helpful, yes :)
Maybe you want to simply put it here? Maybe other users would like to use something like that too, and then they wouldn't have to wait for us to maybe implement that as a feature one day. :)
J
Jan Priebe
This is in our custom JS in Linchpin Theme Configuration:
/*
Sortierungs-Umkehrung fuer die Kommentare
*/
function reverseCommentOrder(){
$comments = AJS.$('#page-comments');
$comments.children().each(function(i,li){$comments.prepend(li)});
}
AJS.toInit(function(){
if(AJS.params["contentType"] == "blogpost" || AJS.params["contentType"] == "page"){
var language = AJS.params["userLocale"].split("_")[0];
var sortText = "";
if(language == "de"){
sortText = "Sortierung umkehren";
} else {
sortText = "Reverse comments";
}
AJS.$('#comments-section-title').append('<a id="page-comments-reverse" href="#">'+sortText+'</a><span id="sortIcon" style="margin-left:5px;color:#999;font-size:16px;">↓</span>');
AJS.$('#page-comments-reverse').css({ 'color':'#999','font-size':'14px', 'margin-left': '10px'}).click(function(e){
if(AJS.cookie.read("COMMENT_ORDER_REVERSED") === undefined || AJS.cookie.read("COMMENT_ORDER_REVERSED") === "false"){
AJS.cookie.save("COMMENT_ORDER_REVERSED", "true");
$("#sortIcon").html("↑");
} else if( AJS.cookie.read("COMMENT_ORDER_REVERSED") === "true"){
AJS.cookie.save("COMMENT_ORDER_REVERSED", "false");
$("#sortIcon").html("↓");
}
reverseCommentOrder();
e.preventDefault();
});
if(AJS.cookie.read("COMMENT_ORDER_REVERSED") === "true"){
reverseCommentOrder();
$("#sortIcon").html("↑");
}
}
});