User Tools

Site Tools


wiki:aw:configure

This is an old revision of the document!


Configuring the site

Unlike all previous versions of the default and alternative website, all settings are now held in one place - the CMXConfig object held in the page-manager.js file.

This object holds the location of the menu to use, the location of your data, the path and name of your menu, the location of your NOAA Reports and other features that the website uses. Data is only stored for the current browsing session so will not be retained once the browser is closed.

Information

Before any page is fully loaded your browsers current Session Storage is checked to see if a copy of the CMXConfig object already exists, if it does, it is loaded into memory.

If it does not then it is created. This enables every page to have access to values stored in it. Below is an explanation of all entries.

Data

This points to the location of your .json data files1) uploaded by CumulusMX. The default location is the same as the pages. If you want to upload you data to a different location then use this entry to point to it.

The menu used by the default website is created from a .json formatted file. This entry points to the supplied menu file.

If you want to create your own menu, then make a copy of the supplied one and make sure this entry points to your intended new menu. Please note that the menu structure has been extended and you should view Editing the Menu page for guidance.

NOAA Reports

If you publish NOAA reports from CumulusMX, this entry should point to the folder containing them. The default is 'Reports/' which is a sub-folder of the main upload folder.

Theme

The default website comes with a new set of colour themes. This entry enables you to choose one of these or to point to one you have created. Please view the Themes page for more information.

The CMXConfig object

CMXConfig = {
    'Data': '',
    'Menu': 'js/aw-menu.js',
    'NOAAReportPath': 'Reports/',
    'Theme': '',
    'StaticHead': true,
    'StaticFoot': true,
    'paddingTop': 2,
    'paddingBottom': 1,
    'paddingUnits': 'em',
    'Seagull': {
        'Animation': '',
        'Speed': 5,
        'OnTop': false
    },
    'Charts':{
        'Trends': '',
        'Historic':''
    },
    'Records':{
        'All':'',
        'Monthly':''
    }
}

The Seagull

As in the AI, the seagull can be animated. The default animation is for it to fade in slowly over 5 seconds but by changing the 'Speed' value you can slow this down or speed it up. Setting the speed to zero effectively stops the animation and the seagull will appear instantly. Some of the other provided keyframe animation will also work and you are free to develop your own.

StaticHead, StaticFoot, paddingTop, paddingBottom and paddingUnits

Along with changing the colour theme, you can also modify the header and footer to make them scroll with the page and change the gap between them and the main page content. The next 5 entries control this and work in the same way as the Alternative Interface.


The remaining entries

At the end of the CMXConfig object there are two more groups of settings. These are used by, and change while a visitor is browsing your website. They relate to the charts - Trends and Historic, and Records - Monthly and All Records.

They store the last chart or the last record set viewed in both cases. This enables visitors to jump from page to page but still return to the last chart or record set that they were viewing. Note this only occurs in the current browsing session - these settings are lost when they close their browser window on your site.

Bonus Feature

One bonus of the above is that you can set the default chart or record set viewed when a visitor initially views your site by entering the chart or record set ID on lines 44, 45 and 48 or 49. Valid IDs are as shown below:

Trends: 'temp', 'dailytemp', 'press', 'wind', 'windDir', 'rain', 'dailyrain', 'humidity', 'solar', 'sunhours', 'airquality', 'extratemp', 'extrahum', 'extradew', 'soiltemp', 'soilmoist', 'leafwet', 'usertemp' or 'co2'.

Historic: 'Temp', 'Press', 'Wind', 'Humidity', 'Rain', 'Solar', 'DegDays', 'TempSum', 'ChillHrs' or 'Snow'.

Of course, if your system does not generate a chart it is pointless to force it to display by default. However, the site will gracefully inform the user that no data has been found.

As the Records pages already select the most appropriate record set, I have not included the options for these but there is no reason why they cannot be used.

In order to make the changes you make active for you without having to start a new browser session, you can uncomment line 14 -

//sessionStorage.clear()

This will force the browser to store a new CMXConfig object when you refresh a page or view a new one. Do remember to comment it again afterwards otherwise the Charts & Records feature won't work for visitors.

This page has been accessed: total times.

1)
and the realtimegauges.txt file
wiki/aw/configure.1746965959.txt.gz · Last modified: by Neil