Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

beteljuice AJAX testers wanted

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

Moderator: daj

User avatar
aadal
Posts: 168
Joined: Tue 04 Nov 2008 8:07 pm
Weather Station: WH 1080
Location: Skodje
Contact:

Re: Windsock mps

Post by aadal »

beteljuice wrote:Ok - I relent !

Look in the script for:

// --------- betejuices composite weather 'graphic' ------------------------------

Then look for the bit like below, and replace it with the bit below OR change the three mph references in the script code to wind_mps



Code: Select all

// create wind graphic / data - using now (gust) value
				spacer="";
				if(wind_mps >= 1) {	// build wind info section(s)
					Rset_ajax_obs("ajax_pic_windsock", "<img src=\"" + here + "stuff/wind_sock.gif\" alt=\"" + langWindFrom + valLang + "\" title=\"" +langWindFrom + valLang + " (" + val2 + "\&deg;)\" />", "");
					Rset_ajax_obs("ajax_pic_windspeed", wind_mps.toFixed(1) + "<br />", "mps");
					spacer="&nbsp;&nbsp;&nbsp;";
				}else{
					Rset_ajax_obs("ajax_pic_windsock", "", "");
					Rset_ajax_obs("ajax_pic_windspeed", "", "");
				}
Thanx I try thise, not working..
Play with it to morrow.. :D
  • Windows Vista
Image

Image
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice »

I must be getting soft !!!

Here is an alternative betel_cumulus_ajax.js so that the EXTRAS 'weather map' and 'wind blurb' are ms native, not mph.

YOU ARE SUPPOSED TO MAKE / MODIFY YOUR OWN EXTRAS !!!

http://www.beteljuice.com/cumulus/MPSbe ... s_ajax.zip

UnZip and RENAME to betel_cumulus_ajax.js - Don't forget to alter the settings to your own site !

Now can someone please just try creating their OWN simple page to prove the 'variables' all work as expected !!!!!!!
Last edited by beteljuice on Sun 18 Nov 2018 4:45 am, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

http://cumulus.joske-online.be/betel_cu ... _ajax.html

take tags.....throw them into table....work is calling :cry: :evil:

look at it and you have a list of tags.....don't ask......I don't know.... when I have more time...
Jozef
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

beteljuice wrote:I must be getting soft !!!
Yes you are ;)
beteljuice wrote: Now can someone please just try creating their OWN simple page to prove the 'variables' all work as expected !!!!!!!
8-)
http://cumulus.joske-online.be/betel_cu ... _ajax.html
Jozef
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

change:
in both js files to display km/h instead of kph

Code: Select all

// define some user (html) variables

			Rset_ajax_obs("ajax_wind_mps", wind_ms.toFixed(1), " mps");
			Rset_ajax_obs("ajax_wind_kph", wind_k.toFixed(1), " km/h");
			Rset_ajax_obs("ajax_wind_mph", wind_mph.toFixed(1), " mph");
			Rset_ajax_obs("ajax_wind_kts", wind_kts.toFixed(1), " kts");

			Rset_ajax_obs("ajax_wind_mps_ave", wind_ms_ave.toFixed(1), " mps");
			Rset_ajax_obs("ajax_wind_kph_ave", wind_k_ave.toFixed(1), " km/h");
			Rset_ajax_obs("ajax_wind_mph_ave", wind_mph_ave.toFixed(1), " mph");
			Rset_ajax_obs("ajax_wind_kts_ave", wind_kts_ave.toFixed(1), " kts");

			Rset_ajax_obs("ajax_wind_mps_recent", wind_ms_recent.toFixed(1), " mps");
			Rset_ajax_obs("ajax_wind_kph_recent", wind_k_recent.toFixed(1), " km/h");
			Rset_ajax_obs("ajax_wind_mph_recent", wind_mph_recent.toFixed(1), " mph");
			Rset_ajax_obs("ajax_wind_kts_recent", wind_kts_recent.toFixed(1), " kts");

			Rset_ajax_obs("ajax_wind_ave_max_TIME", currdat[31], "");
			Rset_ajax_obs("ajax_wind_mps_ave_max", wind_ms_ave_max.toFixed(1), " mps");
			Rset_ajax_obs("ajax_wind_kph_ave_max", wind_k_ave_max.toFixed(1), " km/h");
			Rset_ajax_obs("ajax_wind_mph_ave_max", wind_mph_ave_max.toFixed(1), " mph");
			Rset_ajax_obs("ajax_wind_kts_ave_max", wind_kts_ave_max.toFixed(1), " kts");

			Rset_ajax_obs("ajax_wind_gust_max_TIME", currdat[33], "");
			Rset_ajax_obs("ajax_wind_mps_gust_max", wind_ms_gust_max.toFixed(1), " mps");
			Rset_ajax_obs("ajax_wind_kph_gust_max", wind_k_gust_max.toFixed(1), " km/h");
			Rset_ajax_obs("ajax_wind_mph_gust_max", wind_mph_gust_max.toFixed(1), " mph");
			Rset_ajax_obs("ajax_wind_kts_gust_max", wind_kts_gust_max.toFixed(1), " kts");

