Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Move disclaimer content to template and make disclaimer configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
arrayjam committed Jul 10, 2015
1 parent 1ec984c commit 13015f6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
45 changes: 23 additions & 22 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var checkBrowserCompatibility = require('terriajs/lib/ViewModels/checkBrowserCom
checkBrowserCompatibility('ui');

var knockout = require('terriajs-cesium/Source/ThirdParty/knockout');
var defined = require('terriajs-cesium/Source/Core/defined');

var TerriaViewer = require('terriajs/lib/ViewModels/TerriaViewer');
var registerKnockoutBindings = require('terriajs/lib/Core/registerKnockoutBindings');
Expand Down Expand Up @@ -366,28 +367,28 @@ terria.start({
]
});

// Add the disclaimer
PopupMessageConfirmationViewModel.open(ui, {
title : 'Disclaimer',
horizontalPadding: 100,
width : 600,
height: 580,
confirmText: 'Confirm',
message : '<div>\
<p>The Australian Renewable Energy Mapping Infrastructure (AREMI) website implements a geospatial map viewer which is intended for viewing over the internet. The AREMI website is being developed by National ICT Australia Limited (NICTA) in collaboration with Geoscience Australia (GA) and with funding support from the Australian Renewable Energy Agency (ARENA). ARENA invests in renewable energy projects, supports research and development activities, boosts job creation and industry development, and increases knowledge about renewable energy. The AREMI website is an information service that is intended to be accessible to all interested external parties. The AREMI website provides access to renewable energy and general information which has been provided by various third party data custodians. As a condition of using this website, users should understand and must accept, that the information and data provided on the AREMI website:</p>\
<br/>\
<ul>\
<li>is entirely dependant on the accuracy of the information and data which has been provided by the third party data custodians;</li>\
<li>is not necessarily complete;</li>\
<li>sometimes is general in nature; and</li>\
<li>should not be relied on in place of independent research and professional advice, including in later stages of investment and planning processes.</li>\
</ul>\
<br/>\
<p>\
<strong>ARENA, NICTA and GA, do not warrant, and are not liable for the accuracy of the information and data on the AREMI website.</strong>\
</p>\
</div>'
});
// Add the disclaimer, if specified
if(defined(terria.configParameters.globalDisclaimer)) {
var disclaimer = terria.configParameters.globalDisclaimer;
if(defined(disclaimer.enabled) && disclaimer.enabled) {
var options = {
title: defined(disclaimer.title) ? disclaimer.title : 'Disclaimer',
width: 600,
height: 550,
message: require('fs').readFileSync(__dirname + '/lib/Views/GlobalDisclaimer.html', 'utf8'),
horizontalPadding : 100
};

if(defined(disclaimer.confirmationRequired) && disclaimer.confirmationRequired) {
// To account for confirmation buttons
options.height += 30;
PopupMessageConfirmationViewModel.open(ui, options);
} else if(!defined(disclaimer.confirmationRequired) ||
(defined(disclaimer.confirmationRequired) && !disclaimer.confirmationRequired)) {
PopupMessageViewModel.open(ui, options);
}
}
}

// Add the survey link
var surveyLink = 'https://docs.google.com/forms/d/1ZQkNgSWA2mmxlsEICxlm7cOhJ2xVxRGScsvJ83i0F3M/viewform';
Expand Down
12 changes: 12 additions & 0 deletions lib/Views/GlobalDisclaimer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<p>The Australian Renewable Energy Mapping Infrastructure (AREMI) website implements a geospatial map viewer which is intended for viewing over the internet. The AREMI website is being developed by National ICT Australia Limited (NICTA) in collaboration with Geoscience Australia (GA) and with funding support from the Australian Renewable Energy Agency (ARENA). ARENA invests in renewable energy projects, supports research and development activities, boosts job creation and industry development, and increases knowledge about renewable energy. The AREMI website is an information service that is intended to be accessible to all interested external parties. The AREMI website provides access to renewable energy and general information which has been provided by various third party data custodians. As a condition of using this website, users should understand and must accept, that the information and data provided on the AREMI website:</p>
<br/>
<ul>
<li>is entirely dependant on the accuracy of the information and data which has been provided by the third party data custodians;</li>
<li>is not necessarily complete;</li>
<li>sometimes is general in nature; and</li>
<li>should not be relied on in place of independent research and professional advice, including in later stages of investment and planning processes.</li>
</ul>
<br/>
<p><strong>ARENA, NICTA and GA, do not warrant, and are not liable for the accuracy of the information and data on the AREMI website.</strong></p>
</div>
5 changes: 5 additions & 0 deletions wwwroot/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"disclaimer": {
"text": "Disclaimer: AREMI must not be used for navigation or precise spatial analysis",
"url": "About.html"
},
"globalDisclaimer": {
"enabled": true,
"confirmationRequired": true,
"title": "Disclaimer"
}
}
}

0 comments on commit 13015f6

Please sign in to comment.