Collapse multi-quoted posts. - Better Battlelog Forums #126713

Sitemap
Topicstarter
Well sometimes discussions get hot and specific between two people.
They may quote each other like an infinite loop.So just making the page @$#^*

So BBL should only show last posters text in quote.And previous posters text in same quote should be collapsed with an expand option.

something like this.
____________________________________________
diceguy said:

well this seems .......
CLICK TO EXPAND

____________________________________________
EA_guy said:

But the fact can........
CLICK TO EXPAND

____________________________________________
diceguy said:

Although there are lot of OP weapons and need nerfing
But stingers are just game breaker.They should nerf it
ASAP.
I also thought about that in the past.
Will look into.
Yes please.
i support this request.
but i would go a step forward.

hide WHOLE quotes, if there is no changes and the last quote is on the same page and/or only 20 posts above. the post important is only the last quote, not the quotes before anymore. so i get this idea ^^

for example:
------------------------------------------------------------------------------------------------------------------------------
A Answer 1
B Answer 2

A Answer 3
------------------------------------------------------------------------------------------------------------------------------
C Answer 4
------------------------------------------------------------------------------------------------------------------------------
A Answer 1
B Answer 2
A Answer 3

B Answer 5
------------------------------------------------------------------------------------------------------------------------------

should be visible as:
------------------------------------------------------------------------------------------------------------------------------
previous answers above, scroll upwards to read them
B Answer 2

A Answer 3
------------------------------------------------------------------------------------------------------------------------------
C Answer 4
------------------------------------------------------------------------------------------------------------------------------
previous answers above, scroll upwards to read them
A Answer 3

B Answer 5
------------------------------------------------------------------------------------------------------------------------------
Post edited 5 x times, last by
This is not so easy... and it will take some resourses...
It would be better if the same rule is applied every time without the need of searching the previous posts.

ex. Read more button for all quotes exept the last one.

EDIT:

Go to a topic with quotes in quotes...
Chrome: Press F12, go to console, paste the code and press ENTER.
$("#content").append('\
<style>\
.hidden-post{\
height: 6px;\
overflow: hidden;\
}\
.forum-threadview-post-text blockquote blockquote{\
cursor: pointer;\
}\
</style>\
');

$( ".forum-threadview-post-content .forum-threadview-post-text" ).each(function( index ) {
if( $(this).find('blockquote').length && $(this).find('blockquote blockquote').length){
$(this).find('blockquote blockquote').attr("class", "hidden-post");

$(this).find('blockquote blockquote')[0].addEventListener('click', function(){
if( $( this ).attr("class") && $( this ).attr("class").match("hidden-post") ){
$( this ).removeClass("hidden-post");
}else{
$( this ).addClass("hidden-post");
}
}, true);

}
});
Edit it to improve it...
Thx for the help, will test it out soon.
GreatApo wrote:
This is not so easy... and it will take some resourses...
It would be better if the same rule is applied every time without the need of searching the previous posts.


i know.. its not easy, but its possible. the question is, how many time brain wants to spend ;-) your idea is good for a beginning, maybe after the release we will get a lot of feedbacks by different users from different counties :-)
Topicstarter
GreatApo wrote:
This is not so easy... and it will take some resourses...
It would be better if the same rule is applied every time without the need of searching the previous posts.

ex. Read more button for all quotes exept the last one.

EDIT:

Go to a topic with quotes in quotes...
Chrome: Press F12, go to console, paste the code and press ENTER.
Edit it to improve it...


Hey,I'm just curious which language script is that.

I'm learning programming,never saw such code :)
Post edited 4 x times, last by
ORFK wrote:
i know.. its not easy, but its possible. the question is, how many time brain wants to spend ;-) your idea is good for a beginning, maybe after the release we will get a lot of feedbacks by different users from different counties :-)
You are right. I wrote this as a first step. This can be improved with your ideas and with hide/show JQuery animations.

zeharti wrote:
Hey,I'm just curious which language script is that.

I'm learning programming,never saw such code :)
This is javascript (with JQuery library).
BBLong runs on javascript (with JQuery).
Where i say "<style>", the following code is CSS (until </style>).

The whole internet runs on HTML + Javascript in your browser and most servers generate HTML + Javascript using PHP and SQL.

For more info, ask in the "Development" section of the forum.
Sorry for the semi-off topic parenthesis.
Putting "click to show" is a dead end. You want to make the multi quotes better and you probably end up clicking 20 buttons to see one post :P

