diff --git a/public/css/vroom.css b/public/css/vroom.css index 885fee7..92b17b3 100644 --- a/public/css/vroom.css +++ b/public/css/vroom.css @@ -147,6 +147,9 @@ #mainVideo { display: none; } +.hidden-form { + display: none; +} .actionMute:before{ font-family: 'Glyphicons Halflings'; content: "\e036"; diff --git a/public/js/vroom.js b/public/js/vroom.js index b55644c..be9d9b7 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -572,10 +572,12 @@ function initVroom(room) { if (data.join_auth == 'yes'){ $('#joinPassLabel').addClass('btn-danger active'); $('#joinPassButton').prop('checked', true); + $('#joinPassSet').bootstrapSwitch('state', true); } if (data.owner_auth == 'yes'){ $('#ownerPassLabel').addClass('btn-danger active'); $('#ownerPassButton').prop('checked', true); + $('#ownerPassSet').bootstrapSwitch('state', true); } } }); @@ -1402,11 +1404,13 @@ function initVroom(room) { $.notify(sprintf(locale.PASSWORD_PROTECT_ON_BY_s, stringEscape(who)), 'info'); $('#joinPassLabel').addClass('btn-danger active'); $('#joinPassButton').prop('checked', true); + $('#joinPassSet').bootstrapSwitch('state', true); } else{ $.notify(sprintf(locale.PASSWORD_PROTECT_OFF_BY_s, stringEscape(who)), 'info'); $('#joinPassLabel').removeClass('btn-danger active'); $('#joinPassButton').prop('checked', false); + $('#joinPassSet').bootstrapSwitch('state', true); } }); webrtc.on('owner_password', function(data){ @@ -1419,11 +1423,13 @@ function initVroom(room) { $.notify(sprintf(locale.OWNER_PASSWORD_CHANGED_BY_s, stringEscape(who)), 'info'); $('#ownerPassLabel').addClass('btn-danger active'); $('#ownerPassButton').prop('checked', true); + $('#ownerPassSet').bootstrapSwitch('state', true); } else{ $.notify(sprintf(locale.OWNER_PASSWORD_REMOVED_BY_s, stringEscape(who)), 'info'); $('#ownerPassLabel').removeClass('btn-danger active'); $('#ownerPassButton').prop('checked', false); + $('#ownerPassSet').bootstrapSwitch('state', false); } } else{ @@ -2003,6 +2009,24 @@ function initVroom(room) { } }); + // Hide or show password fields + $('#joinPassSet').on('switchChange.bootstrapSwitch', function(event, state) { + if (state){ + $('#joinPassFields').show(200); + } + else{ + $('#joinPassFields').hide(200); + } + }); + $('#ownerPassSet').on('switchChange.bootstrapSwitch', function(event, state) { + if (state){ + $('#ownerPassFields').show(200); + } + else{ + $('#ownerPassFields').hide(200); + } + }); + $('#ownerPassButton').change(function(){ var action = ($(this).is(':checked')) ? 'set':'unset'; if (action == 'set'){ diff --git a/templates/default/configure_modal.html.ep b/templates/default/configure_modal.html.ep new file mode 100644 index 0000000..c288a75 --- /dev/null +++ b/templates/default/configure_modal.html.ep @@ -0,0 +1,89 @@ +
+ diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index 4b05f70..2a26c0c 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -82,6 +82,12 @@ +