parent
20810aa850
commit
5146305caf
|
@ -65,11 +65,21 @@ h1 img:hover { opacity: 1; }
|
|||
|
||||
main,
|
||||
body > div,
|
||||
body > footer,
|
||||
body > form { display: block; max-width: 90vw; margin: 0 auto 3em auto; padding-bottom: 3em; }
|
||||
|
||||
form > div { margin-bottom: 1em; }
|
||||
label { display: block; font-weight: bold; margin-bottom: .5em; }
|
||||
|
||||
body > footer { border-top: .1em solid var(--color-borders); }
|
||||
|
||||
body > footer > div { display: block; }
|
||||
body > footer > div a,
|
||||
body > footer > div span { display: block; font-weight: bold; cursor: pointer;
|
||||
color: var(--color-fg-less); transition: color .4s; }
|
||||
body > footer > div a:hover,
|
||||
body > footer > div span:hover { color: var(--color-accent-hover); }
|
||||
|
||||
.invisible { display: none !important; opacity: 0; }
|
||||
|
||||
.buttonLike,
|
||||
|
|
2
public/assets/css/csvxml.min.css
vendored
2
public/assets/css/csvxml.min.css
vendored
File diff suppressed because one or more lines are too long
|
@ -1018,6 +1018,45 @@ class CsvxmlPage {
|
|||
|
||||
}
|
||||
|
||||
renderFooter() {
|
||||
|
||||
const footer = document.createElement("footer");
|
||||
|
||||
const licenseStatement = document.createElement("p");
|
||||
licenseStatement.textContent = "This work is licensed under the GNU Affero Public License Version 3.";
|
||||
footer.appendChild(licenseStatement);
|
||||
|
||||
const footerOptions = document.createElement("div");
|
||||
|
||||
const codeLink = document.createElement("a");
|
||||
codeLink.textContent = "Source code";
|
||||
codeLink.href = "https://gitea.armuli.eu/museum-digital/csvxml";
|
||||
footerOptions.appendChild(codeLink);
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
const refreshB = document.createElement("span");
|
||||
refreshB.textContent = "Reload application";
|
||||
refreshB.setAttribute("tabindex", 1);
|
||||
refreshB.addEventListener('click', function(e) {
|
||||
|
||||
Promise.all(['csvxml-cache-v1'].map(function(cache) {
|
||||
caches.has(cache).then(function(hasCache) {
|
||||
if (hasCache === true) {
|
||||
caches.delete(cache).then(function(deletionStatus) {});
|
||||
}
|
||||
})
|
||||
}))
|
||||
location.reload()
|
||||
|
||||
}, {passive: true, once: true});
|
||||
footerOptions.appendChild(refreshB);
|
||||
}
|
||||
|
||||
footer.appendChild(footerOptions);
|
||||
document.body.appendChild(footer);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
(async function() {
|
||||
|
@ -1056,6 +1095,7 @@ class CsvxmlPage {
|
|||
page.renderHelpTexts();
|
||||
page.renderUploader();
|
||||
page.renderMain();
|
||||
page.renderFooter();
|
||||
|
||||
}
|
||||
|
||||
|
|
7
public/assets/js/csvxmlV2.min.js
vendored
7
public/assets/js/csvxmlV2.min.js
vendored
|
@ -72,7 +72,10 @@ const remarkCont=document.createElement("p");remarkCont=field.remarks;tooltipCon
|
|||
if(field.allowedValues!==undefined&&Object.values(field.allowedValues).length!==0){const allowedHl=document.createElement("h4");allowedHl.textContent=this.tls.allowed_values;tooltipContent.appendChild(allowedHl);const allowedList=document.createElement("p");allowedList.textContent=Object.values(field.allowedValues).join(', ');tooltipContent.appendChild(allowedList);}
|
||||
CsvxmlTooltip.bindTooltipToElement(domLi,field.name_human_readable,tooltipContent);}
|
||||
domDiv.appendChild(domUl);this.domMainWrapper.appendChild(domDiv);}
|
||||
document.body.appendChild(this.domMainWrapper);let app=this;this.doForFieldList(function(field){field.addEventListener('click',function(e){app.toggleListFieldSelectionState(field);app.checkCSVBySelectionAccessibility();});});}}
|
||||
document.body.appendChild(this.domMainWrapper);let app=this;this.doForFieldList(function(field){field.addEventListener('click',function(e){app.toggleListFieldSelectionState(field);app.checkCSVBySelectionAccessibility();});});}
|
||||
renderFooter(){const footer=document.createElement("footer");const licenseStatement=document.createElement("p");licenseStatement.textContent="This work is licensed under the GNU Affero Public License Version 3.";footer.appendChild(licenseStatement);const footerOptions=document.createElement("div");const codeLink=document.createElement("a");codeLink.textContent="Source code";codeLink.href="https://gitea.armuli.eu/museum-digital/csvxml";footerOptions.appendChild(codeLink);if('serviceWorker'in navigator){const refreshB=document.createElement("span");refreshB.textContent="Reload application";refreshB.setAttribute("tabindex",1);refreshB.addEventListener('click',function(e){Promise.all(['csvxml-cache-v1'].map(function(cache){caches.has(cache).then(function(hasCache){if(hasCache===true){caches.delete(cache).then(function(deletionStatus){});}})}))
|
||||
location.reload()},{passive:true,once:true});footerOptions.appendChild(refreshB);}
|
||||
footer.appendChild(footerOptions);document.body.appendChild(footer);}}
|
||||
(async function(){function getLang(){const allowedLangs=document.documentElement.getAttribute("data-allowed-langs").split(',');if(navigator.language===undefined)return 'en';const browserLang=navigator.language.toLowerCase().substr(0,2);console.log(browserLang);if(allowedLangs.includes(browserLang))return browserLang;else return 'en';}
|
||||
const lang=getLang();document.documentElement.setAttribute("lang",lang);document.body.classList.add("loading");let loaded=0;let fieldList;let tls;function loadPage(){document.body.classList.remove("loading");const page=new CsvxmlPage(fieldList,tls);page.renderGenHeader();page.renderHeader();page.renderHelpTexts();page.renderUploader();page.renderMain();}
|
||||
const lang=getLang();document.documentElement.setAttribute("lang",lang);document.body.classList.add("loading");let loaded=0;let fieldList;let tls;function loadPage(){document.body.classList.remove("loading");const page=new CsvxmlPage(fieldList,tls);page.renderGenHeader();page.renderHeader();page.renderHelpTexts();page.renderUploader();page.renderMain();page.renderFooter();}
|
||||
window.fetch('/json/fields.'+lang+'.json',{method:'GET',cache:'no-cache',credentials:'same-origin',}).then(function(response){return response.json();}).then(function(elements){fieldList=elements;loaded++;if(loaded===2)loadPage();});window.fetch('/json/tls.'+lang+'.json',{method:'GET',cache:'no-cache',credentials:'same-origin',}).then(function(response){return response.json();}).then(function(elements){tls=elements;loaded++;if(loaded===2)loadPage();});})();
|
Loading…
Reference in New Issue
Block a user