modules/freifunk: OSM in basics fixed thanks to Andreas Pittrich
authorManuel Munz <freifunk@somakoma.de>
Sat, 12 Mar 2011 17:13:36 +0000 (17:13 +0000)
committerManuel Munz <freifunk@somakoma.de>
Sat, 12 Mar 2011 17:13:36 +0000 (17:13 +0000)
22 files changed:
applications/luci-ffwizard/htdocs/luci-static/resources/OSMLatLon.htm [deleted file]
applications/luci-ffwizard/htdocs/luci-static/resources/osm.js [deleted file]
applications/luci-ffwizard/luasrc/view/cbi/osmll_value.htm [deleted file]
modules/freifunk/htdocs/luci-static/resources/OSMLatLon.htm [new file with mode: 0644]
modules/freifunk/htdocs/luci-static/resources/osm.js [new file with mode: 0644]
modules/freifunk/luasrc/model/cbi/freifunk/basics.lua
modules/freifunk/luasrc/view/cbi/osmll_value.htm [new file with mode: 0644]
po/ca/freifunk.po
po/de/freifunk.po
po/el/freifunk.po
po/en/freifunk.po
po/es/freifunk.po
po/fr/freifunk.po
po/it/freifunk.po
po/ja/freifunk.po
po/no/freifunk.po
po/pt/freifunk.po
po/pt_BR/freifunk.po
po/ru/freifunk.po
po/templates/freifunk.pot
po/vi/freifunk.po
po/zh_CN/freifunk.po

