This is an old revision of the document!
Table of Contents
Configuring the site
Like all previous versions of the 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. This object is stored locally on your machine as 'SessionStorage' so is only stored for the current browsing session and 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 used to configure the page. If it does not not then it is created.
Below is an explanation of all entries.
Charts
This is used dynamically by the site to record the last chart viewed. When you return to a charts page it displays same chart.
Records
Again this is dynamically changed by the website based on the last set of records you viewed.
Custom
Only applies to the latest version.
This area is used to configure user settings. This is covered in detail in the wiki:aw:cmxConfig
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.
Menu
Theis should be used to point to the javascript manu file used to drive all the menus on the site. Its default value is js/ows-menu.js. More details can be found on the page Creating your own menu.
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.
The Gull
As in the AI, the seagull can be animated. The default animation is for it to fade in slowly over 5/10 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. Other keyframe animations are provided with a prefix gull.
Other entries are covered in the page devoted to wiki:aw:cmxConfig
The cmxConfig object
cmxConfig = { Charts: { Trends: '', Historic: '', }, Custom: { StandardMenu: false, Dropdown: true, Theme: '', Logo: '', BannerImage: '', StaticHead: true, StaticFoot: true, PaddingTop: '2', PaddingBottom: '1', PaddingUnits: 'em', }, Data: '', Menu: 'js/ows-menu.js', NOAAReportPath: 'Reports/', Gull: { Animation: '', Speed: 10, OnTop: false, }, Records: { All: '', Monthly: '', } };
The remaining entries
As stated above, the sections Charts and Records are dynamic; they are set when visitors select specific charts or record sets. They relate to the charts - Trends and Historic, and Records - Monthly and All Records.
If you set them in cmxConfig then the chart you set will be the one visitors see first. Valid entries are:
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 pre-set: use 1 to 11 for months and Alltime, ThisYear and ThisMonth for others.
Dynamic Configuring
In previous versions I included a command in page-manager.js to clear the sessionStorage on every page load. I have not included this in this version although it is still a valid command.2)
My preferred method is to use the Developer Tools available in most browsers and to edit the sessionStorage variable directly. For my Alternative Public Website the variable always ends: cmxConfig. You should be able to edit the Values directly and see the effect simply by refreshing the page.
If this is not possible, for whatever reason, simply close the browser and reload the page. The session variable will have been deleted and whatever you have stored in the page-control.js cmxConfig variable will be used.
