Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2017-04-17 13:44:56

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,824

Automatically [spoiler] large quotes

Too many people quote the entire post that they're replying to, and you end up with massive quote chains filling up the thread.

If a player clicks the "Quote" button underneath a long post (which isn't already spoilered), make the generated quote include a spoiler which previews the first few words of the quote, like this:

Tomahawk wrote:
Too many people quote...

Quote chains would work like this:

Lancelot wrote:
John wrote:
Tomahawk wrote:
Too many people quote...

This is a short reply, so my post doesn't get put in a spoiler.

This is a long...

And if some nub quotes this entire post, even though you're not meant to quote the OP, it'll be put in a spoiler and the thread stays tidy.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#2 2017-04-17 13:48:44

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Automatically [spoiler] large quotes

This would be really good IMO
I was thinking about it a while ago, but couldnt think of a very good way to impliment it; just using the length of the quote would be a good solution

Offline

Wooted by:

#3 2017-04-17 14:12:50

Onjit
Member
Joined: 2015-02-15
Posts: 9,697
Website

Re: Automatically [spoiler] large quotes

If there's a way to detect if there's more than X characters inside <quote> tags, this would be great.


:.|:;

Offline

Wooted by:

#4 2017-04-17 15:31:09

TaskManager
Formerly maxi123
From: i really should update this
Joined: 2015-03-01
Posts: 9,457

Re: Automatically [spoiler] large quotes

Onjit wrote:

If there's a way to detect if there's more than X characters inside <quote> tags, this would be great.

preferably with an option to change the X through display settings


i8SwC8p.png
signature by HG, profile picture by bluecloud, thank!!
previous signature by drstereos

Offline

#5 2017-04-17 15:45:52, last edited by LukeM (2017-04-17 15:46:25)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Automatically [spoiler] large quotes

maxi123 wrote:
Onjit wrote:

If there's a way to detect if there's more than X characters inside <quote> tags, this would be great.

preferably with an option to change the X through display settings

I dont think that will be possible (well probably, but it wouldnt be easy), as currently all the replacements happen when you submit the post / press the quote button

Offline

#6 2017-04-17 17:40:51, last edited by hummerz5 (2017-04-17 17:40:58)

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: Automatically [spoiler] large quotes

destroyer123 wrote:
maxi123 wrote:
Onjit wrote:

If there's a way to detect if there's more than X characters inside <quote> tags, this would be great.

preferably with an option to change the X through display settings

I dont think that will be possible (well probably, but it wouldnt be easy), as currently all the replacements happen when you submit the post / press the quote button

bbcode replacements? to html? or

I don't think we have any straightforward way to get legitimate height of the post. The post could have large images but little text, or small images and lots of text... line breaks are relatively reliable. I mean, it naturally could be implemented but I'd expect the cut-off to be glaring. Yeah, the character count might be misleading but doable. Make a line break count for like 50 characters or something?

Offline

#7 2017-04-17 18:55:18

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,824

Re: Automatically [spoiler] large quotes

Ideally the cut-off would be based on the vertical height of the quote, but as that's dependent on the device used to view the post idk if it's possible.

If the text-wrapping is entirely independent of the forum code then eh. Counting line breaks only works for posts with line breaks.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#8 2017-04-17 19:53:17

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: Automatically [spoiler] large quotes

Tomahawk wrote:

If the text-wrapping is entirely independent of the forum code then eh. Counting line breaks only works for posts with line breaks.

Yeah, but you see where "vertical height . . . dependent on the device used to view the post" becomes hard to generalize? Images can be many different sizes, but a line break (character) is still a line break (character). Just regular returns based on available width don't make sense, I agree.

Perhaps we're looking at this the wrong way. Instead of setting BBCode, what if the end page has some method for styling the message? A userscript could look at quote objects with large vertical widths and wrap them.

Offline

#9 2017-04-17 23:59:32

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: Automatically [spoiler] large quotes

hummerz5 wrote:

Perhaps we're looking at this the wrong way. Instead of setting BBCode, what if the end page has some method for styling the message? A userscript could look at quote objects with large vertical widths and wrap them.

I'm starting to think that you might be right about that
It would definitely be a lot harder, but would probably be the most reliable way to do it, and would even solve the problem of quoting spoilered quotes not returning the converted spoilers back to quotes (if that makes any sense)

Offline

#10 2017-04-18 01:30:19, last edited by hummerz5 (2017-07-12 19:39:11)

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: Automatically [spoiler] large quotes

you mean like if I were to quote something with our previous line of thinking, the quotes wouldn't really be pretty because they'd be back to weird spoiler + quote meshes?

yeah I could see that would be a bother.

Assuming a javascript solution, how should we go about this? Set a largest visible-quote value? Then we could take the parent-most .quotebox element and traverse the child quotes until parent.height - childQuote.height > desiredHeight, then we'd wrap the child in a spoiler (I suppose we could make a different visibility toggling system but what ain't broke...)

edit: work in progress

$(".postmsg>.quotebox").not(".spoilerbox")

yes that's all I have so far. This will give us the topmost quotes. Handling a straight chain of quotes is straightforward. What if we have a tree, though? two or three quotes in one quote... each with their own extensive parent nodes? Could we, perhaps, if the desired size cannot be determined outside of these branches, simply cut them at the shared trunk? Otherwise, wouldn't we potentially just be making this a rather complicated problem resulting in multiple spoilers later on out into the tree? IT'd just be simpler to err on the side of one sooner spoiler.


much later edit:

hey you! If you're still interested in this, do make a reply! I came back and made things work better. Not quite as tomahawk intended, but with the general concept.

var BOX_HEIGHT_MAX = 200;
var BOX_SPOILER_TITLE = "People said things...";
function getTallBoxes(){
  return $(".quotebox").filter(function(e) { return $(this).height() > BOX_HEIGHT_MAX; }).sort(function (a, b) { return $(a).height() < $(b).height() ? 1 : -1; });
}

function spoilerify(title, content){
  var replacement = $("<div><div class=\"quotebox spoilerbox\" style=\"padding: 0 5px;\"><div class=\"spoiler\" onclick=\"var e,d,c=this.parentNode,a=c.getElementsByTagName('div')[1],b=this.getElementsByTagName('span')[0];if(a.style.display!=''){while(c.parentNode&&(!d||!e||d==e)){e=d;d=(window.getComputedStyle?getComputedStyle(c, null):c.currentStyle)['backgroundColor'];if(d=='transparent'||d=='rgba(0, 0, 0, 0)')d=e;c=c.parentNode;}a.style.display='';b.innerHTML='&#9650;';}else{a.style.display='none';b.innerHTML='&#9660;';}\"><span class=\"spoiler\">&#9660;</span>" + BOX_SPOILER_TITLE + "</div><div class=\"spoiled spoilercontent\" style=\"display:none\"></div></div></div>");
  $(content).replaceWith(replacement);
  replacement.find(".spoilercontent").append(content);
}

$(document).ready(function(){
var boxes = null;
while ((boxes = getTallBoxes()).length != 0){
  spoilerify("Large box... ", boxes[0]);
}
});

Offline

hummerz51492475419655199

Board footer

Powered by FluxBB

[ Started around 1711643185.1743 - Generated in 0.061 seconds, 10 queries executed - Memory usage: 1.56 MiB (Peak: 1.73 MiB) ]