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)
 Insert Forum Code in Place
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

_barbara
Junior Member

Germany
123 Posts

Posted - 26 May 2002 :  00:12:07  Show Profile
Title: Insert Forum Code in Place v.1.0
Author: Barbara, barbara@scripteria.de
proudly presenting her first mod here
Created: 25 may 2002
Download: http://scripteria.de/files/snitz/insertinplace.zip
Compatibility/tested on: 3.1 SR4, 3.3.01, 3.3.05, 4.0 beta 03 (should also work on other versions but not tested)

NOTE: this mod only works with Microsoft IE 4.0+ on win 32 platforms!

Description:
This small mod for Snitz Forums 2000 makes posting messages a little more comfortable. When you add some forum code or a smilie to your message using the post buttons, the code will be inserted at caret (text cursor) position instead of being appended at the end of your message. If you have selected some text before, forum code tag pairs, like ¿b]¿/b], ¿code]¿/code] etc., will be put around this selection.

Credits:
This mod is based on a javascript solution for inserting text at cursor position described in an article by Stefan Vogel and Martin Honnen,
http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
I got some further ideas for handling javascript selections from an excellent article in Doc JavaScript, http://www.webreference.com/js/column12/

Ease of Installation (1-Hard, 10-Easy): 9

Demo: http://scripteria.net/forum/

Altered files:

INC_CODE.ASP
1 modification around line 62:
changed function AddText(NewCode)
added function storeCaret(textEl)

POP_ICON_LEGEND.ASP
1 modification around line 45:
changed function insertsmilie (smilieface)

POST.ASP
1 modification around line 693:
added call of function storeCaret

These files are based on v.3.3.05 files, without any mods but including the bugfix in post.asp as described in http://forum.snitz.com/forum/topic.asp?TOPIC_ID=28511.

Installation:
If you use the current official v.3.3.05 without any mods, you can simply upload the altered files. Keep a backup of your original files!
In any other case, do not upload the included files over the top of your originals, but use them only as a guide for modifying your own files.
Search for 'Insert Forum Code in Place' in the files to find what has been changed or added, and copy the new/changed code parts into your own files. In the altered sections of the files, all original code is kept there for reference, just commented out. This should make changing your files quite easy.

Any comments and suggestions for improvement are appreciated!

Barbara

blackinwhite
Average Member

Turkey
657 Posts

Posted - 26 May 2002 :  08:39:00  Show Profile
very nice mod.

this problem is actually has been solved by someone about a year ago, but it wasn't inclueded in the later snitz releases (weird, isn' it?)

Your solution, and code seems more clear and better-coded.

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 26 May 2002 :  10:31:14  Show Profile  Visit Gremlin's Homepage
Nice mod _Barbara

www.daoc-halo.com
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 26 May 2002 :  13:45:12  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Blakinwhite,
this MOD is only good for Windows users using IE 4 and up. It's not really a candidate for inclusion into Snitz for that reason.

@tomic

http://www.skepticfriends.org
Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 26 May 2002 :  16:17:07  Show Profile
quote:

Blakinwhite,
this MOD is only good for Windows users using IE 4 and up. It's not really a candidate for inclusion into Snitz for that reason.

@tomic

http://www.skepticfriends.org



I never thought about it.

got it now, thanks @tomic.

Go to Top of Page

Sniper3dr
Starting Member

USA
32 Posts

Posted - 26 May 2002 :  16:50:54  Show Profile  Visit Sniper3dr's Homepage  Send Sniper3dr an ICQ Message
Nice mod barbara!!!

Great job! Easy to follow!!

-----
Alex "Sniper" Togstad
News and Review Editor
Files Retreat :: http://files.3dretreat.com
3d Retreat :: www.3dretreat.com
Go to Top of Page

_barbara
Junior Member

Germany
123 Posts

Posted - 27 May 2002 :  07:49:36  Show Profile
Thanks a lot for your comments!

I would have liked to make this mod cross-browser compatible but I don't know of any solution for this. If anyone knows one, please let me know.

Anyway, users with other browsers shouldn't get any errors if you install this mod, inserting forum code will just work the usual way for them (i.e., the code will be appended).

Barbara



Edited by - _barbara on 27 May 2002 08:05:08
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 20 July 2002 :  22:53:25  Show Profile  Visit dayve's Homepage
it would be nice if we could get it to work with the upload mod... I will take a look at it to see if I can figure it out. nice little tweak though.. thanks.


http://www.nineinchnailz.com
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 20 July 2002 :  23:04:43  Show Profile
Late reply... I hadn't seen this topic yet

quote:

this MOD is only good for Windows users using IE 4 and up. It's not really a candidate for inclusion into Snitz for that reason.



I don't see why that means it can't be included in a base version of Snitz. Most people use IE and it won't bug users who use a different browser, so it only makes sense to add it as it makes things a lot easier.

As a matter of fact.... This function (maybe not this exact MOD, but the functionality of this MOD) will be in Snitz 3.4

Roland

http://www.frutzle.com

Snitz Exchange | Do's and Dont's
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 July 2002 :  01:27:05  Show Profile  Visit dayve's Homepage
I haven't pinpointed how this is happening, but on occasion the insert-in-place function will post on my page instead of in text area... quite odd... and amusing...




http://www.nineinchnailz.com
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 22 July 2002 :  14:20:10  Show Profile  Visit Etymon's Homepage

Netscape doesn't have the functionality in the design of the browser to support the placement in a textbox like IE.

It's not that there is an unknown workaround for this. Inserting input in place is specifically an Internet Explorer supported ability.

There is talk that newer Netscape browsers "might" support it.



Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 22 July 2002 :  18:00:48  Show Profile
quote:

I haven't pinpointed how this is happening, but on occasion the insert-in-place function will post on my page instead of in text area... quite odd... and amusing...


Hi~ Dayve
i also got the same problem...
the forum code just "escape" if press the button twice or more continually.
and i refer to Richard's post about the new modification on v3.4 .....
then just add one line in AddText function....

var caretPos = textbox.caretPos;
caretPos.text = (lefttag !='' && righttag !='') ? lefttag + selectedtext + righttag : selectedtext + NewCode;
document.PostTopic.Message.focus();
storeCaret(textbox);


now it can solve my problem about this ...

maybe u want try this too ....

~~ ¡¹ ¡¸ ¡¸¡¹ ¡¸ ¡¹ ~~
p.s. the same in insertsmile function ...

caretPos.text = selectedtext + smilieface;
document.PostTopic.Message.focus();
textbox.caretPos = doc.selection.createRange().duplicate();


Edited by - DoraMoon on 22 July 2002 18:05:51
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 July 2002 :  18:34:51  Show Profile  Visit dayve's Homepage
makes sense DoraMoon, thanks.


http://www.nineinchnailz.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 30 July 2002 :  22:19:27  Show Profile  Visit dayve's Homepage
Error when applying fix.




http://www.nineinchnailz.com
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 30 July 2002 :  22:28:03  Show Profile  Visit dayve's Homepage
I just realized it was because it was the smilie one which is in a popup, so I did this:

window.opener.document.PostTopic.Message.focus();

but this is unnacceptable because the popup window loses focus then...


http://www.nineinchnailz.com
Go to Top of Page

Roland
Advanced Member

Netherlands
9335 Posts

Posted - 30 July 2002 :  22:29:23  Show Profile
quote:

Error when applying fix.





Did you by any chance rename the text area or form?

Roland

http://www.frutzle.com

Snitz Exchange | Snitz Icons | Do's and Dont's
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07