Author Topic: New Record Light  (Read 14785 times)

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
New Record Light
« on: July 24, 2012, 07:35:33 AM »
I've been using a blinking new record light that appears on my index page (next to last update), as well as on the all-time records page (corresponding to the record that was set).

One thing that used to frustrate me was that the page would indent everything, making room for all of the invisible "off" states of the light. I created a new .gif for the "off" state by defining an image as 1px by 1px. This way, there's no indent when things are "normal".

Have a look. Set a new wind gust record this morning as a thunderstorm blew through. Finally got around to re-mounting the anemometer on the roof.

http://http://krmidas.home.comcast.net/~krmidas/cumulus/index.htm

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline virusdunil

  • Jr. Member
  • **
  • Posts: 24
    • http://www.meteohebertville.com
Re: New Record Light
« Reply #1 on: July 24, 2012, 08:12:36 AM »
That lil blinking light is cool....i was thinking about that yesterday ;)

Today ill add a little something funny  on my index page

a ''bug discomfort index'' and a fishing index as well  :lol:
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Station Meteo:National Geographic Fine Offset)
Logiciel:Cumulus et Weather Display
Mon site: http://http://www.meteohebertville.com

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: New Record Light
« Reply #2 on: July 24, 2012, 11:51:55 AM »
Hey Tom,

That looks cool!!
I assume when a record is set, it turns into RED?? Does it refers to the record when you click on it??

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: New Record Light
« Reply #3 on: July 24, 2012, 12:16:25 PM »
When a record is set, it blinks green. When no record is set, it's invisible.

Clicking on it does nothing. However, if you go to the records heading, then click on "all-time", you'll see a corresponding blinking green button next to the actual record that was set. In today's case, it was all-time high gust.

However, you've given me an idea. I may turn the blinking green button into a link that will take you to the page with the all-time records.

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: New Record Light
« Reply #4 on: July 24, 2012, 12:27:54 PM »
Thanks for the idea, Arthur! The blinking green light now takes you to the all-time records page.

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: New Record Light
« Reply #5 on: July 24, 2012, 01:02:28 PM »
Hi Tom,

Effectively, you idea is pretty cool!  :D
If you want to go a step farther in your idea, I can propose that solution!

In html, dynamic is coming with javascript. Then a thing that we can think of is to play with an ID.
We can put an "id" on near everithing html. Suppose that we are using a div. We build it
as if we are allways having a new record set, We need:

- A link pointing to Record page or system page. <a href="......">
- An image to show big alert  <img src="..." alt="..." title="..." />

Let mix all this together

Code: [Select]
<div id="record_set">
  <p><a href="system.htm"><img src="images/BigAlertButton.png" alt="message if button not available" title="A new record is set - for mouse over button" /></a></p>
</div>
Sure you can do it to your own taste, just text, or adding more thing into our record_set id!

Now, we don't want it when no record is set! Then just add these lines just before </head>

Code: [Select]
<style type="text/css">
  /* Hide div record_set until we know if a record is set */
  #record_set{visibility:hidden}
</style>
We have our record_set div, and we have hide it until end of page.
Now we need Cumulus webtag <#newrecord> (0 if nothing, 1 if record!)
Then, just before </body> we add a little javascript trick:

Code: [Select]
<script type="text/javascript">
   alerts=<#newrecord>;
   if(alerts=1) document.getElementById("record_set").style.visibility="visible";
</script>

Thats it! alerts is taking value of <#newrecord> and if 1, it unhide our id="record_set"
If no record is set, record_set stay hided and take no place!

Them you could hide/show as big as you want, and there is no hole if anything!

Hope you lot of fuj with that trick!

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: New Record Light
« Reply #6 on: July 24, 2012, 01:56:02 PM »
Doesn't that seem more involved than the way I'm doing it?

[attachment=1:3vos2pla]Capture.JPG[/attachment:3vos2pla]
<caption style="text-align: left;"><strong><a href="http://krmidas.home.comcast.net/~krmidas/cumulus/monthlyrecord.htm"><img src="record_<#newrecord>.gif">

And each record on the all-time page is formatted like today's wind gust:

[attachment=0:3vos2pla]Capture2.JPG[/attachment:3vos2pla]
<img src="record_<#HighWindGustRecordSet>.gif">Highest Wind Gust</td>

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: New Record Light
« Reply #7 on: July 24, 2012, 02:42:10 PM »
Hi Tom,

It's good, but on some site that green light indicate that the station is "in operation"
or in "real-time mode"... maybe a longer text:

(light) New record on july, 24 2012 1:45pm

Usually, green light is for OK status... maybe yellow.. or red?

But, just a comment.

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: New Record Light
« Reply #8 on: July 24, 2012, 03:27:26 PM »
I hadn't thought of that. I should probably make an indication on the index page that the blinking green light indicates a new record has been set.
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA