MyBB Community Forums

Full Version: Need a relacement for onclick="insertSmilie
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there another onclick for adding text to the mycode window.

Such as:

onclick="insertText

Is it global ? Or,

Does it need a src=xxx.js to run ? If so which of the many .js's needs to be called ??

Too many script's to read, so little time to read them all.

It's like reading a phone-book. Toungue
Adding another MyCode or adding text?

To add a MyCode (and have it work with the Close Tags button etc) then you use:
editor.insertMyCode('test');

It is automatically wrapped in the [] tags.

Alternatively to just insert text (at the current selection you can use:
editor.performInsert('my text', '', true, false);

You need to have the general MyBB Javascripts loaded to do this as well as editor.js.

(This assumes there is already an editor on the page)
Thanks Chris,

I'm adding this Pop-Up Char-Map to the editor, and it uses onclick to insert the char into the post. Wink

[attachment=6145]
That's pretty useful, especially if I need to use special characters (like the umlet in spanish) to type stuff.
And 3-1/2 and a half becomes > 3½

It's on the test site, if you still have the link. Wink
This is coming along very nicely... And thank's for your help Chris, as it made it a little easier. Smile

I didn't like the the options in the first pic because it's not sectional with different char sets and virtually everything is slapped into one frame. So I hacked an idea to just include what's not already accessible on the US keyboard, and use different popups for different Char Sets. And it's 99% html, so that most every browser should handle it. Toungue

It leaves room for adding other Char sets, wingdings and anything else.

Will be released when I add the finishing touches, and a short trial period. Wink