TAG bug

I wasn’t sure where to put this but since it’s so closely related to skins here seemed appropiate.

The new [INSTALL LOCATION] tag is hard to use in Javascript. When I set a variable to it’s value the resulting path is stripped of the ""s making the path useless.

Adding this code

var EdsAPath = '[INSTALL DIRECTORY]'; alert(EdsAPath);to a Splendid WTP yields an IE alert window that displays

C:Program FilesWeather Watcher

Is there a version of this tag that doubles the ""s? And one that converts them to "/"s? :icon_smile:

quote:
[i]Originally posted by EdP[/i]
Is there a version of this tag that doubles the "\"s? And one that converts them to "/"s? [:)]
No, but you can do that using Javascript.

If my variable doesn’t have the ""s how am I to determine where they go? Not everyone installs to the C:\Program Files\Weather Watcher folder. Or to only one subfolder down.

I can extract the drive and the “Weather Watcher” components but there’s no guarantee that what’s left between the two is a single folder’s name.

C:\Documents and Settings\Ed\Local Settings\Application Data\Weather Watcher\

If there is nothing to be replaced, then the replace function won’t make any changes.

:???: :???: That is true but I have no idea what bearing it has on this discussion.

There are suppose to be ""s in file URLs and since Javascript uses the “” as an escape character they have to be doubled to be treated as one.

If you could show me a snippet of Jscript code that would make the example I originally showed work I’d be very interested in seeing it.

Well, the escape characters aren’t handled until you try to display the string (or something like that) so you could manipulate the string before that and you’re good to go…

Actually, I’m surprised you even ask, since you were the one solving almost exactly the same problem a while ago: http://www.singerscreations.com/Forum/t … IC_ID=1065

just re-write your function a little, and I’d say you should be in the clear…

:icon_smile: I agree the problem is not new.

My prior post works if Weather Watcher is installed in it’s default location and it can be tweaked to handle a similar install on a different drive even. It does not work if one installs it on a multi-user system with individual profiles. There is no way to separate the folders between the drive and “Weather Watcher”. And if someone goes crazy and renames the Weather Watcher folder something like WW567… well we don’t even want to go there. :lol:

var EdsAPath = escape('[INSTALL DIRECTORY]'); alert(EdsPath);doesn’t even help.

Ohh, yeah, I don’t know what the heck I was thinking - I guess I didn’t read your code at all…
Can’t really see how this junk works - it SHOULD be possible, and pretty straight foreward too… Well, apparently I couldn’t think earlier, and I still can’t come up with the javascript solution I’d like… Actually, I could only come up with one way of dealing with this… But well, guess it works…:
By loading the path into an input field [preferably of the ‘hidden’ type] there should be no problem using it all over…

You’d need to add this somewhere in the beginning of the WTP:

<input type="hidden" id="textFieldContainingTheWeatherWatcherInstallPath" value="[INSTALL DIRECTORY]" />

And then add this [or access the field in a similar way each time you’d wanna use it]:

<script type="text/javascript" language="javascript"> var thePathToTheDirectoryWhereThisInstanceOfWeatherWatcherWasInstalled = document.getElementById("textFieldContainingTheWeatherWatcherInstallPath").value); </script>
I know it’s not the pretty way, and that it must be possible to do it nicer… But it should do the trick…

Hope it helps more than confuses…

And hey, I really have a skill for naming variables [:D]

That’s a pretty clever solution Fl?gger! I’ll have to give it a try. But we shouldn’t have to be playing tricks with the TAGs, they should be in formats acceptable to be worked in HTML and Jscipt code. And it’s probably more efficient being done in VB than Jscipt so I would still like to see the TAG’s options expanded to support our needs. :icon_smile:

Hehe, thanx, just figured that in order to access a string with single backslashes, you would have to do it from outside any scripting language that would interpret them. And magically it worked :mrgreen:

But I do agree, it should be available in an escaped version, otherwise it’ll be to much a hassle to use… Maybe the two could co-exist, like so many other things…?
I’m thinking something along the lines of having an [INSTALL DIRECTORY] and an [INSTALL DIRECTORY ESC]…

