From 50522f81360bb71138a1ab4acca078d8411d0124 Mon Sep 17 00:00:00 2001 From: Julien VAUBOURG Date: Sat, 2 May 2015 16:54:12 +0200 Subject: [PATCH] Wifiparty feature now works with multissid --- sources/public/css/style.css | 9 +++++---- sources/public/js/custom.js | 16 +++++++++++++--- sources/views/_ssid.html.php | 9 +++++++++ sources/views/settings.html.php | 34 +++++++++++++-------------------- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/sources/public/css/style.css b/sources/public/css/style.css index 3e31aed..d2f37aa 100644 --- a/sources/public/css/style.css +++ b/sources/public/css/style.css @@ -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; } diff --git a/sources/public/js/custom.js b/sources/public/js/custom.js index b91c54f..6d936c4 100644 --- a/sources/public/js/custom.js +++ b/sources/public/js/custom.js @@ -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')) { diff --git a/sources/views/_ssid.html.php b/sources/views/_ssid.html.php index c2955cf..a86d433 100644 --- a/sources/views/_ssid.html.php +++ b/sources/views/_ssid.html.php @@ -95,5 +95,14 @@ + +
$0', $ssid['wifi_passphrase']); + $pw = preg_replace('/\d/', '$0', $pw); + $pw = preg_replace('/ /', '', $pw); + $pw = preg_replace('/span-class/', 'span class', $pw); + + echo $pw; + ?>
diff --git a/sources/views/settings.html.php b/sources/views/settings.html.php index 0360144..c195c07 100644 --- a/sources/views/settings.html.php +++ b/sources/views/settings.html.php @@ -18,28 +18,20 @@ -->
-
-
- - - +
+
+ + + +
+ + +
+ +
+ +
- - -
- -
- - -
- -
$0', $wifi_passphrase); - $pw = preg_replace('/\d/', '$0', $pw); - $pw = preg_replace('/ /', '', $pw); - $pw = preg_replace('/span-class/', 'span class', $pw); - echo $pw; -?>