Jump to content

Attn: Need code help


Recommended Posts

Attn: Kel & mritter

If you guys want I can work on makeing the apperance wizard again. I can't do much untill after the first of July as I am in the prosses of moveing from Nevada to CA. But if I have spare time I will work on it. untill I loose my computer to packing. I would love to finish what I started.

Attn: Everyone

If someone knows how to make a path to a location within the wpi.htm file (There it points to each and every file within that directory) into a var I would be ever so greatfull. This was one of the major setbacks in making the wizard the way I wanted.

example:

from:

<img id='bgpic' src='./themes/Glossy/wallpaper.jpg' width="100%" height="100%">

to

<img id='bgpic' src='ct/wallpaper' width="100%" height="100%">

where "ct" = a var to the current selected theme path

So pretty much ever line of code in the wpi.htm file that need the path to the current folder can be changed to a var.

Take a look at the wpi.htm file under the "/themes/glossy" folder and every line that has

'./themes/Glossy/some_file_name"

I need to change the

"./themes/Glossy/"

to a var that can be loaded from a file.

Hope that makes sence.

Let me know what you find out. Any help is needed.

This problem is my bigest challenge to overcome. and with it solved I will be more interested and willing to finish the apperance wizard.

I have posted screen shots from what I had done before under "WPI 5.1 Wish List" look at what I have got done so far.

It is worth the effort to find out how.

One you know something or are willing to work on a solution let me know there.

Thank you for you help

Edited by almulder
Link to comment
Share on other sites


I hope I understood correctly. If so, this is only a method you could do this.

Notice I'm a noob at js.

The idea is this:

var.js - your file with variables

load.htm - the equivalent for wpi.htm

clicky.gif - a sample image

Take a look at the archive I attached and I think you'll understand.

The variable name I used is "a".

var.zip

Link to comment
Share on other sites

"var.js"

This:

var a = 'clicky.gif';

Would need to be something like

var a = '/Themes/Glossy/';

load.htm

This:

<html>
<head>
<script language="javascript" src="var.js"></script>
</head>
<body>
<script language="javascript">document.write("<img

src="+a+">");</script>
</body>
</html>

Would need to be something like

<html>
<head>
<script language="javascript" src="var.js"></script>
</head>
<body>
<script language="javascript">document.write("<img

src="+a+ clicky.gif">");</script>
</body>
</html>

Does this help you under stand? But you in the right direction.

Link to comment
Share on other sites

Can't get it to work right.

Try and edit these first few line within the wpi.htm file (Edit the glossy theme one)

See if you can make the var work here. I can't seem to do so.

Line 4

<link rel="stylesheet" type="text/css" href="./themes/Glossy/wpi.css">

Line 49

<img id='bgpic' src='./themes/Glossy/wallpaper.jpg' width="100%" height="100%">

Line 54

document.all.bgpic.src = "./Graphics/" + BgPicture;

Line 61

<td colspan="2" background="./themes/Glossy/topbar.jpg" width="100%">

Line 78

<img id="titleimg" src="./themes/Glossy/title.jpg" border="0" align="center">

Hope you can get it to work. If you can get these line to work and send me the file I can probably get the rest.

Edited by almulder
Link to comment
Share on other sites

Well, you'll have to modify the wpi.hta for this one and add one line ... I still couldn't solve the css path, but I'll try again in the afternoon or tomorrow night.

The others are pretty simple to use once you modify the wpi.hta.

Just for your curiosity, this is the modification I made:

[COPY]

var.js to wpiscripts/var.js

[OPEN]

wpi.hta

[FIND]

<script type="text/javascript" src="./wpiscripts/core.js" application="yes">
</script>

[AFTER, ADD]

<script type="text/javascript" src="./wpiscripts/var.js" application="yes">
</script>

[OPEN]

wpi.htm

[FIND]

<img id='bgpic' src='./themes/Glossy/wallpaper.jpg' width="100%" height="100%">

[REPLACE WITH]

<script language="javascript">document.write("<img id='bgpic' src='" + themes_dir + "wallpaper.jpg' width=\"100%\" height=\"100%\">");</script>

This is only the second you asked. The others will come tomorrow (all are easy to do except the css file).

Link to comment
Share on other sites

That worked. That is awsome. Thank you so much. I forgot to move the var.js and add it into the wpi.hta

Now I guess the hardest thing of all as you said will be the css file.

Thanks again.

Link to comment
Share on other sites

How would I do this

<td colspan="2" background="./themes/Glossy/topbar.jpg" width="100%">

needd it to be something like

<script language="javascript">
document.write("<td background='./Themes/" + Theme + "/topbar.jpg' width=\"100%\">");
</script>

Also

<a href;
onMouseDown="document.continuebutton.src='./themes/Glossy/continuedown.gif';"
onMouseOver="document.continuebutton.src='./themes/Glossy/continueover.gif'; stm(getText(ttInstall),Style[0]);"
onMouseOut="document.continuebutton.src='./themes/Glossy/continue.gif'; htm();">
<img
src="./themes/Glossy/continue.gif"
align="absbottom"
class="mainbtn"
border="0"
name="continuebutton"
onClick="StopAudio(); stopInterval(); CreateFile('install');">
</img>

Any Thoughts?

I can't get these to work for me right!

Edited by almulder
Link to comment
Share on other sites

try replacing

<script language="javascript">
document.write("<td background='./Themes/" + Theme + "/topbar.jpg' width=\"100%\">");
</script>

with

<script language="javascript">
document.write("<td colspan=\"2\" background=\"./Themes/" + Theme + "/topbar.jpg\" width=\"100%\">");
</script>

I did not test this, so tell us if this is working.

For the second problem: I don't think this solves your problem, but I don't think you need the <a> tag. I just put the event aactions directly on the <img>

EDIT: Note the "id" property declared for the img tag.

<img
src="./themes/Glossy/continue.gif"
align="absbottom"
class="mainbtn"
border="0"
name="continuebutton"
id="continuebutton"
onClick="StopAudio(); stopInterval(); CreateFile('install');"
onMouseDown="document.continuebutton.src='./themes/Glossy/continuedown.gif';"
onMouseOver="document.continuebutton.src='./themes/Glossy/continueover.gif'; stm(getText(ttInstall),Style[0]);"
onMouseOut="document.continuebutton.src='./themes/Glossy/continue.gif'; htm();">
</img>

Edited by sadicq
Link to comment
Share on other sites

try replacing

<script language="javascript">
document.write("<td background='./Themes/" + Theme + "/topbar.jpg' width=\"100%\">");
</script>

with

<script language="javascript">
document.write("<td colspan=\"2\" background=\"./Themes/" + Theme + "/topbar.jpg\" width=\"100%\">");
</script>

I did not test this, so tell us if this is working.

Yes this worked perfict.

Now just need to change the last section

<img
src="./themes/Glossy/continue.gif"
align="absbottom"
class="mainbtn"
border="0"
name="continuebutton"
id="continuebutton"
onClick="StopAudio(); stopInterval(); CreateFile('install');"
onMouseDown="document.continuebutton.src='./themes/Glossy/continuedown.gif';"
onMouseOver="document.continuebutton.src='./themes/Glossy/continueover.gif'; stm(getText(ttInstall),Style[0]);"
onMouseOut="document.continuebutton.src='./themes/Glossy/continue.gif'; htm();">
</img>

need to make the paths also use the var as before.

Again thanks for your help.

Link to comment
Share on other sites

btw, the img tag is not closing with </img> ... instead use <img src="..." />

<img
src="./themes/Glossy/continue.gif"
align="absbottom"
class="mainbtn"
border="0"
name="continuebutton"
id="continuebutton"
onClick="StopAudio(); stopInterval(); CreateFile('install');"
onMouseDown="document.continuebutton.src='./themes/Glossy/continuedown.gif';"
onMouseOver="document.continuebutton.src='./themes/Glossy/continueover.gif'; stm(getText(ttInstall),Style[0]);"
onMouseOut="document.continuebutton.src='./themes/Glossy/continue.gif'; htm();" />

will be something like

<script language="javascript">
document.write("<img src=\"./themes/" + Theme + "/continue.gif\" align=\"absbottom\" class=\"mainbtn\" border=\"0\" name=\"continuebutton\" id=\"continuebutton\" onClick=\"StopAudio(); stopInterval(); CreateFile('install');\" onMouseDown=\"document.continuebutton.src='./themes/" + Theme + "/continuedown.gif';\" onMouseOver=\"document.continuebutton.src='./themes/" + Theme + "/continueover.gif'; stm(getText(ttInstall),Style[0]);\" onMouseOut=\"document.continuebutton.src='./themes/" + Theme + "/continue.gif'; htm();\" />");
</script>

Note that the script is on one line only.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...