From 532b2710f0716968745bfe501dea42ffeb2c0e25 Mon Sep 17 00:00:00 2001 From: denise Date: Wed, 6 Jun 2012 13:10:57 -0400 Subject: [PATCH] CC-3932: Master/Source Source Connection URL should be in non-editable box -done --- .../forms/LiveStreamingPreferences.php | 4 +- .../scripts/form/preferences_livestream.phtml | 16 ++++--- airtime_mvc/public/css/styles.css | 4 ++ .../js/airtime/preferences/streamsetting.js | 47 ++++++++++--------- 4 files changed, 43 insertions(+), 28 deletions(-) diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index 91dfb3bec..f4e942e10 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -131,9 +131,11 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; $isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1; + $master_dj_connection_url = Application_Model_StreamSetting::GetConnectionUrls('master'); + $live_dj_connection_url = Application_Model_StreamSetting::GetConnectionUrls('show'); $this->setDecorators(array( - array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'isSaas' => $isSaas, 'isDemo' => $isDemo)) + array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isSaas' => $isSaas, 'isDemo' => $isDemo)) )); } diff --git a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml index f25a5abe8..bb8ac4f47 100644 --- a/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml +++ b/airtime_mvc/application/views/scripts/form/preferences_livestream.phtml @@ -94,13 +94,15 @@
- element->getElement('master_dj_connection_url') ?> + element->getElement('master_dj_connection_url')->setValue($this->master_dj_connection_url) ?> isSaas && !$this->isDemo){?> - override   + Override  
- +
isSaas ){?>
@@ -137,13 +139,15 @@
- element->getElement('live_dj_connection_url') ?> + element->getElement('live_dj_connection_url')->setValue($this->live_dj_connection_url) ?> isSaas && !$this->isDemo ){?> - override   + Override  
- +
diff --git a/airtime_mvc/public/css/styles.css b/airtime_mvc/public/css/styles.css index 4c2f735a2..7517bb2a0 100644 --- a/airtime_mvc/public/css/styles.css +++ b/airtime_mvc/public/css/styles.css @@ -386,6 +386,10 @@ fieldset.plain { box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2) inset; } +input[readonly]{ + background-color:#b1b1b1 +} + input[type="text"]:focus, input[type="password"]:focus, textarea:focus, .input_text_area:focus { border: 1px solid #0088f1; } diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index d453edefe..9ed14ff78 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -108,52 +108,57 @@ function checkLiquidsoapStatus(){ function setLiveSourceConnectionOverrideListener(){ $("[id=connection_url_override]").click(function(event){ - var div_ele = $(this).parent().find("div[id$='_dj_connection_url_tb']") - div_ele.find(":input").val("") - div_ele.show() + var url_input = $(this).parent().find("#stream_url").children() + url_input.removeAttr("readonly") + + $(this).parent().find("div[id$='_dj_connection_url_actions']").show() event.preventDefault() }) // set action for "OK" and "X" - var live_dj_input = $("#live_dj_connection_url_tb") - var live_dj_label = live_dj_input.parent().find("#stream_url") - var master_dj_input = $("#master_dj_connection_url_tb") - var master_dj_label = master_dj_input.parent().find("#stream_url") + var live_dj_actions = $("#live_dj_connection_url_actions") + var live_dj_input = live_dj_actions.parent().find("#stream_url").children() + var master_dj_actions = $("#master_dj_connection_url_actions") + var master_dj_input = master_dj_actions.parent().find("#stream_url").children() - live_dj_input.find("#ok").click(function(event){ + live_dj_actions.find("#ok").click(function(event){ event.preventDefault() - var url = $(this).parent().find(":input").val() - live_dj_label.html(url) - live_dj_input.hide() + var url = live_dj_input.val() + live_dj_input.val(url) + live_dj_input.attr("readonly", "readonly") + live_dj_actions.hide() $.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url)}); event.preventDefault() }) - live_dj_input.find("#reset").click(function(event){ + live_dj_actions.find("#reset").click(function(event){ event.preventDefault() var port = $("#dj_harbor_input_port").val() var mount = $("#dj_harbor_input_mount_point").val() var url = "http://"+location.hostname+":"+port+"/"+mount - live_dj_label.html(url) - live_dj_input.hide() + live_dj_input.val(url) + live_dj_input.attr("readonly", "readonly") + live_dj_actions.hide() $.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url)}); event.preventDefault() }) - master_dj_input.find("#ok").click(function(event){ - var url = $(this).parent().find(":input").val() - master_dj_label.html(url) - master_dj_input.hide() + master_dj_actions.find("#ok").click(function(event){ + var url = master_dj_input.val() + master_dj_input.val(url) + master_dj_input.attr("readonly", "readonly") + master_dj_actions.hide() $.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)}) event.preventDefault() }) - master_dj_input.find("#reset").click(function(event){ + master_dj_actions.find("#reset").click(function(event){ var port = $("#master_harbor_input_port").val() var mount = $("#master_harbor_input_mount_point").val() var url = "http://"+location.hostname+":"+port+"/"+mount - master_dj_label.html(url) - master_dj_input.hide() + master_dj_input.val(url) + master_dj_input.attr("readonly", "readonly") + master_dj_actions.hide() $.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url)}) event.preventDefault() })