freifunkmanager/js/menu.js

52 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-07-01 08:25:32 +02:00
define(function(){
return function(el,store){
2016-07-01 16:01:28 +02:00
menu = document.createElement("header");
menu.classList.add("menu");
right = document.createElement("div");
right.classList.add("icons");
menu.appendChild(right);
el.appendChild(menu);
2016-07-01 08:25:32 +02:00
2016-07-01 16:01:28 +02:00
var buttonList = document.createElement("i");
buttonList.innerHTML = "";
2016-07-01 08:25:32 +02:00
buttonList.onclick = function () {
2016-07-01 16:01:28 +02:00
window.location.href = "#list";
};
right.appendChild(buttonList);
2016-07-01 08:25:32 +02:00
2016-07-01 16:01:28 +02:00
var buttonMap = document.createElement("i");
buttonMap.innerHTML = '\uf278';
2016-07-01 08:25:32 +02:00
buttonMap.onclick = function () {
2016-07-01 16:01:28 +02:00
window.location.href = "#map";
};
right.appendChild(buttonMap);
2016-07-01 08:25:32 +02:00
2016-07-01 16:01:28 +02:00
var buttonStatistic = document.createElement("i");
buttonStatistic.classList.add("mini");
buttonStatistic.innerHTML = "";
2016-07-01 08:25:32 +02:00
buttonStatistic.onclick = function () {
2016-07-01 16:01:28 +02:00
window.location.href = "#grafana";
};
right.appendChild(buttonStatistic);
2016-07-01 08:25:32 +02:00
2016-07-01 16:01:28 +02:00
var buttonMeshviewer = document.createElement("i");
buttonMeshviewer.classList.add("mini");
buttonMeshviewer.innerHTML = '\uf279';
buttonMeshviewer.onclick = function () {
window.location.href = "#meshviewer";
};
right.appendChild(buttonMeshviewer);
2016-07-01 08:25:32 +02:00
2016-07-01 16:01:28 +02:00
var buttonRefresh = document.createElement("i");
buttonRefresh.innerHTML = "";
var refreshtime = document.createElement("span");
store.setTimeSinceUpdate(refreshtime);
buttonRefresh.appendChild(refreshtime);
2016-07-01 08:25:32 +02:00
buttonRefresh.onclick = function () {
2016-07-01 16:01:28 +02:00
store.refresh();
};
right.appendChild(buttonRefresh);
};
});