diff --git a/applications/luci-ffwizard/htdocs/luci-static/resources/OSMLatLon.htm b/applications/luci-ffwizard/htdocs/luci-static/resources/OSMLatLon.htm
deleted file mode 100644 (file)
index 30ad5bc..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!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 
-                       &nbsp;&nbsp;&nbsp;&nbsp;
-                       <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/applications/luci-ffwizard/htdocs/luci-static/resources/osm.js b/applications/luci-ffwizard/htdocs/luci-static/resources/osm.js
deleted file mode 100644 (file)
index 4138ef6..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-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.MouseDefaults(),
-                       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();
-}
diff --git a/applications/luci-ffwizard/luasrc/view/cbi/osmll_value.htm b/applications/luci-ffwizard/luasrc/view/cbi/osmll_value.htm
deleted file mode 100644 (file)
index 07bd758..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<%#
-cc-by-sa Andreas Pittrich <andreas.pittrich@web.de>
-in behalf of the german pirate party (Piratenpartei)
-www.piratenpartei.de
-
-$Id$
-
--%>
-<%+cbi/valueheader%>
-<script type="text/javascript">
-function set_lat_lon() {
-       var net
-       var entry
-       var lon
-       var lat
-       var zoom
-       net = document.getElementById('cbid.ffwizward.1.net').value;
-       if (!net){
-               return
-       }
-       
-       lon = document.getElementById('cbid.ffwizward.1.latlon.centerlon');
-       lat = document.getElementById('cbid.ffwizward.1.latlon.centerlat');
-       zoom = document.getElementById('cbid.ffwizward.1.latlon.zoom'); 
-       if ( !lon.value || lon.value == '' || lon.value == 0 || lon.value == 10 ) {
-               for ( var i = 0 ; true ; i++ ) {
-                       if (i == cbi_d.length) {
-                               break;
-                       }
-                       if (cbi_d[i].id == 'cbi-ffwizward-1-net_lon') {
-                               entry = cbi_d[i];
-                               for (var j=0; true; j++) {
-                                       if ( entry.node.children[0].children[j] ){
-                                               if ( entry.node.children[0].children[j].value == net ) {
-                                                       lon.value = entry.node.children[0].children[j].text;
-                                                       zoom.value = '14';
-                                                       break;
-                               }
-                                       } else {
-                                               break;
-                                       }
-                               }
-                               break;
-                       }
-               }
-       }
-       if ( !lat.value || lat.value == '' || lat.value == 0 || lat.value == 52 ) {
-               for (var i=0; true; i++) {
-                       if (i == cbi_d.length) {
-                               break;
-                       }
-                       if (cbi_d[i].id == 'cbi-ffwizward-1-net_lat') {
-                               entry = cbi_d[i];
-                               for (var j=0; true; j++) {
-                                       if ( entry.node.children[0].children[j] ){
-                                               if ( entry.node.children[0].children[j].value == net ) {
-                                                       lat.value = entry.node.children[0].children[j].text;
-                                                       break;
-                               }
-                                       } else {
-                                               break;
-                                       }                                       
-                               }
-                               break;
-                       }
-               }
-       }
-}
-</script>
-
-               <% if self:cfgvalue(section) ~= false then %>
-                       <% if self.latfield and self.lonfield then %>
-                               <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.latfield))..attr("id", cbid..".latfield")..attr("name", cbid..".latfield")%>/>
-                               <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.lonfield))..attr("id", cbid..".lonfield")..attr("name", cbid..".lonfield")%>/>
-                       <% end %>
-                       <input type="hidden" <%= attr("value", self.centerlat)..attr("id", cbid..".centerlat")..attr("name", cbid..".centerlat")%>/>
-                       <input type="hidden" <%= attr("value", self.centerlon)..attr("id", cbid..".centerlon")..attr("name", cbid..".centerlon")%>/>
-                       <input type="hidden" <%= attr("value", self.zoom)..attr("id", cbid..".zoom")..attr("name", cbid..".zoom")%>/>
-               <% end %>
-
-               <% if self.popup then %>
-                       <input class="cbi-input-button" type="button"<%= attr("name", cbid..".button")..attr("id", cbid..".button")..attr("value", self.displaytext)%> 
-                                       onclick="
-                                               popup=window.open('/luci-static/resources/OSMLatLon.htm', '<%=cbid%>.window', 'innerWidth=<%=self.width%>, innerHeight=<%=self.height%>, location=no, menubar=no, scrollbars=no, status=no, toolbar=no');
-                                               popup.focus();
-                                       "
-                       />
-       </div>
-       <div>           
-               <% else %>
-                       <input class="cbi-input-button" type="button"<%= attr("name", cbid..".displayosm")..attr("id", cbid..".displayosm")..attr("value", self.displaytext)%> 
-                                       onclick="
-                                               set_lat_lon();
-                                               document.getElementById('<%=cbid..".hideosm"%>').style.display='inline';
-                                               document.getElementById('<%=cbid..".displayosm"%>').style.display='none';
-                                               for(var i = 0; Math.min(i, window.frames.length)!=window.frames.lengths; i++){
-                                                       if(frames[i].name=='<%=cbid..".iframe"%>'){                                                             
-                                                               document.getElementById('<%=cbid..".iframediv"%>').style.display='block';
-                                                               frames[i].location.href='/luci-static/resources/OSMLatLon.htm';
-                                                       }
-                                                }
-                                       "
-                       />
-                       <input class="cbi-input-button" style="display:none" type="button"<%= attr("name", cbid..".hideosm")..attr("id", cbid..".hideosm")..attr("value", self.hidetext)%> 
-                                       onclick="
-                                               document.getElementById('<%=cbid..".displayosm"%>').style.display='inline';
-                                               document.getElementById('<%=cbid..".hideosm"%>').style.display='none';
-                                               document.getElementById('<%=cbid..".iframediv"%>').style.display='none';
-                                       "
-                       />
-       </div>
-       <div class="cbi-value-osmiframesection" id="<%=cbid..".iframediv"%>" style="display:none">
-                       <iframe src="" <%= attr("id", cbid..".iframe")..attr("name", cbid..".iframe")..attr("width", self.width)..attr("height", self.height)%> frameborder="0" scrolling="no"></iframe>
-               <%end%>
-
-<%+cbi/valuefooter%>
diff --git a/modules/freifunk/htdocs/luci-static/resources/OSMLatLon.htm b/modules/freifunk/htdocs/luci-static/resources/OSMLatLon.htm
new file mode 100644 (file)
index 0000000..30ad5bc
--- /dev/null
@@ -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 
+                       &nbsp;&nbsp;&nbsp;&nbsp;
+                       <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/freifunk/htdocs/luci-static/resources/osm.js b/modules/freifunk/htdocs/luci-static/resources/osm.js
new file mode 100644 (file)
index 0000000..4138ef6
--- /dev/null
@@ -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.MouseDefaults(),
+                       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();
+}
index 2c22f7b..247e881 100644 (file)
@@ -2,6 +2,7 @@
 LuCI - Lua Configuration Interface
 
 Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2011 Manuel Munz <freifunk at somakoma de>
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
@@ -15,6 +16,7 @@ local util = require "luci.util"
 local uci = require "luci.model.uci".cursor()
 local profiles = "/etc/config/profile_"
 
+
 m = Map("freifunk", translate ("Community"))
 c = m:section(NamedSection, "community", "public", nil, translate("These are the basic settings for your local wireless community. These settings define the default values for the wizard and DO NOT affect the actual configuration of the router."))
 
@@ -30,7 +32,12 @@ for k,v in ipairs(list) do
        community:value(n, name)
 end
 
+
 n = Map("system", translate("Basic system settings"))
+function n.on_after_commit(self)
+       luci.http.redirect(luci.dispatcher.build_url("admin", "freifunk", "basics"))
+end
+
 b = n:section(TypedSection, "system")
 b.anonymous = true
 
@@ -42,25 +49,31 @@ loc = b:option(Value, "location", translate("Location"))
 loc.rmempty = false
 
 lat = b:option(Value, "latitude", translate("Latitude"), translate("e.g.") .. " 48.12345")
+lat.datatype = "float"
 lat.rmempty = false
 
 lon = b:option(Value, "longitude", translate("Longitude"), translate("e.g.") .. " 10.12345")
+lon.datatype = "float"
 lon.rmempty = false
 
 --[[
 Opens an OpenStreetMap iframe or popup
 Makes use of resources/OSMLatLon.htm and htdocs/resources/osm.js
-(is that the right place for files like these?)
 ]]--
 
---[[ this needs to be fixed
 local class = util.class
-local co = "profile_augsburg"
-local syslat = uci:get_first(co, "community", "latitude")
-local syslon = uci:get_first(co, "community", "longitude")
-
-OpenStreetMapLonLat = class(AbstractValue)
+local ff = uci:get("freifunk", "community", "name") or ""
+local co = "profile_" .. ff
+
+local deflat = uci:get_first("system", "system", "latitude") or uci:get_first(co, "community", "latitude") or 52
+local deflon = uci:get_first("system", "system", "longitude") or uci:get_first(co, "community", "longitude") or 10
+local zoom = 12
+if ( deflat == 52 and deflon == 10 ) then
+       zoom = 4
+end
 
+OpenStreetMapLonLat = luci.util.class(AbstractValue)
+    
 function OpenStreetMapLonLat.__init__(self, ...)
        AbstractValue.__init__(self, ...)
        self.template = "cbi/osmll_value"
@@ -76,29 +89,16 @@ function OpenStreetMapLonLat.__init__(self, ...)
        self.hidetext="X" -- text on button, that hides OSMap
 end
 
-
-f = SimpleForm("ffwizward", "OpenStreetMap", "Hier kann man die Geokoordinaten des Knotens herausfinden.")
-
-osm = f:field(OpenStreetMapLonLat, "latlon", "Geokoordinaten mit OpenStreetMap ermitteln:", "Klicken Sie auf Ihren Standort in der Karte. Diese Karte funktioniert nur, wenn das Gerät bereits eine Verbindung zum Internet hat.")
-osm.latfield = "lat"
-osm.lonfield = "lon"
-osm.centerlat = syslat
-osm.centerlon = syslon
-osm.width = "100%"
-osm.height = "600"
-osm.popup = false
-
-syslatlengh = string.len(syslat)
-if syslatlengh > 7 then
-       osm.zoom = "15"
-elseif syslatlengh > 5 then
-       osm.zoom = "12"
-else
-       osm.zoom = "6"
-end
-
-osm.displaytext="OpenStreetMap anzeigen"
-osm.hidetext="OpenStreetMap verbergen"
-]]
+       osm = b:option(OpenStreetMapLonLat, "latlon", translate("Find your coordinates with OpenStreetMap"), translate("Select your location with a mouse click on the map. The map will only show up if you are connected to the Internet."))
+       osm.latfield = "latitude"
+       osm.lonfield = "longitude"
+       osm.centerlat = uci:get_first("system", "system", "latitude") or deflat
+       osm.centerlon = uci:get_first("system", "system", "longitude") or deflon
+       osm.zoom = zoom
+       osm.width = "100%"
+       osm.height = "600"
+       osm.popup = false
+       osm.displaytext=translate("Show OpenStreetMap")
+       osm.hidetext=translate("Hide OpenStreetMap")
 
 return m, n
diff --git a/modules/freifunk/luasrc/view/cbi/osmll_value.htm b/modules/freifunk/luasrc/view/cbi/osmll_value.htm
new file mode 100644 (file)
index 0000000..c368b67
--- /dev/null
@@ -0,0 +1,55 @@
+<%#
+cc-by-sa Andreas Pittrich <andreas.pittrich@web.de>
+in behalf of the german pirate party (Piratenpartei)
+www.piratenpartei.de
+
+$Id$
+
+-%>
+<%+cbi/valueheader%>
+
+               <% if self:cfgvalue(section) ~= false then %>
+                       <% if self.latfield and self.lonfield then %>
+                               <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.latfield))..attr("id", cbid..".latfield")..attr("name", cbid..".latfield")%>/>
+                               <input type="hidden" <%= attr("value", string.format('cbid.%s.%s.%s', self.config, section, self.lonfield))..attr("id", cbid..".lonfield")..attr("name", cbid..".lonfield")%>/>
+                       <% end %>
+                       <input type="hidden" <%= attr("value", self.centerlat)..attr("id", cbid..".centerlat")..attr("name", cbid..".centerlat")%>/>
+                       <input type="hidden" <%= attr("value", self.centerlon)..attr("id", cbid..".centerlon")..attr("name", cbid..".centerlon")%>/>
+                       <input type="hidden" <%= attr("value", self.zoom)..attr("id", cbid..".zoom")..attr("name", cbid..".zoom")%>/>
+               <% end %>
+
+               <% if self.popup then %>
+                       <input class="cbi-input-button" type="button"<%= attr("name", cbid..".button")..attr("id", cbid..".button")..attr("value", self.displaytext)%> 
+                                       onclick="
+                                               popup=window.open('/luci-static/resources/OSMLatLon.htm', '<%=cbid%>.window', 'innerWidth=<%=self.width%>, innerHeight=<%=self.height%>, location=no, menubar=no, scrollbars=no, status=no, toolbar=no');
+                                               popup.focus();
+                                       "
+                       />
+       </div>
+       <div>           
+               <% else %>
+                       <input class="cbi-input-button" type="button"<%= attr("name", cbid..".displayosm")..attr("id", cbid..".displayosm")..attr("value", self.displaytext)%> 
+                                       onclick="
+                                               document.getElementById('<%=cbid..".hideosm"%>').style.display='inline';
+                                               document.getElementById('<%=cbid..".displayosm"%>').style.display='none';
+                                               for(var i = 0; Math.min(i, window.frames.length)!=window.frames.lengths; i++){
+                                                       if(frames[i].name=='<%=cbid..".iframe"%>'){                                                             
+                                                               document.getElementById('<%=cbid..".iframediv"%>').style.display='block';
+                                                               frames[i].location.href='/luci-static/resources/OSMLatLon.htm';
+                                                       }
+                                                }
+                                       "
+                       />
+                       <input class="cbi-input-button" style="display:none" type="button"<%= attr("name", cbid..".hideosm")..attr("id", cbid..".hideosm")..attr("value", self.hidetext)%> 
+                                       onclick="
+                                               document.getElementById('<%=cbid..".displayosm"%>').style.display='inline';
+                                               document.getElementById('<%=cbid..".hideosm"%>').style.display='none';
+                                               document.getElementById('<%=cbid..".iframediv"%>').style.display='none';
+                                       "
+                       />
+       </div>
+       <div class="cbi-value-osmiframesection" id="<%=cbid..".iframediv"%>" style="display:none">
+                       <iframe src="" <%= attr("id", cbid..".iframe")..attr("name", cbid..".iframe")..attr("width", self.width)..attr("height", self.height)%> frameborder="0" scrolling="no"></iframe>
+               <%end%>
+
+<%+cbi/valuefooter%>
index 8517b38..35b84a0 100644 (file)
@@ -98,6 +98,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -116,6 +122,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Hola i benvingut a la xarxa de"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -253,9 +262,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -361,6 +378,11 @@ msgstr "Pots trobar més informació sobre la iniciativa global Freifunk a"
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 3d0eff0..4fa645f 100644 (file)
@@ -3,7 +3,7 @@ msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: \n"
-"PO-Revision-Date: 2011-02-11 21:42+0100\n"
+"PO-Revision-Date: 2011-03-12 15:13+0100\n"
 "Last-Translator: Manuel Munz <freifunk@somakoma.de>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
@@ -99,6 +99,12 @@ msgstr "Splash-Text bearbeiten"
 msgid "Edit index page"
 msgstr "Indexseite bearbeiten"
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr "Geokoordinaten mit OpenStreetMap ermitteln"
+
 msgid "Freifunk"
 msgstr ""
 
@@ -117,6 +123,9 @@ msgstr "Gehe zu"
 msgid "Hello and welcome in the network of"
 msgstr "Hallo und willkommen im Netz von"
 
+msgid "Hide OpenStreetMap"
+msgstr "OpenStreetMap ausblenden"
+
 msgid "Homepage"
 msgstr ""
 
@@ -259,9 +268,19 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+"Wähle hier deinen Standort durch einen Mausklick aus. Die Karte funktioniert "
+"nur, wenn bereits eine Verbindung zum Internet besteht."
+
 msgid "Services"
 msgstr "Dienste"
 
