ElkArte Community

Title: Multi-quoting done the correct way
Post by: emanuele on May 23, 2014, 06:12:03 pm
That is something that once in a while is useful, though I've never seen it done properly. Not that at the moment I know what "properly" means, I just know I don't like what I've seen so far.

For example, few ways I can think that would be nicer than what I've tried:
1) the quote button shows an editor in an overlay window, with the quote and allows me to add some text, then when I'm ready, I can chose between post, or go to the edit page and add more text, or continue adding quotes.
2) pick all the quotes, then when is the moment to insert them, let me decide if I want all of them at once, or just a sub-group (kind of what XF does now, but not exactly the same),

Oh, and I would also love to see a "quote selected text". O:-)
Title: Re: Multi-quoting done the correct way
Post by: meetdilip on May 23, 2014, 10:41:59 pm
I was thinking about highlighting quoted text. Suppose someone quoted a post to begin with quoting a post, the whole post gets highlighted. So does other posts that are selected for multi quote. That gives an idea to users that these text will be quoted.
Title: Re: Multi-quoting done the correct way
Post by: Eliana Tamerin on May 23, 2014, 10:52:16 pm
Quote from: emanuele – Oh, and I would also love to see a "quote selected text". O:-)

This is probably the most useful part.

I wouldn't be a fan of the overlay, btw.
Title: Quote selected
Post by: meetdilip on December 27, 2014, 11:21:51 am
A very nice feature that comes with almost all leading scripts. It's time Elk has it too.
Title: Re: Multi-quoting done the correct way
Post by: ahrasis on December 28, 2014, 12:14:35 am
In addition to the above, I would love a quote with full link. Let say one want to quote from a forum and post to another page / site, it will have proper link back to that forum.
Title: Re: Multi-quoting done the correct way
Post by: emanuele on December 28, 2014, 04:51:56 am
That is already around (since forever I think):
Code: [Select]
[quote=http://www.this.it/your.link]text[/quote]
;)
Of course it has to be manual unless you install something in your browser.
Title: Re: Multi-quoting done the correct way
Post by: ahrasis on December 28, 2014, 08:47:33 am
Aah... I never knew it before. :-[
Title: Re: Multi-quoting done the correct way
Post by: radu81 on December 29, 2014, 10:21:24 am
Quote from: emanuele – Oh, and I would also love to see a "quote selected text". O:-)
I'll love that too ;)
Title: Re: Multi-quoting done the correct way
Post by: emanuele on February 08, 2015, 07:52:17 am
Memo:
Code: [Select]
$('.post_wrapper .inner').mouseup(function () {
var sel = 'empty';
if (window.ActiveXObject)
{
var c = document.selection.createRange();
sel = c.htmlText;
}
else
{
var nNd = document.createElement("span");
nNd.className = 'toremove';
var w = getSelection().getRangeAt(0);
w.surroundContents(nNd);
sel = nNd.innerHTML;
}

alert(sel);
});
source: http://stackoverflow.com/questions/10055806/jquery-get-html-source-of-selected-text-in-div
Title: Re: Multi-quoting done the correct way
Post by: emanuele on February 09, 2015, 02:24:24 pm
Just for the record: with the code above I was experimenting how to grab the selected text on mouseup events.
The problem I encountered with the original code (at least with the browser I'm using on this computer that is (still) a very old version of Opera, so it may not be relevant any more)  is that it wraps the selected text with a newly created element in order to grab the innerHTML and return it. So the options I was considering were: 1) if the code is irrelevant due to the browser (not tested because I was in a hurry), 2) if it was possible to "clone" the selection and wrap the cloned selection (I tried using jQuery, but without success), 3) if it was possible to use some neutral tag (i.e. a span) and maybe remove it afterwards.
Title: Re: Multi-quoting done the correct way
Post by: Spuds on February 09, 2015, 10:35:51 pm
What does the wrap do in Opera?  Does it cause a line break or some format issue?
Title: Re: Multi-quoting done the correct way
Post by: emanuele on February 10, 2015, 03:40:36 pm
In the original forum yes because it was using a p tag, in the version I posted (removed the stupid code I added), so using the span, is was fine I think.