Commit d4bb14e5 authored by Sergio Adrian Gongora Euan's avatar Sergio Adrian Gongora Euan
parents 206ca7b6 cfd87035
# compiled code
*.pyc
*.pyc
# project
.idea/
__pycache__/
geosentinel/
geosentinel
db.sqlite3-journal
# django stufff
*.log
*.pot
*.pyc
__pycache__/
local_settings.py
db.sqlite3
media
# virtual env
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# pyenv
.python-version
......@@ -26,33 +26,33 @@ var makeRequest = function (value) {
dataType : 'json',
success : function(data) {
polygonList = data.polygonList;
while (pol_element.firstChild) {
pol_element.removeChild(pol_element.firstChild);
}
if (polygonList.length <= 0) {
var temp = document.querySelector('#city_list_template');
// filling template
temp.content.querySelector('li').id = '';
temp.content.querySelectorAll('span')[0].textContent = 'No cities matched your search. Try again.';
temp.content.querySelectorAll('span')[1].textContent = '';
temp.content.querySelectorAll('div')[3].textContent = '';
var clone = document.importNode(temp.content, true);
document.querySelector('#polygon-list').appendChild(clone);
} else {
data.polygonList.forEach(function (polygon) {
var temp = document.querySelector('#city_list_template');
// filling template
temp.content.querySelector('li').id = polygon.id;
temp.content.querySelectorAll('span')[0].textContent = polygon.city + ", " + polygon.state;
temp.content.querySelectorAll('span')[1].textContent = polygon.description;
temp.content.querySelectorAll('div')[3].textContent = "Fuente: " + polygon.source;
var clone = document.importNode(temp.content, true);
document.querySelector('#polygon-list').appendChild(clone);
});
......@@ -84,16 +84,16 @@ function drawPolygon(element) {
osmap.removePolygon();
// draw wkt polygon
// osmap.addWKTPolygon(polygon.wkt_polygon);
osmap.addWKTPolygon(polygon.wkt_polygon);
// format coords to draw
var coords = osmap.formatCoords(polygon.geojson.geometry.coordinates);
// var coords = osmap.formatCoords(polygon.geojson.geometry.coordinates);
// get the biggest area
var biggest = osmap.getBiggestPolygon(coords);
// var biggest = osmap.getBiggestPolygon(coords);
// draw coordsR
osmap.addPolygon(biggest);
// osmap.addPolygon(biggest);
}
})
}
......@@ -164,7 +164,7 @@ function drawApiResponse(element) {
function createProductContainer() {
var temp_1 = document.querySelector('#product_cart_1');
// filling template
temp_1.content.querySelector('span').textContent = "Product";
......@@ -180,7 +180,7 @@ $('#ajax-input').focus(function () {
$('#option-list').show();
OPT_LIST_IS_HIDDEN = false;
}
}).blur(function () {
}).blur(function (event) {
INPUT_ON_FOCUS = false;
if (!OPT_LIST_IS_HIDDEN && $(this).val() && $(event.target).closest('#option-list').length) {
$('#option-list').hide();
......@@ -245,13 +245,13 @@ $(document).ready(function () {
typingTimer = setTimeout(makeRequest.bind(null, value), typingInterval);
} else {
$('#option-list').hide();
while (pol_element.firstChild) {
pol_element.removeChild(pol_element.firstChild);
}
OPT_LIST_IS_HIDDEN = true;
return
}
});
......@@ -306,7 +306,7 @@ $(document).ready(function () {
temp.content.querySelectorAll('span')[1].textContent = data.product.identifier;
temp.content.querySelectorAll('span')[2].textContent = data.product.size;
temp.content.querySelectorAll('span')[3].textContent = data.product.instrumentname;
var clone = document.importNode(temp.content, true);
document.querySelector('#product-list-globe').appendChild(clone);
}
......@@ -399,7 +399,7 @@ $(document).ready(function () {
productsToObtain = [];
data.product_list.forEach(function (product) {
var temp_2 = document.querySelector('#product_cart_2');
// filling template
temp_2.content.querySelector('li').id = product.uuid;
temp_2.content.querySelector('h4').id = product.uuid + "-h4";
......@@ -426,7 +426,7 @@ $(document).ready(function () {
}
});
// purchasing products in cart
$('#purchased-product-form').submit(function (event) {
event.preventDefault();
......
No preview for this file type
/home/geointdev/sidt-env/GeoSentinel/geosentinel/
\ No newline at end of file
/home/emmanuelhp/Documentos/GeoSentinel/geosentinel
\ No newline at end of file
Markdown is supported
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