Wedge

Public area => The Pub => Features => Topic started by: Nao on September 12th, 2010, 04:47 PM

Title: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on September 12th, 2010, 04:47 PM
Okay, you know what -- QUOTES ARE WAY UNDERUSED.

People don't multi-quote enough. People don't know the pleasure of replying everything line by line.
You know what? Because people use the Quote bbc button and it's so complicated.
Power-quoters like me, and perhaps Pete, do it manually. Quote message... Okay, focus on message, ctrl+end, ctrl+shift+left arrow until I select the entire [/quote], ctrl+c, ctrl+home (I use ctrl a lot, at this point...), go to end of the quote I want to reply to, ctrl+v, enter, enter, type answer... Enter, enter, ctrl+v, right arrow, del (this effectively turns it into an opening quote), go to end of the quote, keep doing it that way...

Now, you can try it if you never did. It works and, well, I don't see a better way of doing it quickly.

...
Until today.
I remembered these freaking' annoying e-mails.
Which were so easy to reply to, because they already were entirely quoted.

> Hello, world.
> Reply to this.
> Just below.

See? It's easy.

> More quotes.

---------------> Now what? Why can't we do that for Wedge?
That's the idea, really.

Quote message.
Show message. Instead of showing it inside a large quote tag, turn it into a post with limited width, add automatic carriage returns, and *add > signs in front of each line*.
Now, the user can reply like on any e-mail they may want to quote...
And then, when they hit the Send button, that's where the magic is supposed to be applied: we turn back this post into a properly quoted post. I don't know exactly how, but we can discuss it. Basically, it's simply about concatenating all lines with a starting ">" into a single quote. Special cases like code tags should be accounted for (we have to deal with them as a single block). We could keep a copy of the quoted post in memory, and compare it with the new post, and thus do some sort of diff on it -- you know, like Wikipedia. And then we quote everything that was inside the earlier post, and only that.

It could be exciting... Because it's something that actually talks to e-mail users. There are a few, I've heard. :whistle:
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 12th, 2010, 05:03 PM
Quote
People don't multi-quote enough. People don't know the pleasure of replying everything line by line.
You know what? Because people use the Quote bbc button and it's so complicated.
Click+hold, drag, Ctrl-C, click, [quote], Ctrl-V, [/quote] hahahaah

Yes, it's... awkward. It's why so many people just hit quote then reply to the message as a whole.

Funny you should mention this, because this came up in SimpleDesk's dev cycle and for the same reason - folks that were used to email wouldn't like the reply-with-quote, and I kind of mulled it over and figured it'd be awesome to do but could never figure out how to make it work sanely for the forum users (the strong SMF background)

I love the idea, though I'm concerned it might be a paradigm shift too far for some folks... hmm.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: MultiformeIngegno on September 12th, 2010, 06:07 PM
I like the idea!!!! Just, what if you use ">" to start a sentence in your post but you don't want it to be converted in a quote..?
What about a more complex system where you can add the quotes you want in your post and then in the editor (at the left of the box) you have lines of different colours at the left of each quote? :)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 12th, 2010, 07:12 PM
I don't know many cases I've seen that be an issue to be honest, but you'd probably have a space at the front.

Interesting idea there but I'd be worried about making it more complex for the user.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on September 12th, 2010, 09:16 PM
Quote from Arantor on September 12th, 2010, 05:03 PM
Quote
People don't multi-quote enough. People don't know the pleasure of replying everything line by line.
You know what? Because people use the Quote bbc button and it's so complicated.
Click+hold, drag, Ctrl-C, click, [quote], Ctrl-V, [/quote] hahahaah
I don't know about that... It doesn't work in Opera, at least.
Quote
Funny you should mention this, because this came up in SimpleDesk's dev cycle and for the same reason - folks that were used to email wouldn't like the reply-with-quote, and I kind of mulled it over and figured it'd be awesome to do but could never figure out how to make it work sanely for the forum users (the strong SMF background)

