Skip to content

Commit

Permalink
Merge pull request #71 from nfdi4plants/madmp
Browse files Browse the repository at this point in the history
Madmp
  • Loading branch information
xiaoranzhou authored Oct 21, 2024
2 parents 66ca718 + a3a3853 commit 02740f7
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DMPDocs/vw-dmp-2024-10-20.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@



vw_dmp = { "vw-dmp" : `<div id="bmbf-dmp" class="">
vw_dmp = { "vw-dmp" : `<div id="vw-dmp" class="">
<div class="content-page" id="text_start">
<p class="c4"><span class="c6">7 Fragen &ndash; Basis-Datenmanagementplan</span><sup class="c6"><a href="#ftnt1"
id="ftnt_ref1">[1]</a></sup></p>
Expand Down
12 changes: 11 additions & 1 deletion css/custom24-09-17.css → css/custom24-10-20.css
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,21 @@ display: block;

}


.expressmenu{
position: fixed;
top: 160px;
left: calc(60vw - 2.9rem );
z-index:1030;
transform: scale(1.5) !important;

}

#up-to-top {
display: none;
position: fixed;
border: none;
left: calc(60vw - 4rem);
left: calc(60vw - 2.9rem);
bottom: 50px;
z-index: 1020;
font-size: 34px;
Expand Down
45 changes: 38 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script src="js/d3.min.js" type="text/javascript" charset="utf-8"> </script>
<script src="js/bs5-intro-tour2106.js" type="text/javascript" charset="utf-8"></script>

