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 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

Annual Daily Summary - JavaScript and jQuery version

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

This new thread is to post my version, of the daily summary script using JavaScript and jQuery, that might be of use to others

EDIT January 2014: The attachment (that was downloaded 43 times!) has been removed from this posting, and the text where I described its features has also been removed.

My version is a rewrite from scratch of David Jamieson's original; it completely restructures the sequence of processing, and consequently reduces what coding is repeated after selecting a different category or making a change in displayed year. On my computer, this makes it amazingly quicker to redisplay the table after a new selection.
The HTML in the attachment includes my coding to deal with browsers that have JavaScript disabled, that is a very basic display, not at all like some elegant alternatives produced by other people, but at least it stops those people seeing nothing.

Please do not use this thread to compare PHP and JavaScript versions. However, I welcome alternative coding suggestions, comments about the restructured code, or queries about amending the coding for your preferences etc.
Also, do post a reply if you find this useful, and implement a version of it on your site.
Last edited by sfws on Fri 07 Nov 2014 8:14 pm, edited 5 times in total.
passafras
Posts: 7
Joined: Mon 26 Nov 2012 12:57 am
Weather Station: Oregon Scientific WMR200
Operating System: Windows 10 Pro
Location: Mooral Creek
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by passafras »

G'day sfws.

I've tried to follow your instructions - I think you need to expand them a little, don't just put them in comments in the files. I'm almost a newbie and it took me a while to remember that dailysummaryT.html needed processing, via Cumulus - V 1.9.3 Build 1053.

Before that though I found that readDayfile.css wasn't being processed in dailysummaryT.html, I just had black text, it turned out to be syntax thing, I'm using FireFox 17.0.1 In FireBug it would not register as a script, once I fixed the syntax it loaded, in FF and IE, on WinXP and Win7.

I think I also had a syntax issue with readDayfileS-part_min.js in dailysummary.html I also found at least 2 references to the default daj folder not in the location mentioned in the documentation.

I did rename that file to readDayfiles.js just in case it was some sort of server side issue with hyphens or long names, no change.

I renamed dailysummary.html to daily.html, where I'm at so far is http://sassafras.id.au/projects/weather/daily.html The table does not display for me. I would like to be able to use the flexibility you describe in your notes. :(

As part of my testing/comparison process I loaded DAJs version at http://sassafras.id.au/projects/weather ... mmary.html I wanted to be certain I had my path naming correct etc, both sets of files are set up the same so far as I can tell, they also read off the same dayfile.txt All the files are in the same folder.

Oh, and I also tried using the older 1.5.1 ajax jscript that DAJ uses, no change.

Thanks
Paul - Mooral Creek Weather at Sassafras.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by BCJKiwi »

There are a couple of gothchas in DAJ's original PHP script as it stands on the Wiki.

Have fixed those and included a couple of the features DAJ added via other posts. Have also increased the documentation in the script.
Have been waiting to find a way to post those into the Wiki which hopefully will be done in the next day or so (there are issues getting .zip files installed on the Wiki which is being resolved).

You can see the result here http://silveracorn.co.nz/weather/datasummary.php (Note:- this is not the same script as the 'Annual Data' menu item on the website).
passafras
Posts: 7
Joined: Mon 26 Nov 2012 12:57 am
Weather Station: Oregon Scientific WMR200
Operating System: Windows 10 Pro
Location: Mooral Creek
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by passafras »

I was hoping to use the javascript version rather than php.
Paul - Mooral Creek Weather at Sassafras.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by BCJKiwi »

The Wiki is now updated with the PHP files V 1.2

Sorry but my website is PHP and accordingly I'm not familiar with js and so am not prepared to offer an updated js version.
Further, I am not sure the core PHP issues addressed in this update would arise in the js version.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

http://sassafras.id.au/ A very impressive site.
In the HTML you should say:

Code: Select all

	<link rel="stylesheet" type="text/css" media="screen" href="readDayfile.css"><link href="weatherstyle.css" rel="stylesheet" type="text/css">