The easy way :
Give max height on quotes and if this max height is passed scrollbar appear. Also scroll all quotes on bottom.
// Lets extend the page Css
$('head').append('<style>\
.forum-threadview-post-text>blockquote{\
width: 97%;\
max-height: 200px;\
overflow-y: auto;\
}\
</style>');

// For each top blockquote
$('.forum-threadview-post-text>blockquote').each(function(){
$(this).scrollTop($(this)[0].scrollHeight);
});


A more complex way ... i not sure if it is better :
Put quotes on a row and leave a mark on the spot the quote was with an name tag.
// Lets extend the page Css
$('head').append('<style>\
.forum-threadview-post-text>blockquote{\
width: 97%;\
max-height: 200px;\
overflow-y: auto;\
}\
.forum-threadview-post-text blockquote>em{\
color: #EEE;\
}\
.forum-threadview-post-text blockquote>.quote-num{\
float: right;\
font-size: 11px;\
color: #eee;\
}\
.forum-threadview-post-text blockquote>blockquote {\
background-color: transparent !important;\
border-top: 0px !important;\
border-left: 0px !important;\
border-right: 0px !important;\
padding: 0px 0px 10px 0px !important;\
}\
.forum-threadview-post-text blockquote.multiquote {\
background-color: rgba(0, 0, 0, 0.3) !important;\
border: 1px solid rgba(167, 167, 167, 0.3) !important;\
padding: 10px !important;\
}\
.forum-threadview-post-text blockquote .quotespot{\
font-style: italic;\
font-size: 10px;\
color: #ccc;\
}\
</style>');

// The recursive patcher
var quotePatcher = function(blockquote, number, data){
// New node
data.length++;
// Insert the namediv of the quote
$(blockquote).prepend('<div class="quote-num"></div>');
// Get his children quotes
var children = $(blockquote).children("blockquote");
// Clone name number
var children_number = number.slice(0);
// For every quote child
$(blockquote).children("blockquote").each(function(){
// New child
children_number[children_number.length-1]++;
// If not the only child
if(children.length>1){
// Set quote as multy quote
$(this).addClass('multiquote');
// Clone again number
var new_children_number = children_number.slice(0);
// Extend number
new_children_number.push(1);
// patch
quotePatcher(this, new_children_number, data);

// If the only one
} else {
// patch
quotePatcher(this, children_number, data);
}
});
// If the last quote
if(number.length==1 && number[0]==1){
// if not the only one
if(data.length!=1){
// Show name
$(blockquote).children('.quote-num').text('Quote last');
// Scroll to last quote
quoteScrollTo($(blockquote), $(blockquote).children('.quote-num'));
}
return;
}
// Insert name
$(blockquote).children('.quote-num').text('Quote '+number.join('.'));
// Leave a quote name on the spot found
$('<div class="quotespot">[Quote '+number.join('.')+']</div>').insertAfter(blockquote);
// Move it on top
$(blockquote).parent().prepend(blockquote);
};

var quoteScrollTo = function(container, scrollTo){
// Scroll to
container.scrollTop(
scrollTo.offset().top - container.offset().top + container.scrollTop()
);
}

// For each top blockquote
$('.forum-threadview-post-text>blockquote').each(function(){
// Create a pointer to length
var data = {length:0};
// Start recursive
quotePatcher(this, [1], data);
});


Just a statement:
I do not know if its good or bad, but personaly i never quote a post above mine, i always trim the quoted text (if able) to the main point and i remove quote's quotes.
Post edited 1 x times, last by
It's already implemented in the newest dev version with a simple hover.
Fast, easy to use and do what it is intended to do.
Seems to be working fine on Chrome. Thank you. :)
Its awesome :)
Topicstarter
Many thanks guys!!!
Tested out and is amazin'.
BTW is it final version or just pre-alpha build?
Post edited 1 x times, last by
zeharti wrote:
Many thanks guys!!!
Tested out and is amazin'.
BTW is it final version or just pre-alpha build?


It's the DEV built, always one step ahead the public built.
That means it's available in next stable release.
i dont like the Auto opening of (collapsed) nested quotes by hovering them with the mouse.
it makes really difficult to read a topic if its always moving because you're handeling your mouse.

and its not only while moving the mouse.. if you're scrolling and scroll over an collapsed quote it will open, so you will scroll forward to read the next topic, after leaving the quote area it collaps again, and what you want to read ist not where you saw it.

please fix this.
You can disable that feature if you don't like it -> Forum -> Auto Collapse multi quotes.
Most people like it as it is and i'm not going to change something in the near future on that feature.
Lack of time, prioritising tasks.