<link href="css/custom24-09-17.css" rel="stylesheet" />
<link href="css/custom24-10-20.css" rel="stylesheet" />
<link href="favicon.png" rel="icon">
<!-- 100% privacy-first analytics -->
<script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
Expand Down Expand Up @@ -117,7 +117,7 @@
var classicMode = true;
var initialed = false; // set the initialed status to false
const JSONString = '{"dmp":{"title":"DMP of Example Project","contact":{"contact_id":{"identifier":"http://orcid.org/0000-0000-0000-0000","type":"orcid"},"mbox":"DMP of email","name":"DMP of Example User"},"created":"2024-06-19T16:45:09.7","dmp_id":{"identifier":"https://doi.org/10.0000/00.0.1234","type":"doi"},"dataset":[{"dataset_id":{"identifier":"https://doi.org/10.0000/00.0.5678","type":"doi"},"title":"Placeholder dataset","personal_data":"unknown","sensitive_data":"unknown"}],"ethical_issues_exist":"unknown","language":"eng","modified":"2024-07-09T10:53:50.4","submission":"2024-07-09T10:53:50.4","version":"1.0"},"replace":{"$_PROJECTNAME":"Example Project","$_STUDYOBJECT":"Example Topic","$_PROJECTAIM":"Example Aim","$_DMPVERSION":"1.0","$_USERNAME":"Example User","$_EMAIL":"email","$_DATAOFFICER":"Example data officer name","$_DATAUTILITY":"Industry, politicians and students can also use the data for different purposes.","$_UPDATEMONTH":"Example Month","$_PREVIOUSPROJECTS":"Previous Project Name","$_PROPRIETARY":"Proprietary Software","$_RAWDATA":"???","$_DERIVEDDATA":"???","$_FUNDINGPROGRAMME":"action number or funding programme name","$_CREATIONDATE":"xxxx-xx-xx","$_MODIFICATIONDATE":"xxxx-xx-xx","$_OTHERSTANDARDINPUT":"other standards","$_OTHEREP":"Other repositories","$_PARTNERS":"partner name", "$_ADDPROJECTCOORDINATOR": "project coordinator" },"checkbox":{"checkbox_1":{"checked":["check_dataplant"],"unchecked":[ "check_acronym","check_protect","check_update","check_previousprojects","check_industry","check_proprietary","check_partners","check_eu"]},"checkbox_2":{"checked":[],"unchecked":["check_transcriptomic", "check_genetic","check_genomic","check_cloned-dna","check_rnaseq","check_metabolomic","check_proteomic","check_phenotypic","check_targeted","check_image","check_models","check_code","check_excel"]},"checkbox_3":{"checked":[],"unchecked":["check_miappe","check_minseqe","check_otherstandards","check_dublincore","check_marc21", "check_darwincore", "check_bioschemas", "check_schemaorg" ,"check_early","check_ipissue","check_vvisualization","check_mixs","check_migseu","check_migsorg","check_mims","check_mimarksspecimen","check_mimarkssurvey","check_misag","check_mimag","check_miame","check_mmiamet","check_rembi","check_miape","check_mimix","check_beforepublication","check_endofproject","check_embargo","check_request","check_nfdi","check_french","check_eosc"]},"checkbox_5":{"checked":[],"unchecked":["check_genbank","check_sra","check_geo","check_ena","check_arrayexpress","check_metabolights","check_pride","check_bioimage","check_idr","check_edal","check_metaworkbench","check_intact","check_pdb","check_chebi","check_otherep"]}},"update":{"timeline":[],"storage":[{"answer":[],"name":[]},{"answer":[],"name":[]},{"answer":[],"name":[]},{"answer":[],"name":[]},{"answer":[],"name":[]},{"answer":[],"name":[]}]}}';
const templateJSON = '{"replace":{"$_PROJECTNAME":"Example Project", "$_ADDACRONYM":"Example Acronym","$_STUDYOBJECT":"Example Topic","$_PROJECTAIM":"Example Aim","$_USERNAME":"Example User","$_EMAIL":"email","$_DATAOFFICER":"Example data officer name","$_RAWDATA":"???","$_DERIVEDDATA":"???","$_FUNDINGPROGRAMME":"action number or funding programme name","$_CREATIONDATE":"xxxx-xx-xx","$_MODIFICATIONDATE":"xxxx-xx-xx"}}';
const templateJSON = '{"replace":{"$_PROJECTNAME":"Example Project","$_STUDYOBJECT":"Example Topic","$_PROJECTAIM":"Example Aim","$_USERNAME":"Example User","$_EMAIL":"email","$_DATAOFFICER":"Example data officer name","$_RAWDATA":"???","$_DERIVEDDATA":"???","$_FUNDINGPROGRAMME":"action number or funding programme name","$_CREATIONDATE":"xxxx-xx-xx","$_MODIFICATIONDATE":"xxxx-xx-xx"}}';
let temp_a = JSON.parse(templateJSON); // template answers used to compare with saved answers
if (cached_a !== null) { // if there is an answer saved in local storage
saved_a = JSON.parse(cached_a); // load the cached answers to webpage
Expand Down Expand Up @@ -580,28 +580,30 @@
function compare_replace(old_a, new_a) {
let locala = JSON.parse(JSON.stringify(old_a["replace"]));
let unreplaced_keys = [];

let replaced_keys = [];
let total_keywords = 0,
changed_keywords = 0;
document.getElementById("check_update").checked? locala["$_UPDATEMONTH"]="Example Month" : {} ;
document.getElementById("check_previousprojects").checked? locala["$_PREVIOUSPROJECTS"]="Previous Project Name" : {} ;
document.getElementById("check_proprietary").checked? locala["$_PROPRIETARY"]="Proprietary Software" : {} ;
document.getElementById("check_partners").checked? locala["$_PARTNERS"]="partner name" : {} ;
document.getElementById("check_otherep").checked? locala["$_OTHEREP"]="" : {} ;
document.getElementById("check_acronym").checked? locala["$_ADDACRONYM"]="Add the acronym here" : {};
document.getElementById("check_projectcoordinator").checked? locala["$_ADDPROJECTCOORDINATOR"]="Project Coordinator" : {};

for (const [key, value] of Object.entries(locala)) {
total_keywords++;
if ((new_a["replace"][key] != value) && (new_a["replace"][key] != "") && (new_a["replace"][key] != undefined)) {
changed_keywords++;

replaced_keys.push(key);
//verbose console.log(new_a["replace"][key]);
} else {
unreplaced_keys.push(key);
}

}
//unreplaced_keys = unreplaced_keys.filter(item => item !== "$_PROPRIETARY").filter(item => item !== "$_PREVIOUSPROJECTS").filter(item => item !== "$_UPDATEMONTH").filter(item => item !== "$_DATAUTILITY");
return [total_keywords, 0, changed_keywords, 0, unreplaced_keys, []];
return [total_keywords, 0, changed_keywords, 0, unreplaced_keys, replaced_keys];
}
/**
* @function onchange_replace
Expand Down Expand Up @@ -2797,7 +2799,7 @@
</li>
<li>
<button id="detailed_vw-dmp" class="dropdown-item"
onclick='load_dmp(reload_answers,name="wv-dmp")'>Volkswage Foundation DMP</button>
onclick='load_dmp(reload_answers,name="vw-dmp")'>Volkswage Foundation DMP</button>
</li>
<li>
<button id="proposal_save" class="dropdown-item"
Expand Down Expand Up @@ -3019,8 +3021,37 @@
style="margin: 0 0 0 0; padding: 0 0 0 0; height: 93vh; width: 100vw; overflow-x: hidden;position:relative;">
<div class="col-7" id="split-0"
style="position: relative;height: 93vh; overflow-x: hidden; margin: 0 0 0 0; padding: 0 0 0 0; ">
<a href="https://github.com/nfdi4plants/dataplan/blob/main/DMPDocs/horizon_europe.js" target="_blank" id="editTemplate" title="Edit this template" style="position: fixed; top: 100px; left: calc(60vw - 5.5rem ); z-index:1030">Edit this <br> template</a>

<div class="expressmenu">
<a href="https://github.com/nfdi4plants/dataplan/blob/main/DMPDocs/horizon_europe.js" hover="edit this template" target="_blank" id="editTemplate" title="Edit this template" >
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2d3e50" class="bi bi-pencil-square" viewBox="0 0 16 16">
<path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
<path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
</svg>
</a>
<br>
<a href="#" id="refreshdefault" onclick="window.localStorage.clear();document.location.reload()"
hover="click to clear the current input" title="click to clear the current input" >
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2d3e50" class="bi bi-arrow-repeat" viewBox="0 0 16 16">
<path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41m-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9"/>
<path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5 5 0 0 0 8 3M3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9z"/>
</svg>
</a>
<br>

<a href="#" id="export2json" onclick="save_json()" hover="click to save answers to JSON" title="click to save answers to JSON" >
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2d3e50" class="bi bi-filetype-json" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5zM4.151 15.29a1.2 1.2 0 0 1-.111-.449h.764a.58.58 0 0 0 .255.384q.105.073.25.114.142.041.319.041.245 0 .413-.07a.56.56 0 0 0 .255-.193.5.5 0 0 0 .084-.29.39.39 0 0 0-.152-.326q-.152-.12-.463-.193l-.618-.143a1.7 1.7 0 0 1-.539-.214 1 1 0 0 1-.352-.367 1.1 1.1 0 0 1-.123-.524q0-.366.19-.639.192-.272.528-.422.337-.15.777-.149.456 0 .779.152.326.153.5.41.18.255.2.566h-.75a.56.56 0 0 0-.12-.258.6.6 0 0 0-.246-.181.9.9 0 0 0-.37-.068q-.324 0-.512.152a.47.47 0 0 0-.185.384q0 .18.144.3a1 1 0 0 0 .404.175l.621.143q.326.075.566.211a1 1 0 0 1 .375.358q.135.222.135.56 0 .37-.188.656a1.2 1.2 0 0 1-.539.439q-.351.158-.858.158-.381 0-.665-.09a1.4 1.4 0 0 1-.478-.252 1.1 1.1 0 0 1-.29-.375m-3.104-.033a1.3 1.3 0 0 1-.082-.466h.764a.6.6 0 0 0 .074.27.5.5 0 0 0 .454.246q.285 0 .422-.164.137-.165.137-.466v-2.745h.791v2.725q0 .66-.357 1.005-.355.345-.985.345a1.6 1.6 0 0 1-.568-.094 1.15 1.15 0 0 1-.407-.266 1.1 1.1 0 0 1-.243-.39m9.091-1.585v.522q0 .384-.117.641a.86.86 0 0 1-.322.387.9.9 0 0 1-.47.126.9.9 0 0 1-.47-.126.87.87 0 0 1-.32-.387 1.55 1.55 0 0 1-.117-.641v-.522q0-.386.117-.641a.87.87 0 0 1 .32-.387.87.87 0 0 1 .47-.129q.265 0 .47.129a.86.86 0 0 1 .322.387q.117.255.117.641m.803.519v-.513q0-.565-.205-.973a1.46 1.46 0 0 0-.59-.63q-.38-.22-.916-.22-.534 0-.92.22a1.44 1.44 0 0 0-.589.628q-.205.407-.205.975v.513q0 .562.205.973.205.407.589.626.386.217.92.217.536 0 .917-.217.384-.22.589-.626.204-.41.205-.973m1.29-.935v2.675h-.746v-3.999h.662l1.752 2.66h.032v-2.66h.75v4h-.656l-1.761-2.676z"/>
</svg>
</a>
<br>
<a href="#" id="incompleteInform" onclick="copy_doc()" hover="click to check which answer is missing" title="Inform me the incomplete question" >
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#2d3e50" class="bi bi-ui-checks" viewBox="0 0 16 16">
<path d="M7 2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5zM2 1a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm0 8a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2zm.854-3.646a.5.5 0 0 1-.708 0l-1-1a.5.5 0 1 1 .708-.708l.646.647 1.646-1.647a.5.5 0 1 1 .708.708zm0 8a.5.5 0 0 1-.708 0l-1-1a.5.5 0 0 1 .708-.708l.646.647 1.646-1.647a.5.5 0 0 1 .708.708zM7 10.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5zm0-5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5m0 8a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5"/>
</svg></a>


</div>
<div class="col-12" id="doc2"
style="top:7vh; overflow-x: hidden; overflow-y: hidden; padding-right: 0px; background-color: WhiteSmoke;">

Expand Down

0 comments on commit 02740f7

Please sign in to comment.