ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: emanuele on December 07, 2013, 03:55:53 am

Title: Quote in quick reply no editor
Post by: emanuele on December 07, 2013, 03:55:53 am
Opera (version 12.x, I have to install a new one at some point)
In a topic,
Quick reply "plaintext"
Quote a message
=> javascript error in this function:
Code: [Select]
function replaceText(a, b) {
if ("caretPos" in b && "createTextRange" in b) {
var c = b.caretPos;
c.text = " " == c.text.charAt(c.text.length - 1) ? a + " " : a;
c.select()
}
else if ("selectionStart" in b) {
var c = b.value.substr(0, b.selectionStart),
d = b.value.substr(b.selectionEnd),
e = b.scrollTop;
b.value = c + a + d;
b.setSelectionRange && (b.focus(), d = is_opera ? a.match(/\n/g).length : 0, b.setSelectionRange(c.length + a.length + d, c.length + a.length + d));

The error is at this piece:
Code: [Select]
a.match(/\n/g).length
and the error is:
Code: [Select]
Unhandled Error: Cannot convert 'a.match(/\n/g)' to object

Though, it seems the error appears only quoting one of the (broken) messages in this topic:
http://www.elkarte.net/index.php?topic=508.0
not the last one by Shawn.

Probably related to some wrong encoding somewhere...

Test °C
Title: Re: Quote in quick reply no editor
Post by: Spuds on December 07, 2013, 09:57:30 am
Well the new scripts are not on the site yet, so I'm not immediately responsible :D

I'll take a look and see if I can reproduce that, I did install opera 12.x so I could surf old skool just like the Eman, also did it to fix up the detection stuff since past 12 it  is really webkit and all those opera checks should fail since after 12 its not really opera  ;)
Title: Re: Quote in quick reply no editor
Post by: emanuele on December 07, 2013, 10:10:41 am
Don't waste time testing old Opera, if it doesn't work with the new one may be a problem, other wise I'd just remove the conditional... :P
Title: Re: Quote in quick reply no editor
Post by: Spuds on December 07, 2013, 12:07:32 pm
I fixed it anyway ... plus found some more ie5 stuff  :'(  so it was worth it  ;D
Title: Re: Quote in quick reply no editor
Post by: emanuele on December 07, 2013, 12:47:59 pm
IE5 ROFL!!!

Moving to fixed. :P