hi to all
finally I found a "solution"
http://jsfiddle.net/Wq3cB/8/

I've added two method for getSelectedRange and selectRange instead of
rewriting them.
This way selections of Firefox and Chrome work on IE and Opera.

I think something like this should be included into the mootools core to
have a standard behaviour.

I hope it could be useful.

-Vito-




2011/6/20 Vito Tafuni <[email protected]>

> sorry there was a mistake in the regular expression
> this is the correct version
> http://jsfiddle.net/vitotafuni/Wq3cB/4/
>
> tested on Firefox, Opera, IE and Chrome
>
>
> -V-
>
>
>
> 2011/6/20 Vito Tafuni <[email protected]>
>
>> I don't think it's necessary... try yourself.
>> backslashes are needed only on RegExp('\\r\\n') but the result is the
>> same!!
>>
>>
>> What about this:
>> http://jsfiddle.net/Wq3cB/2/
>>
>> it's just a proof of concept but works!
>>
>> I think that with a couple of changes I could make it possible to
>> integrate a standard behaviour in the whole set of "selection operators"
>>
>> -V-
>>
>>
>>
>>
>> 2011/6/20 Philip Thompson <[email protected]>
>>
>>> Don't you have to escape backslashes in regex's?
>>>
>>> str.replace(/\\r\\n/g, '\n')
>>>
>>> ~Philip
>>>
>>>
>>> On Mon, Jun 20, 2011 at 9:26 AM, Vito Tafuni <[email protected]>wrote:
>>>
>>>> simply because don't work!
>>>>
>>>> \n -> \r\n   try on firefox    http://jsfiddle.net/Wq3cB/1/
>>>> \r\n -> \n   try on opera    http://jsfiddle.net/FQv3V/1/
>>>>
>>>> may be the browser force that specific format!?!
>>>>
>>>> -V-
>>>>
>>>>
>>>>
>>>> 2011/6/20 verylastminute <[email protected]>
>>>>
>>>>> Why not string.replace \r\n with \n when the value changes...?
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> http://lonestarlightandsound.com/
>>>
>>
>>
>

Reply via email to