Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 How to have a pop-up window insert something
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

James
Average Member

USA
539 Posts

Posted - 26 November 2002 :  21:40:01  Show Profile  Visit James's Homepage
I recently installed Mike's File Attachment Mod so that users could include images in their post, but
i run across a problem with it that someone here might be able to help with (not a mod issue, but more of a development issue). It uses a pop-up window to display the upload option, etc. and then inserts the code to display the image in the message window. This works for IE, but not with netscape. I would like to know the proper way to have a pop-up window insert something into a message window as this could be useful for many things other than just that mod. I'm sure that an older version of the forums use to do the smiles this way (you could click them in the pop-up window to insert them into the message window) and it worked with netscape, but I can't seem to find anything that'll work.

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 26 November 2002 :  22:26:20  Show Profile
that popup window is still there in v3.4.03. Just disable the Smilie table in the Admin options and the icon for that popup will show up on the Post page.
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 27 November 2002 :  00:43:42  Show Profile  Visit James's Homepage
So the code is in pop_icon_legend.asp?

Does a window have to be opened with Javascript to allow for pasteing code back into the message window (in all browsers)?

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 November 2002 :  01:01:23  Show Profile
Yes, the code is in the pop_icon_legend.asp file.

I am not 100% sure about your second question, but most likely you would.

Basically Javascript uses opener to specify the window to post the info back to.
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 27 November 2002 :  19:31:12  Show Profile  Visit James's Homepage
quote:
I am not 100% sure about your second question, but most likely you would.

Basically Javascript uses opener to specify the window to post the info back to.


That's what i was curious about. Having features available when making a post. These features open a pop-up window and your selections or actions in the pop-up window determine what gets pasted or added back into the message box in your main browser window (no matter which browser you use). Opening a window with Javascript seems about the only way to accomplish this for all browsers.

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 02 December 2002 :  23:25:37  Show Profile  Visit James's Homepage
homeacademy posted a solution in another forum.

quote:

<script>
if (opener.document.PostTopic.Message.createTextRange && opener.document.PostTopic.Message.caretPos) {
var caretPos = opener.document.PostTopic.Message.caretPos;
caretPos.text = "*** put code for attachment/image insertation HERE ***";
} else {
opener.document.PostTopic.Message.value+="*** put code for attachment/image insertation HERE ***";
}
</script>


Just replace the *** put code for attachment/image insertation here *** with the code you want inserted into the post. Hope this solution works out for everyone.


I've tested it and it works with netscape 4.7, 6.0 and 7.0 and IE 6.0

Now, anytime I want to create a pop-up window that inserts something I can use that code sniplet.

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page

DJBBIZ
Junior Member

214 Posts

Posted - 03 December 2002 :  02:09:24  Show Profile  Visit DJBBIZ's Homepage
Can you post an example of what the image insetion code would look like that would replace:

"*** put code for attachment/image insertation HERE ***"

Thanks


"The difference between good ideas and good results is performance"
the management institute | tmiFinance | tmiCreative | ProfileOnDemand
Go to Top of Page

James
Average Member

USA
539 Posts

Posted - 03 December 2002 :  21:41:28  Show Profile  Visit James's Homepage
DJBBIZ. that was in reference to a mod posted here.

What I was talking about in this post is a way to post something from
a pop-up window (code, text, etc.) back into the message window and
have it work in all browsers.


For example, using the code posted above if I had a pop-up window
that had a varible named "InstockImages" that held a url of an image
and I wanted this pop-up to insert this back into the message window
as an image it would look something like:

<script>
if (opener.document.PostTopic.Message.createTextRange && opener.document.PostTopic.Message.caretPos) {
var caretPos = opener.document.PostTopic.Message.caretPos;
caretPos.text = "[img]" & InstockImages & "[/img]";
} else {
opener.document.PostTopic.Message.value+="[img]" & InstockImages & "[/img]";
}
</script>

*Interested in Radio Control*
*The RC Web Board - http://www.rcwebboard.com/*
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07