summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-freifunk/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-12-03 15:17:05 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-08 16:26:20 +0100
commit1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch)
tree35e16f100466e4e00657199b38bb3d87d52bf73f /modules/luci-mod-freifunk/htdocs/luci-static
parent9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff)
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-mod-freifunk/htdocs/luci-static')
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/flashing.html84
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/resources/OSMLatLon.htm20
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/resources/flashing.gifbin0 -> 4261 bytes
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/hna.gifbin0 -> 209 bytes
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/node.gifbin0 -> 209 bytes
-rw-r--r--modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js130
6 files changed, 234 insertions, 0 deletions
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/flashing.html b/modules/luci-mod-freifunk/htdocs/luci-static/flashing.html
new file mode 100644
index 0000000000..43e51236d7
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/flashing.html
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>LuCI - System Upgrade</title>
+
+ <style type="text/css">
+ body {
+ background-color: #CCCCCC;
+ font-family: sans-serif;
+ font-size: 90%;
+ padding-left: 50%;
+ padding-top: 100px;
+ }
+
+ h2 {
+ font-size: 110%;
+ margin: 5px 5px 0.5em 5px;
+ border-bottom: 1px dotted #0066CC;
+ color: #0066CC;
+ }
+
+ p {
+ font-size: 95%;
+ margin: 15px 15px 0.5em 15px;
+ }
+
+ div {
+ background-color: #F7F7F7;
+ border: 1px dotted #000000;
+ width: 600px;
+ height: 150px;
+ margin-left: -300px;
+ }
+
+ em {
+ color: #555555;
+ }
+ </style>
+
+ <script type="text/javascript"><!--
+ var time_remaining = 60 * 25;
+ var interval = window.setInterval(function() {
+ if( time_remaining <= 0 )
+ {
+ window.clearInterval(interval);
+ location.href = 'http://' + location.hostname + '/';
+ }
+ else
+ {
+ var minutes = Math.floor(time_remaining / 60);
+ var seconds = time_remaining % 60;
+ var label = document.getElementById('time_remaining');
+
+ if( label )
+ {
+ label.innerHTML =
+ ( minutes > 0 ? minutes + 'm ' : '' ) +
+ seconds + 's';
+ }
+ }
+
+ time_remaining = time_remaining - 1;
+ }, 1000);
+ --></script>
+</head>
+
+<body class="lang_en">
+ <div>
+ <h2>Performing Upgrade</h2>
+
+ <p>
+ The System is flashing now. The procedure can take up to 25 minutes,
+ please be patient and wait until this page reloads itself.
+
+ <br /><img src="resources/flashing.gif" style="vertical-align:middle; margin:10px" />
+
+ <em>Remaining time (estimated): <span id="time_remaining">unknown</span></em>
+ </p>
+ </div>
+</body>
+
+</html>
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/OSMLatLon.htm b/modules/luci-mod-freifunk/htdocs/luci-static/resources/OSMLatLon.htm
new file mode 100644
index 0000000000..18be30be35
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/OSMLatLon.htm
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+
+<head>
+ <title>OpenStreetMap</title>
+ <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
+ <script type="text/javascript" src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
+ <script type="text/javascript" src="osm.js"></script>
+</head>
+<body onload="init();drawmap();" style="padding:0px; margin:0px">
+ <div id="map"></div>
+ <div style="position:absolute; bottom:0%; width:100%; background:url('cbi/black_60.png'); font-size:10px; color:#fff;z-index:1000">
+ Map by <a href="http://www.openstreetmap.org" title="www.openstreetmap.org" style="color:#fff;" >openstreetmap.org</a>, License CC-BY-SA
+ &#160;&#160;&#160;&#160;
+ <span id="osm">
+ Latitude: <input id="osmlat" name="osmlat" type="text" size="20" style="font-size:10px;">
+ Longitude: <input id="osmlon" name="osmlon" type="text" size="20" style="font-size:10px;">
+ </span>
+ </div>
+
+</body>
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/flashing.gif b/modules/luci-mod-freifunk/htdocs/luci-static/resources/flashing.gif
new file mode 100644
index 0000000000..e207fc56a1
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/flashing.gif
Binary files differ
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif
new file mode 100644
index 0000000000..818780d153
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/hna.gif
Binary files differ
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/node.gif b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/node.gif
new file mode 100644
index 0000000000..f64ab162a4
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/freifunk-map/node.gif
Binary files differ
diff --git a/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js b/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js
new file mode 100644
index 0000000000..cae0cd66f7
--- /dev/null
+++ b/modules/luci-mod-freifunk/htdocs/luci-static/resources/osm.js
@@ -0,0 +1,130 @@
+var map;
+var layer_mapnik;
+var layer_tah;
+var layer_markers;
+var PI = Math.PI;
+var latfield = '';
+var lonfield = '';
+var latfield_id='';
+var lonfield_id='';
+var centerlon = 10;
+var centerlat = 52;
+var zoom = 6;
+
+function lon2merc(lon) {
+ return 20037508.34 * lon / 180;
+}
+
+function lat2merc(lat) {
+ lat = Math.log(Math.tan( (90 + lat) * PI / 360)) / PI;
+ return 20037508.34 * lat;
+}
+
+function merc2lon(lon) {
+ return lon*180/20037508.34;
+};
+
+function merc2lat(lat) {
+ return Math.atan(Math.exp(lat*PI/20037508.34))*360/PI-90;
+};
+
+OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
+ defaultHandlerOptions: {
+ 'single': true,
+ 'double': false,
+ 'pixelTolerance': 0,
+ 'stopSingle': false,
+ 'stopDouble': false
+ },
+
+ initialize: function(options) {
+ this.handlerOptions = OpenLayers.Util.extend(
+ {}, this.defaultHandlerOptions
+ );
+ OpenLayers.Control.prototype.initialize.apply(
+ this, arguments
+ );
+ this.handler = new OpenLayers.Handler.Click(
+ this, {
+ 'click': this.trigger
+ }, this.handlerOptions
+ );
+ },
+
+ trigger: function(e) {
+ var lonlat = map.getLonLatFromViewPortPx(e.xy);
+ lat=merc2lat(lonlat.lat);
+ lon=merc2lon(lonlat.lon);
+ if(parent.document.getElementById(latfield_id)==null){
+ latfield=document.getElementById('osmlat');
+ }else{
+ latfield=parent.document.getElementById(latfield_id);
+ }
+ if(parent.document.getElementById(lonfield_id)==null){
+ lonfield=document.getElementById('osmlon');
+ }else{
+ lonfield=parent.document.getElementById(lonfield_id);
+ }
+ latfield.value = lat;
+ lonfield.value = lon;
+ }
+});
+
+function init(){
+ var field = window.name.substring(0, window.name.lastIndexOf("."));
+ if(parent.document.getElementById(field+".latfield")!=null){
+ latfield_id = parent.document.getElementById(field+".latfield").value;
+ document.getElementById('osm').style.display="none";
+ }
+ if(parent.document.getElementById(field+".lonfield")!=null){
+ lonfield_id = parent.document.getElementById(field+".lonfield").value;
+ }
+ if(parent.document.getElementById(field+".centerlat")!=null){
+ centerlat =parseFloat(parent.document.getElementById(field+".centerlat").value);
+ }
+ if(parent.document.getElementById(field+".centerlon")!=null){
+ centerlon = parseFloat(parent.document.getElementById(field+".centerlon").value);
+ }
+ if(parent.document.getElementById(field+".zoom")!=null){
+ zoom = parseFloat(parent.document.getElementById(field+".zoom").value);
+ }
+}
+
+function drawmap() {
+ OpenLayers.Lang.setCode('de');
+ mapdiv=document.getElementById('map');
+ mapdiv.style.height=window.innerHeight+"px";
+ mapdiv.style.width=window.innerWidth+"px";
+ map = new OpenLayers.Map('map', {
+ projection: new OpenLayers.Projection("EPSG:900913"),
+ displayProjection: new OpenLayers.Projection("EPSG:4326"),
+ controls: [
+ new OpenLayers.Control.Navigation(),
+ new OpenLayers.Control.PanZoomBar()],
+ maxExtent:
+ new OpenLayers.Bounds(-20037508.34,-20037508.34, 20037508.34, 20037508.34),
+ numZoomLevels: 18,
+ maxResolution: 156543,
+ units: 'meters'
+ });
+
+ layer_mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");
+
+ map.addLayers([layer_mapnik]);
+ var y =lat2merc(centerlat);
+ var x =lon2merc(centerlon);
+ map.setCenter(new OpenLayers.LonLat(x, y), zoom);
+
+ // Check for geolocation support
+ if(navigator.geolocation){
+ navigator.geolocation.getCurrentPosition(function(position){
+ var y =lat2merc(position.coords.latitude);
+ var x =lon2merc(position.coords.longitude);
+ map.setCenter(new OpenLayers.LonLat(x, y), '17');
+ });
+ }
+
+ var click = new OpenLayers.Control.Click();
+ map.addControl(click);
+ click.activate();
+}