Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2004, 02:32 AM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default HIGHTLIGHT and COPY

I am interested in being able to allow my users of our baords to press one button to HIGHTLIGHT and COPY the text in the WYSIWYG Editor when starting new threads or replying.

Take a look at this javascript here. This does exactly what needs to happen, but I am having trouble with using it on vB3. I know where to add it inside the newthread template....:devious:

Anyone have an ideas?
Reply With Quote
  #2  
Old 11-05-2004, 01:01 PM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i figured it out, give me a few min so i can write out how i did it.
Reply With Quote
  #3  
Old 11-05-2004, 01:12 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh awesome! Thanks!



Quote:
Originally Posted by Johnny
i figured it out, give me a few min so i can write out how i did it.
Reply With Quote
  #4  
Old 11-05-2004, 01:35 PM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Files to edit:
Vbulletin_editor.js


Template Modifications:
editor_toolbar_standard



Open clientscript/Vbulletin_editor.js

at the bottom of the file look for:

PHP Code:
// #############################################################################
function open_smilie_window(x_widthy_widthwysiwygforumid)
{
    if (
typeof(forumid) == "undefined")
    {
        
forumid 0;
    }
    
window.open("misc.php?" SESSIONURL "do=getsmilies&wysiwyg=" wysiwyg "&forumid=" forumid"smilies""statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=" x_width ",height=" y_width);

under add:

PHP Code:
// #############################################################################
function copyit(theField
{
var 
tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")


then save.
<---------------------------------------------------------------------------------------->

Template Modifications:

open template editor_toolbar_standard

look for:

PHP Code:
    <textarea name="message" rows="20" cols="60" wrap="virtual" style="width:$stylevar[messagewidth]; height:250px" tabindex="1">$newpost[message]</textarea


Under add:

You can put the copy button in two ways with a normal text link or a regular button


for a text copy link:

PHP Code:
<A onclick="copyit('vbform.message')" href="#">Copy Text</a
or

for a regular button:


PHP Code:
<input onclick="copyit('vbform.message')" type="button" value="Copy Text" name="cpy"
Your done.

it worked on my board perfect.

only way i got it to work is to have it be displayed on newthread and newreply as well.

plus i only added the copylink to the standerd editor
Reply With Quote
  #5  
Old 11-05-2004, 01:53 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I have done your mod, BUT, how do I add this button UNDER the WYSIWYG editor?

Do I just edit the templage "editor_toolbar_wysiwyg"?

Thanks again!


Quote:
Originally Posted by Johnny
Files to edit:
Vbulletin_editor.js


Template Modifications:
editor_toolbar_standard



Open clientscript/Vbulletin_editor.js

at the bottom of the file look for:

PHP Code:
// #############################################################################
function open_smilie_window(x_widthy_widthwysiwygforumid)
{
    if (
typeof(forumid) == "undefined")
    {
        
forumid 0;
    }
    
window.open("misc.php?" SESSIONURL "do=getsmilies&wysiwyg=" wysiwyg "&forumid=" forumid"smilies""statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=" x_width ",height=" y_width);

under add:

PHP Code:
// #############################################################################
function copyit(theField
{
var 
tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")


then save.
<---------------------------------------------------------------------------------------->

Template Modifications:

open template editor_toolbar_standard

look for:

PHP Code:
    <textarea name="message" rows="20" cols="60" wrap="virtual" style="width:$stylevar[messagewidth]; height:250px" tabindex="1">$newpost[message]</textarea


Under add:

You can put the copy button in two ways with a normal text link or a regular button


for a text copy link:

PHP Code:
<A onclick="copyit('vbform.message')" href="#">Copy Text</a
or

for a regular button:


PHP Code:
<input onclick="copyit('vbform.message')" type="button" value="Copy Text" name="cpy"
Your done.

it worked on my board perfect.

only way i got it to work is to have it be displayed on newthread and newreply as well.

plus i only added the copylink to the standerd editor
Reply With Quote
  #6  
Old 11-05-2004, 01:58 PM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its stated in the post i made on where to put it the way i put it is i added the code right under the textarea where everyone can see it. as stated in the post.
Reply With Quote
  #7  
Old 11-05-2004, 02:03 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The wysiwyg template (editor_toolbar_wysiwyg) is a bit different. I have tried to stick this in a few places in the template. The button shows up, but it didn't hightlight or copy the text.

Let me know what you think


Quote:
Originally Posted by Johnny
its stated in the post i made on where to put it the way i put it is i added the code right under the textarea where everyone can see it. as stated in the post.
Reply With Quote
  #8  
Old 11-05-2004, 02:05 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh, do I add the change in the vbulletin_wysiwyg.js?
Reply With Quote
  #9  
Old 11-05-2004, 02:20 PM
Johnny's Avatar
Johnny Johnny is offline
 
Join Date: Jun 2002
Posts: 290
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the directions i gave you on the post i belieave is written clearly to understand on where to put everything,

or do you want the button to be displayed someplace instead of under the text area?
Reply With Quote
  #10  
Old 11-05-2004, 02:25 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope,

I followed your directions step by step. I DOES work with the standard editor, but not with the WYSYWYG editor that most of my users like more.

So....what I did, was add:

Code:
 
// #############################################################################
function copyit(theField) 
{
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
TO: BOTH vbulletin_wysiwyg.js AND vbulletin_editor.js(then uploaded)


Then added the button (and I also tried the TEXT version also) to the template of editor_toolbar_wysiwyg.

The BUTTON show up fine just under the text area of the WYSIWYG editor(just like in your standard editor) but it just does not copy/highlight.

Any other ideas on why it isnt?


Quote:
Originally Posted by Johnny
the directions i gave you on the post i belieave is written clearly to understand on where to put everything,

or do you want the button to be displayed someplace instead of under the text area?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:43 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.06526 seconds
  • Memory Usage 2,293KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (10)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete