Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

beteljuice AJAX testers wanted

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
User avatar
steve
Cumulus Author
Posts: 26714
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: beteljuice AJAX testers wanted

Post by steve » Mon 29 Dec 2008 5:46 pm

dane wrote:But this is about weather stations, so who am I to argue with a weather specialist?
I'm no specialist. All my knowledge comes from the experts on the uk.sci.weather newsgroup :)

Steve

User avatar
gwheelo
Posts: 453
Joined: Wed 11 Jun 2008 7:36 pm
Weather Station: WMR-88
Operating System: Windows 8.1
Location: L'Estartit, Spain
Contact:

Re: beteljuice AJAX testers wanted

Post by gwheelo » Mon 29 Dec 2008 11:03 pm

After adding Firebug to my Firefox browser - I am showing 1 bug on http://www.wheelocknet.net/cumulus/now.htm - my Ajax page . See attached. The flagged "onload" instruction appears complete to me a novice- but perhaps it is looking for some more detail.

Anyone have a suggestion?

GW
You do not have the required permissions to view the files attached to this post.
Image

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Tue 30 Dec 2008 12:35 am

Interesting !
You may have disovered something that was driving me insane with an even more complicated piece of code that worked in everything except FireFox.

Try changing the <body> statement to:

Code: Select all

<body onLoad="ajaxLoader('http://www.wheelocknet.net/cumulus/realtime.txt?' + new Date().getTime()); done=1;" onpageshow="if(!done){window.onLoad();}; done=0;"> 
Let me know if it works !

(I don't run FF)
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
gwheelo
Posts: 453
Joined: Wed 11 Jun 2008 7:36 pm
Weather Station: WMR-88
Operating System: Windows 8.1
Location: L'Estartit, Spain
Contact:

Re: beteljuice AJAX testers wanted

Post by gwheelo » Tue 30 Dec 2008 8:17 am

No joy with new code.
see attachment.

GW
You do not have the required permissions to view the files attached to this post.
Image

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Fri 02 Jan 2009 12:02 pm

Update:

Just to let you know, pre-release release has been delayed while I build some work arounds and 'belt and braces' stuff.

George (gwheelo) decided to test my mettle by having a page with:
  • Embedded style sheet
    in-line styles
    Two External style sheets
    Two External JavaScript calls at the end, which downloaded and ran more script (analytics / counter)
    .. and HTML comment errors (explained elswhere)
Bless Him

Once the html comment error had been discovered, the page sort of worked in FireFox using the body onLoad option.

However, it made me revisit the way that different browsers handle onLoad, and think about the different possible options for users to handle their browser cache.

onLoad has been dumped !

They all have a different idea of what it means !
Basically speaking, DHTML has to be 'rendered' by (put your browser here) before the script runs, else the inital data grab 'seems' to fail, and you have to wait until the next grab for information to appear.

'Rendering' may or may not take place before any external style sheets, etc. have downloaded.

What this means:
You have an empty element with no styles applied:
<div id="myDiv"></div> - There it is - NOT !
Until the users browser 'renders' the page it doesn't exist :roll:
Not very helpful when these are the very things that we are manipulating :cry:

In the next release there will be a looping check (with a safety timeout) to see if elements have been 'rendered' before the main script call.

This does mean that all html pages that use the script MUST have a new div id at the bottom of the page preferably immediately before the closing </body> tag.
Also, for some browsers there may be a slight inital delay before the data appears (<0.25s usually)

There will be some other tweaks, but the majority of variable names will be the same.

To be continued ............
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
gwheelo
Posts: 453
Joined: Wed 11 Jun 2008 7:36 pm
Weather Station: WMR-88
Operating System: Windows 8.1
Location: L'Estartit, Spain
Contact:

Re: beteljuice AJAX testers wanted

Post by gwheelo » Sat 03 Jan 2009 12:18 am

I am going to take all that as a compliment. But there is no doubt that my complex ideas, sloppy html, and novice approach only results in passable webpages through the patient, thoughtful, and always tutorial assistance of people like, Beteljuice, Steve, Kevin, and all the other support characters on this great forum. Result, see: http://www.wheelocknet.net/cumulus/now.htm

And if anyone needs a beta tester - I have the track record now to make it break. Get past me and you have a winner!

Thanks everyone!

George Wheelock
Image

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Fri 09 Jan 2009 12:20 pm

Hadn't thought about it but steve said elsewhere:
.. are you using the 'rename' option for ftp? Your realtime.txt file keeps disappearing briefly - this makes the data in your banner disappear. The rename option should stop this happening.
Same logic applies to anything trying to grab realtime.txt, including this AJAX routine ;)
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
Paul C
Posts: 377
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: beteljuice AJAX testers wanted

Post by Paul C » Mon 19 Jan 2009 3:09 pm

I have a simple web page with this "ajax" on. Its just a copy of your orginal one with my name added on (sorry).

However it has proved quite useful today and can successfully report the snow falling script does work.

I would now like to edit it a little. I dont what all the temp etc in degrees F, just C will be fine and the pressure is OK in MB rather than anything else. Can you point me in the right direction for removing (safely) the bits I dont need, in otherwords all the duplicate variables to be removed ?

thanks

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Mon 19 Jan 2009 3:30 pm

I hope to shortly re-issue everything (still a few tweaks and cleaning up to do), there will be some minor changes and the snow / freeze calcs are part of that (sorry - should be more accurate :lol: )

You don't really need to worry about the javascript file, just edit the html page to suit.

Just look for the 'variable' names you don't want, and remove everything todo with that <span>

eg.

