Author |
Topic |
_barbara
Junior Member
Germany
123 Posts |
Posted - 26 May 2002 : 00:12:07
|
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
|
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.
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 26 May 2002 : 10:31:14
|
Nice mod _Barbara
www.daoc-halo.com |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 26 May 2002 : 13:45:12
|
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 |
|
|
blackinwhite
Average Member
Turkey
657 Posts |
Posted - 26 May 2002 : 16:17:07
|
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.
|
|
|
Sniper3dr
Starting Member
USA
32 Posts |
|
_barbara
Junior Member
Germany
123 Posts |
Posted - 27 May 2002 : 07:49:36
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 20 July 2002 : 22:53:25
|
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 |
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
Posted - 20 July 2002 : 23:04:43
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 22 July 2002 : 01:27:05
|
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 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 22 July 2002 : 14:20:10
|
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.
|
|
|
DoraMoon
Average Member
Taiwan
661 Posts |
Posted - 22 July 2002 : 18:00:48
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 30 July 2002 : 22:28:03
|
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 |
|
|
Roland
Advanced Member
Netherlands
9335 Posts |
|
Topic |
|