wifi sta picker improvements and better transl

pull/30/head
Ondřej Hruška 8 years ago
parent 812feebf54
commit 3f09cc3601
  1. 22
      html_orig/css/app.css
  2. 2
      html_orig/lang/en.php
  3. 17
      html_orig/pages/cfg_wifi.php
  4. 22
      html_orig/sass/layout/_box.scss
  5. 2
      html_orig/sass/pages/_wifi.scss

@ -504,15 +504,17 @@ ul > * {
max-width: 1200px; } max-width: 1200px; }
.Box.str { .Box.str {
position: relative; } position: relative; }
.Box.str .Row.mq-phone { .Box.str .Row.buttons {
position: absolute; position: absolute; }
right: 1rem; @media screen and (max-width: 544px) {
margin: 1rem auto; } .Box.str .Row.buttons {
.Box.str .Row.mq-no-phone { right: 1rem;
position: absolute; margin: 1rem auto; } }
right: 0; @media screen and (min-width: 545px) {
top: 0; .Box.str .Row.buttons {
margin-top: 0.61805rem; } right: 0;
top: 0;
margin-top: 0.61805rem; } }
@media screen and (max-width: 544px) { @media screen and (max-width: 544px) {
.Box.mobcol h2 { .Box.mobcol h2 {
@ -956,7 +958,7 @@ form span.required {
.AP-preview .wrap .forget:active { .AP-preview .wrap .forget:active {
position: relative; position: relative;
padding-top: calc(0.61805rem + 1px); } padding-top: calc(0.61805rem + 1px); }
.AP-preview .wrap .essid, .AP-preview .wrap .passwd { .AP-preview .wrap .essid, .AP-preview .wrap .passwd, .AP-preview .wrap .nopasswd {
padding-bottom: 0; } padding-bottom: 0; }
.AP-preview .wrap .x-passwd { .AP-preview .wrap .x-passwd {
font-family: monospace; } font-family: monospace; }

@ -27,6 +27,8 @@ return [
'wifi.not_conn' => 'Not connected.', 'wifi.not_conn' => 'Not connected.',
'wifi.sta_none' => 'None', 'wifi.sta_none' => 'None',
'wifi.sta_active_pw' => '🔒', 'wifi.sta_active_pw' => '🔒',
'wifi.sta_active_nopw' => '🔓 Open access',
'wifi.connected_ip_is' => 'Connected, IP is ',
'wifi.submit' => 'Apply!', 'wifi.submit' => 'Apply!',
'wifi.scanning' => 'Scanning', 'wifi.scanning' => 'Scanning',

@ -73,6 +73,7 @@
<div class="inner"> <div class="inner">
<div class="essid"></div> <div class="essid"></div>
<div class="passwd"><?= tr('wifi.sta_active_pw') ?>&nbsp;<span class="x-passwd"></span></div> <div class="passwd"><?= tr('wifi.sta_active_pw') ?>&nbsp;<span class="x-passwd"></span></div>
<div class="nopasswd"><?= tr('wifi.sta_active_nopw') ?></div>
<div class="ip"></div> <div class="ip"></div>
</div> </div>
<a class="forget" id="forget-sta">×</a> <a class="forget" id="forget-sta">×</a>
@ -141,7 +142,8 @@
var nopw = undef(password) || password.length == 0; var nopw = undef(password) || password.length == 0;
$('#sta-nw .x-passwd').html(e(password)); $('#sta-nw .x-passwd').html(e(password));
$('#sta-nw .passwd').toggleClass('hidden', nopw); $('#sta-nw .passwd').toggleClass('hidden', nopw);
$('#sta-nw .ip').html(ip.length>0 ? 'IP = '+ip : '<?=tr('wifi.not_conn')?>'); $('#sta-nw .nopasswd').toggleClass('hidden', !nopw);
$('#sta-nw .ip').html(ip.length>0 ? '<?=tr('wifi.connected_ip_is')?>'+ip : '<?=tr('wifi.not_conn')?>');
} }
selectSta('%sta_ssid%', '%sta_password%', '%sta_active_ip%'); selectSta('%sta_ssid%', '%sta_password%', '%sta_active_ip%');
@ -149,12 +151,15 @@
var authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2']; var authStr = ['Open', 'WEP', 'WPA', 'WPA2', 'WPA/WPA2'];
var curSSID = '%sta_active_ssid%'; var curSSID = '%sta_active_ssid%';
function submitPskModal(e) { function submitPskModal(e, open) {
var passwd = $('#conn-passwd').val(); var passwd = $('#conn-passwd').val();
var ssid = $('#conn-ssid').val(); var ssid = $('#conn-ssid').val();
$('#sta_password').val(passwd);
$('#sta_ssid').val(ssid); if (open || passwd.length) {
selectSta(ssid, passwd, ''); $('#sta_password').val(passwd);
$('#sta_ssid').val(ssid);
selectSta(ssid, passwd, '');
}
if (e) e.preventDefault(); if (e) e.preventDefault();
Modal.hide('#psk-modal'); Modal.hide('#psk-modal');
@ -229,7 +234,7 @@
$('#conn-passwd')[0].focus(); $('#conn-passwd')[0].focus();
} else { } else {
//Modal.show('#reset-modal'); //Modal.show('#reset-modal');
submitPskModal(); submitPskModal(null, true);
} }
}); });

@ -34,18 +34,22 @@
// min-width: 10em; // min-width: 10em;
//} //}
// Submit Top Right
&.str { &.str {
position: relative; position: relative;
.Row.mq-phone { .Row.buttons {
position: absolute; position: absolute;
right: dist(0);
margin: 1rem auto; @include media($phone) {
} right: dist(0);
.Row.mq-no-phone { margin: 1rem auto;
position: absolute; }
right: 0;
top: 0; @include media($tablet-min) {
margin-top: dist(-1); right: 0;
top: 0;
margin-top: dist(-1);
}
} }
} }
} }

@ -173,7 +173,7 @@
} }
} }
.essid, .passwd { .essid, .passwd, .nopasswd {
padding-bottom: 0; padding-bottom: 0;
} }

Loading…
Cancel
Save