1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

Wifiparty feature now works with multissid

This commit is contained in:
Julien VAUBOURG 2015-05-02 16:54:12 +02:00
parent ba4253ff8f
commit 50522f8136
4 changed files with 40 additions and 28 deletions

View file

@ -120,24 +120,25 @@ span#wifiparty_ssid {
font-size: 70px;
}
div#wifiparty_passphrase {
div.wifiparty_passphrase {
clear: both;
font-size: 140px;
font-style: italic;
margin: 50px 20px;
word-wrap: break-word;
line-height: 0.9;
display: none;
}
div#wifiparty_passphrase span.passdigit {
div.wifiparty_passphrase span.passdigit {
color: #428BCA;
}
div#wifiparty_passphrase span.passother {
div.wifiparty_passphrase span.passother {
color: #D9534F;
}
div#wifiparty_passphrase span.passspace {
div.wifiparty_passphrase span.passspace {
color: #CCC;
}

View file

@ -130,7 +130,15 @@ $(document).ready(function() {
});
$('.wifiparty').click(function() {
$('#wifiparty_screen').show('slow');
var screen = $('#wifiparty_screen');
var passphrase = $(this).closest('.ssid').find('.wifiparty_passphrase').clone();
screen.find('#wifiparty_ssid span').last().text($(this).closest('.ssid').find('input[type=text]').first().val());
screen.find('.wifiparty_passphrase').remove();
screen.append(passphrase);
screen.find('.wifiparty_passphrase').show();
screen.show('slow');
});
$('#wifiparty_zoomin_ssid').mousedown(function() {
@ -142,11 +150,11 @@ $(document).ready(function() {
});
$('#wifiparty_zoomin_passphrase').mousedown(function() {
$('#wifiparty_passphrase').css('fontSize', (parseInt($('#wifiparty_passphrase').css('fontSize')) + 7) + "px");
$('#wifiparty_screen .wifiparty_passphrase').css('fontSize', (parseInt($('#wifiparty_screen .wifiparty_passphrase').css('fontSize')) + 7) + "px");
});
$('#wifiparty_zoomout_passphrase').mousedown(function() {
$('#wifiparty_passphrase').css('fontSize', (parseInt($('#wifiparty_passphrase').css('fontSize')) - 7) + "px");
$('#wifiparty_screen .wifiparty_passphrase').css('fontSize', (parseInt($('#wifiparty_screen .wifiparty_passphrase').css('fontSize')) - 7) + "px");
});
$('#wifiparty_close').click(function() {
@ -183,6 +191,8 @@ $(document).ready(function() {
clone.find('[data-toggle="tooltip"]').tooltip();
clone.find('.deletessid').click(deleteClick);
clone.find('.wifiparty_passphrase').remove();
clone.find('.wifiparty').attr('disabled', true);
clone.find('input[type=text]').each(function() {
if($(this).attr('name').match('dns')) {

View file

@ -95,5 +95,14 @@
<div class="deletessid" style="display: none">
<button type="button" class="btn btn-danger"><?= T_("Delete") ?></button>
</div>
<div class="wifiparty_passphrase"><?php
$pw = preg_replace('/[^0-9a-z ]/i', '<span-class="passother">$0</span>', $ssid['wifi_passphrase']);
$pw = preg_replace('/\d/', '<span-class="passdigit">$0</span>', $pw);
$pw = preg_replace('/ /', '<span class="passspace">&#x25AE;</span>', $pw);
$pw = preg_replace('/span-class/', 'span class', $pw);
echo $pw;
?></div>
</div>

View file

@ -18,28 +18,20 @@
-->
<div id="wifiparty_screen">
<div id="wifiparty_ssid_part">
<div id="wifiparty_ssid_part">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" id="wifiparty_close"><span class="glyphicon glyphicon-eye-close"></span></button>
<button type="button" class="btn btn-default" id="wifiparty_zoomin_ssid"><span class="glyphicon glyphicon-zoom-in"></span></button>
<button type="button" class="btn btn-default" id="wifiparty_zoomout_ssid"><span class="glyphicon glyphicon-zoom-out"></span></button>
</div>
<span id="wifiparty_ssid"><span class="glyphicon glyphicon-signal"></span> <?= $wifi_ssid ?></span>
</div>
<span id="wifiparty_ssid"><span class="glyphicon glyphicon-signal"></span> <span></span></span>
</div>
<div class="btn-group" role="group">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" id="wifiparty_zoomin_passphrase"><span class="glyphicon glyphicon-zoom-in"></span></button>
<button type="button" class="btn btn-default" id="wifiparty_zoomout_passphrase"><span class="glyphicon glyphicon-zoom-out"></span></button>
</div>
<div id="wifiparty_passphrase"><?php
$pw = preg_replace('/[^0-9a-z ]/i', '<span-class="passother">$0</span>', $wifi_passphrase);
$pw = preg_replace('/\d/', '<span-class="passdigit">$0</span>', $pw);
$pw = preg_replace('/ /', '<span class="passspace">&#x25AE;</span>', $pw);
$pw = preg_replace('/span-class/', 'span class', $pw);
echo $pw;
?></div>
</div>
</div>
<h2><?= T_("Wifi Hotspot Configuration") ?></h2>