Click to See Complete Forum and Search --> : Help fix my webpage
canamrock
03-18-2003, 01:47 PM
http://www.geocities.com/canamrock/smilies.html
http://www.geocities.com/canamrock/smileytop.html
http://www.geocities.com/canamrock/smileylist.html
These are the links to the main page and frames of the page in question. I am trying to have the image's filename posted in the text box. Furthermore, I need to be able to change the '.gif' into a '.txt' to access the Geocities-friendly versions of the images. Please help! Thanks!
canamrock
03-18-2003, 06:15 PM
Here's all the relevant info, to make it easier for you guys.
-- smilies.html --
<html><head></head>
<body><center>
<input type=text name=smileycode size=50>
</center></body></html>
-- smileytop.html --
<html><head><title>
Smilies by Canamrock
</title></head>
<frameset rows="28,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0">
<frame src="smileytop.html" MARGINHEIGHT="1" SCROLLING="no" name=top>
<frame src="smileylist.html" name=list>
</frameset></html>
-- the script from smileylist.html --
<script language="JavaScript">
<!--
function DoSmiley(smiley) {
doc = parent.top.document;
parent.top.document.smileycode.value = ""+smiley+"";
doc.smileycode.select();
if (doc.execCommand) {
doc.execCommand('copy');
}
}
//-->
</script>
-- example image link from smileylist.html --
<nobr><img src='BkDAngel.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDBlush.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDConfused.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDCool.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDDubious.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDEek.gif' onmousedown="DoSmiley(this.src);"></nobr> <nobr><img src='BkDFrown.gif' onmousedown="DoSmiley(this.src);"></nobr>
<br>
canamrock
03-18-2003, 06:58 PM
I've tried changing the references of 'top' to 'pagetopper' in the smilies framelist and the script. It did not help.
AdamBrill
03-18-2003, 07:40 PM
Well, first of all, the GeoCities generated code at the bottom is creating an error. I don't think it is possible for you to change any of that, so you might have to find a new server. But, if you change this line in the DoSmiley function that is in smileylist.htm:
doc = parent.pagetopper.document;
to:
doc = parent.pagetopper;
then it will work. There will still be the GeoCities errors, though. Anyway, I hope that helps. ;)
canamrock
03-18-2003, 07:53 PM
Holy crap for crap, it works! lol http://www.geocities.com/canamrock/strongbad.txt
Thanks, man. Now, the only thing left to reach perfection is to get the '.txt' to replace the '.gif' suffix.
AdamBrill
03-18-2003, 08:06 PM
Ok, add this into the top line of your DoSmiley function:
smiley = unescape(smiley.replace('.gif','.txt'));
I think that will work for you. Let me know if you need more help...
canamrock
03-18-2003, 09:39 PM
Actually, I remembered that VB text boxes are pretty similar to Javascript ones, so I just eliminated the last 'gif' from the name and added the 'txt' manually.
Now, there seems to be a problem with this working right on Mozilla browsers. I am guessing the <nobr></nobr> tags around the images might cause this, but I am only speculating. Ideas? Thanks again.
AdamBrill
03-18-2003, 10:12 PM
Ok, put the input box on the smileytop.htm page inside of a form and then change this line:
doc = parent.pagetopper;
to this:
doc = parent.pagetopper.document.forms[0];
That should work. Let me know if you have any more problems... ;)
canamrock
03-19-2003, 01:49 AM
That seems to do the trick. Thanks yet again. I'm going to play with it a little more to see if I can get it do keep the text box selected each time a pic is clicked. Right now, each click after the first alternates it unless you click elsewhere first.
I got this to work, by adding a function for onmouseup that simply reselects the text box. It's working perfectly. The assistance you've provided is infinitely good. Feel free to use my smilies whenever you want. :)
AdamBrill
03-19-2003, 07:50 AM
No problem. I'm glad I could help. ;) And thanks for letting my use the smilies... :D
canamrock
03-19-2003, 01:38 PM
^_^ No prob...
What's nice is now I can worry about prettying it up, since it's otherwise good to go.
One related note... I was thinking of making it a smaller separate window... any way to do that? :)
AdamBrill
03-19-2003, 03:32 PM
Originally posted by canamrock
One related note... I was thinking of making it a smaller separate window... any way to do that? Make what a smaller separate window? Like a smaller popup window? If so, then you can use this:
win = window.open("page.htm","","height=400; width=400");
You can add the scroll bars, status bar, etc. if you want to, too. If that isn't what you wanted, let me know... ;)