luci-0.10: merge r7161, r7162, r7163, r7164, r7165 and r7166
authorJo-Philipp Wich <jow@openwrt.org>
Fri, 17 Jun 2011 11:00:38 +0000 (11:00 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Fri, 17 Jun 2011 11:00:38 +0000 (11:00 +0000)
applications/luci-firewall/luasrc/model/cbi/luci_fw/zone.lua
applications/luci-splash/root/usr/lib/luci-splash/splashtext.html
libs/web/htdocs/luci-static/resources/cbi.js
libs/web/luasrc/cbi/datatypes.lua
modules/freifunk/root/etc/config/profile_gadow [new file with mode: 0644]
themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css [new file with mode: 0644]
themes/freifunk-generic/luasrc/view/themes/freifunk-generic/header.htm

index 30dc0084bcdc3e55f9d7ac27f88865314578c4e4..2bcb9a9802e70823af036c96fbba9ba78d9a11e1 100644 (file)
@@ -129,7 +129,7 @@ msrc = s:taboption("advanced", DynamicList, "masq_src",
        translate("Restrict Masquerading to given source subnets"))
 
 msrc.optional = true
-msrc.datatype = "host" -- XXX: ipaddr & uciname
+msrc.datatype = "neg_network_ip4addr"
 msrc.placeholder = "0.0.0.0/0"
 msrc:depends("family", "")
 msrc:depends("family", "ipv4")
@@ -138,7 +138,7 @@ mdest = s:taboption("advanced", DynamicList, "masq_dest",
        translate("Restrict Masquerading to given destination subnets"))
 
 mdest.optional = true
-mdest.datatype = "host" -- XXX: ipaddr & uciname
+mdest.datatype = "neg_network_ip4addr"
 mdest.placeholder = "0.0.0.0/0"
 mdest:depends("family", "")
 mdest:depends("family", "ipv4")
index 811c8a8af7df3ff2759de012c6aa4960e74ec28d..8075393e7974d3f713de396751daeb01fcbe8916 100644 (file)
@@ -18,7 +18,7 @@ Wenn Du unsere Idee gut findest und das Netz regelmässig benutzt, dann bitten w
 <ul>
 <li><a href="###COMMUNITY_URL###">Werde selbst Freifunker oder teile deinen Internetzugang!</a></li>
 <li>Spende ein paar Euro, damit wir unser Netz weiter betreiben und ausbauen können.</li>
-<li>Wenn Du selbst privat genutzte WLAN-Geräte betreibst nutze dafür bitte andere Kanäle als wir.</li>
+<li>Wenn Du andere WLAN-Geräte betreibst nutze dafür bitte andere Kanäle als wir.</li>
 </ul>
 
 <p>
index a8814d451fc44e3c7bd2d5fa00161b807f52d4b1..1cd49bc65d8b23776745d08f95473af3dd7cd3ca 100644 (file)
@@ -2,7 +2,7 @@
        LuCI - Lua Configuration Interface
 
        Copyright 2008 Steven Barth <steven@midlink.org>
-       Copyright 2008-2010 Jo-Philipp Wich <xm@subsignal.org>
+       Copyright 2008-2011 Jo-Philipp Wich <xm@subsignal.org>
 
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
@@ -153,6 +153,8 @@ var cbi_validators = {
        'hostname': function(v)
        {       if ( v.length <= 253 )
                        return (v.match(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*[a-zA-Z0-9]$/) != null);
+
+               return false;
        },
 
        'wpakey': function(v)
@@ -179,6 +181,12 @@ var cbi_validators = {
                return (v.match(/^[a-zA-Z0-9_]+$/) != null);
        },
 
+       'neg_network_ip4addr': function(v)
+       {
+               v = v.replace(/^\s*!/, "");
+               return cbi_validators.uciname(v) || cbi_validators.ip4addr(v);          
+       },
+
        'range': function(v, args)
        {
                var min = parseInt(args[0]);
@@ -188,6 +196,28 @@ var cbi_validators = {
                if (!isNaN(min) && !isNaN(max) && !isNaN(val))
                        return ((val >= min) && (val <= max));
 
+               return false;
+       },
+
+       'min': function(v, args)
+       {
+               var min = parseInt(args[0]);
+               var val = parseInt(v);
+
+               if (!isNaN(min) && !isNaN(val))
+                       return (val >= min);
+
+               return false;
+       },
+
+       'max': function(v, args)
+       {
+               var max = parseInt(args[0]);
+               var val = parseInt(v);
+
+               if (!isNaN(max) && !isNaN(val))
+                       return (val <= max);
+
                return false;
        }
 };
index d4603cf2a388403d8988d2aec3e9d91a52ab0676..6640db639251769de94b9214ed0b17f3b1ea3afc 100644 (file)
@@ -227,6 +227,13 @@ function uciname(val)
        return (val:match("^[a-zA-Z0-9_]+$") ~= nil)
 end
 
+function neg_network_ip4addr(val)
+       if type(v) == "string" then
+               v = v:gsub("^%s*!", "")
+               return (uciname(v) or ip4addr(v))
+       end     
+end
+
 function range(val, min, max)
        val = tonumber(val)
        min = tonumber(min)
@@ -238,3 +245,25 @@ function range(val, min, max)
 
        return false
 end
+
+function min(val, min)
+       val = tonumber(val)
+       min = tonumber(min)
+
+       if val ~= nil and min ~= nil then
+               return (val >= min)
+       end
+
+       return false
+end
+
+function max(val, max)
+       val = tonumber(val)
+       max = tonumber(max)
+
+       if val ~= nil and max ~= nil then
+               return (val <= max)
+       end
+
+       return false
+end
diff --git a/modules/freifunk/root/etc/config/profile_gadow b/modules/freifunk/root/etc/config/profile_gadow
new file mode 100644 (file)
index 0000000..5b963bc
--- /dev/null
@@ -0,0 +1,14 @@
+config 'community' 'profile'
+       option 'name' 'Freifunk Gadow'
+       option 'homepage' 'http://gadow.freifunk.net'
+       option 'ssid' 'leipzig.freifunk.net'
+       option 'mesh_network' '104.0.0.0/8'
+       option 'splash_network' '10.61.0.0/16'
+       option 'splash_prefix' '27'
+       option 'latitude' '53.11'
+       option 'longitude' '12.61'
+
+config 'defaults' 'interface'
+       option 'netmask' '255.0.0.0'
+
+
diff --git a/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css b/themes/freifunk-generic/htdocs/luci-static/freifunk-generic/mobile.css
new file mode 100644 (file)
index 0000000..8649b34
--- /dev/null
@@ -0,0 +1,135 @@
+.high_res_only{
+       display:none !important;
+}
+
+#main_bg_pattern {
+       position:absolute;
+       background: url(images/PF_background_pattern.png) repeat-x;
+       top:0px;
+       left:0px;
+       width:980px;
+       z-index:0;              
+}
+
+#main_bg {
+    min-height:2000px;
+}
+
+#heading{
+       margin-left:285px !important;
+}
+
+#header{
+       padding-left:0px !important;
+       padding-bottom:24px;
+}
+
+#menubar{
+    font-size:35px;
+}
+
+
+               #maincontent .multiColumn {
+                       margin:1em 0px;
+                       width:100%;
+               }
+
+               #maincontent .multiColumn .first{
+                       width:100% !important;
+                       float:none !important;
+                       display:block !important;
+                       padding-right:0px;
+               }
+
+               #maincontent .multiColumn .second{
+                       width:100% !important;
+                       float:none !important;
+                       display:block !important;
+                       padding-right:0px;
+               }
+               #maincontent .multiColumn .terminateMultiColumn{
+                       clear:both;
+                       float:none;
+                       display:block;
+                       text-align:left !important;
+                       padding-top:2em;
+               }
+
+               #maincontent ul{
+                       margin-bottom:1em;
+               }
+
+
+
+
+
+#sidebar_container{
+       display:none;
+}
+
+#adbar_low_res_container{
+       display:block !important;
+}
+#main_content_container{
+       margin-top:50px !important;
+}
+
+.lt_spec{
+       padding:0px;
+       width:54px;
+       height:42px;
+       background:transparent url(images/lt_round.png) no-repeat 0% 0% !important;
+}
+
+#content {
+       margin-left:0px !important; 
+}
+
+#maincontent{
+       font-size:35px!important;
+       line-height:40px;
+}
+
+input[type=submit],
+.cbi-button,
+.cbi-button-reset,
+.cbi-button-save{
+       display:inline !important;
+       float:none !important;
+       padding:10px 30px !important;
+       margin: 0px 10px !important;
+       font-size:45px !important;
+       font-family: impact, sans-serif !important;
+       background:#ff8800 none !important;
+       border-color:#000000 !important;
+}
+
+.cbi-input-text,
+.cbi-input-select,
+.cbi-input-user,
+.cbi-input-password{
+       display:block !important;
+       font-size:35px  !important;
+       margin: 0 !important;
+       padding:0 !important;
+}
+
+.cbi-value-field{
+       font-size:35px;
+       margin:0 !important;
+       margin-bottom: 1em !important;
+       width:100%  !important; 
+}
+
+.cbi-section legend{
+       white-space:normal !important;
+}
+.cbi-section code{
+       font-size:24px;
+}
+
+.cbi-value-title{
+       font-size:35px;
+       font-weight:bold;
+       float:none !important;
+}
index 9dbcf9ff3cc400413f56e8574516ed114cd77c5e..11c7de50eb722b448a48c6614517fbd63d20d5a1 100644 (file)
@@ -68,6 +68,8 @@ require("luci.http").prepare_content("application/xhtml+xml")
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="Content-Script-Type" content="text/javascript" />
 <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
+<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="<%=media%>/mobile.css" type="text/css" />
+<link rel="stylesheet" media="handheld" href="<%=media%>/mobile.css" type="text/css" /> 
 <!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/ie7.css" /><![endif]-->
 <% if node and node.css then %><link rel="stylesheet" type="text/css" media="screen" href="<%=resource%>/<%=node.css%>" />
 <% end -%>