spacey
Amazing Technicolor Dreamcoat From: Group W Bench
Karma: 98 Posts: 7733
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #15 on: April 04, 2008, 04:12:48 PM » |
|
D'oh! There's a forum option to set this. At this point, it's either one way or the other, there's no option for buttons for both. I don't have time now to get both options to work, so let's try having it default to a simple, non-nested quote and see if anyone cares. The only potential drawback I can see is that now anything in quote tags is eliminated, as you can see with the above demonstration. Whether people will care?
|
|
|
Logged
|
|
|
|
gleek
Flak Jacket
Karma: 107 Posts: 9511
OfflineE chu ta!
|
|
Re: Quote vs. MultiQuote
« Reply #16 on: April 04, 2008, 04:23:35 PM » |
|
I think the new setting is a little strange. I'd prefer that there be something there to indicate that something was removed.
|
|
|
Logged
|
Woman, open the door, don't let it sting. I wanna breathe that fire again.
|
|
|
dystopia
Amazing Technicolor Dreamcoat From: Silicon Valley
Karma: 94 Posts: 7929
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #17 on: April 04, 2008, 04:30:39 PM » |
|
Hmm, tough call. On the plus side, maybe it cuts back on this?
|
|
« Last Edit: April 04, 2008, 04:35:14 PM by dystopia »
|
Logged
|
|
|
|
Uisce Beatha
Amazing Technicolor Dreamcoat From: In the Jar
Karma: 116 Posts: 7357
OfflineGet me the tank!
|
|
Re: Quote vs. MultiQuote
« Reply #18 on: April 04, 2008, 04:47:13 PM » |
|
i.e. "shallow copy" vs. "deep copy"
Geek. I don't have time now to get both options to work...
"Lazy copy" ftw.
|
|
|
Logged
|
"If you're darker than a caramel, Reverend Al speaks for you." - Aasif Mandvi "Well, you can tell by the way I use my walk, I'm a woman's man: no time to talk." - stroh
|
|
|
gleek
Flak Jacket
Karma: 107 Posts: 9511
OfflineE chu ta!
|
|
Re: Quote vs. MultiQuote
« Reply #19 on: April 04, 2008, 04:54:10 PM » |
|
If you want to try using JavaScript, this might give you an idea about how to implement it. This code will strip out any quotes that came from another post (as opposed to regular text wrapped in quote tags), and it will also leave any quotes that are inside code tags as-is. Whatever is stripped out is replaced with a brief message. You'll still have to wrap the resultant text in quote tags with references to the original post. You can try it out here. Copy the code into the left textarea, and click the button. Then on the right-hand side, paste the message into the top textarea. Ah, you can figure it out. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <script type="text/javascript"> function sortnum(a, b) { return a - b; }
function Strip() { var quoterep = '~~inane crap snipped~~'; var txtsrc = document.getElementById('txtSource'); var strsrc = txtsrc.value; var QS$ = '[' + 'quote]'; var QS = '[' + 'quote'; var QE = '[' + '/quote]'; var CS = '[' + 'code]'; var CE = '[' + '/code]';
var tags = {}; var aryq1 = LoadHash(tags, strsrc, QS); var aryq2 = LoadHash(tags, strsrc, QE); var aryc1 = LoadHash(tags, strsrc, CS); var aryc2 = LoadHash(tags, strsrc, CE);
var indices = new Array(); indices = indices.concat(aryq1,aryq2,aryc1,aryc2); indices = indices.sort(sortnum);
var section = new Array(); var mode = level = sectionstart = curpos = 0; var index, tag; for (var i in indices) { curpos = indices[i]; tag = tags['i' + curpos]; if (tag == QS && strsrc.substr(curpos, QS$.length) == QS$) { tag = QS$; } if (mode == 0) { if (tag == QS || tag == QS$ || tag == CS) { section.push(strsrc.substring(sectionstart, curpos - 1)); sectionstart = curpos; switch (tag) { case CS: mode = 1; break; case QS$: mode = 2; break; default: mode = 3; } level = 1; } } else if (mode == 1) { if (tag == CS) { level++; } else if (tag == CE) { level--; if (level == 0) { section.push(strsrc.substring(sectionstart, curpos += tag.length)); mode = 0; sectionstart = curpos; } } } else if (mode == 2) { if (tag == QS$ || tag == QS) { level++; } else if (tag == QE) { level--; if (level == 0) { section.push(strsrc.substring(sectionstart, curpos += tag.length)); mode = 0; sectionstart = curpos; } } } else if (mode == 3) { if (tag == QS$ || tag == QS) { level++; } else if (tag == QE) { level--; if (level == 0) { section.push(quoterep + '\r\n'); sectionstart = curpos + tag.length; mode = 0; } } } } if (curpos < strsrc.length - 1) { if (mode == 3) { section.push(quoterep + '\r\n'); } else { section.push(strsrc.substring(sectionstart, strsrc.length - 1)); } }
document.getElementById('txtResult').value = section.join('');
}
function LoadHash(ohash, strsrch, strfind) { var aryfind = new Array(); var i = 0; var index; do { i = strsrch.indexOf(strfind, i); if (i != -1) { index = 'i' + i; ohash[index] = strfind; aryfind.push(i); i += strfind.length; } } while (i != -1) return aryfind; }
</script> </head> <body> <div> <input type="button" id="btnQuote" name="btnQuote" value="Strip Quotes" onclick="Strip(); return false;"/><br /> <span>Original Post:</span><br/> <textarea id="txtSource" cols="50" rows="2" style="width:100%;height:100px;" /></textarea><br /><br /> <span>Stripped Post:</span><br/> <textarea id="txtResult" cols="50" rows="2" style="width:100%;height:100px;" /></textarea> </div> </body> </html>
|
|
|
Logged
|
Woman, open the door, don't let it sting. I wanna breathe that fire again.
|
|
|
spacey
Amazing Technicolor Dreamcoat From: Group W Bench
Karma: 98 Posts: 7733
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #20 on: April 04, 2008, 05:53:05 PM » |
|
Hmm, tough call. On the plus side, maybe it cuts back on this? Sold!
|
|
|
Logged
|
|
|
|
gleek
Flak Jacket
Karma: 107 Posts: 9511
OfflineE chu ta!
|
|
Re: Quote vs. MultiQuote
« Reply #21 on: April 04, 2008, 05:58:33 PM » |
|
Sold!
|
|
|
Logged
|
Woman, open the door, don't let it sting. I wanna breathe that fire again.
|
|
|
dystopia
Amazing Technicolor Dreamcoat From: Silicon Valley
Karma: 94 Posts: 7929
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #22 on: April 05, 2008, 01:34:47 PM » |
|
Grim. I don't have time today to look at the smiley bug when nested quotes are removed, so I put it back to the way it used to be.
|
|
|
Logged
|
|
|
|
Aske
Lederhosen
Karma: 120 Posts: 31405
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #23 on: April 05, 2008, 05:34:23 PM » |
|
D'oh! There's a forum option to set this. Remove nested quotes when posting - This will only show the quote of the post in question, not any quoted posts from that post.
At this point, it's either one way or the other, there's no option for buttons for both. I don't have time now to get both options to work, so let's try having it default to a simple, non-nested quote and see if anyone cares. test
|
|
|
Logged
|
Russia has invaded a sovereign neighboring state and threatens a democratic government elected by its people. Such an action is unacceptable in the 21st century. -- Chimpy McFlightsuit, CEO of Bu$hco Industries of 'Merka
|
|
|
Aske
Lederhosen
Karma: 120 Posts: 31405
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #24 on: April 05, 2008, 05:35:25 PM » |
|
D'oh! There's a forum option to set this. Remove nested quotes when posting - This will only show the quote of the post in question, not any quoted posts from that post.
At this point, it's either one way or the other, there's no option for buttons for both. I don't have time now to get both options to work, so let's try having it default to a simple, non-nested quote and see if anyone cares. test test2
|
|
|
Logged
|
Russia has invaded a sovereign neighboring state and threatens a democratic government elected by its people. Such an action is unacceptable in the 21st century. -- Chimpy McFlightsuit, CEO of Bu$hco Industries of 'Merka
|
|
|
dystopia
Amazing Technicolor Dreamcoat From: Silicon Valley
Karma: 94 Posts: 7929
Offline
|
|
Re: Quote vs. MultiQuote
« Reply #25 on: April 05, 2008, 06:58:04 PM » |
|
Grim. I don't have time today to look at the smiley bug when nested quotes are removed, so I put it back to the way it used to be. test
|
|
|
Logged
|
|
|
|
stroh
Sleeveless Hoodie From: Impact Crater Springs, CA
Karma: 155 Posts: 16135
OfflineWe're doomed!
|
|
Re: Quote vs. MultiQuote
« Reply #26 on: April 06, 2008, 08:35:03 AM » |
|
|
|
|
Logged
|
|
|
|