+msgid "Show OpenStreetMap"
+msgstr "OpenStreetMap anzeigen"
+
 msgid "Signal"
 msgstr ""
 
@@ -384,6 +403,13 @@ msgstr "Weitere Informationen zur globalen Freifunkinitiative findest du unter"
 msgid "You can manually edit the selected community profile here."
 msgstr "Hier kann das ausgewählte Community-Profil bearbeitet werden."
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+"Es muss ein Profil ausgewählt werden, bevor es editiert werden kann. Gehe "
+"dazu zur Seite"
+
 msgid "and fill out all required fields."
 msgstr "und fülle alle benötigten Felder aus."
 
index 8af8a13..726495f 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Γεια σας και καλώς ήλθατε στο δίκτυο"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -249,9 +258,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -360,6 +377,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 61e1a8f..d8853ca 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Hello and welcome in the network of"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -249,9 +258,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -359,6 +376,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 825fa49..b15377b 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Hola y bienvenido a la red de"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -251,9 +260,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -360,6 +377,11 @@ msgstr "Puede obtener información acrca de la iniciativaglobal Freifunk en"
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index a16e17b..814b52e 100644 (file)
@@ -97,6 +97,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -115,6 +121,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -248,9 +257,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -355,6 +372,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 22cb689..f3b27de 100644 (file)
@@ -97,6 +97,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -115,6 +121,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -248,9 +257,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -355,6 +372,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index a16e17b..814b52e 100644 (file)
@@ -97,6 +97,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -115,6 +121,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -248,9 +257,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -355,6 +372,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index ecb1c83..eb324a6 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Hei og velkommen i nettverket av"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -251,9 +260,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -360,6 +377,11 @@ msgstr "Du finner mer informasjon om den globale Freifunk initiativ på"
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 32c7980..9f8fe5c 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Olá e benvindo à rede "
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -251,9 +260,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -360,6 +377,11 @@ msgstr "Pode encontrar mais informações sobre a iniciativa global Freifunk em
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index aad9a7c..5ca5421 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Olá e benvindo à rede "
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -251,9 +260,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -360,6 +377,11 @@ msgstr "Pode encontrar mais informações sobre a iniciativa global Freifunk em
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index a16e17b..814b52e 100644 (file)
@@ -97,6 +97,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -115,6 +121,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -248,9 +257,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -355,6 +372,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index bee7a58..130e5ec 100644 (file)
@@ -85,6 +85,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -103,6 +109,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -236,9 +245,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -343,6 +360,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
index 62d3439..8abb27f 100644 (file)
@@ -98,6 +98,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -116,6 +122,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr "Xin chào và chào mừng gia nhập mạng lưới của"
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -252,9 +261,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -359,6 +376,11 @@ msgstr "Bạn có thể tìm thấy thông tin về Freifunk toàn cầu tại "
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
@@ -400,12 +422,3 @@ msgstr "danh sách trắng"
 
 msgid "wireless settings"
 msgstr ""
-
-
-
-
-
-
-
-
-
index 2a566f0..62b4d27 100644 (file)
@@ -96,6 +96,12 @@ msgstr ""
 msgid "Edit index page"
 msgstr ""
 
+msgid "Error"
+msgstr ""
+
+msgid "Find your coordinates with OpenStreetMap"
+msgstr ""
+
 msgid "Freifunk"
 msgstr ""
 
@@ -114,6 +120,9 @@ msgstr ""
 msgid "Hello and welcome in the network of"
 msgstr ""
 
+msgid "Hide OpenStreetMap"
+msgstr ""
+
 msgid "Homepage"
 msgstr ""
 
@@ -247,9 +256,17 @@ msgstr ""
 msgid "Save"
 msgstr ""
 
+msgid ""
+"Select your location with a mouse click on the map. The map will only show "
+"up if you are connected to the Internet."
+msgstr ""
+
 msgid "Services"
 msgstr ""
 
+msgid "Show OpenStreetMap"
+msgstr ""
+
 msgid "Signal"
 msgstr ""
 
@@ -354,6 +371,11 @@ msgstr ""
 msgid "You can manually edit the selected community profile here."
 msgstr ""
 
+msgid ""
+"You need to select a profile before you can edit it. To select a profile go "
+"to"
+msgstr ""
+
 msgid "and fill out all required fields."
 msgstr ""
 
@@ -395,5 +417,3 @@ msgstr ""
 
 msgid "wireless settings"
 msgstr ""
-
-