<script src="readDayfileS-part_min.js" type="text/javascript"></script>
The HTML I used to successfully display your table uses this, (plus it loads jQuery from the latest available by adding this call:

Code: Select all

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" type="text/javascript"></script>
Last edited by sfws on Fri 07 Nov 2014 8:11 pm, edited 2 times in total.
KevinF
Posts: 71
Joined: Sat 14 Apr 2012 5:01 pm
Weather Station: WMR200
Operating System: XP SP3
Location: Lancashire

Re: Annual Daily Summary - JavaScript and jQuery version

Post by KevinF »

I found in other postings that I have done, that readers on this forum can be critical, can be more expert than me and can be fairly ignorant.
I speak for me, and in general silent, but read as much stuff as I can, which includes your writings. I'm sure I speak for many by saying your efforts are more than appreciated! Basically I'm a novice, but at some point, your expertise will help me to develop my site. Keep up the excellent work - I am extremely grateful to you and all others who impart their knowledge via this forum.

Merry Christmas and A Happy New Year

KF
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

KevinF wrote: I speak for me, and in general silent, but read as much stuff as I can, which includes your writings. I'm sure I speak for many by saying your efforts are more than appreciated!
Basically I'm a novice, but at some point, your expertise will help me to develop my site. Keep up the excellent work - I am extremely grateful to you and all others who impart their knowledge via this forum.
Thank you, you have obviously seen the range of responses I have received.
I started learning about web design because I thought it would be good brain exercise and something that I could do when I had to curb my outdoor practical activities. It has not been as easy as I expected because of all the different browser dependencies and then web pages can be viewed on different devices.
Last edited by sfws on Fri 07 Nov 2014 8:16 pm, edited 1 time in total.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

passafras wrote: I'm using FireFox 17.0.1 In FireBug it would not register as a script, once I fixed the syntax it loaded, in FF and IE, on WinXP and Win7.
I renamed dailysummary.html to daily.html, where I'm at so far is http://sassafras.id.au/projects/weather/daily.html The table does not display for me.
EDIT - removed 'daily.html' that was previously attached here, as I have made further modifications since the original posting.

I'm using the same version of Firefox as you.
When Firefox version 11 introduced the web console (in tools menu or right click), I found I seldom needed to use Firebug, although I still have it available. I use several browsers, but the Error Console in Firefox gives (plain English) messages that are much easier to understand than the (technical worded) equivalent in other browsers. You may find that useful especially if you start editing script files.

I did try using 'Kompozer' (you mention you use this) for creating HTML, but I found it gave me problems when I edited HTML, hence I used HTML-kit 292 to edit your 'daily.html' with a little help from Notepad reading your 'today.htm'.

Ok, I hope you can upload this HTML to your site and see the table being displayed.
I suggest you then edit the HTML until you get the headings and look that suits you - the rest of your site looks good so that should be easy for you.
Then, edit the main array in the script file so you see the headings there that suit you.

That should move you on quite a bit!

You might want to experiment with some small changes to your other weather web pages, following hints elsewhere on the forum - for example <#metdate> (with date/time formatting - see Wiki for web tag details) is quite useful on the 'today' and 'thismonth' web pages to indicate the rollover status (before/after local 9am). Also see https://cumulus.hosiene.co.uk/viewtopic.p ... terday+tag.
Last edited by sfws on Fri 07 Nov 2014 8:20 pm, edited 2 times in total.
passafras
Posts: 7
Joined: Mon 26 Nov 2012 12:57 am
Weather Station: Oregon Scientific WMR200
Operating System: Windows 10 Pro
Location: Mooral Creek
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by passafras »

Thanks for going through everything sfws. It now works, thankyou.

The most enlightening of your comments was the difference between the file system views in server side and browser based processing. Undoubtedly that was the problem. I also appreciate the far greater documentation, much better for someone like myself, 14 years in IT, on the systems management side, if I wanted code written I had a chat to programmer. Of course I wrote the more basic scripts, time to learn a bit more.

Yes I had noticed very early on in using kompozer that it corrupts some script files, and I noticed it again in the first few hours I was playing around with the Cumulus web files. I still prefer to use it because I want to use a wysiwyg, low cost, simple, and yes you can't beat writing code. I do use gedit for script edits as required, and I do try to use css throughout the rest of sassafras.

The reason the dayfile.txt was not updating is I had disconnected the internet here, we went down to Melbourne for a week and the forecast was for a few days of thunderstorms here. Better safe than sorry. When we got back it seems the power went off for a while on the laptop, no UPS yet and the base station was plugged in with a faulty power cable to boot, almost dead flat batteries there too.

I'll have more of a play with it over the next day or so, thanks again.
Paul - Mooral Creek Weather at Sassafras.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

passafras wrote: It now works, thankyou.
Looks good on your site.
For the pressure criterion the '(lighter background)' should be associated with 'maximum' with the colour scheme I provided - compare captions for RH and all the two value temperature criterions with your editing of the pressure one.


I have even had a peep at your species lists - lots of work typing that lot in! I know a little about some UK species, but am mostly content to admire it without identification or study.
passafras wrote:difference between the file system views in server side and browser based processing. Undoubtedly that was the problem.
Yes the browser views of the file system are the subject of many discussions elsewhere on this forum, that together with book reading helped me when I started experimenting a year ago. For ease of maintenance, I created separate folders for Cumulus templates, processed HTML, CSS and ECMA/Java Script, but that causes problems when you do not use web space and try to do things locally. So I am now using a single test folder with anything I am using/working on. I archive into the multiple folder structure trying to remember to change the file references!
passafras wrote: I also appreciate the far greater documentation, much better for someone like myself, 14 years in IT, on the systems management side, if I wanted code written I had a chat to programmer.
Thanks.
EDIT - January 2014 - removed zip previously attached to this post, latest version in later posting of this thread.
Last edited by sfws on Fri 17 Jan 2014 10:04 am, edited 2 times in total.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

Just a cross-reference here, that the Wiki article http://wiki.sandaysoft.com/a/AnnualDataSummary has been amended today in the spirit of being more helpful after seeing all references in this 3rd party tools forum to the Annual Summary.

The change is actually a few minor edits (and I've added my signoff to my contributions), but the Wiki reports it as a big edit as I've corrected some spelling and introduced some consistency in styles.
Last edited by sfws on Fri 07 Nov 2014 8:22 pm, edited 1 time in total.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

I now have proof that my routine copes with pre-rollover in the new year correctly and with local time variations.
See https://cumulus.hosiene.co.uk/posting.php ... =18&t=6640for full report.
The zip includes some rather poor quality screen shots:
sassfras.zip

1 January local time prior to rollover (latest shown is 30 December)
1 January local time after rollover (latest shown is 31 December)
2 January local time prior to rollover (latest shown is 31 December)
You do not have the required permissions to view the files attached to this post.
Last edited by sfws on Mon 07 Jan 2013 7:55 pm, edited 2 times in total.
Mapantz
Posts: 1775
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Annual Daily Summary - JavaScript and jQuery version

Post by Mapantz »

I'd like to use this but it's so massive on my webpage you'll need a week's holiday just to scroll through it.

I've been trying to edit the css but had no luck. I've looked at the Wiki help page and it lists items to change that don't even exist in the css. :(

http://www.wareham-weather.co.uk/dailysummary.htm
Image
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Annual Daily Summary - JavaScript and jQuery version

Post by sfws »

In your 'style.css', change your 'padding-left':

Code: Select all

#content {
   display: block;
   padding-left: 20%;
   /*padding-left: 180px;*/
   padding-top: 5px;
}
In your 'readDayfile.css':

Code: Select all

	#table_container {
		width: 100em;
		margin: 0 auto;
		font-family: Verdana, Helvetica, sans-serif;
		font-size: 9pt;
		color: navy;
	}
defines the width of the entire table and the starting font size. If you change '100em' to '60%' then the table will be reduced to 60 per cent of the available width. You probably want to reduce the '9pt' to '5pt' to bring the font down in proportion.
Of course reducing the table, implies reducing the table cell size...

Code: Select all

	#table_container table td {
		width: 65px;
		/*width: 65em;*/
		text-align: center;
		padding-left: 0.5em;
	}
is the relevant style declaration.
Experiment with changing the table cell size (65em) to something smaller, the fonts used in the table cells are expressed in percentages anyway, so will reduce in proportion.
This is what I see on my screen with the changes so far.
wareham.jpg
You do not have the required permissions to view the files attached to this post.
Last edited by sfws on Sat 15 Nov 2014 8:51 pm, edited 1 time in total.
Post Reply