Now: <span class="ajax" id = "ajaxtemp_C"></span>&nbsp; / <span class="ajax" id = "ajaxtemp_F"></span>&nbsp;&nbsp;| Trend:<span id = "ajaxtemptrend"></span>

For C only would become:

Now: <span class="ajax" id = "ajaxtemp_C"></span>&nbsp;&nbsp;| Trend:<span id = "ajaxtemptrend"></span>

Have fun playing - that's what it's all about :mrgreen:
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
Paul C
Posts: 377
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: beteljuice AJAX testers wanted

Post by Paul C » Tue 20 Jan 2009 8:52 am

Thanks,
Sorted most of that out, what about pressure though you have it in Hpa, would prefer just mb ?

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Tue 20 Jan 2009 12:04 pm

Bless .......

In the javascript, language section, look for;

Code: Select all

var langBaroRising = 'Risen %s hPa since last data'; /* used for 'change' arrow alt/title 
var langBaroFalling = 'Fallen %s hPa since last data';
Change hPa for mb

In the javascript, pressure section, look for the following lines:

Code: Select all


// hPa relative

Rset_ajax_obs("ajaxbaro_rel_hPa", pressure_rel_hPa.toFixed(1), " hPa");

// pressure Min / Max
Rset_ajax_obs("ajaxbaro_rel_hPa_Min", pressure_rel_hPa_Min.toFixed(1), " hPa");
Rset_ajax_obs("ajaxbaro_rel_hPa_Max", pressure_rel_hPa_Max.toFixed(1), " hPa");	


//   Barometric Trend (3 hour) - NB. cumulus gives an hourly average of last 3 hrs
Rset_ajax_obs("ajaxbarotrend_hPa_rate",pressure_rel_hPa_Trend_rate, " hPa");
Change any " hPa" for " mb"

You will have to do it all over again with the next build, but it will get you used to looking for 'patterns' in the code, and hopefully make you less afraid of such things.

Until you break it :lol:
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
Paul C
Posts: 377
Joined: Thu 19 Jun 2008 7:45 am
Weather Station: Davis VP2 with solar
Operating System: Windows 10
Location: Brampton, Cumbria, UK
Contact:

Re: beteljuice AJAX testers wanted

Post by Paul C » Tue 20 Jan 2009 2:14 pm

I have a habit of breaking stuff !

When is your new version out ? I think I will stop fiddling until you have the new version as I was thinking of encorporating it into a new website I am planning on creating, I dont want to do all over it again.

"bless" :twisted:

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Wed 28 Jan 2009 12:23 pm

CODING ERROR !

I am STILL cleaning up / belts 'n' braces / new 'extras' etc. etc.

But the beteljuice has made a logical boo boo, that could affect the way your homebrew pages work.

The Zambretti JavaScript MUST be embedded in EVERY html page that calls the AJAX script, wether it is used or not :oops:

Code: Select all

<html>
.......
<head>

.......

<!-- zambretti forecast - also used by beteljuices 'weather map', as required -->
    <script type="text/javascript" src="zambretti/betel_cast.js"></script>

<!-- MAIN SCRIPT - getting nowhere without this -->
 <script type="text/javascript" src="betel_cumulus_ajax.js"></script>
</head>
<body>
..............
This will be fixed in the 'release' - honest !
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
beteljuice
Posts: 2516
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice » Sun 15 Feb 2009 2:32 am

Pre-Release Release :?

OK guys, here is the neatened up version.

http://www.beteljuice.com/cumulus/betel_cumulus.zip

Fot those that have gone before:

Major change - ALL html pages calling the script MUST have:

Code: Select all

<div id="ajaxEND" style="display; none:"></div>
just before the closing </body> tag
You can put these in your existing pages without ill-effect !

thermometerstr used in extras as a mouse-over (but could be an advisory ;) ) is now split into two;
thermometerstr_C
thermometerstr_F

bug-fix: no need to include zambtretti/betel_cast.js if not required.

added: ajax_gizmo.js
added: betel_more.html
added: basic.html

general, lots of code neatening, tweaks, belts and braces stuff.
Even more user language defined arrays (although you still may have to search for mouse-overs and extras)
The missing EXTRAS/baro_needle .... graphics are now there !
a few extra graphics.
including stuff/change_blank.gif to assist initial html page formating where you have a 'change since last' arrow.

A huge README.txt which has nearly everything you need to know in it !

Because of this, and any tweaks you may have made, I recommend you unzip / upload to a totally new directory, and copy any of your own html files accross, or just make new name copies as long as they reference the new 'ajax' directory.

No changes have been made to the /zambretti directory, so if you have changed the text / language you can just copy your existing stuff over the top.

betel_cumulus_ajax.js - Script with all the extras (extras are MPH)
KPHbetel_cumulus_ajax.js - Script with all the extras (extras are km/h)
KTSbetel_cumulus_ajax.js - Script with all the extras (extras are kts)
MPSbetel_cumulus_ajax.js - Script with all the extras (extras are m/s)
no_frills_betel_ajax.js - Script with NO extras
betel_cumulus_biggest_ajax.js - modified to run 'biggest' graphic ;)

See it working at http://www.beteljuice.com/cumulus/betel_index.html
Last edited by beteljuice on Sun 18 Nov 2018 5:02 am, edited 2 times in total.
Image
......................Imagine, what you will KNOW tomorrow !

simsons
Posts: 31
Joined: Fri 23 Jan 2009 2:34 pm

Re: beteljuice AJAX testers wanted

Post by simsons » Mon 16 Feb 2009 6:57 pm

Hmm, i cant make it running.
I wrote good patch to directory and realtime.txt but always im getting something:
You do not have the required permissions to view the files attached to this post.

Post Reply