diff --git a/404.html b/404.html new file mode 100644 index 0000000..274f881 --- /dev/null +++ b/404.html @@ -0,0 +1,95 @@ + + + + DataSpace | Not Found + + + + + + +
+
+

+ 404
+ Not Found +

+
+
+

+ The requested resource wasn't found or it is not + implemented yet. +

+
+
+ +
+
+
+
+ + + \ No newline at end of file diff --git a/js/ds.js b/js/ds.js index 5a55a65..e33dbc4 100644 --- a/js/ds.js +++ b/js/ds.js @@ -75,15 +75,13 @@ DataSpace.renderReport = async function (report, archesJson, images) { let resource = report.resource; let resKeys = Object.keys(resource); - // TODO prepare 404 page - if (!resKeys.length) { + let resType = resKeys[0].split(' ')[0]; + + if (!resKeys.length || ! (resType in this.RESOURCE_REPORT)) { location.href = '/404.html'; return; } - let resType = resKeys[0].split(' ')[0]; - - if (['Object', 'Context'].includes(resType)) { const geoJSON = JSON.parse( resource[`${resType} Coordinates`] @@ -350,7 +348,7 @@ DataSpace.attachReadMore = function (cssClass, maxWords = 100) // TODO change this element, don't create a new one more.onclick = function () { const less = document.createElement('span'); - less.textContent = 'Less'; + less.textContent = 'Show less'; less.className = 'text-primary c-hand'; // Hacky...