Jozef
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

beteljuice wrote: Now can someone please just try creating their OWN simple page to prove the 'variables' all work as expected !!!!!!!
home page, click on banner

Someone else now, please :?:
Jozef
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice »

VERY nicely integrated Jozef :D

But I did see your earlier table, which highlighted a coding error in the ajaxupdatecount area

So I'm afraid I will be redoing the Zip again (although variable names won't have changed)

I'll change kmh to 'output' km/h

What about mps - do people prefer ms ?
Image
......................Imagine, what you will KNOW tomorrow !
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

beteljuice wrote: What about mps - do people prefer ms ?
When I look at the dutch or scandinavian websites, most of them use m/s
Jozef
User avatar
dane
Posts: 417
Joined: Wed 10 Sep 2008 2:15 pm
Weather Station: Rosenborg 68700
Operating System: Win10 Ult., 64-bit, RaspberryPi
Location: Gilleleje, Denmark

Re: beteljuice AJAX testers wanted

Post by dane »

I was coding along happily until I experienced a "funny" thing: I tried to have the same Ajax "variable" in 2 different places on the same page... And in the second place (HTML-wise) I got: nothing.
Is that "as designed" and "to be expected", or did I do something wrong?

Ib
Ib
pinto
Posts: 112
Joined: Sat 11 Oct 2008 3:20 pm
Weather Station: Davis Vantage Pro 2 Plus
Operating System: Debian Buster

Re: beteljuice AJAX testers wanted

Post by pinto »

each variable has to be unique

You can add a second one to the js file and use it
example for UV

Code: Select all


				Rset_ajax_obs("ajax_UV", currdat[43], "");	// effectively a text value, no processing
				Rset_ajax_obs("ajax_UV_second", currdat[43], "");	// effectively a text value, no processing
and use

Code: Select all

<span class="ajax" id="ajax_UV"></span>
<span class="ajax" id="ajax_UV_second"></span>
Jozef
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice »

From the README.txt - the clue is in the name ;)
THIS MEANS EVERY TARGETED ELEMENT ON ANY PARTICULAR HTML PAGE MUST HAVE A UNIQUE ID !!!
If you need to duplicate anything look for where the first one appears:

eg.

Rset_ajax_obs("ajax_wind_mps", wind_ms.toFixed(1), " mps");

Then copy that with a different 'variable' name:

Rset_ajax_obs("my_duplicate_wind_mps", wind_ms.toFixed(1), " mps");

or if you wanted NO decimal places:

Rset_ajax_obs("my_duplicate_wind_mps", wind_ms.toFixed(0), " mps");

Get the idea ?

Just noticed pinto beat me to it :lol:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dane
Posts: 417
Joined: Wed 10 Sep 2008 2:15 pm
Weather Station: Rosenborg 68700
Operating System: Win10 Ult., 64-bit, RaspberryPi
Location: Gilleleje, Denmark

Re: beteljuice AJAX testers wanted

Post by dane »

My thanks to both of you!
Ib
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice »

Zip has been updated !

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

Minor coding mod to scripts.
Also where output, wind units now m/s and km/h
NO VARIABLE NAMES HAVE BEEN CHANGED

very minor tweak to index and table pages, to avoid confusion with all the '/'

** BONUS ** BONUS ***
For the remaining testing period only !
There is now a version of betel_cumulus_ajax.js for EVERY 'native' wind unit.
This ONLY AFFECTS THE 'EXTRAS', little 'weather map' and 'wind blurb'

If you don't want the default mph, rename it to MPHbetel_cumulus_ajax.js
and rename the one you want to betel_cumulus_ajax.js

Don't forget to set-up the script to see your data.

betel_cumulus_biggest_ajax.js has CHANGED
If you don't want mph, scroll down toward the bottom of the script and follow the instructions.
betel_big.html has CHANGED
If you don't want mph, scroll down and follow the instructions
(NEW graphic in the EXTRAS folder)

If you have modified but not renamed the html pages :lol:
DO IT FIRST !
Last edited by beteljuice on Sun 18 Nov 2018 4:48 am, edited 1 time in total.
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
dane
Posts: 417
Joined: Wed 10 Sep 2008 2:15 pm
Weather Station: Rosenborg 68700
Operating System: Win10 Ult., 64-bit, RaspberryPi
Location: Gilleleje, Denmark

Re: beteljuice AJAX testers wanted

Post by dane »

..... just for info: making progress - when time permits :)
Sample page as it stands right now: http://www.ibtest.dk/vejr/

No major problems. Only minor:
- to "localise" you have to find language-specific bits and pieces in many places in the code...
- didn't seem to be able to specify color in code like the line below. Italic works, but not color :?:

Code: Select all

<span class="ajax" id="ajaxbeaufort" style="color: darkblue; font-style: italic;"></span>
Ib
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: beteljuice AJAX testers wanted

Post by beteljuice »

Everything you need to know about 'color':

http://www.w3.org/TR/css3-color/#html4

Great start ib !

I thought most the basics had language arrays ?

The extras are usually unique code, as you would do for yourself rather than a global audience.
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply