| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| JS Question | |
|---|---|
| Tweet Topic Started: Jan 29 2007, 10:48 PM (310 Views) | |
| Larksmann | Jan 29 2007, 10:48 PM Post #1 |
![]()
5 Meters Up and Inverted
![]() ![]() ![]() ![]() ![]()
|
I was looking at the ZetaBoard beta, and found it really useful how the BBCode buttons working. For example, if you have some text selected, pressing the B button will surround the selected text with [/ b] tags. If the cursor is within the text when you press the button, it will insert a tag at the cursor. With my BBCode buttons (on my website), it just appends the tag to the end of whatever is in the textarea. I'm not the greatest whiz with js, but I know my way around. So how would I do it the ZetaBoards way? PS: I tried looking at the JavaScript on Zetaboards, but they put all the code on one line with absolutely no whitespace in order to prevent coding prodigies like me from expanding their knowledge :-/ |
![]() |
|
| Arrogant | Jan 30 2007, 01:53 AM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]()
|
It has no whitespace because its the packed version of jQuery ![]() As for the BBTags, i know it has something to do with selection ranges and other stuff, but that isn't exactly my forte...lol xD You could just match the text that the user is focused on, and replace it with the same text, except wrapped in the tags the user chose.
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
3:02 PM Jul 11
|




![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)




3:02 PM Jul 11