I love the idea, though I'm concerned it might be a paradigm shift too far for some folks... hmm.
Oh, I'm pretty positive people will learn quickly about the new system.

As for messages starting with a ">"... Yes, people could simply add an extra space to make it a non-quote.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 12th, 2010, 10:37 PM
Quote
I don't know about that... It doesn't work in Opera, at least.
Opera can't manage selecting text, copying it to the clipboard, then holding it while you type stuff, ready to paste it? Now I remember why I never use it :P

It's a paradigm shift and no mistake. So was SimpleDesk's permissions, and because we're not limiting ourselves to sticking to the ways it's done now, I think it has a decent shot at dealing with the problem.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: spuds on September 12th, 2010, 11:47 PM
Or how about some javascript magic so that when you are in the post screen when you mouse over the topic summary with a key press you can start / stop text selection and have it be inserted in to your reply inside the quote blocks for ya .....
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 12th, 2010, 11:50 PM
Keep 'em coming.

I'll be honest, right now I'm not really reading a lot here, I'm reading up on the 3rd party editor I'm looking at using, and playing around with integration.

If it works the way I'm hoping it will, we get to dump the WYSIWTF editor that much sooner.

(I'm looking at CK Editor. I believe I can integrate it better into how the forum works without compromising the sorts of things we have already.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: hadesflames on September 14th, 2010, 04:24 AM
Depending on the size of the message, I may answer it all at once, or break up the quote. If it's like just one paragraph, I'm not going to bother quoting every individual sentence...If it's a monster of a post like something Pete would post, then I'd quote individual points to get across my ideas on these individual points.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 25th, 2010, 05:17 PM
Bumpity.

Do we want to consider building in multi-quoting? It's popular enough on other forum packages, and if enhanced to the point it also covers partial quoting... it could be awesome.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on September 25th, 2010, 08:15 PM
What do you mean 'partial quoting'?

As for multi-quoting, I would actually encourage multi-posting followed with automatic or manual merging of posts. I'm going windward, I know. That's me :) The windward guy.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on September 26th, 2010, 01:22 AM
As mentioned above, the ability to select a bunch of text and have just that appear in the quote tag.

