From 755ec79e7deb3f2e2d2165f9bfcb329339e72f63 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 13 Jul 2015 15:17:47 -0400 Subject: [PATCH] SAAS-876 - frontend tweaks --- .../application/controllers/LocaleController.php | 3 +-- .../js/airtime/preferences/streamsetting.js | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php index 7d83a165e..31d899d48 100644 --- a/airtime_mvc/application/controllers/LocaleController.php +++ b/airtime_mvc/application/controllers/LocaleController.php @@ -171,8 +171,7 @@ class LocaleController extends Zend_Controller_Action "Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."), "If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."), "If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."), - "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted." - => _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."), + "WARNING: This will restart your stream and may cause a short dropout for your listeners!" => _("WARNING: This will restart your stream and may cause a short dropout for your listeners!"), "This is the admin username and password for Icecast/SHOUTcast to get listener statistics." => _("This is the admin username and password for Icecast/SHOUTcast to get listener statistics."), //preferences/support-setting.js "Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"), diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index 2a18a4aaa..7cc65f40a 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -468,9 +468,12 @@ $(document).ready(function() { setupEventListeners(); setSliderForReplayGain(); getAdminPasswordStatus(); - - $("[id^='stream_save']").live('click', function(){ - var confirm_pypo_restart_text = sprintf($.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If %s is recording, and if the change causes a playout engine restart, the recording will be interrupted."), PRODUCT_NAME); + var s = $("[name^='customStreamSettings']:checked"); + + $("[id^='stream_save'], [name^='customStreamSettings']").live('click', function() { + var e = $(this); + if (e[0] == s[0]) { return; } + var confirm_pypo_restart_text = $.i18n._("WARNING: This will restart your stream and may cause a short dropout for your listeners!"); if (confirm(confirm_pypo_restart_text)) { var data = $('#stream_form').serialize(); var url = baseUrl+'Preference/stream-setting'; @@ -482,6 +485,13 @@ $(document).ready(function() { //setSliderForReplayGain(); //setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass, json.s4_set_admin_pass); }); + } else { + if (e.prop('checked')) { + if (e[0] != s[0]) { + e.prop('checked', false); + s.prop('checked', true); + } + } } }); });