vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Insert text into editor (https://vborg.vbsupport.ru/showthread.php?t=179442)

GameWizard 05-16-2008 12:48 PM

Insert text into editor
 
I never imagined something like this would be so complicated, but I'm looking for a way to add text into the editor (both wysiwyg and standard editors) when clicking a link or button.

Boofo 05-16-2008 01:25 PM

In the postbit or where?

GameWizard 05-16-2008 02:04 PM

Into the editor when writing a post. Namely for the "newthread" template. I'd like to create a button which would populate/insert text into the textarea of the editor when clicked. Similarly to how you press a Smilie and it appears inside the textarea.

Boofo 05-16-2008 02:19 PM

That will take a hack like they use here for the Unlicensed User messages. One hasn't been released yet that I know of.

GameWizard 05-16-2008 02:23 PM

I'm well aware that nothing has been released, otherwise I would of already of tried it. :p I am trying to create one. My understanding is that it would take an OnClick event based on a javascript function to accomplish this. But my javascript coding skills are very poor so I hope someone out there can help.

Lynne 05-16-2008 02:30 PM

There is kinda a hack like this, but it will effect all newthreads in a forum. It's call the Stencil Hack (I think). You may want to check it out and see what they do and then modify it for what you want.

Boofo 05-16-2008 02:31 PM

The javascript is only the small part of it.

GameWizard 05-16-2008 02:41 PM

This is the hack in question:
https://vborg.vbsupport.ru/showthread.php?t=130162

Although not exactly what I need, I will certainly try it out and see if this will work for my purposes.

Quote:

The javascript is only the small part of it.
I am not looking for miracles, but in fact the javascript is all I need. I have already tested some javascript code that I found myself and managed to get a partially working version. Problem is that my lack of javascript coding skills prevent me from getting it to work 100%.

Boofo 05-16-2008 03:10 PM

I did a version of the hack they have hear from the Unlicensed user message. I use the javascript for the pull down menu that has like 6 different messages to add to posts.

GameWizard 05-16-2008 03:22 PM

Quote:

Originally Posted by Boofo (Post 1521747)
I did a version of the hack they have hear from the Unlicensed user message. I use the javascript for the pull down menu that has like 6 different messages to add to posts.

Could you share this code? It might be exactly what I need.

As for the stencil hack, although it functions as it should. The limitation is that I am forcefully restricted to 1 message, but I have at least 3 different preset text templates I would like users to chose from.


All times are GMT. The time now is 12:07 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.01742 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)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
  • (10)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