Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ffbs/ffbs-website
  • darkbit/ffbs-website
2 results
Show changes
Showing
with 68 additions and 3719 deletions
This diff is collapsed.
File deleted
File deleted
File deleted
File deleted
File deleted
flamingo/static/img/index_ffbs_anschliessen.webp

26.5 KiB

flamingo/static/img/index_ffbs_router.webp

44.6 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
round = function (num, n) {
return Math.round(num * Math.pow(10,n)) / Math.pow(10,n);
}
writeHash = function () {
ll = map.getCenter().transform("EPSG:900913","EPSG:4326");
location.hash = '#'+map.getZoom()+'/'+round(ll.lat,4)+'/'+round(ll.lon,4);
}
map = new OpenLayers.Map("mapdiv", {
eventListeners: {"moveend": writeHash, "zoomend": writeHash}
});
map.addLayer(new OpenLayers.Layer.OSM());
var pois = new OpenLayers.Layer.Text( "Freifunk Braunschweig",
{ location:"/nodes.txt",
projection: map.displayProjection
});
map.addLayer(pois);
var layer_switcher= new OpenLayers.Control.LayerSwitcher({});
map.addControl(layer_switcher);
updateMap = function () {
var lon = null,lat = null,zoom = null
if (location.hash != "") {
list = location.hash.substr(1).split('/');
if (list.length == 3) {
zoom = parseInt(list[0]);
lat = parseFloat(list[1]);
lon = parseFloat(list[2]);
}
}
if (lon == null || lat == null || zoom == null) {
lon = 10.522;
lat = 52.2645;
zoom = 12;
}
var lonLat = new OpenLayers.LonLat(lon,lat).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject() );
map.setCenter(lonLat, zoom);
}
$(window).on('hashchange', updateMap)
updateMap();
$(function () {
$.get('/nodecount', function (ans) {
$('#nodecount').text(ans);
$('.nodecount').text(ans);
});
$.get('/clientcount', function (ans) {
$('#clientcount').text(ans);
$('.clientcount').text(ans);
});
});
$(function () {
$.get('/s0_finanz.json', function (ans) {
let types = [];
let bound = 0;
ans.appropriations.forEach(function (appr) {
if (appr.subject.indexOf('Freifunk') > -1) {
types = types.concat(appr.types);
bound += parseFloat(appr.amount);
}
});
$('#finanz_total').text(bound.toString());
const typeIds = types.map(function (typ) {
return ans.types.findIndex(function (t) { return t.indexOf(typ) > -1; });
});
const income = [];
const expense = [];
const labels = [];
for (let i = 1; i <= 12; i++) {
labels.unshift(ans.months[i].yearmonth);
for (let j = 0; j < typeIds.length; j++) {
((j%2) === 0 ? income : expense).unshift(Math.abs(parseFloat(ans.months[i].typeTotals[typeIds[j]])));
}
}
const ctx = document.getElementById('graph').getContext('2d');
const chart = new Chart(ctx, {
type: 'bar',
data: {
labels,
datasets: [{
backgroundColor: '#90ee90',
label: 'Einnahmen',
data: income
}, {
backgroundColor: '#ff6363',
label: 'Ausgaben',
data: expense
}],
},
options: {
scales: {
yAxes: [{
scaleLabel: {
display: true,
labelString: 'EUR',
},
ticks: {
beginAtZero: true,
},
}],
},
tooltips: {
callbacks: {
label: function (item) { return item.yLabel+''; },
},
},
},
});
});
});
File added
File added
File added