This username is available
-This email is invalid
-diff --git a/public/js/extras.js b/public/js/extras.js
index 6cdf8aa..49a706d 100644
--- a/public/js/extras.js
+++ b/public/js/extras.js
@@ -346,7 +346,8 @@ function mruPopup(props) {
// Fetches html from elements folder
async function getPagePartial(partialName, target=null) {
- const url = BASE_URL + `/src/Views/${partialName}.php`;
+ // const url = BASE_URL + `/src/Views/${partialName}.php`;
+ const url = BASE_URL + `/interface/partial/${partialName}`;
const res = await fetch(url)
.then((response) => {return response.text();})
.then((content) => {
@@ -595,14 +596,13 @@ async function getFisheriesProduct() {
const group = L.layerGroup();
// load contours in JSON
const bgLayer = L.tileLayer.betterWms(BASE_URL + '/geoserver/wms', { layers: 'nssg_areas', transparent: true, format: "image/png"});
- // let productLayer = L.featureGroup();
const url = BASE_URL + "/interface/charts/afppy";
+
try {
const response = await fetch(url);
const data = await response.json();
let pies;
// Add the custom control to the map
- // slider.addTo(mapL);
pies = createPie(data, 1990).addTo(group);
layerControls['AFPPY'] = L.control.slider(value => {
@@ -622,7 +622,5 @@ async function getFisheriesProduct() {
}
bgLayer.addTo(group);
- group.addLayer(bgLayer);
-
return group;
}
diff --git a/public/js/loader.js b/public/js/loader.js
index 98a155a..2e2e06e 100644
--- a/public/js/loader.js
+++ b/public/js/loader.js
@@ -197,7 +197,9 @@ var loader_script_files=[
"js/config_functions.js",
"js/modules/layersmetadata/layersmetadata.js",
"js/modules/poseidon/poseidon.js",
- "js/modules/configuration/configuration.js"
+ "js/modules/configuration/configuration.js",
+ "js/mru-info.js",
+ "js/more-info.js"
];
/***(var) loader_css_files: stores all the internal css (styles) urls to be included*****/
diff --git a/public/js/more-info.js b/public/js/more-info.js
index dc9c20e..49cdbd0 100644
--- a/public/js/more-info.js
+++ b/public/js/more-info.js
@@ -49,7 +49,8 @@ function moreInfo() {
}
},
getDropdownData(dropdown) {
- this.loading = true;
+ Alpine.store('loading', true);
+
let url = BASE_URL;
let gridCode;
if (this.isGrid) {
@@ -58,17 +59,17 @@ function moreInfo() {
switch(dropdown) {
case 'd':
- url += '/interface/dropdowns/descriptors?entityid=' + this.entityId + '&cellcode=' + gridCode;
+ url += '/interface/dropdowns/descriptors?entity_id=' + this.entityId + '&cellcode=' + gridCode;
break;
case 'c':
- url += '/interface/dropdowns/criterias?descriptor_id=' + this.did + '&cellcode=' + gridCode;
+ url += '/interface/dropdowns/criterias?desc_id=' + this.did + '&cellcode=' + gridCode;
break;
}
fetch(url)
.then(res => res.json())
.then(data => {
- this.isLoading = false;
+ Alpine.store('loading', false);
eval('this.' + dropdown + '=data');
});
},
@@ -95,13 +96,14 @@ function moreInfo() {
}).render(grid);
},
drawDataChart() {
+ Alpine.store('loading', true);
if (this.entityGroup != 'POSEIDON')
return;
const url = `/data/external/POSEIDON/${Alpine.store('entity').tspr}_${Alpine.store('entity').type}_${Alpine.store('entity').pid}`;
fetch(url)
.then(res => res.json())
.then(data => {
- this.isLoading = false;
+ Alpine.store('loading', false);
console.debug(data);
});
diff --git a/public/js/mru-info.js b/public/js/mru-info.js
index e14976f..8c46397 100644
--- a/public/js/mru-info.js
+++ b/public/js/mru-info.js
@@ -41,20 +41,20 @@ function mruInfo() {
}
},
getDropdownData(dropdown) {
- this.loading = true;
+ Alpine.store('loading', true);
let url = BASE_URL;
switch(dropdown) {
case 'd':
- url += '/interface/dropdowns/descriptors?bodyid=' + this.bid;
+ url += '/interface/dropdowns/descriptors?body_id=' + this.bid;
break;
case 'c':
- url += '/interface/dropdowns/criterias?descriptor_id=' + this.did;
+ url += '/interface/dropdowns/criterias?desc_id=' + this.did;
break;
}
fetch(url)
.then(res => res.json())
.then(data => {
- this.isLoading = false;
+ Alpine.store('loading', false);
eval('this.' + dropdown + '=data');
});
},
diff --git a/public/js/sidebar.js b/public/js/sidebar.js
index c82e215..6b7c5e7 100644
--- a/public/js/sidebar.js
+++ b/public/js/sidebar.js
@@ -276,215 +276,215 @@ function clearRequests() {
}
-function moreInfo() {
- return {
- entityGroup: selectedEntityGroup,
- entityId: selectedEntityId || Alpine.store('entity').id,
- dopen: false,
- copen: false,
- loading: false,
- isGrid: Alpine.store('entity').hasOwnProperty('cellcode'),
- d: {},
- c: {},
- tagName(type, id) {
- if (id == null)
- return;
- if (type === 'd') {
- return this.d.find(i => i.id == id).code;
- } else if (type === 'c') {
- return this.c.find(i => i.id == id).code;
- }
- },
- did: null,
- cid: [],
- date: {},
- search() {
- this.drawDataChart();
- // check if entity has an external source
- if (this.$store.entity.hasOwnProperty('ctStationCode')) {
- requestExternalData(this.did, this.cid, this.date.from, this.date.to, this.entityGroup, this.entityId);
- } else {
- requestEntityData(this.did, this.cid, this.date.from, this.date.to, this.entityGroup, this.entityId);
- }
- },
- selectEntry(element, entry) {
- console.debug(element.text.substr(0, element.text.indexOf(' ')));
- if (element.id.split('-')[1] === 'desc') {
- // highlight
- element.parentElement.querySelectorAll('a').forEach(el => el.classList.remove('is-active'));
- element.classList.add('is-active');
- // update variables;
- this.cid = [];
- this.did = entry;
- this.dopen = false;
- } else if (element.id.split('-')[1] === 'crit') {
- // toggle
- element.classList.toggle('is-active');
- // update variables;
- this.cid.indexOf(entry) === -1 ? this.cid.push(entry) : this.cid = this.cid.filter(function(id) { return id !== entry});
- this.copen = false;
- // add tag
- }
- },
- getDropdownData(dropdown) {
- this.loading = true;
- let url = BASE_URL;
- let gridCode;
- if (this.isGrid) {
- gridCode = Alpine.store('entity').cellcode.substr(0,4);
- }
-
- switch(dropdown) {
- case 'd':
- url += '/interface/dropdowns/descriptors?entity_id=' + this.entityId + '&cellcode=' + gridCode;
- break;
- case 'c':
- url += '/interface/dropdowns/criterias?desc_id=' + this.did + '&cellcode=' + gridCode;
- break;
- }
-
- fetch(url)
- .then(res => res.json())
- .then(data => {
- this.isLoading = false;
- eval('this.' + dropdown + '=data');
- });
- },
- loadCal() {
- const calendars = bulmaCalendar.attach('[type=date]', {dateFormat: 'dd/MM/yyyy', isRange: true});
- // Loop on each calendar initialized
- calendars.forEach(calendar => {
- calendar.on('save', data => {
- this.date = {
- from: calendar.startDate.toLocaleDateString(),
- to: calendar.endDate.toLocaleDateString()
- }
- });
- });
- },
- populateFeatureGrid(grid) {
- const features = Alpine.store('entity');
- console.debug(features);
- const featureCols = Object.getOwnPropertyNames(Alpine.store('entity')).filter(name => aliasMap.has(name));
- const featureVals = featureCols.map(col => {return {feature: aliasMap.get(col), value: features[col]}});
- console.debug(featureVals);
- new gridjs.Grid({
- data: featureVals
- }).render(grid);
- },
- drawDataChart() {
- if (this.entityGroup != 'POSEIDON')
- return;
- const url = `/data/external/POSEIDON/${Alpine.store('entity').tspr}_${Alpine.store('entity').type}_${Alpine.store('entity').pid}`;
- fetch(url)
- .then(res => res.json())
- .then(data => {
- this.isLoading = false;
- console.debug(data);
- });
-
- const config = {
- type: 'line',
- data: data,
- options: {
- responsive: true,
- plugins: {
- legend: {
- position: 'top',
- },
- title: {
- display: true,
- text: 'Chart.js Line Chart'
- }
- }
- },
- };
- }
- };
-}
+// function moreInfo() {
+// return {
+// entityGroup: selectedEntityGroup,
+// entityId: selectedEntityId || Alpine.store('entity').id,
+// dopen: false,
+// copen: false,
+// loading: false,
+// isGrid: Alpine.store('entity').hasOwnProperty('cellcode'),
+// d: {},
+// c: {},
+// tagName(type, id) {
+// if (id == null)
+// return;
+// if (type === 'd') {
+// return this.d.find(i => i.id == id).code;
+// } else if (type === 'c') {
+// return this.c.find(i => i.id == id).code;
+// }
+// },
+// did: null,
+// cid: [],
+// date: {},
+// search() {
+// this.drawDataChart();
+// // check if entity has an external source
+// if (this.$store.entity.hasOwnProperty('ctStationCode')) {
+// requestExternalData(this.did, this.cid, this.date.from, this.date.to, this.entityGroup, this.entityId);
+// } else {
+// requestEntityData(this.did, this.cid, this.date.from, this.date.to, this.entityGroup, this.entityId);
+// }
+// },
+// selectEntry(element, entry) {
+// console.debug(element.text.substr(0, element.text.indexOf(' ')));
+// if (element.id.split('-')[1] === 'desc') {
+// // highlight
+// element.parentElement.querySelectorAll('a').forEach(el => el.classList.remove('is-active'));
+// element.classList.add('is-active');
+// // update variables;
+// this.cid = [];
+// this.did = entry;
+// this.dopen = false;
+// } else if (element.id.split('-')[1] === 'crit') {
+// // toggle
+// element.classList.toggle('is-active');
+// // update variables;
+// this.cid.indexOf(entry) === -1 ? this.cid.push(entry) : this.cid = this.cid.filter(function(id) { return id !== entry});
+// this.copen = false;
+// // add tag
+// }
+// },
+// getDropdownData(dropdown) {
+// this.loading = true;
+// let url = BASE_URL;
+// let gridCode;
+// if (this.isGrid) {
+// gridCode = Alpine.store('entity').cellcode.substr(0,4);
+// }
+//
+// switch(dropdown) {
+// case 'd':
+// url += '/interface/dropdowns/descriptors?entity_id=' + this.entityId + '&cellcode=' + gridCode;
+// break;
+// case 'c':
+// url += '/interface/dropdowns/criterias?desc_id=' + this.did + '&cellcode=' + gridCode;
+// break;
+// }
+//
+// fetch(url)
+// .then(res => res.json())
+// .then(data => {
+// this.isLoading = false;
+// eval('this.' + dropdown + '=data');
+// });
+// },
+// loadCal() {
+// const calendars = bulmaCalendar.attach('[type=date]', {dateFormat: 'dd/MM/yyyy', isRange: true});
+// // Loop on each calendar initialized
+// calendars.forEach(calendar => {
+// calendar.on('save', data => {
+// this.date = {
+// from: calendar.startDate.toLocaleDateString(),
+// to: calendar.endDate.toLocaleDateString()
+// }
+// });
+// });
+// },
+// populateFeatureGrid(grid) {
+// const features = Alpine.store('entity');
+// console.debug(features);
+// const featureCols = Object.getOwnPropertyNames(Alpine.store('entity')).filter(name => aliasMap.has(name));
+// const featureVals = featureCols.map(col => {return {feature: aliasMap.get(col), value: features[col]}});
+// console.debug(featureVals);
+// new gridjs.Grid({
+// data: featureVals
+// }).render(grid);
+// },
+// drawDataChart() {
+// if (this.entityGroup != 'POSEIDON')
+// return;
+// const url = `/data/external/POSEIDON/${Alpine.store('entity').tspr}_${Alpine.store('entity').type}_${Alpine.store('entity').pid}`;
+// fetch(url)
+// .then(res => res.json())
+// .then(data => {
+// this.isLoading = false;
+// console.debug(data);
+// });
+//
+// const config = {
+// type: 'line',
+// data: data,
+// options: {
+// responsive: true,
+// plugins: {
+// legend: {
+// position: 'top',
+// },
+// title: {
+// display: true,
+// text: 'Chart.js Line Chart'
+// }
+// }
+// },
+// };
+// }
+// };
+// }
-function mruInfo() {
- return {
- dopen: false,
- copen: false,
- loading: false,
- d: {},
- c: {},
- tagName(type, id) {
- if (id == null)
- return;
- if (type === 'd') {
- return this.d.find(i => i.id == id).code;
- } else if (type === 'c') {
- return this.c.find(i => i.id == id).code;
- }
- },
- bid: Alpine.store('mru').objectid,
- did: null,
- cid: [],
- date: {},
- search() {
- generateRequest(this.did, this.cid, this.date.from, this.date.to, this.bid);
- },
- selectEntry(element, entry) {
- console.debug(element.text.substr(0, element.text.indexOf(' ')));
- if (element.id.split('-')[1] === 'desc') {
- // highlight
- element.parentElement.querySelectorAll('a').forEach(el => el.classList.remove('is-active'));
- element.classList.add('is-active');
- // update variables;
- this.cid = [];
- this.did = entry;
- this.dopen = false;
- } else if (element.id.split('-')[1] === 'crit') {
- // toggle
- element.classList.toggle('is-active');
- // update variables;
- this.cid.indexOf(entry) === -1 ? this.cid.push(entry) : this.cid = this.cid.filter(function(id) { return id !== entry});
- this.copen = false;
- // add tag
- }
- },
- getDropdownData(dropdown) {
- this.loading = true;
- let url = BASE_URL;
- switch(dropdown) {
- case 'd':
- url += '/interface/dropdowns/descriptors?body_id=' + this.bid;
- break;
- case 'c':
- url += '/interface/dropdowns/criterias?desc_id=' + this.did;
- break;
- }
- fetch(url)
- .then(res => res.json())
- .then(data => {
- this.isLoading = false;
- eval('this.' + dropdown + '=data');
- });
- },
- loadCal() {
- const calendars = bulmaCalendar.attach('[type=date]', {dateFormat: 'dd/MM/yyyy', isRange: true});
- // Loop on each calendar initialized
- calendars.forEach(calendar => {
- calendar.on('save', data => {
- this.date = {
- from: calendar.startDate.toLocaleDateString(),
- to: calendar.endDate.toLocaleDateString()
- }
- });
- });
- },
- populateFeatureGrid(grid) {
- console.debug(grid);
- const features = Alpine.store('mru');
- const featureCols = Object.getOwnPropertyNames(Alpine.store('mru')).filter(name => aliasMap.has(name));
- const featureVals = featureCols.map(col => {return {feature: aliasMap.get(col), value: features[col]}});
- console.debug(featureVals);
- new gridjs.Grid({
- data: featureVals
- }).render(grid);
- }
- };
-}
+// function mruInfo() {
+// return {
+// dopen: false,
+// copen: false,
+// loading: false,
+// d: {},
+// c: {},
+// tagName(type, id) {
+// if (id == null)
+// return;
+// if (type === 'd') {
+// return this.d.find(i => i.id == id).code;
+// } else if (type === 'c') {
+// return this.c.find(i => i.id == id).code;
+// }
+// },
+// bid: Alpine.store('mru').objectid,
+// did: null,
+// cid: [],
+// date: {},
+// search() {
+// generateRequest(this.did, this.cid, this.date.from, this.date.to, this.bid);
+// },
+// selectEntry(element, entry) {
+// console.debug(element.text.substr(0, element.text.indexOf(' ')));
+// if (element.id.split('-')[1] === 'desc') {
+// // highlight
+// element.parentElement.querySelectorAll('a').forEach(el => el.classList.remove('is-active'));
+// element.classList.add('is-active');
+// // update variables;
+// this.cid = [];
+// this.did = entry;
+// this.dopen = false;
+// } else if (element.id.split('-')[1] === 'crit') {
+// // toggle
+// element.classList.toggle('is-active');
+// // update variables;
+// this.cid.indexOf(entry) === -1 ? this.cid.push(entry) : this.cid = this.cid.filter(function(id) { return id !== entry});
+// this.copen = false;
+// // add tag
+// }
+// },
+// getDropdownData(dropdown) {
+// this.loading = true;
+// let url = BASE_URL;
+// switch(dropdown) {
+// case 'd':
+// url += '/interface/dropdowns/descriptors?body_id=' + this.bid;
+// break;
+// case 'c':
+// url += '/interface/dropdowns/criterias?desc_id=' + this.did;
+// break;
+// }
+// fetch(url)
+// .then(res => res.json())
+// .then(data => {
+// this.isLoading = false;
+// eval('this.' + dropdown + '=data');
+// });
+// },
+// loadCal() {
+// const calendars = bulmaCalendar.attach('[type=date]', {dateFormat: 'dd/MM/yyyy', isRange: true});
+// // Loop on each calendar initialized
+// calendars.forEach(calendar => {
+// calendar.on('save', data => {
+// this.date = {
+// from: calendar.startDate.toLocaleDateString(),
+// to: calendar.endDate.toLocaleDateString()
+// }
+// });
+// });
+// },
+// populateFeatureGrid(grid) {
+// console.debug(grid);
+// const features = Alpine.store('mru');
+// const featureCols = Object.getOwnPropertyNames(Alpine.store('mru')).filter(name => aliasMap.has(name));
+// const featureVals = featureCols.map(col => {return {feature: aliasMap.get(col), value: features[col]}});
+// console.debug(featureVals);
+// new gridjs.Grid({
+// data: featureVals
+// }).render(grid);
+// }
+// };
+// }
diff --git a/public/src/Views/404.php b/public/src/Views/404.php
deleted file mode 100644
index d51a8b3..0000000
--- a/public/src/Views/404.php
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- This username is available This email is invalid
OR
-Download Layer
- -You may request the whole entity (cruise/station etc.) without selecting search criteria or be more specific by doing so.
- diff --git a/public/src/Views/mru-info.php b/public/src/Views/mru-info.php deleted file mode 100644 index 9c37f5f..0000000 --- a/public/src/Views/mru-info.php +++ /dev/null @@ -1,62 +0,0 @@ - -You may request the whole water body without selecting search criteria or be more specific by doing so.
- diff --git a/public/src/Views/register.php b/public/src/Views/register.php deleted file mode 100644 index c034941..0000000 --- a/public/src/Views/register.php +++ /dev/null @@ -1,87 +0,0 @@ -This username is available
-This email is invalid
-