+ Reply
Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 52

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Request JavaScript Help for Live MoonPhase addition to Vista Bliss

is a discussion within the

WinterBoard

forums, a part of the

Skinning / Themes Discussion

section;
nope that's Javascript so I'm assuming it goes into the wallpaper. js when I just added it in there and resprung the moon disappeared so I got all happy and
...
  1. #21
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    nope that's Javascript so I'm assuming it goes into the wallpaper.js when I just added it in there and resprung the moon disappeared so I got all happy and thought it worked but when I changed my clock on my device to 9:00pm to test it and reloaded the theme the moon still won't come back sooooo either:

    1. I did something wrong

    or

    2. Since this is a moon phase thing it's feeding from a source that I cannot fool the time so after 8:00-9:00pm if that moon pops out on my Springboard I won't know (cuz I'm just poking in the dark like you)

    I will work on renaming all the overlay icons sometime later today and get that folder ready since that will be the next step. (very close though we just need someone who knows this stuff)

  2. #22
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Alright boys and girls, here you go.

    I've modified the appleaccueweatherStolen.js parser to do the following:

    Between the hours of 6 and 20 (inclusive), the obj.moonday is set to 99. I put a moon-99.png into the moonphases folder. Right now it's a picture of my daughter so that you can see that it works. I suggest replacing it with a transparent image. Outside of those hours, the moonday object is set to be the current "moonday" from accuweather, which should then call the correct moonimage.

    Here it is: Vista_Weather_+_Moonphase 2.zip


    Let me know what you think.

  3. The Following User Says Thank You to Spamdumpster For This Useful Post:

    radarlove63 (02-22-2009)

  4. #23
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    Quote Originally Posted by Doreen View Post
    nope that's Javascript so I'm assuming it goes into the wallpaper.js when I just added it in there and resprung the moon disappeared so I got all happy and thought it worked but when I changed my clock on my device to 9:00pm to test it and reloaded the theme the moon still won't come back sooooo either:

    1. I did something wrong

    or

    2. Since this is a moon phase thing it's feeding from a source that I cannot fool the time so after 8:00-9:00pm if that moon pops out on my Springboard I won't know (cuz I'm just poking in the dark like you)

    I will work on renaming all the overlay icons sometime later today and get that folder ready since that will be the next step. (very close though we just need someone who knows this stuff)
    I went with the editing .js file.
    I tried something similar but I opened up the parameters for display to be x>0 x<24.
    Didn't work either. The moon doesnt come up.

    I am sure its just code placement related. Will try some more research. Maybe someone with skills will jump in and save the day. LOL
    Got my fingers crossed.

    Quote Originally Posted by Spamdumpster View Post
    Alright boys and girls, here you go.

    I've modified the appleaccueweatherStolen.js parser to do the following:

    Between the hours of 6 and 20 (inclusive), the obj.moonday is set to 99. I put a moon-99.png into the moonphases folder. Right now it's a picture of my daughter so that you can see that it works. I suggest replacing it with a transparent image. Outside of those hours, the moonday object is set to be the current "moonday" from accuweather, which should then call the correct moonimage.

    Here it is: Vista_Weather_+_Moonphase 2.zip


    Let me know what you think.

    I am downloading this right now.
    Can't wait to see the results.
    Thanks in advance.
    -------------------------
    Yes, Yes, Yes, Yes.
    Great Job!! Beautiful daughter!!
    This is absolutely awesome. Thanks so much for looking into this.

    I have some tweaking to do so I can try to merge what you have done with my current setup.
    I will post later on those results.
    Last edited by radarlove63; 02-22-2009 at 09:13 AM. Reason: Automerged Doublepost

  5. #24
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    Okay Spamdumpster it looks like you got it (almost) I tested it and when I changed my clock the moon popped out right on schedule and then when I changed my clock again for this morning it hid. but I've got something strange to show you hold on and I'll take a ss for you...

    pic #1 your moon phase works (just needs the moon on the left of the screen then we may not need the overlay (atleast at the moment)


    pic #2 when I changed my clock the moon hid but some now some lil girl is peeking at me. (what is that? I know she's not in my cam roll nor my family) hehe


    Obviously you take a Dare seriously! hehe

    "Thank you" Spamdumpster for helping radarlove he is on a mission! I just noticed my rank moved up to iPhoneaholic? What's next iPhoneRehab?
    Last edited by Doreen; 02-22-2009 at 09:36 AM. Reason: Automerged Doublepost

  6. #25
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Hah! That's a picture of my daughter. Just there to prove that something else comes up between 6 and 10. If someone replaces it (i.e., the moon-99.png file) with a transparent image.

    Looks from radar loves' response that it;s working. Can't wait to see how he mods it. I bet it will look great. The only thing left to do is to finish converting your gifs to the accuweather format, so that all weather possibilities are covered.

  7. #26
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    You're amazing! (you're daughter and her cute lil red nose is adorable)

    I tossed the transparent image in and it works! Radar don't worry about the wrong weather walls popping up I originally titled them for yahoo which is totally diff than accuweather so I will work w/ you later on this, as for right now my Mom called and said she is on her way coming over for a visit so I'll be busy today (I'll jump back on this tonight okay)

    Thanks again Spamdumpster!

  8. #27
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    Default It works!!!!
    Great Job Spamdumpster.

    I have attached modded files to position the moon.
    This shows where I was at yesterday

    This is the current with your setup plus the changes I made in the attached files (time was changed so as to show the moon).


    In addition to bringing over the Icons and UIImages folder the following was done

    In the Wallpaper.html pasted
    Code:
    <img id="weatherIcon" src=""/>
    <img id="moonIcon" width="185" src=""/></div>
    over the
    Code:
    <img id="weatherIcon" src=""/>
    <img id="moonIcon" src=""/>
    For the VistaBlissWeather.css contained in your zip.

    Pasted


    Code:
    #moonIcon{
        position:absolute;
        top: -370;
        left:30;
        z-index: -1;
    Over the


    Code:
    #moonIcon{
        position:absolute;
        top: -400;
        left:190;
        z-index: 0;
    I am sure there is a better way to do that but it does work.

    I will be using Doreens Animated night background to fill in for the night shots for a bit that will resolve at least for me the issue of the moon being in front of the weather elements.
    It's a trade off that I can get away with due to my location has about 340 clear days a year.

    I read that last sentence and wonder how I can ge wrapped up in these weather themes so much.
    Last edited by radarlove63; 02-25-2009 at 01:58 PM. Reason: Goal Met.. Deleted file attachment

  9. #28
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Radarlove -- one more thing to consider:
    Moondock (http://www.garycmartin.com/MoonDock.zip) has 40 moon images, whereas the accuweather feed only returns 27 "moondays". I went through the 40 images included with moondock and deleted the ones I didn't think I "needed". I may not have done the best job. I noticed that the widget pulls a much bigger moon than is really predicted for tonight.

    You may want to redo it or find a different set of images.

  10. The Following User Says Thank You to Spamdumpster For This Useful Post:

    radarlove63 (02-22-2009)

  11. #29
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    Quote Originally Posted by Spamdumpster View Post
    Radarlove -- one more thing to consider:
    Moondock (http://www.garycmartin.com/MoonDock.zip) has 40 moon images, whereas the accuweather feed only returns 27 "moondays". I went through the 40 images included with moondock and deleted the ones I didn't think I "needed". I may not have done the best job. I noticed that the widget pulls a much bigger moon than is really predicted for tonight.

    You may want to redo it or find a different set of images.
    If accu only provides 27 moondays then I guess there will be some gaps. I'll look at the images that you posted. I was just excited to see that this could be done.

    1 more request. Could you make this moonphase "stand alone" without pulling in the weather data and the associated weather images?
    Doreen has an interesting thought about this possibility.

  12. #30
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Quote Originally Posted by radarlove63 View Post
    If accu only provides 27 moondays then I guess there will be some gaps. I'll look at the images that you posted. I was just excited to see that this could be done.

    1 more request. Could you make this moonphase "stand alone" without pulling in the weather data and the associated weather images?
    Doreen has an interesting thought about this possibility.
    I'm away from my computer for the rest of the night, but it would be easy to get rid of everything except the moonphase. First, open up the html file and get rid of everythng in the body except the line that has the moonicon. Second, open up wallpaper js, scroll down to where you see "function dealwithweather" and the comment out all of the sections except for the one with the moonicon. It's hard to explain, but not a big deal.

    If you post your entire theme folder, I'll do it when I get home later tonight.

  13. The Following User Says Thank You to Spamdumpster For This Useful Post:

    radarlove63 (02-22-2009)

  14. #31
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    Thanks for the info. I think Doreen has got a plan to layer these themes to make the weather elements go on top. She is very creative and I imagine this is all going to add a whole new dimension.

    I looked at the icons. Really there are 29 seperate day events that should be addressed. I am not sure of the need for 40 phases.

    The selections you have made should work.

    Thanks again for all your efforts. I will be off for awhile myself.

    Can't wait to see the moon come up tonight!!

  15. #32
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    Nope not that creative, all I do is try stupid stuff and sometimes I get miracles and things just happen to work. hehe

    I need to get the overlay icons done before I can play around w/ this so I'm going to work on finishing those tonight and I'll post back if I can figure this out. Since WB lets you layer themes we might be able to layer if not then we can try the Twin city theme and use the same location for both cities "but" place wallpapers in one icon folder and overlay weather icons in the other folder for the secondary location and just position everything cleverly? Lets see...

    Spamdumpster since I had already edited the Yahoo source and had all my weather icons matching up for accuracy is there a way to have what you did work w/ that source instead of the accuweather? Yahoo supports moon phase.

    The issue is I've been going nuts since my last post w/ this rediculous tstorm3.gif, light_rain.gif, cloudy1_night.gif, tstorm2_night.gif etc etc. (completely nuts) vs if I use what I had already worked hard on simplifying the icons to match the yahoo source and I obtained perfection on the accuracy w/ yahoo, so it's just a matter of redoing all these crazy icons and naming them 0.png all the way through 47.png vs that completely insane accuweather icon naming.

    Here's where I'm at atm, this is using the Twin Cities code and editing the second location which is Moscow as you can see Los Angeles is the first weather icon (my weather wall which has the moon painted on it) and the floating cloud under the moon is the second location using the second icon folders which is not attached to the wallpaper, so now if we get the moon phase in there we have all (3) things when I add that I seem to lose everything. *sigh*

    But the issue I'm having right now is the accuweather source and the proper naming of all these crazy icons I need to do which I don't have enough time for so this will take forever.


    Here's what I made as a table for myself when I do my themes which is why it's easier for me:



    vs what everyone else uses:


    I don't think I have the patience to go the accuweather route...
    Last edited by Doreen; 02-22-2009 at 07:51 PM. Reason: Automerged Doublepost

  16. #33
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Doreen, I've never been comfortable using the yahoo source, since I can't see the xml. Whenever I go to the urls in the yahoo source, I get a weather feed, but it's not in xml. This is why I didn't know that yahoo supported moonphase info. Is there somewhere I can go to see what the xml looks like for yahoo?

  17. #34
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    I believe I now have a stand alone moonphase that will work.
    I am running a few different time structures through it.
    If I can't break it in the next 30 mins I will post.
    This should enable Doreen to use the yahoo source.

    ----
    Tabled until tomorrow. one word..Broken.
    Last edited by radarlove63; 02-22-2009 at 10:12 PM.

  18. #35
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    Moon Phase II - Yahoo! Widgets

    If I remember correctly alot of things such as the images and .xml files and scripts can be pulled out of the Desktop Widgets right?

    Not so sure now, I just tested the standalone and for some reason in WinterBoard though it "normally" lets you layer according to the order you drag your themes, this moon phase theme wants to be on top no matter where you place it in the order of your themes therefore we can't get the weather condition icon to overlay such as clouds and/or rain to position on top of the moon phase. argh! very frustrating I wish I knew this stuff better.
    I'll post a ss to show you in a mins let me try something else first.

    Okay don't pay attention to the Text on the bottom (cuz I'm swapping diff icons around to test this) but see look what I mean now that we can get this layered in WB it still wants the Moon on top no matter the position so if it's cloudy, raining or snowing the overlay icons will not go ontop of the moon but only behind it.
    Last edited by Doreen; 02-22-2009 at 10:24 PM. Reason: Automerged Doublepost

  19. #36
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    Doreen,
    Maybe related to this?

    Definition
    The z-index property sets the stack order of an element. An element with greater stack order is always in front of another element with lower stack order.

    Note: Elements can have negative stack orders.

    Note: Z-index only works on elements that have been positioned (eg position:absolute!


    For the dailyalmanac.css the setting is:
    #moonIcon{
    margin-top:-50px;
    margin-left:146px;
    z-index:-1;

    Could you check the others and post?

  20. #37
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Doreen and Radarlove,

    After doing some research, it looks like most widgets, programs, and websites that provide moonphase informaiton use an algorithm to calculate the moonphase. For example, check out this code here.

    The benefit of doing it this way is that it would be easy to incorporate into any widget without having to pull the data from a feed. Plus, you could easily use all 40 moon images from Moondock. I will look into this when I have a chance.

  21. #38
    Green Apple
    Join Date
    Nov 2008
    Posts
    75
    Thanks
    48
    Thanked 7 Times in 7 Posts

    So I am catching back up on these posts and I hope that my thought about z index works out. But what I didn't quite catch I think is the image that you want to bring to the top.
    Thats a pretty nice cloud you've got going there.

    I really hope that a 3 layered approach will work for your theme.

    If this is a hint of whats coming, well.....WOW

    Quote Originally Posted by Doreen View Post
    Moon Phase II - Yahoo! Widgets

    If I remember correctly alot of things such as the images and .xml files and scripts can be pulled out of the Desktop Widgets right?

    Not so sure now, I just tested the standalone and for some reason in WinterBoard though it "normally" lets you layer according to the order you drag your themes, this moon phase theme wants to be on top no matter where you place it in the order of your themes therefore we can't get the weather condition icon to overlay such as clouds and/or rain to position on top of the moon phase. argh! very frustrating I wish I knew this stuff better.
    I'll post a ss to show you in a mins let me try something else first.

    Okay don't pay attention to the Text on the bottom (cuz I'm swapping diff icons around to test this) but see look what I mean now that we can get this layered in WB it still wants the Moon on top no matter the position so if it's cloudy, raining or snowing the overlay icons will not go ontop of the moon but only behind it.

  22. #39
    Theme Creator Doreen's Avatar
    Join Date
    Jul 2007
    Location
    Southern California
    Posts
    2,572
    Thanks
    2,687
    Thanked 2,449 Times in 1,156 Posts

    You are def an optimistic cuz the way I see if it Spamdumpster can't figure out how to accomplished the last result he had again (but w/ the yahoo source instead of accuweather) plus not having to use the feed route for the moon phase we pretty much may have to beat our phones w/ a big stick to get it to cooperate. This is really not going to be easy. Last night I kept fighting w/ it over and over again trying to reposition the icons and then I realized if I dissect the overlay icons then how will this work during the "Day Time" hehe

    I got so frustrated cuz now if we can get the overlay weather condtion icons for the night time to lay onto top the moons then that folder of icons will be no good during the day when the Sun comes out since they will have been dissected from the Sun and the day time images have Suns in "some" of them as well. Soooo we would need to obviously call specific folders of images for day and night since the moon phase really complicates things for the "daytime" images.

    It really is a bit of some serious work and as far as shooting for accuracy it would become secondary to just trying to get this to work and I'd rather have accuracy myself but I'll keep working on the graphics portion and leave the rest up to you guys (cuz I have to work and juggle kids etc)

    I'll check back tonight to see how things progress over here...
    Last edited by Doreen; 02-23-2009 at 08:24 AM.

  23. #40
    iPhone? More like MyPhone
    Join Date
    Oct 2007
    Posts
    212
    Thanks
    8
    Thanked 37 Times in 30 Posts

    Guys and Gals: Copy this file over the Wallpaper.html in Doreen's weather widget. IT uses the yahoo source, but I've added a script to the html to caluclate the moondata (by formula, no pulling from external source), and then to add the data to the top of the screen like this:



    I found the code through a google search. I don't have any more time to work on it today, but I figure that if this Code can write the moonphase info, you guys should be able to translate it into an image.

    This preserved the goal of using the yahoo weathersource.

  24. The Following 2 Users Say Thank You to Spamdumpster For This Useful Post:

    Blik (02-24-2009), radarlove63 (02-23-2009)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts