Browse Source

changed map attributions, index.py no longer saves a html copy

pull/3/head
rscmbbng 11 years ago
parent
commit
39335190a5
  1. 19
      web/index.py
  2. 10
      web/js/bc.js

19
web/index.py

@ -6,8 +6,8 @@ GPLv3 - 2013 by psy (epsylon@riseup.net)
"""
from xml.dom.minidom import parseString
import xml.etree.ElementTree as ET
# extract data from a xml file
# try:
f = open('data.xml', 'r')
f2 = open('data.xml', 'r')
xml = ET.parse(f)
@ -50,7 +50,7 @@ for counter in range(0, last_hop+1):
unique_country_code_list = set(country_code_list)
x = open('testmap.html','w')
# HTML + JS container
output = """
<html>
@ -88,10 +88,9 @@ output = """
<div id="button"> > </div>
<div class = info>
<div> <img src='images/bclogo.png'></img></div>
<div id='info-text'><p>Border Check (BC) allows you to see all the servers you visit while you browse to a specific website.</p>
<p>As one surfs the net, data packets are sent from the user's computer to the target server. These data packets go on a journey hopping from server to server, potentially crossing multiple countries, until the packets reach the desired website. In each of the countries that are passed different laws and practices can apply to the data, influencing whether or not authorities can inspect, store or modify that data.</p>
<p>In realtime BC lets you know which countries you surf through as you browse the web. Additionally BC will illustrate this process on a world map and (where available) provide you with contextualizing information on that country's laws and practices regarding your data.</p>
<p>Currently supporting the following browsers on OSX and Unix systems: <br /> Firefox, Chromium, Chrome, Safari</p>
<div id='info-text'><p>Border Check allows you to retrace your path across the internet's infrastructure, it will map you all the servers you pass while you browse to a specific website.</p>
As you surf the net, data packets are sent from your computer to the target server. These data packets go on a journey hopping from server to server, potentially crossing multiple countries and networks, until the packets reach the desired website. In each of the countries different laws and practices can apply to the data, influencing whether or not authorities can inspect, store or modify that data. </p>
<div>
</div>
</div>
@ -110,10 +109,4 @@ output = """
unique_country_code_list = """+str(list(unique_country_code_list))+"""
</script>
</html>
"""
x.write(output)
x.close
# except:
# output = """
# <html> loading </html>
# """
"""

10
web/js/bc.js

@ -1,6 +1,8 @@
window.onload = function () {
index = 0
cables = L.tileLayer('http://{s}.tiles.mapbox.com/v3/rllfff.kaart-drie/{z}/{x}/{y}.png')
cables = L.tileLayer('http://{s}.tiles.mapbox.com/v3/rllfff.kaart-drie/{z}/{x}/{y}.png',{
attribution: 'Cable data: <a href="http://cablemap.info/">cablemap.info</a>'
})
blank_map = L.tileLayer('http://{s}.tiles.mapbox.com/v3/rllfff.blank-populations/{z}/{x}/{y}.png')
osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
@ -9,8 +11,7 @@ window.onload = function () {
minZoom: 2,
maxZoom:6,
zoomControl:false,
layers: [osm, cables, blank_map]
layers: [blank_map]
}).setView(latlong[index], 3);
blank_map.addTo(map)
@ -27,6 +28,7 @@ window.onload = function () {
new L.Control.Zoom({
position: 'topright'}
).addTo(map)
new L.Control.Attribution
//custom markers:
@ -105,7 +107,7 @@ window.onload = function () {
var marker = L.marker([src[0], src[1]],{icon: makeCustomMarker(index)})
var popup = L.Popup({
maxHeight: 50})
var popupcontent = "<p>Hop no:"+hop_list[index]+"<br />Server name:<br />"+server_name_list[index]+"<br />Network owner:<br />"+asn_list[index]+"</p>"
var popupcontent = "Server name:<br /><b>"+server_name_list[index]+"</b><br />Network owner:<br /><b>"+asn_list[index]+"</b></p>"
marker.bindPopup(popupcontent)
AddMarkerCluster(marker, index)
}

Loading…
Cancel
Save