Author Topic: Trying to eliminate space in ajax-dashboard6.php  (Read 1307 times)

0 Members and 1 Guest are viewing this topic.

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Trying to eliminate space in ajax-dashboard6.php
« on: June 30, 2021, 04:13:17 PM »
I have my ajax-dashboard6.php up and running. I have one thing I am trying to do. I have some "white space" I am trying to eliminate, but can't figure out how to do it.

Look at the heading "Liquid Precipitation" and notice the Rain Graph below the heading. I am trying to move the graph up towards the heading and eliminate the white space.

You can see it here: https://ajijicweather.com/wxindex.php

Also I have attached a jpeg showing it.

Any ideas?

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #1 on: June 30, 2021, 07:42:14 PM »
It looks really good so far!  If you need some ideas, my overloaded dashboard might give you some ideas.

Keep up the good work. [tup]
« Last Edit: July 02, 2021, 12:27:42 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #2 on: July 01, 2021, 03:06:11 PM »
Two questions Jerry,

1. On your site you have a "Season Countdown" section. Where can I find code for that? I see it has something to do with "Curley's" script.

2. On my site, Just under "Liquid Precipitation" I have a large "whitespace" between the top of the column and the raintoday.gif. I can't for the life of me figure out how to eliminate that whitespace. I tried valign="top" on the <td> for the rain graph. I notice on your site it is nice and tight to the top. Any ideas?

http://ajijicweather.com/wxindex.php
 

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #3 on: July 01, 2021, 04:47:23 PM »
The Season Countdown lowdown can be found here.

If you'll compare my entries under 'Precipitation' vs. yours you'll see that you're missing some.  Also, the adjacent 'Dew Point'/'Humidity' and 'Wind'/'Barometer' have been altered to occupy less space.

Here's my dashboard code.  If you compare this script with Ken's distribution you might better be able to identify my modifications.  I use 'CompareIt!' for this purpose, and that's how I incorporate Ken's changes while preserving my mods.

Hope this helps.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #4 on: July 01, 2021, 05:00:47 PM »
Thanks for the info Jerry. I'll look into it tomorrow. I also use CompareIt! I'll let you know what I find ...

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #5 on: July 02, 2021, 11:29:18 AM »
Hi Jerry,

Thanks for letting me compare my ajax-dashboard6.php to yours. I was able to use CompareIt to work out some issues. I also added the Season Countdown.

I also changed my Chandler Burn Index to use firedangerWD.php. I read up about it on this webboard and am able to get it to work. I do have one problem with it. Right after the Temperature it is displaying some "weird" characters.

You can see it here: https://ajijicweather.com/wxindex.php

Any idea how to fix the "weird" characters?

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #6 on: July 02, 2021, 12:32:06 PM »
Did you use my modified code for firedangerWD.php?
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #7 on: July 02, 2021, 12:54:47 PM »
Yes, I did see that. Attached find my ajaxWDwx3.js and firedangerWD.php

(added the file extension type of .txt so I could post)

And here is the code to display it:

<tr>
                <td colspan ="2" style="text-align: center;">
          <a class="hvr-glow hvr-grow" title="Jalisco Wildfire Danger">
                    <span class="ajax" id="ajaxfdimg"><img src="firedangerWD.php" height="135" width="170" alt=""/></span></a>
                  </td>
 </tr>
« Last Edit: July 02, 2021, 12:58:29 PM by mexbound »

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #8 on: July 02, 2021, 03:29:19 PM »
I think I found the problem. At least it's not displaying the weird characters anymore. In firedangerWD.php here is the line of code I changed:

$degree_units = (($uom == 'E')?'�F':'�C');

changed to:

$degree_units = (($uom == 'E')?'F':'C');

I'm not sure how that line got those extra weird chars added ...

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #9 on: July 02, 2021, 03:33:29 PM »
I'm not sure where the strange symbols came from either.  Glad you solved the problem.  Now watch to be sure that while the ajax updates are active the Fire Danger values change as well when necessary.

It has been years since I've played around with this code, so kudos on getting it up and running! [tup] [tup] [tup]
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #10 on: July 02, 2021, 05:11:52 PM »
Hey Jerry,

I also noticed on your site that when my mouse hovers over a "picture" it grows a bit. Like your 2 hour lightning and sunpie chart. How did you achieve this?

Darryl

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #11 on: July 02, 2021, 05:29:07 PM »
If you read the text on my Scripts Page you'll see the 'CSS Hover Style' which is downloadable as a zip.  Implementation is fairly straightforward as you can see in my ajax-dashboard6.php script.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #12 on: July 02, 2021, 08:01:29 PM »
Hi Jerry,

Yes, I read that text and placed the three css files in a subdirectory from my root named /css .
hover.css
hover-min.css
hover-tiny.css

In my ajax-dashboard6.php I have some code for my Lake Cam but I don't get the effects of growing when hovering over the image with the mouse.

<tr>
    <td align="center" colspan="3" valign="bottom">
    <a class="hvr-glow hvr-grow" href="<?php echo $spc_url?>" title="<?php langtrans('Click to see enlarged Image and Timelapse Videos'); ?>")>
    <img src="<?php echo getUniqueImageURL($spc_img)?>" alt="Lake Chapala Webcam Unavailable" style=" margin-top:9px;
           height:205px;width:265px;border:1px solid gray" /></a>
    </td>
</tr>

It's like it isn't finding the "class="

I also have it on the firedanger image:
<tr>
      <td colspan ="2" style="text-align: center;">
           <a class="hvr-glow hvr-grow" title="Jalisco Wildfire Danger">
                  <span class="ajax" id="ajaxfdimg"><img src="firedangerWD.php" height="135" width="170" alt=""/></span></a>
          </td>
</tr>


Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #13 on: July 03, 2021, 06:43:10 AM »
Sorry for not being more straightforward about how to implement this style, Darryl. :oops:

This is at the top of my 'index.php', in context:
Code: [Select]
...
include("top.php");
############################################################################
?>
<script type="text/javascript" src="https://...(elided)..."></script>
<link href="css/hover-tiny.css" rel="stylesheet" media="all"/>
<style type="text/css">
...
You only need to add this line:
Code: [Select]
<link href="css/hover-tiny.css" rel="stylesheet" media="all"/>
My scripts page has also been modified to reference this thread as further instructions regarding 'hover.css'.
« Last Edit: July 03, 2021, 07:02:39 AM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #14 on: July 03, 2021, 08:16:02 AM »
Thanks Jerry, adding that line in my wxindex.php worked great.

One last question. Do you compress or "minify" any of your javascripts or css files? Is it necessary? I see my ajaxWDwx3.js is pretty big.

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #15 on: July 03, 2021, 10:19:34 AM »
I've attached the latest minified version of my 'ajaxWDwx3.js'.

Let me know if this misbehaves for you.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #16 on: July 03, 2021, 01:28:52 PM »
I have tried to download the compress ajaxWDwx3.js file you attached but having problems with windows defender and virus checkers. Maybe if you rename it to ajaxWDwx3.js.txt I'll have better luck. I'm pretty good with windows and know about these kind of issues but I can't get around this one.

I went ahead and tried "Google Closure Compiler" to compress my ajaxWDwx.js and it did a pretty good job. From 141k to 61k. Testing out the results now ...

https://closure-compiler.appspot.com/home

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #17 on: July 03, 2021, 01:57:58 PM »
Let's try this, then.

It looks like they're the same size.  The advantage of minifying an uncompressed ajaxWDwx.js file is that you can modify any settings according to your needs before compression.

BTW, I just downloaded the ZIP file successfully using the Brave browser.

And while looking for javascript minifiers I came across this unminifier:  https://unminify.com/  I tried it, and it seems to work well.
« Last Edit: July 03, 2021, 02:12:48 PM by gwwilk »
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: Trying to eliminate space in ajax-dashboard6.php
« Reply #18 on: July 03, 2021, 04:27:44 PM »
I was able to download your compressed ajaxWDwx3.js after you renamed it. I tested it but there is a problem with using your version. I have a setting in my ajaxWDwx3.js which points to my clientraw file which is in a different folder than yours:

My setting in ajaxWDwx3.js is: var clientrawFile = './WD_realtime/clientraw.txt';

Anyway no problem. I was just wondering if you did any compression for your site. Some do, some don't.

I will look into  the   https://unminify.com/ and see what i find.  I am using the google compressor I mentioned in a previous post and it seems to be working fine. I used the "simple" option instead of the "advanced" option as I read you must write your javascript specifically to use the advanced option.

 

anything