vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   New vbcode.js - vBcode and smilie user interface improvement (https://vborg.vbsupport.ru/showthread.php?t=24033)

s.molinari 07-29-2001 10:00 PM

Hello vB Troopers,

With special permission from the Dev Team I am proud to release an improved version of vbcode.js. Any usage of this script other than in licensed vBulletin driven Boards is a direct violation of Jelsoft copyrights. Any violators will be prosecuted to the full extent of the law!

One MAJOR Improvement(note: only works with IE, NS users are out o luck! But who uses NS anyway?)

vBcode and smilies will be inserted wherever the cursor is instead of at the end of the text.

Installation
Copy the new vbcode.js file over your old one(see "Another small note" below). If you'd like to keep the old file just rename it before copying the new one.

You need to add the following text to the "message" textarea tag:
Code:

onChange=getActiveText(this) onclick=getActiveText(this)
It should basically look similiar to this:
Code:

<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2"
onChange=getActiveText(this) onclick=getActiveText(this) >$message</textarea>

Please note: The variable($message) may be different in some templates, editpost for example, so make sure to keep the original variable in the textarea attribute "name =". Otherwise the text may be missing in some instances.

This textarea can be found in the following templates:

Calendar Templates

calendar_enterevent

New Posting Templates

newreply

newthread

Private Messaging Templates

priv_forwardmultiple

priv_sendprivmsg

priv_sendtobuddies

and the editpost template

additional template changes

In the vbcode_popup_smilies template you must delete the following code:
Code:

<script language="JavaScript">
function smilie(smilietext) {
        opener.document.vbform.message.value += smilietext+" ";
        //opener.vbform.message.focus();
}
</script>

In the vbcode__popup_smiliebits template you must change:
Code:

<a href="javascript:smilie('$smilie[text]')">
to:
Code:

<a href="javascript:opener.smilie('$smilie[text]')">
small note:If you use the above code pleas omit the space between java and script.


If these changes aren't made the new script WILL NOT WORK!

I hope to hear from those who use it, and please let me know if you find a bug.


vB.org is using this hack. Try it out!:D

Scott

Latest release date: 20.04.2002
Any version older than this should be updated.

smithy256 07-30-2001 07:30 PM

thanks but i cant install it because im a complete newbie.

s.molinari 07-30-2001 07:38 PM

Quote:

Originally posted by smithy256
thanks but i cant install it because im a complete newbie.
Can you copy a file to your web server and cut and paste in windows?

That's all the skills you need.:)


Scott

Delhaze 07-30-2001 07:46 PM

I have the latest version installed and all is well. :)

I would also like to congratulate the VB team for allowing this file to be posted.

You have completely restored my faith with your new common sense approach.

It will also reduce the number of hits I was getting to this file on my board. :D

ThomasP 07-30-2001 09:12 PM

Hi Scott,

really a great hack! Works like a charm, "installation" was easy.

And thanks to the vB Team, too.

cu & Gr??e ;)
-Tom

P.S.: At least it works in NS the way it did before, so this is not really a drawback...

RobAC 07-31-2001 12:57 AM

Found a problem with this hack. If I go to edit a post I made, the content of my post does not show up within the text field. I had to revert my editpost template back to the original. Anyone else experiencing this?

s.molinari 07-31-2001 04:27 AM

Quote:

Originally posted by RobAC
Found a problem with this hack. If I go to edit a post I made, the content of my post does not show up within the text field. I had to revert my editpost template back to the original. Anyone else experiencing this?
Hello Rob,

You were probably a bit too fast. In the editpost template you probably copy and pasted over the $postinfo[message] variable. It is something I should point out in my installation instructions.

The textarea in editpost should look like this:
Code:

<textarea name="message" rows="20" cols="$textareacols" wrap="virtual" tabindex="2"
onChange=getActiveText(this) onclick=getActiveText(this) >$postinfo[message]</textarea>

Scott

tubedogg 07-31-2001 05:18 AM

Awesome Scott :)
v cool and works great.

s.molinari 07-31-2001 06:38 AM

Quote:

Originally posted by tubedogg
Awesome Scott :)
v cool and works great.

Thanx for the compliment Kevin. Coming from you means alot!:D

Scott

VirtueTech 07-31-2001 07:42 AM

I found the script and used it...I had problems with my netscape users...they seemed to get script errors...when this ran.

Not sure what it was...I didn't get to test it with netscape...

EDITED - I thought this was the original thread you started. I didn't see the new vbcode.js at the top of the page...I came into this thread via 'lastpost'. I got the last vbcode off Ztsky's site and that one didn't work.

This new one you posted works great! Thanks. :)

s.molinari 07-31-2001 07:59 AM

Quote:

Originally posted by VirtueTech
I found the script and used it...I had problems with my netscape users...they seemed to get script errors...when this ran.

Not sure what it was...I didn't get to test it with netscape...

If you had gotten the first script I posted here,
the one that was deleted, then you definitely have a faulty script. At the time I posted it, I too didn't test it with NS. My mistake......... or Netscapes?:D

The script in this post should work with NS(I tested it with 4.7). I racked my brains and searched all over the internet trying to find a fix to get it to work like it does with IE. All I was able to manage is that no errors come up with NS, but the functionality is, unfortunately, as it always was. i.e. the code is always added to the end of any previously written text. Another reason from hundereds why NS users should change over to the Explorer!;)

Scott

VirtueTech 07-31-2001 09:19 AM

Ok question: Is there any way to make this script work with the "Get More Smilies" pop-up window. So that when they click on a smiley in the pop-up window that it updates the textarea in the last spot the cursor was?

s.molinari 07-31-2001 10:05 AM

Quote:

Originally posted by VirtueTech
Ok question: Is there any way to make this script work with the "Get More Smilies" pop-up window. So that when they click on a smiley in the pop-up window that it updates the textarea in the last spot the cursor was?
This is a valid problem, which I have tried to get rid of. Haven't found the trick yet.

Scott

s.molinari 07-31-2001 02:34 PM

Hello all,

I found a fix for the "get more" smilies popup window prob.
Many thanx goes to Vincent Puglia at www.pageresource.com. He basically solved the prob for me with his tips.

In the vbcode_popup_smilies template you must delete the following code:
Code:

<script language="JavaScript">
function smilie(smilietext) {
        opener.document.vbform.message.value += smilietext+" ";
        //opener.vbform.message.focus();
}
</script>

In the vbcode__popup_smiliebits template you must change:
Code:

<a href="javascript:smilie('$smilie[text]')">
to:
Code:

<a href="javascript:opener.smilie('$smilie[text]')">
Scott

Uh....guys I think there is a small problem with the vbcode parser! It should read "javascript : opener.smilies" without spaces and the embarrassed face.;)

Freddie Bingham 07-31-2001 02:39 PM

Disable Smilies :)

RobAC 07-31-2001 02:44 PM

Quote:

Originally posted by freddie
Disable Smilies :)
Been there, done that. The responses I got from my members were 100X more viscious than the responses I got when I tried disabling post counts. You might think I had imposed a one post allowed per week per user curfew! :)

s.molinari 07-31-2001 04:59 PM

Quote:

Originally posted by freddie
Disable Smilies :)
If I were Homer I would say,"Doh!" :D

Scott

But then again, when most people post code they don't usually include smilies in it do they.:confused:

Freddie Bingham 07-31-2001 05:05 PM

I meant just in that post, which if you notice I edited and turned smilies off.

s.molinari 08-01-2001 10:35 AM

Hello users of this hack,

Does somebody have a test area on their board where guests can make post. I would like to link to it as a demo to show everyone what the new script does.

I would link to my own board but it's in german and is original vB!:)


Any help would be appreciated!


Scott

inetd 08-01-2001 02:15 PM

Please post screenshot of this hack.

s.molinari 08-01-2001 05:14 PM

Quote:

Originally posted by inetd
Please post screenshot of this hack.
Hello inetd,

A screen shot is practically useless. The improvement is in the functionality and you can't take a picture of that. A screen shot would look just like any other vB Board. You wouldn't see a difference.


Scott

s.molinari 08-01-2001 07:35 PM

Demo Board now available for a short time!

Sorry demo board is closed.


Scott

jucs 08-01-2001 11:23 PM

Ugggh, too many changes..too much time for such a small improvement with no complaints now.

When I first saw this it was "cool"..just replace the file. Then, I saw the LONG list of changes to a bunch of files.

Oh well. :)

tubedogg 08-01-2001 11:29 PM

Honestly, it took me approximately 60 seconds to make all the required changes...

s.molinari 08-02-2001 05:48 AM

60 seconds? Wow....:D

I made the hack and it took me 120 seconds. Seriously, about 10 minutes and the hack should be up and running. I believe my instructions are a bit more cumbersome than the actual work that they describes. So don't let my longwindedness scare you.:)


Scott

VirtueTech 08-02-2001 06:59 AM

jucs please :rolleyes:

Scott - I added the 'get more' smilies additon...works awesome....it even brings the user back to their textarea in the original window after.

I'm sure if we wanted we could even put a 'close window' in the link to so that once they choose the smilie and added it...it closed the window all in one click.


I wonder if that would be good....or if the window should stay open.

Here is the code to CLOSE the 'get more smilies' window after you click. This will allow the process of adding and closing the 'get more smilies' window a one click process.

AFTER you make both Scotts changes just change your vbcode__popup_smiliebits

From:
PHP Code:

<a href="java script:opener.smilie('$smilie[text]')"

To:
PHP Code:

<a href="java script:opener.smilie('$smilie[text]'),self.close()"

Very simple and makes things cleaner. Not for everyone though....some people might want to leave the window open to add more. But I'll just let the user open the window again. :cool:

Thanks again Scott and Vincent Puglia for this....truly a simple yet very useful addition.

dost 08-02-2001 02:12 PM

You forgot to mention to add the code to the editpost template.

VirtueTech 08-02-2001 03:08 PM

Dost - I did ?

dxb 08-02-2001 08:38 PM

it worked fine

except that problem with the space between the java and script drove me crazy hahahah I installed the hack twice and removed it then I noticed the space problem :) now it's working fine

thanks Scott

ThomasP 08-02-2001 08:41 PM

Hi,
works great in 2.0.3

I edited <a href="java script to <a href="javascript .
cu,
-Tom

s.molinari 08-03-2001 04:36 AM

Sorry about the java script thingy. That I believe is a special function of the [code] tag in the vbcode parser. It does that to avoid people writing JS in their posts and using willfully or not to mess up vB. I may be wrong though. :)

For those of you who cut and paste the code out of my directions please do not forget to delete the space between java and script.


Scott

JJR512 08-04-2001 03:18 PM

Mostly this hack seems to work fine, but I did notice one odd thing. When in Enhanced Mode, if you use the keyboard shortcuts for the various tags (like Ctrl+I for italics), the codes do not show up in the message. They don't show up anywhere, even at the end. The really odd thing is that the status window acts as if the code is there; if you hit Ctrl+I twice, for example, on the second time it will tell you that "You already have an open tag of this type".

Enhanced Mode works fine if you actually click the buttons. It's just the keyboard shortcuts that don't work anymore. Can a way be found to get them working again?

s.molinari 08-05-2001 01:57 AM

JJR512,

What Browser are you using? With IE 5.+ it works fine. The keypress doesn't work with NS 4.7. But then again the whole script doesn't work right with NS.

Scott

JJR512 08-05-2001 03:56 AM

It's IE6 beta, updated as far as I know. Windows 2000 Pro, if it helps.

JJR512 08-05-2001 04:03 AM

I just noticed another odd thing.

For the record, what I mentioned earlier was while posting a new thread.

This happens while posting a reply.

In Enhanced Mode, if I click the I button to begin italic text, the tag appears, and I type the text. When I click the Close Current Tag button, the /i tag appears. But if instead I click the Close All Tags button, the /i tag appears, immediately followed by another tag that says /undefined. (This also happens while starting a new thread.)

s.molinari 08-05-2001 04:28 AM

I've recreated the /undefined problem. I'll look into that. Is the alt+i or b or u still not working?

Scott

JJR512 08-05-2001 04:40 AM

No...well sort of.

Here's another aspect of the problem which looks like it's getting weirder and weirder.

If I click on "New Reply", if I'm in Normal Mode, and I hit alt+b and put some text in the pop-up box, the text, along with the bold codes, appears in the message. But if I do it again, after the first time, the popup box will appear, but when I press Enter, nothing new shows up in the message area. It doesn't matter which code I try to use the second time; it just won't work.

It looks to be similar in Enhanced Mode...the first time I use a keyboard shortcut, it shows up where the cursor is. But when I try to close it or begin a new tag, nothing new shows up. For example I can hit alt+b and the b tag shows up, but when I hit alt+x, the /b tag does not show up. If I hit alt+x again, the status thing tells me there are no open tags to close.

s.molinari 08-05-2001 07:03 AM

Hello JJR 512,

There was an error in my logic. I have corrected the problem and the new file is ready for upload in my original post. See if it works.

Scott

s.molinari 08-05-2001 07:11 AM

Hello all users of this hack,

There was a small logic error in the script. I used the same variable twice not knowing that variables in JS are considered GLOBAL. At least I think that was the prob. Anyhow, I believe it's fixed. Please download the vbcode.js file again.

Scott

JJR512 08-05-2001 02:24 PM

Even on your test board I'm having the same problem. That is, (Normal Mode, btw) if I hit alt+i, type in some text in the popup box, hit Enter, the text I typed shows up with the codes around it. So that's fine. But if I do it again, the popup box shows up, I type in my text and hit Enter, but nothing happens. The text I just typed does not go into the message, and no codes go into the message, either. The original text is still there; it's just that the new stuff doesn't go into the message.

So if it works fine for you on your test board, but doesn't work for me, then maybe that means the problem is with IE6? Can anyone else with IE6 try it on the test board?


All times are GMT. The time now is 04:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01681 seconds
  • Memory Usage 1,841KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete