Commit aa589a3d authored by Maxime Chaillet's avatar Maxime Chaillet

Merge branch 'issue66' into 'master'

Issue66

Closes #66

See merge request !76
parents ed833524 8cd378cc
Pipeline #8677 passed with stages
in 1 minute and 56 seconds
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="UTF-8">
<title> ESRF - DOI </title>
<link rel="icon" href="/src/images/favicon.ico">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/dustjs-linkedin/dist/dust-full.min.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/dustjs-helpers/dist/dust-helpers.min.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/moment/moment.js"></script>
<!-- endbower -->
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below -->
<script src="src/author.js"></script>
<script src="src/beamlineurl.js"></script>
<script src="src/citation.js"></script>
<script src="src/constants.js"></script>
<script src="src/doicontroller.js"></script>
<script src="src/doiData.js"></script>
<script src="src/doiview.js"></script>
<script src="src/ESRF-DC-142893590.js"></script>
<script src="src/ESRF-DC-142915526.js"></script>
<script src="src/event.js"></script>
<script src="src/experimentalreportcontroller.js"></script>
<script src="src/jsonextractor.js"></script>
<script src="src/metadataTableHelper.js"></script>
<head> <!-- bower:css -->
<meta charset="UTF-8"> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<title> ESRF - DOI </title> <!-- endbower -->
<link rel="icon" href="/src/images/favicon.ico">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> <!-- Using grunt-include-source, the proper all dustjs templates files (not minified are included below -->
<script src="min/precompiled.templates.min.js"></script>
<!-- Using grunt-wiredep, the proper js files from bower components are included below -->
<!-- bower:js --> <link rel="stylesheet" href="/min/output.min.css" >
<script src="bower_components/jquery/dist/jquery.js"></script> <script type="text/javascript">
<script src="bower_components/dustjs-linkedin/dist/dust-full.min.js"></script> $(document).ready(function() {
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script> var doi = document.location.search.substring(5);
<script src="bower_components/dustjs-helpers/dist/dust-helpers.min.js"></script> if (doi==="") {
<script src="bower_components/lodash/lodash.js"></script> alert ("Please use dev.html page as follow .../dev.html?DOI=prefix/suffix");
<script src="bower_components/moment/moment.js"></script> } else {
<!-- endbower --> new DOIController(new DOIView()).getData(doi);
}
<!-- Using grunt-include-source, the proper js files created by us (not minified) are included below --> });
<script src="src/author.js"></script> </script>
<script src="src/beamlineurl.js"></script> </head>
<script src="src/citation.js"></script> <body>
<script src="src/constants.js"></script> <div class="container-fluid">
<script src="src/doicontroller.js"></script> <div class="row align-items-center blueBackground">
<script src="src/doiData.js"></script> <div class="col-12 col-sm-4" > <img id="logo" style="height:80px;" src="/src/images/esrflogo.png" alt="the ESRF logo"> </img> </div>
<script src="src/doiview.js"></script>
<script src="src/ESRF-DC-142893590.js"></script>
<script src="src/ESRF-DC-142915526.js"></script>
<script src="src/event.js"></script>
<script src="src/experimentalreportcontroller.js"></script>
<script src="src/jsonextractor.js"></script>
<script src="src/metadataTableHelper.js"></script>
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css" />
<!-- endbower -->
<!-- Using grunt-include-source, the proper all dustjs templates files (not minified are included below -->
<script src="min/precompiled.templates.min.js"></script>
<link rel="stylesheet" href="/min/output.min.css">
<script type="text/javascript">
$(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);
}
});
</script>
</head>
<body>
<div class="container-fluid">
<div class="row align-items-center blueBackground">
<div class="col-12 col-sm-4"> <img id="logo" style="height:80px;" src="/src/images/esrflogo.png" alt="the ESRF logo">
</img> </div>
<div class="col"> </div> <div class="col"> </div>
<div class="col-auto"> <div class="col-auto">
<div class="whiteFont font-3p2rem" id="doiValue"> <div class="whiteFont font-3p2rem" id="doiValue">
<!-- filled by the js code --> <!-- filled by the js code -->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div id="main"></div> <div id="main"></div>
<div id='error'></div> <div id='error' ></div>
<div class="modal"> <div class="modal">
<!-- nothing to write here --> <!-- nothing to write here -->
</div> </div>
<footer class="footer"> <footer class="footer">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-12 col-md-5"> <div class="col-12 col-md-5" >
<p><a style='font-weight:bold;' href="http://www.esrf.eu">European Synchrotron Radiation Facility</a></p> <p><a style='font-weight:bold;' href="http://www.esrf.eu">European Synchrotron Radiation Facility</a></p>
</div> </div>
<div class="col-12 col-md-2"> <div class="col-12 col-md-2" >
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" <a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a>
style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a> </div>
</div> <div class="col-12 col-md-5">
<div class="col-12 col-md-5"> <p class="float-right" style="font-size:12px;display:block;" > Access to data is governed by the <a href="http://www.esrf.eu/files/live/sites/www/files/about/organisation/ESRF%20data%20policy-web.pdf" target="_blank">ESRF data policy</a>.</p>
<p class="float-right" style="font-size:12px;display:block;"> Access to data is governed by the <a </div>
href="http://www.esrf.eu/files/live/sites/www/files/about/organisation/ESRF%20data%20policy-web.pdf"
target="_blank">ESRF data policy</a>.</p>
</div>
</div> </div>
</div> </div>
</footer> </footer>
</body> </body>
</html>
</html>
\ No newline at end of file
This diff is collapsed.
...@@ -173,11 +173,19 @@ DOIController.prototype.getDataForGoogleSearch = function (doi) { ...@@ -173,11 +173,19 @@ DOIController.prototype.getDataForGoogleSearch = function (doi) {
type: "GET", type: "GET",
timeout: 15000, timeout: 15000,
url: 'https://data.datacite.org/' + doi, url: 'https://data.datacite.org/' + doi,
dataType: 'text', // don't convert JSON to Javascript object //dataType: 'text', // don't convert JSON to Javascript object
success: function (data) { success: function (data) {
if (data) { if (data) {
_this.view.addDOIMetadataToHead(data); // Here we add the documentation field in the recieved object because 'name' and 'documentation' fileds are required by google dataset search.
} else{ if (data.name) {
if (!data.documentation) {
data.documentation = data.name;
}
_this.view.addDOIMetadataToHead(JSON.stringify(data));
} else {
console.log("[GOOGLE SEARCH INDEXING] - The data required by Google is missing the 'name' field. This is required by Google for indexing.");
}
} else {
console.log("[GOOGLE SEARCH INDEXING] - No metadata recieved from datacite."); console.log("[GOOGLE SEARCH INDEXING] - No metadata recieved from datacite.");
} }
}, },
......
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