Commit 1eebe12f authored by Olivier Lezoray's avatar Olivier Lezoray 🇫🇷
Browse files

Initial commit

parents
@CHARSET "UTF-8";
body {
font-size:14px;
color:#777;
-webkit-font-smoothing:antialiased;
margin-top:79px;
line-height:1.80em;
margin-top:79px;
font-family: 'Open Sans', sans-serif;
}
.whites {
background:#fff;
padding:20px 20px;
}
#publications * {
font-size: 10pt;
font-family: Arial, Helvetica, sans-serif;
}
.logoHAL {
background: url("../img/hal_header.bg.jpg") center center repeat-x;
height: 125px;
color:silver;
}
label
{
display: block;
width: 250px;
float: left;
}
.logoHAL img {
margin-left: 20px;
margin-top: 20px;
}
.pull-left {
float: left !important;
}
.media,
.media-body {
overflow: hidden;
zoom: 1;
}
.media {
margin-top: 15px;
margin-bottom: 15px;
border-top: thin solid rgb(128,128,128);
}
.media:first-child {
margin-top: 0;
}
.media-object {
display: block;
}
.media-heading {
margin: 0 0 5px;
}
.media > .pull-left {
margin-right: 10px;
}
.media > .pull-right {
margin-left: 10px;
}
.media-list {
padding-left: 0;
list-style: none;
}
.headerHAL > select {
color:black;
}
This diff is collapsed.
This diff is collapsed.
//search a structure : https://api.archives-ouvertes.fr/ref/structure/?q=GREYC
//search an author : https://api.archives-ouvertes.fr/ref/author/?q=lézoray
//fields for search : https://api.archives-ouvertes.fr/docs/search/schema/fields/#fields
//https://www.ccsd.cnrs.fr/2015/04/produire-la-liste-des-publications-pour-un-laboratoire-une-collection-un-portail/
function generateYears(deb,fin,theid){
var i;
var actualYear=new Date();
actualYear=actualYear.getYear()+1900;
var option = $('<option/>');
option.attr({ "value": "None" }).text("Aucune année");
$("#"+theid).append(option);
for(i=fin;i>=deb;i--) {
var option = $('<option/>');
option.attr({ 'value': i }).text(i);
$("#"+theid).append(option);
}
}
function generateDocTypes(theid){
var res="";
var typesCODES=new Array("None","ART","COMM","COUV","OTHER","OUV","DOUV","PATENT","POSTER","UNDEFINED","REPORT","THESE","HDR","LECTURE");
var typesDESCR=new Array("Selectionnez un type de document","Article dans des revues","Communication dans un congrès",
"Chapitre d'ouvrage","Autre publication","Ouvrage (y compris édition critique et traduction)",
"Direction d'ouvrage, Proceedings","Brevet","Poster",
"Pré-publication, Document de travail","Rapport",
"Thèse","HDR","Cours");
var i;
for(i=0;i<typesCODES.length;i++) {
var option = $('<option/>');
option.attr({ 'value': typesCODES[i] }).text(typesDESCR[i]);
$("#"+theid).append(option);
}
}
function getDocuments(displayid,idHal,firstName,lastName,lab,selectedDocType,selectedYear){
var criteria="authFullName_t:"+firstName+"+"+lastName+" and labStructId_i:"+lab+" and docType_s:"+selectedDocType;
//var criteria="authIdHal_s:"+idHal+" and labStructId_i:"+lab+" and docType_s:"+selectedDocType;
if(selectedYear != undefined) criteria+=" and producedDateY_i:"+selectedYear;
var fields="label_s,thumbId_i,uri_s,docid,authFullName_s,title_s,doiId_s,producedDateY_i";
if(selectedDocType=="ART") fields+=",journalTitle_s,volume_s,number_s,page_s";
if(selectedDocType=="COMM") fields+=",conferenceTitle_s,page_s,city_s,country_t";
if(selectedDocType=="COUV") fields+=",scientificEditor_s,publisher_s,bookTitle_s,page_s";
if(selectedDocType=="OUV") fields+=",publisher_s";
$.get("https://api.archives-ouvertes.fr/search/",
{q:criteria,
fl:fields,
sort:"producedDateY_i desc",
wt:"json",
rows:500},
function(result){
var docs = result.response.docs;
var output="";
if(docs.length>0) {
output+="<h1>"+docs.length+" Document";
if(docs.length>1) output+="s";
output+= "</h1>";
}
else output+="<h1> Aucun Document </h1>";
for(var i=0;i<docs.length;i++){
output+="<div class=\"media\"><br>";
output+="<a target=\"_blank\" class=\"pull-left\" href=\""+docs[i].uri_s+"\">";
output+="<img style=\"width:50px;\" src=\"https://thumb.ccsd.cnrs.fr/"+docs[i].thumbId_i+"/thumb\"/><br/>";
output+="hal-"+docs[i].docid+"</a>";
output+="<div class=\"media-body\">";
authors=docs[i].authFullName_s;
for(var j=0;j<authors.length;j++){
output+=authors[j];
if(j<(authors.length-1)) output+=", ";
else output+="<br/>";
}
output+="<b>"+docs[i].title_s[0]+"</b><br/>";
output+="<i>";
if(selectedDocType=="ART") {
if(docs[i].journalTitle_s) output+=docs[i].journalTitle_s+", ";
if(docs[i].volume_s) output+="Vol. "+docs[i].volume_s+", ";
if(docs[i].number_s) output+="N°. "+docs[i].number_s+", ";
if(docs[i].page_s) output+="pp. "+docs[i].page_s+", ";
}
else if(selectedDocType=="COMM"){
output+=docs[i].conferenceTitle_s+", ";
if(docs[i].page_s) output+="pp. "+docs[i].page_s+", ";
if(docs[i].city_s) output+=docs[i].city_s+", ";
if(docs[i].country_t) output+=docs[i].country_t+", ";
}
else if(selectedDocType=="COUV"){
//output+=docs[i].label_s+", ";
output+=docs[i].scientificEditor_s+", ";
output+=docs[i].bookTitle_s+", ";
output+=docs[i].publisher_s+", ";
if(docs[i].page_s) output+="pp. "+docs[i].page_s+", ";
}
else if(selectedDocType=="OUV"){
output+=docs[i].publisher_s+", ";
}
output+=docs[i].producedDateY_i+".";
output+="</i><br/>";
if(docs[i].doiId_s){
output+="<a target=\"_blank\" href=\"http://dx.doi.org/"+docs[i].doiId_s+"\">";
output+="&lt;"+docs[i].doiId_s+"&gt;</a>";
}
output+="</div>";
output+="</div>";
}
$("#"+displayid).html(output);
},
"json"
);
}
function yearChange(){
var selectedYear=$("#yearSelect").val();
var selectedDocType=$("#documentTypeSelect").val();
if(selectedYear=="None") {
getDocuments("publications",idHal,firstName,lastName,lab,selectedDocType);
}
else {
getDocuments("publications",idHal,firstName,lastName,lab,selectedDocType,selectedYear);
}
}
function typeChange(){
lastName=$("#lastName").val();
firstName=$("#firstName").val();
var selectedDocType=$("#documentTypeSelect").val();
if(selectedDocType=="None" || (lastName=="")) {
$("#publications").html("");
$("#yearSelect").hide();
$("#yearSelectLabel").hide();
}
else {
if($("#yearSelect").is(":visible")){
var selectedYear=$("#yearSelect").val();
if(selectedYear=="None") {
getDocuments("publications",idHal,firstName,lastName,lab,selectedDocType);
}
else getDocuments("publications",idHal,firstName,lastName,lab,selectedDocType,selectedYear);
}
else {
getDocuments("publications",idHal,firstName,lastName,lab,selectedDocType);
$("#yearSelect").show();
$("#yearSelectLabel").show();
}
}
}
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/Hal.js"></script>
<link rel='stylesheet' href='css/bootstrap.min.css' type='text/css' media='all' />
<link rel="stylesheet" type="text/css" media="all" href="css/Hal.css">
</head>
<body>
<script type="text/javascript">
//DOC API à https://api.archives-ouvertes.fr/docs/search/
$(document).ready(function(){
$("#yearSelect").hide();
$("#yearSelectLabel").hide();
lastName="Lézoray";
firstName="Olivier";
idHal="olivier-lezoray";
lab="150";
var now = new Date();
var annee = now.getFullYear();
generateDocTypes("documentTypeSelect");
generateYears(1995,annee,"yearSelect");
});
$(document).ajaxStart(function(){
$("#publications").html("<p style='text-align:center'>Interrogation de HAL en cours, patientez<br><img src='img/loading.gif' /></p>");
});
</script>
<div>
<section class="introblock whites">
<div class="row logoHAL">
<a href="https://hal.archives-ouvertes.fr" border="0" onclick="window.open(this.href); return false;" >
<img src="img/hal.logo.png"></a>
</div>
<div class="row">
<div class="col-md-7 left">
<label for="documentTypeSelect">Choisissez le type de document :</label>
<select id="documentTypeSelect" onchange="typeChange();">
</select>
</div>
</div>
<div class="row">
<div class="col-md-5 right">
<label id="yearSelectLabel" for="yearSelect">Choisissez une année :</label>
<select id="yearSelect" onchange="yearChange();">
</select>
</div>
</div>
<div id="publications">
</div>
</section>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/Hal.js"></script>
<link rel='stylesheet' href='css/bootstrap.min.css' type='text/css' media='all' />
<link rel='stylesheet' href='css/font-awesome.css' type='text/css' media='all' />
<link rel="stylesheet" type="text/css" media="all" href="css/Hal.css">
</head>
<body>
<script type="text/javascript">
//DOC API à https://api.archives-ouvertes.fr/docs/search/
$(document).ready(function(){
$("#yearSelect").hide();
$("#yearSelectLabel").hide();
lastName="";
firstName="";
idHal="";
lab="150";
var now = new Date();
var annee = now.getFullYear();
generateDocTypes("documentTypeSelect");
generateYears(1995,annee,"yearSelect");
});
$(document).ajaxStart(function(){
$("#publications").html("<p style='text-align:center'>Interrogation de HAL en cours, patientez<br><img src='img/loading.gif' /></p>");
});
</script>
<div>
<section class="introblock whites">
<div class="row logoHAL">
<a href="https://hal.archives-ouvertes.fr" border="0" onclick="window.open(this.href); return false;" >
<img src="img/hal.logo.png"></a>
</div>
<div class="row">
<div class="col-sm-6 left">
<label for="firstName">Prénom :</label>
<input id="firstName" type="text" value="">
</div>
<div class="col-sm-6 left">
<label for="lastName">Nom :</label>
<input id="lastName" type="text" value="">
</div>
</div>
<div class="row">
<div class="col-md-7 left">
<label for="documentTypeSelect">Choisissez le type de document :</label>
<select id="documentTypeSelect" onchange="typeChange();">
</select>
</div>
</div>
<div class="row">
<div class="col-md-5 right">
<label id="yearSelectLabel" for="yearSelect">Choisissez une année :</label>
<select id="yearSelect" onchange="yearChange();">
</select>
</div>
</div>
<div id="publications">
</div>
</section>
</div>
</body>
</html>
Supports Markdown
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