Author |
Topic  |
|
James
Average Member
  
USA
539 Posts |
Posted - 26 November 2002 : 21:40:01
|
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
|
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. |
 |
|
James
Average Member
  
USA
539 Posts |
Posted - 27 November 2002 : 00:43:42
|
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/* |
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 27 November 2002 : 01:01:23
|
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. |
 |
|
James
Average Member
  
USA
539 Posts |
Posted - 27 November 2002 : 19:31:12
|
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/* |
 |
|
James
Average Member
  
USA
539 Posts |
Posted - 02 December 2002 : 23:25:37
|
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/* |
 |
|
DJBBIZ
Junior Member
 
214 Posts |
Posted - 03 December 2002 : 02:09:24
|
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 |
 |
|
James
Average Member
  
USA
539 Posts |
Posted - 03 December 2002 : 21:41:28
|
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/* |
 |
|
|
Topic  |
|