And while we’re at it, why not have tags for the last of the skins? I’d like info on atleast the interface too…

Originally posted by Fl?gger
And while we’re at it, why not have tags for the last of the skins? I’d like info on at least the interface too…
2b || !2b

I agree. I had asked for tags to indicate the interfaces’ name and WW’s install folder so I could access the interface’s icons but it appears Mike misunderstood. The new [SKIN FORECASTS] tag has the name of the forecast skin, we need a [SKIN INTERFACE] tag.

So for 5.6.8 we would like to have tags for;

[SKIN INTERFACE] - name of the interface being used.
[INSTALL LOCATION 2] - the WW install folder with 2 ""s.
[INSTALL LOCATION X] - the WW install folder with “/” in place of “”.
[ALERTS SOUND] - the complete path and filename of the New Severe Weather Alert .wav file. :razz:

That should keep us happy for a bit. :lol:

Please start a running list in the thread below. I’d like to try to add as many as I can at once [8D]

http://www.singerscreations.com/Forum/v … php?t=1263

Well, I finally got to try this concept. A couple of your parms threw me for awhile but once I got around them I got this to work:

[code]

EdsMoon=document.WWfix.InstallDir.value;
EdsMoon=“file:///” + EdsMoon.replace(/\/g, ‘/’) + “/Skins/Forecasts/Eds Stone Soup/”;
alert(EdsMoon);
[/code]
The Input Type ID parm might have caused my problems with the getElementById method not working for me but I didn’t catch on to it till after I changed the document line completely around.

Anyways, this approach may work better for people with older systems.

While this works, thank you, I still think the WW tags I suggested be added to address the slash problem at the WW.exe level would help. Whenever WW updates and I’m in the middle of something I feel a momentary drag on the system and I suspect part of it is due to all the Javascript code I’ve added to it being run. :cool:

Well, I’m glad you got this working, but as far as I remember, the way you access is an [old?] proprietary IE method, which means it’s a bad practise to use it - even though it might work… The way I proposed is the official W3C standard way of accessing HTML elements from JavaScript, so this should work [it should, not that it necessarily does] in all implementations of HTML [ie, ff, opera, etc.]

[code]

[/code]

In order to please all, I’d say the proper code might/should be as follows

[code]

[/code]

This way, if it doesn’t find it one way it’ll try the other, thereby working for even more users…

As for your systems drag, I wouldn’t think it should have to much to do with the JS… Would seem odd… But, if it does, you might want to consider recoding some of your JS code :wink: or maybe design functions with broader uses, instead of just coding everything where you need it :razz:

And btw, thank you for doing all the coding these days - now there’s another feature for me to copy :wink: that is, if it’s okay with you - I wouldn’t wanna offend anyone…

Well, I did copy the technique from some code I did awhile ago. But, it works in IE which is the environment of WW, it should work on older systems running IE 5.x, and it works in Netscape. If it doesn’t work in IE 7 then I have a problem but until then… :icon_smile:

And now that I have it working I can play with changing it to official W3C standards. But when I was struggling with it, function trumped standards. :wink:

An even better option is to use the new tags we requested. :icon_smile: See the lastest in http://www.singerscreations.com/forum/v … php?t=1263

I understand. But we have different design objectives. I try to keep my changes modular so they can be reapplied or overlaid to newer versions of Mike’s template conveniently. If I was designing my own, independent, version of a skin I would code for efficiency.

You’re most welcome but you’re the one doing all the coding. The new options to resize the WW window are extensive. As for copying I like seeing my name/id in print so, as long as you keep including
"-The option of choosing EdP’s ‘real’ pictures of the moon " :shock:
in your list of acknowledgements I’m flattered and happy. :lol: :icon_smile:

And as an aside:

Mike when quoting prior text the icons end up as simply proper names. Can that be fixed? I suspect it’s due to the icon’s title being used in the quotes rather than the icon’s shortcut. For example the word Wink rather than semicolon dash parrens or even icon_wink.gif.

Thanks

I ran a few tests, but that didn’t happen to me :scratch: