vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Creating a custom editor button to insert text (https://vborg.vbsupport.ru/showthread.php?t=116727)

Emmy2 05-26-2006 12:02 PM

Creating a custom editor button to insert text
 
I wonder if someone can help me with this.

I want to create a new button on the regular and quickreply editors that will insert some pre-defined text into the reply box when it is clicked.

I am aware of this thread that will add extra buttons to the quickreply but those are for features already available on the full reply (like align, font etc.).

What I want to do is create a button for a CUSTOM function that is not anywhere else and that is NOT a custom bbcode.

In other words, a user clicks the button and a phrase like "abcdefghijk" is automatically inserted into the reply box so they don't have to type it themselves. Simply that.

Can this be done?

If it can, a little more complex would be if there was a drop-down menu to choose from several different phrases to insert....but that's not absolutely necessary...getting just the one custom phrase insert would be a tremendous help. I'm not a coder but I can follow directions. Can anyone help me? Thanks so much.

creedmaniac 05-26-2006 01:33 PM

this would be an awesome hack, it'd be useful to me as well

Krahl 05-27-2006 03:33 AM

If this is turning into a full-blown request for a mod from one of our outstanding coders, I'll vote for the drop-down, multiple choice version.

Great idea, I hope someone can and will do this one!

Emmy2 05-28-2006 09:45 AM

can anyone help? is this doable?

Me again. Been spending a lot of time trying to search for a way to do this. Again, I'm not a coder so I'm hampered quite a bit already there. Anyway, from what I've read so far....

Is there some way to use the "onclick" command within a link to do this? Make a button on the editor and "onclick" it returns "this" and puts it in the textarea box. Like the emoticons, that get inserted using "onclick". But instead of inserting :smilie: into the textarea it would insert a string of text that I pre-define.

Is this helping any? Getting closer at all?

Emmy2 05-31-2006 11:04 AM

Quote:

Originally Posted by Krahl
If this is turning into a full-blown request for a mod from one of our outstanding coders, I'll vote for the drop-down, multiple choice version.

Great idea, I hope someone can and will do this one!

If anyone is interested I've figured out how to create a button to insert text into the reply box. I've posted it in the Dice Roll thread because we are using it to insert code for a preset dice roll. But it could be used to insert ANY complex bbcode string or text sentence or whatever you wanted to insert with the click of a button.

My code to add one button is on page 6, then others add code to create drown down menus and user interfaces...

https://vborg.vbsupport.ru/showthrea...=113972&page=6

ps. unfortunately the code only works with the standard editors. Users would have to click the A/A button to toggle from the wysiwyg editor to standard to use the insert buttons.


All times are GMT. The time now is 04:51 AM.

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.01442 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete