Commit b3f5df10 authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue21' into 'master'

Issue21 - Ensure cross compatibility with new features

See merge request !25
parents 8221e08a dc27a348
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,19 +3,15 @@
<head>
<meta charset="UTF-8">
<title>ESRF</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="/min/output.min.css" >
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<script src="src/beamlineUrl.js"></script>
<script src="src/doicontroller.js"></script>
<script src="src/doiview.js"></script>
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
......@@ -29,19 +25,14 @@
<script src="min/precompiled.templates.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var params = new URLSearchParams(document.location.search.substring(1));
var doi;
if (params.get("DOI")){
doi = params.get("DOI");
}
else{
doi = document.location.pathname.substring(1,document.location.pathname.length )
$(document).ready(function() {
var doi = document.location.search.substring(5);
if (doi==="") {
alert ("Please use dev.html page as follow .../dev.html?DOI=prefix/suffix");
} else {
new DOIController(new DOIView()).getData(doi);
}
new DOIController(new DOIView()).getData(doi);
});
});
</script>
</head>
<body>
......
......@@ -3,17 +3,13 @@
<head>
<meta charset="UTF-8">
<title>ESRF</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link rel="stylesheet" href="/min/output.min.css" >
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<!-- include: "type": "js", "files": "src/*.js" -->
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<!-- endbower -->
......@@ -22,19 +18,14 @@
<!-- include: "type": "js", "files": "min/precompiled.templates.min.js" -->
<script type="text/javascript">
$(document).ready(function() {
var params = new URLSearchParams(document.location.search.substring(1));
var doi;
if (params.get("DOI")){
doi = params.get("DOI");
}
else{
doi = document.location.pathname.substring(1,document.location.pathname.length )
$(document).ready(function() {
var doi = document.location.search.substring(5);
if (doi==="") {
alert ("Please use dev.html page as follow .../dev.html?DOI=prefix/suffix");
} else {
new DOIController(new DOIView()).getData(doi);
}
new DOIController(new DOIView()).getData(doi);
});
});
</script>
</head>
<body>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
var BEAMLINEURL = [
{
"name" : "BM05",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/UsersAndScience/Experiments/XNP/BM05"
},
{
"name" : "BM29",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/BM29"
},
{
"name" : "CM01",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/CM01.html"
},
{
"name" : "ID01",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID01"
},
{
"name" : "ID06",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/home/UsersAndScience/Experiments/MEx/id06-large-volume-press.html"
},
{
"name" : "ID11",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/UsersAndScience/Experiments/StructMaterials/ID11"
},
{
"name" : "ID16A",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16A"
},
{
"name" : "ID16B",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/UsersAndScience/Experiments/XNP/ID16B"
},
{
"name" : "ID17",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/UsersAndScience/Experiments/CBS/ID17"
},
{
"name" : "ID19",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.fr/home/UsersAndScience/Experiments/StructMaterials/ID19.html"
},
{
"name" : "ID21",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/UsersAndScience/Experiments/XNP/ID21"
},
{
"name" : "ID22",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/id22"
},
{
"name" : "ID23-1",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-1"
},
{
"name" : "ID23-2",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/UsersAndScience/Experiments/MX/About_our_beamlines/ID23-2"
},
{
"name" : "ID29",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/home/UsersAndScience/Experiments/Beamlines/content/content/id29.html"
},
{
"name" : "ID30A1",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/MASSIF1"
},
{
"name" : "ID30A3",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/home/UsersAndScience/Experiments/MX/About_our_beamlines/id30a-3--massif-3.html"
},
{
"name" : "ID30B",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/id30b"
},
{
"name" : "ID32",
"startDate" : "01 01 2000 00:00 +0000",
"endDate" : "01 12 2100 00:00 +0000",
"startDate" : "2000-01-01T00:00+00:00",
"endDate" : "2100-12-31T00:00+00:00",
"url" : "http://www.esrf.eu/ID32"
}
];
\ No newline at end of file
......@@ -35,7 +35,7 @@ DOIController.prototype.getData = function(doi) {
// Retrieve the URL corresponding to the beamline name. Currently, the date of the
// experiment is calculated from the publicationYear.
var experimentalYear = doiData.issued["date-parts"] - 3 ;
var experimentalDate = new Date(experimentalYear + " 01 01 00:00 +0000");
var experimentalDate = new Date(experimentalYear + "-01-01T00:00+00:00");
doiData.beamlineUrl = _this.findsUrl(doiData.beamline, experimentalDate);
// send to dust render
......
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<form class="needs-validation" novalidate>
<div class="form-row">
<div class="col-md-4 mb-3">
<label for="validationCustom01">First name</label>
<input type="text" class="form-control" id="validationCustom01" placeholder="First name" value="Mark" required>
<div class="valid-feedback">
Looks good!
</div>
</div>
<div class="col-md-4 mb-3">
<label for="validationCustom02">Last name</label>
<input type="text" class="form-control" id="validationCustom02" placeholder="Last name" value="Otto" required>
<div class="valid-feedback">
Looks good!
</div>
</div>
<div class="col-md-4 mb-3">
<label for="validationCustomUsername">Username</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroupPrepend">@</span>
</div>
<input type="text" class="form-control" id="validationCustomUsername" placeholder="Username" aria-describedby="inputGroupPrepend" required>
<div class="invalid-feedback">
Please choose a username.
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="col-md-6 mb-3">
<label for="validationCustom03">City</label>
<input type="text" class="form-control" id="validationCustom03" placeholder="City" required>
<div class="text-danger">
Please provide a valid city.
</div>
</div>
<div class="col-md-3 mb-3">
<label for="validationCustom04">State</label>
<input type="text" class="form-control" id="validationCustom04" placeholder="State" required>
<div class="invalid-feedback">
Please provide a valid state.
</div>
</div>
<div class="col-md-3 mb-3">
<label for="validationCustom05">Zip</label>
<input type="text" class="form-control" id="validationCustom05" placeholder="Zip" required>
<div class="invalid-feedback">
Please provide a valid zip.
</div>
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="invalidCheck" required>
<label class="form-check-label" for="invalidCheck">
Agree to terms and conditions
</label>
<div class="invalid-feedback">
You must agree before submitting.
</div>
</div>
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form>
<script>
// Example starter JavaScript for disabling form submissions if there are invalid fields
(function() {
'use strict';
window.addEventListener('load', function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation');
// Loop over them and prevent submission
var validation = Array.prototype.filter.call(forms, function(form) {
form.addEventListener('submit', function(event) {
if (form.checkValidity() === false) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
}, false);
})();
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment