Author Topic: AJAX webpages are underway  (Read 18752 times)

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #15 on: March 20, 2012, 02:16:15 AM »
Page is finally getting somewhere. I've used the jquery and jquery ui scripts to help out with the AJAX and tab functions. One advanatage is that changing the theme is pretty simple and you can even roll your own by going to http://jqueryui.com/themeroller/

Also, the page is valid HTML5 and makes use of CSS3, so older browsers are out (IE mainly). Works just phone on iOS and Safari, FF, and Chrome.

I've still got to integrate the graphs and I have a couple more ideas I want to try and implement but I hope to have this ready to go in a week or so (or at least after the next release of WC which will provide a couple things that I and SaratogaWX need ;) ).

Anyway, check it out:
http://wx.atkinsfamily.org

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #16 on: March 20, 2012, 02:23:28 AM »
Looking great  [tup]

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #17 on: March 20, 2012, 02:47:03 AM »
Looking great  [tup]

Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.

mattm

  • Gentle Breeze
  • **
  • Posts: 21
  • Station Details: 2011 MacMini, Core2 duo, Vantage Pro 2 with 5 stations
Re: AJAX webpages are underway
« Reply #18 on: March 20, 2012, 11:16:58 AM »
Very impressive. I'm liking your development page a lot. Thanks for putting the time into it.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: AJAX webpages are underway
« Reply #19 on: March 20, 2012, 04:50:20 PM »
Indeed, very nice  [tup]

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #20 on: March 20, 2012, 10:37:10 PM »
Looking great  [tup]

Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.

I was going to ask about it  ;) but realised it was still in development.

Is there any chance of doing some Javanese on the wind direction to get it to display compass bearings rather than degrees? My pet hate.. but not enough to put me off  [tup]

Tony

saratogaWX

  • Strong Breeze
  • ***
  • Posts: 156
  • Weather website programming enthusiast
    • Saratoga-Weather.org
  • Station Details: Davis VP1 +, iMAC 21, OSX 10.6.8
Re: AJAX webpages are underway
« Reply #21 on: March 21, 2012, 12:08:39 AM »
Here's a handy JavaScript code to convert degrees to cardinal directions:

Code: [Select]
function windDir ($winddir)
// Take wind direction value, return the
// text label based upon 16 point compass -- function by beeker425
//  see http://www.weather-watch.com/smf/index.php/topic,20097.0.html
{
   var $windlabel = new Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW");
   return $windlabel[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}

use it by
Code: [Select]
var windDirection = windDir(windDegrees); and the windDirection variable will contain the text of the cardinal wind direction based on the number in windDegrees.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub, WeatherSnoop, WeatherCat
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #22 on: March 21, 2012, 12:53:07 AM »
Here's a handy JavaScript code to convert degrees to cardinal directions:

Code: [Select]
function windDir ($winddir)
// Take wind direction value, return the
// text label based upon 16 point compass -- function by beeker425
//  see http://www.weather-watch.com/smf/index.php/topic,20097.0.html
{
   var $windlabel = new Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW");
   return $windlabel[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}

use it by
Code: [Select]
var windDirection = windDir(windDegrees); and the windDirection variable will contain the text of the cardinal wind direction based on the number in windDegrees.

Best regards,
Ken

Thanks! That's much more compact than the code I came up with!

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #23 on: March 21, 2012, 01:17:12 AM »
Looking great  [tup]

Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.

I was going to ask about it  ;) but realised it was still in development.

Is there any chance of doing some Javanese on the wind direction to get it to display compass bearings rather than degrees? My pet hate.. but not enough to put me off  [tup]

Tony

Cardinal directions have been added thanks to the efficient function provided by saratogaWX (which is many many lines shorter than the code I'd originally come up with!).

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: AJAX webpages are underway
« Reply #24 on: March 21, 2012, 05:15:37 PM »
Looking good Todd  [tup]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks for the converter! (Re: AJAX webpages)
« Reply #25 on: March 21, 2012, 06:21:29 PM »
Hi Ken, Todd, Stu, and WeatherCat fans,

Here's a handy JavaScript code to convert degrees to cardinal directions:

Thanks! That's much more compact than the code I came up with!

Ditto!! Shucks I should have thought of that!!

Not certain AppleScript can do the math properly . . . *sigh* everything is weird in AppleScript  :o, but that doesn't look like a real stretch.  [tup]

The one good thing is I have that code in a separate library so I could swap it out and all my AppleScripts would be updated.

Thanks Ken for the elegant solution!!  [bounce]

Cheers, Edouard  [cheers1]

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #26 on: March 22, 2012, 01:29:23 AM »
Looking good Todd  [tup]

Thanks, Stu. Got the realtime min/max for today included now and no problems to report with the interim build. Thanks.

WCDev

  • WeatherCat Developer
  • Administrator
  • Storm
  • *****
  • Posts: 2911
    • CW9739
    • ISCOTLAN25
    • Trixology
  • Station Details: Main Station: Vantage Pro-2, 24hr fars, solar, soil/leaf station, extra temp stations, no U.V. WeatherLink IP.
Re: AJAX webpages are underway
« Reply #27 on: March 25, 2012, 10:41:11 AM »
Just had a quick look Todd, looking good! (So glad you made the high/low text a little bit bigger - I had to get a twenty year old colleague to read it earlier in the week  [biggrin])

Stu.

tigers

  • Gentle Breeze
  • **
  • Posts: 79
Re: AJAX webpages are underway
« Reply #28 on: March 27, 2012, 02:24:20 AM »
Thanks Stu, yeah I was playing around with Google fonts. I ended up making the widget boxes a little wider to there's more room to work.

Anyway, things are coming along nicely. I've got weather underground forecasts and alerts working now and the only thing left for an initial release is to bring in the graphs.

Not sure of a good solution for the STMONTHLY and STDAILY tags yet...the output from those is W   I   D   E! :D

HairyMcLeary

  • Strong Breeze
  • ***
  • Posts: 164
    • DW5912
    • INORTHOT6
  • Station Details: LaCrosse WS2355, iMac 2.66 Ghz Core 2 Duo, 8 GB RAM, Mountain Lion
Re: AJAX webpages are underway
« Reply #29 on: March 27, 2012, 03:03:53 AM »

Looking good!

I like the forecast icons, give the page a bit of a lift