Page 1 of 1

Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 10:19 am
by sfws
This is just a warning, after I tried to change the solar table on the today and yesterday page in the MX interface. The contents of the tables in the todayyest.html file will be seen as you first load the file, but the ajax routines quickly replaces whole tables to change their content. So there is absolutely no point in editing the HTML, other than to change the order of complete tables. Do not bother to edit what on that web page source file is within any table (to add, relabel, or remove, items).

Have a look at the tempTable below, It mentions High Temperature, but it does not mention Low Temperature yet both are being updated while you view the page. It includes two fixed times(23:10 and 15:10) but you don't see those fixed times on the page in the interface. In other words, ignore the structure within the <table> and </table> tags, it is overwritten by the Javascript.

In the HTML file

Code: Select all

<table id="TempTable" style="width:100%">
                        <thead>
                            <tr>
                                <th>&nbsp;Temperature</th>
                                <th></th>
                                <th></th>
                                <th></th>
                                <th></th>
                            </tr>
                            <tr>
                                <th>&nbsp;</th>
                                <th colspan="2">Today</th>
                                <th colspan="2">Yesterday</th>
                            </tr>
                        </thead>
                        <tr>
                            <td>High Temperature</td>
                            <td><span id="OutdoorTemp">--</span>&nbsp;<span class="TempUnit">--</span></td>
                            <td>23:10</td>
                            <td><span id="OutdoorTemp">--</span>&nbsp;<span class="TempUnit">--</span></td>
                            <td>15:10</td>
                        </tr>
                        <tr>
                            <td>Dew Point</td>
                            <td><span id="OutdoorDewpoint">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                        <tr>
                            <td>Wind Chill</td>
                            <td><span id="WindChill">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                        <tr>
                            <td>Apparent Temperature</td>
                            <td><span id="AppTemp">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                        <tr>
                            <td>Heat Index</td>
                            <td><span id="HeatIndex">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                        <tr>
                            <td>Humidex</td>
                            <td><span id="Humidex">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                        <tr>
                            <td>Indoor Temperature</td>
                            <td><span id="IndoorTemp">--</span></td>
                            <td><span class="TempUnit">--</span></td>
                        </tr>
                    </table>
The corresponding\CumulusMX\interface\js\todayyest.js file

Code: Select all

var tempTable = $('#TempTable').DataTable({
        "paging": false,
        "searching": false,
        "info": false,
        "ordering": false,
        "ajax": '../api/todayyest/temp.json'
    });
I don't know where the api json mentioned is, but it would be there that you would edit (if for example you wanted to show UV or did not want to see high and Low Apparent Temp).

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 10:36 am
by water01
I am sorry but I have to disagree. I have edited mine to remove the Solar parts and it worked fine.

Image

Not sure why your edits are not working but it maybe the same reason some of your Settings drop down items are not working?

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 11:15 am
by mcrossley
The content of the tables is dynamically created from the downloaded data, so any changes you make to them will be lost - you need to fix the source data.

However, if you remove the table completely from the HTML it will not be created.

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 11:29 am
by water01
The JSON files can also be looked at in the browser. If you hit F12 and make sure that Network is selected and refresh the screen you will see the json files loaded at the end of the list. In Firefox if you double click on the json line it opens a property window where it shows you the URL of json file created by the CumulusMX engine.
If you cut and paste that URL into separate tab/window this is what you get (temp as an example).
Image

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 12:33 pm
by sfws
mcrossley wrote: Mon 23 Mar 2020 11:15 am The content of the tables is dynamically created
That is a neater way of describing it, although perhaps too technical for a few readers.

If I was developer, I would probably have just one row per table, and all table cells in the HTML empty, knowing that they would be replaced, particularly as number of cells by row, and number of rows both vary after dynamic creation.
water01 wrote: Mon 23 Mar 2020 10:36 am I have edited mine to remove the Solar parts and it worked fine
I did not say you could not remove a table, I said I could not edit the solar table to add UV, there is a difference.

I cannot see any image in your post, just the word image, your image has not been uploaded correctly.

The basic message remains true - that you cannot edit the table contents by changing the HTML file. I believe it a valid message to have in this forum where some readers are not as technically knowledgeable as others.

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 12:56 pm
by water01
I cannot see any image in your post, just the word image, your image has not been uploaded correctly.
I suspect this is either a setting in your browser stopping images loading or a slow internet connection as the image was not loaded on Cumulus Support Forum but hosted on my server here http://www.dmjsystems.co.uk/djweather/tempjson.png

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 2:21 pm
by freddie
water01 wrote: Mon 23 Mar 2020 12:56 pm I suspect this is [...] a setting in your browser stopping images loading
No, it's a phpBB setting. If you want to include an image you need to upload it.

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 3:30 pm
by water01
Surely not if you include it in img delimiters, that is how the banners work and also I can see the images in the post?

Re: Don't try to change "todayyest.html"

Posted: Mon 23 Mar 2020 3:40 pm
by mcrossley
I see the image too?

Re: Don't try to change "todayyest.html"

Posted: Tue 24 Mar 2020 12:22 am
by jimi
I can see the image as well, as below

Image

It is possible to disable the use of IMG tags globally in phpBB, it's default setting is "allowed" but it can be disabled in the ACP, via Permissions, IIRC

Re: Don't try to change "todayyest.html"

Posted: Tue 24 Mar 2020 2:41 am
by jimi
Might be worth checking in your UCP on the "Board preferences/Edit display options" tab that the option to display images in posts is set to Yes.

EDIT
UCP = phpBB User Control Panel

Re: Don't try to change "todayyest.html"

Posted: Tue 24 Mar 2020 5:10 am
by freddie
water01 wrote: Mon 23 Mar 2020 3:30 pm Surely not if you include it in img delimiters, that is how the banners work and also I can see the images in the post?
mcrossley wrote: Mon 23 Mar 2020 3:40 pm I see the image too?
I was wrong. It was the avatars only that I prevent remote linking to. Images in posts are okay as it is easy to edit a post with a dead link. Apologies for misleading :D

Re: Don't try to change "todayyest.html"

Posted: Tue 24 Mar 2020 5:14 am
by freddie
jimi wrote: Tue 24 Mar 2020 2:41 am Might be worth checking in your UCP on the "Board preferences/Edit display options" tab that the option to display images in posts is set to Yes.

EDIT
UCP = phpBB User Control Panel
NSS :lol:

Re: Don't try to change "todayyest.html"

Posted: Tue 24 Mar 2020 8:31 pm
by jimi
freddie wrote: Tue 24 Mar 2020 5:14 am
jimi wrote: Tue 24 Mar 2020 2:41 am Might be worth checking in your UCP on the "Board preferences/Edit display options" tab that the option to display images in posts is set to Yes.

EDIT
UCP = phpBB User Control Panel
NSS :lol:
Wasn't intended for you, I never doubted you knew what it meant, which is why I didn't explain ACP In my previous post ;) However many users have no idea about the UCP and the settings in it 8-)