Multi-posting is fine - just I think that's slightly deviating from the route you've taken here?
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on October 3rd, 2010, 12:54 PM
Quote
using JS to select the text?
Sure, there's functionality in the browsers to achieve this.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on November 30th, 2010, 10:54 PM
Quote from Bloc on October 3rd, 2010, 11:56 AM
The multi-quoting sounds fascinating..but will it be an issue with widths? I mean, different people will have different set of lines, depending on what width they have in their browser.
I'm thinking it *could* be done by Javascript... We retrieve the width of the textarea... And then we format the quoted text in a way that they never go above 80% of that width or something. Well, it may be easier said than done... Width issues are the #3 reason why I haven't implemented this yet. (#2 being not having enough time to work on everything, and #1 being that I really meant #2, not #3.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 9th, 2011, 11:24 PM
Spent the better part of the day thinking of implementations for this...
Especially after I did something similar in Class-CSS.php (nested rules), I thought it'd be easy.

Well... It isn't. The basics work, I tested and everything. But because I tested, I also found many, many flaws.
For instance, how do we differentiate between a newline, and a line that is simply too long and must be split over two lines? How do we make sure lines don't get longer than the available textarea width? How do we treat anything that is between tags and split over several lines? (e.g. if you have a link with a description that takes over two lines, should we cut the line at all, or close the link at the end of the first line and reopen the same link automatically at the beginning of the next one? Things like that...)

Every time I think of a workaround for a problem, I discover another weakness somewhere else.
So, basically -- it's pretty hard to have both a BBCode system, and an e-mail style quote system.

Any thoughts...? Going to bed. Maybe I'll be more capable of thinking tomorrow.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 9th, 2011, 11:48 PM
Hmm. OK, well, we already know what is newline delineated because we're given newlines by the editor and they're still present in the message body. So it's not like we're totally devoid of that meaning.

We can easily use that to define blocks of text that should be indicated with >>... but without using JS there's no way to display it. Part of me things we should just treat it as a single block of text, stick it in a paragraph tag and attach a coloured left border to it the way some email clients do. That way you essentially leave layout to the client to deal with ;)

But yeah, it's not pretty or clever to have to deal with this.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 10th, 2011, 11:03 AM
Quote from Arantor on March 9th, 2011, 11:48 PM
Hmm. OK, well, we already know what is newline delineated because we're given newlines by the editor and they're still present in the message body. So it's not like we're totally devoid of that meaning.
That's the basics... Obviously it gets more complicated because of 5 things:
- Cutting lines that are longer than an arbitrarily decided length. I think around 80 chars would be logical, but smaller screens will show them in two lines... Whatever. Can live with that uh. Most likely these screens are on mobile -- and you know how dealing with quotes is horrible on mobile screens. The > solution is actually a great step in usability for these. (Select a line, press Return, type answer...)
- wordwrap() doesn't work on UTF, ah ah. So I have to do it differently, getting all lines that are longer than 80 chars and splitting them manually.
- words that are too long: it's relatively easy to split them to the next line... But how do we put them back together at posting time?
- tags: same here...
- how do we differentiate between line breaks that are due to long lines, and line breaks that were in the original? I thought that it could be solved by telling the editor that a 50-char line (or smaller) means a real line-break while more is a normal line. But of course, it would be too easy -- because of the aforementioned tag & long word problems, it's never easy to determine that kind of thing...
Quote
We can easily use that to define blocks of text that should be indicated with >>... but without using JS there's no way to display it.
I haven't been using JS because it can be done with PHP and JS would only complicate things. (I'm thinking this feature will only be on non-Wysiwyg anyway. I don't care -much- about Wysiwyg and Wysiwyg users probably don't even know what a non-HTML e-mail is...)
Quote
Part of me things we should just treat it as a single block of text, stick it in a paragraph tag and attach a coloured left border to it the way some email clients do. That way you essentially leave layout to the client to deal with ;)
That would mean using a contentEditable frame instead of a textarea, if you want to add coloring inside the area...
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 10th, 2011, 11:14 AM
It sort of depends how you approach it; from a display perspective, the issue of using paragraph tags with a left border solves all the display issues, but none of the editing issues.

It's not like it would be a problem to use a contentEditable frame; we're already doing that anyway in the WYSIWYG editor, but yeah I see where you're going.

Thing is, Thunderbird uses the left border gig in HTML emails which is where I got it from, as does other stuff, and everyone else uses >> for non HTML emails, so it's not like it is anything special. FWIW, they also do it as >> to indicate the start of a line and not bother to worry about how long the line is.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 12th, 2011, 01:45 AM
Finished doing my first 'working' version of the parser... It only parses TO mail format, not FROM it for now.

Stats: 45 lines of code, 1 preg_match_all, 2*words preg_match, 4*words westr::strlen, 2 explode (1 per line), 1 str_replace per line. Heavy, eh....? Couldn't do any better... But it's still pretty fast and it's nestable.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 12th, 2011, 02:04 AM
Certainly sounds heavy, am curious to see it thought.

Hang on, why aren't you in bed?! :P
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Adonis on March 12th, 2011, 06:47 AM
Just skimming the topic as it's something I'm fond of.

I usually end up C/P the [BB] tags after I add some hard returns between the individual bits I'd like to quote.  Opening and closing tags seems easier than a mysterious and arbitrary > length.

It'd like a system that automated the above a little more.

So if the original quote is [startquote]"There is no one who loves pain itself, who seeks after it and wants to have it,"[endquote]

Putting the cursor after "itself," and pressing 'SplitQuote' automagically get you


 [startquote]"There is no one who loves pain itself,[endquote]

 [startquote]who seeks after it and wants to have it,"[endquote]

 

Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 12th, 2011, 09:34 AM
Considering I wanted to do that for >... why didn't I think of that for quote rags? Eheh. I'll try to see into it.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 12th, 2011, 09:36 AM
Quote from Arantor on March 12th, 2011, 02:04 AM
Certainly sounds heavy, am curious to see it thought.

Hang on, why aren't you in bed?! :P
Tron marathon in hd yesterday with friends. (the first one was so boring! Hate ya Wendy Carlos. My childhood memories were raped.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 12th, 2011, 10:10 AM
'SplitQuote'... is that a vB feature I've just never noticed before?
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 12th, 2011, 01:14 PM
I have no idea.... Google says there's a "Split quote" bookmarklet for vB, but it simply splits every paragraph into its own quote, at the beginning. That's an interesting approach but to me it sounds like a wrong one, if only because of the potential waste of space if the user doesn't modify anything at all and just answers at the beginning of their post.

Anyway... Currently working on implementing that 'splitQuote' function. And of course, my implementation is ugly... What matters is to make it work, for now. I think I can be done before tonight but I have to go right now. A Jane Austen movie to watch...
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 12th, 2011, 06:09 PM
My, my... It's working pretty well. And with a relatively short function. And without a single regex involved, ahah. (I originally had one.)

Added this in editor.js (the splitQuote registration):

Code: [Select]
$(this.oTextHandle).keydown(this.aEventWrappers.shortcutCheck).keydown(splitQuote);

And then this in post.js:

Code: [Select]
// Split a quote if we press Enter inside it.
function splitQuote(oEvent)
{
// Did we just press Enter?
if (oEvent.which != 13)
return true;

// Where are we, already?
if ('selectionStart' in this)
var selectionStart = this.selectionStart;
else
{
var range = document.selection.createRange(), stored_range = range.duplicate();
dul.moveToElementText(this);
dul.setEndPoint('EndToEnd', range);
var selectionStart = dul.text.length - range.text.length;
}

// Is there an opened quote tag here?
var selection = this.value.substring(0, selectionStart), lcs = selection.toLowerCase(), lioQuote = lcs.lastIndexOf('[quote');
if (lioQuote <= lcs.lastIndexOf('[/quote'))
return true;
var quote = '\n\n' + selection.substring(lioQuote);

surroundText('[/quote]\n', quote.substring(0, quote.indexOf(']') + 1), this);

return true;
};

Can you give it a try, Pete? I tested in many possible ways but I'm sure you'll be interested in seeing it for yourself.
Also, I'm readding the original quote with author and time, but I think it'd be smarter to add something like[quote continued], where we would make it clear that this quote is a continuation of the previous one.

NB: it doesn't work on nested quotes, I fear... Maybe you can find a workaround, like counting the number of quotes and the number of /quotes and generating the splitter quotes based on the difference between them... That might work.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Adonis on March 12th, 2011, 06:22 PM
Quote from Arantor on March 12th, 2011, 10:10 AM
'SplitQuote'... is that a vB feature I've just never noticed before?
While there may be such a creature, I intended it to be a new machination/button (hence being able to split a sentence).  It seemed to be an appropriate name (if already taken).
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 12:19 AM
Added support for multiple levels of tags...

Code: [Select]
// Is there an opened quote tag here?
var selection = this.value.substring(0, selectionStart), lcs = selection.toLowerCase();
var quotes = lcs.match(/\[quote.*?\]/g), unquotes = lcs.match(/\[\/quote\]/g);
if (quotes === null || (unquotes !== null && quotes.length <= unquotes.length))
return true;
var num = quotes.length - (unquotes === null ? 0 : unquotes.length) + 1;

surroundText(new Array(num).join('[/quote]') + '\n', '\n\n' + new Array(num).join('[quote]'), this);

The 'join' thing is the equivalent of str_repeat. Pretty neat... (Took the idea from php.js)
It still won't deal with things that are cut in the middle, like code tags or even anchors or whatever. Dunno if it's that important... Is it? Also, it no longer reproduces the earlier quote variables (author, date). Adding them back would probably be a bit complicated... (I can't just use a list of the last quotes in the array... If I have a self-closed quote right before my post, it will get crazy and reproduce that quote's data instead of the correct one.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 13th, 2011, 12:21 AM
Quote
It still won't deal with things that are cut in the middle, like code tags or even anchors or whatever. Dunno if it's that important... Is it?
It probably should, to be honest.
Quote
Adding them back would probably be a bit complicated...
Yup. Not sure it's hugely critical personally.

/mewill go test shortly.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 12:24 AM
Or maybe just that...

Code: [Select]
surroundText(new Array(num).join('[/quote]') + '\n', '\n\n[quote continued]' + new Array(num - 1).join('[quote]'), this);
Quote from Arantor on March 13th, 2011, 12:21 AM
Quote
It still won't deal with things that are cut in the middle, like code tags or even anchors or whatever. Dunno if it's that important... Is it?
It probably should, to be honest.
What about... If I cut a code tag that's located in a nested quote? (i.e. not directly inside the main quote.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 13th, 2011, 12:25 AM
Quote
What about... If I cut a code tag that's located in a nested quote? (i.e. not directly inside the main quote.)
I'd argue it should replicate the end code bbc in before the cut, and open a new code bbc in the new quote. That way the tags are what they should be, and will be legally nested later.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 12:45 AM
It's a bit complex but... Well, I guess I can get a copy of the text between the last [quote] opened and the current cursor position, get a list of all opened and unclosed tags, and reopen them in order.
Still... It's going to make the code at least twice bigger. Meh.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 13th, 2011, 12:46 AM
It's the only way to ensure that the quote doesn't break anything it's not supposed to, I think.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 07:32 PM
It's quite complicated per se...
But I've made it. (Phew.)
This isn't optimized, but it's working at least.
This replaces the second half of the function... Obviously it's much longer. Can't do much about that... Feel free to optimize yourself, too.

Code: [Select]
// Build a list of opened tags...
var
selection = this.value.substr(0, selectionStart), lcs = selection.toLowerCase(),
lcsl = lcs.length, pos = 0, tag, bbcode, taglist = [], extag, log_tags = true,
protect_tags = ['code', 'php', 'html'];
while (true)
{
pos = lcs.indexOf('[', pos) + 1;
if (!pos)
break;
tag = selection.substring(pos, lcs.indexOf(']', pos + 1));
bbcode = tag.substr(tag.charAt(0) === '/' ? 1 : 0);

if (tag.charAt(0) === '/')
{
if (!log_tags && bbcode != taglist[taglist.length - 1].substr(0, bbcode.length))
continue;
do
{
extag = taglist.pop();
if (in_array(extag, protect_tags))
log_tags = true;
}
while (extag && bbcode != extag.substr(0, bbcode.length).toLowerCase());
}
else if (log_tags)
taglist.push(bbcode);
if (log_tags && in_array(bbcode, protect_tags))
log_tags = false;
}
for (var closers = [], j = 0, l = taglist.length; j < l; j++)
closers[] = '[/' + (taglist[j].indexOf(' ') > 0 ? taglist[j].substr(0, taglist[j].indexOf(' ')) : taglist[j]) + ']';
surroundText(closers.reverse().join('') + '\n', '\n\n[' + taglist.join('][') + ']', this);

return true;

NB: this uses the original quote params, rather than "continued".
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 13th, 2011, 07:51 PM
I just realised another issue with it, if you're wrapping tags - you'd have to pass a list of closed tags to the parsing function otherwise it would see the br tag and attempt to close it, no?

(As for me, for the first time in 2 years, I'm experimenting with a theme as opposed to UI tweaks :o)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 08:26 PM
Ah, yes indeed... Something I didn't think of.

A theme, eh? Based on something?
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 08:34 PM
Here's the complete code, updated for self-closing tags... I've laid the tags out to make them easier to mod (oh... How I hate the word. But I can hardly do it differently. Unless you have an idea...)

Code: [Select]
// Split a quote if we press Enter inside it.
function splitQuote(oEvent)
{
// Did we just press Enter?
if (oEvent.which != 13)
return true;

// Where are we, already?
if ('selectionStart' in this)
var selectionStart = this.selectionStart;
else
{
var range = document.selection.createRange(), dul = range.duplicate();
dul.moveToElementText(this);
dul.setEndPoint('EndToEnd', range);
var selectionStart = dul.text.length - range.text.length;
}

// Build a list of opened tags...
var
selection = this.value.substr(0, selectionStart), lcs = selection.toLowerCase(),
lcsl = lcs.length, pos = 0, tag, bbcode, taglist = [], extag, log_tags = true,
protect_tags = [
'code',
'php',
'html',
],
closed_tags = [
'br',
'hr',
'more',
];
while (true)
{
pos = lcs.indexOf('[', pos) + 1;
if (!pos)
break;
tag = selection.substring(pos, lcs.indexOf(']', pos + 1));
bbcode = tag.substr(tag.charAt(0) === '/' ? 1 : 0);

if (tag.charAt(0) === '/')
{
if (!log_tags && bbcode != taglist[taglist.length - 1].substr(0, bbcode.length))
continue;
do
{
extag = taglist.pop();
if (in_array(extag, protect_tags))
log_tags = true;
}
while (extag && bbcode != extag.substr(0, bbcode.length).toLowerCase());
}
else if (log_tags && !in_array(bbcode, closed_tags))
taglist.push(bbcode);
if (log_tags && in_array(bbcode, protect_tags))
log_tags = false;
}
for (var closers = [], j = 0, l = taglist.length; j < l; j++)
closers.push('[/' + (taglist[j].indexOf(' ') > 0 ? taglist[j].substr(0, taglist[j].indexOf(' ')) : taglist[j]) + ']');
surroundText(closers.reverse().join('') + '\n', '\n\n[' + taglist.join('][') + ']', this);

return true;
};
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 13th, 2011, 09:00 PM
We'd actually have to pass the list of closed tags to the JS because although the list is only three tags now, it might not be in future.

As for the theme, just playing with some different header ideas and seeing how well the sidebar worked on the right.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 09:32 PM
Quote from Arantor on March 13th, 2011, 09:00 PM
We'd actually have to pass the list of closed tags to the JS because although the list is only three tags now, it might not be in future.
I know, I know... But if we pass it, we'll also have to pass the list of unparse_content tags (a matter of logic)...
BTW, I forgot to add nobbc to the list. Done locally.

Anyway, I figured you can do it if you want, now that the stuff is committed ;)

Also, what do you think of the result...? I haven't added anything to make it disablable (is that a real word?), because let's just say... I'm quite happy with it. Of course it's going to crash/behave badly in plenty of situations... I'm sure a [quo[b][/b]te] wouldn't behave well... Or splitting a quote right inside a [url=something_very_long] tag...
Quote
As for the theme, just playing with some different header ideas and seeing how well the sidebar worked on the right.
It's fun innit? ;)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 13th, 2011, 11:27 PM
Okay, I've generated the list dynamically. (Query-free, since parse_bbc(false) generates the list from the current bbc cache.)

You might wanna test the entire thing on complex messages if you have some time... Notably, mixing quotes with code tags is okay but if you do several in a row, Wedge seems to give up at some point... It ends up emptying the taglist array, indicating that it 'missed' the matching tag when going through the pop() loop.
Bed time for me, so if you can find the 'culprit'... Please fix it for me :)
Posted: March 13th, 2011, 11:21 PM

AFAICS, the bug (also?) happens when we just press the Enter key in an area that is NOT within a quote... So, obviously, Wedge will return an empty array, uh. Dull! :lol: But I'm pretty sure I still managed to trigger the bug within a code tag.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 14th, 2011, 12:03 AM
Hmm, this seems like it could be very interesting to debug. I'm doing other (family history) stuff tonight but I can certainly dig into it properly tomorrow.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 17th, 2011, 04:17 PM
Did you look into it, or shall I..?
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 17th, 2011, 06:10 PM
I've had a play with it, and it's certainly interesting, just gotta get used to it, you know? I need to be sure in my own mind when it's acting up and when it's behaving as expected.

I also get the distinct impression an option to disable it (either forum wide or per user) wouldn't be a bad idea.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 17th, 2011, 06:30 PM
I don't think forum wide would be very logical. This is a helper and it isn't as buggy as, say, the Wysiwyg engine...
A per-user setting, yeah, I thought about that but am too lazy ;) Spent too much time and that feature and it didn't even end up the way I wanted... (I wanted the > stuff, and in the end I did something else :P) (I still have the code for ">", btw... Maybe I'll commit it in the future, in the wip folder.)
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 18th, 2011, 12:16 AM
Quote
I don't think forum wide would be very logical.
True enough. I just get the impression that some people are going to freak out though.
Quote
A per-user setting, yeah, I thought about that but am too lazy
We really need to overhaul that actually. The way it's implemented feels wrong to me. If you ever looked at it, you'll understand why it feels wrong, I think.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 18th, 2011, 12:25 AM
Quote from Arantor on March 18th, 2011, 12:16 AM
True enough. I just get the impression that some people are going to freak out though.
Yeah, possibly... But then they'll get used to it and they may like it. Only old timers will refuse it. People like me, probably :lol:
(I'm not saying I won't use it... I'm saying if I were in a position to 'try' it, I would have a hard time accepting that Wedge is doing everything for me :P)
Quote
We really need to overhaul that actually. The way it's implemented feels wrong to me. If you ever looked at it, you'll understand why it feels wrong, I think.
You mean the fact that it's in the 'Look and layout' page?
Profiles are on my to-do-list to overhaul (e.g. custom profiles, buddy lists...), and as I think I said earlier, I'll definitely make user settings easier to access. It would probably make sense to have all user settings (inc. account settings etc) in a single page, divided in sections that are folded out as required. Somethin' like that...
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 18th, 2011, 12:29 AM
Quote
Yeah, possibly... But then they'll get used to it and they may like it. Only old timers will refuse it. People like me, probably
Well isn't that ironic :lol:
Quote
I'm saying if I were in a position to 'try' it, I would have a hard time accepting that Wedge is doing everything for me
It's a fair point.
Quote
You mean the fact that it's in the 'Look and layout' page?
No, more the mechanics. There are just a bunch of checkboxes in the HTML, and minimal validation done on the other end; you can literally add a profile field just by adding the HTML there without having to modify anything else.
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Nao on March 18th, 2011, 12:42 AM
I don't get the problem with the checkboxes.
As for security... Well, it's not THAT surprising ahah.

For the record, I just tested IE7.js on IE6 and it's still slow as hell (about 2s delay on one-post topics, and 5s on full page topics). Also tried my simplified IE9.js, same delays globally. Considering the amount of fixes this file has, it's no surprise. Finally, I tried with Selectivizr and it's a very acceptable solution (about 1s delay on full page topics, similar delay on smaller pages). Just a pity that it doesn't support many fixes... For instance, it has a fix for "input[type=button]" but not for ".class1 > .class2" or, worse, ".class1.class2". Technically it's only interesting as proof that it CAN be done faster than IE7.js does it.

Bed time!
Title: Re: Another life-changing fantastic idea for quotes! (Bit silly, too.)
Post by: Arantor on March 18th, 2011, 12:56 AM
Quote
I don't get the problem with the checkboxes.
As for security... Well, it's not THAT surprising ahah.
The problem with the checkboxes in there is simply the fact that the only way they're passing back to the backend is by what's in the form. It would be trivial to inject something into the themes table via that page because no sanitisation of accepted values. Literally to add a new field is a new <input> in the form. No checking on the backend what should be used, no validation of data type, just the form provides it, so it's accepted.