The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello, I was wondering if anyone could help me with adding my own custom CTRL-X key press while editing or (quick) replying.
For example, when I'm typing a message, hitting CTRL-B will put [b][ /b] around the cursor, or around the selected text. I'm using a hack that shows tooltip links for World of Warcraft items, and this requires people to put the item names between [item][ /item] tags. What I want to do, is add a keypress, similar to CTRL-B, that instantly prints [item][ /item] on the cursor or around the selected text. I would really appreciate it, because I also hope it will give me a little better understanding of how this works. I have been digging through some files, but unfortunately I'm not that familiar with Javascripting so I'm stuck real fast... |
#2
|
|||
|
|||
![]()
No one has any idea? that's too bad
![]() |
#3
|
|||
|
|||
![]()
Have you tried the vbulletin_textedit.js file? There is a function or whatever they call it in javascript: [minicode]vB_Text_Editor_Events.prototype.editdoc_onkeypress = function(e)[/minicode] (Search for that).
You might be able to mess around with that and follow it through. How to edit it exactly I don't know. P.S. Don't forget the Ctrl+X combination is used for "Cutting" so you should use another key instead of X. |
#4
|
|||
|
|||
![]()
Thanks for pointing me in the right direction, I figured it out!
![]() For those who are interested, here's what I did: In vbulletin_textedit.js - Added the line Code:
case 'q': cmd = 'itemlink'; break; Code:
case 'b': cmd = 'bold'; break; case 'i': cmd = 'italic'; break; case 'u': cmd = 'underline'; break; Code:
case 'itemlink': { this.wrap_tags('item', false); return; } Code:
case 'bold': case 'italic': case 'underline': { this.wrap_tags(cmd.substr(0, 1), false); return; } ![]() Only had to find a non-functioning CTRL- key combination, as most are shortcuts for the browser. |
#5
|
|||
|
|||
![]()
I was suspecting it would be something simple like that
![]() Glad you got it working. ![]() |
#6
|
|||
|
|||
![]()
Well, with vBulletin 3.7 this solution is no longer viable.
The file vbulletin_textedit.js is just one big line of text and it appears they changed the scripting as well. I'm going to try to fix it anyway, if anyone's interested I'll post my solution here (if I find it!). Edit: I was able to fix it, quite easily actually, it's just a b*tch to document because there are no line numbers to go by ... |
#7
|
|||
|
|||
![]()
You should be able to download a zip file containing the uncompressed Javascript files, edit this script and upload it to your server instead of the compressed one.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|