Author |
Topic |
|
aspwiz
Junior Member
250 Posts |
Posted - 13 November 2003 : 09:33:57
|
In IE, when you select text and click on the Bold icon, it wraps the selected text up in [ b] and [ /b] tags as you would expect... but in opera and netscape, it adds the tags to the end of the message!!!
I've done a search and looked in the archives, and can't see any topic referencing this.
Is this something that the development team is aware of?
Are there any fixes in existence or indeed, any planned?
Cheers, |
Edited by - Davio on 13 November 2003 10:25:50 |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 13 November 2003 : 10:19:16
|
sorry, but this isn't a bug, opera and netscape do not support the forums insert feature.
It may however be possible to enable it for Mozilla 1.3+ and Netscape 7.1 as discussed below. |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 13 November 2003 : 20:19:11
|
At the time that was implemented in Snitz other browsers didn't support script manipulation of textarea elements. Though not a bug, it may be something that could be considered for future versions.
Some of the newer Gecko based browsers do support this functionality. Here's some example code I found and tested in firebird.
<script>
function inserttext(myTA, texttoinsert) {
myTA.value = myTA.value.substring(0,myTA.selectionStart) + texttoinsert + myTA.value.substring(myTA.selectionStart,myTA.value.length)
}
</script>
<div onclick="inserttext(document.getElementById('mytextarea'),'text to insert')">
insert now
</div>
<textarea id="mytextarea" cols="40" rows="4"></textarea>
|
Nathan Bales CoreBoard | Active Users Download |
Edited by - Nathan on 13 November 2003 21:29:53 |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 13 November 2003 : 20:57:35
|
I just uploaded that code I posted to here -> http://www.ls3k.com/Random/test.html
It works both in IE6 and Mozilla Firebird 0.7 which are the two browsers I have installed. If you dont believe me try it.<edit> Yeah, I was wrong, it only works in Mozilla/Firebird. |
Nathan Bales CoreBoard | Active Users Download |
Edited by - Nathan on 13 November 2003 21:28:54 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 November 2003 : 21:12:13
|
quote: Originally posted by Nathan
Sorry, I beg to differ again.
I just uploaded that code I posted to here -> http://www.ls3k.com/Random/test.html
It works both in IE6 and Mozilla Firebird 0.7 which are the two browsers I have installed. If you dont believe me try it.
I'm only saying that Mozilla has the functionality, I'm not saying its a problem that it hasn't been implmented in Snitz. (Though I would very much like to see it added, as would many other Mozilla users.)
just tried that page in IE6 and it inserts the text at the end, not where the cursor is. And, it's inserting more text each time.
First time I press to insert the text it looks like this:
text to insert
next time it now looks like:
text to inserttext to inserttext to insert
and then the next time it looks like this:
text to inserttext to inserttext to inserttext to inserttext to inserttext to inserttext to insert
and so on.... |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 13 November 2003 : 21:14:32
|
quote: just tried that page in IE6 and it inserts the text at the end, not where the cursor is.
Really? It works in my IE6. Build 2800.1106. Do you have a differnt version?
Try typing a whole string of letter 'f's, then put the cursor in the middle and click the link. |
Nathan Bales CoreBoard | Active Users Download |
Edited by - Nathan on 13 November 2003 21:15:15 |
|
|
Nikkol
Forum Moderator
USA
6907 Posts |
Posted - 13 November 2003 : 21:20:01
|
i have same version as you Nathan and I get the results Richard does. when I do as you say (I typed 6 f's and put the cursor in the middle), I get:
fffffftext to insertffffff |
Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~ |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 13 November 2003 : 21:20:39
|
I've got the same build.
trying again.
I typed 20 f characters:
ffffffffffffffffffff
I placed the cursor right after the 10th f (so right in the middle) and then clicked on the link to insert the text, here is what is now in the textarea:
fffffffffffffffffffftext to insertffffffffffffffffffff |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 13 November 2003 : 21:22:38
|
quote:
It works in my IE6. Build 2800.1106
doesn't in mine, same version as yours, does what Richard's does. |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 13 November 2003 : 21:24:10
|
Yeah, I didn't count my f's. I guess thats the grade I get for this example.
So this isn't IE/Gecko universal code, but it does work properly in Gecko(Firbird). Might require some browser spacific Javascript to get one code to work for all. |
Nathan Bales CoreBoard | Active Users Download |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 13 November 2003 : 21:48:53
|
this should work, but will need a browser check.
function mozAddText(txtarea, open, close)
{
var selLength = txtarea.textLength;
var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
if (selEnd == 1 || selEnd == 2)
selEnd = selLength;
var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd)
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
return;
}
function AddText(text) {
if (is_ie)
{
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
}
else document.post.message.value += text;
document.post.message.focus(caretPos);
}
else
{
mozAddText(document.post.message, text, '');
}
}
|
|
|
aspwiz
Junior Member
250 Posts |
Posted - 14 November 2003 : 10:17:41
|
I'm getting excited....
This looks to be moving toward a fix, that this bug/issue is screaming for! |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 14 November 2003 : 10:58:49
|
it is not a bug, and therefore does not require a fix. |
|
|
Nathan
Help Moderator
USA
7664 Posts |
Posted - 14 November 2003 : 11:02:38
|
quote: Originally posted by aspwiz
This looks to be moving toward a fix, that this bug/issue is screaming for!
The origional Snitz code was never intended to work in anything other than IE, so its not a bug.
I suppose it could be implmented as a micro-mod for those who want it now. I'll look into doing that later today. |
Nathan Bales CoreBoard | Active Users Download |
|
|
aspwiz
Junior Member
250 Posts |
Posted - 15 November 2003 : 10:29:46
|
Thanks Nathan!!!
Sweet! |
|
|
Nathan
Help Moderator
USA
7664 Posts |
|
|
Topic |
|