Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MicroMod: Insert Tags for Mozilla (Take 4)
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

cripto9t
Average Member

USA
881 Posts

Posted - 17 November 2003 :  07:38:22  Show Profile
Still doesn't work in my NS 7.0, but the smiles now work in IE.
The smiles insert right on this forum. Has the code been changed or has it always been this way

    _-/Cripto9t\-_
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 17 November 2003 :  11:01:03  Show Profile  Visit Nathan's Homepage
The smilies should never have been broken in IE. Unless that function I eliminated had a typo in it.

It shouldn't work in Netscape 6.x or 7.0, their Gecko base is too old.

Nathan Bales
CoreBoard | Active Users Download

Edited by - Nathan on 17 November 2003 11:02:05
Go to Top of Page

zeth
Junior Member

United Kingdom
117 Posts

Posted - 01 December 2003 :  08:11:18  Show Profile  Visit zeth's Homepage
This is a great fix to a horrible problem, everyone should use this now! Thankyou, rant over.

THEOLOGY.ME.UK CROSSRING.COM
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 January 2004 :  10:08:19  Show Profile
implemented this change on this site. You'll probably have to force a refresh to get the new inc_code.js file though.

Will test it for a few days here and if there are no problems, it will be added to the base code.
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 21 January 2004 :  10:47:45  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Works fine using Mozilla 1.6 (Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040113) and Netscape 7.1 (Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)).

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz

Edited by - OneWayMule on 21 January 2004 11:15:50
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 January 2004 :  11:06:25  Show Profile
I tested it with the current nightly build of Firebird for windows:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7a) Gecko/20040120 Firebird/0.8.0+

works fine with that version.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 23 January 2004 :  07:35:32  Show Profile
ok, I've been doing some more testing of this and noticed some things.

(this is all using Mozilla Firebird)

after inserting text, tags or a smilie inside some existing text, the focus isn't being returned to the textarea

and, after the insertion, the cursor isn't being left immediately after the newly inserted text, it is being placed at the end of the textarea.

I found one site, where this behavior doesn't exist:

http://randomfoo.net/sandbox/mozilla/getselection/

Mozilla's implementation doesn't allow you to just return focus at the caretPos like IE does, you have to figure out the position it should be at by taking the ending position of the selection in the textarea, and add to that # whatever was added during the insertion.

I was able to kludge my way through it and got it to act as expected, but it's not the most elegant solution. I had to manually pass some values based on the length of the tags used and change the addText function further. Then I had to modify all of the smilie tags to also pass a value. But it broke some of the current functionality, so I reverted it all back to the code shown in this post.

I believe that Mozilla is still being actively developed, and this functionality isn't final, and may change. Taking that into account, I think it would be better to leave this as a MOD for right now. It's a pretty simple change, but I don't want to add code to the distribution file that might become obsolete in a few months.

I am open for suggestions though.
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 18 June 2004 :  20:03:26  Show Profile  Visit Nathan's Homepage
I streamlined the above code and fixed the return focus.

It should also now work with any browser that supports DOM2 (Safari???)

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 18 June 2004 :  21:08:10  Show Profile
I implemented Nathan's changed code above on this site. You'll probably have to force a refresh to get the new inc_code.js file though.

Please test this out and report back any problems.
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 18 June 2004 :  21:47:07  Show Profile
It works for me. I'm using Firefox 0.9.

Support Snitz Forums
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 18 June 2004 :  22:12:21  Show Profile  Visit Nathan's Homepage
Ahh, I didn't check that for typos!!! I'm glad there were none!

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 June 2004 :  19:48:37  Show Profile
Nathan,

Do you think it would be possible to implement the IE functionality where you can select some text, then click on the one of the buttons (like the Bold button), and then have all of the selected text surrounded by the tags.

For example, in IE you can select some text like this:

selectedtext

and then when you click on the Bold button, it will automatically change the selected text to this:

[b]selectedtext[/b]

I tried doing it with Firefox .9 and it just puts the tags at the very end of all the text in the textarea.
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 19 June 2004 :  22:12:20  Show Profile  Visit Nathan's Homepage
Oh, you mean to keep the entire thing selected instead of putting the cursor at the end?


function AddText(text) {
	var tarea = document.PostTopic.Message;
	if (tarea.selectionStart){ // if it supports DOM2
		start = tarea.selectionStart;
		end = tarea.selectionEnd;
		tarea.value = tarea.value.substr(0,tarea.selectionStart) 
			+ text + tarea.value.substr(tarea.selectionEnd);
		tarea.focus();
		tarea.selectionStart = start;
		tarea.selectionEnd = start + text.length;
	} else {
		if (tarea.createTextRange && tarea.caretPos) { 
			var caretPos = tarea.caretPos; 
			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?   text + ' ' : text; 
		} 
		else {
			tarea.value += text; 
		}
		tarea.focus(caretPos); 
	} 
}


As far as I can this mimics the IE functionality nearly perfectly. The only major difference is that IE keeps the text selected only doesn't highlight the selected part (a bug in IE????) and Mozilla does.

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 21 June 2004 :  20:08:35  Show Profile
Thanks Nathan,

I tried the changes you posted, but with Firebird .9 it still behaved the same (placed the tags at the end of the textarea instead of around the selected text).
Go to Top of Page

Nathan
Help Moderator

USA
7664 Posts

Posted - 21 June 2004 :  21:19:52  Show Profile  Visit Nathan's Homepage
I tested that with Firefox .9 (currently my default browser). . . is it really not working for you?

Nathan Bales
CoreBoard | Active Users Download

Edited by - Nathan on 21 June 2004 21:20:29
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07